/* Final brand and layout layer.
   Copper identifies Seelaz actions and selection. Semantic colors are reserved
   for operational state: green success, amber attention, red failure, blue info. */

/* Customer-supplied Arabic (names, addresses, phones) renders inside LTR chrome.
   dir="auto" picks the base direction from the content; unicode-bidi:plaintext
   keeps each value on its own bidi paragraph so it never reorders visually. */
[dir="auto"] { unicode-bidi: plaintext; }

/* Inline validation: a rejected field is outlined in burgundy (the approved palette's
   alert tone) with a small note beneath it, so the fix is visible after the toast fades. */
.input-error,
input.input-error,
textarea.input-error,
select.input-error {
  border-color: var(--sem-danger, #6B2D3A) !important;
  box-shadow: 0 0 0 3px var(--sz-error-ring, rgba(107, 45, 58, 0.14)) !important;
}
.input-error-note {
  display: block;
  margin-top: 5px;
  color: var(--sem-danger, #6B2D3A);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

:root {
  --dashboard-bg: #f6f5f2;
  --dashboard-surface: #faf6ee;
  --dashboard-subtle: #f8f6f3;
  --dashboard-line: #e5e0da;
  --dashboard-text: #211c18;
  --dashboard-muted: #756e68;
  --dashboard-copper: #b15a2f;
  --dashboard-green: #657956;
  --dashboard-green-soft: #eaf6f0;
}

html[data-theme="dark"] {
  --dashboard-bg: #151412;
  --dashboard-surface: #1d1b19;
  --dashboard-subtle: #26231f;
  --dashboard-line: #3a352f;
  --dashboard-text: #f4f1ed;
  --dashboard-muted: #aaa29a;
  --dashboard-copper: #e27449;
  --dashboard-green-soft: #193129;
}

.sidebar {
  background: rgba(255, 255, 255, 0.9);
}

.nav-list a .nav-icon,
.module-icon {
  color: var(--dashboard-muted);
  background: transparent;
}

.nav-list a.active,
.entity-list-item.active,
.workspace-tab.active,
.editor-tab.active,
.order-commerce-row.selected {
  color: var(--dashboard-text);
  border-color: #efd2c3;
  background: #fff1e9;
}

.nav-list a.active .nav-icon,
.module-card:hover .module-icon {
  color: var(--dashboard-copper);
  background: #fdfbf6;
}

.order-commerce-row.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--dashboard-copper);
}

.saved-view-tabs button.active,
.campaign-view-tabs button.active,
.theme-mode-control button.active {
  border-color: #efd2c3;
  background: #fff8f4;
  color: var(--dashboard-copper);
}

.campaign-row.active {
  border-color: #efd2c3;
  background: #fff8f4;
}

html[data-theme="dark"] .sidebar {
  background: rgba(29, 27, 25, 0.92);
}

html[data-theme="dark"] .nav-list a {
  color: #b9b1aa;
}

html[data-theme="dark"] .nav-list a .nav-icon {
  color: #a29a93;
}

html[data-theme="dark"] .nav-section-label {
  color: #8f8881;
}

html[data-theme="dark"] .side-note {
  border-color: #285846;
  background: #183128;
  color: #83daba;
}

html[data-theme="dark"] .side-note strong {
  color: #83daba;
}

html[data-theme="dark"] :is(.nav-list a.active, .entity-list-item.active, .workspace-tab.active, .editor-tab.active, .order-commerce-row.selected, .campaign-row.active) {
  border-color: #65402f;
  background: #35251e;
  color: var(--dashboard-text);
}

html[data-theme="dark"] :is(.saved-view-tabs button.active, .campaign-view-tabs button.active, .theme-mode-control button.active) {
  border-color: #65402f;
  background: #35251e;
  color: var(--dashboard-copper);
}

#growth > .metrics-grid.wide {
  grid-column: 1 / -1;
  width: 100%;
}

.orders-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  align-items: start;
  gap: 12px;
}

.orders-workspace-grid .order-commerce-panel {
  min-width: 0;
  margin: 0;
}

.orders-workspace-grid .order-commerce-wrap {
  min-height: 430px;
  max-height: calc(100vh - 315px);
}

.orders-workspace-grid .order-detail-drawer {
  position: sticky;
  top: 102px;
  grid-template-columns: minmax(0, 1fr);
  max-height: calc(100vh - 122px);
  overflow: auto;
}

.order-detail-drawer > * {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.order-detail-drawer .order-command-bar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-detail-drawer .order-command-bar .control-field {
  grid-column: 1 / -1;
}

.order-detail-drawer .order-command-bar .button,
.order-detail-drawer .after-sales-form .button {
  width: 100%;
}

.order-detail-drawer .detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-detail-drawer .fulfillment-decision-card,
.order-detail-drawer .order-work-grid,
.order-detail-drawer .after-sales-form {
  grid-template-columns: minmax(0, 1fr);
}

.order-detail-drawer .dispatch-card,
.order-detail-drawer .dispatch-controls {
  align-items: stretch;
  flex-direction: column;
}

.order-detail-drawer .dispatch-controls select {
  width: 100%;
  min-width: 0;
}

.order-list-compat {
  display: none;
}

@media (max-width: 1320px) {
  .orders-workspace-grid {
    grid-template-columns: 1fr;
  }

  .orders-workspace-grid .order-detail-drawer {
    position: relative;
    top: 0;
    max-height: none;
  }
}

/* Operations V2: the overview is a decision surface, not a second navigation. */
.overview-secondary {
  display: none !important;
}

#overview .metrics-grid {
  margin-bottom: 12px;
}

