/* Pulse · نبض — design tokens
   Brand: Nile teal + desert sand-gold on papyrus. Data colours follow the validated
   reference palette (blue / orange / aqua), with blue = relief and red = pressure. */
:root {
  color-scheme: light;
  --bg: #f6f3ea; --surface: #fffdf8; --surface-2: #efeadd; --surface-3: #e7e0cf;
  --border: #e1d9c6; --border-strong: #cfc4ab;
  --text: #142120; --text-2: #55605d; --muted: #8a8f88;
  --brand: #13606b; --brand-ink: #0e3b43; --brand-soft: #dcecea; --sand: #b9852a; --sand-soft: #f4e7c8;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
  --relief: #2a78d6; --relief-soft: #dce9f9; --pressure: #d03b3b; --pressure-soft: #f8dddd; --neutral: #d9d3c4;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --shadow: 0 1px 2px rgba(20, 33, 32, .06), 0 6px 24px rgba(20, 33, 32, .06);
  --shadow-lg: 0 12px 48px rgba(14, 59, 67, .18);
  --r: 14px; --r-sm: 10px;
  --font: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c1213; --surface: #131b1d; --surface-2: #1a2427; --surface-3: #22302f;
    --border: #263336; --border-strong: #35464a;
    --text: #ecebe4; --text-2: #a8b0ac; --muted: #7d8783;
    --brand: #47a8ad; --brand-ink: #9fd6d6; --brand-soft: #173436; --sand: #e0b35a; --sand-soft: #3a3020;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
    --relief: #3987e5; --relief-soft: #1b2c44; --pressure: #e66767; --pressure-soft: #3d2224; --neutral: #35403f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
    --shadow-lg: 0 18px 60px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1213; --surface: #131b1d; --surface-2: #1a2427; --surface-3: #22302f;
  --border: #263336; --border-strong: #35464a;
  --text: #ecebe4; --text-2: #a8b0ac; --muted: #7d8783;
  --brand: #47a8ad; --brand-ink: #9fd6d6; --brand-soft: #173436; --sand: #e0b35a; --sand-soft: #3a3020;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  --relief: #3987e5; --relief-soft: #1b2c44; --pressure: #e66767; --pressure-soft: #3d2224; --neutral: #35403f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
  --shadow-lg: 0 18px 60px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); font-feature-settings: "tnum" 1; }
