:root {
  color-scheme: dark;
  --bg: #08090a;
  --surface: rgba(18, 20, 22, 0.78);
  --surface-2: #17191c;
  --surface-3: #202328;
  --line: rgba(236, 239, 244, 0.10);
  --line-strong: rgba(236, 239, 244, 0.18);
  --text: #f1f2f4;
  --muted: #9298a1;
  --soft: #c9cdd3;
  --accent: #aeb9c6;
  --accent-ink: #0b0d0f;
  --accent-rgb: 120, 135, 154;
  --success: #8eb6a1;
  --danger: #d89b94;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 0; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
button, input, textarea { font: inherit; }
button { color: inherit; }
button, input, textarea { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 78% 10%, rgba(var(--accent-rgb), 0.10), transparent 30rem),
    radial-gradient(circle at 8% 82%, rgba(112, 102, 127, 0.06), transparent 26rem);
}

.boot, .access-error { position: relative; z-index: 1; min-height: 100vh; display: grid; place-content: center; text-align: center; color: var(--muted); }
.boot__mark { width: 36px; height: 54px; margin: 0 auto 16px; border: 1px solid var(--line-strong); border-radius: 24px 24px 9px 9px; box-shadow: inset 0 0 22px rgba(145, 184, 154, .16); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-4px); box-shadow: inset 0 0 30px rgba(145,184,154,.28), 0 0 28px rgba(145,184,154,.1); } }
.access-error__card { width: min(420px, calc(100vw - 32px)); padding: 32px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); }
.access-error__icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 18px; border-radius: 50%; background: rgba(223,157,146,.12); color: var(--danger); font-weight: 700; }
.access-error h1 { margin: 0 0 10px; font-size: 24px; }
.access-error p { margin: 0 0 22px; line-height: 1.55; }