#overview .metric-card[data-metric="activeOrders"],
#overview .metric-card[data-metric="revenueToday"],
#overview .metric-card[data-metric="activeCustomersNow"] {
  border-left-color: var(--sem-info);
}

#overview .metric-card[data-metric="openBranches"] {
  border-left-color: var(--sem-success);
}

#overview .metric-card[data-metric="activeOrders"] span,
#overview .metric-card[data-metric="revenueToday"] span,
#overview .metric-card[data-metric="activeCustomersNow"] span {
  color: var(--sem-info);
}

#overview .metric-card[data-metric="openBranches"] span {
  color: var(--sem-success);
}

.control-tower-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(260px, 0.82fr);
  margin-bottom: 0;
}

.control-panel {
  min-height: 0;
}

.ops-task,
.readiness-row,
.experience-priority {
  min-height: 62px;
  padding: 9px;
}

.finance-card {
  min-height: 66px;
  padding: 9px;
}

.ops-task {
  border-left-color: var(--sem-info);
}

.ops-task.high {
  border-left-color: var(--sem-danger);
}

.ops-task.medium {
  border-left-color: var(--sem-warning);
}

/* The order desk keeps the queue scannable while the selected order stays editable. */
.orders-workspace-grid {
  grid-template-columns: minmax(0, 1fr) minmax(380px, 410px);
}

.orders-workspace-grid .order-commerce-wrap {
  min-height: 390px;
  max-height: calc(100vh - 300px);
}

.order-commerce-table {
  min-width: 760px;
  table-layout: fixed;
}

.order-commerce-table th:nth-child(1) { width: 17%; }
.order-commerce-table th:nth-child(2) { width: 18%; }
.order-commerce-table th:nth-child(3) { width: 22%; }
.order-commerce-table th:nth-child(4) { width: 16%; }
.order-commerce-table th:nth-child(5) { width: 16%; }
.order-commerce-table th:nth-child(6) { width: 11%; }

.order-commerce-row td {
  vertical-align: middle;
}

.order-commerce-row td strong,
.order-commerce-row td small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-commerce-row td small {
  white-space: nowrap;
}

.order-detail-drawer {
  padding: 12px;
}

.order-detail-drawer .editor-hero {
  border: 0;
  border-bottom: 1px solid var(--dashboard-line);
  border-radius: 0;
  background: transparent;
  padding: 4px 0 12px;
}

.order-detail-drawer .order-command-bar {
  margin: 10px 0 0;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--dashboard-line);
  border-radius: 0;
  background: transparent;
}

.order-detail-drawer .detail-grid {
  margin-top: 0;
  gap: 0;
}

.order-detail-drawer .detail-grid > div {
  min-height: 66px;
  border: 0;
  border-bottom: 1px solid var(--dashboard-line);
  border-radius: 0;
  background: transparent;
}

.order-detail-drawer .fulfillment-decision-card,
.order-detail-drawer .dispatch-card,
.order-detail-drawer .detail-section,
.order-detail-drawer .order-note-strip {
  margin-top: 0;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--dashboard-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.order-detail-drawer .dispatch-person img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

/* Customer 360: one source of truth, then context and history. */
#customers .operations-shell {
  grid-template-columns: 276px minmax(0, 1fr);
}

#customerDetail {
  padding: 12px;
}

#customerDetail .editor-hero {
  border: 0;
  border-bottom: 1px solid var(--dashboard-line);
  border-radius: 0;
  background: transparent;
  padding: 4px 0 12px;
}

.customer-command-bar {
  min-height: 46px;
  justify-content: flex-end;
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--dashboard-line);
}

.customer-command-bar .status-pill {
  margin-right: auto;
}

.customer-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.customer-summary-grid > div {
  min-height: 72px;
  border: 0;
  border-bottom: 1px solid var(--dashboard-line);
  border-radius: 0;
  background: transparent;
}

.customer-summary-grid > div:not(:nth-child(3n)) {
  border-right: 1px solid var(--dashboard-line);
}

.customer-context-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--dashboard-line);
}

.customer-context-strip > div {
  min-width: 0;
  padding: 11px;
}

.customer-context-strip > div:not(:last-child) {
  border-right: 1px solid var(--dashboard-line);
}

.customer-context-strip span,
.customer-context-strip strong,
.customer-context-strip small {
  display: block;
}

.customer-context-strip span {
  color: var(--dashboard-muted);
  font-size: 11px;
  font-weight: 750;
}

.customer-context-strip strong {
  margin-top: 5px;
  overflow: hidden;
  color: var(--dashboard-text);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
}

.customer-context-strip small {
  margin-top: 4px;
  color: var(--dashboard-muted);
  font-size: 11px;
  line-height: 1.35;
}

#customerDetail .customer-cart-alert {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--sem-warning-border);
  border-radius: 0;
}

#customerDetail .detail-columns {
  gap: 0;
}

