/* ==========================================================================
   الهوية المعتمدة: 04 — Rose Quartz · الخط: Alexandria (Self-hosted, OFL)
   المشهد (الخلفية، الشجرة، الإطارات الزجاجية) مأخوذ من المرجع المعتمد نفسه: assets/plate-air.jpg
   كل القياسات بوحدة التصميم --u حيث لوحة المرجع = 1672 × 941.
   ========================================================================== */
@font-face {
  font-family: 'Alexandria'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('fonts/alexandria-arabic-wght-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Alexandria'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('fonts/alexandria-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #34163a; --ink-2: #553650; --ink-3: #735a6e;
  --rose: #c9588c; --rose-d: #9c3b66; --teal: #0e8a82; --coral: #cf4762; --gold: #9a6d12;
  --pearl: #eee1ea; --blush: #dbb3cf; --peach: #e5c9b1; --lilac: #9e7391; --aqua: #aad4dd;
  --line: rgba(196, 150, 178, 0.32);
  --u: 1.15px; --su: var(--u);
  --font: 'Alexandria', 'Segoe UI', 'Noto Sans Arabic', Tahoma, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; font-family: var(--font); color: var(--ink); line-height: 1.5; overflow-x: hidden; -webkit-font-smoothing: antialiased;
  background: #f3e6ee url('assets/backdrop.jpg') center / cover fixed; }
h1, h2, h3, p, ul { margin: 0; padding: 0; } ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: start; -webkit-tap-highlight-color: transparent; }
small { font-weight: 400; }
:focus-visible { outline: 2px solid var(--rose-d); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; top: 8px; inset-inline-start: 8px; z-index: 60; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; transform: translateY(-300%); }
.skip:focus { transform: none; }
.grow { flex: 1; min-width: 0; }
.teal { color: var(--teal); } .coral { color: var(--coral); }
.ic { width: calc(var(--u) * 22); height: calc(var(--u) * 22); flex: none; }
.kpi-val, .stat b, .count, .ppct, .gauge-num, .hex-n, .tile-row b { font-variant-numeric: tabular-nums lining-nums; }

/* ==========================================================================
   التخطيط الانسيابي (جوال / تابلت طولي) — نفس المكوّنات، بطاقات زجاجية فوق خلفية المشهد
   ========================================================================== */
.scene { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 900px; margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left)); }
.hd { order: 1; } .tools { order: 2; } .kpis { order: 3; } .stage { order: 4; } .p-health { order: 5; } .p-progress { order: 6; }
.p-cash { order: 7; } .p-plan { order: 8; } .p-alerts { order: 9; } .p-due { order: 10; } .p-news { order: 11; } .demo { order: 12; }
.side { display: none; }

.hd h1 { font-size: calc(var(--u) * 24); font-weight: 700; line-height: 1.3; color: var(--ink); }
.hd p { font-size: calc(var(--u) * 12); color: var(--ink-2); }

.tools { display: flex; align-items: center; gap: 8px; }
.tool, .chip { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; border-radius: 13px; color: var(--ink);
  background: rgba(255, 255, 255, 0.86); border: 1px solid #fff; box-shadow: 0 6px 16px -8px rgba(150, 90, 130, 0.55); }
.chip { flex: 1; justify-content: space-between; white-space: nowrap; padding-inline: 14px; font-size: calc(var(--u) * 13); font-weight: 500; border-radius: 20px; }
.ic.sm { width: calc(var(--u) * 15); height: calc(var(--u) * 15); }
.has-dot { position: relative; }
.has-dot::after { content: ''; position: absolute; top: 22%; inset-inline-start: 24%; width: 18%; aspect-ratio: 1; border-radius: 50%; background: #e2507c; border: 1.5px solid #fff; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi, .panel { background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 253, 0.76)); border: 1px solid #fff; border-radius: 22px;
  box-shadow: 0 16px 34px -20px rgba(150, 90, 130, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.6); }
.kpi { display: flex; align-items: center; gap: calc(var(--u) * 12); padding: 12px 16px; min-height: 68px; }
.kpi:first-child { grid-column: 1 / -1; }
.kpi-ic { display: grid; place-items: center; color: var(--ink-2); }
.kpi-ic .ic { width: calc(var(--u) * 32); height: calc(var(--u) * 32); stroke-width: 1.5; }
.kpi.teal .kpi-ic { color: var(--teal); } .kpi.coral .kpi-ic { color: var(--coral); }
.kpi-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; color: var(--ink); }
@media (max-width: 359px) { .kpi { padding: 10px; gap: 6px; } .kpi-ic .ic { width: 24px; height: 24px; } .kpi-val { font-size: 16px !important; } .kpi-label { font-size: 11px !important; } }
.kpi-label { font-size: calc(var(--u) * 12); font-weight: 500; line-height: 1.3; }
.kpi-val { font-size: calc(var(--u) * 19); font-weight: 700; line-height: 1.3; direction: ltr; text-align: end; unicode-bidi: isolate; }
.kpi.coral .kpi-val { color: var(--coral); }

