/* Omni-Radius panel — themes, layout and components */

:root, [data-theme="dream"] {
  --ground: #EEF1F9; --paper: #FFFFFF; --soft: #EEF1F9; --line: #DFE3F1;
  --ink: #151A3B; --ink2: #454C77; --muted: #656B92;
  --nav-active: #ECE8FF; --nav-active-ink: #4B36A8;
  --accent: #6E56CF; --on-accent: #FFFFFF; --accent-ink: #5B44C2; --focus: #9D8AF0;
  --logo-bg: #151A3B; --logo-ink: #FFE6A8;
  --hero-bg: radial-gradient(120% 140% at 85% 0%, #2A2F6E 0%, #151A3B 55%, #0C1030 100%);
  --hero-ink: #FFFFFF; --hero-muted: #C9CCF5; --hero-border: 0;
  --warn-ink: #9A5B00; --warn-bg: #FFF1D6; --danger-ink: #B42B33; --danger-bg: #FDE5E6;
  --ok-ink: #0B7468; --ok-bg: #DDF6F1; --info-ink: #4B36A8; --info-bg: #ECE8FF;
  --font: 'Alexandria', 'Segoe UI', Tahoma, sans-serif; --font-head: var(--font);
  --r-card: 20px; --r-hero: 26px; --r-btn: 12px; --shadow: 0 24px 60px -36px rgba(21, 26, 59, .45);
  --star: #FFF4D6; --hero-kind: sky;
  color-scheme: light;
}
[data-theme="midnight"] {
  --ground: #0E1230; --paper: #161B40; --soft: #1F2552; --line: #2A3163;
  --ink: #EEF0FF; --ink2: #C3C7EC; --muted: #9AA0D0;
  --nav-active: #2A2463; --nav-active-ink: #D9D0FF;
  --accent: #6E56CF; --on-accent: #FFFFFF; --accent-ink: #C2B5FF; --focus: #A996FF;
  --logo-bg: #2A2463; --logo-ink: #FFE6A8;
  --hero-bg: radial-gradient(120% 140% at 85% 0%, #23285E 0%, #10143A 60%, #080B26 100%);
  --hero-ink: #FFFFFF; --hero-muted: #B9BDEA; --hero-border: 1px solid #2A3163;
  --warn-ink: #FFC86B; --warn-bg: #3A2E14; --danger-ink: #FF8F94; --danger-bg: #45202D;
  --ok-ink: #4FE0C9; --ok-bg: #123B44; --info-ink: #C2B5FF; --info-bg: #2A2463;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
[data-theme="lapis"] {
  --ground: #0F1A3D; --paper: #16245A; --soft: #1D2C66; --line: #2A3A78;
  --ink: #F4EBD3; --ink2: #DCD0AC; --muted: #B3A884;
  --nav-active: #22337A; --nav-active-ink: #E9C46A;
  --accent: #D4A93C; --on-accent: #1A1405; --accent-ink: #E9C46A; --focus: #E9C46A;
  --logo-bg: #D4A93C; --logo-ink: #16245A;
  --hero-bg: linear-gradient(135deg, #1B2D6E 0%, #16245A 60%, #0F1A3D 100%);
  --hero-ink: #F4EBD3; --hero-muted: #D9C894; --hero-border: 1px solid #8A6E2A;
  --warn-ink: #E9C46A; --warn-bg: #3A3214; --danger-ink: #F4A39C; --danger-bg: #4A1F28;
  --ok-ink: #7FDCD2; --ok-bg: #163A4F; --info-ink: #E9C46A; --info-bg: #22337A;
  --font-head: 'Reem Kufi', 'Alexandria', sans-serif;
  --r-card: 6px; --r-hero: 8px; --r-btn: 6px; --shadow: 0 24px 60px -30px rgba(0, 0, 0, .7);
  --star: #E9C46A;
  color-scheme: dark;
}
[data-theme="nile"] {
  --ground: #EAF3F1; --paper: #FFFFFF; --soft: #E4F0ED; --line: #D3E4E0;
  --ink: #0E2E2C; --ink2: #2E5753; --muted: #57716D;
  --nav-active: #D7EFEA; --nav-active-ink: #0B5F58;
  --accent: #0F766E; --on-accent: #FFFFFF; --accent-ink: #0F766E; --focus: #3FB8A9;
  --logo-bg: #0F766E; --logo-ink: #E6FFFA;
  --hero-bg: linear-gradient(180deg, #0B3B3D 0%, #0F5E5A 100%);
  --hero-ink: #EFFFFB; --hero-muted: #A7D8D0; --hero-border: 0;
  --warn-ink: #8A5A00; --warn-bg: #FDF0D5; --danger-ink: #B4232C; --danger-bg: #FCE4E4;
  --ok-ink: #0B6B5F; --ok-bg: #D7F2EC; --info-ink: #0B5F58; --info-bg: #D7EFEA;
  --font: 'Readex Pro', 'Alexandria', sans-serif;
  --r-card: 18px; --r-hero: 28px; --r-btn: 999px; --shadow: 0 24px 60px -36px rgba(14, 46, 44, .45);
  --star: #CFFFF5;
}
[data-theme="day"] {
  --ground: #F5F6F8; --paper: #FFFFFF; --soft: #EEF1F5; --line: #E3E7EE;
  --ink: #1B2330; --ink2: #3E4A5C; --muted: #5E6B7E;
  --nav-active: #E8EFFD; --nav-active-ink: #1846AE;
  --accent: #1F5BD8; --on-accent: #FFFFFF; --accent-ink: #1F5BD8; --focus: #6E9BF5;
  --logo-bg: #1F5BD8; --logo-ink: #FFFFFF;
  --hero-bg: #FFFFFF; --hero-ink: #1B2330; --hero-muted: #5E6B7E; --hero-border: 1px solid #E3E7EE;
  --warn-ink: #8A5A00; --warn-bg: #FDF0D5; --danger-ink: #B4232C; --danger-bg: #FCE4E4;
  --ok-ink: #11733F; --ok-bg: #DDF3E5; --info-ink: #1846AE; --info-bg: #E8EFFD;
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif;
  --r-card: 12px; --r-hero: 12px; --r-btn: 8px; --shadow: 0 10px 30px -24px rgba(27, 35, 48, .35);
}
[data-theme="aurora"] {
  --ground: #0A1622; --paper: #0F2130; --soft: #143042; --line: #1C3646;
  --ink: #E8FBF6; --ink2: #B4D7D0; --muted: #8DB3AD;
  --nav-active: #123B39; --nav-active-ink: #5FE6C0;
  --accent: #2FD3A6; --on-accent: #062018; --accent-ink: #5FE6C0; --focus: #5FE6C0;
  --logo-bg: #2FD3A6; --logo-ink: #062018;
  --hero-bg: linear-gradient(180deg, #0B1B2B 0%, #0A1622 100%);
  --hero-ink: #FFFFFF; --hero-muted: #B4D7D0; --hero-border: 1px solid #1C3646;
  --warn-ink: #FFC266; --warn-bg: #3B2E12; --danger-ink: #FF8A8A; --danger-bg: #3D1A22;
  --ok-ink: #5FE6C0; --ok-bg: #123B39; --info-ink: #B9A2FF; --info-bg: #261F48;
  --font: 'Readex Pro', 'Alexandria', sans-serif;
  --r-card: 22px; --r-hero: 26px; --r-btn: 14px; --shadow: 0 24px 60px -30px rgba(0, 0, 0, .7);
  --star: #E8FBF6;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.3; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.nav { width: 248px; flex: none; background: var(--paper); border-inline-start: 1px solid var(--line); padding: 26px 16px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; text-decoration: none; color: var(--ink); }
.brand .mark { width: 42px; height: 42px; border-radius: 14px; background: var(--logo-bg); color: var(--logo-ink); display: grid; place-items: center; }
.brand .mark svg { width: 25px; height: 25px; }
.brand b { font-family: var(--font-head); font-weight: 800; font-size: 19px; display: block; line-height: 1.15; }
.brand small { font-size: 12px; color: var(--muted); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.nav a.item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-btn); text-decoration: none; color: var(--ink2); }
.nav a.item:hover { background: var(--soft); }
.nav a.item[aria-current="page"] { background: var(--nav-active); color: var(--nav-active-ink); font-weight: 600; }
.nav a.item .count { margin-inline-start: auto; font-size: 12px; color: var(--muted); }
.nav .foot { margin-top: auto; padding: 14px; border-radius: var(--r-card); background: var(--soft); font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.nav .foot .row { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #12A594; flex: none; }
.dot.off { background: #9AA0B8; }
.main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.main { flex: 1 1 auto; min-width: 0; padding: 28px 36px 64px; display: flex; flex-direction: column; gap: 22px; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.topbar .title { flex: 1 1 260px; display: flex; flex-direction: column; }
.topbar .title span { font-size: 14px; color: var(--muted); }
.mobile-bar { display: none; }

/* ---------------------------------------------------------------- controls */
.btn { height: 44px; padding: 0 18px; border-radius: var(--r-btn); border: 1px solid transparent; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent-ink); border-color: var(--accent); }
.btn.quiet { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--danger-ink); border-color: var(--danger-ink); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 44px; padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink2); }
.field small { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { height: 44px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--paper); padding: 0 14px; width: 100%; min-width: 0; }
textarea.input { height: auto; min-height: 80px; padding: 10px 14px; resize: vertical; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.search { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: var(--r-btn); background: var(--paper); border: 1px solid var(--line); flex: 0 1 340px; color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--ink); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.unit { display: flex; gap: 8px; }
.unit .input:first-child { flex: 1 1 auto; }
.unit select.input { flex: 0 0 110px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink2); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .n { font-size: 12px; opacity: .75; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-btn); overflow: hidden; background: var(--paper); }
.seg label { padding: 0 14px; height: 40px; display: flex; align-items: center; cursor: pointer; font-size: 13px; color: var(--ink2); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--nav-active); color: var(--nav-active-ink); font-weight: 600; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: -3px; }

/* ---------------------------------------------------------------- surfaces */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); }
.panel.pad { padding: 20px 22px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; flex-wrap: wrap; }
.panel-head .end { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.pill.ok { color: var(--ok-ink); background: var(--ok-bg); }
.pill.warn { color: var(--warn-ink); background: var(--warn-bg); }
.pill.danger { color: var(--danger-ink); background: var(--danger-bg); }
.pill.info { color: var(--info-ink); background: var(--info-bg); }
.pill.mute { color: var(--ink2); background: var(--soft); }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 13px; display: grid; place-items: center; font-weight: 700; background: var(--soft); color: var(--ink2); }
.list .li { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line); }
.list .li .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.list .li .grow b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .li .grow small { font-size: 12px; color: var(--muted); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: start; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--soft); }
.usage { height: 6px; border-radius: 6px; background: var(--soft); overflow: hidden; min-width: 70px; }
.usage i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }

/* ---------------------------------------------------------------- KPI strip */
.kpis { display: flex; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); }
.kpi { flex: 1 1 200px; padding: 20px 24px; display: flex; flex-direction: column; gap: 2px; }
.kpi + .kpi { border-inline-start: 1px solid var(--line); }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi b { font-family: var(--font-head); font-size: 30px; font-weight: 700; line-height: 1.25; }
.kpi b small { font-size: 14px; font-weight: 500; color: var(--muted); }
.kpi em { font-style: normal; font-size: 12px; color: var(--ink2); }
.kpi.warn b { color: var(--warn-ink); }
.kpi.danger b { color: var(--danger-ink); }