#customerDetail .detail-section {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--dashboard-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html[data-theme="dark"] :is(.order-detail-drawer .editor-hero, .order-detail-drawer .order-command-bar, .order-detail-drawer .detail-grid > div, .order-detail-drawer .fulfillment-decision-card, .order-detail-drawer .dispatch-card, .order-detail-drawer .detail-section, .order-detail-drawer .order-note-strip, #customerDetail .editor-hero, .customer-summary-grid > div, #customerDetail .detail-section) {
  background: transparent;
}

@media (max-width: 1500px) {
  .customer-context-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-context-strip > div:nth-child(2) {
    border-right: 0;
  }

  .customer-context-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--dashboard-line);
  }
}

@media (max-width: 1180px) {
  .control-tower-grid,
  .orders-workspace-grid {
    grid-template-columns: 1fr;
  }

  .orders-workspace-grid .order-detail-drawer {
    position: relative;
    top: 0;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .customer-summary-grid,
  .customer-context-strip {
    grid-template-columns: 1fr;
  }

  .customer-summary-grid > div,
  .customer-context-strip > div {
    border-right: 0 !important;
    border-bottom: 1px solid var(--dashboard-line);
  }
}

/* Dashboard concept: calm health-data hierarchy adapted to live Seelaz operations. */
body[data-page="overview"] {
  --overview-ink: #161b18;
  --overview-muted: #748078;
  --overview-line: rgba(26, 44, 34, 0.09);
  --overview-shadow: 0 18px 45px rgba(31, 45, 37, 0.08), 0 2px 8px rgba(31, 45, 37, 0.04);
  background: #f7f9f8;
}

body[data-page="overview"] .main {
  padding-right: 32px;
  padding-left: 32px;
}

body[data-page="overview"] .topbar {
  min-height: 86px;
  margin-bottom: 24px;
  border-bottom-color: transparent;
  background: rgba(247, 249, 248, 0.86);
}

body[data-page="overview"] .topbar h1 {
  font-size: 27px;
  font-weight: 760;
}

body[data-page="overview"] .sidebar {
  border-right-color: rgba(26, 44, 34, 0.07);
  background: rgba(255, 255, 255, 0.94);
}

.overview-canvas {
  max-width: 1480px;
  margin: 0 auto;
}

.overview-lead-grid {
  display: grid;
  grid-template-columns: minmax(380px, 0.9fr) minmax(560px, 1.35fr);
  gap: 18px;
  margin-bottom: 30px;
}

.operations-pulse-card {
  position: relative;
  min-height: 326px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 24px;
  color: #122018;
  background:
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.62), transparent 27%),
    linear-gradient(145deg, #ffd7ad 0%, #f2df8c 27%, #a9dc8b 58%, #47a86f 100%);
  box-shadow: 0 26px 54px rgba(56, 112, 75, 0.17), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.operations-pulse-card::after {
  content: "";
  position: absolute;
  right: -10%;
  bottom: -32%;
  width: 68%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, 0.05), 0 0 0 56px rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.pulse-card-head,
.pulse-score-row,
.pulse-card-foot {
  position: relative;
  z-index: 1;
}

.pulse-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pulse-card-head p,
.pulse-card-head span,
.pulse-card-foot span,
.pulse-status-copy span {
  margin: 0;
  font-size: 11px;
  font-weight: 720;
}

.pulse-card-head p {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 820;
}

.pulse-card-head > div > span,
.pulse-status-copy span,
.pulse-card-foot span {
  color: rgba(18, 32, 24, 0.63);
}

.pulse-live {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.27);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.pulse-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10724a;
  box-shadow: 0 0 0 4px rgba(16, 114, 74, 0.12);
}

.pulse-score-row {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin-top: 28px;
}

.pulse-score {
  display: flex;
  align-items: flex-start;
  line-height: 1;
}

.pulse-score strong {
  font-size: 64px;
  font-weight: 560;
  letter-spacing: 0;
}

.pulse-score sup {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 720;
}

.pulse-status-copy {
  display: grid;
  gap: 5px;
  padding-bottom: 8px;
}

.pulse-status-copy strong {
  font-size: 16px;
  font-weight: 800;
}

.pulse-wave {
  position: relative;
  z-index: 1;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 16px 0 18px;
}

.pulse-wave i {
  width: 4px;
  height: var(--bar);
  min-height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 3px 12px rgba(31, 101, 62, 0.1);
}

.pulse-card-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.38);
}

.pulse-card-foot div {
  display: grid;
  gap: 6px;
}

.pulse-card-foot strong {
  font-size: 19px;
  font-weight: 820;
}

.overview-kpi-column {
  min-width: 0;
  padding: 4px 0;
}

.overview-kpi-head {
  min-height: 46px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.overview-kpi-head h2 {
  font-size: 20px;
  font-weight: 760;
}

.overview-kpi-head a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 0;
  color: var(--overview-muted);
  font-size: 11px;
  font-weight: 760;
  text-decoration: none;
}

#overview .overview-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

#overview .overview-metrics .metric-card {
  min-height: 126px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--overview-line);
  border-left: 1px solid var(--overview-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--overview-shadow);
}

#overview .overview-metrics .metric-card span {
  color: var(--overview-muted);
  font-size: 11px;
  font-weight: 720;
}

