﻿/* =========================================================
   Rubiko design language — tokens + shared primitives
   Source of truth for index.html (sample) and components.html (kit).
   Reference: ref/reference.png · brief: ref/brief.md
   ========================================================= */

@font-face { font-family: "Vazirmatn"; src: url(fonts/Vazirmatn-wght.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
/* Poppins only for Latin glyphs; Persian falls through to Vazirmatn */
@font-face { font-family: "Poppins"; src: url(fonts/Poppins-400.woff2) format("woff2"); font-weight: 400; unicode-range: U+0041-005A, U+0061-007A, U+0030-0039, U+0040, U+0025; }
@font-face { font-family: "Poppins"; src: url(fonts/Poppins-500.woff2) format("woff2"); font-weight: 500; unicode-range: U+0041-005A, U+0061-007A, U+0030-0039, U+0040, U+0025; }
@font-face { font-family: "Poppins"; src: url(fonts/Poppins-600.woff2) format("woff2"); font-weight: 600 700; unicode-range: U+0041-005A, U+0061-007A, U+0030-0039, U+0040, U+0025; }

:root {
  /* ---- colour (sampled) ---- */
  --ink: #222224;          /* shell, dark cards, primary buttons */
  --ink-2: #2e2e31;        /* hover on dark */
  --ink-3: #4c4c4e;        /* pills on dark */
  --well: #e2e2e2;         /* content area */
  --card: #ffffff;
  --track: #f1f1f1;
  --lime: #daf165;
  --lime-2: #cfe74f;       /* pressed lime */
  --lime-soft: #eef8c3;
  --lavender: #bbb2f5;
  --lav-2: #a79cf0;
  --lav-soft: #dcd7fb;
  --lav-faint: #efedfd;
  --backdrop: #dcea95;     /* presentation only (hero, frames) */

  /* ---- text ---- */
  --text: #1c1c1e;
  --text-2: #3a3a3e;
  --muted: #77777c;        /* darkened from #b8b8b8 for contrast */
  --muted-2: #a3a3a8;
  --on-dark: #f4f4f5;
  --on-dark-muted: #9a9aa0;
  --line: #ececee;
  --line-2: #dcdce0;

  /* ---- semantic (designed, muted) ---- */
  --ok: #2f7d4c;   --ok-bg: #e3f4e8;
  --warn: #9a6200; --warn-bg: #fdf0d2;
  --danger: #c4433a; --danger-bg: #fbe3e0;
  --info: #5b4fc4; --info-bg: var(--lav-faint);

  /* ---- type ---- */
  --font: "Poppins", "Vazirmatn", system-ui, sans-serif;
  --fs-display: 44px; --fs-h1: 30px; --fs-h2: 20px; --fs-title: 16px;
  --fs-body: 14px; --fs-cap: 12px; --fs-micro: 11px;

  /* ---- shape ---- */
  --r-shell: 28px; --r-card: 22px; --r-inner: 16px; --r-input: 14px; --r-sm: 10px; --r-pill: 999px;
  --sh-float: 0 18px 40px -18px rgb(0 0 0 / .28), 0 2px 8px -2px rgb(0 0 0 / .08);
  --sh-pop: 0 24px 60px -20px rgb(0 0 0 / .35);
  --ring: 0 0 0 3px rgb(187 178 245 / .55);

  /* ---- space ---- */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --gutter: 20px;

  /* ---- motion ---- */
  --ease-ios: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.36, .64, 1);
  --spring-soft: cubic-bezier(.3, 1.15, .6, 1);
  --spring-pop: cubic-bezier(.34, 1.56, .64, 1);
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring-soft: linear(0, .009, .035 2.1%, .141 4.4%, .281 6.7%, .723 12.9%, .938 16.7%, 1.017 19.4%, 1.051 21.9%, 1.06 24.4%, 1.051 27.4%, 1.018 33.8%, 1.002 40.4%, .997 48%, 1);
    --spring: linear(0, .006, .025 2.8%, .101 6.1%, .539 18.9%, .721 25.3%, .849 31.5%, .937 38.1%, .968 41.8%, .991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.9%, 1);
    --spring-pop: linear(0, .013 .6%, .05 1.2%, .2 2.6%, .419 4.3%, .817 7.8%, 1.002 9.9%, 1.105 11.9%, 1.162 14%, 1.172 15.9%, 1.141 18.6%, 1.035 24.8%, .986 29.1%, .968 33.6%, .977 39%, 1.003 49.4%, 1.006 54.8%, 1);
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; transition-delay: 0s !important; }
}

