:root {
  color-scheme: light dark;
  --bg: #090a10;
  --surface: #131521;
  --surface-2: #1a1d2c;
  --glass: rgba(16,18,29,.82);
  --text: #ffffff;
  --muted: #d0d5e8;
  --line: rgba(255,255,255,.16);
  --accent: #5e67ff;
  --accent-strong: #9b53ff;
  --accent-soft: #24284b;
  --success: #00d878;
  --success-soft: #123d31;
  --warning: #ffc15a;
  --warning-soft: #49391d;
  --danger: #ff7d91;
  --danger-soft: #542630;
  --tg: #229ed9;
  --max: #6851ff;
  --vk: #2787f5;
  --shadow-low: 0 5px 14px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.07);
  --shadow-medium: 0 14px 30px rgba(0,0,0,.3), 0 3px 8px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.09);
  --shadow-high: 0 24px 64px rgba(0,0,0,.58), 0 6px 18px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.13);
  --shadow: var(--shadow-high);
  --motion-fast: 150ms;
  --motion-base: 220ms;
  --ease-out: cubic-bezier(.2,.8,.2,1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --control-gap: var(--space-2);
  --related-gap: var(--space-3);
  --content-gap: var(--space-4);
  --subsection-gap: var(--space-5);
  --section-gap: var(--space-5);
  --card-padding: var(--space-4);
  --page-bottom-gap: var(--space-6);
  --bottom-nav-height: 64px;
  --shell-gap: 16px;
  --content-bottom-inset: calc(var(--bottom-nav-height) + var(--shell-gap) + var(--page-bottom-gap) + var(--safe-bottom));
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090a10;
    --surface: #131521;
    --surface-2: #1a1d2c;
    --glass: rgba(16,18,29,.82);
    --text: #ffffff;
    --muted: #d0d5e8;
    --line: rgba(255,255,255,.16);
    --accent: #5e67ff;
    --accent-strong: #9b53ff;
    --accent-soft: #24284b;
    --success: #00d878;
    --success-soft: #123d31;
    --warning: #ffc15a;
    --warning-soft: #49391d;
    --danger: #ff7d91;
    --danger-soft: #542630;
    --shadow: var(--shadow-high);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #e9edf7;
  --glass: rgba(255,255,255,.88);
  --text: #171a28;
  --muted: #5d6579;
  --line: rgba(28,35,59,.16);
  --accent: #4f46e5;
  --accent-strong: #7c3aed;
  --accent-soft: #e9e8ff;
  --success: #087f5b;
  --success-soft: #dff6ed;
  --warning: #9a5b00;
  --warning-soft: #fff1cf;
  --danger: #c33855;
  --danger-soft: #ffe4ea;
  --shadow-low: 0 5px 14px rgba(30,38,70,.08), inset 0 1px 0 rgba(255,255,255,.75);
  --shadow-medium: 0 14px 30px rgba(30,38,70,.11), inset 0 1px 0 rgba(255,255,255,.8);
  --shadow-high: 0 24px 64px rgba(30,38,70,.16), inset 0 1px 0 rgba(255,255,255,.9);
}

:root[data-theme="dusk"] {
  color-scheme: dark;
  --bg: #252b34;
  --surface: #303742;
  --surface-2: #3a4350;
  --glass: rgba(43,50,61,.92);
  --text: #f7f9fc;
  --muted: #c1cad5;
  --line: rgba(225,232,240,.2);
  --accent: #9bb0c4;
  --accent-strong: #748da5;
  --accent-soft: #465563;
  --success: #66d6ad;
  --success-soft: #294b43;
  --warning: #f3c87a;
  --warning-soft: #5a4930;
  --danger: #f39aaa;
  --danger-soft: #5a3740;
  --shadow-low: 0 5px 14px rgba(8,12,18,.18), inset 0 1px 0 rgba(255,255,255,.08);
  --shadow-medium: 0 14px 30px rgba(8,12,18,.24), inset 0 1px 0 rgba(255,255,255,.09);
  --shadow-high: 0 24px 64px rgba(8,12,18,.34), inset 0 1px 0 rgba(255,255,255,.12);
}

/* Light theme needs its own control surfaces: the default controls below are
   intentionally dark and otherwise lose contrast against the pale canvas. */