#overview .overview-metrics .metric-card strong {
  margin-top: auto;
  color: var(--overview-ink);
  font-size: 30px;
  font-weight: 650;
}

#overview .overview-metrics .metric-card small {
  margin-top: 7px;
  color: #98a19c;
  font-size: 11px;
}

#overview .overview-section-head {
  margin: 0 0 13px;
}

#overview .overview-section-head h2 {
  font-size: 20px;
  font-weight: 760;
}

#overview .control-tower-grid {
  gap: 14px;
}

#overview .control-panel {
  padding: 18px;
  border: 1px solid var(--overview-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--overview-shadow);
}

#overview .panel-head h2 {
  font-size: 16px;
  font-weight: 780;
}

#overview :is(.ops-task, .readiness-row, .finance-card, .finance-check) {
  border-color: rgba(26, 44, 34, 0.075);
  border-radius: 12px;
  background: #fafcfb;
}

#overview .ops-task {
  border-left-width: 3px;
}

#overview :is(.button, .status-pill, .count-pill, .chip) {
  border-radius: 999px;
}

html[data-theme="dark"] body[data-page="overview"] {
  --overview-ink: #f2f5f3;
  --overview-muted: #9aa69f;
  --overview-line: rgba(255, 255, 255, 0.08);
  --overview-shadow: 0 18px 46px rgba(0, 0, 0, 0.2);
  background: #121513;
}

html[data-theme="dark"] body[data-page="overview"] .topbar {
  background: rgba(18, 21, 19, 0.86);
}

html[data-theme="dark"] #overview :is(.overview-metrics .metric-card, .control-panel) {
  background: #1b201d;
}

html[data-theme="dark"] #overview :is(.ops-task, .readiness-row, .finance-card, .finance-check) {
  background: #202622;
}

@media (max-width: 1180px) {
  .overview-lead-grid {
    grid-template-columns: 1fr;
  }

  .operations-pulse-card {
    min-height: 300px;
  }
}

@media (max-width: 760px) {
  body[data-page="overview"] .main {
    padding-right: 14px;
    padding-left: 14px;
  }

  .overview-lead-grid,
  #overview .overview-metrics {
    grid-template-columns: 1fr;
  }

  .operations-pulse-card {
    min-height: 330px;
    padding: 20px;
    border-radius: 20px;
  }

  .pulse-score strong {
    font-size: 54px;
  }

  .overview-kpi-head {
    align-items: flex-end;
  }
}

/* Notifications are operational communication: green means eligible, blue is
   delivery information, amber needs attention, and red is reserved for blocks. */
.panel-copy {
  margin: 5px 0 0;
  color: var(--dashboard-muted);
  font-size: 12px;
}

.notification-center-panel {
  grid-column: 1 / -1;
}

.notification-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 -18px;
  border-top: 1px solid var(--dashboard-line);
  border-bottom: 1px solid var(--dashboard-line);
}

.notification-metrics > div {
  min-width: 0;
  padding: 13px 18px;
  border-right: 1px solid var(--dashboard-line);
}

.notification-metrics > div:last-child {
  border-right: 0;
}

.notification-metrics span,
.notification-metrics small {
  display: block;
  color: var(--dashboard-muted);
  font-size: 11px;
  font-weight: 700;
}

.notification-metrics strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--sem-success);
  font-size: 22px;
}

.notification-metrics > div:nth-child(n + 3) strong {
  color: var(--sem-info);
}

.notification-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  min-height: 390px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: var(--dashboard-surface);
}

.notification-composer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 13px;
  padding: 18px;
}

.notification-composer .field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  color: var(--dashboard-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.notification-composer :is(input, textarea, select) {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--dashboard-line);
  border-radius: 7px;
  background: var(--dashboard-surface);
  color: var(--dashboard-text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-transform: none;
}

.notification-composer :is(input, textarea) {
  padding: 10px 11px;
}

.notification-composer select {
  padding: 0 10px;
}

.notification-composer :is(input, textarea, select):focus {
  outline: 2px solid color-mix(in srgb, var(--dashboard-copper) 18%, transparent);
  border-color: var(--dashboard-copper);
}

.notification-composer .field-wide,
.notification-send-row {
  grid-column: 1 / -1;
}

.notification-composer textarea {
  min-height: 94px;
  resize: vertical;
}

.notification-send-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
}

.notification-send-row p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--dashboard-muted);
  font-size: 11px;
  line-height: 1.5;
}

.notification-send-row p .ion {
  color: var(--sem-success);
  font-size: 16px;
}

.notification-log-panel {
  min-width: 0;
  padding: 16px;
  border-left: 1px solid var(--dashboard-line);
  background: var(--dashboard-subtle);
}

.notification-log-head,
.notification-log-head > div,
.notification-log-copy > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-log-head > div {
  display: block;
}

.notification-log-head h3 {
  margin: 3px 0 0;
  color: var(--dashboard-text);
  font-size: 16px;
}

.notification-delivery-log {
  margin-top: 12px;
}

.notification-log-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--dashboard-line);
}

.notification-log-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--sem-info);
  background: var(--sem-info-bg);
}

.notification-log-icon.success {
  color: var(--sem-success);
  background: var(--sem-success-bg);
}