.app { position: relative; z-index: 1; min-height: 100vh; padding-bottom: calc(92px + var(--safe-bottom)); }
.app.is-readonly { padding-bottom: calc(24px + var(--safe-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(8,9,10,.72); backdrop-filter: blur(24px) saturate(1.12); }
.brand { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 750; letter-spacing: .22em; }
.brand small { margin-left: -3px; color: var(--muted); font-size: 8px; font-weight: 650; letter-spacing: .16em; }
.brand__portal { width: 18px; height: 26px; border: 1px solid rgba(225,230,236,.5); border-radius: 12px 12px 5px 5px; box-shadow: inset 0 0 13px rgba(var(--accent-rgb),.28), 0 0 16px rgba(var(--accent-rgb),.1); }
.topbar__meta { display: flex; align-items: center; gap: 12px; }
.save-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px rgba(142,184,154,.45); }
.save-state.is-dirty i { background: #d6bc83; box-shadow: 0 0 12px rgba(214,188,131,.45); }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); cursor: pointer; }
.icon-button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.05); }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.workspace { width: min(1500px, 100%); margin: 0 auto; display: grid; grid-template-columns: 190px minmax(420px, 700px) minmax(330px, 440px); gap: 22px; padding: 24px; align-items: start; }
.app.is-operations .workspace { width: min(1580px, 100%); grid-template-columns: 190px minmax(0, 1fr); }
.app.is-operations .preview { display: none; }
.app.is-operations .editor-main { width: 100%; }
.sidebar { position: sticky; top: 98px; display: grid; gap: 6px; }
.nav-group-label { margin: 16px 12px 3px; color: #6f757e; font-size: 9px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.nav-group-label:first-child { margin-top: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border: 1px solid transparent; border-radius: 14px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.025); }
.nav-item.is-active { color: var(--text); border-color: var(--line); background: var(--surface); box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.nav-item__icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: rgba(255,255,255,.045); color: var(--soft); font-size: 13px; font-weight: 700; }
.nav-item.is-active .nav-item__icon { background: rgba(var(--accent-rgb),.14); color: var(--accent); }

.editor-main { min-width: 0; scroll-margin-top: 98px; }
.section-heading { margin: 5px 0 22px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.section-heading h1, .preview h2, .dialog__header h2 { margin: 0; letter-spacing: -.03em; }
.section-heading h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 610; }
.section-heading p { max-width: 600px; margin: 10px 0 0; color: var(--muted); line-height: 1.55; }

.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.dashboard-card { min-height: 148px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(34,40,34,.9), rgba(23,28,24,.9)); cursor: pointer; text-align: left; box-shadow: 0 14px 40px rgba(0,0,0,.12); transition: transform .2s ease, border-color .2s ease; }
.dashboard-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.dashboard-card__top { display: flex; justify-content: space-between; align-items: flex-start; }
.dashboard-card__index { color: var(--muted); font: 600 11px/1 monospace; letter-spacing: .08em; }
.dashboard-card__arrow { color: var(--muted); }
.dashboard-card strong { display: block; margin: 38px 0 5px; font-size: 18px; }
.dashboard-card small { color: var(--muted); line-height: 1.4; }
.moderation-note { margin-top: 14px; padding: 16px 18px; border: 1px solid rgba(142,184,154,.17); border-radius: 17px; background: rgba(142,184,154,.055); color: var(--soft); font-size: 13px; line-height: 1.5; }
.section-actions { display: flex; justify-content: flex-end; margin: -54px 0 24px; }
.promotion-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.payment-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.promotion-metric { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.022); }
.promotion-metric.is-accent { border-color: rgba(142,184,154,.24); background: linear-gradient(145deg, rgba(142,184,154,.11), rgba(255,255,255,.022)); }
.promotion-metric span, .promotion-metric small { display: block; color: var(--muted); }
.promotion-metric span { overflow: hidden; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.promotion-metric strong { display: block; margin: 12px 0 4px; font-size: 27px; font-weight: 620; letter-spacing: -.04em; }
.promotion-metric small { min-height: 2.7em; font-size: 10px; line-height: 1.35; }
.promotion-analytics { overflow: hidden; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 16px 44px rgba(0,0,0,.12); }
.promotion-analytics__header, .promotion-editor-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.promotion-analytics__header { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.promotion-analytics__header .eyebrow, .promotion-editor-heading .eyebrow { margin-bottom: 5px; }
.promotion-analytics__header h2, .promotion-editor-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.promotion-analytics__header small, .promotion-editor-heading small { color: var(--muted); font-size: 11px; text-align: right; }
.promotion-table-wrap { overflow-x: auto; }
.promotion-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.promotion-table th { padding: 10px 12px; color: var(--muted); background: rgba(255,255,255,.018); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.promotion-table td { min-width: 76px; padding: 13px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.promotion-table tbody tr:first-child td { border-top: 0; }
.promotion-table tbody tr:hover { background: rgba(255,255,255,.018); }
.promotion-table td strong, .promotion-table td small { display: block; }
.promotion-table td strong { font-size: 12px; white-space: nowrap; }
.promotion-table td small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.promotion-code { display: grid; justify-items: start; gap: 7px; }
.promotion-code code { padding: 4px 6px; border-radius: 7px; color: var(--accent); background: rgba(142,184,154,.08); font: 750 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; }
.promotion-status { padding: 4px 6px; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.045); font-size: 8px; font-weight: 750; letter-spacing: .04em; white-space: nowrap; }
.promotion-status.is-active { color: #b9d9c1; background: rgba(142,184,154,.11); }
.promotion-status.is-scheduled { color: #d9c593; background: rgba(214,188,131,.1); }
.promotion-status.is-reserved { color: #d6bc83; background: rgba(214,188,131,.11); }
.promotion-status.is-ended, .promotion-status.is-off { color: var(--muted); background: rgba(255,255,255,.035); }
.promotion-number { font-size: 17px !important; letter-spacing: -.03em; }
.promotion-progress { display: block; overflow: hidden; width: 100%; height: 3px; margin-top: 8px; border-radius: 999px; background: rgba(255,255,255,.055); }
.promotion-progress i { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.promotion-editor-heading { margin-top: 24px; padding: 0 2px; }
.promotion-stack { margin-top: 14px; }
.payment-error { display: grid; gap: 5px; margin-top: 14px; padding: 16px 18px; border: 1px solid rgba(223,157,146,.3); border-radius: 17px; background: rgba(223,157,146,.07); color: var(--danger); }
.account-search { margin-bottom: 14px; }
.account-search__actions { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:16px; }
.account-search__actions small { color:var(--muted); line-height:1.4; }
.account-card { margin-top:14px; }
.account-card__header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.account-card__header h2 { margin:5px 0 3px; font-size:18px; }
.account-card__header small { color:var(--muted); }
.account-card__header code { color:var(--muted); font-size:11px; }
.account-sides { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:17px; }
.account-side { min-width:0; padding:14px; border:1px solid var(--line); border-radius:15px; background:rgba(255,255,255,.022); }
.account-side strong,.account-side small { display:block; margin-top:6px; }
.account-side small { color:var(--muted); }
.account-side.is-empty { opacity:.7; }
.account-target { max-width: 360px; margin-top: 14px; }
.account-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:15px; }
.account-actions .button { min-height:38px; font-size:11px; }
.account-operation { display:block; margin-top:12px; color:var(--muted); }
.account-history { margin-top:14px; border-top:1px solid var(--line); padding-top:11px; color:var(--muted); font-size:11px; }
.account-history summary { cursor:pointer; color:var(--soft); }
.account-history div { display:grid; gap:5px; margin-top:9px; }
.accounts-active .editor-main { min-width:0; }
.account-search .field-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.account-search .field-grid .field { margin-top:0; }
.account-search input,.account-target input { min-width:0; width:100%; }
.account-results { display:grid; gap:18px; }
.account-results .account-card { margin:0; padding:24px; min-width:0; }
.account-card__header>div { min-width:0; }
.account-card__header .eyebrow,.account-card__header h2 { overflow-wrap:anywhere; }
.account-card__header .eyebrow { letter-spacing:.02em; text-transform:none; }
.account-card__header code { flex:none; }
.account-sides { align-items:stretch; }
.account-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.account-actions .button { white-space:normal; min-height:44px; padding:10px 16px; line-height:1.4; }
.account-history div>span { display:block; padding:10px 12px; border:1px solid var(--line); border-radius:8px; line-height:1.5; overflow-wrap:anywhere; }
.customer-daily { margin:18px 0 24px; padding:24px; min-width:0; }
.customer-daily-note,.customer-daily-help { font-size:12px; color:var(--muted); line-height:1.65; }
.customer-daily-scroll { overflow:auto; max-height:540px; margin:20px 0; border:1px solid var(--line); border-radius:12px; }
.customer-daily-table { width:100%; border-collapse:collapse; font-size:13px; }
.customer-daily-table thead { position:sticky; top:0; background:var(--surface-2); z-index:1; }
.customer-daily-table th,.customer-daily-table td { text-align:right; padding:15px 18px; border-bottom:1px solid var(--line); white-space:nowrap; }
.customer-daily-table th:first-child { text-align:left; }
.customer-daily-table th { font-weight:500; color:var(--muted); font-size:11px; }
.customer-daily-table small { display:block; margin-top:5px; color:var(--muted); font-size:10px; }
.customer-daily-table tbody tr:hover { background:rgba(255,255,255,.025); }
.customer-new { color:var(--success); font-weight:600; }
.customer-no-data { color:var(--muted); font-size:11px; }
.customer-daily-help summary { cursor:pointer; color:var(--soft); }
@media(max-width:760px) {
  .account-search .field-grid { grid-template-columns:minmax(0,1fr); }
  .account-search__actions { flex-direction:column; align-items:stretch; }
  .account-card__header { flex-direction:column; }
  .account-sides { grid-template-columns:minmax(0,1fr); }
  .account-results .account-card,.customer-daily { padding:18px; }
  .account-actions { grid-template-columns:minmax(0,1fr); }
  .customer-daily .admin-panel__header { align-items:flex-start; flex-direction:column; gap:10px; }
}
.payment-error span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.payment-breakdowns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.payment-breakdown { min-width: 0; }
.payment-breakdown__items { display: flex; flex-wrap: wrap; gap: 8px; padding: 15px; }
.payment-breakdown__items > span { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.018); font-size: 10px; }
.payment-breakdown__items strong { color: var(--text); font-size: 13px; }
.payment-breakdown__items > small { color: var(--muted); }
.payment-orders { margin-top: 12px; }
.payment-table td { min-width: 104px; }
.payment-table td:first-child { min-width: 118px; }
.payment-table td:last-child { min-width: 150px; }
.payment-table tr.needs-attention { background: rgba(223,157,146,.045); }
.payment-attention { display: inline-block; margin-top: 7px; padding: 4px 6px; border-radius: 999px; color: var(--danger); background: rgba(223,157,146,.11); font-size: 8px; font-weight: 750; white-space: nowrap; }
.payment-status { display: inline-block; padding: 5px 7px; border-radius: 999px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.payment-status.is-success { color: #b9d9c1; background: rgba(142,184,154,.11); }
.payment-status.is-pending { color: #d9c593; background: rgba(214,188,131,.1); }
.payment-status.is-danger { color: var(--danger); background: rgba(223,157,146,.11); }
.payment-status.is-muted { color: var(--muted); background: rgba(255,255,255,.045); }
.promotion-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.promotion-card__footer small { color: var(--muted); line-height: 1.4; }
.promo-plans { margin-top: 16px; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.check-chip { position: relative; min-width: 0; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip span { display: grid; place-items: center; min-height: 42px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(8,11,9,.25); cursor: pointer; font-size: 12px; font-weight: 650; text-align: center; }
.check-chip input:checked + span { color: var(--accent); border-color: rgba(142,184,154,.34); background: rgba(142,184,154,.1); }

.form-stack { display: grid; gap: 14px; }
.form-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 16px 44px rgba(0,0,0,.12); }
.form-card__heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 17px; }
.form-card__heading h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.form-card__heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.form-card__badge { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.045); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.message-card__summary { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; list-style: none; cursor: pointer; }
.message-card__summary::-webkit-details-marker { display: none; }
.message-card__summary h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.message-card__summary p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.message-card__content { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.message-card[open] { border-color: var(--line-strong); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.field { display: grid; gap: 7px; margin-top: 12px; }
.field:first-child { margin-top: 0; }
.field > span { color: var(--soft); font-size: 12px; font-weight: 650; }
.field small { color: var(--muted); line-height: 1.4; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; outline: none; color: var(--text); background: rgba(8,11,9,.35); transition: border-color .18s, box-shadow .18s; }
.field input { height: 44px; padding: 0 13px; }
.field textarea { min-height: 112px; padding: 12px 13px; line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: rgba(170,204,178,.45); box-shadow: 0 0 0 3px rgba(142,184,154,.08); }
.field input[readonly] { color: var(--muted); cursor: default; }
.rich-field small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.format-toolbar { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: 13px 13px 0 0; background: rgba(255,255,255,.025); }
.format-toolbar button { min-width: 34px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; color: var(--soft); background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; }
.format-toolbar button:hover { border-color: var(--line); background: rgba(255,255,255,.045); }
.rich-field textarea { margin-top: -7px; border-radius: 0 0 13px 13px; }
.emoji-palette { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px; border-inline: 1px solid var(--line); background: rgba(8,11,9,.22); }
.emoji-palette[hidden] { display: none; }
.emoji-palette button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.035); color: var(--text); cursor: pointer; font-size: 20px; }
.emoji-palette button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.06); }
.emoji-palette small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; }
.switch-row strong { display: block; font-size: 14px; }
.switch-row small { display: block; margin-top: 4px; color: var(--muted); }
.switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + span { background: rgba(142,184,154,.16); border-color: rgba(142,184,154,.3); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--accent); }

.attachment { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.attachment__empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--muted); font-size: 13px; }
.attachment__current { display: flex; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.022); }
.attachment__icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; background: rgba(142,184,154,.1); color: var(--accent); font-size: 11px; font-weight: 800; }
.attachment__meta { min-width: 0; flex: 1; }
.attachment__meta strong, .attachment__meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment__meta strong { font-size: 13px; }
.attachment__meta small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.file-button, .text-action { border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700; }
.file-button { position: relative; display: inline-flex; align-items: center; min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.035); }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.attachment__actions { display: flex; align-items: center; gap: 3px; }
.text-action.is-danger { color: var(--danger); }