.panel { padding: 14px; min-width: 0; }
.ph { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: calc(var(--u) * 30); margin-block-end: calc(var(--u) * 4); }
.ph h2 { display: flex; align-items: center; gap: calc(var(--u) * 8); font-size: calc(var(--u) * 16.5); font-weight: 700; line-height: 1.2; white-space: nowrap; }
.ph h2 .ic { color: var(--rose); width: calc(var(--u) * 24); height: calc(var(--u) * 24); }
.more, .drop { display: inline-flex; align-items: center; gap: 4px; font-size: calc(var(--u) * 12.5); color: var(--ink-2); min-height: 32px; white-space: nowrap; }
.drop { padding: 0 calc(var(--u) * 10); border-radius: 999px; background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line); }
.drop .ic { width: calc(var(--u) * 14); height: calc(var(--u) * 14); }

.rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--u) * 3); } .rows > li { min-width: 0; }
.tile-row { display: flex; align-items: center; gap: calc(var(--u) * 10); width: 100%; min-height: 40px; padding: 4px calc(var(--u) * 10); font-size: calc(var(--u) * 13.5); font-weight: 500; line-height: 1.35;
  background: rgba(255, 255, 255, 0.78); border: 1px solid var(--line); border-radius: calc(var(--u) * 9); box-shadow: 0 1px 3px rgba(160, 100, 140, 0.1); }