.notification-log-icon.warning {
  color: var(--sem-warning);
  background: var(--sem-warning-bg);
}

.notification-log-icon.danger {
  color: var(--sem-danger);
  background: var(--sem-danger-bg);
}

/* Pumo character avatar inside the notification preview + log rows. Keeps the old chip
   footprint but renders it as a round photo well (object-fit: cover). */
.preview-app-icon-pumo,
.notification-log-icon-pumo {
  border-radius: 50%;
  overflow: hidden;
  padding: 0;
  background: var(--sem-info-bg, rgba(32, 47, 40, 0.06));
}

.preview-app-icon-pumo img,
.notification-log-icon-pumo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.notification-log-copy {
  min-width: 0;
}

.notification-log-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--dashboard-text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-log-copy p,
.notification-log-copy small {
  display: block;
  margin: 3px 0 0;
  color: var(--dashboard-muted);
  font-size: 11px;
  line-height: 1.45;
}

.notification-log-copy .chip {
  flex: 0 0 auto;
}

html[data-theme="dark"] .notification-workspace,
html[data-theme="dark"] .notification-composer,
html[data-theme="dark"] .notification-log-panel {
  background: var(--dashboard-surface);
}

html[data-theme="dark"] .notification-log-panel {
  background: var(--dashboard-subtle);
}

@media (max-width: 1100px) {
  .notification-workspace {
    grid-template-columns: 1fr;
  }

  .notification-log-panel {
    border-top: 1px solid var(--dashboard-line);
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .notification-metrics,
  .notification-composer {
    grid-template-columns: 1fr;
  }

  .notification-metrics > div {
    border-right: 0;
    border-bottom: 1px solid var(--dashboard-line);
  }

  .notification-metrics > div:last-child {
    border-bottom: 0;
  }

  .notification-send-row {
    align-items: stretch;
    flex-direction: column;
  }

  .notification-send-row .button {
    width: 100%;
  }
}

/* Stable workspace sizing: data may scroll inside its own surface, never over
   neighboring panels or outside the dashboard canvas. */
html,
body,
.app-shell,
.main,
.page,
.management-shell,
.entity-list-panel,
.entity-editor-panel,
.panel,
.detail-section,
.studio-editor-pane,
.studio-preview-pane {
  min-width: 0;
  max-width: 100%;
}

html,
body {
  overflow-x: hidden;
}

.page.active {
  width: 100%;
}

:is(.control-field, .studio-field, .field) :is(input, select, textarea),
.editor-form-grid > *,
.detail-grid > *,
.content-grid > * {
  min-width: 0;
  max-width: 100%;
}

:is(.editor-title-group, .detail-grid, .customer-context-strip, .customer-summary-grid, .notification-log-copy) :is(strong, p, small, span) {
  overflow-wrap: anywhere;
}

.order-commerce-wrap,
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.order-commerce-table {
  min-width: 680px;
}

.workspace-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

/* No-code automation builder */
.automation-builder {
  padding-top: 14px;
}

.automation-sentence {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--sem-info-border);
  border-radius: 8px;
  background: var(--sem-info-bg);
}

.automation-sentence > .ion {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--dashboard-surface);
  color: var(--sem-info);
  font-size: 17px;
}

.automation-sentence p {
  margin: 0;
  color: var(--dashboard-text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.55;
}

.automation-builder-flow {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 20px minmax(180px, 0.9fr) 20px minmax(180px, 1fr);
  align-items: stretch;
  gap: 8px;
  margin-bottom: 14px;
}

.automation-step {
  position: relative;
  min-width: 0;
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 7px;
  margin: 0;
  padding: 14px 12px 12px;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: var(--dashboard-subtle);
}

.automation-step-number {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff1e9;
  color: var(--dashboard-copper);
  font-size: 11px;
  font-weight: 900;
}

.automation-step > small {
  color: var(--dashboard-copper);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.automation-step .control-field {
  gap: 0;
  margin: 0;
}

.automation-step .control-field > label {
  display: none;
}

.automation-step :is(input, select) {
  min-height: 38px;
  border-radius: 7px;
  background: var(--dashboard-surface);
  font-size: 11px;
}

.delay-control {
  display: grid;
  grid-template-columns: minmax(70px, 0.65fr) minmax(100px, 1fr);
  gap: 7px;
}

.automation-connector {
  align-self: center;
  color: var(--dashboard-copper);
  font-size: 17px;
  text-align: center;
}

.automation-basics {
  padding: 13px;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
}

.automation-channel-readonly {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--dashboard-line);
  border-radius: 7px;
  background: var(--dashboard-subtle);
}

.automation-channel-readonly span,
.automation-channel-readonly small {
  color: var(--dashboard-muted);
  font-size: 11px;
  font-weight: 700;
}

.automation-channel-readonly strong {
  color: var(--dashboard-text);
  font-size: 12px;
}

.automation-condition-list {
  display: grid;
  gap: 7px;
}

.automation-condition-row {
  display: grid;
  grid-template-columns: 28px minmax(145px, 1.15fr) minmax(125px, 0.9fr) minmax(110px, 0.8fr) 34px;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: var(--dashboard-surface);
}

.condition-number {
  align-self: center;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--dashboard-green-soft);
  color: var(--sem-success);
  font-size: 11px;
  font-weight: 900;
}