html[lang="ar"] body { font-family: var(--font-ar); }
a { color: var(--brand); text-underline-offset: 2px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { width: auto; height: auto; clip-path: none; inset-inline-start: 12px; top: 8px; z-index: 99; background: var(--surface); padding: 6px 10px; }
.hidden, [hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.vu { unicode-bidi: isolate; white-space: nowrap; }
bdi { unicode-bidi: isolate; }
html[dir="rtl"] .t-chg { justify-content: flex-end; }
html[dir="rtl"] [dir="auto"] { text-align: start; }
html[dir="rtl"] .tile, html[dir="rtl"] .lq, html[dir="rtl"] .cn, html[dir="rtl"] .mini-tile { text-align: right; }
html[dir="rtl"] .t-val, html[dir="rtl"] .lq-v, html[dir="rtl"] .bn-v { text-align: right; }
.muted { color: var(--text-2); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { border-radius: 10px; box-shadow: var(--shadow); flex: none; }
.wordmark { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.wm-name { font-weight: 700; font-size: 19px; letter-spacing: -.01em; color: var(--brand-ink); }
.wm-ar { font-family: var(--font-ar); color: var(--sand); margin-inline-start: 4px; }
.wm-sub { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 13.5px; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { filter: brightness(1.08); }
.btn.icon { width: 36px; padding: 0; justify-content: center; }
.btn.ghost { background: transparent; }
kbd { font: 500 11px var(--mono); padding: 1px 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; color: var(--text-2); background: var(--surface); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; height: 36px; }
.seg button { border: 0; background: transparent; padding: 0 11px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.live { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 12.5px; color: var(--text-2); cursor: default; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); position: relative; }
.live.on .dot { background: var(--good); }
.live.on .dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--good); opacity: 0; animation: ping 2.4s infinite; }
.live.busy .dot { background: var(--sand); animation: blink 1s infinite; }
@keyframes ping { 0% { transform: scale(.5); opacity: .8; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- tabs ---------- */
.tabs { position: sticky; top: 57px; z-index: 25; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 8px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; cursor: pointer; font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab[aria-current="page"] { background: var(--brand-ink); color: var(--bg); font-weight: 600; }
.tab .count { font-size: 11px; background: var(--pressure); color: #fff; border-radius: 999px; padding: 0 6px; line-height: 17px; }
.bottombar { display: none; }

/* ---------- layout ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 18px 16px 90px; outline: none; }
.boot { min-height: 60vh; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--text-2); }
.boot img { animation: beat 1.4s infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.08); } 30% { transform: scale(1); } 45% { transform: scale(1.05); } }
.view { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.015em; }
.page-head p { margin: 4px 0 0; color: var(--text-2); max-width: 760px; }
h2.sec { font-size: 16px; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
h2.sec .pill { font-weight: 500; }
.grid { display: grid; gap: 12px; }
.g-hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-tiles { grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .cap { font-size: 11.5px; color: var(--text-2); margin-top: 8px; line-height: 1.4; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-2); background: var(--surface); white-space: nowrap; }
.pill.p { color: var(--pressure); border-color: color-mix(in srgb, var(--pressure) 40%, var(--border)); background: var(--pressure-soft); }
.pill.r { color: var(--relief); border-color: color-mix(in srgb, var(--relief) 40%, var(--border)); background: var(--relief-soft); }
.pill.warn { border-color: var(--warning); color: color-mix(in srgb, var(--warning) 60%, var(--text)); }
.pill.crit { border-color: var(--critical); color: var(--critical); }
.pill.sand { background: var(--sand-soft); border-color: color-mix(in srgb, var(--sand) 45%, var(--border)); color: color-mix(in srgb, var(--sand) 75%, var(--text)); }

/* ---------- hero / gauge ---------- */
.hero { position: relative; overflow: hidden; background:
  radial-gradient(1200px 300px at -10% -40%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 60%),
  radial-gradient(600px 240px at 110% 0%, color-mix(in srgb, var(--sand) 16%, transparent), transparent 60%), var(--surface); }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); font-weight: 600; }
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; }
.gauge-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: center; margin-top: 8px; }
.gauge { width: 240px; height: 140px; }
.gauge .needle { transition: transform 1.1s cubic-bezier(.2, .9, .2, 1); transform-origin: 120px 120px; }
.gauge-val { font-size: 46px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.gauge-label { font-size: 15px; font-weight: 600; margin-top: 6px; }
.verdict-p { color: var(--pressure); } .verdict-r { color: var(--relief); } .verdict-n { color: var(--text-2); }
.covbar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin: 10px 0 4px; }
.covbar span { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width .8s ease; }
.hero.insufficient .gauge, .hero.insufficient .gauge-val { opacity: .35; filter: grayscale(1); }
.subs { display: grid; gap: 4px; }
.sub { display: grid; grid-template-columns: minmax(120px, 170px) 1fr 52px; gap: 10px; align-items: center; padding: 7px 8px;
  border-radius: 10px; cursor: pointer; border: 1px solid transparent; background: transparent; text-align: start; width: 100%; }
.sub:hover { background: var(--surface-2); border-color: var(--border); }
.sub .nm { font-size: 13px; font-weight: 500; } .sub .nm small { color: var(--muted); font-weight: 400; margin-inline-start: 4px; }
.dbar { position: relative; height: 10px; border-radius: 5px; background: var(--surface-3); }
.dbar::after { content: ""; position: absolute; left: 50%; top: -3px; width: 1.5px; height: 16px; background: var(--border-strong); }
.dbar span { position: absolute; top: 0; height: 10px; border-radius: 5px; transition: all .9s cubic-bezier(.2, .9, .2, 1); }
.sub .val { text-align: end; font-size: 13px; font-weight: 600; }
.sub .val small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }

/* ---------- story / rules ---------- */
.story { display: grid; gap: 10px; }
.sig { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px 12px 16px; background: var(--surface); }
.sig::before { content: ""; position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--neutral); }
.sig.p::before { background: var(--pressure); } .sig.r::before { background: var(--relief); } .sig.n::before { background: var(--sand); }
.sig-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.sig-head b { font-size: 13.5px; }
.sig p { margin: 0; font-size: 14px; }
.strength { display: inline-flex; gap: 2px; } .strength i { width: 6px; height: 10px; border-radius: 2px; background: var(--surface-3); }
.sig.p .strength i.on { background: var(--pressure); } .sig.r .strength i.on { background: var(--relief); } .sig.n .strength i.on { background: var(--sand); }
details.more { margin-top: 8px; } details.more summary { cursor: pointer; font-size: 12.5px; color: var(--brand); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "▸ "; } details.more[open] summary::before { content: "▾ "; }
.learn { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--sand-soft); font-size: 13px; }
.learn b { color: color-mix(in srgb, var(--sand) 70%, var(--text)); }
.inputs { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-2); display: grid; gap: 3px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--brand-ink); color: var(--bg); border-color: var(--brand-ink); }