.tile-row b { font-weight: 600; }
.ri { display: grid; place-items: center; color: var(--rose-d); }
.ring { width: calc(var(--u) * 13); height: calc(var(--u) * 13); border-radius: 50%; border: calc(var(--u) * 2.6) solid #17a69b; flex: none; }
.ring.warn { border-color: #f0b454; } .ring.bad { border-color: #ea6b83; }
.tile-row.danger { background: linear-gradient(90deg, #fde6d8, #fbd5c5); border-color: #f3c3ae; }
.tile-row.danger .ri { color: #d5482f; } .tile-row.warn .ri { color: var(--rose-d); } .tile-row.ok .ri { color: var(--teal); }
.when { font-size: calc(var(--u) * 11.5); color: var(--ink-2); padding: 2px calc(var(--u) * 8); border-radius: 8px; background: rgba(255, 255, 255, 0.9); border: 1px solid var(--line); white-space: nowrap; }
.count { min-width: calc(var(--u) * 46); padding: 1px calc(var(--u) * 10); text-align: center; border-radius: 999px; font-size: calc(var(--u) * 13); font-weight: 700; background: linear-gradient(90deg, #fbd3dc, #f6bdcd); }

.gauge-box { position: relative; display: block; width: min(100%, calc(var(--u) * 196)); aspect-ratio: 200 / 112; margin: calc(var(--u) * 6) auto calc(var(--u) * 8); }
.gauge { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.gauge-num, .gauge-word { position: absolute; inset-inline: 0; text-align: center; }
.gauge-num { top: 40%; font-size: calc(var(--u) * 31); font-weight: 700; line-height: 1; }
.gauge-word { top: 76%; font-size: calc(var(--u) * 12.5); font-weight: 500; }

.grid2, .grid3 { display: grid; gap: calc(var(--u) * 5); }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-block-start: calc(var(--u) * 6); }
.stat { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 46px; padding: 3px 4px; text-align: center; background: rgba(255, 255, 255, 0.8); border: 1px solid var(--line); border-radius: calc(var(--u) * 9); }
.stat span { font-size: calc(var(--u) * 11.5); font-weight: 500; white-space: nowrap; }
.stat b { font-size: calc(var(--u) * 16); font-weight: 700; line-height: 1.3; direction: ltr; unicode-bidi: isolate; }
.stat.teal b { color: var(--teal); }
.t-mint { background: linear-gradient(180deg, #e9f8f4, #d9f1ec); border-color: #c4e7df; } .t-peach { background: linear-gradient(180deg, #fde7df, #fbd9d0); border-color: #f4c8bd; }
.wave { display: block; width: 100%; height: calc(var(--u) * 54); margin-block-start: calc(var(--u) * 8); }

.prow { display: flex; align-items: center; gap: calc(var(--u) * 10); width: 100%; min-height: 48px; padding: 2px calc(var(--u) * 6); background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line); border-radius: calc(var(--u) * 9); }
.thumb { display: grid; place-items: center; width: calc(var(--u) * 42); height: calc(var(--u) * 42); border-radius: calc(var(--u) * 8); flex: none; color: var(--rose-d); border: 1px solid #fff; }
.thumb.peach { background: linear-gradient(140deg, #fdeadb, #f6cdb6); } .thumb.lilac { background: linear-gradient(140deg, #efe2fa, #d6bff0); color: #7a55a8; }
.thumb.mint { background: linear-gradient(140deg, #e4f6e6, #bfe3c2); color: #3d8a55; } .thumb.sky { background: linear-gradient(140deg, #e3f3fb, #bfe0f3); color: #1c7fb5; }
.prow-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.prow-txt b { font-size: calc(var(--u) * 13); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .prow-txt small { font-size: calc(var(--u) * 12); color: var(--ink-2); }
.pbar { width: calc(var(--u) * 96); height: calc(var(--u) * 8); border-radius: 99px; background: rgba(170, 130, 160, 0.22); overflow: hidden; align-self: flex-end; margin-block-end: calc(var(--u) * 9); flex: none; }
.pbar i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: linear-gradient(90deg, #12998f, #56c7bb); margin-inline-end: auto; }
.ppct { width: calc(var(--u) * 40); font-size: calc(var(--u) * 15.5); font-weight: 700; color: var(--teal); text-align: end; flex: none; }

.chart { display: block; width: 100%; height: auto; direction: ltr; }
.chart .cg { stroke: rgba(170, 130, 160, 0.25); stroke-width: 0.8; } .chart .ca { font-family: var(--font); font-size: 9px; fill: var(--ink-2); } .chart .ca.mid { text-anchor: middle; }
.chart .cb { fill: url(#cbg); opacity: 0.92; } .chart .cl { fill: none; stroke: #b0448a; stroke-width: 1.6; stroke-linejoin: round; } .chart .cd { fill: #fff; stroke: #b0448a; stroke-width: 1.4; }

.demo { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--gold); }
.demo .ic { width: 14px; height: 14px; }

/* ---------- الشجرة: قصّ من المشهد نفسه، والنص الحي فوق الفقاعات المخبوزة ---------- */
.stage { position: relative; aspect-ratio: 770 / 515; container-type: inline-size; border-radius: 24px; overflow: hidden;
  background: url('assets/plate-air.jpg') no-repeat; background-size: 217.143% auto; background-position: 52.106% 43.427%; box-shadow: 0 16px 34px -20px rgba(150, 90, 130, 0.7); border: 1px solid #fff; }
.stage > * { --su: calc(100cqi / 770); position: absolute; }
.hex { left: 47.53%; top: 54.95%; width: calc(var(--su) * 112); transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; color: #fff; text-align: center; line-height: 1.15; }
.hex .ic { width: calc(var(--su) * 30); height: calc(var(--su) * 30); stroke-width: 1.6; }
.hex-l { font-size: calc(var(--su) * 13); font-weight: 600; margin-block-start: calc(var(--su) * 4); white-space: nowrap; }
.hex-n { font-size: calc(var(--su) * 31); font-weight: 700; }
.tab { display: flex; align-items: center; justify-content: center; gap: calc(var(--su) * 7); height: 5.4%; font-size: calc(var(--su) * 14.5); font-weight: 600; color: var(--ink); white-space: nowrap; }
.tab .ic { width: calc(var(--su) * 19); height: calc(var(--su) * 19); color: var(--rose-d); }
.tab-tl { left: 18.57%; top: 2.14%; width: 15.6%; } .tab-tr { left: 73.38%; top: 2.14%; width: 16.1%; }
.tab-bl { left: 11.43%; top: 44.85%; width: 16.6%; } .tab-br { left: 76.36%; top: 45.83%; width: 16.9%; }
.bub { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; padding: calc(var(--su) * 2) calc(var(--su) * 20) 0; color: var(--ink); border-radius: 44%; }
.bub-tl { left: 6.49%; top: 9.13%; width: 30.13%; height: 27.96%; } .bub-tr { left: 62.6%; top: 9.13%; width: 32.86%; height: 27.96%; }
.bub-bl { left: 3.38%; top: 52.62%; width: 30.65%; height: 27.96%; } .bub-br { left: 65.58%; top: 53.01%; width: 31.17%; height: 27.57%; }
.bub-t { display: block; font-size: calc(var(--su) * 14); font-weight: 700; white-space: nowrap; padding-inline-start: calc(var(--su) * 8); }
.bub-lead, .br { display: flex; align-items: center; gap: calc(var(--su) * 7); font-size: calc(var(--su) * 12); font-weight: 500; white-space: nowrap; line-height: 1.2; margin-block-start: calc(var(--su) * 9); padding-inline-start: calc(var(--su) * 8); }
.bub-lead { font-weight: 700; color: var(--rose-d); } .stage .bub-lead { display: none; }
.bub-rows { display: block; }
.br .ic { width: calc(var(--su) * 16); height: calc(var(--su) * 16); color: var(--ink-2); }
.br.coral, .br.coral .ic { color: var(--coral); } .br.teal, .br.teal .ic { color: var(--teal); }
.bub-art { position: absolute; left: calc(var(--su) * 22); bottom: calc(var(--su) * 34); display: grid; place-items: center; width: calc(var(--su) * 62); height: calc(var(--su) * 62); border-radius: 30%; color: #1b9bd6; background: radial-gradient(circle at 35% 30%, #fff, rgba(232, 214, 240, 0.55)); }
.bub-art .ic { width: 62%; height: 62%; stroke-width: 1.4; }
.bub-tl .bub-art { color: var(--rose); } .bub-bl .bub-art { color: #3d9a63; } .bub-tr .bub-art { color: #8d63c4; }
@container (max-width: 600px) {
  .bub-rows, .bub-art { display: none; }
  .bub { padding: calc(var(--su) * 20) calc(var(--su) * 10) 0; text-align: center; }
  .bub-t { font-size: calc(var(--su) * 22); padding: 0; }
  .stage .bub-lead { display: flex; justify-content: center; font-size: calc(var(--su) * 25); padding: 0; margin-block-start: calc(var(--su) * 10); }
  .tab { font-size: calc(var(--su) * 20); } .tab .ic { display: none; }
  .hex-l { font-size: calc(var(--su) * 17); } .hex-n { font-size: calc(var(--su) * 36); } .hex .ic { width: calc(var(--su) * 24); height: calc(var(--su) * 24); }
}

/* ---------- Tab bar (جوال) ---------- */
.tabbar { position: fixed; z-index: 20; inset-inline: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); height: 64px; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 24px;
  background: rgba(255, 255, 255, 0.9); border: 1px solid #fff; box-shadow: 0 18px 40px -14px rgba(122, 72, 108, 0.6); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.tabb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 44px; border-radius: 18px; font-size: 11px; font-weight: 500; color: var(--ink-2); }
.tabb .ic { width: 22px; height: 22px; }
.tabb.is-active { color: #fff; background: linear-gradient(120deg, #d77aa6, #b24f82); }

/* تابلت طولي: عمودان */
@media (min-width: 700px) {
  .scene { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding-inline: 24px; }
  .hd, .tools, .kpis, .stage, .demo { grid-column: 1 / -1; }
  .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } .kpi:first-child { grid-column: auto; } .kpi { padding-inline: 12px; gap: 8px; }
  .kpi-val { font-size: calc(var(--u) * 15); } .kpi-label { font-size: calc(var(--u) * 10.5); } .kpi-ic .ic { width: calc(var(--u) * 26); height: calc(var(--u) * 26); }
  .chip { flex: none; } .tools { justify-content: flex-end; flex-direction: row-reverse; }
}

/* ==========================================================================
   لوحة المرجع (ديسك توب / لابتوب / iPad عرضي): كل عنصر في موضعه من المرجع 1672×941
   ========================================================================== */
@media (min-width: 1024px) and (min-aspect-ratio: 5/4) {
  :root { --ux: calc(100vw / 1672); --uy: calc(100dvh / 941); --u: min(var(--ux), var(--uy)); }
  body { display: grid; place-items: center; overflow: hidden; }
  .scene { display: block; position: relative; max-width: none; padding: 0; margin: 0; width: 100vw; height: 100dvh;
    background: url('assets/plate-air.jpg') center / 100% 100% no-repeat; overflow: hidden; }
  .tabbar { display: none; }
  .kpis { display: contents; }
  .at { position: absolute; left: calc(var(--ux) * var(--x)); top: calc(var(--uy) * var(--y)); width: calc(var(--ux) * var(--w)); height: calc(var(--uy) * var(--h)); }
  .k1 { --x: 1281; --y: 90; --w: 204; --h: 65; } .k2 { --x: 1065; --y: 90; --w: 203; --h: 65; } .k3 { --x: 849; --y: 90; --w: 204; --h: 65; }
  .k4 { --x: 640; --y: 90; --w: 198; --h: 65; } .k5 { --x: 435; --y: 90; --w: 193; --h: 65; }
  .p-health { --x: 1237; --y: 175; --w: 248; --h: 272; } .p-plan { --x: 1237; --y: 460; --w: 248; --h: 228; }
  .p-progress { --x: 103; --y: 175; --w: 364; --h: 255; } .p-cash { --x: 103; --y: 442; --w: 364; --h: 258; }
  .p-news { --x: 1028; --y: 726; --w: 457; --h: 164; } .p-alerts { --x: 584; --y: 726; --w: 428; --h: 164; } .p-due { --x: 122; --y: 726; --w: 446; --h: 164; }
  .stage { --x: 470; --y: 185; --w: 770; --h: 515; } .hd { --x: 1010; --y: 6; --w: 472; --h: 72; } .tools { --x: 111; --y: 23; --w: 420; --h: 44; }
  .side { --x: 1522; --y: 153; --w: 148; --h: 470; } .demo { --x: 716; --y: 905; --w: 240; --h: 24; }

  /* الإطارات الزجاجية مخبوزة في المشهد؛ لا خلفيات CSS فوقها */
  .kpi, .panel { background: none; border: 0; box-shadow: none; border-radius: calc(var(--u) * 20); min-height: 0; }
  .kpi-label { white-space: nowrap; font-size: calc(var(--u) * 12); } .kpi-val { font-size: calc(var(--u) * 19); } .kpi-txt { flex: none; }
  .kpi:first-child { grid-column: auto; }
  .kpi { padding: 0 calc(var(--u) * 18); gap: calc(var(--u) * 12); }
  .panel { padding: calc(var(--u) * 11) calc(var(--u) * 14) 0; }
  .p-progress, .p-cash { padding-inline: calc(var(--u) * 12); }
  .p-news, .p-alerts, .p-due { padding: calc(var(--u) * 10) calc(var(--u) * 16) 0; }
  .ph { min-height: calc(var(--u) * 30); margin-block-end: calc(var(--u) * 5); }
  .more, .drop { min-height: 0; height: calc(var(--u) * 28); }

  .hd h1 { font-size: calc(var(--u) * 27); line-height: 1.5; } .hd p { font-size: calc(var(--u) * 12.5); }
  .tools { gap: calc(var(--ux) * 11.3); flex-direction: row; justify-content: flex-start; }
  .tool, .chip { min-width: 0; min-height: 0; background: none; border: 0; box-shadow: none; border-radius: calc(var(--u) * 12); }
  .tool { width: calc(var(--ux) * 44); height: calc(var(--uy) * 44); } .tool .ic { width: calc(var(--u) * 23); height: calc(var(--u) * 23); }
  .chip { flex: none; width: calc(var(--ux) * 142); height: calc(var(--uy) * 38); margin-inline-end: calc(var(--ux) * 55); padding-inline: calc(var(--u) * 14); gap: calc(var(--u) * 6); font-size: calc(var(--u) * 13); }
  .chip .ic { width: calc(var(--u) * 18); height: calc(var(--u) * 18); } .chip .ic.sm { width: calc(var(--u) * 14); height: calc(var(--u) * 14); }

  .side { display: flex; flex-direction: column; gap: calc(var(--u) * 8.300); }
  .side-link { display: flex; align-items: center; gap: calc(var(--u) * 14); height: calc(var(--u) * 38); padding-inline: calc(var(--u) * 6); font-size: calc(var(--u) * 13); font-weight: 600; color: var(--ink); white-space: nowrap; border-radius: calc(var(--u) * 19); flex: none; }
  .side-link .ic { width: calc(var(--u) * 25); height: calc(var(--u) * 25); stroke-width: 1.5; }
  .side-link.is-active { color: #fff; }
  .side-link:not(.is-active):hover { background: rgba(255, 255, 255, 0.6); }

  .rows { gap: calc(var(--u) * 2.500); }
  .tile-row .grow, .tile-row { white-space: nowrap; } .tile-row .grow { overflow: hidden; text-overflow: ellipsis; }
  .tile-row { font-size: calc(var(--u) * 12.800); }
  .tile-row { min-height: 0; height: calc(var(--u) * 30); padding-block: 0; }
  .p-news .tile-row, .p-alerts .tile-row, .p-due .tile-row { height: calc(var(--u) * 33); } .p-news .rows, .p-alerts .rows, .p-due .rows { gap: calc(var(--u) * 4); }
  .stat { min-height: 0; height: calc(var(--u) * 45); } .grid3 .stat { height: calc(var(--u) * 56); }
  .prow { min-height: 0; height: calc(var(--u) * 48); background: rgba(255, 255, 255, 0.55); }
  .chart { height: calc(var(--u) * 140); }
  .gauge-box { margin: calc(var(--u) * 4) auto calc(var(--u) * 8); width: calc(var(--u) * 196); }
  .demo { font-size: calc(var(--u) * 11.5); } .demo .ic { width: calc(var(--u) * 13); height: calc(var(--u) * 13); }

  .stage { aspect-ratio: auto; container-type: normal; background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
  .stage > * { --su: var(--u); }
  .bub-lead { display: none; }
  .kpi:hover, .bub:hover, .hex:hover, .tool:hover, .chip:hover { filter: brightness(0.82) saturate(1.3); }
  .tile-row:is(button):hover, .prow:hover, .stat:hover { border-color: var(--rose); }
}

/* ---------- Sheet / Inspector ---------- */
.sheet { border: 1px solid #fff; padding: 0; color: var(--ink); background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(250, 238, 245, 0.92)); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  box-shadow: 0 30px 80px -20px rgba(80, 40, 70, 0.6); width: min(430px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; inset-inline: auto 0; inset-block: 0; border-start-start-radius: 28px; border-end-start-radius: 28px; overflow: hidden; font-size: 14px; }
.sheet[open] { display: flex; flex-direction: column; animation: slide-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sheet::backdrop { background: rgba(52, 22, 58, 0.28); }
@keyframes slide-in { from { transform: translateX(-24px); } } @keyframes slide-up { from { transform: translateY(24px); } }
.sheet-grip { display: none; width: 40px; height: 5px; border-radius: 99px; background: rgba(160, 120, 150, 0.4); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(16px + env(safe-area-inset-top)) 20px 8px; }
.sheet-head h2 { font-size: 18px; font-weight: 700; }
.sheet-x { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #fff; border: 1px solid var(--line); } .sheet-x .ic { width: 20px; height: 20px; }
.sheet-body { padding: 4px 20px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.sheet-body h3 { font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin: 16px 0 6px; }
.sheet-big { font-size: 30px; font-weight: 700; color: var(--rose-d); line-height: 1.3; unicode-bidi: plaintext; text-align: right; }
.formula { padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.calc { margin-block-start: 8px; } .calc li { display: flex; align-items: baseline; gap: 8px; padding: 8px 4px; border-block-end: 1px solid var(--line); }
.calc .op { width: 1.1em; text-align: center; color: var(--ink-3); font-weight: 700; } .calc .cv { font-weight: 600; white-space: nowrap; unicode-bidi: plaintext; font-variant-numeric: tabular-nums; }
.calc .total { font-weight: 700; border-block-end: 0; } .calc .total .cv { color: var(--rose-d); font-weight: 700; }
.src { display: flex; flex-wrap: wrap; gap: 6px; } .src code { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font: 12.5px ui-monospace, Consolas, monospace; }
.later { display: flex; gap: 8px; margin-block-start: 16px; padding: 10px 12px; border-radius: 12px; background: rgba(203, 168, 109, 0.18); border: 1px dashed rgba(160, 120, 40, 0.5); font-size: 13px; color: var(--ink-2); }
.later .ic { width: 18px; height: 18px; color: var(--gold); margin-block-start: 2px; }
@media not ((min-width: 1024px) and (min-aspect-ratio: 5/4)) {
  @media (max-width: 699px) {
    .sheet { width: 100vw; height: auto; max-height: 86dvh; inset-inline: 0; inset-block: auto 0; border-radius: 28px 28px 0 0; }
    .sheet[open] { animation-name: slide-up; } .sheet-grip { display: block; } .sheet-head { padding-block-start: 10px; }
  }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .tabbar { display: none; } }