:root[data-theme="light"] .button.secondary,
:root[data-theme="light"] .icon-button,
:root[data-theme="light"] .tool-button {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background: linear-gradient(145deg, #ffffff, #e8ebf6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 6px 16px rgba(30,38,70,.12);
}
:root[data-theme="dusk"] .button.secondary,
:root[data-theme="dusk"] .icon-button,
:root[data-theme="dusk"] .tool-button {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  background: linear-gradient(145deg, #485362, #343c48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 6px 16px rgba(8,12,18,.18);
}
:root[data-theme="light"] .button.ghost {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
:root[data-theme="dusk"] .button.ghost {
  color: #d7e1ea;
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}
:root[data-theme="light"] .button:disabled,
:root[data-theme="light"] .icon-button:disabled,
:root[data-theme="light"] .tool-button:disabled {
  opacity: 1;
  color: #747b8f;
  border-color: rgba(28,35,59,.13);
  background: #e4e7f0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
:root[data-theme="dusk"] .button:disabled,
:root[data-theme="dusk"] .icon-button:disabled,
:root[data-theme="dusk"] .tool-button:disabled {
  opacity: 1;
  color: #a7b0bb;
  border-color: rgba(225,232,240,.12);
  background: #3b434e;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
:root[data-theme="light"] .notification-button {
  color: var(--accent);
  background: linear-gradient(145deg, #ffffff, #e4e7f4);
}
:root[data-theme="dusk"] .notification-button {
  color: #eef3f7;
  background: linear-gradient(145deg, #485362, #343c48);
}
:root[data-theme="light"] .elevated-surface {
  background: linear-gradient(145deg, #ffffff, #eef0f7);
}
:root[data-theme="dusk"] .elevated-surface { background: linear-gradient(145deg, #3b4552, #2d343e); }
:root[data-theme="light"] .bottom-nav.glass {
  border-color: rgba(40,47,80,.24);
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 34px rgba(30,38,70,.18), inset 0 1px 0 #fff;
}
:root[data-theme="dusk"] .bottom-nav.glass {
  border-color: rgba(225,232,240,.22);
  background: rgba(48,55,66,.96);
  box-shadow: 0 14px 34px rgba(8,12,18,.28), inset 0 1px 0 rgba(255,255,255,.1);
}
:root[data-theme="light"] .bottom-nav button {
  color: #596176;
}
:root[data-theme="dusk"] .bottom-nav button { color: #c1cad5; }
:root[data-theme="light"] .bottom-nav button[aria-current="page"] {
  color: #fff;
  background: linear-gradient(145deg, #5b55e8, #7667ee);
  box-shadow: 0 7px 18px rgba(79,70,229,.28), inset 0 1px 0 rgba(255,255,255,.28);
}
:root[data-theme="dusk"] .bottom-nav button[aria-current="page"] {
  color: #fff;
  background: linear-gradient(145deg, #7e96ab, #657d94);
  box-shadow: 0 7px 18px rgba(8,12,18,.3), inset 0 1px 0 rgba(255,255,255,.2);
}
:root[data-theme="dusk"] .button.primary {
  border-color: color-mix(in srgb, #9bb0c4 70%, #fff);
  background: linear-gradient(145deg, #859db2, #657e95);
  box-shadow: 0 11px 22px rgba(8,12,18,.28), inset 0 1px 0 rgba(255,255,255,.2);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  overflow: hidden;
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% -12%, color-mix(in srgb, #9b53ff 10%, transparent), transparent 68rem),
    radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 64rem),
    radial-gradient(circle at 50% 94%, color-mix(in srgb, #4b237c 11%, transparent), transparent 68rem),
    var(--bg);
  font: 400 15px/1.5 ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, select { min-height: 44px; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
button:not(:disabled), select, input, textarea, [contenteditable="true"] { transition: transform var(--motion-fast) var(--ease-out), box-shadow var(--motion-base) var(--ease-out), border-color var(--motion-fast) ease, background-color var(--motion-base) var(--ease-out), color var(--motion-fast) ease, opacity var(--motion-fast) ease; }
button:not(:disabled):active { transform: translateY(1px) scale(.975); transition-duration: 80ms; }
input, select, textarea, [contenteditable="true"] { color: var(--text); background: var(--surface); }
input:focus, select:focus, textarea:focus, [contenteditable="true"]:focus { transform: translateY(-1px); }
button:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 72%, white);
  outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, [contenteditable="true"]:focus-visible {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent) inset, inset 0 1px 0 rgba(255,255,255,.08);
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.skip-link { position: fixed; z-index: 100; left: 12px; top: 8px; display: inline-flex; min-height: 44px; padding: 10px 14px; align-items: center; color: #fff; background: #111; border-radius: 10px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.app-shell { position: relative; width: min(100%, 560px); height: var(--app-height, 100dvh); min-height: 0; margin: 0 auto; overflow: hidden; }
.glass { border: 1px solid color-mix(in srgb, var(--line) 98%, white 2%); background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 36%, transparent), color-mix(in srgb, var(--glass) 96%, #1c1c28 4%)); box-shadow: var(--shadow-high), inset 0 1px 0 rgba(255,255,255,.15), inset 0 -1px 0 rgba(0,0,0,.24); backdrop-filter: blur(24px) saturate(155%); -webkit-backdrop-filter: blur(24px) saturate(155%); }

.connection-banner { position: absolute; z-index: 40; top: calc(72px + var(--safe-top)); right: calc(12px + var(--safe-right)); left: calc(12px + var(--safe-left)); display: flex; padding: 9px 10px; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid color-mix(in srgb, var(--warning) 34%, var(--line)); border-radius: 14px; color: var(--warning); background: color-mix(in srgb, var(--warning-soft) 86%, transparent); box-shadow: 0 12px 26px rgba(0,0,0,.18); backdrop-filter: blur(16px); font-size: 12.5px; }
.banner-retry { flex: 0 0 auto; min-height: 36px; padding: 6px 10px; border: 1px solid currentColor; border-radius: 10px; color: inherit; background: transparent; font-weight: 750; }
.host-bar { position: absolute; z-index: 30; top: calc(10px + var(--safe-top)); right: calc(12px + var(--safe-right)); left: calc(12px + var(--safe-left)); display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 7px; border-radius: 20px; }
.brand-button { border: 0; background: transparent; }
.host-actions { display: flex; align-items: center; gap: 3px; }
.brand-button { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 6px; text-align: left; }
.brand-button span:last-child { min-width: 0; }
.brand-button strong, .brand-button small { display: block; }
.brand-button strong { font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.brand-button small { color: var(--muted); font-size: 12px; }
.brand-mark { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; }
.brand-mark img { display: block; width: 34px; height: 34px; object-fit: contain; }
.notification-button { position: relative; flex-basis: 44px; border: 1px solid var(--line); background: var(--surface-2); }
.notification-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.notification-count { position: absolute; top: 1px; right: 0; display: grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border: 2px solid var(--surface); border-radius: 999px; color: white; background: var(--danger); font-size: 10px; font-weight: 800; }
.help-button { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; background: radial-gradient(circle at center, var(--accent) 0 13px, color-mix(in srgb, var(--accent) 76%, white) 14px, transparent 15px); font-size: 16px; font-weight: 800; line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.help-button::before { content: none; }
.help-button::after { content: none; }

#app-main { height: 100%; min-height: 0; padding: calc(88px + var(--safe-top)) calc(12px + var(--safe-right)) var(--content-bottom-inset) calc(12px + var(--safe-left)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; scroll-padding-block: calc(84px + var(--safe-top)) var(--content-bottom-inset); }
#app-main::-webkit-scrollbar { display: none; }
.screen-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--related-gap); margin: 2px 2px var(--content-gap); }
.screen-head h1 { margin: 2px 0 5px; font-size: clamp(26px, 7vw, 34px); font-weight: 650; line-height: 1.08; letter-spacing: -.04em; }
.screen-head h1:focus { outline: none; }
.screen-head p, .section-copy { margin: 0; color: var(--muted); }
.refresh-button { position: fixed; z-index: 29; top: calc(76px + var(--safe-top)); right: max(calc(12px + var(--safe-right)), calc((100vw - 560px) / 2 + 12px)); border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); background: #1c1c28; box-shadow: var(--shadow-medium); }
.eyebrow { margin: 0; color: var(--accent); font-size: 11.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.2; letter-spacing: -.022em; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
p { margin: 6px 0 0; }

.surface { min-width: 0; margin-top: var(--section-gap); padding: var(--card-padding); border: 1px solid color-mix(in srgb, var(--line) 96%, transparent); border-radius: 20px; background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 98%, white 2%), color-mix(in srgb, var(--surface) 94%, #02080c 6%)); box-shadow: var(--shadow-medium), inset 0 -1px 0 rgba(0,0,0,.12); }
.surface > h2 + p,
.surface > h3 + p,
.surface-head h2 + p,
.surface-head h3 + p { margin-top: var(--space-2); }
.surface > p + .button,
.surface > .muted + .button,
.surface > .field-note + .button,
.surface > .inline-status + .button,
.surface > .stats + .button,
.surface > .list + .button,
.surface > .summary-box + .button,
.empty-state > p + .button { margin-top: var(--content-gap); }
.surface > .button + .button-row,
.surface > .button + .grid-2,
.surface > .button + .action-stack { margin-top: var(--related-gap); }
.surface > .button + .field-note { margin-top: var(--space-2); }
.surface > h2 + .setting-group { margin-top: var(--related-gap); }
.surface > h2 + .stack { margin-top: var(--content-gap); }
.elevated-surface { background: linear-gradient(145deg, #1c1c28, color-mix(in srgb, var(--surface-2) 90%, #090a10)); box-shadow: var(--shadow-high); }
.ai-nav-card { border-color: color-mix(in srgb, var(--accent) 48%, var(--line)); background: radial-gradient(circle at 88% 12%, rgba(30,193,203,.15), transparent 45%), linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 65%, var(--surface)), var(--surface)); }
.ai-nav-card .nav-icon { box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 18%, transparent); }
.ai-coming-soon { min-height: 300px; text-align: center; display: grid; align-content: center; justify-items: center; gap: 10px; }
.ai-coming-soon p { max-width: 36ch; }
.ai-coming-soon .button { width: min(100%, 280px); margin-top: 10px; }
.ai-coming-soon-mark { display: grid; width: 64px; height: 64px; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--line)); border-radius: 22px; color: var(--accent); background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent-soft) 45%, transparent)); box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 14%, transparent), var(--shadow-low); font-size: 28px; }
.ai-rewrite-balance, .ai-rewrite-subscription { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.ai-rewrite-balance-hero { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.ai-rewrite-balance-hero span { color: var(--muted); font-size: 15px; line-height: 1.35; }
.ai-rewrite-balance-hero strong { font-size: clamp(36px, 12vw, 56px); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.ai-rewrite-balance-summary { margin: 14px 0 2px; color: var(--text); }
.ai-rewrite-balance-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: var(--content-gap); }
.ai-rewrite-balance-actions .button { min-width: 0; }
.ai-rewrite-balance-details { margin-top: var(--related-gap); padding-top: var(--related-gap); border-top: 1px solid var(--line); }
.ai-rewrite-balance-details p { margin: 0 0 4px; color: var(--muted); }
.ai-rewrite-renewal { display: grid; gap: 8px; justify-items: start; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ai-rewrite-renewal p { margin: 0; }
.ai-rewrite-offer h2 { font-size: clamp(26px, 8vw, 34px); line-height: 1.1; }
.ai-rewrite-offer h2 small { font-size: 15px; font-weight: 500; color: var(--muted); }
.ai-rewrite-offer p { margin: 8px 0 var(--content-gap); }
.ai-rewrite-offer + .ai-rewrite-offer { margin-top: var(--content-gap); padding-top: var(--content-gap); border-top: 1px solid var(--line); }
.ai-rewrite-notice { margin-bottom: var(--section-gap); }
.ai-rewrite-notice p { margin: 5px 0 10px; }
.ai-rewrite-notice-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-rewrite-sku-list { display: grid; gap: 8px; margin-top: var(--related-gap); }
.ai-rewrite-sku-list .list-button { border: 1px solid var(--line); border-radius: 14px; }
.ai-rewrite-sku-list .list-button + .list-button { margin-top: 0; }
.ai-rewrite-scope { display: grid; gap: 4px; margin-top: var(--content-gap); padding: var(--related-gap); border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.ai-rewrite-scope span { font-weight: 700; }
.ai-rewrite-scope small, .ai-rewrite-history-detail { color: var(--muted); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.ai-rewrite-route { display: grid; gap: 10px; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ai-rewrite-route .field { margin: 0; }
.ai-rewrite-scope .ai-rewrite-scope-warning { color: var(--warning); }
.ai-rewrite-transactions > .list-button { width: 100%; }
.ai-rewrite-transaction { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ai-rewrite-transaction span { display: grid; gap: 4px; min-width: 0; }
.ai-rewrite-transaction small { color: var(--muted); }
.ai-rewrite-transaction > strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ai-rewrite-history-row { border-bottom: 1px solid var(--line); }
.ai-rewrite-history-row:last-child { border-bottom: 0; }
.ai-rewrite-history-row .list-button { border-bottom: 0; }
.ai-rewrite-history-row .disclosure-indicator { flex: 0 0 36px; width: 36px; height: 36px; }
.ai-rewrite-history-row .list-button[aria-expanded="true"] .disclosure-indicator::before { transform: translateY(2px) rotate(225deg); }
.ai-rewrite-history-detail { padding: 0 13px 13px; }
.ai-rewrite-history-detail dl { display: grid; gap: 5px; margin: 0; }
.ai-rewrite-history-detail dt { color: var(--text); font-weight: 700; }
.ai-rewrite-history-detail dd { margin: 0 0 9px; white-space: pre-wrap; }
.surface.compact { padding: 12px; }
.surface.accent-surface { color: #fff; border-color: rgba(255,255,255,.2); background: linear-gradient(145deg, rgba(40,140,164,.9), rgba(17,37,50,.94) 78%); box-shadow: 0 20px 42px color-mix(in srgb, #112532 48%, transparent), inset 0 1px 0 rgba(255,255,255,.13); }
.surface.accent-surface .muted, .surface.accent-surface p { color: rgba(255,255,255,.78); }
.surface.accent-surface .button.secondary { color: #202542; background: rgba(255,255,255,.94); }
.subscription-strip { display: grid; width: 100%; min-height: 44px; margin-top: 9px; padding: 8px 10px; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 13px; color: inherit; background: rgba(255,255,255,.09); text-align: left; }
.subscription-strip span { overflow: hidden; color: rgba(255,255,255,.8); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.subscription-strip i { font-size: 20px; font-style: normal; }
.subscription-overview { border-color: color-mix(in srgb, var(--accent) 58%, var(--line)); background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 31%, var(--surface)), color-mix(in srgb, var(--surface) 88%, #02080c 12%)); box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 13%, transparent), inset 0 1px 0 rgba(255,255,255,.1); }
.home-status-card { display: grid; min-height: 126px; padding: 0; grid-template-columns: minmax(0,2fr) minmax(132px,1fr); overflow: hidden; }
.home-plan { display: flex; min-width: 0; padding: 18px; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-radius: 0; background: transparent; text-align: left; }
.home-plan > span { min-width: 0; }
.home-plan strong, .home-plan small { display: block; }
.home-plan strong { margin-top: 4px; font-size: 22px; line-height: 1.1; }
.home-plan small { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.home-plan-meta { display: grid; gap: 3px; }
.home-plan-meta small { margin-top: 5px; }
.home-plan i { font-size: 26px; font-style: normal; }
.delivery-metrics { display: grid; min-width: 0; padding: 10px; align-content: center; gap: 10px; border-left: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 44%, transparent); }
.metric-periods { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; padding: 3px; border-radius: 11px; background: color-mix(in srgb, var(--surface) 62%, transparent); }
.metric-periods button { min-width: 0; min-height: 32px; padding: 4px 3px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 10.5px; }
.metric-periods button[aria-pressed="true"] { color: #fff; background: var(--accent); font-weight: 750; }
.metric-values { display: grid; grid-template-columns: 1fr; gap: 5px; }
.metric-values span { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; text-align: left; }
.metric-values strong, .metric-values small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-values strong { font-size: 13px; }
.metric-values small { color: var(--muted); font-size: 9.5px; }
.home-workspace, .home-side { display: grid; gap: var(--content-gap); }
.home-side .account-bridge { margin-top: 0; }
.pause-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.pause-panel .button { flex: 0 0 auto; min-width: 156px; }
.account-bridge { display: grid; margin-top: var(--content-gap); padding: var(--related-gap); grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: var(--related-gap); border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line)); border-radius: 16px; background: color-mix(in srgb, var(--accent-soft) 56%, var(--surface)); box-shadow: 0 8px 22px rgba(5,16,23,.07), inset 0 1px 0 rgba(255,255,255,.08); }
.account-bridge strong, .account-bridge small { display: block; }
.account-bridge small { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.bridge-symbol { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, var(--surface)); font-size: 18px; font-weight: 800; }
.account-bridge.linked { border-color: color-mix(in srgb, var(--success) 38%, var(--line)); background: color-mix(in srgb, var(--success-soft) 58%, var(--surface)); }
.account-bridge.linked .bridge-symbol { color: var(--success); background: var(--success-soft); }
.account-bridge.waiting { border-color: color-mix(in srgb, var(--warning) 38%, var(--line)); background: color-mix(in srgb, var(--warning-soft) 52%, var(--surface)); }
.account-bridge.waiting .bridge-symbol { color: var(--warning); background: var(--warning-soft); }
.account-link-banner { display: grid; margin-bottom: var(--content-gap); padding: 10px 12px; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface)); }
.account-link-banner strong, .account-link-banner small { display: block; }
.account-link-banner small { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.3; }
.account-link-banner.waiting { border-color: color-mix(in srgb, var(--warning) 38%, var(--line)); background: color-mix(in srgb, var(--warning-soft) 38%, var(--surface)); }
.account-link-actions { display: flex; align-items: center; gap: 7px; }
.account-link-actions .button { min-height: 36px; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.banner-close { display: grid; width: 28px; height: 28px; place-items: center; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 19px; line-height: 1; }
.banner-close:hover, .banner-close:focus-visible { color: var(--text); background: color-mix(in srgb, var(--surface) 72%, transparent); }
.attention-row { display: grid; margin-top: var(--content-gap); padding: var(--related-gap) var(--content-gap); grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: var(--related-gap); border: 1px solid color-mix(in srgb, var(--warning) 42%, var(--line)); border-radius: 16px; background: color-mix(in srgb, var(--warning-soft) 78%, transparent); box-shadow: 0 9px 24px rgba(5,16,23,.08); }
.attention-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 5px color-mix(in srgb, var(--warning) 16%, transparent); }
.subscription-card .button, .subscription-overview .subscription-strip { margin-top: 16px; }
.plan-list > h2 { margin-bottom: 12px; }
.surface-head, .inline, .list-row, .summary-row { display: flex; align-items: center; justify-content: space-between; gap: var(--related-gap); }
.surface-head { align-items: flex-start; margin-bottom: var(--content-gap); }
.surface-head p { color: var(--muted); }
.stack, .action-stack { display: grid; gap: var(--content-gap); }
.action-stack { margin-top: var(--subsection-gap); gap: var(--related-gap); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--related-gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--related-gap); }
.muted { color: var(--muted); }
.fine { font-size: 12.5px; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--related-gap); margin-top: var(--content-gap); }
.stat { min-width: 0; padding: 10px; border: 1px solid color-mix(in srgb, var(--line) 76%, transparent); border-radius: 13px; background: linear-gradient(145deg, color-mix(in srgb, currentColor 10%, var(--surface)), color-mix(in srgb, var(--surface-2) 75%, var(--surface))); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 4px 12px rgba(0,0,0,.11); }
.stat span, .stat strong { display: block; }
.stat span { color: var(--muted); font-size: 11.5px; }
.accent-surface .stat span { color: rgba(255,255,255,.7); }
.stat strong { margin-top: 3px; font-size: 18px; }

.button, .icon-button, .chip, .nav-card, .platform-toggle, .list-button, .tool-button, .settings-tab {
  border: 1px solid color-mix(in srgb, var(--line) 94%, transparent);
  border-radius: 13px;
  background: var(--surface);
}
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 14px; font-weight: 700; text-align: center; }
.button.primary { color: white; border-color: color-mix(in srgb, var(--accent) 68%, #fff); background: linear-gradient(145deg, #7664ff, var(--accent-strong)); box-shadow: 0 11px 22px color-mix(in srgb, var(--accent) 32%, transparent), inset 0 1px 0 rgba(255,255,255,.25); }
.button.secondary, .icon-button, .tool-button { border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: linear-gradient(145deg, #2a2e49, #1b1e31); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 5px 14px rgba(0,0,0,.2); }
.button.ghost { color: #bfc5ff; border-color: color-mix(in srgb, var(--accent) 24%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 28%, var(--line)); background: var(--danger-soft); }
.button.full { width: 100%; }
.button-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--related-gap); margin-top: var(--content-gap); }
.icon-button { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; padding: 0; font-size: 20px; }

.nav-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--related-gap); }
.nav-card { display: flex; min-height: 112px; min-width: 0; padding: var(--related-gap); flex-direction: column; align-items: flex-start; justify-content: space-between; text-align: left; }
.nav-card > span:last-child { width: 100%; min-width: 0; }
.nav-card strong, .nav-card small { display: block; overflow-wrap: anywhere; }
.nav-card strong { font-size: 15px; }
.nav-card small { margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.nav-card .nav-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px; background: color-mix(in srgb, var(--accent-soft) 84%, var(--surface)); box-shadow: inset 0 1px 0 rgba(255,255,255,.16); }
.nav-card .nav-icon img { display: block; width: 30px; height: 30px; object-fit: contain; }
.nav-card .nav-icon.nav-icon-contrast { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 34%, var(--surface)), color-mix(in srgb, var(--accent-strong) 22%, var(--surface-2))); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 7px 16px color-mix(in srgb, var(--accent) 22%, transparent); }
.nav-card .nav-icon.nav-icon-contrast img { width: 34px; height: 34px; filter: contrast(1.24) saturate(1.15); }
.analytics-nav-card { cursor: pointer; border-style: solid; border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); background: linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 34%, var(--surface)), var(--surface)); }
.analytics-nav-card small { color: var(--accent); font-weight: 700; }
.icon-attribution { margin: var(--related-gap) 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.icon-attribution a { color: inherit; }
.plan-features { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; line-height: 1.35; }
.plan-features li { position: relative; padding-left: 17px; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.business-plan { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); background: linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 26%, var(--surface)), var(--surface)); }
.team-summary { display: grid; gap: 3px; margin: var(--content-gap) 0; padding: var(--related-gap); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); border-radius: 13px; background: color-mix(in srgb, var(--accent-soft) 28%, var(--surface)); }
.team-summary small { color: var(--muted); }

.badge, .platform-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.success { color: var(--success); background: var(--success-soft); }
.badge.warning { color: var(--warning); background: var(--warning-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.badge.neutral { color: var(--muted); background: var(--surface-2); }
.platform-badge { position: relative; min-width: 30px; width: 30px; height: 30px; min-height: 30px; padding: 0; overflow: hidden; color: #fff; background: transparent; box-shadow: 0 3px 9px rgba(0,0,0,.18); }
.platform-badge img { display: block; width: 100%; height: 100%; object-fit: cover; }

.list { overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 94%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 5px 14px rgba(0,0,0,.1); }
.list-row { min-height: 62px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.member-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(132px,auto) auto; align-items: center; gap: 10px; }
.member-row select { min-height: 44px; border: 1px solid var(--line); border-radius: 16px; padding-left: 11px; }
.list-button { width: 100%; min-height: 64px; padding: 10px 12px; border-radius: 0; border-width: 0 0 1px; text-align: left; }
.list-button:last-child { border-bottom: 0; }
.list-copy { min-width: 0; flex: 1; }
.list-copy strong, .list-copy small { display: block; }
.list-copy small { margin-top: 2px; color: var(--muted); font-size: 12.5px; white-space: normal; }
.route-line { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.configuration-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); }
.configuration-card + .configuration-card { margin-top: var(--related-gap); }
.configuration-summary { display: flex; width: 100%; min-height: 76px; padding: var(--related-gap); align-items: center; gap: var(--related-gap); border: 0; border-radius: 0; background: transparent; text-align: left; }
.configuration-actions { display: grid; padding: 7px; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 74%, var(--surface)); }
.configuration-actions.single { grid-template-columns: 1fr; }
.card-action { min-height: 44px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); font-weight: 700; }
.card-action.state { color: var(--success); }
.card-action.delete { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: var(--danger-soft); }
.addon-offer, .migration-help { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: var(--content-gap); }
.addon-offer p, .migration-help p { color: var(--muted); }
.addon-offer .button { min-width: 180px; }
.notification-row:not(.is-read) { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.notification-symbol { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 10px; color: var(--muted); background: var(--surface-2); font-weight: 850; }
.notification-symbol.success { color: var(--success); background: var(--success-soft); }
.notification-symbol.warning { color: var(--warning); background: var(--warning-soft); }

.platform-step { overflow: hidden; padding: 0; }
.platform-toggle { display: grid; width: 100%; min-height: 66px; padding: 10px 12px; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; border: 0; border-radius: 0; text-align: left; }
.platform-step.is-selected .platform-toggle { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.step-number { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 12px; color: var(--accent); background: var(--accent-soft); font-weight: 800; }
.platform-toggle small, .platform-toggle strong { display: block; }
.platform-toggle small { color: var(--muted); font-size: 12px; }
.platform-readiness { display: inline-flex; justify-content: flex-end; }
.platform-body { display: grid; gap: var(--content-gap); padding: var(--content-gap) var(--content-gap) var(--subsection-gap) 60px; }
.platform-body > .field, .platform-body > .button-row, .platform-body > .inline-status, .platform-body > .connection-note { margin-top: 0; }
.platform-body { animation: section-reveal var(--motion-base) var(--ease-out) both; }
.platform-status-row { display: grid; min-height: 44px; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.connection-note { margin: 9px 0 0; padding: 8px 10px; border-left: 2px solid color-mix(in srgb, var(--success) 70%, var(--line)); color: var(--muted); font-size: 12.5px; }
.field { display: grid; gap: 8px; margin-top: 12px; }
fieldset.field { min-width: 0; padding: 0; border: 0; }
.field > span, .field-label { font-size: 12.5px; font-weight: 700; }
.field input, .field select, .field textarea, .editor { width: 100%; max-width: 100%; min-width: 0; min-height: 46px; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--line) 94%, transparent); border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.1); }
.field select, .list-row select { appearance: none; padding-right: 44px; color: var(--text); background-color: var(--surface); background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-repeat: no-repeat; background-size: 5px 5px, 5px 5px; }
.field select:focus, .list-row select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), inset 0 1px 0 rgba(255,255,255,.08); }
.field textarea { min-height: 88px; resize: vertical; }
.field-note { color: var(--muted); font-size: 12px; }
.scoped-setting { display: grid; gap: var(--content-gap); padding-top: var(--content-gap); border-top: 1px solid var(--line); }
.scoped-setting:first-child { padding-top: 0; border-top: 0; }
.scoped-setting .field { margin-top: 0; }
.rule-scope-field { padding: var(--related-gap); border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--surface-2) 52%, var(--surface)); }
.rule-scope-field small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 8px; color: var(--text); font-size: 14px; }
.check-row input { inline-size: 20px; block-size: 20px; accent-color: var(--accent); }
.inline-status { margin-top: var(--related-gap); padding: var(--related-gap); border-radius: 11px; font-size: 12.5px; }
.inline-status.success { color: var(--success); background: var(--success-soft); }
.inline-status.warning { color: var(--warning); background: var(--warning-soft); }
.inline-status.danger { color: var(--danger); background: var(--danger-soft); }
.inline-status.loading { color: var(--accent); background: var(--accent-soft); }
.inline-status.neutral { display: grid; gap: 2px; color: var(--text); background: var(--surface-2); }
.inline-status.neutral span { color: var(--muted); }
.free-limit-note { margin-top: var(--content-gap); }
.quote-explanation { margin-top: var(--content-gap); padding: var(--content-gap); border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.quote-explanation p, .quote-explanation small { color: var(--muted); }

.progress { overflow: hidden; height: 7px; margin-top: 9px; border-radius: 999px; background: var(--surface-2); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .18s ease; }
.summary-box { margin-top: var(--related-gap); padding: var(--related-gap); border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 13px; background: var(--accent-soft); }
.summary-box strong { display: block; }
.sticky-action { position: static; margin: var(--space-6) 0 0; padding: var(--related-gap); border: 1px solid color-mix(in srgb, var(--line) 75%, transparent); border-radius: 18px; background: color-mix(in srgb, var(--surface-2) 78%, var(--surface)); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 20px rgba(0,0,0,.14); }
.sync-action { display: grid; gap: 9px; box-shadow: 0 12px 28px rgba(5,16,23,.18); }
.comments-summary .stats + .button { margin-top: 14px; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.segmented button, .settings-tab { min-height: 44px; padding: 8px; border: 0; background: transparent; }
.segmented button[aria-pressed="true"], .settings-tab[aria-selected="true"] { color: var(--accent); border-radius: 9px; background: var(--surface); box-shadow: 0 2px 10px rgba(25,31,56,.08); }
.workspace-selector { display: grid; width: min(100%, 224px); margin: 0 auto calc(var(--content-gap) * .7); }
.workspace-segmented { gap: 3px; padding: 2px; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: color-mix(in srgb, var(--surface-2) 86%, transparent); box-shadow: var(--shadow-low); }
.workspace-segmented button { min-height: 31px; padding: 5px 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .055em; }
.workspace-segmented button[aria-pressed="true"] { color: #fff; background: linear-gradient(145deg, var(--accent), var(--accent-strong)); box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 32%, transparent); }
.workspace-segmented button:disabled { cursor: default; opacity: 1; }
.workspace-picker-list { display: grid; gap: 8px; margin-top: var(--related-gap); }
.workspace-picker-option { display: flex; width: 100%; min-height: 48px; padding: 12px 14px; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: var(--surface-2); font: inherit; text-align: left; }
.workspace-picker-option[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 62%, var(--line)); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.workspace-picker-option i { color: var(--accent); font-style: normal; font-weight: 800; }
.calendar-strip { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; margin-top: 10px; }
.day-button { min-width: 0; min-height: 52px; padding: 6px 2px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.day-button span, .day-button small { display: block; }
.day-button small { color: var(--muted); font-size: 10px; }
.day-button[aria-pressed="true"] { color: #fff; border-color: var(--accent); background: var(--accent); }

.toolbar { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.tool-button { min-width: 44px; min-height: 44px; padding: 7px 9px; }
.editor { min-height: 118px; outline: none; white-space: pre-wrap; }
.editor:empty::before { color: var(--muted); content: attr(data-placeholder); }
.preview { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.preview-content { margin-top: 9px; white-space: pre-wrap; overflow-wrap: anywhere; }

.switch-row { display: grid; min-height: 62px; padding: 9px 0; grid-template-columns: 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-copy strong, .switch-copy small { display: block; }
.switch-copy small { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.switch { position: relative; width: 54px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 999px; background: transparent; }
.switch::before { position: absolute; top: 7px; right: 2px; bottom: 7px; left: 2px; border-radius: 999px; background: #8398a2; box-shadow: inset 0 1px 2px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.12); content: ""; transition: background-color var(--motion-base) var(--ease-out), box-shadow var(--motion-fast) var(--ease-out); }
.switch::after { position: absolute; top: 10px; left: 5px; width: 24px; height: 24px; border-radius: 50%; background: white; box-shadow: 0 3px 8px rgba(0,0,0,.28); content: ""; transition: transform var(--motion-base) var(--ease-out), box-shadow var(--motion-fast) var(--ease-out); }
.switch[aria-checked="true"]::before { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch:not(:disabled):active::after { box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.settings-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 7px; scrollbar-width: none; }
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tab { flex: 0 0 auto; padding-inline: 14px; border: 1px solid var(--line); }
.platform-scope { margin-top: var(--related-gap); padding: var(--related-gap); border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.platform-scope .field { margin-top: 0; }
.platform-scope .field-note { margin-top: 8px; }
.scope-value-note { margin: 0; }
.theme-choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.theme-choice { display: grid; min-width: 0; min-height: 110px; padding: 12px; align-content: start; gap: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); text-align: left; }
.theme-choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent) inset; }
.theme-choice strong, .theme-choice small { display: block; }
.theme-choice small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.theme-swatches { display: flex; gap: 4px; }
.theme-swatches i { width: 22px; height: 22px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; background: #090a10; }
.theme-swatches i:nth-child(2) { background: #5e67ff; }
.theme-swatches i:nth-child(3) { background: #9b53ff; }
.theme-swatches.light i:nth-child(1) { background: #fff; border-color: rgba(28,35,59,.2); }
.theme-swatches.light i:nth-child(2) { background: #4f46e5; }
.theme-swatches.light i:nth-child(3) { background: #e9e8ff; }
.theme-swatches.dusk i:nth-child(1) { background: #303742; border-color: rgba(225,232,240,.22); }
.theme-swatches.dusk i:nth-child(2) { background: #9bb0c4; }
.theme-swatches.dusk i:nth-child(3) { background: #465563; }
.dirty-note { color: var(--warning); font-size: 12.5px; }
.setting-group { border-bottom: 1px solid var(--line); }
.setting-group:last-of-type { border-bottom: 0; }
.setting-group summary, .setting-summary { display: grid; width: 100%; min-height: 76px; padding: var(--content-gap) 0; grid-template-columns: 1fr auto; align-items: center; gap: var(--content-gap); border: 0; border-radius: 0; background: transparent; cursor: pointer; list-style: none; text-align: left; }
.setting-group summary::-webkit-details-marker { display: none; }
.setting-group summary strong, .setting-group summary small, .setting-summary strong, .setting-summary small { display: block; }
.setting-group summary small, .setting-summary small { margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.setting-summary:active { transform: none; }
.disclosure-indicator { display: grid; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; place-items: center; border: 1px solid color-mix(in srgb, var(--line) 86%, transparent); border-radius: 50%; color: var(--accent); background: linear-gradient(145deg, color-mix(in srgb, var(--surface-2) 92%, white 8%), var(--surface)); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 5px 12px rgba(0,0,0,.13); font-size: 0; line-height: 0; }
.disclosure-indicator::before { display: block; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; content: ""; transform: translateY(-2px) rotate(45deg); transform-origin: 50% 50%; transition: transform var(--motion-base) var(--ease-out); }
.setting-group[data-open="true"] .disclosure-indicator, .setting-group[open] .disclosure-indicator { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 58%, var(--line)); background: linear-gradient(145deg, color-mix(in srgb, var(--surface-2) 92%, white 8%), var(--surface)); }
.setting-group[data-open="true"] .disclosure-indicator::before, .setting-group[open] .disclosure-indicator::before { transform: translateY(2px) rotate(225deg); }
.setting-group-content { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--motion-base) var(--ease-out); }
.setting-group[data-open="true"] .setting-group-content { grid-template-rows: 1fr; }
.setting-group-clip { min-height: 0; overflow: hidden; }
.setting-group-body { display: grid; min-width: 0; gap: var(--content-gap); padding: var(--space-2) 0 var(--space-6); }
.setting-group-body > * { min-width: 0; margin-block: 0; }
.setting-group-body > .field, .setting-group-body > .button-row, .setting-group-body > .inline-status { margin-top: 0; }
.setting-group-body > .button-row { margin-bottom: 0; }
.my-routes-list { overflow: visible; }
.my-route-card { padding-inline: var(--content-gap); }
.my-route-card + .my-route-card { border-top: 1px solid var(--line); }
.my-route-details summary { min-height: 82px; }
.my-route-summary-end { display: inline-flex; align-items: center; gap: 8px; }
.my-route-controls { display: grid; gap: 8px; padding: 0 0 var(--space-5); }
.my-route-expanded { display: grid; gap: var(--content-gap); padding: 0 0 var(--space-6); }
.my-route-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.my-route-actions .button { min-width: 0; min-height: 40px; padding-inline: 10px; }
.my-route-actions .button:disabled { opacity: .68; cursor: not-allowed; }
.my-route-resources { display: grid; overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 86%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--surface-2) 52%, var(--surface)); }
.my-route-resource { display: grid; min-width: 0; min-height: 64px; padding: 10px 11px; grid-template-columns: minmax(0,1fr); align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.my-route-resource > .route-line, .my-route-resource .list-copy { min-width: 0; }
.my-route-resource:last-child { border-bottom: 0; }
.my-route-resource-type { margin-top: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.my-route-link, .my-route-link-unavailable { display: block; min-width: 0; margin-top: 4px; overflow: hidden; color: var(--accent); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.my-route-link-unavailable { color: var(--muted); font-weight: 500; }
.my-route-capability-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.team-list { box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }

.empty-state { padding: var(--space-6) var(--content-gap); text-align: center; }
.empty-state strong { display: block; font-size: 17px; }
.empty-state p { color: var(--muted); }
.skeleton { position: relative; overflow: hidden; height: 58px; border-radius: 13px; background: var(--surface-2); }
.skeleton::after { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, white 50%, transparent), transparent); content: ""; animation: shimmer 1.1s infinite; transform: translateX(-100%); }
@keyframes shimmer { to { transform: translateX(100%); } }

.bottom-nav { position: absolute; z-index: 30; right: calc(12px + var(--safe-right)); bottom: calc(8px + var(--safe-bottom)); left: calc(12px + var(--safe-left)); isolation: isolate; display: grid; min-height: var(--bottom-nav-height); grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; padding: 5px; border-radius: 20px; opacity: 1; visibility: visible; transform: translateZ(0); }
.bottom-nav button { display: flex; min-width: 0; min-height: 54px; padding: 5px 2px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-size: 11px; }
.bottom-nav button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.bottom-nav button[aria-current="page"] { color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 34%, var(--surface-2)), var(--accent-soft)); box-shadow: var(--shadow-low), inset 0 1px 0 rgba(255,255,255,.12); font-weight: 750; }
.settings-save-bar { position: absolute; z-index: 45; right: calc(12px + var(--safe-right)); bottom: calc(var(--bottom-nav-height) + 18px + var(--safe-bottom)); left: calc(12px + var(--safe-left)); display: grid; min-height: 58px; padding: 7px; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 8px; border-radius: 18px; }
.settings-save-bar span { min-width: 0; color: var(--muted); font-size: 12.5px; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--bottom-nav-height) + 24px + var(--safe-bottom)); width: min(calc(100vw - 28px), 440px); padding: 11px 14px; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); transform: translateX(-50%); }
.modal-backdrop { position: fixed; z-index: 70; inset: 0; display: grid; padding: 20px; place-items: end center; background: rgba(10,12,19,.46); }
.modal { width: min(100%, 520px); padding: var(--subsection-gap); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.modal p { color: var(--muted); }
.vk-provider-backdrop { place-items: center; }
.vk-provider { position: relative; width: min(100%, 520px); max-width: 100%; max-height: calc(var(--app-height, 100dvh) - 32px - var(--safe-top) - var(--safe-bottom)); overflow-x: hidden; overflow-y: auto; }
.vk-provider-stage { display: block; overflow: hidden; width: 100%; min-height: 180px; max-height: min(46vh, 420px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: #fff; touch-action: manipulation; }
.vk-provider-stage img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0 auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.vk-provider-placeholder { padding: 32px 20px; color: #30354a; text-align: center; }
.vk-provider-progress { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface)); }
.vk-provider-progress strong { font-size: 14px; line-height: 1.28; }
.vk-provider-progress p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.vk-provider-progress.is-success { border-color: color-mix(in srgb, var(--success) 42%, var(--line)); background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.vk-provider-progress.is-warning { border-color: color-mix(in srgb, var(--warning) 42%, var(--line)); }
.vk-provider-progress.is-error { border-color: color-mix(in srgb, var(--danger) 42%, var(--line)); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.vk-connect-close-confirmation { position: absolute; z-index: 3; inset: 0; display: grid; padding: 16px; place-items: center; background: color-mix(in srgb, #0a0c13 58%, transparent); }
.vk-connect-close-confirmation-card { width: min(100%, 400px); padding: var(--subsection-gap); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 24px 70px rgba(0,0,0,.32); }
.vk-connect-close-confirmation-card h3 { margin: 0; font-size: 20px; line-height: 1.18; }
.vk-connect-close-confirmation-card p { margin: 10px 0 var(--related-gap); color: var(--muted); white-space: pre-line; }
.vk-provider-bar { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 8px; }
.vk-provider-bar h2 { margin: 0; font-size: 20px; line-height: 1.1; }
.vk-provider-composer { display: grid; padding: 6px; grid-template-columns: minmax(0, 1fr) 44px 44px; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); box-shadow: var(--shadow-low); }
.vk-provider-composer input { min-width: 0; min-height: 44px; padding: 0 12px; border: 0; outline: 0; color: var(--text); background: transparent; font: inherit; font-size: 16px; }
.vk-provider-composer input::placeholder { color: var(--muted); }
.vk-provider-key,
.vk-provider-submit { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; color: #fff; background: var(--accent); font-size: 24px; line-height: 1; }
.vk-provider-key { color: var(--text); background: color-mix(in srgb, var(--surface-2) 82%, var(--text) 18%); font-size: 20px; }
.vk-provider-key:disabled,
.vk-provider-submit:disabled { opacity: .42; }

body.vk-remote-browser-active { overflow: hidden; }
body.vk-remote-browser-active .app-shell { overflow: visible; }
body.vk-remote-browser-active .vk-provider-backdrop {
  padding: 0;
  place-items: stretch;
  background: var(--surface);
  top: var(--vk-viewport-top, 0px);
  bottom: auto;
  height: var(--app-height, 100dvh);
}
body.vk-remote-browser-active .vk-provider {
  display: grid;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: max(8px, var(--safe-top)) max(8px, var(--safe-right)) max(8px, var(--safe-bottom)) max(8px, var(--safe-left));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
}
body.vk-remote-browser-active .vk-provider .icon-button { width: 44px; height: 44px; }
body.vk-remote-browser-active .vk-provider-stage {
  height: 100%;
  min-height: 0;
  max-height: none;
  border-radius: 12px;
}
body.vk-remote-browser-active .vk-provider-stage img { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
.vk-captcha-image { display: block; width: min(100%, 360px); max-height: 180px; margin: 10px auto; border: 1px solid var(--line); border-radius: 12px; object-fit: contain; background: #fff; }
.plan-option { display: grid; gap: var(--related-gap); padding: var(--content-gap); border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.plan-option .list-row { padding: 0; border: 0; background: transparent; }
.plan-option > .field { margin-top: 0; }
.state-controls { display: grid; gap: 8px; }
.host-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.host-selector button[aria-pressed="true"] { color: white; border-color: var(--accent); background: var(--accent); }

@media (max-width: 480px) {
  :root { --section-gap: 14px; --card-padding: 14px; --content-gap: 14px; --subsection-gap: 17px; --page-bottom-gap: 20px; }
  #app-main { padding-right: max(10px, var(--safe-right)); padding-left: max(10px, var(--safe-left)); }
  .surface { border-radius: 17px; }
  .screen-head h1 { font-size: clamp(26px, 8.4vw, 34px); line-height: 1.04; }
  .screen-head > div > p:last-child { font-size: 14px; line-height: 1.42; }
  .grid-3, .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stats .stat:last-child { grid-column: span 2; }
  .pause-panel { align-items: stretch; flex-direction: column; }
  .pause-panel .button { width: 100%; }
  .account-bridge { grid-template-columns: auto minmax(0,1fr); }
  .account-bridge .button { grid-column: 1 / -1; width: 100%; }
  .account-link-banner { grid-template-columns: 1fr; }
  .account-link-actions { justify-content: space-between; }
  .attention-row { grid-template-columns: auto minmax(0,1fr); }
  .attention-row .button { grid-column: 1 / -1; width: 100%; }
  .plan-list .list-row { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .plan-list .list-row .button { width: 100%; }
  .platform-body { padding-left: 12px; }
  .modal-backdrop { padding: max(8px, var(--safe-top)) max(8px, var(--safe-right)) max(8px, var(--safe-bottom)) max(8px, var(--safe-left)); }
  .vk-provider { max-height: calc(var(--app-height, 100dvh) - 16px - var(--safe-top) - var(--safe-bottom)); padding: 12px; border-radius: 17px; }
  .vk-provider .surface-head { margin-bottom: 10px; }
  .vk-provider .button-row { grid-template-columns: 1fr; }
  .vk-provider-stage { min-height: 160px; max-height: 40vh; }
  body.vk-remote-browser-active .vk-provider { max-height: none; padding: max(8px, var(--safe-top)) max(8px, var(--safe-right)) max(8px, var(--safe-bottom)) max(8px, var(--safe-left)); border-radius: 0; }
  body.vk-remote-browser-active .vk-provider-stage { min-height: 0; max-height: none; }
  body.vk-remote-browser-active .vk-provider-bar { flex-wrap: nowrap; }
  .theme-choice-grid { grid-template-columns: 1fr; }
  .theme-choice { min-height: 82px; grid-template-columns: auto minmax(0,1fr); align-items: center; }
  .home-status-card { grid-template-columns: minmax(0,1.25fr) minmax(150px,1fr); }
  .home-plan { padding: 14px; }
  .home-plan strong { font-size: 18px; }
  .home-plan small { font-size: 11px; }
  .delivery-metrics { padding: 8px; gap: 8px; }
  .metric-periods button { min-height: 34px; font-size: 9.5px; }
  .metric-values { gap: 3px; }
  .metric-values strong { font-size: 12px; }
  .metric-values small { font-size: 8.5px; }
  .nav-card { min-height: 104px; padding: 11px; }
  .nav-card strong { font-size: 14px; }
  .nav-card small { font-size: 11.5px; }
  .nav-card .nav-icon { width: 40px; height: 40px; }
  .nav-card .nav-icon img { width: 27px; height: 27px; }
  .configuration-summary { align-items: flex-start; gap: 9px; }
  .configuration-summary .badge { margin-left: auto; }
  .addon-offer, .migration-help { grid-template-columns: 1fr; }
  .addon-offer .button, .migration-help .button-row { width: 100%; }
  .migration-help .button-row { grid-template-columns: 1fr; }
  .member-row { grid-template-columns: minmax(0,1fr) auto; }
  .member-row select { min-width: 0; max-width: 148px; }
  .member-row .button { grid-column: 1 / -1; width: 100%; }
  .screen-head { display: block; }
  .screen-head .icon-button { margin-top: 8px; }
}

@media (max-width: 350px) {
  .home-status-card { grid-template-columns: 1fr; }
  .delivery-metrics { border-top: 1px solid var(--line); border-left: 0; }
  .home-plan small { display: block; }
}

@media (min-width: 680px) {
  :root { --section-gap: var(--space-6); --card-padding: var(--space-5); --page-bottom-gap: var(--space-7); }
  .app-shell { width: min(100%, 1120px); }
  .host-bar { top: calc(18px + var(--safe-top)); right: calc(24px + var(--safe-right)); left: calc(24px + var(--safe-left)); }
  .host-bar { border-radius: 20px; }
  #app-main { width: min(100%, 920px); margin: 0 auto; padding: calc(102px + var(--safe-top)) 0 var(--content-bottom-inset); }
  .platform-step, .comments-summary, .sync-action { width: min(100%, 780px); margin-inline: auto; }
  .nav-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .settings-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); overflow: visible; }
  .settings-tab { width: 100%; }
  .bottom-nav { right: max(24px, calc((100% - 920px) / 2)); left: max(24px, calc((100% - 920px) / 2)); bottom: calc(12px + var(--safe-bottom)); }
  .bottom-nav button { min-height: 54px; font-size: 12px; }
  .refresh-button { top: calc(88px + var(--safe-top)); right: max(calc(24px + var(--safe-right)), calc((100vw - 920px) / 2 + 24px)); }
}

@media (min-width: 960px) {
  .app-shell { width: min(calc(100% - 32px), 1360px); }
  .host-bar { right: max(24px, calc((100% - 1180px) / 2)); left: max(24px, calc((100% - 1180px) / 2)); }
  #app-main { width: min(calc(100% - 48px), 1180px); }
  #app-main[data-current-route="settings"], #app-main[data-current-route="more"] { width: min(calc(100% - 48px), 920px); }
  .home-workspace { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .home-actions .nav-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .home-actions .nav-card { min-height: 124px; }
  .home-side { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; }
  .home-side > * { margin-top: 0; }
  .bottom-nav { right: max(24px, calc((100% - 720px) / 2)); left: max(24px, calc((100% - 720px) / 2)); }
}

@media (min-width: 1280px) {
  .app-shell { width: min(calc(100% - 40px), 1800px); }
  .host-bar { right: max(28px, calc((100% - 1640px) / 2)); left: max(28px, calc((100% - 1640px) / 2)); }
  #app-main { width: min(calc(100% - 64px), 1640px); }
  #app-main[data-current-route="settings"], #app-main[data-current-route="more"] { width: min(calc(100% - 64px), 1120px); }
  .home-actions .nav-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
  .home-side { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover { transform: translateY(-1px); }
  button.setting-summary:not(:disabled):hover { transform: none; }
  .button.primary:not(:disabled):hover { box-shadow: 0 15px 28px color-mix(in srgb, var(--accent) 31%, transparent), inset 0 1px 0 rgba(255,255,255,.26); }
  .button.secondary:not(:disabled):hover, .nav-card:not(:disabled):hover, .list-button:not(:disabled):hover { border-color: color-mix(in srgb, var(--accent) 46%, var(--line)); box-shadow: 0 9px 20px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.1); }
  .setting-group summary:hover .disclosure-indicator, .setting-summary:hover .disclosure-indicator { border-color: var(--accent); }
  .field select:hover, .list-row select:hover { border-color: color-mix(in srgb, var(--accent) 58%, var(--line)); }
}

@keyframes disclosure-open {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes section-reveal {
  from { opacity: .01; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fresh-pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 16%, transparent); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--success) 4%, transparent); }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .glass { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .surface { background: var(--surface); border-color: var(--line); }
}