.automation-condition-row > label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.automation-condition-row > label > span {
  color: var(--dashboard-muted);
  font-size: 11px;
  font-weight: 750;
}

.automation-condition-row :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid var(--dashboard-line);
  border-radius: 7px;
  background: var(--dashboard-surface);
  color: var(--dashboard-text);
  font-size: 11px;
}

.automation-safety-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 11px;
  border-left: 3px solid var(--sem-success);
  background: var(--sem-success-bg);
}

.automation-safety-note > .ion {
  color: var(--sem-success);
  font-size: 17px;
}

.automation-safety-note strong,
.automation-safety-note p {
  display: block;
  margin: 0;
}

.automation-safety-note strong {
  color: var(--dashboard-text);
  font-size: 11px;
}

.automation-safety-note p {
  margin-top: 3px;
  color: var(--dashboard-muted);
  font-size: 11px;
  line-height: 1.45;
}

/* App Studio */
.app-studio-view-tabs {
  display: inline-flex;
  gap: 3px;
  margin-bottom: 10px;
  padding: 3px;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
}

.app-studio-view-tabs button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dashboard-muted);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.app-studio-view-tabs button.active {
  background: #fff1e9;
  color: var(--dashboard-copper);
}

.app-studio-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 350px;
  min-height: 690px;
  overflow: hidden;
  border: 1px solid var(--dashboard-line);
  border-radius: 10px;
  background: var(--dashboard-surface);
}

.app-studio-shell.studio-single-editor {
  grid-template-columns: minmax(0, 1fr) 350px;
}

.studio-pages-pane,
.studio-editor-pane,
.studio-preview-pane {
  min-height: 690px;
  padding: 14px;
}

.studio-pages-pane {
  border-right: 1px solid var(--dashboard-line);
  background: var(--dashboard-subtle);
}

.studio-editor-pane {
  overflow: auto;
}

.studio-preview-pane {
  border-left: 1px solid var(--dashboard-line);
  background: #efefec;
}

.studio-pane-head,
.studio-editor-head,
.studio-inspector-head,
.studio-section-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.studio-pane-head {
  min-height: 48px;
  padding-bottom: 10px;
}

.studio-pane-head h3,
.studio-editor-head h2,
.studio-inspector-head h3,
.studio-section-toolbar h3 {
  margin: 2px 0 0;
  color: var(--dashboard-text);
}

.studio-pane-head h3,
.studio-inspector-head h3,
.studio-section-toolbar h3 {
  font-size: 14px;
}

.studio-editor-head {
  min-height: 64px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--dashboard-line);
}

.studio-editor-head h2 {
  font-size: 20px;
}

.studio-editor-head p,
.studio-section-toolbar p {
  margin: 4px 0 0;
  color: var(--dashboard-muted);
  font-size: 11px;
  line-height: 1.45;
}

.studio-page-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--dashboard-muted);
  font-size: 11px;
  font-weight: 800;
}

.studio-page-list,
.studio-section-list,
.studio-navigation-list,
.studio-color-list {
  display: grid;
  gap: 6px;
}

.studio-page-row {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 8px;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--dashboard-text);
  text-align: left;
  cursor: pointer;
}

.studio-page-row:hover {
  background: var(--dashboard-surface);
}

.studio-page-row.active {
  border-color: #efd2c3;
  background: #fff1e9;
}

.studio-page-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--dashboard-surface);
  color: var(--dashboard-copper);
  font-size: 15px;
}

.studio-page-row strong,
.studio-page-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-page-row strong {
  font-size: 11px;
}

.studio-page-row small {
  margin-top: 3px;
  color: var(--dashboard-muted);
  font-size: 11px;
}

.studio-page-row > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9b2ac;
}

.studio-page-row > i.online {
  background: var(--sem-success);
}

.studio-page-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--dashboard-line);
}

.studio-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.studio-field > span {
  color: var(--dashboard-muted);
  font-size: 11px;
  font-weight: 800;
}

.studio-field :is(input, textarea, select),
.studio-section-toolbar select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--dashboard-line);
  border-radius: 7px;
  background: var(--dashboard-surface);
  color: var(--dashboard-text);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
}

.studio-field textarea {
  min-height: 76px;
  padding: 9px 10px;
  line-height: 1.45;
  resize: vertical;
}

.studio-section-toolbar {
  align-items: center;
  padding: 13px 0 9px;
}

.studio-section-toolbar > div:last-child {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 6px;
}

.studio-section-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--dashboard-line);
  border-radius: 7px;
  background: var(--dashboard-surface);
}

.studio-section-row.active {
  border-color: #efd2c3;
  box-shadow: inset 3px 0 0 var(--dashboard-copper);
}

.studio-section-select {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 0;
  background: transparent;
  color: var(--dashboard-text);
  text-align: left;
  cursor: pointer;
}

.studio-section-select strong,
.studio-section-select small {
  display: block;
}

.studio-section-select strong {
  font-size: 11px;
}

.studio-section-select small {
  margin-top: 3px;
  color: var(--dashboard-muted);
  font-size: 11px;
}

.studio-section-grip,
.studio-nav-grip {
  color: #aca49d;
  font-size: 15px;
}

.studio-section-actions,
.studio-navigation-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  padding-right: 7px;
}