/* ---------- tiles ---------- */
.tile { position: relative; display: flex; flex-direction: column; gap: 2px; text-align: start; padding: 13px 14px 10px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; box-shadow: var(--shadow); min-height: 140px;
  transition: transform .15s, box-shadow .15s, border-color .15s; width: 100%; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.tile .t-name { font-size: 12.5px; color: var(--text-2); line-height: 1.3; min-height: 33px; }
.tile .t-val { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.tile .t-val small { font-size: 12px; font-weight: 500; color: var(--text-2); margin-inline-start: 3px; }
.tile .t-chg { font-size: 12.5px; display: flex; align-items: center; gap: 4px; }
.t-chg.p { color: var(--pressure); } .t-chg.r { color: var(--relief); } .t-chg.n { color: var(--text-2); }
.tile .t-meta { font-size: 11px; color: var(--muted); margin-top: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.tile .spark { height: 34px; width: 100%; margin: 4px 0 2px; }
.tile.empty { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 8px, var(--surface-2) 8px, var(--surface-2) 9px); box-shadow: none; }
.tile.empty .t-val { font-size: 15px; color: var(--muted); font-weight: 500; }
.tile.flash { animation: flash 2.2s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sand) 70%, transparent); border-color: var(--sand); }
  100% { box-shadow: var(--shadow); } }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- layout switch (auto / phone / desktop) ---------- */
#viewBtn { position: relative; }
.auto-badge { position: absolute; top: 2px; inset-inline-end: 3px; font-size: 9px; font-weight: 700; color: var(--sand); }
html[data-view="mobile"][data-device="computer"] body { max-width: 440px; margin: 0 auto; min-height: 100vh;
  box-shadow: 0 0 0 1px var(--border), 0 20px 80px rgba(0, 0, 0, .18); }
html[data-view="mobile"][data-device="computer"] { background: var(--surface-3); }
html[data-view="mobile"][data-device="computer"] .bottombar { left: 50%; right: auto; width: 440px; transform: translateX(-50%); }
html[data-view="mobile"][data-device="computer"] .drawer-panel { width: 440px; inset-inline-end: calc(50% - 220px); }
html[data-view="mobile"][data-device="computer"] .toasts { inset-inline-end: calc(50% - 205px); }
html[data-view="mobile"] main { padding-bottom: 96px; }

/* =====================================================================================
   PHONE APP DESIGN — active when html[data-view="mobile"][data-device] (auto on phones, or forced)
   ===================================================================================== */
html[data-view="mobile"][data-device] body { font-size: 15px; }
html[data-view="mobile"][data-device] main { padding: 10px 12px 96px; }
html[data-view="mobile"][data-device] .topbar { padding: 8px 12px; gap: 6px; }
html[data-view="mobile"][data-device] .wm-sub, html[data-view="mobile"][data-device] #runBtn, html[data-view="mobile"][data-device] #searchBtn,
html[data-view="mobile"][data-device] #themeBtn, html[data-view="mobile"][data-device] .live #liveText, html[data-view="mobile"][data-device] .hide-sm { display: none !important; }
html[data-view="mobile"][data-device] .brand img { width: 30px; height: 30px; }
html[data-view="mobile"][data-device] .wm-name { font-size: 16px; }
html[data-view="mobile"][data-device] .top-actions { gap: 4px; }
html[data-view="mobile"][data-device] .btn.icon, html[data-view="mobile"][data-device] .seg { height: 32px; }
html[data-view="mobile"][data-device] .btn.icon { width: 32px; }
html[data-view="mobile"][data-device] .seg button { padding: 0 8px; font-size: 12px; }
html[data-view="mobile"][data-device] .live { padding: 0 9px; height: 32px; }
/* in Simple mode the bottom bar is the navigation */
html[data-view="mobile"][data-device][data-ui="simple"] .tabs { display: none; }
html[data-view="mobile"][data-device] .tabs { top: 49px; padding: 6px 10px; }
html[data-view="mobile"][data-device] .bottombar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; justify-content: space-around;
  padding: 6px 6px max(8px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px); border-top: 1px solid var(--border); }