/* ---------------------------------------------------------------- hero (live) */
.hero { position: relative; overflow: hidden; min-height: 360px; border-radius: var(--r-hero); background: var(--hero-bg); color: var(--hero-ink); border: var(--hero-border); }
.hero .art { position: absolute; inset: 0; }
.hero .copy { position: relative; padding: 32px 38px; max-width: 380px; display: flex; flex-direction: column; gap: 4px; }
.hero .copy .label { font-size: 15px; color: var(--hero-muted); }
.hero .copy .big { font-family: var(--font-head); font-size: 88px; font-weight: 800; line-height: 1; letter-spacing: -2px; }
.hero .copy .sub { font-size: 14px; color: var(--hero-muted); }
.ticker { margin-top: 20px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--hero-ink) 8%, transparent); border: 1px solid color-mix(in srgb, var(--hero-ink) 16%, transparent); font-size: 13px; animation: rise .5s ease-out both; }
.ticker .dot { background: #3DD9C1; box-shadow: 0 0 10px #3DD9C1; }
.star { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--star); box-shadow: 0 0 8px color-mix(in srgb, var(--star) 70%, transparent); transform: translate(-50%, -50%); animation: twinkle var(--d, 3s) ease-in-out infinite; transition: opacity .8s; }
.star.gone { opacity: 0 !important; animation: none; }
.ring { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #FFD27A; transform: translate(-50%, -50%); animation: arrive 1.4s ease-out forwards; pointer-events: none; }
.anchor { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.anchor i { width: 14px; height: 14px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 0 0 5px rgba(255, 255, 255, .12), 0 0 22px rgba(190, 180, 255, .9); }
.anchor span { font-size: 12px; white-space: nowrap; padding: 3px 10px; border-radius: 999px; background: rgba(8, 12, 40, .66); border: 1px solid rgba(201, 204, 245, .22); color: #FFFFFF; }
.anchor span b { color: #FFE2A0; font-weight: 700; }
[data-theme="day"] .anchor i { background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent); }
[data-theme="day"] .anchor span { background: var(--paper); color: var(--ink); border-color: var(--line); }
[data-theme="day"] .anchor span b { color: var(--accent-ink); }
.meteor { position: absolute; left: 70%; top: 12%; width: 120px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(255, 226, 160, 0), #FFE2A0); animation: fall 1.6s ease-in forwards; }
.wave1 { animation: wave 14s linear infinite; } .wave2 { animation: wave 22s linear infinite; } .wave3 { animation: wave 32s linear infinite; }
.blob { position: absolute; border-radius: 50%; filter: blur(32px); }
.blob.a1 { animation: drift1 16s ease-in-out infinite; } .blob.a2 { animation: drift2 20s ease-in-out infinite; } .blob.a3 { animation: drift1 26s ease-in-out infinite reverse; }

@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes arrive { 0% { width: 6px; height: 6px; opacity: 1; } 100% { width: 46px; height: 46px; opacity: 0; } }
@keyframes fall { 0% { transform: translate(0, 0) rotate(-28deg); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(-220px, 120px) rotate(-28deg); opacity: 0; } }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-600px); } }
@keyframes drift1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-90px, 30px) scale(1.15); } }
@keyframes drift2 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(110px, -20px) scale(.9); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); } }
@keyframes slide { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------- feed */
.feed { list-style: none; margin: 0; padding: 0 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.feed li { display: flex; gap: 12px; }
.feed .ic { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; }
.feed .ic svg { width: 17px; height: 17px; }
.feed .ic.ok { background: var(--ok-bg); color: var(--ok-ink); }
.feed .ic.info { background: var(--info-bg); color: var(--info-ink); }
.feed .ic.danger { background: var(--danger-bg); color: var(--danger-ink); }
.feed .ic.mute { background: var(--soft); color: var(--ink2); }
.feed li div { display: flex; flex-direction: column; font-size: 14px; }
.feed li small { font-size: 12px; color: var(--muted); }
.done { animation: pop .45s ease-out both; color: var(--ok-ink); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- packages */
.pkgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.pkg { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.pkg .speed { font-family: var(--font-head); font-size: 30px; font-weight: 800; line-height: 1.1; }
.pkg .speed small { font-size: 13px; font-weight: 500; color: var(--muted); }
.pkg .facts { display: flex; flex-wrap: wrap; gap: 6px; }
.pkg .price { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--accent-ink); }
.pkg .foot .counts { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.pkg .foot .counts > span { white-space: nowrap; }
.pkg .foot .counts b { color: var(--ink); font-weight: 700; }
.pkg .foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- overlays */
.scrim { position: fixed; inset: 0; background: rgba(8, 12, 30, .45); z-index: 40; animation: fade .2s ease-out; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(620px, 100vw); background: var(--paper); z-index: 41; overflow-y: auto; box-shadow: var(--shadow); animation: slide .28s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; }
.drawer .dh { position: sticky; top: 0; background: var(--paper); padding: 20px 24px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; z-index: 1; }
.drawer .db { padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 20px; }
.modal { position: fixed; z-index: 41; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow); animation: fade .2s ease-out; }
.modal .mh { padding: 20px 24px 6px; display: flex; align-items: center; gap: 12px; }
.modal .mb { padding: 14px 24px 8px; display: flex; flex-direction: column; gap: 14px; }
.modal .mf { padding: 14px 24px 22px; display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; }
.close { margin-inline-start: auto; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 14px; font-size: 14px; box-shadow: var(--shadow); animation: rise .3s ease-out; max-width: calc(100vw - 32px); }
.toast.err { background: var(--danger-ink); color: #FFFFFF; }
.code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px; white-space: pre; overflow: auto; max-height: 360px; direction: ltr; text-align: left; }
.secret { font-family: var(--font-head); font-size: 26px; font-weight: 800; letter-spacing: 2px; direction: ltr; }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
.login .art-side { position: relative; overflow: hidden; background: var(--hero-bg); color: var(--hero-ink); display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; }
.login .art-side .copy { position: relative; max-width: 440px; }
.login .art-side h1 { font-size: 40px; font-weight: 800; }
.login .art-side p { color: var(--hero-muted); font-size: 16px; }
.login .form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.login .err { color: var(--danger-ink); background: var(--danger-bg); padding: 10px 14px; border-radius: 12px; font-size: 14px; }

/* ---------------------------------------------------------------- themes picker */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.theme-card { border: 2px solid var(--line); border-radius: 18px; padding: 0; overflow: hidden; background: var(--paper); cursor: pointer; text-align: start; display: flex; flex-direction: column; }
.theme-card[aria-pressed="true"] { border-color: var(--accent); }
.theme-card .sw { height: 76px; display: flex; }
.theme-card .sw i { flex: 1 1 0; }
.theme-card .tx { padding: 10px 14px 12px; display: flex; flex-direction: column; }
.theme-card .tx b { font-size: 15px; }
.theme-card .tx small { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- sales chart */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding: 10px 20px 0; }
.bars .b { flex: 1 1 0; display: flex; flex-direction: column-reverse; min-width: 4px; border-radius: 4px 4px 0 0; overflow: hidden; background: var(--line); }
.bars-x { display: flex; gap: 4px; padding: 6px 20px 0; font-size: 11px; color: var(--muted); }
.bars-x span { flex: 1 1 0; min-width: 4px; text-align: center; }
.bars .b i { display: block; }
.bars .b i.s { background: var(--accent); }
.bars .b i.v { background: color-mix(in srgb, var(--accent) 45%, var(--paper)); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); padding: 8px 20px 16px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .nav { display: none; }
  .main { padding: 18px 16px 96px; }
  .mobile-bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--paper); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
  .mobile-bar a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; padding: 4px 0; min-height: 48px; justify-content: center; }
  .mobile-bar a[aria-current="page"] { color: var(--accent-ink); font-weight: 600; }
  .hero { min-height: 240px; }
  .hero .copy { padding: 22px; }
  .hero .copy .big { font-size: 62px; }
  .anchor span { display: none; }
  .kpi { flex: 1 1 45%; padding: 14px 16px; }
  .kpi + .kpi { border-inline-start: 0; }
  .kpi b { font-size: 24px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login .art-side { min-height: 220px; padding: 28px; }
  .login .art-side h1 { font-size: 30px; }
  .kv { grid-template-columns: 110px 1fr; }
  .hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- print sheets */
.print-page { background: #FFFFFF; color: #000000; min-height: 100vh; }
.print-bar { position: sticky; top: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 20px; background: var(--paper); border-bottom: 1px solid var(--line); color: var(--ink); z-index: 2; }
.sheet { display: flex; flex-wrap: wrap; gap: 5mm; padding: 10mm; justify-content: center; }
.sheet.thermal { flex-direction: column; align-items: center; gap: 0; padding: 4mm 0; }
.tk { width: 90mm; height: 50mm; border-radius: 4mm; display: flex; overflow: hidden; position: relative; break-inside: avoid; page-break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-family: 'Alexandria', sans-serif; }
.tk .m { flex: 1 1 auto; padding: 4mm 4.5mm; display: flex; flex-direction: column; gap: .8mm; min-width: 0; }
.tk .m .top { display: flex; align-items: center; gap: 1.5mm; font-size: 3.2mm; }
.tk .m .top b { font-weight: 800; }
.tk .m .top span { margin-inline-start: auto; font-size: 2.4mm; opacity: .85; }
.tk .m .lbl { font-size: 2.3mm; opacity: .8; margin-top: 1.5mm; }
.tk .m .cd { font-size: 7.5mm; font-weight: 800; letter-spacing: .6mm; direction: ltr; text-align: right; line-height: 1.1; }
.tk .m .facts { display: flex; gap: 1.2mm; flex-wrap: wrap; margin-top: .6mm; }
.tk .m .facts span { padding: .5mm 2mm; border-radius: 99px; font-size: 2.3mm; font-weight: 600; }
.tk .m .note { font-size: 2mm; opacity: .78; margin-top: auto; }
.tk .s { width: 26mm; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 3.5mm 2mm; border-inline-start: .5mm dashed var(--perf); }
.tk .s .qr { width: 19mm; height: 19mm; background: #FFFFFF; border-radius: 1.5mm; padding: 1mm; }
.tk .s .qr svg { width: 100%; height: 100%; display: block; }
.tk .s .pr { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.tk .s .pr b { font-size: 5mm; font-weight: 800; }
.tk .s .pr small { font-size: 2.2mm; }
.tk.night { background: linear-gradient(125deg, #1E2360 0%, #3B2E7E 58%, #5B3F95 100%); color: #FFFFFF; --perf: rgba(255, 255, 255, .4); }
.tk.night .facts span { background: rgba(255, 255, 255, .14); }
.tk.night .s { background: rgba(255, 226, 160, .12); }
.tk.dawn { background: linear-gradient(125deg, #5B3F95 0%, #C2679A 55%, #FFB57A 100%); color: #FFFFFF; --perf: rgba(255, 255, 255, .55); }
.tk.dawn .facts span { background: rgba(255, 255, 255, .2); }
.tk.dawn .s { background: rgba(255, 255, 255, .14); }
.tk.classic { background: #FFFFFF; color: #151A3B; border: .3mm solid #C9CEE3; --perf: #C9CEE3; }
.tk.classic .facts span { background: #EEF1F9; }
.tk.classic .s { background: #F6F7FC; }
.th58 { width: 48mm; padding: 3mm 0 4mm; display: flex; flex-direction: column; align-items: center; gap: 1.2mm; color: #000; border-bottom: .4mm dashed #000; break-inside: avoid; page-break-inside: avoid; font-family: 'Alexandria', sans-serif; }
.th58 b.brand58 { font-size: 4.4mm; font-weight: 800; }
.th58 .c { font-size: 7mm; font-weight: 800; letter-spacing: .5mm; direction: ltr; }
.th58 .f { font-size: 2.8mm; }
.th58 .qr { width: 22mm; height: 22mm; }
.th58 .qr svg { width: 100%; height: 100%; display: block; }
.th58 hr { width: 100%; border: 0; border-top: .3mm dashed #000; margin: .5mm 0; }
.rc { width: 85.6mm; height: 54mm; border-radius: 3.5mm; position: relative; overflow: hidden; color: #FFFFFF; background: radial-gradient(110% 120% at 100% 0%, #3A3F8F 0%, #1A1F4F 52%, #0E1236 100%); padding: 4mm 4.5mm; display: flex; flex-direction: column; break-inside: avoid; page-break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-family: 'Alexandria', sans-serif; }
.rc .top { display: flex; align-items: center; gap: 1.5mm; font-size: 3.2mm; }
.rc .top b { font-weight: 800; }
.rc .top span { margin-inline-start: auto; font-size: 2.3mm; color: #C9CCF5; }
.rc .mid { display: flex; align-items: flex-end; margin-top: 3mm; }
.rc .mid .pk { display: flex; flex-direction: column; font-size: 3.8mm; font-weight: 700; line-height: 1.2; }
.rc .mid .pk small { font-size: 2.3mm; font-weight: 400; color: #C9CCF5; }
.rc .mid .pr { margin-inline-start: auto; font-size: 6mm; font-weight: 800; color: #FFE2A0; line-height: 1; }
.rc .pin { margin-top: 3mm; height: 11mm; border-radius: 2.5mm; background: linear-gradient(110deg, #B9BED6, #E9ECF8, #AEB4CF, #DCE0F0, #A9AFCB); color: #151A3B; display: flex; align-items: center; justify-content: center; font-size: 5mm; font-weight: 800; letter-spacing: .6mm; direction: ltr; }
.rc .how { margin-top: 2.6mm; font-size: 2.35mm; line-height: 1.5; color: #E4E6FB; }
.rc .how b { color: #FFE2A0; font-weight: 700; display: inline-block; direction: ltr; white-space: nowrap; }
.rc .bot { margin-top: auto; display: flex; font-size: 2.1mm; color: #C9CCF5; gap: 2mm; }
.rc .bot span:last-child { margin-inline-start: auto; direction: ltr; }
@media print {
  @page { margin: 6mm; }
  body { background: #FFFFFF; }
  .print-bar { display: none; }
  .sheet { padding: 0; }
  .sheet.thermal { padding: 0; }
}
@page thermal { size: 58mm auto; margin: 0; }

/* drawer tables stay on one line; scroll sideways inside their frame */
.drawer .t th, .drawer .t td { white-space: nowrap; padding-inline: 12px; }
/* day theme chart keeps clear of the big number */
.hchart { position: absolute; inset: 0 34% 0 0; }
@media (max-width: 860px) { .hchart { inset: 0; opacity: .55; } }

/* network logo + hotspot preview (settings) */
.logo-prev { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.lp { height: 120px; border-radius: var(--r-card); border: 1px solid var(--line); display: grid; place-items: center; padding: 16px; }
.lp img { max-height: 84px; max-width: 100%; display: block; }
.lp.on-light { background: #FFFFFF; background-image: linear-gradient(45deg, #F1F2F7 25%, transparent 25%, transparent 75%, #F1F2F7 75%), linear-gradient(45deg, #F1F2F7 25%, transparent 25%, transparent 75%, #F1F2F7 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.lp.on-dark { background: linear-gradient(180deg, #0C1030, #1E2360 60%, #5B3F95); border-color: transparent; }
.lp.on-dark .muted { color: #C9CCF5; }
.hs-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.phone { width: 340px; max-width: 100%; height: 640px; border-radius: 36px; border: 10px solid #151A3B; overflow: hidden; background: #FFFFFF; box-shadow: var(--shadow); }
.phone iframe { width: 100%; height: 100%; border: 0; display: block; }
/* logo on printed cards */
.tk .m .top img.lg { height: 8.6mm; width: auto; max-width: 42mm; display: block; }
.rc .top img.lg { height: 9mm; width: auto; max-width: 44mm; display: block; }
.th58 img.lg58 { height: 10mm; width: auto; max-width: 44mm; filter: grayscale(1) contrast(1.6) brightness(.85); }

/* the hidden attribute always wins over display rules like .grid2 / .row */
[hidden] { display: none !important; }

/* cloud: subscription / acting banner, link-looking buttons */
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 36px; background: var(--info-bg); color: var(--info-ink); font-size: 14px; border-bottom: 1px solid var(--line); }
.banner .i { width: 18px; height: 18px; flex: none; }
.banner span { flex: 1 1 auto; }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); }
.banner.act { background: var(--nav-active); color: var(--nav-active-ink); }
@media (max-width: 860px) { .banner { padding: 10px 16px; } }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--accent-ink); cursor: pointer; text-decoration: underline; }