.mini-switch {
  position: relative;
  width: 32px;
  height: 20px;
  display: inline-block;
}

.mini-switch input {
  position: absolute;
  opacity: 0;
}

.mini-switch > span {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: #c9c3bd;
  cursor: pointer;
}

.mini-switch > span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fdfbf6;
  transition: transform 0.16s ease;
}

.mini-switch input:checked + span {
  background: var(--sem-success);
}

.mini-switch input:checked + span::after {
  transform: translateX(12px);
}

.studio-inspector,
.studio-copy-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--dashboard-line);
}

.studio-inspector-head {
  align-items: center;
  margin-bottom: 10px;
}

.studio-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.studio-field-grid .span-all {
  grid-column: 1 / -1;
}

.studio-color-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 94px;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 8px 0;
  border-bottom: 1px solid var(--dashboard-line);
}

.studio-color-row input[type="color"] {
  width: 40px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: var(--dashboard-surface);
  cursor: pointer;
}

.studio-color-row input[type="text"] {
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--dashboard-line);
  border-radius: 7px;
  background: var(--dashboard-surface);
  color: var(--dashboard-text);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.studio-color-row strong,
.studio-color-row small {
  display: block;
}

.studio-color-row strong {
  color: var(--dashboard-text);
  font-size: 11px;
}

.studio-color-row small {
  margin-top: 4px;
  color: var(--dashboard-muted);
  font-size: 11px;
  line-height: 1.4;
}

.studio-navigation-row {
  display: grid;
  grid-template-columns: 22px 34px minmax(120px, 1fr) minmax(120px, 0.8fr) auto;
  align-items: end;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
}

.studio-nav-icon {
  align-self: center;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff1e9;
  color: var(--dashboard-copper);
  font-size: 16px;
}

.studio-navigation-actions {
  align-self: center;
  padding: 0;
}

.studio-nav-warning {
  display: flex;
  gap: 9px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--sem-warning-border);
  border-radius: 8px;
  background: var(--sem-warning-bg);
  color: var(--sem-warning);
}

.studio-nav-warning p {
  margin: 0;
  color: var(--dashboard-text);
  font-size: 11px;
  line-height: 1.45;
}

.studio-preview {
  min-height: 620px;
  display: grid;
  place-items: start center;
  padding-top: 5px;
}

.studio-phone {
  --studio-primary: #b15a2f;
  --studio-accent: #eaba5c;
  --studio-success: #657956;
  --studio-bg: #f7f6f3;
  --studio-surface: #faf6ee;
  --studio-text: #211c18;
  position: relative;
  width: min(286px, 100%);
  height: 590px;
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr) 54px;
  overflow: hidden;
  border: 7px solid #171614;
  border-radius: 34px;
  background: var(--studio-bg);
  color: var(--studio-text);
  box-shadow: 0 18px 42px rgba(32, 27, 24, 0.18);
}

.studio-phone-island {
  position: absolute;
  z-index: 4;
  top: 7px;
  left: 50%;
  width: 78px;
  height: 20px;
  border-radius: 11px;
  background: #171614;
  transform: translateX(-50%);
}

.studio-phone-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: var(--studio-text);
  font-size: 11px;
  font-weight: 850;
}

.studio-phone-content {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 7px 9px 18px;
  overflow-y: auto;
  scrollbar-width: none;
}

.studio-phone-content::-webkit-scrollbar {
  display: none;
}

.studio-phone-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 1px 4px;
}

.studio-phone-title small,
.studio-phone-title strong {
  display: block;
}

.studio-phone-title small {
  color: var(--studio-primary);
  font-size: 11px;
  font-weight: 900;
}

.studio-phone-title strong {
  margin-top: 2px;
  font-size: 14px;
}

.studio-preview-pumo {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  border: 1px solid color-mix(in srgb, var(--studio-primary) 26%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--studio-primary) 12%, var(--studio-surface));
  color: var(--studio-primary);
  font-size: 11px;
  font-weight: 900;
}

.studio-phone-section,
.studio-phone-modes {
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--studio-text) 8%, transparent);
  border-radius: 9px;
  background: var(--studio-surface);
}

.studio-phone-section {
  padding: 9px;
}

.studio-phone-section :is(strong, small, p, b) {
  margin: 0;
}

.studio-phone-section strong,
.studio-phone-section small {
  display: block;
}

.studio-phone-section strong {
  color: var(--studio-text);
  font-size: 11px;
}

.studio-phone-section small {
  color: color-mix(in srgb, var(--studio-text) 58%, transparent);
  font-size: 11px;
  font-weight: 800;
}

.studio-phone-section p {
  margin-top: 3px;
  color: color-mix(in srgb, var(--studio-text) 62%, transparent);
  font-size: 11px;
  line-height: 1.35;
}

.studio-phone-hero {
  position: relative;
  min-height: 142px;
  display: flex;
  align-items: flex-end;
  padding: 0;
  border: 0;
  background: #2b211c;
}

.studio-phone-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
}

.studio-phone-hero > div {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 36px 11px 11px;
  background: linear-gradient(transparent, rgba(23, 18, 15, 0.82));
}

.studio-phone-hero :is(strong, small, p) {
  color: #faf6ee;
}