.preview { position: sticky; top: 98px; min-width: 0; }
.preview__header { display: flex; justify-content: space-between; align-items: flex-end; margin: 5px 0 14px; }
.preview h2 { font-size: 18px; }
.preview__live { padding: 6px 9px; border-radius: 999px; color: var(--success); background: rgba(142,184,154,.08); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.phone-preview { overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: #171b18; box-shadow: var(--shadow); }
.phone-preview__bar { display: flex; align-items: center; gap: 10px; min-height: 66px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.025); }
.phone-preview__avatar { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; background: linear-gradient(145deg,#29332b,#151a16); color: var(--accent); font-weight: 700; box-shadow: inset 0 0 18px rgba(142,184,154,.12); }
.phone-preview__bar strong, .phone-preview__bar small { display: block; }
.phone-preview__bar strong { font-size: 13px; }.phone-preview__bar small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.chat-preview { min-height: 490px; padding: 22px 14px; background: radial-gradient(circle at 70% 0, rgba(87,110,91,.08), transparent 18rem); }
.bubble { max-width: 92%; padding: 11px 12px 9px; border-radius: 15px 15px 15px 5px; background: #252c26; box-shadow: 0 8px 22px rgba(0,0,0,.18); font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.bubble strong { font-size: 14px; }
.bubble a { color: #b9d9c1; text-decoration: underline; text-underline-offset: 2px; }
.bubble code { padding: 1px 4px; border-radius: 4px; background: rgba(0,0,0,.25); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.bubble blockquote { margin: 7px 0; padding-left: 9px; border-left: 2px solid rgba(185,217,193,.45); color: var(--soft); }
.bubble tg-emoji { display: inline-grid; place-items: center; min-width: 1.35em; height: 1.35em; padding: 0 .12em; border-radius: .4em; background: rgba(185,217,193,.1); vertical-align: -.18em; }
.bubble__attachment { display: grid; place-items: center; min-height: 112px; margin: -4px -5px 10px; border-radius: 11px; background: linear-gradient(135deg, rgba(142,184,154,.14), rgba(255,255,255,.025)); color: var(--soft); text-align: center; }
.bubble__attachment span { display: block; font-size: 11px; color: var(--muted); margin-top: 5px; }
.preview-buttons { display: grid; gap: 5px; margin-top: 6px; }
.preview-button { min-height: 37px; display: grid; place-items: center; padding: 7px; border-radius: 9px; background: #283c31; color: #cfe7d5; font-size: 12px; font-weight: 650; text-align: center; }
.preview-button-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.preview-empty { color: var(--muted); text-align: center; padding: 42px 20px; line-height: 1.5; }

/* Owner control surface */
.admin-heading { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 18px 24px; margin-bottom: 20px; }
.admin-heading .section-heading { margin-bottom: 0; }
.admin-heading .button { flex: 0 0 auto; }
.admin-heading__actions { display: flex; flex: 1 1 620px; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.period-picker { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.range-control { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
.range-control button { min-width: 43px; min-height: 36px; padding: 0 9px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 750; white-space: nowrap; }
.range-control button:hover { color: var(--soft); }
.range-control button.is-active { color: var(--text); background: rgba(var(--accent-rgb),.16); box-shadow: 0 5px 16px rgba(0,0,0,.17); }
.custom-period { display: flex; align-items: flex-end; justify-content: flex-end; gap: 7px; }
.custom-period label { display: grid; gap: 4px; }
.custom-period label span { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.custom-period input { width: 132px; min-height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--soft); color-scheme: dark; background: rgba(255,255,255,.02); font: 600 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; outline: none; }
.custom-period input:focus { border-color: rgba(var(--accent-rgb),.48); }
.custom-period .button { min-height: 36px; font-size: 10px; }
.admin-utility { display: flex; align-items: center; gap: 7px; }
.freshness-badge { max-width: 155px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.auto-refresh { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.018); cursor: pointer; font-size: 9px; font-weight: 700; }
.auto-refresh i { width: 6px; height: 6px; border-radius: 50%; background: #59606a; }
.auto-refresh.is-active { color: var(--soft); }
.auto-refresh.is-active i { background: var(--success); box-shadow: 0 0 0 4px rgba(142,182,161,.08); }
.export-button { min-height: 36px; padding-inline: 11px; font-size: 10px; }
.admin-kpis { display: grid; grid-template-columns: 1.15fr repeat(4, minmax(150px, 1fr)); gap: 10px; }
.admin-kpi { position: relative; overflow: hidden; min-width: 0; min-height: 145px; padding: 18px; border: 1px solid var(--line); border-radius: 21px; background: rgba(255,255,255,.022); }
.admin-kpi::after { content: ""; position: absolute; inset: auto -35px -60px auto; width: 120px; height: 120px; border-radius: 50%; background: rgba(var(--accent-rgb),.07); filter: blur(20px); }
.admin-kpi.is-primary { border-color: rgba(var(--accent-rgb),.33); background: linear-gradient(145deg, rgba(var(--accent-rgb),.17), rgba(255,255,255,.018) 72%); }
.admin-kpi.is-success { border-color: rgba(142,182,161,.24); }
.admin-kpi.is-danger { border-color: rgba(216,155,148,.34); background: linear-gradient(145deg, rgba(216,155,148,.11), rgba(255,255,255,.018)); }
.admin-kpi span, .admin-kpi small { display: block; position: relative; z-index: 1; color: var(--muted); }
.admin-kpi span { font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.admin-kpi strong { display: block; position: relative; z-index: 1; margin: 28px 0 8px; overflow: hidden; font-size: clamp(25px, 2.2vw, 38px); font-weight: 560; letter-spacing: -.055em; text-overflow: ellipsis; white-space: nowrap; }
.admin-kpi small { font-size: 11px; }
.comparison-pills { display: flex !important; position: relative; z-index: 1; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.comparison-pills em { padding: 4px 6px; border-radius: 7px; color: var(--muted); background: rgba(255,255,255,.035); font-size: 8px; font-style: normal; font-weight: 700; white-space: nowrap; }
.comparison-pills em.is-up { color: #abc8b8; background: rgba(142,182,161,.08); }
.comparison-pills em.is-down { color: #dfaaa3; background: rgba(216,155,148,.075); }
.admin-overview-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 12px; margin-top: 12px; }
.admin-panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(18,20,22,.62); box-shadow: 0 18px 55px rgba(0,0,0,.16); }
.admin-panel__header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; min-height: 78px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.admin-panel__header .eyebrow { margin-bottom: 4px; }
.admin-panel__header h2, .admin-section-title h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.025em; }
.admin-panel__header > small { max-width: 250px; color: var(--muted); font-size: 10px; line-height: 1.4; text-align: right; }
.analytics-lead-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 12px; margin-top: 12px; }
.analytics-lead-grid.is-full { grid-template-columns: minmax(0, 1.5fr) minmax(310px, .7fr); }
.trend-panel, .funnel-panel { min-height: 350px; }
.sales-trend { padding: 8px 18px 17px; color: var(--accent); }
.sales-trend svg { display: block; width: 100%; height: auto; overflow: visible; }
.sales-trend__grid { fill: none; stroke: rgba(236,239,244,.08); stroke-width: 1; }
.sales-trend__paid-bar { fill: rgba(174,185,198,.14); }
.sales-trend__area { fill: url(#salesArea); }
.sales-trend__line { fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.sales-trend circle { fill: #111417; stroke: currentColor; stroke-width: 2; }
.sales-trend text { fill: var(--muted); font-size: 10px; }
.sales-trend__legend { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.sales-trend__legend > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.sales-trend__legend span { display: inline-flex; align-items: center; gap: 7px; }
.sales-trend__legend i { width: 18px; height: 2px; border-radius: 999px; background: var(--accent); }
.sales-trend__legend .is-orders i { width: 8px; height: 8px; background: rgba(174,185,198,.38); }
.sales-trend__legend strong { color: var(--soft); font-weight: 600; }
.sales-funnel { display: grid; gap: 2px; padding: 20px 20px 22px; }
.sales-funnel__step { position: relative; display: grid; gap: 8px; padding-bottom: 20px; }
.sales-funnel__step:last-child { padding-bottom: 0; }
.sales-funnel__step > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sales-funnel__step span { color: var(--soft); font-size: 11px; font-weight: 650; }
.sales-funnel__step strong { font-size: 21px; font-weight: 570; letter-spacing: -.04em; }
.sales-funnel__step i { display: block; overflow: hidden; height: 5px; border-radius: 999px; background: rgba(255,255,255,.055); }
.sales-funnel__step b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #718092, #aeb9c6); }
.sales-funnel__step small { color: var(--muted); font-size: 9px; }
.sales-funnel__step em { position: absolute; right: 1px; bottom: 2px; color: #59606a; font-size: 12px; font-style: normal; }
.attention-board { margin-top: 12px; }
.attention-board.has-items { border-color: rgba(216,155,148,.22); }
.attention-clear { display: flex; align-items: center; gap: 14px; min-height: 104px; padding: 20px; }
.attention-clear i { display: grid; flex: 0 0 auto; place-items: center; width: 39px; height: 39px; border: 1px solid rgba(142,182,161,.25); border-radius: 50%; color: var(--success); background: rgba(142,182,161,.08); font-style: normal; }
.attention-clear strong, .attention-clear span { display: block; }
.attention-clear strong { font-size: 13px; }
.attention-clear span { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.attention-list { display: grid; }
.attention-row { display: grid; grid-template-columns: auto minmax(160px,1fr) auto 70px 22px; align-items: center; gap: 12px; min-height: 68px; padding: 12px 18px; border: 0; border-top: 1px solid var(--line); color: var(--text); background: transparent; cursor: pointer; text-align: left; }
.attention-row:first-child { border-top: 0; }
.attention-row:hover { background: rgba(255,255,255,.022); }
.attention-row > span:nth-child(2) { min-width: 0; }
.attention-row > span:nth-child(2) strong, .attention-row > span:nth-child(2) small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-row > span:nth-child(2) strong { font-size: 11px; }
.attention-row > span:nth-child(2) small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.attention-row em { color: var(--muted); font-size: 9px; font-style: normal; text-align: right; }
.attention-row > b { color: var(--muted); font-size: 13px; font-weight: 500; }
.analytics-breakdown-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.analytics-breakdown-grid.is-home { grid-template-columns: repeat(2,minmax(0,1fr)); }
.analytics-breakdown__list { display: grid; gap: 14px; padding: 18px; }
.analytics-breakdown__list > div:not(.preview-empty) { display: grid; grid-template-columns: minmax(130px,1fr) minmax(80px,1.25fr) 44px; align-items: center; gap: 11px; }
.analytics-breakdown__list span { min-width: 0; }
.analytics-breakdown__list span strong, .analytics-breakdown__list span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-breakdown__list span strong { color: var(--soft); font-size: 11px; }
.analytics-breakdown__list span small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.analytics-breakdown__list i { display: block; overflow: hidden; height: 4px; border-radius: 999px; background: rgba(255,255,255,.055); }
.analytics-breakdown__list b { display: block; height: 100%; border-radius: inherit; background: #78879a; }
.analytics-breakdown__list em { color: var(--soft); font-size: 11px; font-style: normal; font-weight: 650; text-align: right; }
.audience-strip { display: grid; grid-template-columns: 1.35fr repeat(3,minmax(100px,.65fr)); align-items: stretch; margin-top: 12px; }
.audience-strip > div { display: grid; align-content: center; min-height: 100px; padding: 18px; border-left: 1px solid var(--line); }
.audience-strip > div:first-child { grid-template-columns: 1fr auto; align-items: center; border-left: 0; }
.audience-strip > div:first-child .eyebrow { grid-column: 1/-1; margin-bottom: 6px; }
.audience-strip span, .audience-strip small { color: var(--muted); font-size: 9px; font-weight: 650; }
.audience-strip strong { margin-top: 7px; font-size: 24px; font-weight: 570; letter-spacing: -.04em; }
.audience-strip > div:first-child strong { margin: 0; font-size: 31px; }
.analytics-summary-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 9px; }
.analytics-metric { min-width: 0; min-height: 142px; padding: 16px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.02); }
.analytics-metric span, .analytics-metric small { display: block; color: var(--muted); }
.analytics-metric span { font-size: 10px; font-weight: 700; }
.analytics-metric strong { display: block; margin: 22px 0 7px; overflow: hidden; font-size: clamp(21px,2vw,31px); font-weight: 570; letter-spacing: -.045em; text-overflow: ellipsis; white-space: nowrap; }
.analytics-metric small { font-size: 9px; line-height: 1.4; }
.analytics-metric .comparison-pills { margin-top: 10px; }
.comparison-panel { margin-top: 12px; }
.comparison-table-wrap { overflow-x: auto; }
.comparison-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.comparison-table th, .comparison-table td { padding: 12px 16px; border-top: 1px solid var(--line); text-align: right; }
.comparison-table thead th { border-top: 0; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.comparison-table th:first-child { text-align: left; }
.comparison-table tbody th { color: var(--soft); font-size: 10px; font-weight: 650; }
.comparison-table td strong, .comparison-table td small { display: block; }
.comparison-table td strong { color: var(--soft); font-size: 11px; font-weight: 650; }
.comparison-table td small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.comparison-table td small.is-up { color: #abc8b8; }
.comparison-table td small.is-down { color: #dfaaa3; }
.analytics-deep-grid { display: grid; grid-template-columns: minmax(340px,1.3fr) repeat(2,minmax(230px,.75fr)); gap: 12px; margin-top: 12px; }
.landing-funnel { display: grid; gap: 0; padding: 10px 18px 16px; }
.landing-funnel__step { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.landing-funnel__step:first-child { border-top: 0; }
.landing-funnel__step > span { display: grid; grid-template-columns: 25px minmax(0,1fr); align-items: center; min-width: 0; }
.landing-funnel__step > span i { grid-row: 1/3; color: #59606a; font-size: 9px; font-style: normal; }
.landing-funnel__step > span strong { color: var(--soft); font-size: 10px; }
.landing-funnel__step > span small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.landing-funnel__step > b { font-size: 19px; font-weight: 570; letter-spacing: -.035em; }
.landing-funnel__step > em { grid-column: 1/-1; display: block; overflow: hidden; height: 3px; border-radius: 999px; background: rgba(255,255,255,.045); }
.landing-funnel__step > em u { display: block; height: 100%; border-radius: inherit; background: #78879a; text-decoration: none; }
.landing-funnel > p { margin: 7px 0 0; color: #666d76; font-size: 8px; line-height: 1.5; }
.analytics-unavailable { display: grid; gap: 7px; padding: 28px 20px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.analytics-unavailable strong { color: var(--soft); font-size: 12px; }
.referral-panel { margin-top: 12px; }
.referral-analytics { display: grid; grid-template-columns: minmax(360px,.9fr) minmax(420px,1.1fr); min-width: 0; }
.referral-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.referral-metrics > div { display: grid; align-content: center; min-height: 116px; padding: 17px 19px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.referral-metrics > div:nth-child(odd) { border-left: 0; }
.referral-metrics span, .referral-metrics small { color: var(--muted); font-size: 9px; }
.referral-metrics span { font-weight: 700; }
.referral-metrics strong { margin: 11px 0 6px; font-size: 25px; font-weight: 570; letter-spacing: -.04em; }
.referral-trend-wrap { min-width: 0; padding: 16px 18px 13px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.referral-trend-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.referral-trend-heading span { color: var(--soft); font-size: 10px; font-weight: 700; }
.referral-trend-heading small { color: var(--muted); font-size: 8px; }
.referral-trend { margin-top: 8px; color: #91a0b2; }
.referral-trend svg { display: block; width: 100%; height: auto; overflow: visible; }
.referral-trend text { fill: #666d76; font-size: 8px; }
.referral-trend__grid { fill: none; stroke: rgba(236,239,244,.08); stroke-width: 1; }
.referral-trend__bar { fill: rgba(174,185,198,.17); }
.referral-trend__line { fill: none; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; }
.referral-trend__point { fill: #0c0d0f; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; }
.referral-trend__legend { display: flex; align-items: center; justify-content: flex-end; gap: 16px; color: var(--muted); font-size: 8px; }
.referral-trend__legend span { display: inline-flex; align-items: center; gap: 6px; }
.referral-trend__legend i { display: inline-block; width: 15px; height: 3px; border-radius: 999px; }
.referral-trend__legend .is-invited { background: rgba(174,185,198,.42); }
.referral-trend__legend .is-paid { background: #91a0b2; }
.customer-mix { padding: 17px; }
.customer-mix > div { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.customer-mix > div:first-child { border-top: 0; padding-top: 2px; }
.customer-mix > div span, .customer-mix > div small { color: var(--muted); font-size: 9px; }
.customer-mix > div span { display: flex; align-items: center; gap: 7px; }
.customer-mix > div span i { width: 7px; height: 7px; border-radius: 50%; background: #78879a; }
.customer-mix > div span i.is-repeat { background: #9cb6a9; }
.customer-mix > div strong { grid-row: 1/3; grid-column: 2; font-size: 22px; font-weight: 570; }
.customer-mix > div small { margin-top: 5px; }
.customer-mix > em { display: block; overflow: hidden; height: 5px; border-radius: 999px; background: #9cb6a9; }
.customer-mix > em i { display: block; height: 100%; background: #78879a; }
.subscription-countdown { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 17px; }
.subscription-countdown > div { min-width: 0; padding: 7px 12px; border-left: 1px solid var(--line); }
.subscription-countdown > div:first-child { padding-left: 0; border-left: 0; }
.subscription-countdown span, .subscription-countdown strong { display: block; }
.subscription-countdown span { color: var(--muted); font-size: 8px; }
.subscription-countdown strong { margin-top: 13px; font-size: 24px; font-weight: 570; }
.subscription-countdown .has-attention strong { color: #dfaaa3; }
.subscription-countdown small { display: block; margin-top: 8px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.trial-statistics { margin-top: 12px; }
.trial-statistics__metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.trial-statistics__metrics > div { min-width: 0; padding: 20px; }
.trial-statistics__metrics > div + div { border-left: 1px solid var(--line); }
.trial-statistics__metrics span, .trial-statistics__metrics strong, .trial-statistics__metrics small { display: block; }
.trial-statistics__metrics span { color: var(--soft); font-size: 11px; }
.trial-statistics__metrics strong { margin: 12px 0 6px; font-size: 28px; font-weight: 570; }
.trial-statistics__metrics small { color: var(--muted); font-size: 10px; line-height: 1.6; }
@media (max-width: 600px) {
  .trial-statistics__metrics { grid-template-columns: 1fr; }
  .trial-statistics__metrics > div + div { border-left: 0; border-top: 1px solid var(--line); }
}
.compact-insights { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-top: 12px; }
.compact-insights > div { min-height: 112px; padding: 17px; border-left: 1px solid var(--line); }
.compact-insights > div:first-child { border-left: 0; }
.compact-insights span, .compact-insights strong, .compact-insights small { display: block; }
.compact-insights strong { margin: 17px 0 6px; font-size: 25px; font-weight: 570; letter-spacing: -.04em; }
.compact-insights small { color: var(--muted); font-size: 9px; line-height: 1.7; }
.expiry-insight__table { width: 100%; margin-top: 14px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.expiry-insight__table th, .expiry-insight__table td { border: 0; padding: 7px 0 7px 12px; text-align: right; white-space: nowrap; }
.expiry-insight__table th:first-child { padding-left: 0; text-align: left; }
.expiry-insight__table thead th { padding-top: 0; padding-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 450; }
.expiry-insight__table tbody th { color: var(--soft); font-size: 12px; font-weight: 450; }
.expiry-insight__table td { color: var(--text); font-size: 16px; font-weight: 550; }
.expiry-insight__table .expiry-insight__total th { color: var(--text); }
.expiry-insight__table .expiry-insight__total td { font-size: 26px; font-weight: 570; letter-spacing: -.035em; }
.expiry-insight__table .expiry-insight__total th, .expiry-insight__table .expiry-insight__total td { padding-bottom: 12px; }
.expiry-insight__table .expiry-insight__total + tr th, .expiry-insight__table .expiry-insight__total + tr td { border-top: 1px solid var(--line); padding-top: 12px; }
.timing-panel { margin-top: 12px; }
.timing-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
.timing-grid > div { min-height: 112px; padding: 18px; border-left: 1px solid var(--line); }
.timing-grid > div:first-child { border-left: 0; }
.timing-grid span, .timing-grid small { display: block; color: var(--muted); font-size: 9px; }
.timing-grid strong { display: block; margin: 18px 0 6px; font-size: 24px; font-weight: 570; letter-spacing: -.04em; }
.reliability-panel { margin-top: 12px; }
.reliability-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); }
.reliability-item { min-height: 104px; padding: 18px; border-left: 1px solid var(--line); }
.reliability-item:first-child { border-left: 0; }
.reliability-item span { display: block; color: var(--muted); font-size: 10px; }
.reliability-item strong { display: block; margin-top: 19px; font-size: 26px; font-weight: 570; letter-spacing: -.04em; }
.reliability-item.is-success strong { color: #abc8b8; }
.reliability-item.is-danger strong { color: #dfaaa3; }
.reliability-item.is-muted strong { color: var(--muted); }
.preview-empty.is-compact { padding: 26px 18px; font-size: 11px; }
.audience-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 18px; }
.audience-stats > div { padding: 5px 15px; border-left: 1px solid var(--line); }
.audience-stats > div:first-child { border-left: 0; padding-left: 2px; }
.audience-stats span, .audience-new > span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.audience-stats strong { display: block; margin-top: 9px; font-size: 27px; font-weight: 570; letter-spacing: -.04em; }
.audience-new { display: flex; align-items: center; gap: 18px; margin: 0 18px 18px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.018); }
.audience-new > span { margin-right: auto; }
.audience-new strong { font-size: 14px; }
.audience-new small { color: var(--muted); font-size: 9px; font-weight: 600; }
.breakdown-bars { display: grid; gap: 13px; padding: 18px; }
.breakdown-bars > div { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(80px, 2fr) 38px; align-items: center; gap: 10px; }
.breakdown-bars span { overflow: hidden; color: var(--soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-bars i { overflow: hidden; height: 3px; border-radius: 999px; background: rgba(255,255,255,.055); }
.breakdown-bars b { display: block; height: 100%; border-radius: inherit; background: #78879a; }
.breakdown-bars strong { color: var(--muted); font-size: 11px; text-align: right; }
.order-health { margin-top: 12px; }
.order-health__channels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.order-health__channels > div { min-width: 0; padding: 17px 19px; border-left: 1px solid var(--line); }
.order-health__channels > div:first-child { border-left: 0; }
.order-health__channels > div > strong { display: block; margin-bottom: 12px; font-size: 12px; }
.order-health__channels > div > div { display: flex; flex-wrap: wrap; gap: 7px; }
.status-count { display: inline-flex; align-items: center; gap: 6px; min-height: 31px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; }
.status-count b { color: var(--text); font-size: 12px; }
.admin-section-title { margin: 30px 2px 13px; }
.admin-section-title .eyebrow { margin-bottom: 5px; }
.admin-shortcuts { grid-template-columns: repeat(4,minmax(0,1fr)); }
.admin-shortcuts .dashboard-card { min-height: 130px; background: rgba(18,20,22,.55); }
.admin-shortcuts .dashboard-card strong { margin-top: 27px; }

.order-toolbar { display: grid; grid-template-columns: auto minmax(230px, 1fr) 190px auto; gap: 9px; margin-bottom: 12px; }
.segmented-control { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
.segmented-control button { min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.segmented-control button.is-active { color: var(--text); background: rgba(var(--accent-rgb),.16); box-shadow: 0 5px 16px rgba(0,0,0,.17); }
.order-search { display: flex; min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
.order-search:focus-within { border-color: rgba(var(--accent-rgb),.5); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.09); }
.order-search input { width: 100%; min-width: 0; height: 44px; padding: 0 13px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; }
.order-search button { width: 44px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 19px; }
.order-select, .filter-toggle { min-height: 44px; border: 1px solid var(--line); border-radius: 14px; color: var(--soft); background: #111316; font-size: 11px; font-weight: 650; }
.order-select { padding: 0 34px 0 12px; }
.filter-toggle { padding: 0 13px; cursor: pointer; }
.filter-toggle.is-active { border-color: rgba(216,155,148,.33); color: #e0aaa4; background: rgba(216,155,148,.09); }
.orders-panel { overflow: hidden; }
.orders-summary { display: flex; justify-content: space-between; padding: 13px 17px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.orders-table-wrap { overflow-x: auto; }
.orders-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.orders-table th { padding: 11px 14px; color: var(--muted); background: rgba(255,255,255,.015); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.orders-table td { min-width: 112px; padding: 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.orders-table tbody tr { transition: background .15s ease; }
.orders-table tbody tr:hover { background: rgba(255,255,255,.023); }
.orders-table tbody tr.needs-attention { box-shadow: inset 3px 0 rgba(216,155,148,.55); }
.orders-table td strong, .orders-table td small { display: block; }
.orders-table td strong { margin-top: 5px; font-size: 12px; white-space: nowrap; }
.orders-table td small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.orders-table td:first-child small { max-width: 260px; overflow-wrap: anywhere; }
.channel-badge { display: inline-grid; place-items: center; min-width: 30px; height: 18px; padding: 0 5px; border-radius: 5px; font: 750 8px/1 ui-monospace, monospace; letter-spacing: .04em; }
.channel-badge.is-telegram { color: #b8c7d8; background: rgba(var(--accent-rgb),.14); }
.channel-badge.is-web { color: #c9bfda; background: rgba(130,112,153,.16); }
.order-open-cell { min-width: 58px !important; width: 58px; text-align: right; }
.order-open { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 11px; color: var(--soft); background: rgba(255,255,255,.025); cursor: pointer; }
.order-open:hover { border-color: var(--line-strong); background: rgba(var(--accent-rgb),.1); }
.orders-pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px; border-top: 1px solid var(--line); }
.orders-pagination span { color: var(--muted); font-size: 11px; }

.order-dialog { width: min(760px, calc(100vw - 24px)); max-height: min(900px, calc(100vh - 24px)); padding: 0; overflow: auto; border: 1px solid var(--line-strong); border-radius: 26px; color: var(--text); background: rgba(13,14,16,.97); box-shadow: 0 34px 120px rgba(0,0,0,.68); }
.order-dialog::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(7px); }
.order-dialog__header { position: sticky; top: 0; z-index: 3; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: rgba(13,14,16,.92); backdrop-filter: blur(20px); }
.order-dialog__header > div { min-width: 0; }
.order-dialog__header .channel-badge { float: left; margin: 1px 9px 0 0; }
.order-dialog__header .eyebrow { margin-bottom: 5px; }
.order-dialog__header h2 { margin: 0; overflow: hidden; font-size: 21px; font-weight: 600; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.order-dialog__body { display: grid; gap: 12px; padding: 16px; }
.order-dialog__loading { min-height: 260px; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 30px; color: var(--muted); text-align: center; }
.order-dialog__loading strong, .order-dialog__loading span { display: block; }
.order-detail-hero { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.order-detail-hero > div, .order-detail-grid, .subscription-strip, .order-actions, .order-history, .order-audit { border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.018); }
.order-detail-hero > div { padding: 17px; }
.order-detail-hero span, .order-detail-grid span, .subscription-strip span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.order-detail-hero strong { display: block; margin: 12px 0 6px; font-size: 23px; font-weight: 570; }
.order-detail-hero small { color: var(--muted); font-size: 10px; }
.order-warning { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 13px 15px; border: 1px solid rgba(216,155,148,.3); border-radius: 15px; background: rgba(216,155,148,.075); }
.order-warning strong { flex: 0 0 auto; color: #dfaaa3; font-size: 12px; }
.order-warning span { flex: 1 1 320px; color: var(--muted); font-size: 11px; }
.order-warning code { margin-left: auto; color: #dfaaa3; font-size: 9px; }
.provider-creation-card { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.018); }
.provider-creation-card.is-danger { border-color: rgba(216,155,148,.28); }
.provider-creation-card.is-success { border-color: rgba(124,181,145,.28); }
.provider-creation-card > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.provider-creation-card > div:first-child strong { font-size: 12px; }
.provider-creation-card > p { margin: 12px 0; color: var(--soft); font-size: 11px; line-height: 1.55; }
.provider-creation-card dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 0; }
.provider-creation-card dl div { min-width: 0; padding: 10px 11px; border-radius: 11px; background: rgba(255,255,255,.025); }
.provider-creation-card dl div.is-wide { grid-column: 1/-1; }
.provider-creation-card dt { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.provider-creation-card dd { margin: 6px 0 0; overflow-wrap: anywhere; color: var(--soft); font-size: 10px; }
.order-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: hidden; }
.order-detail-grid > div { min-width: 0; padding: 14px 16px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.order-detail-grid > div:nth-child(-n+2) { border-top: 0; }
.order-detail-grid > div:nth-child(odd) { border-left: 0; }
.order-detail-grid > div.is-wide { grid-column: 1/-1; border-left: 0; }
.order-detail-grid strong { display: block; overflow-wrap: anywhere; margin-top: 7px; font: 600 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.subscription-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 15px; }
.subscription-strip > div { padding: 2px 14px; border-left: 1px solid var(--line); }
.subscription-strip > div:first-child { border-left: 0; padding-left: 2px; }
.subscription-strip strong { display: block; margin-top: 8px; font-size: 13px; }
.order-actions, .order-history, .order-audit { padding: 16px; }
.order-actions h3, .order-history h3, .order-audit h3 { margin: 0; font-size: 16px; }
.order-actions .eyebrow, .order-history .eyebrow, .order-audit .eyebrow { margin-bottom: 4px; }
.order-history__heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.order-history__heading > small { color: var(--muted); font-size: 9px; }
.order-history__list { display: grid; gap: 7px; margin-top: 13px; }
.order-history__item { display: grid; grid-template-columns: auto minmax(0,1fr) auto 18px; align-items: center; gap: 11px; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: rgba(255,255,255,.018); cursor: pointer; text-align: left; }
.order-history__item:hover { border-color: rgba(var(--accent-rgb),.35); background: rgba(var(--accent-rgb),.07); }
.order-history__item > span:nth-child(2) { min-width: 0; }
.order-history__item > span:nth-child(3) { text-align: right; }
.order-history__item strong, .order-history__item small { display: block; }
.order-history__item strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.order-history__item small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.order-history__item .payment-status { display: inline-block; margin-top: 5px; }
.order-history__item > b { color: var(--muted); font-size: 16px; }
.order-history__empty { margin: 13px 0 0; color: var(--muted); font-size: 11px; }
.order-actions > div:last-child { display: grid; gap: 7px; margin-top: 13px; }
.order-action-control { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.012); }
.order-action-control.is-danger { border-color: rgba(216,155,148,.24); }
.order-action-control > label > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.order-action-control input[type="text"], .order-action-control input:not([type]), .order-action-control textarea, .order-action-control select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: rgba(0,0,0,.2); font: 500 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; outline: none; }
.order-action-control textarea { min-height: 72px; resize: vertical; font-family: inherit; }
.order-action-control input:focus, .order-action-control textarea:focus, .order-action-control select:focus { border-color: rgba(var(--accent-rgb),.48); }
.order-action-confirm { display: flex !important; align-items: flex-start; gap: 9px; }
.order-action-confirm input { margin: 2px 0 0; accent-color: var(--accent); }
.order-action-confirm span { margin: 0 !important; color: var(--soft) !important; font-size: 10px !important; font-weight: 500 !important; line-height: 1.45; text-transform: none !important; }
.order-actions button { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 58px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: rgba(255,255,255,.022); cursor: pointer; text-align: left; }
.order-actions button:hover { border-color: rgba(var(--accent-rgb),.35); background: rgba(var(--accent-rgb),.07); }
.order-actions button strong, .order-actions button small { display: block; }
.order-actions button strong { font-size: 12px; }
.order-actions button small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.order-actions p, .order-audit p { margin: 13px 0 0; color: var(--muted); font-size: 11px; }
.audit-item { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.order-audit > .audit-item:first-of-type { margin-top: 12px; }
.audit-item i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.audit-item i.is-succeeded { background: var(--success); }
.audit-item i.is-failed { background: var(--danger); }
.audit-item strong, .audit-item small { display: block; }
.audit-item strong { font-size: 11px; }
.audit-item small, .audit-item > span { margin-top: 3px; color: var(--muted); font-size: 9px; }

.actionbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; min-height: calc(72px + var(--safe-bottom)); padding: 12px max(24px, calc((100vw - 1452px)/2 + 24px)) calc(12px + var(--safe-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); background: rgba(8,9,10,.9); backdrop-filter: blur(22px); }
.actionbar__primary { display: flex; gap: 8px; }
.button { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; font-weight: 700; font-size: 13px; transition: transform .15s, opacity .15s, border-color .15s; }
.button:hover { border-color: var(--line-strong); }.button:active { transform: scale(.98); }.button:disabled { opacity: .45; cursor: wait; }
.button--quiet { background: transparent; color: var(--muted); }.button--secondary { background: var(--surface-2); }.button--primary { color: var(--accent-ink); background: var(--accent); border-color: transparent; }

.history-dialog { width: min(560px, calc(100vw - 28px)); max-height: min(720px, calc(100vh - 28px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 24px; color: var(--text); background: #171b18; box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.history-dialog::backdrop { background: rgba(0,0,0,.58); backdrop-filter: blur(5px); }
.dialog__header { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 20px; border-bottom: 1px solid var(--line); background: #171b18; }
.dialog__header h2 { font-size: 22px; }.history-list { padding: 12px; display: grid; gap: 8px; }
.history-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; }
.history-item strong, .history-item small { display: block; }.history-item small { margin-top: 4px; color: var(--muted); }

.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(88px + var(--safe-bottom)); max-width: calc(100vw - 32px); padding: 11px 15px; border: 1px solid var(--line-strong); border-radius: 13px; background: #2a312b; box-shadow: var(--shadow); color: var(--text); font-size: 13px; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translate(-50%,0); }
.toast.is-error { border-color: rgba(223,157,146,.35); }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 76px minmax(420px, 1fr) minmax(310px, .7fr); }
  .nav-group-label { margin-inline: 0; text-align: center; font-size: 7px; letter-spacing: .08em; }
  .nav-item { justify-content: center; padding: 8px; }.nav-item > span:last-child { display: none; }
}

@media (max-width: 860px) {
  .app { padding-bottom: calc(82px + var(--safe-bottom)); }
  .topbar { height: 62px; padding: 0 14px; }.save-state > span { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 16px; padding: 12px 12px 24px; }
  .sidebar { position: sticky; z-index: 15; top: 62px; width: 100%; max-width: 100%; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; background: linear-gradient(var(--bg) 75%, transparent); scrollbar-width: none; }
  .nav-group-label { display: none; }
  .sidebar::-webkit-scrollbar { display: none; }.nav-item { flex: 0 0 auto; min-height: 39px; padding: 6px 10px; border-color: var(--line); background: rgba(22,27,23,.94); }.nav-item > span:last-child { display: inline; }.nav-item__icon { width: 23px; height: 23px; }
  .editor-main, .preview { width: 100%; }.preview { position: static; }
  .editor-main { scroll-margin-top: 118px; }
  .phone-preview { max-width: 460px; margin: 0 auto; }.chat-preview { min-height: 420px; }
  .promotion-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payment-breakdowns { grid-template-columns: 1fr; }
  .actionbar { min-height: calc(64px + var(--safe-bottom)); padding: 9px 12px calc(9px + var(--safe-bottom)); }.button { min-height: 42px; padding: 0 12px; }#resetButton { font-size: 0; }#resetButton::after { content: "Сбросить"; font-size: 12px; }
}

@media (max-width: 640px) {
  .promotion-analytics__header, .promotion-editor-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .promotion-analytics__header small, .promotion-editor-heading small { text-align: left; }
  .promotion-table thead { display: none; }
  .promotion-table, .promotion-table tbody { display: block; }
  .promotion-table tbody { display: grid; gap: 9px; padding: 10px; }
  .promotion-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.018); }
  .promotion-table td { display: block; min-width: 0; padding: 0; border: 0 !important; }
  .promotion-table td:first-child { grid-column: 1 / -1; }
  .promotion-table td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
  .promotion-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
}

@media (max-width: 520px) {
  .section-heading { margin-bottom: 16px; }.section-heading h1 { font-size: 29px; }.section-heading p { font-size: 13px; }
  .dashboard-grid, .field-grid { grid-template-columns: 1fr; }.dashboard-card { min-height: 112px; }.dashboard-card strong { margin-top: 20px; }
  .form-card { padding: 16px; border-radius: 18px; }.form-card__heading { margin-bottom: 14px; }
  .actionbar__primary { flex: 1; }.actionbar__primary .button { flex: 1; }.button--secondary { padding-inline: 9px; }
  .attachment__current { flex-wrap: wrap; }.attachment__actions { margin-left: 50px; }
  .section-actions { justify-content: stretch; margin: 0 0 14px; }.section-actions .button { width: 100%; }
  .promotion-metric { padding: 13px; }.promotion-metric strong { margin-top: 9px; font-size: 24px; }
  .check-grid { grid-template-columns: 1fr; }
  .promotion-card__footer { align-items: stretch; flex-direction: column; }.promotion-card__footer .button { width: 100%; }
}

@media (max-width: 1280px) {
  .admin-kpis { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .admin-kpi:first-child { grid-column: span 2; }
  .analytics-summary-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .analytics-metric:first-child { grid-column: span 2; }
  .analytics-deep-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .landing-funnel-panel { grid-column: 1/-1; }
  .compact-insights { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .compact-insights > div:nth-child(odd) { border-left: 0; }
  .compact-insights > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .admin-shortcuts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .order-toolbar { grid-template-columns: auto minmax(220px,1fr) 180px; }
  .filter-toggle { grid-column: 1/-1; }
}

@media (max-width: 860px) {
  .admin-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-kpi:first-child { grid-column: span 2; }
  .admin-overview-grid { grid-template-columns: 1fr; }
  .analytics-lead-grid, .analytics-lead-grid.is-full { grid-template-columns: 1fr; }
  .analytics-deep-grid { grid-template-columns: 1fr; }
  .referral-analytics { grid-template-columns: 1fr; }
  .referral-trend-wrap { border-left: 0; }
  .landing-funnel-panel { grid-column: auto; }
  .trend-panel, .funnel-panel { min-height: 0; }
  .timing-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .timing-grid > div:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .timing-grid > div:nth-child(4) { border-top: 1px solid var(--line); }
  .reliability-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .reliability-item:nth-child(4) { border-left: 0; border-top: 1px solid var(--line); }
  .reliability-item:nth-child(5) { border-top: 1px solid var(--line); }
  .order-toolbar { grid-template-columns: 1fr 1fr; }
  .segmented-control, .order-search { grid-column: 1/-1; }
  .order-dialog { border-radius: 22px; }
}

@media (max-width: 640px) {
  .admin-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .admin-heading .button { width: 100%; }
  .admin-heading__actions { flex: 0 0 auto; width: 100%; }
  .period-picker { width: 100%; align-items: stretch; }
  .admin-heading__actions .range-control { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); width: 100%; }
  .admin-heading__actions .range-control button { width: 100%; }
  .admin-heading__actions .button { flex: 1 1 auto; width: auto; }
  .custom-period { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .custom-period input { width: 100%; }
  .custom-period .button { grid-column: 1/-1; }
  .admin-utility { width: 100%; flex-wrap: wrap; }
  .freshness-badge { flex: 1 1 120px; max-width: none; }
  .admin-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-kpi { min-height: 124px; padding: 15px; }
  .admin-kpi:first-child { grid-column: 1/-1; }
  .admin-kpi strong { margin-top: 20px; font-size: 28px; }
  .analytics-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .analytics-metric:first-child { grid-column: 1/-1; }
  .analytics-metric { min-height: 112px; }
  .analytics-breakdown-grid, .analytics-breakdown-grid.is-home { grid-template-columns: 1fr; }
  .referral-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .compact-insights { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .comparison-panel .admin-panel__header { align-items: flex-start; flex-direction: column; gap: 5px; }
  .audience-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .audience-strip > div { min-height: 84px; padding: 14px; }
  .audience-strip > div:first-child { grid-column: 1/-1; border-bottom: 1px solid var(--line); }
  .audience-strip > div:nth-child(2) { border-left: 0; }
  .attention-row { grid-template-columns: auto minmax(0,1fr) auto; gap: 9px; padding: 12px 14px; }
  .attention-row .payment-status { grid-column: 2; justify-self: start; }
  .attention-row em { grid-column: 2; text-align: left; }
  .attention-row > b { grid-column: 3; grid-row: 1/4; }
  .reliability-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reliability-item:nth-child(n) { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
  .reliability-item:nth-child(-n+2) { border-top: 0; }
  .reliability-item:nth-child(odd) { border-left: 0; }
  .audience-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 0; }
  .audience-stats > div:nth-child(3) { border-left: 0; padding-left: 2px; }
  .audience-new { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
  .audience-new > span { grid-column: 1/-1; }
  .order-health__channels { grid-template-columns: 1fr; }
  .order-health__channels > div { border-top: 1px solid var(--line); border-left: 0; }
  .order-health__channels > div:first-child { border-top: 0; }
  .order-toolbar { grid-template-columns: 1fr; }
  .segmented-control, .order-search, .filter-toggle { grid-column: auto; }
  .segmented-control button { flex: 1; }
  .orders-table-wrap { overflow: visible; }
  .orders-table thead { display: none; }
  .orders-table, .orders-table tbody { display: block; }
  .orders-table tbody { display: grid; gap: 9px; padding: 10px; }
  .orders-table tr { position: relative; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px 10px; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.018); }
  .orders-table tr.needs-attention { box-shadow: inset 3px 0 rgba(216,155,148,.55); }
  .orders-table td { display: block; min-width: 0; padding: 0; border: 0; }
  .orders-table td:first-child { grid-column: 1/-1; padding-right: 44px; }
  .orders-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
  .orders-table td:first-child::before, .order-open-cell::before { display: none; }
  .order-open-cell { position: absolute; top: 12px; right: 12px; width: 36px; }
  .order-dialog { position: fixed; inset: 12px 0 0; width: 100%; height: calc(100dvh - 12px); max-width: none; max-height: none; margin: 0; border-radius: 24px 24px 0 0; }
  .order-dialog__header { padding: 17px; }
  .order-dialog__body { padding: 10px; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .order-detail-grid > div { border-top: 1px solid var(--line) !important; border-left: 0; }
  .order-detail-grid > div:first-child { border-top: 0 !important; }
  .order-history__heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .order-history__item { grid-template-columns: auto minmax(0,1fr) 16px; }
  .order-history__item > span:nth-child(3) { grid-column: 2; text-align: left; }
  .order-history__item > b { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 430px) {
  .brand small { display: none; }
  .admin-heading__actions { align-items: stretch; flex-direction: column; }
  .admin-heading__actions .button { width: 100%; }
  .admin-utility .freshness-badge { flex-basis: 100%; }
  .admin-utility .auto-refresh, .admin-utility .export-button, .admin-utility .button { flex: 1 1 30%; width: auto; }
  .compact-insights { grid-template-columns: 1fr; }
  .compact-insights > div:nth-child(n) { border-top: 1px solid var(--line); border-left: 0; }
  .compact-insights > div:first-child { border-top: 0; }
  .timing-grid { grid-template-columns: 1fr; }
  .timing-grid > div:nth-child(n) { border-top: 1px solid var(--line); border-left: 0; }
  .timing-grid > div:first-child { border-top: 0; }
  .admin-shortcuts { grid-template-columns: 1fr; }
  .admin-shortcuts .dashboard-card { min-height: 104px; }
  .admin-shortcuts .dashboard-card strong { margin-top: 17px; }
  .admin-panel__header { align-items: flex-start; flex-direction: column; gap: 5px; }
  .admin-panel__header > small { text-align: left; }
  .sales-trend { padding-inline: 10px; }
  .sales-trend__legend { align-items: flex-start; flex-direction: column; }
  .referral-metrics > div { min-height: 100px; padding: 14px; }
  .referral-metrics strong { font-size: 22px; }
  .referral-trend-wrap { padding-inline: 10px; }
  .referral-trend-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .analytics-breakdown__list > div:not(.preview-empty) { grid-template-columns: minmax(110px,1fr) minmax(60px,.8fr) 32px; gap: 8px; }
  .order-detail-hero { grid-template-columns: 1fr; }
  .order-dialog__header h2 { font-size: 18px; white-space: normal; }
  .subscription-strip { grid-template-columns: 1fr; gap: 12px; }
  .subscription-strip > div { padding: 0; border-left: 0; }
}

.subscription-results { margin: 22px 0; }
.subscription-results__heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 0 4px 14px; }
.subscription-results__heading h2 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.035em; }
.subscription-results__heading > span { color: var(--muted); font-size: 12px; }
.subscription-results__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.conversion-card { --conversion-color: #9fc5b1; padding: 25px; border: 1px solid var(--line); border-radius: 22px; background: radial-gradient(ellipse at 5% 0, rgba(142,182,161,.08), transparent 68%), var(--surface); display: flex; flex-direction: column; }
.conversion-card--trial { --conversion-color: #a6bbd7; background: radial-gradient(ellipse at 5% 0, rgba(128,157,195,.09), transparent 68%), var(--surface); }
.conversion-card__top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.conversion-card__icon { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 11px; font-size: 21px; color: var(--conversion-color); }
.conversion-card__period { color: var(--soft); background: rgba(255,255,255,.04); padding: 6px 10px; border: 1px solid var(--line); border-radius: 20px; font-size: 11px; }
.conversion-card h3 { margin: 20px 0 13px; font-size: 17px; font-weight: 600; letter-spacing: -.025em; }
.conversion-card__value { display: flex; align-items: center; gap: 14px; min-height: 65px; }
.conversion-card__value > strong { color: var(--conversion-color); font-size: 50px; line-height: 1; font-weight: 550; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.conversion-card__value > span { max-width: 200px; font-size: 12px; color: var(--muted); line-height: 1.65; }
.conversion-card__value > b { margin-left: auto; color: var(--conversion-color); font-size: 15px; white-space: nowrap; }
.conversion-card__track { overflow: hidden; height: 5px; border-radius: 8px; background: rgba(255,255,255,.065); margin-top: 20px; }
.conversion-card__track svg { display: block; width: 100%; height: 100%; }
.conversion-card__track rect { fill: var(--conversion-color); }
.conversion-card__track--split { background: rgba(166,187,215,.55); }
.conversion-card__track--split rect { fill: #ded9bb; }
.conversion-card__track--split.is-empty { background: rgba(255,255,255,.065); }
.conversion-card__caption { margin-top: 10px; color: var(--muted); font-size: 12px; }
.conversion-card__caption strong { color: var(--soft); font-weight: 600; }
.conversion-card__table { width: 100%; margin-top: 21px; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.conversion-card__table th { text-align: left; font-weight: 450; color: var(--soft); }
.conversion-card__table th, .conversion-card__table td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.conversion-card__table thead th { color: var(--muted); font-size: 11px; }
.conversion-card__table th:not(:first-child), .conversion-card__table td { text-align: right; }
.conversion-card__table td:last-child { color: var(--conversion-color); font-weight: 650; }
.conversion-card__breakdown { margin: 21px 0 0; }
.conversion-card__breakdown > div { display: flex; justify-content: space-between; gap: 14px; align-items: center; min-height: 46px; border-bottom: 1px solid var(--line); }
.conversion-card__breakdown dt { color: var(--soft); font-size: 12px; display: flex; gap: 9px; align-items: center; }
.conversion-card__breakdown dd { margin: 0; font-size: 17px; font-variant-numeric: tabular-nums; }
.conversion-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--conversion-color); }
.conversion-dot--early { background: #ded9bb; }
.conversion-card__note { color: var(--muted); font-size: 11px; line-height: 1.65; margin: auto 0 0; padding-top: 19px; }
@media (max-width: 760px) {
  .subscription-results__grid { grid-template-columns: 1fr; }
  .subscription-results__heading { align-items: start; flex-direction: column; gap: 8px; }
  .conversion-card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
}

.orders-table .order-bs-extra { color: var(--text, #f1f1f1); font-weight: 600; white-space: normal; }

.active-subscriptions-panel { margin: 16px 0; }
.active-subscriptions-totals, .active-subscriptions-plans {
  display: grid; gap: 12px; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 18px 19px;
}
.active-subscriptions-plans { grid-template-columns: repeat(4,minmax(0,1fr)); border-top: 1px solid var(--line); }
.active-subscriptions-totals > div, .active-subscriptions-plans > div { min-width: 0; }
.active-subscriptions-totals span, .active-subscriptions-plans span { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.active-subscriptions-totals strong { display: block; font-size: 28px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.active-subscriptions-plans strong { display: block; font-size: 21px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.active-subscriptions-panel > p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 0; padding: 0 19px 18px; overflow-wrap: anywhere; }
@media(max-width:600px) {
  .active-subscriptions-panel .admin-panel__header { padding: 16px; gap: 8px; }
  .active-subscriptions-panel .admin-panel__header h2 { font-size: 18px; }
  .active-subscriptions-panel .eyebrow { font-size: 9px; line-height: 1.5; }
  .active-subscriptions-totals { grid-template-columns: 1fr; gap: 0; padding: 4px 16px; }
  .active-subscriptions-totals > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
  .active-subscriptions-totals > div + div { border-top: 1px solid var(--line); }
  .active-subscriptions-totals strong { margin: 0; font-size: 24px; }
  .active-subscriptions-plans { grid-template-columns:repeat(2,minmax(0,1fr)); gap: 16px; padding: 16px; }
  .active-subscriptions-plans > div { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
  .active-subscriptions-panel > p { padding: 0 16px 16px; }
  .admin-kpi small { line-height: 1.5; overflow-wrap: anywhere; }
}
:root .analytics-pwa-panel .analytics-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 16px; }
:root .analytics-pwa-panel .analytics-metric { grid-column: auto; }
:root .analytics-pwa-panel > small, :root .analytics-pwa-panel > p { display: block; padding: 0 16px 16px; color: var(--muted); line-height: 1.5; }
@media (max-width: 640px) { :root .analytics-pwa-panel .analytics-summary-grid { grid-template-columns: 1fr; } }