html[data-view="mobile"][data-device] .bottombar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none;
  font-size: 11px; color: var(--text-2); padding: 4px 2px; cursor: pointer; border-radius: 12px; }
html[data-view="mobile"][data-device] .bottombar button span:first-child { font-size: 19px; line-height: 1; }
html[data-view="mobile"][data-device] .bottombar button[aria-current="page"] { color: var(--brand); font-weight: 650; background: var(--brand-soft); }

/* slim live price strip under the header */
.pricebar { display: none; }
html[data-view="mobile"][data-device] .pricebar { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding: 7px 12px; font-size: 12.5px;
  background: var(--brand-ink); color: var(--bg); position: sticky; top: 49px; z-index: 24; white-space: nowrap; }
html[data-view="mobile"][data-device][data-ui="pro"] .pricebar { display: none; }
.pricebar::-webkit-scrollbar { display: none; }
.pricebar .pb { display: inline-flex; gap: 5px; align-items: baseline; }
.pricebar .pb b { font-weight: 650; } .pricebar .pb i { font-style: normal; font-size: 11px; opacity: .85; }
.pricebar .pb i.p { color: #ff9b9b; } .pricebar .pb i.r { color: #9cc7ff; }

/* hero */
html[data-view="mobile"][data-device] .hero2 { padding: 16px 16px 14px; border-radius: 18px; margin-bottom: 12px; }
html[data-view="mobile"][data-device] .h2-sent { font-size: 21px; line-height: 1.32; margin: 6px 0; }
html[data-view="mobile"][data-device] .h2-good { font-size: 13.5px; margin-bottom: 10px; }
html[data-view="mobile"][data-device] .eyebrow { font-size: 11px; }
html[data-view="mobile"][data-device] .bigs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
html[data-view="mobile"][data-device] .bign { padding: 8px 9px; border-radius: 12px; }
html[data-view="mobile"][data-device] .bn-l { font-size: 10.5px; line-height: 1.25; min-height: 26px; }
html[data-view="mobile"][data-device] .bn-v { font-size: 19px; }
html[data-view="mobile"][data-device] .bn-u { font-size: 10.5px; } html[data-view="mobile"][data-device] .bn-s { font-size: 10px; }

/* cards */
html[data-view="mobile"][data-device] .card { padding: 13px; border-radius: 16px; }
html[data-view="mobile"][data-device] .card h3 { font-size: 15px; flex-wrap: wrap; }
html[data-view="mobile"][data-device] h2.sec { font-size: 15px; margin: 20px 0 10px; }
html[data-view="mobile"][data-device] .page-head h1 { font-size: 20px; }

/* chain as a tidy list */
html[data-view="mobile"][data-device] .chain h3 .btn { width: 100%; justify-content: center; height: 42px; font-size: 14.5px; margin-top: 6px; }
html[data-view="mobile"][data-device] .cn-two { grid-template-columns: 1fr; gap: 4px; }
html[data-view="mobile"][data-device] .cn-grid, html[data-view="mobile"][data-device] .cn-grid.cn-2 { grid-template-columns: 1fr; gap: 6px; }
html[data-view="mobile"][data-device] .cn { align-items: center; padding: 9px 11px; border-radius: 12px; }
html[data-view="mobile"][data-device] .cn-ic { width: 32px; height: 32px; font-size: 15px; }
html[data-view="mobile"][data-device] .cn-body { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; width: 100%; align-items: center; }
html[data-view="mobile"][data-device] .cn-t { font-size: 13.5px; } html[data-view="mobile"][data-device] .cn-v { font-size: 13.5px; grid-row: 1 / span 2; grid-column: 2; text-align: end; max-width: 46vw; }
html[data-view="mobile"][data-device] .cn-s { font-size: 11px; }
html[data-view="mobile"][data-device] .cn-label { margin: 10px 2px 6px; }
html[data-view="mobile"][data-device] .cn-arrow { margin: 2px 0; font-size: 14px; } html[data-view="mobile"][data-device] .cn-arrow em { font-size: 11px; }

/* live block */
html[data-view="mobile"][data-device] .g-live { grid-template-columns: 1fr; gap: 6px; }
html[data-view="mobile"][data-device] .lq-row { grid-auto-columns: 132px; }
html[data-view="mobile"][data-device] .lq-v { font-size: 16px; }
html[data-view="mobile"][data-device] .live-card:not(.expanded) .story .sig:nth-child(n+3) { display: none; }
.more-btn { display: none; }
html[data-view="mobile"][data-device] .live-card:not(.expanded) .more-btn { display: block; width: 100%; margin-top: 8px; }
html[data-view="mobile"][data-device] .minis { grid-template-columns: 1fr 1fr; }
html[data-view="mobile"][data-device] .mini b { font-size: 17px; }
html[data-view="mobile"][data-device] .sig p { font-size: 13.5px; }

/* lessons + changes */
html[data-view="mobile"][data-device] .lessons { grid-auto-columns: 150px; }
html[data-view="mobile"][data-device] .lessons.full { grid-template-columns: 1fr 1fr; }
html[data-view="mobile"][data-device] .lesson { min-height: 104px; padding: 12px; }
html[data-view="mobile"][data-device] .lesson-card { padding: 16px; } html[data-view="mobile"][data-device] .lesson-step { font-size: 17px; min-height: 120px; }
html[data-view="mobile"][data-device] ul.changes li { font-size: 13.5px; }

/* pro tiles */
html[data-view="mobile"][data-device] .g-hero, html[data-view="mobile"][data-device] .g-2, html[data-view="mobile"][data-device] .g-3 { grid-template-columns: 1fr; }
html[data-view="mobile"][data-device] .kpis, html[data-view="mobile"][data-device] .g-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
html[data-view="mobile"][data-device] .tile { min-height: 124px; padding: 10px; }
html[data-view="mobile"][data-device] .tile .t-val { font-size: 18px; }
html[data-view="mobile"][data-device] .gauge-wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
html[data-view="mobile"][data-device] .sub { grid-template-columns: 100px 1fr 46px; }
html[data-view="mobile"][data-device] .chart { height: 240px; }

/* detail panel = bottom sheet */
html[data-view="mobile"][data-device] .drawer-panel { top: auto; bottom: 0; left: 0; right: 0; inset-inline-end: 0; width: 100%; max-height: 90vh;
  border-radius: 22px 22px 0 0; border: 0; border-top: 1px solid var(--border); padding: 26px 14px 40px; transform: translateY(105%); }
html[data-view="mobile"][data-device] .drawer.open .drawer-panel { transform: none; }
html[data-view="mobile"][data-device] .drawer-panel::before { content: ""; position: absolute; top: 9px; left: 50%; width: 44px; height: 5px; margin-left: -22px;
  border-radius: 3px; background: var(--border-strong); }
html[data-view="mobile"][data-device="computer"] .drawer-panel { left: calc(50% - 220px); right: auto; width: 440px; }
html[data-view="mobile"][data-device] .tu p { font-size: 15px; }
html[data-view="mobile"][data-device] .facts { grid-template-columns: 1fr; }
html[data-view="mobile"][data-device] .toasts { bottom: 84px; }

/* ---------- SIMPLE / tutor mode ---------- */
.simple { max-width: 1080px; margin: 0 auto; }
.hero2 { border-radius: 22px; padding: 26px 26px 20px; margin-bottom: 14px; color: var(--text); border: 1px solid var(--border);
  background: radial-gradient(900px 260px at 0% -20%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%),
              radial-gradient(500px 220px at 100% 0%, color-mix(in srgb, var(--sand) 20%, transparent), transparent 60%), var(--surface); box-shadow: var(--shadow); }
.hero2.verdict-bg-p { border-color: color-mix(in srgb, var(--pressure) 35%, var(--border)); }
.hero2.verdict-bg-r { border-color: color-mix(in srgb, var(--relief) 35%, var(--border)); }
.h2-sent { font-size: clamp(22px, 3.4vw, 34px); line-height: 1.25; margin: 8px 0 6px; letter-spacing: -.02em; max-width: 900px; }
.h2-good { margin: 0 0 14px; color: var(--relief); font-weight: 500; }
.bigs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.bign { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; }
.bn-l { font-size: 13px; color: var(--text-2); } .bn-v { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.bn-u { font-size: 13px; color: var(--text-2); } .bn-s { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.simple-live .live-card { margin-bottom: 14px; }
.chain { margin-bottom: 14px; }
.chain h3 { flex-wrap: wrap; font-size: 18px; }
.cn-row { margin: 6px 0; } .cn-label { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; margin: 4px 2px 8px; }
html[lang="ar"] .cn-label { text-transform: none; letter-spacing: 0; font-size: 13px; }
.cn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cn-grid.cn-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cn-grid.cn-1 { grid-template-columns: 1fr; }
.cn-two { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; }
.cn-in .cn-label { color: var(--relief); } .cn-out .cn-label { color: var(--pressure); }
.cn { display: flex; gap: 10px; align-items: flex-start; text-align: start; padding: 11px 12px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; transition: transform .15s, box-shadow .15s; border-inline-start-width: 5px; min-width: 0; width: 100%; }
.cn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.cn-p { border-inline-start-color: var(--pressure); } .cn-r { border-inline-start-color: var(--relief); } .cn-n { border-inline-start-color: var(--muted); }
.cn-x { border-inline-start-color: var(--border); opacity: .8; }
.cn-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: var(--surface-2); }
.cn-ic.big { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; }
.cn-p .cn-ic { background: var(--pressure-soft); } .cn-r .cn-ic { background: var(--relief-soft); }
.cn-body { display: flex; flex-direction: column; min-width: 0; }
.cn-t { font-size: 13px; font-weight: 600; line-height: 1.25; } .cn-v { font-size: 17px; font-weight: 700; margin-top: 2px; }
.cn-s { font-size: 11.5px; color: var(--text-2); } .cn-p .cn-s { color: var(--pressure); } .cn-r .cn-s { color: var(--relief); }
.cn-arrow { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); margin: 6px 0; font-size: 18px; }
.cn-arrow em { font-style: normal; font-size: 12px; color: var(--text-2); background: var(--surface-2); padding: 2px 10px; border-radius: 999px; }
.lessons { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.lessons.full { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.lesson { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); text-decoration: none; transition: transform .15s; min-height: 120px; }
.lesson:hover { transform: translateY(-2px); border-color: var(--sand); }
.lesson.done { background: color-mix(in srgb, var(--relief-soft) 60%, var(--surface)); }
.ls-ic { font-size: 22px; } .ls-ic.big { font-size: 34px; } .ls-t { font-weight: 600; line-height: 1.3; } .ls-m { font-size: 12px; color: var(--text-2); margin-top: auto; }
ul.changes { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
ul.changes li { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border-inline-start: 4px solid var(--muted); font-size: 14px; }
ul.changes li.p { border-color: var(--pressure); } ul.changes li.r { border-color: var(--relief); }
.seg.mode button[aria-pressed="true"] { background: var(--sand); color: #1a1205; }
.node-head { display: flex; gap: 14px; align-items: center; margin: 4px 40px 12px 0; }
.tutor { display: grid; gap: 4px; }
.tu { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.tu > b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: color-mix(in srgb, var(--sand) 70%, var(--text)); margin-bottom: 4px; }
html[lang="ar"] .tu > b { text-transform: none; letter-spacing: 0; font-size: 13.5px; }
.tu p { margin: 0; font-size: 15.5px; line-height: 1.6; }
.tu-now { background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); }
.chips2 { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-chip { border: 1px solid var(--border); border-inline-start-width: 4px; background: var(--surface-2); border-radius: 12px; padding: 7px 11px; cursor: pointer; font-size: 13.5px; text-align: start; }
.ch-chip em { display: block; font-style: normal; font-size: 11.5px; color: var(--text-2); }
.mini-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mini-tile { display: flex; flex-direction: column; gap: 2px; text-align: start; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 12px; }
.mini-tile b { font-size: 16px; } .mini-tile small { font-size: 10px; color: var(--text-2); }
.tourbar { position: sticky; top: 0; z-index: 3; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; margin: -6px -6px 12px; border-radius: 14px;
  background: var(--sand-soft); border: 1px solid color-mix(in srgb, var(--sand) 45%, var(--border)); }
.tour-dots { display: flex; gap: 5px; margin: 8px 0; } .tour-dots i { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); }
.tour-dots i.on { background: var(--sand); } .tour-dots i.past { background: color-mix(in srgb, var(--sand) 45%, var(--surface-3)); }
.lesson-card { max-width: 760px; margin: 0 auto 14px; padding: 24px; }
.ls-head { display: flex; align-items: center; gap: 12px; } .ls-head h1 { font-size: 24px; margin: 0; }
.lesson-step { font-size: 20px; line-height: 1.6; margin: 18px 0; min-height: 96px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; }
.qopts { display: grid; gap: 8px; margin-bottom: 12px; }
.qopt { text-align: start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 15px; }
.qopt.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--surface)); }
.qopt.wrong { border-color: var(--critical); background: var(--pressure-soft); }
.qfb { padding: 10px 12px; border-radius: 12px; } .qfb.right { background: color-mix(in srgb, var(--good) 12%, var(--surface)); } .qfb.wrong { background: var(--pressure-soft); }
.cn-v.num, .bn-v.num { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  #runBtn, #searchBtn, #themeBtn { display: none !important; }
  .brand img { width: 30px; height: 30px; } .wm-name { font-size: 16px; }
  .seg button { padding: 0 7px; font-size: 12px; } .seg { height: 32px; }
  .bigs { grid-template-columns: 1fr; } .bn-v { font-size: 26px; }
  .cn-two { grid-template-columns: 1fr; } .cn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cn-grid.cn-1 { grid-template-columns: 1fr; } .hero2 { padding: 18px; } .lesson-step { font-size: 18px; }
}