.studio-phone-hero strong {
  margin-top: 3px;
  font-size: 15px;
}

.studio-phone-hero button {
  min-height: 24px;
  margin-top: 7px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: #fdfbf6;
  color: #211c18;
  font-size: 11px;
  font-weight: 900;
}

.studio-phone-location,
.studio-phone-order,
.studio-phone-rewards {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.studio-phone-location > .ion {
  color: var(--studio-primary);
  font-size: 16px;
}

.studio-phone-location > b,
.studio-phone-order > b {
  color: var(--studio-success);
  font-size: 11px;
}

.studio-phone-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 3px;
}

.studio-phone-modes span {
  min-width: 0;
  padding: 8px 2px;
  border-radius: 7px;
  color: color-mix(in srgb, var(--studio-text) 62%, transparent);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.studio-phone-modes span.active {
  background: var(--studio-primary);
  color: #faf6ee;
}

.studio-phone-products > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.studio-phone-products > div:last-child {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}

.studio-phone-products > div:last-child span {
  min-height: 48px;
  display: grid;
  align-content: end;
  padding: 6px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--studio-primary) 7%, var(--studio-bg));
  color: var(--studio-text);
  font-size: 11px;
  font-weight: 800;
}

.studio-phone-products b {
  display: block;
  margin-top: 3px;
  color: var(--studio-primary);
  font-size: 11px;
}

.studio-phone-rewards {
  grid-template-columns: auto minmax(0, 1fr);
  border-color: color-mix(in srgb, var(--studio-success) 30%, transparent);
  background: color-mix(in srgb, var(--studio-success) 10%, var(--studio-surface));
}

.studio-phone-rewards > .ion {
  color: var(--studio-success);
}

.studio-phone-offer {
  border-left: 3px solid var(--studio-accent);
}

.studio-phone-nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: center;
  padding: 4px 6px 7px;
  border-top: 1px solid color-mix(in srgb, var(--studio-text) 8%, transparent);
  background: color-mix(in srgb, var(--studio-surface) 88%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}

.studio-phone-nav > span {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
  color: color-mix(in srgb, var(--studio-text) 48%, transparent);
}

.studio-phone-nav .ion {
  font-size: 14px;
}

.studio-phone-nav b {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-phone-nav > span.active {
  color: var(--studio-primary);
}

html[data-theme="dark"] .app-studio-view-tabs,
html[data-theme="dark"] .studio-page-row:hover,
html[data-theme="dark"] .studio-section-row,
html[data-theme="dark"] .studio-navigation-row,
html[data-theme="dark"] .automation-step,
html[data-theme="dark"] .automation-condition-row {
  background: var(--dashboard-surface);
}

html[data-theme="dark"] :is(.app-studio-view-tabs button.active, .studio-page-row.active) {
  border-color: #65402f;
  background: #35251e;
  color: var(--dashboard-copper);
}

html[data-theme="dark"] .studio-preview-pane {
  background: #121210;
}

html[data-theme="dark"] .studio-pages-pane {
  background: var(--dashboard-subtle);
}

@media (max-width: 1380px) {
  .app-studio-shell {
    grid-template-columns: 210px minmax(0, 1fr) 320px;
  }

  .app-studio-shell.studio-single-editor {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .automation-builder-flow {
    grid-template-columns: 1fr;
  }

  .automation-connector {
    transform: rotate(90deg);
  }
}

@media (max-width: 1080px) {
  .app-studio-shell,
  .app-studio-shell.studio-single-editor {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .app-studio-shell.studio-single-editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .studio-preview-pane {
    grid-column: 1 / -1;
    min-height: auto;
    border-top: 1px solid var(--dashboard-line);
    border-left: 0;
  }

  .automation-condition-row,
  .studio-navigation-row {
    grid-template-columns: 28px repeat(2, minmax(0, 1fr));
  }

  .automation-condition-row > label:nth-of-type(3),
  .automation-condition-row > .icon-button,
  .studio-navigation-actions {
    grid-column: 2 / -1;
  }
}

@media (max-width: 760px) {
  .workspace-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .app-studio-view-tabs {
    width: 100%;
  }

  .app-studio-view-tabs button {
    flex: 1;
    justify-content: center;
  }

  .app-studio-shell,
  .app-studio-shell.studio-single-editor {
    grid-template-columns: 1fr;
  }

  .studio-pages-pane,
  .studio-editor-pane,
  .studio-preview-pane {
    min-height: auto;
  }

  .studio-pages-pane {
    border-right: 0;
    border-bottom: 1px solid var(--dashboard-line);
  }

  .studio-page-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .studio-field-grid,
  .studio-page-settings,
  .automation-basics {
    grid-template-columns: 1fr;
  }

  .studio-page-settings .button {
    width: 100%;
  }

  .studio-section-row,
  .automation-condition-row,
  .studio-navigation-row {
    grid-template-columns: 1fr;
  }

  .studio-section-actions,
  .automation-condition-row > label:nth-of-type(3),
  .automation-condition-row > .icon-button,
  .studio-navigation-actions {
    grid-column: auto;
  }

  .studio-section-actions,
  .studio-navigation-actions {
    padding: 0 8px 8px;
  }

  .automation-condition-row .condition-number {
    display: none;
  }
}
