* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f8;
  color: #171717;
}

/* Sales display trend: daily order mix by acquisition source. */
.display-trend-meta {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.display-trend-meta > small {
  color: #64748b;
  font-size: clamp(8px, 0.52vw, 10px);
}

.display-chart-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 13px;
}

.display-chart-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: clamp(8px, 0.56vw, 10px);
  font-weight: 750;
  white-space: nowrap;
}

.display-chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #64748b;
}

.display-chart-legend .is-paid i { background: #f97316; }
.display-chart-legend .is-organic i { background: #10b981; }
.display-chart-legend .is-pending i { background: #f59e0b; }

.display-chart-day > .display-chart-track {
  display: flex;
  align-items: flex-end;
  min-height: 0;
  overflow: hidden;
  border-radius: 6px 6px 2px 2px;
  background: rgba(30, 41, 59, 0.72);
}

.display-chart-stack {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 6px 6px 2px 2px;
}

.display-chart-day > .display-chart-track .display-chart-stack > span {
  display: block;
  width: 100%;
  min-height: 2px;
  flex-basis: 0;
  border-radius: 0;
}

.display-chart-stack > .is-paid {
  background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
}

.display-chart-stack > .is-organic {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
}

.display-chart-stack > .is-pending {
  background: repeating-linear-gradient(
    135deg,
    #fbbf24 0,
    #fbbf24 4px,
    #d97706 4px,
    #d97706 7px
  );
}

@media (max-width: 560px) {
  .display-trend-card > header {
    align-items: flex-start;
  }

  .display-trend-meta {
    max-width: 62%;
    gap: 6px;
  }

  .display-trend-meta > small,
  .display-chart-legend > span {
    font-size: 11px;
  }

  .display-chart-legend {
    gap: 5px 9px;
  }

  .display-chart-legend i {
    width: 9px;
    height: 9px;
  }
}

/* --------------------------------------------------------------------------
   STRWKY Shipping admin theme
   Visually aligned with the live sales display; scoped so the public display
   and login remain untouched.
   -------------------------------------------------------------------------- */
.shipping-body {
  --shipping-bg: #070b14;
  --shipping-panel: #0f172a;
  --shipping-panel-soft: #111827;
  --shipping-panel-deep: rgba(2, 6, 23, 0.34);
  --shipping-border: #1e293b;
  --shipping-border-strong: #334155;
  --shipping-text: #f8fafc;
  --shipping-text-soft: #e2e8f0;
  --shipping-muted: #94a3b8;
  --shipping-muted-deep: #64748b;
  --shipping-orange: #fb923c;
  --shipping-orange-strong: #f97316;
  --shipping-green: #34d399;
  --shipping-blue: #93c5fd;
  --shipping-amber: #fbbf24;
  --shipping-red: #fca5a5;
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(234, 88, 12, 0.15), transparent 28%),
    var(--shipping-bg);
  color: var(--shipping-text);
  color-scheme: dark;
}

.shipping-body *,
.shipping-body *::before,
.shipping-body *::after { box-sizing: border-box; }

.shipping-body .topbar {
  height: 76px;
  padding: 0 clamp(18px, 3vw, 48px);
  border-bottom: 1px solid var(--shipping-border);
  background: rgba(7, 11, 20, 0.94);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
}

.shipping-body .topbar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.shipping-body .topbar-brand > div { min-width: 0; }
.shipping-body .topbar-brand strong,
.shipping-body .topbar-brand span { display: block; }
.shipping-body .topbar-brand strong {
  color: var(--shipping-text);
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.shipping-body .topbar-brand > div > span {
  margin: 4px 0 0;
  color: var(--shipping-muted-deep);
  font-size: 11px;
}
.shipping-body .topbar .topbar-eyebrow {
  margin: 0;
  color: var(--shipping-orange);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.17em;
}

.shipping-body .topbar nav {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--shipping-border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
}
.shipping-body .topbar a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--shipping-muted);
  font-size: 13px;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.shipping-body .topbar a:hover {
  color: var(--shipping-text);
  background: rgba(30, 41, 59, 0.78);
}
.shipping-body .topbar a.active {
  border-color: rgba(251, 146, 60, 0.35);
  background: rgba(249, 115, 22, 0.12);
  color: var(--shipping-orange);
}

.shipping-body .shell {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px clamp(16px, 2.7vw, 38px) 54px;
}

.shipping-body .page-head,
.shipping-body .counter-heading { margin-bottom: 22px; }
.shipping-body .page-head h1,
.shipping-body .counter-heading h1,
.shipping-body .ads-report-head h1 {
  color: var(--shipping-text);
  font-size: clamp(27px, 2.4vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}
.shipping-body .page-head p,
.shipping-body .counter-heading p,
.shipping-body .ads-report-head p,
.shipping-body .ads-section-head p,
.shipping-body .section-heading p,
.shipping-body .muted-line,
.shipping-body .muted-block {
  color: var(--shipping-muted);
}
.shipping-body .eyebrow { color: var(--shipping-orange); }
.shipping-body .section-heading h2,
.shipping-body .table-head h2 { color: var(--shipping-text-soft); }

.shipping-body .button {
  min-height: 42px;
  border-color: var(--shipping-border-strong);
  border-radius: 9px;
  background: var(--shipping-panel-soft);
  color: var(--shipping-text-soft);
  box-shadow: none;
}
.shipping-body .button:hover {
  border-color: #475569;
  background: #1e293b;
  color: var(--shipping-text);
}
.shipping-body .button.primary {
  border-color: var(--shipping-orange-strong);
  background: var(--shipping-orange-strong);
  color: #fff;
}
.shipping-body .button.primary:hover {
  border-color: var(--shipping-orange);
  background: var(--shipping-orange);
  color: #1b0c04;
}
.shipping-body .button.secondary { min-height: 36px; }
.shipping-body input[type="checkbox"],
.shipping-body input[type="radio"] { accent-color: var(--shipping-orange-strong); }

.shipping-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.shipping-body select,
.shipping-body textarea,
.shipping-body .settings-edit input,
.shipping-body .settings-edit select {
  border-color: var(--shipping-border-strong);
  background: #0b1220;
  color: var(--shipping-text);
}
.shipping-body input::placeholder,
.shipping-body textarea::placeholder { color: var(--shipping-muted-deep); }
.shipping-body input:focus,
.shipping-body select:focus,
.shipping-body textarea:focus,
.shipping-body .button:focus-visible,
.shipping-body a:focus-visible,
.shipping-body summary:focus-visible {
  outline: 3px solid rgba(251, 146, 60, 0.38);
  outline-offset: 2px;
}
.shipping-body .settings-edit label span,
.shipping-body .batchhint { color: var(--shipping-muted); }
.shipping-body .checkline {
  border-color: var(--shipping-border-strong);
  background: var(--shipping-panel);
  color: var(--shipping-text-soft);
}

.shipping-body .orders {
  overflow: hidden;
  border-color: var(--shipping-border);
  border-radius: 13px;
  background: var(--shipping-panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
}
.shipping-body .orders th,
.shipping-body .orders td {
  border-bottom-color: var(--shipping-border);
  color: var(--shipping-text-soft);
}
.shipping-body .orders th {
  background: rgba(2, 6, 23, 0.3);
  color: var(--shipping-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.shipping-body .orders tbody tr { transition: background 140ms ease; }
.shipping-body .orders tbody tr:hover { background: rgba(30, 41, 59, 0.48); }
.shipping-body .orders tbody tr:last-child td { border-bottom: 0; }
.shipping-body .orders a:not(.button),
.shipping-body .shell a:not(.button) { color: #fdba74; }
.shipping-body .empty { color: var(--shipping-muted); }
.shipping-body .warn-row td { background: rgba(120, 53, 15, 0.16); }
.shipping-body .error-text { color: var(--shipping-red); }

.shipping-body .notice,
.shipping-body .connection-alert,
.shipping-body .app-package-note,
.shipping-body .action-note {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(120, 53, 15, 0.18);
  color: #fde68a;
}
.shipping-body .connection-alert span,
.shipping-body .app-package-note span,
.shipping-body .action-note { color: #fcd34d; }
.shipping-body .notice.success {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(6, 78, 59, 0.25);
  color: #a7f3d0;
}
.shipping-body .notice.error {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
}
.shipping-body .notice pre,
.shipping-body code,
.shipping-body pre {
  color: var(--shipping-text-soft);
  overflow-wrap: anywhere;
}

.shipping-body .summary div,
.shipping-body .statusline div,
.shipping-body .readiness-panel,
.shipping-body .settings-grid article,
.shipping-body .settings-edit article,
.shipping-body .worker-history .readiness-head,
.shipping-body .order-source-board,
.shipping-body .conversion-board,
.shipping-body .trend-card,
.shipping-body .counter-metrics article,
.shipping-body .sales-kpis article,
.shipping-body .sales-chart-card,
.shipping-body .sales-snapshot-card,
.shipping-body .source-overview-card,
.shipping-body .recent-sales-section,
.shipping-body .service-orders,
.shipping-body .ads-executive,
.shipping-body .ads-panel,
.shipping-body .ads-detail-panel,
.shipping-body .retention-state,
.shipping-body .retention-kpis article,
.shipping-body .retention-board {
  border-color: var(--shipping-border);
  border-radius: 14px;
  background: var(--shipping-panel);
  color: var(--shipping-text-soft);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
}

.shipping-body .summary span,
.shipping-body .statusline span,
.shipping-body .settings-grid p,
.shipping-body .readiness-list span,
.shipping-body .trend-head p,
.shipping-body .table-head p,
.shipping-body .counter-metrics span,
.shipping-body .counter-metrics small,
.shipping-body .sales-kpis span,
.shipping-body .sales-kpis small,
.shipping-body .sales-chart-card header p,
.shipping-body .source-cost-note,
.shipping-body .recent-sales-section > header > small,
.shipping-body .service-orders > p,
.shipping-body .retention-state p,
.shipping-body .retention-head p,
.shipping-body .retention-definition span,
.shipping-body .retention-reel-title div > span,
.shipping-body .retention-reel-metrics small,
.shipping-body .retention-score span,
.shipping-body .ads-report p,
.shipping-body .ads-method-copy,
.shipping-body .ads-order-evidence p {
  color: var(--shipping-muted);
}

.shipping-body .summary strong,
.shipping-body .statusline strong,
.shipping-body .settings-grid h2,
.shipping-body .settings-edit h2,
.shipping-body .readiness-head h2,
.shipping-body .worker-history h2,
.shipping-body .counter-metrics strong,
.shipping-body .sales-kpis strong,
.shipping-body .sales-chart-card h2,
.shipping-body .source-overview-head h2,
.shipping-body .source-overview-head > strong,
.shipping-body .recent-sales-section h2,
.shipping-body .retention-head h2,
.shipping-body .retention-winner-copy h3,
.shipping-body .retention-reel-title strong,
.shipping-body .ads-report-head h1,
.shipping-body .ads-section-head h2,
.shipping-body .ads-ad-main h3,
.shipping-body .ads-kpi strong {
  color: var(--shipping-text);
}

.shipping-body .summary > div:first-child,
.shipping-body .sales-snapshot-card.primary {
  border-color: rgba(251, 146, 60, 0.4);
  background: linear-gradient(145deg, #25170f 0%, var(--shipping-panel) 78%);
}
.shipping-body .summary > div:first-child strong,
.shipping-body .sales-snapshot-card.primary > strong,
.shipping-body .sales-snapshot-card.dark > strong { color: var(--shipping-orange); }
.shipping-body .sales-snapshot-card.dark { border-color: var(--shipping-border); }

.shipping-body .readiness-list li {
  border-color: var(--shipping-border);
  background: var(--shipping-panel-deep);
}
.shipping-body .readiness-list li.ready {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(6, 78, 59, 0.2);
}
.shipping-body .readiness-list li.todo {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(120, 53, 15, 0.16);
}
.shipping-body .ok { color: #6ee7b7 !important; }
.shipping-body .warn { color: #fcd34d !important; }
.shipping-body .bad { color: #fca5a5 !important; }

.shipping-body .sales-total,
.shipping-body .counter-hero {
  border-color: rgba(251, 146, 60, 0.42);
  background:
    radial-gradient(circle at 84% 14%, rgba(251, 146, 60, 0.2), transparent 33%),
    linear-gradient(145deg, #25170f 0%, var(--shipping-panel) 72%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.shipping-body .sales-total > span,
.shipping-body .counter-today { color: var(--shipping-orange); }
.shipping-body .sales-total > strong,
.shipping-body .counter-number { color: var(--shipping-orange-strong); }
.shipping-body .sales-total > p,
.shipping-body .counter-message { color: var(--shipping-text-soft); }
.shipping-body .sales-total > small { color: var(--shipping-muted); }
.shipping-body .sales-today {
  border-color: var(--shipping-border);
  background: var(--shipping-panel);
}
.shipping-body .sales-today-metrics div,
.shipping-body .source-legend > div,
.shipping-body .source-cost-scope,
.shipping-body .source-cost-grid > div,
.shipping-body .sales-order-card,
.shipping-body .source-order-row,
.shipping-body .source-visit,
.shipping-body .conversion-definition,
.shipping-body .conversion-ad,
.shipping-body .winner-metrics div,
.shipping-body .ads-kpi,
.shipping-body .ads-ad-row,
.shipping-body .ads-ad-metrics div,
.shipping-body .ads-source-totals > div,
.shipping-body .ads-source-list > div,
.shipping-body .ads-order-evidence > article,
.shipping-body .retention-winner-metrics div,
.shipping-body .retention-reel,
.shipping-body .retention-reel-metrics > span {
  border-color: var(--shipping-border);
  background: var(--shipping-panel-deep);
  color: var(--shipping-text-soft);
}

.shipping-body .source-legend strong,
.shipping-body .source-cost-grid strong,
.shipping-body .sales-order-head > div:first-child > strong,
.shipping-body .sales-order-value strong,
.shipping-body .sales-order-cost > strong,
.shipping-body .source-order-title strong,
.shipping-body .source-order-title b,
.shipping-body .source-visit strong,
.shipping-body .conversion-score,
.shipping-body .conversion-ad-metrics strong,
.shipping-body .winner-metrics strong,
.shipping-body .ads-ad-metrics strong,
.shipping-body .ads-source-totals strong,
.shipping-body .retention-reel-metrics strong,
.shipping-body .retention-score strong { color: var(--shipping-text-soft); }
.shipping-body .source-legend span,
.shipping-body .source-cost-grid span,
.shipping-body .source-cost-grid small,
.shipping-body .source-order-date,
.shipping-body .source-order-row > p,
.shipping-body .source-visit span,
.shipping-body .source-visit small,
.shipping-body .sales-order-head > div:first-child > span,
.shipping-body .sales-order-value span,
.shipping-body .sales-order-source p,
.shipping-body .sales-order-cost > span,
.shipping-body .sales-order-cost > small,
.shipping-body .sales-order-proof,
.shipping-body .ads-kpi span,
.shipping-body .ads-kpi small,
.shipping-body .ads-ad-main p,
.shipping-body .ads-ad-metrics span,
.shipping-body .retention-reel-metrics small,
.shipping-body .retention-score span { color: var(--shipping-muted); }

.shipping-body .source-balance,
.shipping-body .conversion-bar,
.shipping-body .retention-bar,
.shipping-body .sales-chart-track { background: #273449; }
.shipping-body .source-cost-grid .is-conversion {
  border-color: rgba(96, 165, 250, 0.32);
  background: rgba(30, 64, 175, 0.12);
}
.shipping-body .source-cost-grid .is-conversion strong { color: var(--shipping-blue); }
.shipping-body .source-cost-grid .is-cost-kpi {
  border-color: rgba(251, 146, 60, 0.4);
  background: rgba(124, 45, 18, 0.16);
}
.shipping-body .source-cost-grid .is-cost-kpi strong { color: #fdba74; }
.shipping-body .source-cost-grid .is-positive {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(6, 78, 59, 0.18);
}
.shipping-body .source-cost-grid .is-positive strong { color: #6ee7b7; }
.shipping-body .source-cost-grid .is-negative {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(127, 29, 29, 0.17);
}
.shipping-body .source-cost-grid .is-negative strong { color: var(--shipping-red); }
.shipping-body .source-cost-grid .is-warning {
  border-color: rgba(251, 146, 60, 0.3);
  background: rgba(120, 53, 15, 0.16);
}
.shipping-body .source-cost-grid .is-warning strong { color: var(--shipping-orange); }
.shipping-body .recent-sales-empty,
.shipping-body .retention-inline-empty { background: var(--shipping-panel-deep); color: var(--shipping-muted); }
.shipping-body .sales-order-card.is-service { background: rgba(30, 41, 59, 0.45); }
.shipping-body .sales-order-cost,
.shipping-body .sales-order-proof { border-color: var(--shipping-border); }

.shipping-body .marketing-subnav {
  border-color: var(--shipping-border);
  background: rgba(15, 23, 42, 0.72);
}
.shipping-body .marketing-subnav a { color: var(--shipping-muted); }
.shipping-body .marketing-subnav a.active {
  background: rgba(249, 115, 22, 0.14);
  color: var(--shipping-orange);
}
.shipping-body .ads-period,
.shipping-body .retention-definition {
  border-color: var(--shipping-border-strong);
  background: var(--shipping-panel-deep);
  color: var(--shipping-text-soft);
}
.shipping-body .ads-kpi.primary,
.shipping-body .ads-ad-row.is-winner,
.shipping-body .retention-winner,
.shipping-body .retention-reel.is-winner {
  border-color: rgba(251, 146, 60, 0.42);
  background: rgba(124, 45, 18, 0.13);
}
.shipping-body .ads-rank,
.shipping-body .retention-rank,
.shipping-body .conversion-rank {
  background: #1e293b;
  color: var(--shipping-muted);
}
.shipping-body .is-winner .ads-rank,
.shipping-body .retention-reel.is-winner .retention-rank,
.shipping-body .is-winner .conversion-rank {
  background: var(--shipping-orange-strong);
  color: #fff;
}
.shipping-body .ads-detail-panel > summary,
.shipping-body .service-orders > summary { color: var(--shipping-text-soft); }
.shipping-body .retention-kpis span,
.shipping-body .retention-kpis small { color: var(--shipping-muted); }
.shipping-body .retention-kpis strong { color: var(--shipping-text); }
.shipping-body .retention-kpis article.highlight {
  border-color: rgba(251, 146, 60, 0.42);
  background: rgba(124, 45, 18, 0.16);
}
.shipping-body .retention-kpis article.highlight strong { color: var(--shipping-orange); }
.shipping-body .ads-refresh-menu > summary {
  border-color: var(--shipping-border-strong);
  background: var(--shipping-panel-soft);
  color: var(--shipping-text-soft);
}
.shipping-body .ads-refresh-menu[open] form {
  border-color: var(--shipping-border);
  background: var(--shipping-panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}
.shipping-body .ads-detail-body { border-top-color: var(--shipping-border); }
.shipping-body .ads-technical-table { box-shadow: none; }

.shipping-body .performance-badge,
.shipping-body .method-badge {
  background: #1e293b;
  color: #cbd5e1;
}
.shipping-body .performance-badge.winner,
.shipping-body .source-badge.is-paid,
.shipping-body .source-pill {
  background: rgba(249, 115, 22, 0.16);
  color: #fdba74;
}
.shipping-body .performance-badge.pending,
.shipping-body .source-badge.is-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
}
.shipping-body .performance-badge.weak {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}
.shipping-body .source-badge.is-organic {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}
.shipping-body .source-badge.is-service {
  background: #1e293b;
  color: #cbd5e1;
}

.shipping-body .chart-grid { stroke: var(--shipping-border); }
.shipping-body .chart-axis { stroke: #475569; }
.shipping-body .chart-line.spend { stroke: #94a3b8; }
.shipping-body .chart-point { stroke: var(--shipping-panel); }
.shipping-body .chart-y-label,
.shipping-body .chart-x-label { fill: var(--shipping-muted); }

@media (max-width: 860px) {
  body.shipping-body {
    background:
      radial-gradient(circle at 8% 0%, rgba(234, 88, 12, 0.15), transparent 24%),
      var(--shipping-bg);
  }
  .shipping-body .topbar {
    height: auto;
    min-height: 0;
    gap: 12px;
    padding: 14px 14px 10px;
    background: rgba(7, 11, 20, 0.97);
  }
  .shipping-body .topbar-brand { gap: 10px; }
  .shipping-body .topbar-brand strong { font-size: 19px; }
  .shipping-body .topbar-brand > div > span { margin-top: 3px; font-size: 10px; }
  .shipping-body .topbar nav {
    gap: 5px;
    padding: 4px;
    scrollbar-width: none;
  }
  .shipping-body .topbar nav::-webkit-scrollbar { display: none; }
  .shipping-body .topbar a {
    min-height: 40px;
    padding: 0 11px;
    font-size: 12px;
  }
  .shipping-body .shell { padding: 22px 12px 40px; }
  .shipping-body .page-head h1,
  .shipping-body .counter-heading h1,
  .shipping-body .ads-report-head h1 { font-size: 28px; }
  .shipping-body .split,
  .shipping-body .page-head.split,
  .shipping-body .counter-heading,
  .shipping-body .source-overview-head,
  .shipping-body .recent-sales-section > header,
  .shipping-body .ads-report-head,
  .shipping-body .ads-section-head,
  .shipping-body .retention-head {
    align-items: stretch;
    flex-direction: column;
  }
  .shipping-body .head-actions,
  .shipping-body .counter-heading-actions,
  .shipping-body .actions,
  .shipping-body .batchbar { align-items: stretch; }
  .shipping-body .head-actions .button,
  .shipping-body .counter-heading-actions .button { flex: 1 1 auto; }
  .shipping-body .summary.six { grid-template-columns: 1fr; }
  .shipping-body .readiness-list { gap: 8px; }
  .shipping-body .readiness-list li { min-height: 0; }
  .shipping-body .orders { border-radius: 11px; }
  .shipping-body .orders tbody tr {
    border-color: var(--shipping-border);
    background: var(--shipping-panel);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  }
  .shipping-body .orders td::before { color: var(--shipping-muted); }
  .shipping-body .orders tbody td {
    border-bottom-color: var(--shipping-border);
    background: transparent;
    color: var(--shipping-text-soft);
  }
  .shipping-body .batchbar .checkline {
    border-color: var(--shipping-border-strong);
    background: var(--shipping-panel);
    color: var(--shipping-text-soft);
  }
  .shipping-body .settings-grid article,
  .shipping-body .settings-edit article,
  .shipping-body .readiness-panel,
  .shipping-body .source-overview-card,
  .shipping-body .recent-sales-section,
  .shipping-body .retention-board,
  .shipping-body .ads-executive,
  .shipping-body .ads-panel { padding: 16px; }
}

@media (max-width: 520px) {
  .shipping-body .topbar { position: sticky; }
  .shipping-body .topbar-brand { padding: 0 2px; }
  .shipping-body .topbar nav {
    gap: 2px;
    margin: 0;
    padding: 3px;
  }
  .shipping-body .topbar a {
    min-height: 40px;
    padding: 0 7px;
    font-size: 11px;
  }
  .shipping-body .shell { padding-inline: 10px; }
  .shipping-body .page-head p,
  .shipping-body .counter-heading p { font-size: 13px; line-height: 1.45; }
  .shipping-body .button { min-height: 44px; }
  .shipping-body .batchbar .button { flex: 1 1 auto; }
  .shipping-body .batchbar .batchhint { flex-basis: 100%; }
  .shipping-body .checkline { min-height: 34px; }
  .shipping-body .checkline input,
  .shipping-body .order-check { width: 20px; height: 20px; }
  .shipping-body .summary,
  .shipping-body .sales-snapshot-grid,
  .shipping-body .sales-kpis,
  .shipping-body .counter-metrics,
  .shipping-body .source-cost-grid,
  .shipping-body .retention-kpis,
  .shipping-body .ads-kpi-grid { grid-template-columns: 1fr; }
  .shipping-body .sales-order-card { grid-template-columns: 1fr; }
  .shipping-body .sales-order-cost {
    padding: 8px 0 0;
    border-top: 1px solid var(--shipping-border);
    border-left: 0;
  }
  .shipping-body .source-legend { grid-template-columns: 1fr; }
  .shipping-body .marketing-subnav { overflow-x: auto; scrollbar-width: none; }
  .shipping-body .marketing-subnav::-webkit-scrollbar { display: none; }
}

/* Advertentierapport: summary-first en dezelfde informatiehiërarchie op mobiel. */
.ads-report {
  display: grid;
  gap: 18px;
}

.ads-report-head,
.ads-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.ads-report-head h1,
.ads-section-head h2 {
  margin: 3px 0 5px;
  letter-spacing: -0.025em;
}

.ads-report-head h1 {
  font-size: clamp(28px, 4vw, 38px);
}

.ads-section-head h2 {
  font-size: clamp(21px, 3vw, 28px);
}

.ads-report-head p,
.ads-section-head p {
  margin: 0;
  color: #6c6b68;
}

.ads-report-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ads-refresh-menu {
  position: relative;
}

.ads-refresh-menu > summary {
  cursor: pointer;
  list-style: none;
  border: 1px solid #dedbd6;
  border-radius: 10px;
  padding: 10px 14px;
  background: #fff;
  font-weight: 700;
}

.ads-refresh-menu > summary::-webkit-details-marker {
  display: none;
}

.ads-refresh-menu[open] form {
  position: absolute;
  z-index: 5;
  right: 0;
  top: calc(100% + 8px);
  width: max-content;
  padding: 10px;
  border: 1px solid #e2dfda;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(37, 29, 22, 0.12);
}

.ads-executive,
.ads-panel,
.ads-detail-panel {
  border: 1px solid #e5e2dd;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(46, 34, 24, 0.045);
}

.ads-executive,
.ads-panel {
  padding: 24px;
}

.ads-period {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f3f1ee;
  color: #5e5b57;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
}

.ads-insight-list {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.ads-insight-list li {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 13px;
  padding: 14px 0;
  border-top: 1px solid #efede9;
}

.ads-insight-list li:first-child {
  border-top: 0;
  padding-top: 4px;
}

.ads-insight-list strong {
  display: block;
  font-size: 16px;
  line-height: 1.35;
}

.ads-insight-list p {
  margin: 3px 0 0;
  color: #6d6a66;
  line-height: 1.45;
}

.ads-insight-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: #a8a49e;
}

.ads-insight-dot.positive { background: #168559; }
.ads-insight-dot.accent { background: #ee5b12; }
.ads-insight-dot.warning { background: #d28a12; }
.ads-insight-dot.neutral { background: #7c8798; }

.ads-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.ads-kpi {
  min-width: 0;
  padding: 18px;
  border: 1px solid #e5e2dd;
  border-radius: 16px;
  background: #fff;
}

.ads-kpi.primary {
  border-color: #f0a375;
  background: linear-gradient(145deg, #fff7f1, #fff);
}

.ads-kpi span,
.ads-kpi strong,
.ads-kpi small {
  display: block;
}

.ads-kpi span {
  min-height: 32px;
  color: #6c6965;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.ads-kpi strong {
  margin: 6px 0 4px;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.035em;
}

.ads-kpi small {
  color: #8a8782;
  line-height: 1.35;
}

.ads-chart-legend {
  display: flex;
  gap: 14px;
  color: #6e6b67;
  font-size: 12px;
}

.ads-chart-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ads-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px 3px 1px 1px;
  background: #3192eb;
}

.ads-chart-legend i.orders { background: #a84d18; }

.ads-volume-chart {
  display: flex;
  align-items: stretch;
  gap: clamp(5px, 1.2vw, 14px);
  height: 250px;
  margin-top: 22px;
  padding: 14px 8px 0;
  border-bottom: 1px solid #d8d5d0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 49px,
    #f0eeea 50px
  );
}

.ads-day {
  display: grid;
  grid-template-rows: 28px 1fr 24px;
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.ads-bar-values {
  display: flex;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
}

.ads-bar-values b:last-child { color: #9b4316; }

.ads-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-height: 0;
}

.ads-bar {
  display: block;
  width: min(42%, 28px);
  min-height: 0;
  border-radius: 5px 5px 1px 1px;
}

.ads-bar.sessions { background: #3192eb; }
.ads-bar.orders { background: #a84d18; }

.ads-day small {
  padding-top: 7px;
  color: #74716d;
  font-size: 10px;
  white-space: nowrap;
}

.ads-ranking {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.ads-ad-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(520px, 1.45fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid #ece9e4;
  border-radius: 14px;
  background: #fdfcfb;
}

.ads-ad-row.is-winner {
  border-color: #ed9a67;
  background: #fff9f4;
}

.ads-ad-main {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  min-width: 0;
}

.ads-rank {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ece9e4;
  font-weight: 800;
}

.is-winner .ads-rank {
  background: #ee5b12;
  color: #fff;
}

.ads-ad-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.ads-ad-main h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.32;
}

.ads-ad-main p {
  margin: 3px 0 0;
  color: #77736e;
  font-size: 12px;
}

.ads-ad-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.ads-ad-metrics div {
  min-width: 0;
  padding-left: 10px;
  border-left: 1px solid #e4e1dc;
}

.ads-ad-metrics span,
.ads-ad-metrics strong {
  display: block;
}

.ads-ad-metrics span {
  color: #77736f;
  font-size: 10px;
  line-height: 1.2;
}

.ads-ad-metrics strong {
  margin-top: 5px;
  font-size: 15px;
  white-space: nowrap;
}

.ads-detail-panel {
  overflow: clip;
}

.ads-detail-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
}

.ads-detail-panel > summary::-webkit-details-marker { display: none; }

.ads-detail-panel > summary::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 24px;
  line-height: 1;
}

.ads-detail-panel[open] > summary::after { content: "−"; }

.ads-detail-panel > summary span,
.ads-detail-panel > summary small {
  display: block;
}

.ads-detail-panel > summary span {
  font-weight: 800;
}

.ads-detail-panel > summary small {
  margin-left: auto;
  color: #77736e;
}

.ads-detail-body {
  padding: 20px 22px 22px;
  border-top: 1px solid #ece9e4;
}

.ads-source-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ads-source-totals > div {
  padding: 14px;
  border-radius: 12px;
  background: #f7f5f2;
}

.ads-source-totals span,
.ads-source-totals strong,
.ads-source-totals small {
  display: block;
}

.ads-source-totals span,
.ads-source-totals small { color: #6f6b66; }
.ads-source-totals strong { margin: 6px 0; font-size: 24px; }

.ads-source-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.ads-source-list > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 2px;
  border-top: 1px solid #eeebe7;
}

.ads-order-evidence {
  display: grid;
  gap: 12px;
}

.ads-order-evidence > article {
  padding: 16px;
  border: 1px solid #ece9e4;
  border-radius: 12px;
}

.ads-evidence-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ads-evidence-title strong { margin-right: 8px; }
.ads-order-evidence p { color: #6e6a65; }
.ads-table-wrap { overflow-x: auto; }
.ads-technical-table { margin: 0; min-width: 760px; }
.ads-method-copy { color: #5f5b56; line-height: 1.55; }
.ads-method-copy p { margin: 0 0 9px; }
.ads-method-copy p:last-child { margin-bottom: 0; }

@media (max-width: 980px) {
  .ads-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ads-ad-row { grid-template-columns: 1fr; }
  .ads-ad-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .ads-report { gap: 12px; }
  .ads-report-head,
  .ads-section-head { display: grid; gap: 12px; }
  .ads-report-actions { justify-content: space-between; }
  .ads-report-actions form { flex: 1 1 auto; }
  .ads-report-actions .button { width: 100%; }
  .ads-refresh-menu[open] form { right: 0; }
  .ads-executive,
  .ads-panel { padding: 18px; border-radius: 15px; }
  .ads-period { width: max-content; }
  .ads-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ads-kpi { padding: 14px; }
  .ads-kpi.primary { grid-column: 1 / -1; }
  .ads-kpi span { min-height: auto; }
  .ads-volume-panel { overflow: hidden; }
  .ads-volume-chart { height: 220px; gap: 4px; padding-inline: 0; }
  .ads-bar-values { gap: 2px; font-size: 9px; }
  .ads-day small { font-size: 8px; transform: rotate(-40deg); transform-origin: top center; }
  .ads-ad-row { padding: 14px; }
  .ads-ad-metrics { gap: 10px 4px; }
  .ads-ad-metrics div { padding-left: 8px; }
  .ads-detail-panel > summary { display: grid; grid-template-columns: 1fr auto; padding: 16px; }
  .ads-detail-panel > summary small { grid-column: 1; margin: 2px 0 0; }
  .ads-detail-panel > summary::after { grid-column: 2; grid-row: 1 / span 2; }
  .ads-detail-body { padding: 16px; }
  .ads-source-totals { grid-template-columns: 1fr; }
  .ads-source-list > div { align-items: flex-start; }
  .ads-evidence-title { display: grid; }
}

@media (max-width: 380px) {
  .ads-ad-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid #dedede;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar span {
  margin-left: 10px;
  color: #666;
  font-size: 13px;
}
.topbar nav { display: flex; gap: 14px; flex-shrink: 0; }
.topbar a { color: #171717; text-decoration: none; font-weight: 600; }
.shell { max-width: 1120px; margin: 0 auto; padding: 28px 20px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: 0; }
.page-head p { margin: 0; color: #666; }
.muted-line { margin-top: 8px !important; font-size: 13px; }
.muted-block { display: block; color: #666; font-size: 12px; margin-top: 3px; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.head-actions form { margin: 0; }
.orders {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #dedede;
}
.orders th, .orders td {
  padding: 12px 14px;
  border-bottom: 1px solid #ececec;
  text-align: left;
  font-size: 14px;
}
.orders th { color: #555; font-size: 12px; text-transform: uppercase; }
.empty { text-align: center; color: #777; padding: 36px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #cfcfcf;
  background: #fff;
  color: #171717;
  text-decoration: none;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
}
.button.primary { background: #111; color: #fff; border-color: #111; }
.button:active { transform: translateY(1px); }
.button.secondary {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
.notice {
  padding: 14px 16px;
  margin: 0 0 18px;
  border: 1px solid #d9c46b;
  background: #fff7c7;
  border-radius: 6px;
}
.notice.error { border-color: #f0a0a0; background: #fff1f1; }
.notice.success { border-color: #8bd39c; background: #effaf1; }
.notice pre { white-space: pre-wrap; margin: 10px 0 0; font-size: 12px; }
.safety-warnings ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.app-package-note {
  display: grid;
  gap: 4px;
  border-color: #b7c7d8;
  background: #f2f7fb;
}
.app-package-note span {
  color: #3f4a55;
}
.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.summary.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.summary div {
  background: #fff;
  border: 1px solid #dedede;
  padding: 14px;
  border-radius: 6px;
}
.summary span { display: block; color: #666; font-size: 12px; margin-bottom: 6px; }
.summary strong { font-size: 20px; }
.summary .summary-period { font-size: 14px; line-height: 1.35; }
.section-heading {
  margin: 24px 0 10px;
}
.section-heading h2 {
  margin: 0;
  font-size: 18px;
}
.section-heading p {
  margin: 5px 0 0;
  color: #666;
  font-size: 12px;
}
.order-source-board {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid #dfe3e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.order-source-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.order-source-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.order-source-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
}
.order-source-equation {
  flex: 0 0 auto;
  min-width: 116px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #0f172a;
  color: #fff;
  text-align: center;
}
.order-source-equation strong,
.order-source-equation span {
  display: block;
}
.order-source-equation strong {
  font-size: 28px;
  line-height: 1;
}
.order-source-equation span {
  margin-top: 4px;
  color: #cbd5e1;
  font-size: 10px;
}
.order-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.order-source-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
}
.order-source-card span,
.order-source-card strong,
.order-source-card small {
  display: block;
}
.order-source-card span {
  color: #475569;
  font-size: 11px;
  font-weight: 750;
}
.order-source-card strong {
  margin-top: 7px;
  color: #0f172a;
  font-size: 30px;
  line-height: 1;
}
.order-source-card small {
  margin-top: 7px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}
.order-source-card.total {
  border-color: #0f172a;
  background: #0f172a;
}
.order-source-card.total span,
.order-source-card.total strong {
  color: #fff;
}
.order-source-card.total small {
  color: #cbd5e1;
}
.order-source-card.ads {
  border-color: #fdba74;
  background: #fff7ed;
}
.order-source-card.ads strong {
  color: #c2410c;
}
.order-source-card.unattributed {
  border-color: #cbd5e1;
}
.order-source-card.unknown {
  border-color: #fecaca;
  background: #fef2f2;
}
.order-source-card.unknown strong {
  color: #b91c1c;
}
.order-source-card.manual {
  border-color: #fde68a;
  background: #fffbeb;
}
.order-source-card.unresolved {
  border-color: #fecaca;
  background: #fef2f2;
}
.source-breakdown {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #f8fafc;
}
.source-breakdown-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.source-breakdown-head h3 {
  margin: 2px 0 0;
  color: #0f172a;
  font-size: 16px;
}
.source-breakdown-head small {
  max-width: 390px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.4;
  text-align: right;
}
.source-breakdown-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.source-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.source-breakdown-row strong,
.source-breakdown-row span {
  display: block;
}
.source-breakdown-row strong {
  color: #0f172a;
  font-size: 12px;
}
.source-breakdown-row span {
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
}
.source-breakdown-row b {
  flex: 0 0 auto;
  color: #0f172a;
  font-size: 14px;
}
.source-order-list {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fffaf5;
}
.source-order-row {
  margin-top: 10px;
  padding: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
}
.source-order-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.source-order-title > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.source-order-title strong {
  color: #0f172a;
  font-size: 14px;
}
.source-order-title b {
  flex: 0 0 auto;
  color: #0f172a;
  font-size: 13px;
}
.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 10px;
  font-weight: 800;
}
.source-order-date {
  color: #64748b;
  font-size: 10px;
  white-space: nowrap;
}
.source-order-row > p {
  margin: 7px 0 0;
  color: #64748b;
  font-size: 10px;
}
.source-journey {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.source-visit {
  min-width: 0;
  padding: 10px;
  border-radius: 7px;
  background: #f8fafc;
}
.source-visit span,
.source-visit strong,
.source-visit small {
  display: block;
}
.source-visit span {
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.source-visit strong {
  margin-top: 4px;
  color: #0f172a;
  font-size: 12px;
}
.source-visit small {
  margin-top: 3px;
  color: #64748b;
  font-size: 9px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.order-source-note {
  margin: 11px 0 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}
.conversion-board {
  margin: 0 0 24px;
  padding: 20px;
  border: 1px solid #dfe3e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.conversion-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #c2410c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.conversion-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.conversion-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
}
.conversion-definition {
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.conversion-definition strong,
.conversion-definition span {
  display: block;
}
.conversion-definition strong {
  font-size: 12px;
}
.conversion-definition span {
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
}
.conversion-winner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 20px;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid #fdba74;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 72%);
}
.winner-copy h3 {
  max-width: 640px;
  margin: 8px 0 0;
  font-size: 20px;
  line-height: 1.25;
}
.winner-detail {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}
.winner-conversion {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 14px;
}
.winner-conversion strong {
  color: #c2410c;
  font-size: 52px;
  line-height: 1;
  letter-spacing: -0.05em;
}
.winner-conversion span {
  color: #475569;
  font-size: 13px;
}
.winner-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-self: stretch;
  gap: 8px;
}
.winner-metrics div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}
.winner-metrics span {
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
}
.winner-metrics strong {
  margin-top: 5px;
  font-size: 19px;
}
.conversion-ranking {
  display: grid;
  gap: 9px;
}
.conversion-ad {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 90px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
}
.conversion-ad.is-winner {
  border-color: #fdba74;
  background: #fffaf5;
}
.conversion-rank {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}
.is-winner .conversion-rank {
  background: #ea580c;
  color: #fff;
}
.conversion-ad-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.conversion-ad-title strong,
.conversion-ad-title span {
  display: block;
}
.conversion-ad-title strong {
  font-size: 14px;
  line-height: 1.25;
}
.conversion-ad-title div > span {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
}
.performance-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.performance-badge.winner {
  background: #ffedd5;
  color: #9a3412;
}
.performance-badge.pending {
  background: #fef3c7;
  color: #92400e;
}
.performance-badge.weak {
  background: #fee2e2;
  color: #991b1b;
}
.conversion-bar {
  height: 9px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}
.conversion-bar span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: #64748b;
}
.is-winner .conversion-bar span {
  background: #ea580c;
}
.conversion-ad-metrics {
  display: flex;
  gap: 14px;
  margin-top: 9px;
  color: #64748b;
  font-size: 11px;
  flex-wrap: wrap;
}
.conversion-ad-metrics strong {
  color: #1e293b;
  font-size: 12px;
}
.conversion-score {
  color: #0f172a;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.04em;
  text-align: right;
}
.is-winner .conversion-score {
  color: #c2410c;
}
.conversion-method {
  margin-top: 14px;
  padding: 11px 12px;
  border-left: 3px solid #94a3b8;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}
.trend-card {
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid #dedede;
  border-radius: 6px;
  background: #fff;
}
.trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}
.trend-head h2,
.table-head h2 {
  margin: 0;
  font-size: 18px;
}
.trend-head p,
.table-head p {
  margin: 5px 0 0;
  color: #666;
  font-size: 12px;
  line-height: 1.4;
}
.trend-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: #444;
  font-size: 12px;
  white-space: nowrap;
}
.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legend-line {
  display: inline-block;
  width: 22px;
  height: 3px;
  border-radius: 999px;
}
.legend-line.revenue { background: #ea580c; }
.legend-line.spend { background: #334155; }
.trend-chart-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.trend-chart {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
  font-family: inherit;
}
.chart-grid {
  stroke: #e5e7eb;
  stroke-width: 1;
}
.chart-axis {
  stroke: #94a3b8;
  stroke-width: 1;
}
.chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-line.revenue { stroke: #ea580c; }
.chart-line.spend { stroke: #334155; }
.chart-point {
  stroke: #fff;
  stroke-width: 1.5;
}
.chart-point.revenue { fill: #ea580c; }
.chart-point.spend { fill: #334155; }
.chart-y-label,
.chart-x-label {
  fill: #64748b;
  font-size: 11px;
}
.chart-y-label { text-anchor: end; }
.chart-x-label { text-anchor: middle; }
.table-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 10px;
}
.statusline {
  display: grid;
  grid-template-columns: minmax(0, 135px) minmax(0, 150px) minmax(0, 1fr) minmax(0, 120px) minmax(0, 190px) minmax(0, 135px);
  gap: 12px;
  margin-bottom: 18px;
}
.statusline div {
  background: #fff;
  border: 1px solid #dedede;
  border-radius: 6px;
  padding: 12px 14px;
}
.statusline span { display: block; color: #666; font-size: 12px; margin-bottom: 4px; }
.statusline strong { font-size: 14px; }
.statusline .status-ready { border-color: #bbf7d0; background: #f0fdf4; }
.statusline .status-warn { border-color: #fed7aa; background: #fff7ed; }
.connection-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  background: #fff7ed;
}
.connection-alert strong,
.connection-alert span {
  display: block;
}
.connection-alert span {
  color: #68420f;
  font-size: 13px;
  margin-top: 2px;
}
.actions { display: flex; gap: 10px; }
.actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
}
.actions-cell form, .actions form { margin: 0; }
.compact { margin-top: 28px; }
.compact h2 { margin: 0; font-size: 20px; }
.batchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.batchhint {
  color: #555;
  font-size: 13px;
  margin-right: 4px;
}
.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 13px;
  color: #444;
}
.checkline input,
.order-check {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.error-text { color: #9f1d1d; }
.warn-row td { background: #fff8f1; }
.readiness-panel {
  background: #fff;
  border: 1px solid #dedede;
  border-radius: 6px;
  margin-bottom: 18px;
  padding: 16px;
}
.readiness-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.readiness-head h2 { margin: 0; font-size: 20px; }
.readiness-head form { margin: 0; }
.readiness-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.readiness-list li {
  border: 1px solid #dedede;
  border-radius: 6px;
  min-height: 104px;
  padding: 12px;
}
.readiness-list li.ready { background: #f0fdf4; border-color: #bbf7d0; }
.readiness-list li.todo { background: #fff7ed; border-color: #fed7aa; }
.readiness-list strong,
.readiness-list span {
  display: block;
}
.readiness-list strong { margin-bottom: 6px; font-size: 13px; }
.readiness-list span { color: #555; font-size: 12px; line-height: 1.35; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.settings-grid article {
  background: #fff;
  border: 1px solid #dedede;
  border-radius: 6px;
  padding: 16px;
}
.settings-grid h2 { margin: 0 0 12px; font-size: 18px; }
.settings-grid p { margin: 8px 0; color: #444; }
.settings-grid ul { margin: 8px 0 0; padding-left: 18px; }
.action-note {
  display: grid;
  gap: 4px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #fff7ed;
  color: #4f3422;
  font-size: 13px;
  line-height: 1.35;
}
.settings-edit {
  margin-top: 18px;
}
.worker-history {
  margin-top: 18px;
}
.worker-history .readiness-head {
  background: #fff;
  border: 1px solid #dedede;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  margin: 0;
  padding: 14px 16px;
}
.worker-history .orders {
  border-radius: 0 0 6px 6px;
}
.settings-edit form {
  display: grid;
  gap: 14px;
}
.settings-edit article {
  background: #fff;
  border: 1px solid #dedede;
  border-radius: 6px;
  padding: 16px;
}
.settings-edit h2 { margin: 0 0 12px; font-size: 18px; }
.settings-edit label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.settings-edit label span {
  color: #555;
  font-size: 12px;
  font-weight: 700;
}
.settings-edit input,
.settings-edit select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: #171717;
  font: inherit;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
.form-grid .wide { grid-column: 1 / -1; }
.form-inline-action {
  align-self: end;
  margin: 0 0 12px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
}
.ok { color: #166534 !important; }
.bad { color: #9f1d1d !important; }
.warn { color: #92590b !important; }

.counter-page {
  max-width: 1020px;
  margin: 0 auto;
}
.counter-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.counter-heading h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.03em;
}
.counter-heading p {
  margin: 6px 0 0;
  color: #64748b;
}
.counter-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
}
.counter-live span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}
.counter-live.is-offline {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.counter-live.is-offline span {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}
.counter-hidden {
  display: none;
}
.counter-hero {
  position: relative;
  overflow: hidden;
  padding: 42px 24px 38px;
  border: 1px solid #fdba74;
  border-radius: 18px;
  background:
    radial-gradient(circle at 85% 15%, rgba(251, 146, 60, 0.22), transparent 32%),
    linear-gradient(145deg, #fff7ed 0%, #ffffff 72%);
  text-align: center;
  box-shadow: 0 18px 48px rgba(154, 52, 18, 0.08);
}
.counter-today {
  color: #9a3412;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.counter-number {
  display: block;
  margin: 4px 0 10px;
  color: #ea580c;
  font-size: clamp(96px, 22vw, 170px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.08em;
}
.counter-message {
  margin: 0;
  color: #475569;
  font-size: 16px;
  font-weight: 650;
}
.counter-hero.has-new-order {
  animation: counter-new-order 1.2s ease-out;
}
@keyframes counter-new-order {
  0% { transform: scale(1); box-shadow: 0 18px 48px rgba(154, 52, 18, 0.08); }
  35% { transform: scale(1.015); box-shadow: 0 20px 58px rgba(234, 88, 12, 0.28); }
  100% { transform: scale(1); box-shadow: 0 18px 48px rgba(154, 52, 18, 0.08); }
}
.counter-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.counter-metrics article {
  min-width: 0;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.counter-metrics span,
.counter-metrics small,
.counter-metrics strong {
  display: block;
}
.counter-metrics span {
  margin-bottom: 8px;
  color: #64748b;
  font-size: 12px;
}
.counter-metrics strong {
  color: #0f172a;
  font-size: 24px;
  overflow-wrap: anywhere;
}
.counter-metrics small {
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
}
.counter-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: #64748b;
  font-size: 11px;
}
.sales-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 14px;
}
.sales-total,
.sales-today {
  min-width: 0;
  border-radius: 16px;
}
.sales-total {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  padding: 30px;
  border: 1px solid #fdba74;
  background:
    radial-gradient(circle at 85% 15%, rgba(251, 146, 60, 0.24), transparent 32%),
    linear-gradient(145deg, #fff7ed 0%, #fff 70%);
  box-shadow: 0 16px 42px rgba(154, 52, 18, 0.08);
}
.sales-total > span,
.sales-total > strong,
.sales-total > small {
  display: block;
}
.sales-total > span {
  color: #9a3412;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sales-total > strong {
  margin: 8px 0 4px;
  color: #ea580c;
  font-size: clamp(94px, 15vw, 150px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.08em;
}
.sales-total > p {
  margin: 16px 0 0;
  color: #334155;
  font-size: 18px;
  font-weight: 750;
}
.sales-total > small {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
}
.sales-total.has-new-order {
  animation: counter-new-order 1.2s ease-out;
}
.sales-today {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border: 1px solid #e2e8f0;
  background: #0f172a;
  color: #fff;
}
.sales-today .eyebrow {
  color: #fdba74;
}
.sales-today-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.sales-today-head h2 {
  margin: 0;
  max-width: 220px;
  font-size: 24px;
  line-height: 1.15;
}
.sales-today-head > strong {
  color: #fb923c;
  font-size: 66px;
  line-height: 0.9;
  letter-spacing: -0.07em;
}
.sales-today-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}
.sales-today-metrics div {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}
.sales-today-metrics span,
.sales-today-metrics strong {
  display: block;
}
.sales-today-metrics span {
  margin-bottom: 6px;
  color: #cbd5e1;
  font-size: 11px;
}
.sales-today-metrics strong {
  font-size: 22px;
}
.sales-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.sales-kpis article {
  min-width: 0;
  padding: 17px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.sales-kpis span,
.sales-kpis strong,
.sales-kpis small {
  display: block;
}
.sales-kpis span {
  margin-bottom: 8px;
  color: #64748b;
  font-size: 11px;
}
.sales-kpis strong {
  color: #0f172a;
  font-size: 22px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.sales-kpis small {
  margin-top: 5px;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.35;
}
.sales-chart-card {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}
.sales-chart-card header h2 {
  margin: 0;
  font-size: 18px;
}
.sales-chart-card header p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 11px;
}
.sales-chart-scroll {
  margin-top: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sales-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(34px, 1fr));
  gap: 8px;
  min-width: 640px;
  height: 180px;
}
.sales-chart-day {
  display: grid;
  grid-template-rows: 20px 1fr 24px;
  gap: 5px;
  min-width: 0;
  text-align: center;
}
.sales-chart-day > strong {
  color: #475569;
  font-size: 11px;
}
.sales-chart-track {
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 6px 6px 2px 2px;
  background: #f1f5f9;
}
.sales-chart-track span {
  display: block;
  width: 100%;
  min-height: 0;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
}
.sales-chart-day > small {
  color: #64748b;
  font-size: 9px;
  white-space: nowrap;
}
.sales-source-note {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  body {
    background: #fff;
  }

  .topbar {
    height: auto;
    min-height: 58px;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }

  .topbar span {
    display: block;
    margin: 2px 0 0;
    font-size: 12px;
  }

  .topbar nav {
    display: flex;
    width: 100%;
    gap: 0;
    padding-top: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .topbar a {
    flex: 0 0 auto;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    font-size: 12.5px;
    white-space: nowrap;
  }

  .shell {
    padding: 16px 12px 28px;
  }

  .page-head {
    margin-bottom: 14px;
  }

  .page-head h1 {
    font-size: 24px;
    line-height: 1.15;
  }

  .page-head p {
    line-height: 1.4;
  }

  .statusline,
  .readiness-list,
  .form-grid,
  .settings-grid,
  .summary {
    grid-template-columns: 1fr;
  }

  .summary.six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary > div {
    min-width: 0;
  }

  .summary strong {
    overflow-wrap: anywhere;
  }

  .conversion-board {
    margin-left: -12px;
    margin-right: -12px;
    padding: 16px 12px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .order-source-board {
    margin-left: -12px;
    margin-right: -12px;
    padding: 16px 12px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .order-source-head {
    flex-direction: column;
  }

  .order-source-equation {
    width: 100%;
  }

  .order-source-grid {
    grid-template-columns: 1fr;
  }

  .source-breakdown-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-breakdown-head small {
    max-width: none;
    text-align: left;
  }

  .source-breakdown-list {
    grid-template-columns: 1fr;
  }

  .source-order-title,
  .source-order-title > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-journey {
    grid-template-columns: 1fr;
  }

  .conversion-head,
  .winner-conversion {
    align-items: flex-start;
    flex-direction: column;
  }

  .conversion-definition {
    width: 100%;
  }

  .conversion-winner {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .winner-conversion {
    gap: 4px;
  }

  .winner-conversion strong {
    font-size: 46px;
  }

  .winner-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .winner-metrics div {
    padding: 10px 8px;
  }

  .winner-metrics strong {
    font-size: 17px;
  }

  .conversion-ad {
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: flex-start;
    padding: 12px;
  }

  .conversion-ad-title {
    flex-direction: column;
    gap: 7px;
  }

  .conversion-score {
    display: none;
  }

  .conversion-ad-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
  }

  .statusline,
  .summary {
    gap: 8px;
  }

  .connection-alert {
    align-items: stretch;
    flex-direction: column;
  }

  .split,
  .actions-cell,
  .trend-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .trend-card {
    margin-left: -12px;
    margin-right: -12px;
    padding: 14px 12px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .trend-legend {
    white-space: normal;
  }

  .trend-chart-scroll {
    max-width: 100%;
  }

  .trend-chart {
    min-width: 0;
  }

  .split > form,
  .head-actions,
  .head-actions form {
    width: 100%;
  }

  .head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .batchbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .batchbar .button,
  .page-head .button,
  .split form .button,
  .actions-cell .button,
  .actions-cell form,
  .actions-cell form button {
    width: 100%;
  }

  .button {
    min-height: 44px;
    padding: 0 14px;
    font-size: 15px;
  }

  .button.secondary {
    min-height: 40px;
    font-size: 14px;
  }

  .checkline {
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #dedede;
    border-radius: 6px;
    background: #fff;
  }

  .orders {
    display: block;
    border: 0;
    background: transparent;
  }

  .orders thead {
    display: none;
  }

  .orders tbody,
  .orders tr,
  .orders td {
    display: block;
    width: 100%;
  }

  .orders tr {
    margin: 0 0 10px;
    border: 1px solid #dedede;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
  }

  .orders td {
    display: grid;
    grid-template-columns: minmax(90px, 36%) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 40px;
    padding: 10px 12px;
    border-bottom: 1px solid #ececec;
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  .orders td:last-child {
    border-bottom: 0;
  }

  .orders td::before {
    content: attr(data-label);
    color: #666;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .orders td[data-label=""] {
    display: block;
  }

  .orders td[data-label=""]::before {
    display: none;
  }

  .empty {
    padding: 22px 14px;
  }

  .settings-edit input,
  .settings-edit select {
    min-height: 44px;
    font-size: 16px;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .button {
    width: 100%;
  }

  .counter-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .sales-overview {
    grid-template-columns: 1fr;
  }

  .sales-total {
    min-height: 250px;
    padding: 24px;
  }

  .sales-today {
    padding: 20px;
  }

  .sales-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .sales-kpis article {
    padding: 14px;
  }

  .sales-chart-card {
    margin-left: -12px;
    margin-right: -12px;
    padding: 18px 12px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .counter-hero {
    padding: 34px 16px 30px;
    border-radius: 14px;
  }

  .counter-metrics {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .counter-metrics article {
    padding: 15px 16px;
  }

  .counter-footer {
    flex-direction: column;
    gap: 4px;
  }
}

.display-body {
  min-width: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(234, 88, 12, 0.16), transparent 30%),
    #070b14;
  color: #f8fafc;
  overflow: hidden;
}
.sales-display {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(14px, 1.5vw, 24px);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: clamp(18px, 2vw, 36px);
}
.display-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.display-portal-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid #1e293b;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
}
.display-portal-nav a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.display-portal-nav a:hover {
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.78);
}
.display-portal-nav a.is-active {
  border-color: rgba(251, 146, 60, 0.35);
  background: rgba(249, 115, 22, 0.12);
  color: #fb923c;
}
.display-brand span {
  display: block;
  color: #fb923c;
  font-size: clamp(11px, 0.8vw, 15px);
  font-weight: 900;
  letter-spacing: 0.18em;
}
.display-brand h1 {
  margin: 3px 0 0;
  font-size: clamp(24px, 2vw, 38px);
  line-height: 1;
  letter-spacing: -0.04em;
}
.display-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.display-live {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
  font-size: 13px;
}
.display-live > span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 5px rgba(74, 222, 128, 0.12);
}
.display-live.is-offline {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}
.display-live.is-offline > span {
  background: #f87171;
  box-shadow: 0 0 0 5px rgba(248, 113, 113, 0.12);
}
.display-clock {
  min-width: 150px;
  text-align: right;
}
.display-clock strong,
.display-clock span {
  display: block;
}
.display-clock strong {
  font-size: clamp(24px, 2vw, 36px);
  line-height: 1;
  letter-spacing: -0.04em;
}
.display-clock span {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 11px;
  text-transform: capitalize;
}
.display-fullscreen-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #334155;
  border-radius: 9px;
  background: #111827;
  color: #f8fafc;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
:fullscreen .display-fullscreen-button {
  display: none;
}
.display-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) repeat(3, minmax(190px, 0.65fr));
  grid-template-rows: minmax(190px, 0.8fr) minmax(250px, 1.2fr);
  gap: clamp(12px, 1vw, 18px);
  min-height: 0;
}
.display-total-card,
.display-kpi,
.display-chart-card {
  min-width: 0;
  border: 1px solid #1e293b;
  border-radius: clamp(14px, 1.2vw, 22px);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.display-total-card {
  position: relative;
  display: flex;
  grid-column: 1;
  grid-row: 1 / 3;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(26px, 3vw, 54px);
  border-color: rgba(251, 146, 60, 0.42);
  background:
    radial-gradient(circle at 80% 14%, rgba(251, 146, 60, 0.22), transparent 34%),
    linear-gradient(145deg, #18110d 0%, #0f172a 68%);
}
.display-total-card > strong {
  display: block;
  margin: clamp(10px, 1.4vh, 18px) 0 0;
  color: #fb7a21;
  font-size: clamp(150px, 18vw, 310px);
  font-weight: 950;
  line-height: 0.78;
  letter-spacing: -0.09em;
}
.display-total-card > h2 {
  margin: clamp(18px, 2.5vh, 30px) 0 0;
  font-size: clamp(30px, 3vw, 54px);
  line-height: 1;
  letter-spacing: -0.04em;
}
.display-total-card > p {
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: clamp(12px, 0.9vw, 16px);
}
.display-label {
  display: block;
  color: #fb923c;
  font-size: clamp(11px, 0.8vw, 14px);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.display-latest {
  margin-top: auto;
  padding-top: clamp(18px, 3vh, 34px);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}
.display-latest span,
.display-latest strong,
.display-latest small {
  display: block;
}
.display-latest span {
  color: #94a3b8;
  font-size: clamp(11px, 0.8vw, 14px);
}
.display-latest strong {
  margin-top: 5px;
  font-size: clamp(24px, 2.2vw, 42px);
}
.display-latest small {
  margin-top: 5px;
  color: #64748b;
  font-size: clamp(11px, 0.75vw, 14px);
}
.display-total-card.has-new-order {
  animation: display-new-order 1.4s ease-out;
}
@keyframes display-new-order {
  0% { transform: scale(1); border-color: rgba(251, 146, 60, 0.42); }
  35% { transform: scale(1.015); border-color: #fb923c; box-shadow: 0 0 90px rgba(251, 146, 60, 0.34); }
  100% { transform: scale(1); border-color: rgba(251, 146, 60, 0.42); }
}
.display-kpi {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(18px, 1.7vw, 30px);
}
.display-kpi > strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(44px, 4.2vw, 76px);
  line-height: 0.92;
  letter-spacing: -0.06em;
}
.display-kpi > p {
  margin: 8px 0 0;
  color: #cbd5e1;
  font-size: clamp(13px, 1vw, 18px);
  font-weight: 750;
}
.display-kpi > div {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #1e293b;
}
.display-kpi > div span,
.display-kpi > div small {
  display: block;
}
.display-kpi > div span {
  color: #f8fafc;
  font-size: clamp(19px, 1.5vw, 28px);
  font-weight: 850;
}
.display-kpi > div small {
  margin-top: 4px;
  color: #64748b;
  font-size: clamp(10px, 0.7vw, 12px);
}
.display-kpi-today {
  border-color: rgba(251, 146, 60, 0.34);
}
.display-kpi-today > strong {
  color: #fb923c;
}
.display-chart-card {
  display: grid;
  grid-column: 2 / 5;
  grid-row: 2;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding: clamp(18px, 1.7vw, 30px);
}
.display-chart-card header h2 {
  margin: 4px 0 0;
  font-size: clamp(20px, 1.6vw, 30px);
}
.display-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: clamp(5px, 0.6vw, 11px);
  min-height: 0;
  margin-top: clamp(12px, 1.6vh, 22px);
}
.display-chart-day {
  display: grid;
  grid-template-rows: 22px minmax(0, 1fr) 22px;
  gap: 5px;
  min-width: 0;
  text-align: center;
}
.display-chart-day > strong {
  color: #cbd5e1;
  font-size: clamp(10px, 0.7vw, 13px);
}
.display-chart-day > div {
  display: flex;
  align-items: flex-end;
  min-height: 0;
  overflow: hidden;
  border-radius: 6px 6px 2px 2px;
  background: rgba(30, 41, 59, 0.72);
}
.display-chart-day > div span {
  display: block;
  width: 100%;
  min-height: 0;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
}
.display-chart-day > small {
  color: #64748b;
  font-size: clamp(8px, 0.58vw, 11px);
  white-space: nowrap;
}
.display-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #64748b;
  font-size: clamp(10px, 0.7vw, 13px);
}
.display-order-alert {
  position: fixed;
  top: 28px;
  left: 50%;
  z-index: 20;
  transform: translate(-50%, -140%);
  padding: 16px 24px;
  border: 1px solid #fdba74;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 18px 50px rgba(234, 88, 12, 0.25);
  opacity: 0;
  transition: transform 300ms ease, opacity 300ms ease;
}
.display-order-alert.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 900px) {
  .display-body {
    overflow: auto;
  }

  .sales-display {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    padding: 16px;
  }

  .display-header,
  .display-header-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .display-header-actions {
    width: 100%;
    gap: 10px;
  }

  .display-clock {
    text-align: left;
  }

  .display-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    margin-top: 18px;
  }

  .display-total-card {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 440px;
  }

  .display-kpi {
    min-height: 230px;
  }

  .display-chart-card {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 330px;
  }

  .display-footer {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 16px;
  }
}

@media (max-width: 560px) {
  .display-body {
    overflow: hidden;
  }

  .sales-display {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 10px;
  }

  .display-header,
  .display-header-actions {
    align-items: center;
    flex-direction: row;
  }

  .display-header {
    gap: 8px;
  }

  .display-header-actions {
    width: auto;
    margin-left: auto;
    gap: 8px;
  }

  .display-brand span {
    font-size: 8px;
  }

  .display-brand h1 {
    font-size: 20px;
  }

  .display-live {
    min-height: 28px;
    padding: 0 9px;
    font-size: 10px;
  }

  .display-live > span {
    width: 7px;
    height: 7px;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
  }

  .display-clock {
    min-width: 46px;
    text-align: right;
  }

  .display-clock strong {
    font-size: 18px;
  }

  .display-clock span,
  .display-fullscreen-button {
    display: none;
  }

  .display-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows:
      minmax(150px, 1.25fr)
      minmax(105px, 0.9fr)
      minmax(68px, 0.55fr)
      minmax(150px, 1.25fr);
    gap: 8px;
    min-height: 0;
    margin-top: 0;
  }

  .display-total-card {
    display: block;
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 0;
    padding: 14px;
    border-radius: 14px;
  }

  .display-total-card > strong {
    margin: 7px 0 0;
    font-size: clamp(70px, 23vw, 94px);
    line-height: 0.82;
  }

  .display-total-card > h2 {
    margin-top: 12px;
    font-size: 23px;
  }

  .display-total-card > p {
    margin-top: 4px;
    font-size: 9px;
  }

  .display-label {
    font-size: 8px;
  }

  .display-latest {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 46%;
    margin: 0;
    padding: 0 0 0 12px;
    border-top: 0;
    border-left: 1px solid rgba(148, 163, 184, 0.18);
  }

  .display-latest span {
    font-size: 8px;
  }

  .display-latest strong {
    margin-top: 3px;
    font-size: 18px;
  }

  .display-latest small {
    margin-top: 3px;
    font-size: 8px;
  }

  .display-kpi {
    min-height: 0;
    padding: 11px;
    border-radius: 12px;
  }

  .display-kpi > strong {
    margin-top: 5px;
    font-size: clamp(27px, 8vw, 34px);
  }

  .display-kpi > p {
    margin-top: 3px;
    font-size: 10px;
  }

  .display-kpi > div {
    padding-top: 7px;
  }

  .display-kpi > div span {
    font-size: 15px;
  }

  .display-kpi > div small {
    margin-top: 1px;
    font-size: 7px;
  }

  .display-kpi-units {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 2px 10px;
    align-items: center;
    padding: 9px 12px;
  }

  .display-kpi-units .display-label {
    grid-column: 1;
    grid-row: 1;
  }

  .display-kpi-units > strong {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
  }

  .display-kpi-units > p {
    display: none;
  }

  .display-kpi-units > div {
    grid-column: 3;
    grid-row: 1 / 3;
    margin: 0;
    padding: 0;
    border: 0;
    text-align: right;
  }

  .display-chart-card {
    grid-column: 1 / -1;
    grid-row: 4;
    min-height: 0;
    padding: 11px;
    border-radius: 12px;
  }

  .display-chart-card header h2 {
    margin-top: 2px;
    font-size: 15px;
  }

  .display-chart {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    min-height: 0;
    margin-top: 6px;
  }

  .display-chart-day:nth-child(-n+7) {
    display: none;
  }

  .display-chart-day {
    grid-template-rows: 14px minmax(0, 1fr) 15px;
    gap: 2px;
  }

  .display-chart-day > strong {
    font-size: 8px;
  }

  .display-chart-day > small {
    font-size: 7px;
  }

  .display-footer {
    align-items: center;
    flex-direction: row;
    margin: 0;
    font-size: 8px;
  }

  .display-footer [data-display-status] {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .display-order-alert {
    top: 12px;
    padding: 11px 16px;
    font-size: 13px;
  }
}

@media (max-height: 560px) and (min-width: 561px) {
  .display-body {
    overflow: hidden;
  }

  .sales-display {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    padding: 10px;
  }

  .display-header,
  .display-header-actions {
    align-items: center;
    flex-direction: row;
  }

  .display-header-actions {
    width: auto;
    margin-left: auto;
  }

  .display-fullscreen-button {
    display: none;
  }

  .display-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.2fr) repeat(3, minmax(120px, 0.65fr));
    grid-template-rows: minmax(110px, 0.8fr) minmax(140px, 1.2fr);
    min-height: 0;
    margin-top: 0;
  }

  .display-total-card {
    grid-column: 1;
    grid-row: 1 / 3;
    min-height: 0;
  }

  .display-kpi {
    min-height: 0;
  }

  .display-chart-card {
    grid-column: 2 / 5;
    grid-row: 2;
    min-height: 0;
  }

  .display-footer {
    align-items: center;
    flex-direction: row;
    margin: 0;
  }
}

/* Marketing navigation and reel retention */
.marketing-subnav {
  display: inline-flex;
  gap: 4px;
  margin: -6px 0 18px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}
.marketing-subnav a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 7px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.marketing-subnav a.active {
  background: #0f172a;
  color: #fff;
}
.retention-page-head {
  margin-bottom: 12px;
}
.retention-state {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin: 0 0 24px;
  padding: 28px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background:
    radial-gradient(circle at 88% 15%, rgba(251, 146, 60, 0.16), transparent 28%),
    #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.retention-state h2,
.retention-state p {
  margin: 0;
}
.retention-state h2 {
  font-size: 22px;
}
.retention-state p {
  max-width: 680px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}
.retention-state .button,
.retention-state form {
  margin-top: 6px;
}
.retention-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.retention-kpis article {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}
.retention-kpis article.highlight {
  border-color: #fdba74;
  background: #fff7ed;
}
.retention-kpis span,
.retention-kpis strong,
.retention-kpis small {
  display: block;
}
.retention-kpis span {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}
.retention-kpis strong {
  margin-top: 7px;
  color: #0f172a;
  font-size: 23px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.retention-kpis article.highlight strong {
  color: #9a3412;
  font-size: 17px;
}
.retention-kpis small {
  margin-top: 6px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
}
.retention-board {
  margin: 0 0 24px;
  padding: 20px;
  border: 1px solid #dfe3e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.retention-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.retention-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.retention-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
}
.retention-definition {
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.retention-definition strong,
.retention-definition span {
  display: block;
}
.retention-definition strong {
  font-size: 12px;
}
.retention-definition span {
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
}
.retention-winner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: 20px;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid #fdba74;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 72%);
}
.retention-winner-copy h3 {
  margin: 8px 0 0;
  font-size: 20px;
  line-height: 1.25;
}
.retention-winner-copy > p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}
.retention-winner-score {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 16px;
}
.retention-winner-score strong {
  color: #c2410c;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.05em;
}
.retention-winner-score span {
  color: #475569;
  font-size: 13px;
}
.retention-winner-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.retention-winner-metrics div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}
.retention-winner-metrics span {
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
}
.retention-winner-metrics strong {
  margin-top: 5px;
  color: #0f172a;
  font-size: 19px;
}
.retention-ranking {
  display: grid;
  gap: 9px;
}
.retention-reel {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 80px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
}
.retention-reel.is-winner {
  border-color: #fdba74;
  background: #fffaf5;
}
.retention-rank {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}
.retention-reel.is-winner .retention-rank {
  background: #ea580c;
  color: #fff;
}
.retention-reel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.retention-reel-title strong,
.retention-reel-title div > span {
  display: block;
}
.retention-reel-title strong {
  font-size: 14px;
  line-height: 1.25;
}
.retention-reel-title div > span {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
}
.retention-bar {
  height: 9px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}
.retention-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #64748b;
}
.retention-reel.is-winner .retention-bar span {
  background: #ea580c;
}
.retention-reel-metrics {
  display: flex;
  gap: 10px 18px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.retention-reel-metrics > span {
  min-width: 82px;
}
.retention-reel-metrics small,
.retention-reel-metrics strong {
  display: block;
}
.retention-reel-metrics small {
  color: #64748b;
  font-size: 10px;
}
.retention-reel-metrics strong {
  margin-top: 2px;
  color: #1e293b;
  font-size: 12px;
}
.retention-score {
  text-align: right;
}
.retention-score strong,
.retention-score span {
  display: block;
}
.retention-score strong {
  color: #0f172a;
  font-size: 23px;
  letter-spacing: -0.04em;
}
.retention-reel.is-winner .retention-score strong {
  color: #c2410c;
}
.retention-score span {
  color: #64748b;
  font-size: 10px;
}
.retention-inline-empty {
  padding: 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}
.retention-method {
  margin-top: 14px;
  padding: 11px 12px;
  border-left: 3px solid #94a3b8;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .marketing-subnav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin: -2px 0 16px;
  }

  .marketing-subnav a {
    min-height: 44px;
    padding: 0 10px;
    font-size: 13px;
  }

  .retention-state {
    margin-left: -12px;
    margin-right: -12px;
    padding: 22px 16px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .retention-state .button,
  .retention-state form {
    width: 100%;
  }

  .retention-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .retention-kpis article {
    padding: 14px 12px;
  }

  .retention-kpis strong {
    font-size: 20px;
  }

  .retention-board {
    margin-left: -12px;
    margin-right: -12px;
    padding: 16px 12px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .retention-head,
  .retention-winner-score {
    align-items: flex-start;
    flex-direction: column;
  }

  .retention-definition {
    width: 100%;
  }

  .retention-winner {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .retention-winner-score {
    gap: 4px;
  }

  .retention-winner-score strong {
    font-size: 42px;
  }

  .retention-winner-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .retention-reel {
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: flex-start;
    padding: 12px;
  }

  .retention-reel-title {
    flex-direction: column;
    gap: 7px;
  }

  .retention-reel-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
  }

  .retention-reel-metrics > span {
    min-width: 0;
  }

  .retention-score {
    display: none;
  }
}

@media (max-width: 420px) {
  .retention-kpis {
    grid-template-columns: 1fr;
  }

  .retention-kpis article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    column-gap: 12px;
  }

  .retention-kpis strong {
    margin-top: 0;
    text-align: right;
  }

  .retention-kpis small {
    grid-column: 1 / -1;
  }
}

/* Compact source-and-cost sales dashboard */
.counter-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.sales-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.sales-snapshot-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.sales-snapshot-card > span,
.sales-snapshot-card > strong,
.sales-snapshot-card > small {
  display: block;
}

.sales-snapshot-card > span {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}

.sales-snapshot-card > strong {
  margin-top: 7px;
  color: #0f172a;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.sales-snapshot-card > small {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.35;
}

.sales-snapshot-card.primary {
  border-color: #fdba74;
  background: linear-gradient(145deg, #fff7ed 0%, #fff 78%);
}

.sales-snapshot-card.primary > strong {
  color: #ea580c;
}

.sales-snapshot-card.dark {
  border-color: #0f172a;
  background: #0f172a;
}

.sales-snapshot-card.dark > span,
.sales-snapshot-card.dark > small {
  color: #cbd5e1;
}

.sales-snapshot-card.dark > strong {
  color: #fb923c;
}

.sales-snapshot-card.has-new-order {
  animation: counter-new-order 1.2s ease-out;
}

.source-overview-card,
.recent-sales-section,
.service-orders {
  margin-top: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.035);
}

.source-overview-card {
  padding: 20px;
}

.source-overview-head,
.recent-sales-section > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.source-overview-head h2,
.recent-sales-section > header h2 {
  margin: 3px 0 0;
  color: #0f172a;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.source-overview-head > strong {
  color: #0f172a;
  font-size: 15px;
}

.source-balance,
.display-source-bar {
  display: flex;
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.source-balance {
  height: 14px;
  margin-top: 17px;
}

.source-balance > span,
.display-source-bar > span {
  display: block;
  min-width: 0;
  transition: width 240ms ease;
}

.source-balance-paid,
.display-source-bar > .is-paid {
  background: #f97316;
}

.source-balance-organic,
.display-source-bar > .is-organic {
  background: #10b981;
}

.source-balance-pending,
.display-source-bar > .is-pending {
  background: #f59e0b;
}

.source-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.source-legend > div {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 2px 8px;
  min-width: 0;
  padding: 10px 11px;
  border-radius: 10px;
  background: #f8fafc;
}

.source-legend i,
.display-source-legend i {
  display: block;
  width: 8px;
  height: 8px;
  margin-top: 3px;
  border-radius: 999px;
}

.source-legend .is-paid i,
.display-source-legend .is-paid i { background: #f97316; }
.source-legend .is-organic i,
.display-source-legend .is-organic i { background: #10b981; }
.source-legend .is-pending i,
.display-source-legend .is-pending i { background: #f59e0b; }

.source-legend span,
.source-legend strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.source-legend span {
  color: #64748b;
  font-size: 10px;
}

.source-legend strong {
  grid-column: 2;
  color: #0f172a;
  font-size: 12px;
}

.source-cost-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.source-cost-scope {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 9px;
  line-height: 1.35;
}

.source-cost-scope strong {
  color: #334155;
  font-size: 9px;
}

.source-cost-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.source-cost-grid span,
.source-cost-grid strong,
.source-cost-grid small {
  display: block;
}

.source-cost-grid span {
  min-height: 28px;
  color: #64748b;
  font-size: 9px;
  line-height: 1.35;
}

.source-cost-grid strong {
  margin-top: 5px;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.source-cost-grid small {
  margin-top: 5px;
  color: #64748b;
  font-size: 8px;
  font-weight: 500;
  line-height: 1.3;
}

.source-cost-grid small b {
  color: inherit;
  font-size: inherit;
}

.source-cost-grid .is-conversion {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.source-cost-grid .is-conversion strong { color: #1d4ed8; }

.source-cost-grid .is-primary-kpi {
  border-width: 2px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.055);
}

.source-cost-grid .is-cost-kpi {
  border-color: #fdba74;
  background: #fff7ed;
}

.source-cost-grid .is-cost-kpi strong { color: #c2410c; }

.source-cost-grid .is-positive {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.source-cost-grid .is-positive strong { color: #047857; }
.source-cost-grid .is-negative {
  border-color: #fecaca;
  background: #fef2f2;
}
.source-cost-grid .is-negative strong { color: #b91c1c; }
.source-cost-grid .is-warning {
  border-color: #fed7aa;
  background: #fff7ed;
}
.source-cost-grid .is-warning strong { color: #c2410c; }

.source-cost-note {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.45;
}

.recent-sales-section {
  padding: 20px;
}

.recent-sales-section > header > small {
  max-width: 260px;
  color: #94a3b8;
  font-size: 10px;
  text-align: right;
}

.recent-sales-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.sales-order-card {
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) minmax(220px, 1.35fr);
  gap: 8px 14px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #e2e8f0;
  border-left-width: 4px;
  border-radius: 11px;
  background: #fff;
}

.sales-order-card.is-paid { border-left-color: #f97316; }
.sales-order-card.is-organic { border-left-color: #10b981; }
.sales-order-card.is-pending { border-left-color: #f59e0b; }
.sales-order-card.is-service { border-left-color: #94a3b8; background: #f8fafc; }

.sales-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.sales-order-head > div:first-child,
.sales-order-value,
.sales-order-source,
.sales-order-cost {
  min-width: 0;
}

.sales-order-head span,
.sales-order-head strong,
.sales-order-value span,
.sales-order-value strong,
.sales-order-cost span,
.sales-order-cost strong,
.sales-order-cost small {
  display: block;
}

.sales-order-head > div:first-child > span {
  color: #94a3b8;
  font-size: 9px;
}

.sales-order-head > div:first-child > strong {
  margin-top: 4px;
  color: #0f172a;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.sales-order-value {
  text-align: right;
}

.sales-order-value strong {
  color: #0f172a;
  font-size: 14px;
}

.sales-order-value span {
  margin-top: 3px;
  color: #64748b;
  font-size: 9px;
}

.sales-order-source {
  display: flex;
  align-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.source-badge,
.method-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  max-width: 100%;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.source-badge.is-paid { background: #ffedd5; color: #c2410c; }
.source-badge.is-organic { background: #d1fae5; color: #047857; }
.source-badge.is-pending { background: #fef3c7; color: #92400e; }
.source-badge.is-service { background: #e2e8f0; color: #475569; }
.method-badge { background: #f1f5f9; color: #475569; }

.sales-order-source p {
  flex-basis: 100%;
  margin: 2px 0 0;
  color: #64748b;
  font-size: 9px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.sales-order-cost {
  padding-left: 12px;
  border-left: 1px solid #e2e8f0;
}

.sales-order-cost > span {
  color: #94a3b8;
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.sales-order-cost > strong {
  margin-top: 3px;
  color: #0f172a;
  font-size: 15px;
}

.sales-order-cost > small {
  margin-top: 3px;
  color: #64748b;
  font-size: 8px;
  line-height: 1.3;
}

.sales-order-proof {
  grid-column: 1 / -1;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
  color: #64748b;
  font-size: 9px;
}

.sales-order-proof summary {
  color: #475569;
  font-weight: 750;
  cursor: pointer;
}

.sales-order-proof ul {
  margin: 7px 0 0;
  padding-left: 17px;
  line-height: 1.45;
}

.recent-sales-empty,
.display-orders-empty {
  margin: 0;
  padding: 20px;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

.service-orders {
  padding: 0;
  color: #475569;
}

.service-orders > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.service-orders > p,
.service-orders > .recent-sales-list {
  margin-right: 18px;
  margin-left: 18px;
}

.service-orders > p {
  margin-top: 0;
  color: #94a3b8;
  font-size: 10px;
}

.service-orders > .recent-sales-list {
  margin-bottom: 18px;
}

.counter-page .sales-kpis {
  margin-top: 12px;
}

.counter-page .sales-chart-card {
  margin-top: 12px;
}

/* Full-screen monitor, using the same source and cost hierarchy */
.display-dashboard {
  display: grid;
  grid-template-rows: auto auto minmax(220px, 1fr) minmax(110px, 0.52fr);
  gap: clamp(9px, 1vw, 15px);
  min-height: 0;
  overflow: hidden;
}

.display-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 0.75vw, 12px);
}

.display-summary-card,
.display-finance-panel,
.display-source-panel,
.display-recent-panel,
.display-lifetime-strip,
.display-trend-card {
  min-width: 0;
  border: 1px solid #1e293b;
  border-radius: clamp(12px, 1vw, 18px);
  background: rgba(15, 23, 42, 0.93);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.18);
}

.display-summary-card {
  min-height: 88px;
  padding: clamp(12px, 1.1vw, 18px);
}

.display-summary-card > span,
.display-summary-card > strong,
.display-summary-card > small {
  display: block;
}

.display-summary-card > span {
  color: #94a3b8;
  font-size: clamp(9px, 0.68vw, 12px);
  font-weight: 750;
}

.display-summary-card > strong {
  margin-top: 5px;
  color: #f8fafc;
  font-size: clamp(24px, 2.4vw, 42px);
  line-height: 1;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

.display-summary-card > small {
  margin-top: 5px;
  color: #64748b;
  font-size: clamp(8px, 0.56vw, 10px);
}

.display-summary-card.is-primary {
  border-color: rgba(251, 146, 60, 0.45);
  background: linear-gradient(145deg, #27170e 0%, #0f172a 75%);
}

.display-summary-card.is-primary > strong,
.display-summary-card.is-dark > strong { color: #fb923c; }

.display-summary-card.is-result {
  border-color: rgba(52, 211, 153, 0.38);
  background: linear-gradient(145deg, rgba(6, 78, 59, 0.36), #0f172a 72%);
}

.display-summary-card.is-result.is-negative {
  border-color: rgba(248, 113, 113, 0.42);
  background: linear-gradient(145deg, rgba(127, 29, 29, 0.3), #0f172a 72%);
}

.display-summary-card.is-result.is-positive > strong { color: #6ee7b7; }
.display-summary-card.is-result.is-negative > strong { color: #fca5a5; }

.display-finance-panel {
  min-width: 0;
  padding: clamp(10px, 0.9vw, 14px);
}

.display-finance-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.display-finance-panel h2 {
  margin: 2px 0 0;
  color: #f8fafc;
  font-size: clamp(13px, 1vw, 18px);
  line-height: 1.1;
}

.display-finance-quality {
  max-width: 42%;
  color: #94a3b8;
  font-size: clamp(7px, 0.5vw, 9px);
  text-align: right;
}

.display-finance-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr) auto) minmax(0, 1.08fr);
  align-items: stretch;
  gap: clamp(4px, 0.45vw, 8px);
  margin-top: 8px;
}

.display-finance-flow > div {
  min-width: 0;
  padding: clamp(7px, 0.65vw, 10px);
  border: 1px solid #273449;
  border-radius: 9px;
  background: rgba(2, 6, 23, 0.3);
}

.display-finance-flow > i {
  align-self: center;
  color: #64748b;
  font-size: clamp(13px, 1.2vw, 21px);
  font-style: normal;
  font-weight: 800;
}

.display-finance-flow span,
.display-finance-flow strong,
.display-finance-flow small { display: block; }
.display-finance-flow span {
  color: #94a3b8;
  font-size: clamp(7px, 0.5vw, 9px);
}
.display-finance-flow strong {
  margin-top: 3px;
  color: #f8fafc;
  font-size: clamp(13px, 1.1vw, 19px);
  line-height: 1;
  overflow-wrap: anywhere;
}
.display-finance-flow small {
  margin-top: 3px;
  color: #64748b;
  font-size: clamp(6px, 0.42vw, 8px);
  line-height: 1.15;
}
.display-finance-flow .is-start { border-color: rgba(96, 165, 250, 0.34); }
.display-finance-flow .is-start strong { color: #93c5fd; }
.display-finance-flow .is-result.is-positive { border-color: rgba(52, 211, 153, 0.38); }
.display-finance-flow .is-result.is-positive strong { color: #6ee7b7; }
.display-finance-flow .is-result.is-negative { border-color: rgba(248, 113, 113, 0.42); }
.display-finance-flow .is-result.is-negative strong { color: #fca5a5; }
.display-finance-panel > p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: clamp(6px, 0.43vw, 8px);
  line-height: 1.25;
}

.display-summary-card.has-new-order {
  animation: display-new-order 1.4s ease-out;
}

.display-insight-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(430px, 1.28fr);
  gap: clamp(9px, 1vw, 15px);
  min-height: 0;
}

.display-source-panel,
.display-recent-panel,
.display-trend-card {
  padding: clamp(13px, 1.25vw, 21px);
  overflow: hidden;
}

.display-source-panel > header,
.display-recent-panel > header,
.display-trend-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.display-source-panel h2,
.display-recent-panel h2,
.display-trend-card h2 {
  margin: 3px 0 0;
  color: #f8fafc;
  font-size: clamp(16px, 1.25vw, 23px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.display-source-panel > header > strong {
  color: #cbd5e1;
  font-size: clamp(10px, 0.75vw, 13px);
}

.display-source-bar {
  height: 13px;
  margin-top: clamp(10px, 1.1vh, 16px);
  background: #334155;
}

.display-source-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.display-source-legend > div {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 2px 6px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.7);
}

.display-source-legend span,
.display-source-legend strong {
  overflow-wrap: anywhere;
}

.display-source-legend span {
  color: #94a3b8;
  font-size: clamp(7px, 0.48vw, 9px);
}

.display-source-legend strong {
  grid-column: 2;
  color: #e2e8f0;
  font-size: clamp(8px, 0.58vw, 10px);
}

.display-cost-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.display-cost-scope {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin-top: 7px;
  color: #64748b;
  font-size: clamp(7px, 0.46vw, 9px);
  line-height: 1.25;
}

.display-cost-scope strong { color: #94a3b8; }

.display-cost-grid > div {
  min-width: 0;
  padding: clamp(7px, 0.65vw, 10px);
  border: 1px solid #273449;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.28);
}

.display-cost-grid span,
.display-cost-grid strong,
.display-cost-grid small {
  display: block;
}

.display-cost-grid span {
  min-height: 24px;
  color: #64748b;
  font-size: clamp(7px, 0.45vw, 9px);
  line-height: 1.25;
}

.display-cost-grid strong {
  margin-top: 3px;
  color: #f8fafc;
  font-size: clamp(13px, 1vw, 18px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.display-cost-grid small {
  margin-top: 3px;
  color: #64748b;
  font-size: clamp(6px, 0.4vw, 8px);
  font-weight: 500;
  line-height: 1.2;
}

.display-cost-grid small b {
  color: inherit;
  font-size: inherit;
}

.display-cost-grid .is-conversion { border-color: rgba(96, 165, 250, 0.3); }
.display-cost-grid .is-conversion strong { color: #93c5fd; }
.display-cost-grid .is-primary-kpi {
  border-width: 2px;
  background: rgba(15, 23, 42, 0.9);
}
.display-cost-grid .is-cost-kpi { border-color: rgba(251, 146, 60, 0.42); }
.display-cost-grid .is-cost-kpi strong { color: #fdba74; }

.display-cost-grid .is-positive { border-color: rgba(52, 211, 153, 0.26); }
.display-cost-grid .is-positive strong { color: #6ee7b7; }
.display-cost-grid .is-negative { border-color: rgba(248, 113, 113, 0.32); }
.display-cost-grid .is-negative strong { color: #fca5a5; }
.display-cost-grid .is-warning { border-color: rgba(251, 146, 60, 0.26); }
.display-cost-grid .is-warning strong { color: #fb923c; }

.display-average-note {
  margin: 7px 0 0;
  color: #64748b;
  font-size: clamp(7px, 0.48vw, 9px);
  line-height: 1.3;
}

.display-checkout-funnel {
  margin-top: clamp(10px, 1.15vh, 16px);
  padding-top: clamp(9px, 1vh, 14px);
  border-top: 1px solid #273449;
}

.display-checkout-funnel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.display-checkout-funnel h3 {
  margin: 2px 0 0;
  color: #f8fafc;
  font-size: clamp(12px, 0.9vw, 16px);
  line-height: 1.1;
}

.display-funnel-period {
  color: #94a3b8;
  font-size: clamp(7px, 0.48vw, 9px);
  font-weight: 750;
  white-space: nowrap;
}

.display-funnel-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr) auto) minmax(0, 1fr);
  align-items: stretch;
  gap: 5px;
  margin-top: 8px;
}

.display-funnel-flow > div,
.display-funnel-losses > div {
  min-width: 0;
  padding: clamp(7px, 0.6vw, 9px);
  border: 1px solid #273449;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.28);
}

.display-funnel-flow > div.is-completed {
  border-color: rgba(52, 211, 153, 0.34);
  background: rgba(6, 78, 59, 0.18);
}

.display-funnel-flow > i {
  align-self: center;
  color: #475569;
  font-size: clamp(11px, 0.9vw, 16px);
  font-style: normal;
  font-weight: 900;
}

.display-funnel-flow span,
.display-funnel-flow strong,
.display-funnel-flow small,
.display-funnel-losses span,
.display-funnel-losses strong {
  display: block;
}

.display-funnel-flow span,
.display-funnel-flow small,
.display-funnel-losses span {
  color: #64748b;
  font-size: clamp(6px, 0.42vw, 8px);
  line-height: 1.15;
}

.display-funnel-flow strong,
.display-funnel-losses strong {
  margin-top: 3px;
  color: #f8fafc;
  font-size: clamp(13px, 1vw, 18px);
  line-height: 1;
}

.display-funnel-flow small { margin-top: 3px; }
.display-funnel-flow > div.is-completed strong { color: #6ee7b7; }

.display-funnel-losses {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 5px;
}

.display-funnel-losses > div.is-warning { border-color: rgba(251, 191, 36, 0.36); }
.display-funnel-losses > div.is-warning strong { color: #fbbf24; }
.display-funnel-losses > div.is-danger { border-color: rgba(248, 113, 113, 0.38); }
.display-funnel-losses > div.is-danger strong { color: #fca5a5; }

.display-checkout-funnel > p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: clamp(6px, 0.42vw, 8px);
  line-height: 1.25;
}

.display-checkout-funnel.is-unavailable {
  opacity: 0.62;
}

.display-service-count {
  padding: 5px 8px;
  border-radius: 999px;
  background: #1e293b;
  color: #94a3b8;
  font-size: clamp(7px, 0.5vw, 9px);
  white-space: nowrap;
}

.display-order-list {
  display: grid;
  align-content: start;
  gap: 6px;
  margin-top: 10px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.display-recent-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.display-order-row {
  display: grid;
  grid-template-columns: minmax(105px, 0.9fr) minmax(135px, 1.25fr) minmax(75px, 0.62fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: clamp(7px, 0.65vw, 10px);
  border: 1px solid #243044;
  border-left-width: 3px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.28);
}

.display-order-row.is-paid { border-left-color: #f97316; }
.display-order-row.is-organic { border-left-color: #10b981; }
.display-order-row.is-pending { border-left-color: #f59e0b; }
.display-order-row:nth-child(n) { display: grid; }

.display-order-identity,
.display-order-origin,
.display-order-value,
.display-order-cost {
  min-width: 0;
}

.display-order-identity span,
.display-order-identity strong,
.display-order-origin small,
.display-order-value strong,
.display-order-value span,
.display-order-cost strong,
.display-order-cost span {
  display: block;
}

.display-order-identity span,
.display-order-origin small,
.display-order-value span,
.display-order-cost span {
  color: #64748b;
  font-size: clamp(7px, 0.47vw, 9px);
  line-height: 1.25;
}

.display-order-identity strong {
  margin-top: 2px;
  color: #e2e8f0;
  font-size: clamp(9px, 0.66vw, 12px);
  overflow-wrap: anywhere;
}

.display-order-origin .source-badge {
  min-height: 19px;
  padding: 0 6px;
  font-size: clamp(7px, 0.46vw, 9px);
}

.display-order-origin small { margin-top: 3px; }
.display-order-value { text-align: right; }
.display-order-value strong {
  color: #f8fafc;
  font-size: clamp(10px, 0.8vw, 14px);
}
.display-order-value span { margin-top: 2px; }

.display-order-cost {
  padding-left: 8px;
  border-left: 1px solid #273449;
}

.display-order-cost strong {
  color: #cbd5e1;
  font-size: clamp(9px, 0.68vw, 12px);
}

.display-order-cost span {
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.display-lifetime-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.display-lifetime-strip > div {
  min-width: 0;
  padding: clamp(9px, 0.8vw, 13px);
  border-right: 1px solid #1e293b;
}

.display-lifetime-strip > div:last-child { border-right: 0; }
.display-lifetime-strip span,
.display-lifetime-strip strong,
.display-lifetime-strip small { display: block; }
.display-lifetime-strip span,
.display-lifetime-strip small {
  color: #64748b;
  font-size: clamp(7px, 0.48vw, 9px);
}
.display-lifetime-strip strong {
  margin-top: 3px;
  color: #f8fafc;
  font-size: clamp(16px, 1.35vw, 24px);
  line-height: 1;
  overflow-wrap: anywhere;
}
.display-lifetime-strip small { margin-top: 3px; }

.display-trend-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.display-trend-card > header > small {
  color: #64748b;
  font-size: clamp(8px, 0.52vw, 10px);
}

.display-trend-card .display-chart {
  margin-top: 7px;
}

.display-trend-card .display-chart-day {
  grid-template-rows: 12px minmax(8px, 1fr) 12px;
  gap: 1px;
}

@media (max-width: 960px) {
  .sales-snapshot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-cost-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .display-body { overflow: auto; }
  .sales-display {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    padding: 16px;
  }
  .display-dashboard {
    display: grid;
    grid-template-rows: auto;
    gap: 10px;
    margin-top: 14px;
    overflow: visible;
  }
  .display-insight-grid { grid-template-columns: 1fr; }
  .display-finance-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .display-finance-flow > i { display: none; }
  .display-source-panel,
  .display-recent-panel { min-height: 250px; }
  .display-trend-card { min-height: 240px; }
  .display-footer { margin-top: 12px; }
}

@media (max-width: 680px) {
  .counter-heading,
  .source-overview-head,
  .recent-sales-section > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .counter-heading-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .counter-heading-actions .button { flex: 1 1 auto; }
  .source-legend { grid-template-columns: 1fr; }
  .source-cost-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-order-card { grid-template-columns: 1fr; }
  .sales-order-cost {
    padding: 9px 0 0;
    border-top: 1px solid #e2e8f0;
    border-left: 0;
  }
  .sales-order-proof { grid-column: 1; }
  .recent-sales-section > header > small {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .display-body {
    min-height: 100dvh;
    overflow: auto;
  }

  .sales-display {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    padding: 10px;
  }

  .display-header {
    position: sticky;
    top: 0;
    z-index: 8;
    align-items: center;
    padding: 5px 0 8px;
    background: rgba(7, 11, 20, 0.94);
    backdrop-filter: blur(10px);
  }

  .display-header-actions {
    align-items: center;
    flex-direction: row;
    width: auto;
    margin-left: auto;
  }

  .display-brand h1 { font-size: 19px; }
  .display-clock { min-width: 42px; text-align: right; }
  .display-clock strong { font-size: 16px; }
  .display-clock span,
  .display-fullscreen-button { display: none; }
  .display-live { min-height: 26px; padding: 0 8px; font-size: 9px; }

  .display-dashboard { margin-top: 7px; }
  .display-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .display-summary-card {
    min-height: 82px;
    padding: 11px;
    border-radius: 11px;
  }
  .display-summary-card > span { font-size: 9px; }
  .display-summary-card > strong { font-size: 25px; }
  .display-summary-card > small { font-size: 8px; }

  .display-summary-card.is-result { grid-column: 1 / -1; }

  .display-finance-panel {
    padding: 12px;
    border-radius: 12px;
  }
  .display-finance-panel > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .display-finance-panel h2 { font-size: 17px; }
  .display-finance-quality {
    max-width: none;
    font-size: 8px;
    text-align: left;
  }
  .display-finance-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .display-finance-flow > div { padding: 9px; }
  .display-finance-flow span { font-size: 8px; }
  .display-finance-flow strong { font-size: 15px; }
  .display-finance-flow small { font-size: 7px; }
  .display-finance-flow .is-result { grid-column: 1 / -1; }
  .display-finance-panel > p { font-size: 7px; }

  .display-source-panel,
  .display-recent-panel,
  .display-trend-card {
    min-height: 0;
    padding: 12px;
    border-radius: 12px;
  }

  .display-source-panel h2,
  .display-recent-panel h2,
  .display-trend-card h2 { font-size: 17px; }
  .display-label { font-size: 8px; }
  .display-source-legend { grid-template-columns: 1fr; }
  .display-source-legend > div {
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
  }
  .display-source-legend strong { grid-column: 3; }
  .display-cost-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .display-cost-grid > div { padding: 8px; }
  .display-cost-grid > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .display-cost-grid span { min-height: 22px; font-size: 8px; }
  .display-cost-grid strong { font-size: 15px; }

  .display-order-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
    padding: 9px;
  }
  .display-order-row:nth-child(n + 4) { display: none; }
  .display-order-identity { grid-column: 1; grid-row: 1; }
  .display-order-origin { grid-column: 1; grid-row: 2; }
  .display-order-value { grid-column: 2; grid-row: 1 / 3; }
  .display-order-identity strong { font-size: 11px; }
  .display-order-value strong { font-size: 12px; }

  .display-trend-card { min-height: 190px; }
  .display-chart { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .display-trend-card .display-chart-day {
    grid-template-rows: 14px minmax(48px, 1fr) 15px;
    gap: 2px;
  }
  .display-chart-day:nth-last-child(n + 8) { display: none; }
  .display-chart-day > small { font-size: 7px; }
  .display-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
    font-size: 8px;
  }
}

@media (max-width: 390px) {
  .sales-snapshot-card { padding: 13px; }
  .sales-snapshot-card > strong { font-size: 25px; }
  .source-overview-card,
  .recent-sales-section { padding: 15px; }
  .source-cost-grid { grid-template-columns: 1fr 1fr; }
  .source-cost-grid > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .source-cost-grid span { min-height: 0; }
}

/* Compact live display: the page itself never scrolls; only the order list does. */
@media (max-width: 560px) {
  html,
  body.display-body {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .sales-display {
    display: grid;
    grid-template-rows: 32px minmax(0, 1fr);
    gap: 5px;
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    padding:
      max(5px, env(safe-area-inset-top))
      max(6px, env(safe-area-inset-right))
      max(5px, env(safe-area-inset-bottom))
      max(6px, env(safe-area-inset-left));
    overflow: hidden;
  }

  .display-header {
    position: static;
    z-index: auto;
    min-height: 0;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .display-brand span,
  .display-clock span,
  .display-fullscreen-button,
  .display-footer {
    display: none;
  }

  .display-brand h1 {
    margin: 0;
    font-size: 16px;
    line-height: 1;
  }

  .display-header-actions { gap: 7px; }
  .display-live {
    min-height: 22px;
    padding: 0 7px;
    gap: 5px;
    font-size: 8px;
  }
  .display-live > span {
    width: 6px;
    height: 6px;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
  }
  .display-clock { min-width: 38px; }
  .display-clock strong { font-size: 13px; }

  .display-dashboard {
    display: grid;
    grid-template-rows: 58px 116px minmax(0, 1fr) 92px;
    gap: 5px;
    min-height: 0;
    margin: 0;
    overflow: hidden;
  }

  .display-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    min-height: 0;
  }

  .display-summary-card {
    min-height: 0;
    padding: 7px;
    border-radius: 8px;
  }
  .display-summary-card > span {
    font-size: 7px;
    line-height: 1.05;
  }
  .display-summary-card > strong {
    margin-top: 3px;
    font-size: clamp(18px, 5.8vw, 23px);
  }
  .display-summary-card > small {
    margin-top: 2px;
    font-size: 5.7px;
    line-height: 1.05;
  }

  .display-finance-panel {
    min-height: 0;
    padding: 6px;
    border-radius: 9px;
    overflow: hidden;
  }
  .display-finance-panel > header {
    align-items: flex-start;
    flex-direction: row;
    gap: 5px;
  }
  .display-finance-panel h2 {
    margin-top: 1px;
    font-size: 10px;
    white-space: nowrap;
  }
  .display-finance-quality {
    max-width: 42%;
    font-size: 5.5px;
    line-height: 1.1;
    text-align: right;
  }
  .display-finance-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    margin-top: 4px;
  }
  .display-finance-flow > i { display: none; }
  .display-finance-flow > div {
    min-height: 35px;
    padding: 4px 5px;
    border-radius: 6px;
  }
  .display-finance-flow span { font-size: 6px; line-height: 1.05; }
  .display-finance-flow strong { margin-top: 2px; font-size: 11px; }
  .display-finance-flow small { margin-top: 2px; font-size: 5px; line-height: 1.05; }
  .display-finance-flow .is-result { grid-column: auto; }
  .display-finance-panel > p { display: none; }

  .display-insight-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(230px, 1.15fr) minmax(110px, 0.85fr);
    gap: 5px;
    min-height: 0;
    overflow: hidden;
  }

  .display-source-panel,
  .display-recent-panel,
  .display-trend-card {
    min-height: 0;
    padding: 7px;
    border-radius: 9px;
  }

  .display-source-panel h2,
  .display-recent-panel h2,
  .display-trend-card h2 {
    margin-top: 1px;
    font-size: 11px;
  }
  .display-label { font-size: 6px; }
  .display-source-panel > header > strong {
    font-size: 7px;
  }

  .display-source-bar {
    height: 6px;
    margin-top: 4px;
  }
  .display-source-legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    margin-top: 4px;
  }
  .display-source-legend > div {
    display: grid;
    grid-template-columns: 5px minmax(0, 1fr);
    align-items: start;
    gap: 1px 3px;
    padding: 3px 4px;
    border-radius: 5px;
  }
  .display-source-legend > div > i {
    width: 5px;
    height: 5px;
  }
  .display-source-legend span { font-size: 5.4px; line-height: 1.05; }
  .display-source-legend strong {
    grid-column: 2;
    font-size: 6px;
    line-height: 1.05;
  }

  .display-cost-scope {
    display: block;
    margin-top: 4px;
    font-size: 5.5px;
    line-height: 1.1;
  }
  .display-cost-scope strong,
  .display-cost-scope span { display: block; }

  .display-cost-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 3px;
    margin-top: 4px;
  }
  .display-cost-grid > div,
  .display-cost-grid > div:last-child:nth-child(odd) {
    grid-column: span 2;
    padding: 4px;
    border-radius: 6px;
  }
  .display-cost-grid > .is-cost-kpi { grid-column: span 3; }
  .display-cost-grid span {
    min-height: 13px;
    font-size: 5.5px;
    line-height: 1.08;
  }
  .display-cost-grid strong {
    margin-top: 2px;
    font-size: 11px;
  }
  .display-cost-grid small {
    margin-top: 2px;
    font-size: 4.9px;
    line-height: 1.05;
  }
  .display-average-note {
    margin-top: 4px;
    font-size: 5.3px;
    line-height: 1.1;
  }

  .display-recent-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }
  .display-service-count {
    padding: 2px 5px;
    font-size: 5.5px;
  }
  .display-order-list {
    align-content: start;
    gap: 3px;
    min-height: 0;
    margin-top: 4px;
    padding-right: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }
  .display-order-row,
  .display-order-row:nth-child(n + 4),
  .display-order-row:nth-child(n + 5) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 6px;
    padding: 4px 5px;
    border-radius: 6px;
  }
  .display-order-identity { grid-column: 1; grid-row: 1; }
  .display-order-origin { grid-column: 1; grid-row: 2; }
  .display-order-value { grid-column: 2; grid-row: 1 / 3; }
  .display-order-identity span,
  .display-order-origin small,
  .display-order-value span { font-size: 5.4px; line-height: 1.05; }
  .display-order-identity strong { margin-top: 1px; font-size: 7px; }
  .display-order-origin .source-badge {
    min-height: 13px;
    padding: 0 4px;
    font-size: 5.5px;
  }
  .display-order-origin small { margin-top: 1px; }
  .display-order-value strong { font-size: 8px; }
  .display-order-value span { margin-top: 1px; }

  .display-trend-card {
    min-height: 0;
    overflow: hidden;
  }
  .display-trend-card > header > small { font-size: 5.5px; }
  .display-trend-card .display-chart {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    margin-top: 3px;
  }
  .display-trend-card .display-chart-day {
    grid-template-rows: 8px minmax(0, 1fr) 9px;
    gap: 1px;
  }
  .display-chart-day:nth-last-child(n + 8) { display: none; }
  .display-chart-day > strong,
  .display-chart-day > small { font-size: 5.5px; }
}

@media (max-width: 560px) and (max-height: 720px) {
  .display-dashboard {
    grid-template-rows: 52px 98px minmax(0, 1fr) 78px;
  }
  .display-insight-grid {
    grid-template-rows: minmax(214px, 1.2fr) minmax(86px, 0.8fr);
  }
  .display-summary-card > small,
  .display-finance-quality,
  .display-average-note { display: none; }
  .display-finance-panel h2 { font-size: 9px; }
  .display-finance-flow > div { min-height: 30px; }
  .display-finance-flow small { display: none; }
}

/* Read-only dashboard login */
.display-login-body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(249, 115, 22, 0.22), transparent 36%),
    radial-gradient(circle at 90% 100%, rgba(59, 130, 246, 0.14), transparent 34%),
    #070b14;
  color: #f8fafc;
}

.display-login-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.display-login-card {
  width: min(100%, 430px);
  padding: clamp(24px, 5vw, 38px);
  border: 1px solid rgba(251, 146, 60, 0.28);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.display-login-brand {
  display: inline-grid;
  min-height: 40px;
  margin-bottom: 22px;
  padding: 0 14px;
  place-items: center;
  border-radius: 12px;
  background: #f97316;
  color: #fff;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0.15em;
}

.display-login-card h1 {
  margin: 5px 0 0;
  font-size: clamp(30px, 8vw, 42px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.display-login-card > p {
  margin: 14px 0 0;
  color: #94a3b8;
  font-size: 15px;
  line-height: 1.5;
}

.display-login-error {
  margin-top: 18px;
  padding: 11px 13px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 10px;
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  font-size: 13px;
  line-height: 1.4;
}

.display-login-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.display-login-form label,
.display-login-form label > span {
  display: grid;
}

.display-login-form label > span {
  margin-bottom: 7px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
}

.display-login-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #334155;
  border-radius: 10px;
  outline: none;
  background: rgba(2, 6, 23, 0.55);
  color: #f8fafc;
  font-size: 16px;
  padding: 0 13px;
}

.display-login-form input:focus {
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.16);
}

.display-login-form button {
  min-height: 50px;
  margin-top: 3px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
}

.display-login-card > small {
  display: block;
  margin-top: 18px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.display-logout-form { margin: 0; }
.display-logout-form button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #334155;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.82);
  color: #cbd5e1;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

/* On phones, readability wins: the dashboard scrolls vertically. */
@media (max-width: 560px) {
  html,
  body.display-body {
    width: 100%;
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .sales-display {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
    overflow: visible;
  }

  .display-header {
    position: static;
    min-height: 48px;
    padding: 7px 0 9px;
    background: transparent;
    flex-wrap: wrap;
  }

  .display-portal-nav {
    order: 3;
    width: 100%;
    gap: 2px;
    margin-top: 3px;
    padding: 3px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .display-portal-nav::-webkit-scrollbar { display: none; }
  .display-portal-nav a {
    min-height: 38px;
    flex: 1 0 auto;
    padding: 0 9px;
    font-size: 11px;
  }

  .display-brand span { display: block; font-size: 8px; }
  .display-brand h1 { margin-top: 2px; font-size: 20px; }
  .display-header-actions { gap: 6px; }
  .display-live { min-height: 28px; padding: 0 8px; font-size: 9px; }
  .display-clock { min-width: 38px; }
  .display-clock strong { font-size: 14px; }
  .display-clock span,
  .display-fullscreen-button { display: none; }
  .display-logout-form button { min-height: 44px; padding: 0 10px; font-size: 11px; }

  .display-dashboard {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    margin-top: 10px;
    overflow: visible;
  }

  .display-summary-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .display-summary-card {
    min-height: 102px;
    padding: 15px;
    border-radius: 13px;
  }
  .display-summary-card > span { font-size: 12px; line-height: 1.25; }
  .display-summary-card > strong { margin-top: 7px; font-size: 34px; }
  .display-summary-card > small { display: block; margin-top: 6px; font-size: 12px; line-height: 1.3; }

  .display-finance-panel {
    padding: 15px;
    border-radius: 13px;
    overflow: visible;
  }
  .display-finance-panel > header { flex-direction: column; gap: 7px; }
  .display-finance-panel h2 { font-size: 18px; white-space: normal; }
  .display-finance-quality { display: block; max-width: none; font-size: 11px; text-align: left; }
  .display-finance-flow {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
  }
  .display-finance-flow > i { display: none; }
  .display-finance-flow > div {
    min-height: 70px;
    padding: 11px 12px;
    border-radius: 9px;
  }
  .display-finance-flow span { font-size: 12px; line-height: 1.25; }
  .display-finance-flow strong { margin-top: 5px; font-size: 20px; }
  .display-finance-flow small { display: block; margin-top: 4px; font-size: 11px; line-height: 1.35; }
  .display-finance-flow .is-result { grid-column: auto; }
  .display-finance-panel > p { display: block; margin-top: 10px; font-size: 11px; line-height: 1.45; }

  .display-insight-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: visible;
  }

  .display-source-panel,
  .display-recent-panel,
  .display-trend-card {
    min-height: 0;
    padding: 15px;
    border-radius: 13px;
    overflow: visible;
  }
  .display-source-panel h2,
  .display-recent-panel h2,
  .display-trend-card h2 { margin-top: 3px; font-size: 19px; }
  .display-label { font-size: 12px; }
  .display-source-panel > header > strong { font-size: 12px; }

  .display-source-bar { height: 10px; margin-top: 13px; }
  .display-source-legend {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 9px;
  }
  .display-source-legend > div {
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 3px 7px;
    padding: 9px 10px;
    border-radius: 8px;
  }
  .display-source-legend > div > i { width: 8px; height: 8px; }
  .display-source-legend span { font-size: 12px; line-height: 1.25; }
  .display-source-legend strong { grid-column: 3; font-size: 13px; line-height: 1.25; }

  .display-cost-scope {
    display: block;
    margin-top: 11px;
    font-size: 12px;
    line-height: 1.4;
  }
  .display-cost-scope strong,
  .display-cost-scope span { display: block; }

  .display-cost-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }
  .display-cost-grid > div,
  .display-cost-grid > div:last-child:nth-child(odd),
  .display-cost-grid > .is-cost-kpi {
    grid-column: auto;
    min-height: 82px;
    padding: 11px 12px;
    border-radius: 9px;
  }
  .display-cost-grid span { min-height: 0; font-size: 13px; line-height: 1.3; }
  .display-cost-grid strong { margin-top: 6px; font-size: 22px; }
  .display-cost-grid small { margin-top: 5px; font-size: 12px; line-height: 1.35; }
  .display-average-note { display: block; margin-top: 10px; font-size: 12px; line-height: 1.45; }

  .display-recent-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: 500px;
    overflow: hidden;
  }
  .display-service-count { padding: 4px 7px; font-size: 8px; }
  .display-order-list {
    gap: 7px;
    max-height: min(52dvh, 420px);
    margin-top: 11px;
    padding-right: 3px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .display-order-row,
  .display-order-row:nth-child(n + 4),
  .display-order-row:nth-child(n + 5) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 10px;
    border-radius: 8px;
  }
  .display-order-identity span,
  .display-order-origin small,
  .display-order-value span { font-size: 12px; line-height: 1.25; }
  .display-order-identity strong { margin-top: 3px; font-size: 15px; }
  .display-order-origin .source-badge { min-height: 24px; padding: 0 8px; font-size: 12px; }
  .display-order-origin small { margin-top: 3px; }
  .display-order-value strong { font-size: 16px; }
  .display-order-value span { margin-top: 3px; }

  .display-trend-card { min-height: 270px; overflow: hidden; }
  .display-trend-card > header > small { font-size: 11px; }
  .display-trend-card .display-chart {
    grid-template-columns: repeat(14, 48px);
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin-top: 12px;
    padding: 0 0 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .display-trend-card .display-chart-day,
  .display-chart-day:nth-last-child(n + 8) {
    display: grid;
    min-width: 48px;
    grid-template-rows: 18px minmax(145px, 1fr) 18px;
    gap: 3px;
  }
  .display-chart-day > strong,
  .display-chart-day > small { font-size: 11px; }

  .display-footer {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    margin-top: 12px;
    font-size: 11px;
  }
}

@media (max-width: 560px) {
  .display-checkout-funnel {
    margin-top: 15px;
    padding-top: 14px;
  }

  .display-checkout-funnel > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .display-checkout-funnel h3 { font-size: 18px; }
  .display-funnel-period { font-size: 11px; }

  .display-funnel-flow {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 11px;
  }

  .display-funnel-flow > i { display: none; }

  .display-funnel-flow > div,
  .display-funnel-losses > div {
    min-height: 68px;
    padding: 11px 12px;
    border-radius: 9px;
  }

  .display-funnel-flow span,
  .display-funnel-flow small,
  .display-funnel-losses span { font-size: 12px; }

  .display-funnel-flow strong,
  .display-funnel-losses strong { margin-top: 5px; font-size: 22px; }

  .display-funnel-losses {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 7px;
  }

  .display-checkout-funnel > p {
    margin-top: 9px;
    font-size: 11px;
    line-height: 1.45;
  }
}

/* Shared live portal header -------------------------------------------------
   The shipping pages mirror the sales display without changing page logic. */
.shipping-body .portal-live-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(235px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 12px clamp(18px, 3vw, 48px);
  border-bottom: 1px solid var(--shipping-border);
  background: rgba(7, 11, 20, 0.94);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.shipping-body .portal-live-brand {
  min-width: 0;
}

.shipping-body .portal-live-brand h1 {
  overflow: hidden;
  color: var(--shipping-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shipping-body .portal-live-nav {
  justify-self: center;
}

.shipping-body .portal-live-actions {
  justify-self: end;
  gap: 12px;
}

.shipping-body .portal-live-actions .display-clock {
  min-width: 82px;
}

.shipping-body .portal-live-actions .display-clock strong {
  font-size: clamp(22px, 1.8vw, 30px);
}

.shipping-body .portal-fullscreen-button[hidden] {
  display: none;
}

.shipping-body .portal-fullscreen-short {
  display: none;
}

.display-body .display-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

@media (max-width: 1080px) {
  .shipping-body .portal-live-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
    padding-top: 13px;
    padding-bottom: 10px;
  }

  .shipping-body .portal-live-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .shipping-body .portal-live-nav::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 560px) {
  .shipping-body .portal-live-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 8px;
    min-height: 0;
    padding:
      max(9px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      8px
      max(10px, env(safe-area-inset-left));
    background: rgba(7, 11, 20, 0.97);
  }

  .shipping-body .portal-live-brand span {
    font-size: 8px;
  }

  .shipping-body .portal-live-brand h1 {
    margin-top: 2px;
    font-size: 19px;
  }

  .shipping-body .portal-live-actions {
    gap: 5px;
  }

  .shipping-body .portal-live-actions .display-live {
    min-height: 30px;
    gap: 6px;
    padding: 0 8px;
    font-size: 9px;
  }

  .shipping-body .portal-live-actions .display-live > span {
    width: 7px;
    height: 7px;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
  }

  .shipping-body .portal-live-actions .display-clock {
    min-width: 39px;
  }

  .shipping-body .portal-live-actions .display-clock strong {
    font-size: 15px;
  }

  .shipping-body .portal-live-actions .display-clock span {
    display: none;
  }

  .shipping-body .portal-fullscreen-button {
    min-height: 32px;
    padding: 0 8px;
    font-size: 9px;
  }

  .shipping-body .portal-fullscreen-label {
    display: none;
  }

  .shipping-body .portal-fullscreen-short {
    display: inline;
  }

  .shipping-body .portal-live-nav {
    gap: 2px;
    padding: 3px;
  }

  .shipping-body .portal-live-nav a {
    min-height: 38px;
    flex: 1 0 auto;
    padding: 0 9px;
    font-size: 11px;
  }

  .display-body .display-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 11, 20, 0.97);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}