/* =================== base =================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-body); line-height: 1.7; color: var(--text);
  background: var(--well); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: none; box-shadow: var(--ring); }
::selection { background: var(--lime); color: var(--ink); }
.num { font-feature-settings: "ss01"; letter-spacing: -.02em; }
.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; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; } .ic.lg { width: 24px; height: 24px; }
[dir="rtl"] .ic.flip { transform: scaleX(-1); }

/* press feedback — everything tappable */
.press { transition: transform .35s var(--spring-soft), background-color .2s, color .2s, box-shadow .2s, opacity .2s; }
.press:active { transform: scale(.955); transition-duration: .12s; transition-timing-function: var(--ease-out); }

/* staggered entrance */
.rise { opacity: 0; transform: translateY(18px); }
.is-ready .rise { opacity: 1; transform: none; transition: opacity .8s var(--ease-out), transform 1s var(--spring);
  transition-delay: calc(var(--i, 0) * 70ms + 120ms); }
.is-settled .rise { transition-delay: 0s; }
.is-ready .press.rise:active { transform: scale(.955); transition: transform .12s var(--ease-out) 0s; }

/* =================== cards =================== */
.card { background: var(--card); border-radius: var(--r-card); padding: 18px 20px 20px; position: relative; min-width: 0; }
.card.dark { background: var(--ink); color: var(--on-dark); }
.card.lime { background: var(--lime); color: var(--ink); }
.card.lav { background: var(--lavender); color: var(--ink); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h3 { font-size: 15px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--track); flex: none; }
.card.dark .icon-dot { background: var(--ink-3); color: var(--on-dark); }
.more { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--muted-2); margin-inline-end: -6px; }
.more:hover { background: var(--track); color: var(--text); }
.card.dark .more:hover { background: var(--ink-3); color: var(--on-dark); }

/* big number + unit + delta chip */
.big { display: flex; align-items: baseline; gap: 6px; line-height: 1; }
.big b { font-size: 36px; font-weight: 600; letter-spacing: -.02em; }
.big small { font-size: 12px; color: var(--muted); font-weight: 500; }
.card.dark .big small { color: var(--on-dark-muted); }
.delta { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-pill);
  background: var(--lime); color: var(--ink); font-size: 11px; font-weight: 600; align-self: flex-start; transform: translateY(-14px); direction: ltr; unicode-bidi: isolate; }
.delta.down { background: var(--danger-bg); color: var(--danger); }
.side-stat { margin-inline-start: auto; text-align: end; font-size: 12px; line-height: 1.4; color: var(--text-2); }
.side-stat span { display: block; color: var(--muted); font-size: 11px; }