/* ---------- live layer ---------- */
.live-card { background: radial-gradient(700px 160px at 0% 0%, color-mix(in srgb, var(--good) 10%, transparent), transparent 70%), var(--surface); }
.live-card h3 { flex-wrap: wrap; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--good); margin-inline-end: 8px; position: relative; top: -1px;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); animation: livepulse 2s infinite; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.lq-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.lq { display: flex; flex-direction: column; gap: 1px; text-align: start; padding: 10px 11px 8px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); cursor: pointer; min-width: 0; transition: border-color .15s, transform .15s; }
.lq:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.lq.flash { animation: flash 2.2s ease; }
.lq-n { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lq-v { font-size: 18px; font-weight: 650; } .lq-v small { font-size: 11px; color: var(--text-2); margin-inline-start: 3px; font-weight: 500; }
.lq .spark { height: 26px; }
.lq-t { font-size: 10.5px; color: var(--muted); }
.pill.live-on { border-color: var(--good); color: var(--good); }
.g-live { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.minis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.mini { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.mini b { font-size: 20px; }
ul.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; }
ul.news li { display: flex; flex-direction: column; gap: 1px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
@media (max-width: 900px) { .g-live { grid-template-columns: 1fr; } }

/* ---------- explanations ---------- */
.btn.toggle[aria-pressed="true"] { background: var(--sand-soft); border-color: var(--sand); color: color-mix(in srgb, var(--sand) 70%, var(--text)); }
.tile .t-ex { font-size: 11.5px; line-height: 1.35; color: var(--text-2); margin: 2px 0; }
.tile .t-imp { color: var(--text); font-weight: 500; }
.tile.explained { min-height: 210px; }
.explain { margin-top: 12px; border-color: color-mix(in srgb, var(--sand) 45%, var(--border)); background:
  linear-gradient(180deg, color-mix(in srgb, var(--sand-soft) 55%, transparent), transparent 140px), var(--surface); }
.ex-row { padding: 8px 0; border-top: 1px dashed var(--border); } .ex-row:first-of-type { border-top: 0; }
.ex-row > b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: color-mix(in srgb, var(--sand) 70%, var(--text)); margin-bottom: 3px; }
html[lang="ar"] .ex-row > b { text-transform: none; letter-spacing: 0; font-size: 13px; }
.ex-row p { margin: 3px 0; font-size: 14px; }

/* ---------- charts ---------- */
.chart { width: 100%; height: 300px; direction: ltr; overflow: hidden; }
.chart.tall { height: 380px; }
.rangebar { display: inline-flex; gap: 2px; background: var(--surface-2); padding: 2px; border-radius: 9px; }
.rangebar button { border: 0; background: transparent; padding: 3px 9px; border-radius: 7px; font-size: 12px; cursor: pointer; color: var(--text-2); }
.rangebar button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }

/* ---------- lists ---------- */
.timeline { display: grid; gap: 8px; }
.ev { display: grid; grid-template-columns: 74px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); }
.ev .d { font-size: 12px; color: var(--text-2); }
.ev .t { font-size: 13.5px; } .ev .t small { display: block; color: var(--text-2); font-size: 12px; }
.decay { width: 90px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.decay span { display: block; height: 100%; border-radius: 3px; }
.cal { display: grid; gap: 6px; }
.cal-item { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); }
.cal-item .when { font-weight: 600; font-size: 13px; } .cal-item .when small { display: block; color: var(--text-2); font-weight: 400; }
.countdown { font: 500 12px var(--mono); color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.tbl th { font-size: 11.5px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tblwrap { overflow-x: auto; }
.status-ok { color: var(--good); } .status-err { color: var(--critical); }

/* ---------- brief ---------- */
.brief { direction: rtl; text-align: right; font-family: var(--font-ar); font-size: 16.5px; line-height: 1.95; max-width: 860px; margin-inline: auto; }
.brief h1 { font-size: 24px; line-height: 1.4; } .brief h2 { font-size: 19px; margin-top: 28px; color: var(--brand-ink); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.brief li { margin: 4px 0; } .brief .refs { direction: ltr; text-align: left; font-family: var(--font); font-size: 12.5px; line-height: 1.6; }
.brief .refs a { word-break: break-all; }
.brief table { width: 100%; border-collapse: collapse; font-size: 14px; } .brief td, .brief th { border-bottom: 1px solid var(--border); padding: 6px 8px; }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(8, 18, 20, .45); opacity: 0; transition: opacity .25s; }
.drawer-panel { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(720px, 100%); background: var(--bg); border-inline-start: 1px solid var(--border);
  box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .32s cubic-bezier(.2, .9, .2, 1); overflow-y: auto; padding: 22px 22px 60px; }
html[dir="rtl"] .drawer-panel { transform: translateX(-105%); }
.drawer:not(.open) .drawer-panel { visibility: hidden; transition: transform .32s cubic-bezier(.2, .9, .2, 1), visibility 0s .32s; }
.drawer.open { pointer-events: auto; } .drawer.open .drawer-scrim { opacity: 1; } .drawer.open .drawer-panel { transform: none; }
.drawer .close { position: sticky; top: 0; float: inline-end; z-index: 2; }
.d-title { font-size: 20px; margin: 0 40px 4px 0; } .d-sub { color: var(--text-2); font-size: 13px; margin: 0 0 14px; }
.d-big { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.d-big .v { font-size: 36px; font-weight: 700; letter-spacing: -.02em; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.fact { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; }
.fact b { display: block; font-size: 11px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }

/* ---------- palette ---------- */
.palette { position: fixed; inset: 0; z-index: 70; display: none; }
.palette.open { display: block; }
.palette-scrim { position: absolute; inset: 0; background: rgba(8, 18, 20, .5); backdrop-filter: blur(2px); }
.palette-box { position: relative; margin: 10vh auto 0; width: min(640px, calc(100% - 24px)); background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: rise .2s ease; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 16px 18px; font: inherit; font-size: 16px; background: transparent; color: var(--text); outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.palette li[aria-selected="true"] { background: var(--brand-soft); }
.palette li small { color: var(--text-2); }
.palette-hint { padding: 8px 14px; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--border); }

/* ---------- toasts ---------- */
.toasts { position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; width: min(380px, calc(100% - 32px)); }
.toast { background: var(--brand-ink); color: var(--bg); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-lg); font-size: 13.5px;
  animation: rise .25s ease; display: flex; gap: 10px; align-items: flex-start; }
.toast b { display: block; } .toast .x { margin-inline-start: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .7; }

.disclaimer { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.empty-state { padding: 24px; text-align: center; color: var(--text-2); border: 1px dashed var(--border-strong); border-radius: var(--r); }

/* ---------- responsive ---------- */
@media (max-width: 1060px) { .g-hero { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .wm-sub { display: none; }
  .topbar { padding: 8px 12px; gap: 6px; }
  .top-actions { gap: 4px; }
  .live { padding: 0 9px; } .live #liveText { display: none; }
  .btn { padding: 0 9px; } .seg button { padding: 0 8px; }
  .card h3 { flex-wrap: wrap; }
  .tabs { top: 53px; padding: 6px 12px; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .gauge-wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .tabs { top: 57px; }
  .g-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { min-height: 128px; padding: 11px; } .tile .t-val { font-size: 19px; }
  .sub { grid-template-columns: 100px 1fr 58px; }
  .bottombar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; justify-content: space-around;
    padding: 6px 6px max(6px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px); border-top: 1px solid var(--border); }
  .bottombar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; font-size: 11px; color: var(--text-2); padding: 4px; cursor: pointer; }
  .bottombar button span:first-child { font-size: 18px; line-height: 1; }
  .bottombar button[aria-current="page"] { color: var(--brand); font-weight: 600; }
  .ev { grid-template-columns: 1fr auto; } .ev .d { grid-column: 1 / -1; }
  .cal-item { grid-template-columns: 1fr auto; } .cal-item .when { grid-column: 1 / -1; }
  .facts { grid-template-columns: 1fr; }
  .toasts { bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .topbar, .tabs, .bottombar, .toasts { display: none; } body { background: #fff; } .card { box-shadow: none; } }