/* =================== buttons =================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  border-radius: var(--r-pill); font-weight: 600; font-size: 14px; white-space: nowrap; position: relative;
  transition: transform .35s var(--spring-soft), background-color .2s, color .2s, box-shadow .2s, opacity .2s; }
.btn:active { transform: scale(.955); transition-duration: .12s; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #333336; }
.btn-lime { background: var(--lime); color: var(--ink); }
.btn-lime:hover { background: var(--lime-2); }
.btn-lav { background: var(--lavender); color: var(--ink); }
.btn-lav:hover { background: var(--lav-2); }
.btn-secondary { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn-secondary:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { background: var(--track); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .38; pointer-events: none; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.card.dark .btn-secondary, .on-dark .btn-secondary { background: var(--ink-3); color: var(--on-dark); box-shadow: none; }

/* round icon button (bell / search) */
.round { width: 44px; height: 44px; border-radius: 50%; background: var(--card); display: grid; place-items: center; position: relative; }
.round .pip { position: absolute; top: 9px; inset-inline-end: 10px; min-width: 9px; height: 9px; border-radius: 9px; background: var(--lime);
  box-shadow: 0 0 0 2px var(--card); }

/* =================== chips, badges, pills =================== */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--card); font-size: 13px; font-weight: 500; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; box-shadow: none; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px;
  background: var(--lime); color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--track); color: var(--text-2); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.warn { background: var(--warn-bg); color: var(--warn); }
.status.danger { background: var(--danger-bg); color: var(--danger); }
.status.info { background: var(--info-bg); color: var(--info); }
.status.lime { background: var(--lime-soft); color: #556400; }
.status.dark { background: var(--ink); color: #fff; }
.status.plain::before { display: none; }

.select-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border-radius: var(--r-pill);
  background: var(--card); font-weight: 600; font-size: 13px; }
.card.dark .select-pill, .on-dark .select-pill { background: var(--ink-3); color: var(--on-dark); }

/* =================== avatar =================== */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--lavender); display: grid; place-items: center;
  font-weight: 700; color: var(--ink); flex: none; font-size: 14px; overflow: hidden; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.lime { background: var(--lime); } .avatar.dark { background: var(--ink); color: #fff; } .avatar.grey { background: var(--track); }
.avatars { display: flex; } .avatars .avatar { box-shadow: 0 0 0 2px var(--card); }
.avatars .avatar + .avatar { margin-inline-start: -10px; }

/* =================== inputs =================== */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input { height: 46px; width: 100%; border: 0; border-radius: var(--r-input); background: var(--track); padding: 0 14px;
  font-size: 14px; outline: none; transition: box-shadow .2s, background-color .2s; }
.input::placeholder { color: var(--muted-2); }
.input:hover { background: #ebebed; }
.input:focus { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--ink); }
textarea.input { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; line-height: 1.7; }
.help { font-size: 12px; color: var(--muted); }
.field.error .input { background: var(--danger-bg); box-shadow: inset 0 0 0 1.5px var(--danger); }
.field.error .help { color: var(--danger); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .ic { position: absolute; inset-inline-start: 14px; color: var(--muted); pointer-events: none; }
.input-wrap .input { padding-inline-start: 42px; }
.input-wrap .suffix { position: absolute; inset-inline-end: 14px; font-size: 12px; color: var(--muted); font-weight: 600; }
.search { height: 44px; border-radius: var(--r-pill); background: var(--card); display: flex; align-items: center; gap: 10px; padding: 0 16px; min-width: 0; }
.search input { border: 0; outline: 0; background: none; width: 100%; font-size: 13px; }
.search input::placeholder { color: var(--muted-2); }

/* =================== progress =================== */
.bar { height: 10px; border-radius: 10px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; width: var(--v, 50%); border-radius: inherit; background: var(--lavender);
  transform-origin: right; transition: width 1s var(--spring); }
.bar.ink > i { background: var(--ink); } .bar.lime > i { background: var(--lime); }
.prog-row { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 8px; }
.prog-row .big b { font-size: 26px; }
.prog-row .tag { justify-self: end; font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.prog-row .tag::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--lavender)); }
.prog-row .bar { grid-column: 1 / -1; margin-top: 2px; }

/* =================== signature: bubble trio =================== */
.bubbles { position: relative; width: 100%; max-width: 300px; aspect-ratio: 1 / .78; margin-inline: auto; }
.bubbles .b { position: absolute; border-radius: 50%; display: grid; place-content: center; text-align: center; line-height: 1.1;
  transform: scale(0); transition: transform .9s var(--spring-pop); }
.bubbles .b b { font-size: clamp(20px, 3vw, 30px); font-weight: 600; letter-spacing: -.02em; }
.bubbles .b small { font-size: 11px; opacity: .75; margin-top: 4px; }
.bubbles .b1 { width: 58%; aspect-ratio: 1; background: var(--lavender); color: var(--ink); top: 2%; inset-inline-start: 2%; }
.bubbles .b2 { width: 46%; aspect-ratio: 1; background: var(--ink); color: #fff; top: 8%; inset-inline-end: 2%; }
.bubbles .b2 b { font-size: clamp(16px, 2.4vw, 24px); }
.bubbles .b3 { width: 36%; aspect-ratio: 1; background: var(--lime); color: var(--ink); bottom: 0; inset-inline-start: 34%; box-shadow: 0 0 0 4px var(--card); }
.bubbles .b3 b { font-size: clamp(15px, 2vw, 21px); }
.is-ready .bubbles .b, .bubbles.show .b { transform: scale(1); }
.bubbles .b2 { transition-delay: .12s; } .bubbles .b3 { transition-delay: .24s; }
.bubbles .b:hover { transform: scale(1.04); transition: transform .45s var(--spring-soft); z-index: 2; }
.bubbles.live .b1 { animation: breathe 6s var(--ease-in-out) 1.2s infinite alternate; }
.bubbles.live .b2 { animation: breathe 7s var(--ease-in-out) 1.4s infinite alternate-reverse; }
@keyframes breathe { to { scale: 1.03; translate: 0 -3px; } }

/* =================== signature: hatched bars =================== */
.hbars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 6px; height: 170px; position: relative; }
.hbars .grp { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 100%; position: relative; cursor: default; }
.hbars .hb { width: min(18px, 42%); border-radius: 12px; height: var(--h, 50%);
  background: repeating-linear-gradient(135deg, #3a3a3d 0 2px, transparent 2px 6px); box-shadow: inset 0 0 0 1px #343437;
  transform: scaleY(0); transform-origin: bottom; transition: transform 1s var(--spring); transition-delay: calc(var(--i, 0) * 50ms + 200ms); }
.hbars .grp.on .hb:first-child { background: var(--lime); box-shadow: none; }
.hbars .grp.on .hb:last-child { background: var(--lavender); box-shadow: none; }
.is-ready .hbars .hb, .hbars.show .hb { transform: scaleY(1); }
.hbars .grp:hover .hb { box-shadow: inset 0 0 0 1px #6a6a6e; }
.hbars-x { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--on-dark-muted); text-align: center; }
.hbars-x .on { color: #fff; font-weight: 600; }
.legend-bar { display: flex; gap: 10px; align-items: flex-start; }
.legend-bar::before { content: ""; width: 6px; height: 30px; border-radius: 6px; background: var(--c, var(--lime)); margin-top: 3px; }
.legend-bar .big b { font-size: 30px; }
.legend-bar p { font-size: 11px; color: var(--on-dark-muted); margin-top: 6px; }

/* =================== signature: dot matrix =================== */
.dots { display: grid; grid-template-columns: repeat(var(--cols, 12), 1fr); gap: 5px; direction: ltr; }
.dots i { aspect-ratio: 1; border-radius: 50%; background: var(--lav-faint); transform: scale(0); transition: transform .6s var(--spring-pop);
  transition-delay: calc(var(--d, 0) * 1ms); }
.dots i.l1 { background: var(--lav-faint); } .dots i.l2 { background: var(--lav-soft); } .dots i.l3 { background: #c9c2f8; } .dots i.l4 { background: var(--lav-2); }
.dots i.l0 { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.dots i.x { background: var(--danger-bg); }
.is-ready .dots i, .dots.show i { transform: scale(1); }
.dots i:hover { transform: scale(1.35); transition-duration: .25s; transition-delay: 0s; }

/* =================== tooltip (shared, JS-positioned) =================== */
.tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; font-weight: 500;
  padding: 7px 11px; border-radius: 10px; line-height: 1.5; white-space: nowrap; opacity: 0; transform: translate(-50%, -100%) translateY(-4px) scale(.94);
  transition: opacity .18s var(--ease-out), transform .3s var(--spring-soft); box-shadow: var(--sh-float); }
.tip.show { opacity: 1; transform: translate(-50%, -100%) translateY(-10px); }
.tip b { color: var(--lime); font-weight: 700; }

/* =================== popover / menu =================== */
.pop-anchor { position: relative; display: inline-flex; }
.pop { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60; min-width: 190px; background: var(--card); color: var(--text);
  border-radius: 18px; padding: 6px; box-shadow: var(--sh-pop); opacity: 0; transform: scale(.92) translateY(-4px); transform-origin: top left;
  pointer-events: none; transition: opacity .18s var(--ease-out), transform .35s var(--spring-soft); }
[dir="rtl"] .pop { transform-origin: top left; }
.pop.show { opacity: 1; transform: none; pointer-events: auto; }
.pop.up { top: auto; bottom: calc(100% + 8px); transform-origin: bottom left; }
.pop.start { inset-inline-end: auto; inset-inline-start: 0; transform-origin: top right; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 12px; font-size: 13px; font-weight: 500; text-align: start; }
.menu-item:hover, .menu-item:focus-visible { background: var(--track); }
.menu-item.on { font-weight: 700; }
.menu-item.on::after { content: ""; margin-inline-start: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 8px; }
.menu-label { font-size: 11px; color: var(--muted); padding: 6px 12px 2px; font-weight: 600; }

/* =================== segmented =================== */
.seg { position: relative; display: inline-flex; background: var(--track); border-radius: var(--r-pill); padding: 4px; }
.seg button { position: relative; z-index: 1; height: 34px; padding: 0 16px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--muted); transition: color .25s; white-space: nowrap; }
.seg button.on { color: var(--ink); }
.seg .thumb { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: var(--r-pill); background: var(--card); box-shadow: 0 2px 8px -2px rgb(0 0 0 / .15);
  transition: transform .45s var(--spring-soft), width .45s var(--spring-soft); }
.seg.dark { background: #19191b; } .seg.dark button { color: var(--on-dark-muted); } .seg.dark button.on { color: var(--ink); } .seg.dark .thumb { background: var(--lime); }

/* =================== app shell (desktop) =================== */
.app { display: grid; grid-template-columns: 220px 1fr; gap: 10px; min-height: 100vh; padding: 10px; background: var(--ink); }
.side { color: var(--on-dark); display: flex; flex-direction: column; padding: 18px 10px 10px; gap: 6px; min-height: 0;
  position: sticky; top: 10px; height: calc(100vh - 20px); overflow-y: auto; scrollbar-width: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 16px; font-weight: 800; font-size: 19px; }
.logo { width: 30px; height: 26px; position: relative; flex: none; }
.logo i { position: absolute; border-radius: 50%; }
.logo i:nth-child(1) { width: 18px; height: 18px; background: var(--lavender); top: 0; right: 0; }
.logo i:nth-child(2) { width: 14px; height: 14px; background: #fff; top: 2px; left: 2px; }
.logo i:nth-child(3) { width: 12px; height: 12px; background: var(--lime); bottom: 0; left: 10px; box-shadow: 0 0 0 2px var(--ink); }
.nav { display: grid; gap: 2px; }
.nav-label { font-size: 11px; color: var(--on-dark-muted); padding: 12px 14px 4px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; border-radius: var(--r-pill); color: #d8d8dc; font-weight: 500; font-size: 13.5px; position: relative; }
.nav-item:hover { background: var(--ink-2); color: #fff; }
.nav-item.on { background: #fff; color: var(--ink); font-weight: 700; }
.nav-item .badge { margin-inline-start: auto; }
.nav-item.locked { opacity: .45; }
.side-promo { margin-top: auto; background: var(--lime); color: var(--ink); border-radius: var(--r-card); padding: 16px; display: grid; gap: 10px; position: relative; overflow: hidden; }
.side-promo h4 { font-size: 16px; font-weight: 800; }
.side-promo p { font-size: 12px; color: #3d4410; line-height: 1.6; max-width: 15ch; }
.well { background: var(--well); border-radius: var(--r-shell); padding: 22px 26px 26px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { display: block; font-size: 13.5px; line-height: 1.3; }
.who span { font-size: 11.5px; color: var(--muted); }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin: 14px 0 18px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(26px, 3.2vw, 42px); font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.page-head p { font-size: 12.5px; color: var(--muted); }
.page-head .date { margin-inline-start: auto; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 12px; }

/* mobile tab bar */
.tabbar { position: fixed; inset-inline: 12px; bottom: 12px; z-index: 50; height: 66px; background: var(--ink); border-radius: 26px; display: none;
  align-items: center; justify-content: space-around; padding: 0 8px; box-shadow: var(--sh-float); }
.tab { display: grid; justify-items: center; gap: 2px; color: var(--on-dark-muted); font-size: 10.5px; font-weight: 600; padding: 6px 10px; border-radius: 18px; position: relative; }
.tab.on { color: var(--ink); background: var(--lime); }
.tab .badge { position: absolute; top: 0; inset-inline-end: 2px; min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; box-shadow: 0 0 0 2px var(--ink); }

/* =================== table =================== */
.table-wrap { overflow-x: auto; overflow-y: hidden; border-radius: var(--r-inner); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th { text-align: start; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .2s; }
.table tbody tr:hover { background: #fafafa; }
.table tbody tr.sel { background: var(--lime-soft); }

/* =================== checkbox / switch =================== */
.check { width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--line-2); display: inline-grid; place-items: center;
  background: var(--card); flex: none; transition: background-color .2s, box-shadow .2s; cursor: pointer; appearance: none; margin: 0; position: relative; }
.check::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--ink); border-top: 0; border-right: 0; transform: rotate(-45deg) scale(0);
  margin-top: -3px; transition: transform .35s var(--spring-pop); }
.check:checked { background: var(--lime); box-shadow: none; }
.check:checked::after { transform: rotate(-45deg) scale(1); }
.switch { appearance: none; margin: 0; width: 46px; height: 28px; border-radius: 28px; background: var(--line-2); position: relative; cursor: pointer; transition: background-color .25s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / .2); transition: transform .45s var(--spring-soft), width .2s; }
.switch:checked { background: var(--ink); }
.switch:checked::after { transform: translateX(-18px); background: var(--lime); }
.switch:active::after { width: 27px; }
.switch:checked:active::after { transform: translateX(-13px); }
.switch:disabled { opacity: .4; cursor: default; }

/* =================== list rows =================== */
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; min-width: 0; }
.row + .row { border-top: 1px solid var(--line); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 13.5px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* =================== responsive shell =================== */
@media (max-width: 1023px) {
  .app { grid-template-columns: 76px 1fr; }
  .side .brand span, .side .nav-item span, .side .nav-item .badge, .side .nav-label, .side .side-promo, .side .mod-switch { display: none; }
  .side .nav-item { justify-content: center; padding: 0; width: 52px; margin-inline: auto; }
  .side .brand { justify-content: center; padding-inline: 0; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .app { display: block; padding: 0; background: var(--well); }
  .side { display: none; }
  .well { border-radius: 0; padding: 14px var(--gutter) 100px; }
  .tabbar { display: flex; }
  .page-head h1 { font-size: 24px; }
}



