@charset "UTF-8";
/*
 * TrilùTable 6.0 · design system «Scuro premium» (docs/sviluppo/DESIGN-V6.md). Owner: SHELL.
 * 1 fonts · 2 tokens · 3 base · 4 components · 5 app shell · 6 sign-in · 7 responsive · 8 motion.
 * Token and class names are a contract shared by every console module: keep them stable.
 */

/* ───────────────────────────── 1. Fonts (self-hosted Geist) ───────────────────────────── */
@font-face { font-family: "Geist"; src: url("fonts/geist-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ───────────────────────────── 2. Tokens ───────────────────────────── */
:root {
  color-scheme: dark;
  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Surfaces: canvas → panel → raised → control → hover */
  --bg-0: #0B0C0E;
  --bg-1: #111316;
  --bg-2: #16191D;
  --bg-3: #1C1F24;
  --bg-4: #23272D;
  /* Hairlines */
  --line: rgba(255, 255, 255, .07);
  --line-soft: rgba(255, 255, 255, .05);
  --line-strong: rgba(255, 255, 255, .11);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .035);
  /* Text (text-4 only for disabled / decoration) */
  --text-1: #EDEEF0;
  --text-2: #A4A9B1;
  --text-3: #878C94;
  --text-4: #5F646B;
  /* Brand accent: primary action, active nav marker, key highlight only */
  --accent: #FF833F;
  --accent-hover: #FF9A5E;
  --accent-ink: #1A0E06;
  --accent-soft: rgba(255, 131, 63, .12);
  --accent-line: rgba(255, 131, 63, .32);
  /* Status */
  --green: #6CD49E;  --green-soft: rgba(108, 212, 158, .10);  --green-line: rgba(108, 212, 158, .24);
  --amber: #E8B65A;  --amber-soft: rgba(232, 182, 90, .10);   --amber-line: rgba(232, 182, 90, .26);
  --red: #F0918A;    --red-soft: rgba(240, 145, 138, .10);    --red-line: rgba(240, 145, 138, .26);
  --blue: #7FB0F2;   --blue-soft: rgba(127, 176, 242, .10);   --blue-line: rgba(127, 176, 242, .24);
  --violet: #B3A3F7; --violet-soft: rgba(179, 163, 247, .10); --violet-line: rgba(179, 163, 247, .24);
  --grey: #8A9099;   --grey-soft: rgba(138, 144, 153, .12);   --grey-line: rgba(138, 144, 153, .24);
  /* Radii, spacing, elevation, layers, motion */
  --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 14px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-pop: 0 18px 60px rgba(0, 0, 0, .55), 0 0 0 1px var(--line-strong);
  --z-nav: 30; --z-drawer: 40; --z-modal: 50; --z-toast: 60;
  --ease: cubic-bezier(.2, .7, .2, 1); --t-fast: 140ms; --t-med: 220ms;
  /* Layout (shell) */
  --sidebar-w: 248px;
  --topbar-h: 56px;
  --frame-gap: 8px;
  --sticky-top: calc(var(--frame-gap) + var(--topbar-h)); /* first free line below the sticky top bar */
  --page-max: 1480px;
  --control-h: 36px;
  /* Legacy aliases: console modules written before 6.0 read these names. */
  --bg: var(--bg-0);
  --surface: var(--bg-2);
  --surface-2: var(--bg-3);
  --surface-3: var(--bg-4);
  --text: var(--text-1);
  --muted: var(--text-2);
  --radius: 12px;
}

/* ───────────────────────────── 3. Base ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--sticky-top) + 12px); }
body {
  margin: 0; min-width: 320px;
  background: var(--bg-0); color: var(--text-1);
  font-family: var(--font); font-size: 14px; line-height: 20px;
  font-synthesis: none; text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, figure, blockquote { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
h1 { letter-spacing: -.02em; }
p { line-height: 1.55; }
img, svg, video, canvas { max-width: 100%; }
input, select, textarea { min-width: 0; }
hr { height: 1px; margin: 16px 0; border: 0; background: var(--line); }
[hidden] { display: none !important; }
::selection { background: rgba(255, 131, 63, .32); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
svg.icon { flex: none; vertical-align: middle; pointer-events: none; }
button > span[data-icon], a > span[data-icon] { display: inline-flex; }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 10px; background: rgba(255, 255, 255, .14) padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .22); }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }

/* Utilities */
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 200; transform: translateY(-160%); padding: 10px 16px; border-radius: var(--r-md); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.skip-link:focus { transform: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.truncate { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.eyebrow { display: block; margin: 0 0 6px; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0; color: var(--text-3); }
.sep { margin: 0 6px; color: var(--text-4); }
.ordn { font-size: .68em; line-height: 0; vertical-align: .5em; margin-left: .5px; font-weight: 500; } /* Italian ordinals: 1<span class="ordn">a</span> */
.brand-logo { display: block; max-width: 100%; height: auto; }
.list-reset { margin: 0; padding: 0; list-style: none; }

/* ───────────────────────────── 4. Components ───────────────────────────── */

/* Buttons */
.btn {
  --btn-h: var(--control-h);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-h); min-height: var(--btn-h); padding: 0 14px; border: 0; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none; user-select: none;
  color: var(--text-1); background: var(--bg-3);
  box-shadow: inset 0 0 0 1px var(--line-strong), inset 0 1px 0 rgba(255, 255, 255, .05), var(--shadow-1);
  transition: background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn:hover { background: var(--bg-4); }
.btn:active:not(:disabled) { transform: translateY(.5px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn .icon { flex: none; }
.btn-primary {
  color: var(--accent-ink); background: var(--accent); font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 131, 63, .5);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { color: var(--text-1); background: var(--bg-3); }
.btn-ghost { color: var(--text-2); background: transparent; box-shadow: none; }
.btn-ghost:hover { color: var(--text-1); background: rgba(255, 255, 255, .05); }
.btn-danger { color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red-line); }
.btn-danger:hover { background: rgba(240, 145, 138, .17); }
.btn-sm { --btn-h: 28px; padding: 0 10px; gap: 6px; font-size: 13px; border-radius: 7px; }
.btn-lg { --btn-h: 44px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--btn-h); padding: 0; }
.btn .ico-ok { color: var(--green); }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); border-top-color: var(--text-1); animation: spin .8s linear infinite; }
.btn-primary.is-loading::after { border-color: rgba(26, 14, 6, .25); border-top-color: var(--accent-ink); }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--r-md);
  color: var(--text-2); background: transparent; box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--text-1); background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line-strong); }
.icon-btn.is-ghost { box-shadow: none; }
.icon-btn[aria-pressed="true"], .icon-btn[aria-expanded="true"] { color: var(--text-1); background: rgba(255, 255, 255, .06); }
.text-button { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0; border: 0; background: none; color: var(--text-2); font-size: 13px; font-weight: 500; }
.text-button:hover { color: var(--text-1); }
.link { color: var(--text-1); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .25); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--text-1); }

/* Card, panel, rows */
.card {
  min-width: 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--highlight), 0 1px 2px rgba(0, 0, 0, .25);
}
.panel {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--highlight), 0 1px 2px rgba(0, 0, 0, .25);
}
.panel.is-flat { box-shadow: none; }
.panel-header { min-height: 48px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--line-soft); }
.panel-header.no-border { border-bottom: 0; }
.panel-title { flex: 0 1 auto; min-width: 0; margin: 0; font-size: 15px; line-height: 20px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-sub { flex: 0 1000 auto; min-width: 0; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-header > .count, .panel-header > .pill, .panel-header > .tag { flex: none; }
.panel-link {
  flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 2px; min-height: 28px; padding: 0 2px 0 6px; border: 0; border-radius: 6px;
  background: none; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.panel-link .icon { color: var(--text-3); transition: transform var(--t-fast) var(--ease); }
.panel-link:hover { color: var(--text-1); }
.panel-link:hover .icon { color: var(--text-2); transform: translateX(1px); }
.panel-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.panel-body { padding: 16px; min-width: 0; }
.panel-footer { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.panel-list { margin: 0; padding: 4px 0; list-style: none; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px;
  color: inherit; text-align: left;
}
.panel-list > .row + .row::before, .panel-list > li + li > .row::before, .row + .row.has-separator::before, .rows > .row + .row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px; background: var(--line-soft);
}
a.row, button.row, .row.is-interactive { cursor: pointer; transition: background-color var(--t-fast) var(--ease); }
button.row { width: 100%; border: 0; background: none; font: inherit; }
a.row:hover, button.row:hover, .row.is-interactive:hover { background: rgba(255, 255, 255, .025); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.row-end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

/* KPI strip */
.kpi-strip {
  display: grid; grid-template-columns: repeat(var(--kpi-cols, 4), minmax(0, 1fr));
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--highlight), 0 1px 2px rgba(0, 0, 0, .25);
}
.kpi { position: relative; min-width: 0; padding: 16px 20px; }
.kpi + .kpi::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 1px; background: var(--line); }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-label .icon { color: var(--text-3); }
.kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-width: 0; }
.kpi-value { margin-top: 8px; display: flex; align-items: baseline; gap: 5px; font-size: 28px; line-height: 32px; font-weight: 600; letter-spacing: -.03em; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-1); }
.kpi-value.is-muted { color: var(--text-3); }
.kpi-unit { font-size: 16px; font-weight: 500; letter-spacing: -.01em; color: var(--text-3); }
.kpi-value .cur { font-size: 20px; font-weight: 500; color: var(--text-2); margin-right: 1px; }
.kpi-value .dec { font-size: 20px; font-weight: 500; color: var(--text-2); letter-spacing: -.02em; margin-left: -5px; }
.kpi-foot { margin-top: 10px; min-height: 18px; display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; color: var(--text-3); white-space: nowrap; overflow: hidden; }
.kpi-pct { font-size: 13px; font-weight: 500; color: var(--text-2); }
.meter { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.meter > span { display: block; height: 100%; max-width: 100%; border-radius: 2px; background: linear-gradient(90deg, #C9CCD1, #EDEEF0); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 500; color: var(--text-2); }
.delta.is-up, .delta.good { color: var(--green); }
.delta.is-down, .delta.bad { color: var(--red); }
.attn { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--amber); }
.spark { flex: none; margin-bottom: 2px; }

/* Pills (status), tags, counts, chips of tables, keys, dots */
.pill {
  --pill-c: var(--text-2); --pill-bg: rgba(255, 255, 255, .045); --pill-line: rgba(255, 255, 255, .08);
  display: inline-flex; align-items: center; gap: 6px; height: 22px; max-width: 100%; padding: 0 8px; border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 500; line-height: 1; white-space: nowrap; vertical-align: middle;
  color: var(--pill-c); background: var(--pill-bg); box-shadow: inset 0 0 0 1px var(--pill-line);
}
.pill::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.pill:not(.is-green):not(.is-amber):not(.is-red):not(.is-blue):not(.is-violet):not(.is-accent)::before { background: var(--text-3); }
.pill.no-dot::before { display: none; }
.pill .icon { margin: 0 -1px 0 -2px; }
.pill.is-green { --pill-c: var(--green); --pill-bg: var(--green-soft); --pill-line: var(--green-line); }
.pill.is-amber { --pill-c: var(--amber); --pill-bg: var(--amber-soft); --pill-line: var(--amber-line); }
.pill.is-red { --pill-c: var(--red); --pill-bg: var(--red-soft); --pill-line: var(--red-line); }
.pill.is-blue { --pill-c: var(--blue); --pill-bg: var(--blue-soft); --pill-line: var(--blue-line); }
.pill.is-violet { --pill-c: var(--violet); --pill-bg: var(--violet-soft); --pill-line: var(--violet-line); }
.pill.is-grey { --pill-c: var(--text-2); --pill-bg: var(--grey-soft); --pill-line: var(--grey-line); }
.pill.is-accent { --pill-c: var(--accent); --pill-bg: var(--accent-soft); --pill-line: var(--accent-line); }
.pill.is-lg { height: 26px; padding: 0 10px; font-size: 13px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  color: var(--text-2); background: rgba(255, 255, 255, .045); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.badge-orange { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.badge-green { color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green-line); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; max-width: 100%; padding: 0 7px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-2); background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.tag .icon { color: var(--text-3); }
.tag.is-sm { height: 18px; padding: 0 5px 0 4px; gap: 4px; border-radius: 5px; }
.count {
  display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 500; line-height: 20px; font-variant-numeric: tabular-nums;
  color: var(--text-2); background: rgba(255, 255, 255, .055);
}
.count.is-accent { color: var(--accent); background: var(--accent-soft); }
.count.is-amber { color: var(--amber); background: var(--amber-soft); }
.count.is-red { color: var(--red); background: var(--red-soft); }
.tchip {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 24px; min-width: 34px; max-width: 100%; padding: 0 7px; border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09);
}
.tchip.is-empty { font-weight: 500; color: var(--text-3); background: none; box-shadow: none; outline: 1px dashed rgba(255, 255, 255, .16); outline-offset: -1px; }
.kbd {
  display: inline-flex; align-items: center; gap: 1px; height: 20px; padding: 0 5px; border-radius: 5px;
  font: 500 12px/20px var(--font); color: var(--text-3); white-space: nowrap;
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.dot { display: inline-block; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--text-3); box-shadow: 0 0 0 3px rgba(138, 144, 153, .15); }
.dot.is-green, .dot-green { background: var(--green); box-shadow: 0 0 0 3px rgba(108, 212, 158, .15); }
.dot.is-amber, .dot-amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(232, 182, 90, .15); }
.dot.is-red, .dot-red { background: var(--red); box-shadow: 0 0 0 3px rgba(240, 145, 138, .15); }
.dot.is-blue { background: var(--blue); box-shadow: 0 0 0 3px rgba(127, 176, 242, .15); }
.dot.is-violet { background: var(--violet); box-shadow: 0 0 0 3px rgba(179, 163, 247, .15); }
.dot.is-accent { background: var(--accent); box-shadow: 0 0 0 3px rgba(255, 131, 63, .15); }

/* Tabs, segmented control, filter chips */
.tabs { display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; flex: none; height: 40px; padding: 0 12px; border: 0; border-radius: 6px 6px 0 0;
  background: none; color: var(--text-2); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: color var(--t-fast) var(--ease);
}
.tab:hover { color: var(--text-1); }
.tab[aria-selected="true"], .tab.is-active { color: var(--text-1); }
.tab[aria-selected="true"]::after, .tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.tab:focus-visible { outline-offset: -2px; }
.segmented { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 3px; border-radius: var(--r-md); background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; scrollbar-width: none; }
.segmented > button, .segmented > a, .segmented > label {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 28px; padding: 0 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.segmented > :hover { color: var(--text-1); }
.segmented > [aria-pressed="true"], .segmented > [aria-selected="true"], .segmented > [aria-checked="true"], .segmented > .is-active, .segmented > label:has(input:checked) {
  color: var(--text-1); background: var(--bg-4); box-shadow: inset 0 0 0 1px var(--line-strong), 0 1px 2px rgba(0, 0, 0, .3);
}
.segmented > label > input { position: absolute; opacity: 0; pointer-events: none; }
.segmented.is-sm > * { height: 24px; padding: 0 8px; font-size: 12.5px; }
/* Scrolling tab strips and segmented controls fade at the edge that still hides items (Chromium/Electron:
   scroll-driven animation; elsewhere nothing changes). Without overflow the timeline is inactive: no fade. */
@property --edge-l { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --edge-r { syntax: "<length>"; inherits: false; initial-value: 0px; }
@keyframes tt-edge-fade { from { --edge-l: 0px; --edge-r: 28px; } to { --edge-l: 28px; --edge-r: 0px; } }
@supports (animation-timeline: scroll()) {
  .tabs, .segmented {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--edge-l), #000 calc(100% - var(--edge-r)), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 var(--edge-l), #000 calc(100% - var(--edge-r)), transparent 100%);
    animation: tt-edge-fade linear both; animation-timeline: scroll(self inline);
  }
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: var(--r-md);
  background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-2);
  font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.chip:hover { color: var(--text-1); background: rgba(255, 255, 255, .055); box-shadow: inset 0 0 0 1px var(--line-strong); }
.chip[aria-pressed="true"], .chip.is-active { color: var(--text-1); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.chip .count { height: 18px; min-width: 18px; padding: 0 5px; line-height: 18px; }

/* Switch, checkbox, radio */
.switch {
  position: relative; display: inline-block; flex: none; width: 36px; height: 20px; margin: 0; padding: 0; border: 0; border-radius: 999px;
  background: var(--bg-4); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer; vertical-align: middle;
  -webkit-appearance: none; appearance: none;
  transition: background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #C9CCD1; box-shadow: 0 1px 2px rgba(0, 0, 0, .45); transition: transform var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.switch[aria-checked="true"], input.switch:checked { background: var(--accent); box-shadow: inset 0 0 0 1px rgba(255, 131, 63, .6); }
.switch[aria-checked="true"]::after, input.switch:checked::after { transform: translateX(16px); background: #fff; }
.switch:disabled, .switch[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.switch-field { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.switch-field-text { min-width: 0; }
.switch-field-text b, .switch-field-text strong { display: block; font-size: 14px; font-weight: 500; color: var(--text-1); }
.switch-field-text small { display: block; font-size: 12.5px; line-height: 18px; color: var(--text-3); }
input[type="checkbox"], input[type="radio"], .check, .radio { accent-color: var(--accent); }
.check, .radio { width: 16px; height: 16px; margin: 0; flex: none; cursor: pointer; }
.check-field { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; line-height: 20px; color: var(--text-1); }
.check-field > input { margin-top: 2px; }
.check-field small { display: block; font-size: 12.5px; line-height: 18px; color: var(--text-3); }

/* Search and toolbar */
.search {
  position: relative; display: flex; align-items: center; gap: 8px; height: var(--control-h); min-width: 0; padding: 0 6px 0 10px; border-radius: var(--r-md);
  color: var(--text-3); background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.search:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.search:focus-within { background: rgba(255, 255, 255, .045); box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; color: var(--text-1); font-size: 13.5px; outline: none; }
.search input::placeholder { color: var(--text-3); opacity: 1; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input:focus-visible { outline: none; }
.search .kbd { flex: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.toolbar .search { width: min(280px, 100%); }
.toolbar-spacer { flex: 1; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 16px; }
.field > label, .field-label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-2); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.input, .select, .textarea,
.field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
.field select, .field textarea {
  display: block; width: 100%; min-height: var(--control-h); padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--bg-1); color: var(--text-1); font-size: 14px; line-height: 20px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.textarea, .field textarea { min-height: 88px; padding: 8px 12px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover, .field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(255, 255, 255, .17); }
.input:focus, .select:focus, .textarea:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft);
}
.input:disabled, .select:disabled, .textarea:disabled { opacity: .55; cursor: not-allowed; }
.input[readonly] { color: var(--text-2); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"], .field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--red-line); }
.input-sm, .select-sm { min-height: 30px; font-size: 13px; padding: 0 10px; }
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }
.select, .field select {
  -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23878C94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px 16px;
}
select option { background: var(--bg-2); color: var(--text-1); }
.field-help { margin: 0 0 16px; font-size: 12.5px; line-height: 18px; color: var(--text-3); }
.field > .field-help { margin: 0; }
.form-error {
  display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 16px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red-line); color: #F6B9B3; font-size: 13.5px; line-height: 20px; overflow-wrap: anywhere;
}
.field-error { font-size: 12.5px; line-height: 18px; color: var(--red); }

/* Headings */
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; }
.section-heading p { margin: 4px 0 0; font-size: 13px; line-height: 18px; color: var(--text-2); }

/* Page */
.page { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 28px 32px 48px; min-width: 0; }
.page .page { max-width: none; margin: 0; padding: 0; }
.page.page-bleed { max-width: none; padding: 0; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 20px; }
.page-heading { min-width: 0; }
.page-title { margin: 0; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -.02em; color: var(--text-1); overflow-wrap: anywhere; }
.page-subtitle { margin: 4px 0 0; font-size: 14px; line-height: 20px; color: var(--text-2); }
.page-subtitle .sep { margin: 0 6px; color: var(--text-4); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; min-width: 0; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Data table */
.table-wrap { width: 100%; min-width: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; line-height: 20px; }
.table th {
  position: sticky; top: var(--sticky-top); z-index: 1; height: 36px; padding: 0 12px; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3);
  background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.table-wrap .table th { position: static; }
.table td { height: 52px; padding: 6px 12px; border-bottom: 1px solid var(--line-soft); color: var(--text-1); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.table tbody tr { transition: background-color var(--t-fast) var(--ease); }
.table tbody tr:hover td { background: rgba(255, 255, 255, .025); }
.table tr.is-selected td { background: rgba(255, 255, 255, .04); }
.table tr.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.table .is-num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .is-muted { color: var(--text-2); }
.table tfoot th, .table tfoot td { border-bottom: 0; }

/* Stepper, progress, ring */
.stepper { position: relative; display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; counter-reset: tt-step; }
.step { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; padding: 8px 10px; border-radius: var(--r-md); color: var(--text-2); counter-increment: tt-step; }
.step::after { content: ""; position: absolute; left: 21.5px; top: 36px; bottom: -6px; width: 1px; background: var(--line); }
.step:last-child::after { display: none; }
.step-bubble { position: relative; z-index: 1; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line-strong); }
.step-bubble:empty::before { content: counter(tt-step); }
.step-text { min-width: 0; display: flex; flex-direction: column; }
.step-label { font-size: 13.5px; line-height: 24px; font-weight: 500; color: inherit; }
.step-help { font-size: 12.5px; line-height: 18px; color: var(--text-3); }
.step.is-current { color: var(--text-1); background: rgba(255, 255, 255, .04); }
.step.is-current .step-bubble { color: var(--accent-ink); background: var(--accent); box-shadow: none; }
.step.is-done { color: var(--text-1); }
.step.is-done .step-bubble { color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green-line); }
.step.is-done .step-bubble:empty::before, .step.is-error .step-bubble:empty::before {
  content: ""; width: 12px; height: 12px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.step.is-error { color: var(--text-1); }
.step.is-error .step-bubble { color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red-line); }
.step.is-error .step-bubble:empty::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 6v7M12 18h.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 6v7M12 18h.01'/%3E%3C/svg%3E");
}
.step.is-todo { color: var(--text-2); }
a.step, button.step, .step.is-interactive { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; transition: background-color var(--t-fast) var(--ease); }
a.step:hover, button.step:hover, .step.is-interactive:hover { background: rgba(255, 255, 255, .035); }
.stepper.is-horizontal { flex-direction: row; gap: 0; }
.stepper.is-horizontal .step { flex: 1; grid-template-columns: 24px minmax(0, 1fr); }
.stepper.is-horizontal .step::after { left: 40px; right: 8px; top: 20px; bottom: auto; width: auto; height: 1px; }
.progress { position: relative; height: 6px; min-width: 40px; border-radius: 3px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.progress > span, .progress-bar { display: block; height: 100%; width: var(--value, 0%); max-width: 100%; border-radius: inherit; background: var(--accent); transition: width var(--t-med) var(--ease); }
.progress.is-green > span { background: var(--green); }
.progress.is-amber > span { background: var(--amber); }
.progress.is-red > span { background: var(--red); }
.progress.is-neutral > span { background: linear-gradient(90deg, #C9CCD1, #EDEEF0); }
.progress.is-thin { height: 4px; }
.ring { --value: 0; --size: 36px; --thickness: 3.5px; --ring-color: var(--accent); position: relative; display: inline-grid; place-items: center; flex: none; width: var(--size); height: var(--size); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-1); }
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--value) * 1%), rgba(255, 255, 255, .09) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), #000 calc(100% - var(--thickness) + .5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), #000 calc(100% - var(--thickness) + .5px));
}
.ring.is-green { --ring-color: var(--green); }
.ring.is-lg { --size: 52px; --thickness: 4px; font-size: 13px; }

/* Banner */
.banner {
  --b-c: var(--blue); --b-bg: var(--blue-soft); --b-line: var(--blue-line);
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; padding: 10px 12px 10px 14px; border-radius: var(--r-lg);
  background: var(--b-bg); box-shadow: inset 0 0 0 1px var(--b-line); color: var(--text-1); font-size: 13.5px; line-height: 20px;
}
.banner > .icon { color: var(--b-c); }
.banner-text { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.banner-text b, .banner-text strong { font-weight: 600; }
.banner-text small, .banner-text p { display: block; margin: 0; color: var(--text-2); font-size: 13px; }
.banner-actions { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.banner.is-info { --b-c: var(--blue); --b-bg: var(--blue-soft); --b-line: var(--blue-line); }
.banner.is-warn { --b-c: var(--amber); --b-bg: var(--amber-soft); --b-line: var(--amber-line); }
.banner.is-error { --b-c: var(--red); --b-bg: var(--red-soft); --b-line: var(--red-line); }
.banner.is-ok { --b-c: var(--green); --b-bg: var(--green-soft); --b-line: var(--green-line); }
.banner.is-neutral { --b-c: var(--text-2); --b-bg: rgba(255, 255, 255, .035); --b-line: var(--line); }
.banner.is-slim { min-height: 40px; padding: 4px 6px 4px 12px; gap: 10px; font-size: 13px; }

/* Drawer and bottom sheet */
.drawer-scrim { position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); border: 0; background: rgba(4, 5, 7, .6); }
.drawer {
  position: fixed; top: var(--frame-gap); right: var(--frame-gap); bottom: var(--frame-gap); z-index: var(--z-drawer);
  width: min(520px, calc(100vw - 2 * var(--frame-gap))); max-height: none; margin: 0; padding: 0; border: 0; border-radius: var(--r-xl);
  display: flex; flex-direction: column; background: var(--bg-2); color: var(--text-1); box-shadow: var(--shadow-pop);
  transform: translateX(calc(100% + 16px)); visibility: hidden;
  transition: transform var(--t-med) var(--ease), visibility 0s linear var(--t-med);
}
.drawer.is-open, dialog.drawer[open] { transform: none; visibility: visible; transition: transform var(--t-med) var(--ease); }
dialog.drawer { height: auto; inset: var(--frame-gap) var(--frame-gap) var(--frame-gap) auto; }
dialog.drawer[open] { animation: drawer-in var(--t-med) var(--ease); }
dialog.drawer::backdrop { background: rgba(4, 5, 7, .6); }
.drawer-header { display: flex; align-items: flex-start; gap: 12px; padding: 18px 16px 14px 20px; border-bottom: 1px solid var(--line-soft); }
.drawer-header h2 { margin: 0; font-size: 17px; line-height: 24px; }
.drawer-header .icon-btn { margin-left: auto; box-shadow: none; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; }
.drawer-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-drawer); max-height: 88dvh; margin: 0; padding: 0 0 env(safe-area-inset-bottom); border: 0;
  display: flex; flex-direction: column; width: 100%; max-width: none; border-radius: 16px 16px 0 0; background: var(--bg-2); color: var(--text-1); box-shadow: var(--shadow-pop);
  transform: translateY(100%); visibility: hidden; transition: transform var(--t-med) var(--ease), visibility 0s linear var(--t-med);
}
.sheet.is-open, dialog.sheet[open] { transform: none; visibility: visible; transition: transform var(--t-med) var(--ease); }
dialog.sheet { inset: auto 0 0 0; }
dialog.sheet[open] { animation: sheet-in var(--t-med) var(--ease); }
dialog.sheet::backdrop { background: rgba(4, 5, 7, .6); }
.sheet-handle { width: 36px; height: 4px; margin: 8px auto 4px; border-radius: 2px; background: rgba(255, 255, 255, .18); flex: none; }

/* Skeleton, spinner */
.skeleton {
  display: block; min-height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .04) 25%, rgba(255, 255, 255, .085) 37%, rgba(255, 255, 255, .04) 63%);
  background-size: 400% 100%; animation: skeleton 1.4s ease infinite;
}
.skeleton-text { height: 12px; margin: 6px 0; }
.skeleton-title { height: 18px; width: 40%; margin: 4px 0 10px; }
.skeleton-row { height: 40px; margin: 8px 0; border-radius: var(--r-md); }
.spinner, .loading-spinner {
  display: inline-block; flex: none; width: var(--spinner-size, 18px); height: var(--spinner-size, 18px); border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .12); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
.btn .spinner { --spinner-size: 14px; border-color: color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; }

/* Empty states */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 24px; }
.empty.is-compact { padding: 24px 16px; }
.empty-icon { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 14px; border-radius: var(--r-lg); color: var(--text-2); background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line); }
.empty-title { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; color: var(--text-1); }
.empty-text { max-width: 440px; margin: 6px 0 0; font-size: 13.5px; line-height: 20px; color: var(--text-2); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--highlight);
}
.empty-state > svg.icon:first-child { width: 40px; height: 40px; padding: 10px; margin-bottom: 14px; border-radius: var(--r-lg); color: var(--text-2); background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line); }
.empty-state h2 { margin: 0; font-size: 16px; line-height: 22px; }
.empty-state p { max-width: 440px; margin: 6px auto 16px; font-size: 13.5px; line-height: 20px; color: var(--text-2); }

/* Avatar */
.avatar {
  width: 32px; height: 32px; flex: none; display: inline-grid; place-items: center; border-radius: 50%;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--text-1); user-select: none;
  background: linear-gradient(180deg, #30343B, #23262C); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09);
}
.avatar-sm, .avatar.is-sm, .avatar-small { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg, .avatar.is-lg { width: 40px; height: 40px; font-size: 13.5px; }

/* Venue monogram (sidebar switcher, lists) */
.mono {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 7px; overflow: hidden;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: #E9DCCF;
  background: linear-gradient(180deg, #2B2520, #221E1A); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.mono > img { width: 100%; height: 100%; object-fit: cover; }
.mono.is-lg { width: 36px; height: 36px; border-radius: 9px; font-size: 13px; }
.mono.is-master { color: var(--accent); background: linear-gradient(180deg, #2A1D15, #1E1610); }

/* Modal (<dialog class="modal">) */
.modal {
  width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 0; border-radius: var(--r-xl);
  background: var(--bg-2); color: var(--text-1); box-shadow: var(--shadow-pop); overflow: auto; overscroll-behavior: contain;
}
.modal[open] { animation: modal-in var(--t-med) var(--ease); }
.modal::backdrop { background: rgba(4, 5, 7, .72); }
.modal-wide { width: min(900px, calc(100% - 32px)); }
.modal-form { display: flex; flex-direction: column; min-height: 0; }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; gap: 12px; padding: 20px 16px 16px 24px; background: var(--bg-2); border-bottom: 1px solid var(--line-soft); }
.modal-header h2 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.modal-header p { margin: 4px 0 0; font-size: 13.5px; line-height: 20px; color: var(--text-2); }
.modal-header .icon-btn { margin: -4px 0 0 auto; box-shadow: none; }
.modal-body { padding: 20px 24px 8px; min-width: 0; }
.modal-actions { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 24px; background: var(--bg-2); border-top: 1px solid var(--line-soft); }
.modal-actions .btn { min-width: 96px; }
.modal-error { margin: 0 24px 16px; }
.confirm-message { margin: 0 0 16px; font-size: 14px; line-height: 22px; color: var(--text-2); }

/* Popover menu (workspace switcher, account menu, search results, notifications) */
.menu {
  position: fixed; z-index: 45; min-width: 220px; max-width: min(380px, calc(100vw - 16px)); max-height: min(520px, calc(100dvh - 24px));
  overflow-y: auto; overscroll-behavior: contain; padding: 6px; border-radius: var(--r-lg);
  background: var(--bg-2); box-shadow: var(--shadow-pop); color: var(--text-1);
  animation: menu-in var(--t-fast) var(--ease); transform-origin: top left;
}
.menu-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 4px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-3); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 7px;
  background: none; color: var(--text-1); font-size: 13.5px; line-height: 18px; text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover, .menu-item.is-focused, .menu-item:focus-visible { background: rgba(255, 255, 255, .055); outline: none; }
.menu-item:focus-visible { box-shadow: inset 0 0 0 1px var(--accent-line); }
.menu-item > .icon { color: var(--text-3); }
.menu-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-item-text > b, .menu-item-text > strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-item-text > small { font-size: 12px; line-height: 16px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-item-end { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; color: var(--text-3); }
.menu-item.is-current .menu-item-end .icon { color: var(--accent); }
.menu-item.is-danger, .menu-item.is-danger > .icon { color: var(--red); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--line-soft); }
.menu-empty { padding: 14px 10px; font-size: 13px; color: var(--text-3); }

/* Toasts */
.toast-container { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast {
  --toast-c: var(--green);
  position: relative; display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 12px 12px 12px 16px; overflow: hidden;
  border-radius: var(--r-lg); background: var(--bg-3); box-shadow: var(--shadow-pop); color: var(--text-1);
  font-size: 13.5px; line-height: 20px; pointer-events: auto; overflow-wrap: anywhere; animation: toast-in var(--t-med) var(--ease);
}
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--toast-c); }
.toast > .icon { flex: none; margin-top: 1px; color: var(--toast-c); }
.toast > span { flex: 1; min-width: 0; }
.toast.error { --toast-c: var(--red); }
.toast.notice { --toast-c: var(--accent); }
.toast.info { --toast-c: var(--blue); }
.toast.is-leaving { opacity: 0; transform: translateY(4px); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.toast-action { flex: none; align-self: center; height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: var(--bg-4); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-1); font-size: 13px; font-weight: 500; pointer-events: auto; }
.toast-action:hover { background: #2B3037; }

/* ───────────────────────────── 5. App shell ───────────────────────────── */
.boot-screen, .loading-screen { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; color: var(--text-2); }
.boot-screen p, .loading-screen p { margin: 0; font-size: 13.5px; color: var(--text-3); }
.boot-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: -.015em; color: var(--text-1); }
.brand-mark { display: block; flex: none; width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .09), 0 1px 2px rgba(0, 0, 0, .6); }
.boot-brand .brand-mark { width: 34px; height: 34px; border-radius: 9px; }

/* Sidebar */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: var(--z-nav); width: var(--sidebar-w);
  display: flex; flex-direction: column; padding: 14px 12px 12px; background: var(--bg-0);
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
}
.sb-brand { display: flex; align-items: center; gap: 10px; height: 36px; flex: none; padding: 0 8px; border-radius: var(--r-md); color: var(--text-1); }
.sb-brand-name { font-size: 15.5px; font-weight: 600; letter-spacing: -.015em; }
.ws-switch {
  margin-top: 14px; width: 100%; min-height: 44px; flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border: 0; border-radius: var(--r-lg);
  background: #131518; color: var(--text-1); text-align: left;
  box-shadow: inset 0 0 0 1px var(--line), var(--highlight), 0 1px 2px rgba(0, 0, 0, .3);
  transition: background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
button.ws-switch:hover, .ws-switch[aria-expanded="true"] { background: #16181C; box-shadow: inset 0 0 0 1px var(--line-strong), var(--highlight), 0 1px 2px rgba(0, 0, 0, .3); }
.ws-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ws-name { font-size: 13.5px; line-height: 18px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-sub { font-size: 12px; line-height: 16px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-caret { color: var(--text-3); }
.compat-select { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }
.sb-nav { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.nav-section { display: flex; flex-direction: column; min-width: 0; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-label { height: 26px; display: flex; align-items: center; margin: 0; padding: 0 10px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 8px 0 10px; border: 0; border-radius: 7px;
  background: none; color: var(--text-2); font-size: 13.5px; font-weight: 500; text-align: left; white-space: nowrap; text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav-item .icon { color: var(--text-3); transition: color var(--t-fast) var(--ease); }
.nav-item:hover { color: var(--text-1); background: rgba(255, 255, 255, .035); }
.nav-item:hover .icon { color: var(--text-2); }
.nav-item.active, .nav-item.is-active { color: var(--text-1); background: rgba(255, 255, 255, .055); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035); }
.nav-item.active .icon, .nav-item.is-active .icon { color: var(--text-1); }
.nav-item.active::before, .nav-item.is-active::before { content: ""; position: absolute; left: -12px; top: 8px; width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item:focus-visible { outline-offset: -2px; }
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-count {
  flex: none; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 500; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums;
  color: var(--text-2); background: rgba(255, 255, 255, .055);
}
.nav-item.active .nav-count { color: var(--text-1); background: rgba(255, 255, 255, .09); }
.nav-count.is-alert { color: var(--amber); background: var(--amber-soft); }
.nav-alert { flex: none; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(232, 182, 90, .14); }
.sb-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.sb-agent {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: var(--r-lg); text-align: left;
  background: #121417; color: var(--text-1); box-shadow: inset 0 0 0 1px var(--line), var(--highlight);
}
button.sb-agent:hover { background: #15171A; }
.sb-agent-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: var(--r-md); color: var(--green); background: rgba(108, 212, 158, .09); box-shadow: inset 0 0 0 1px rgba(108, 212, 158, .14); }
.sb-agent.is-off .sb-agent-icon { color: var(--amber); background: var(--amber-soft); box-shadow: inset 0 0 0 1px rgba(232, 182, 90, .16); }
.sb-agent-text { min-width: 0; display: flex; flex-direction: column; }
.sb-agent-text strong { display: flex; align-items: center; gap: 7px; font-size: 13px; line-height: 18px; font-weight: 500; }
.sb-agent-text small { font-size: 12px; line-height: 16px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(108, 212, 158, .16); }
.sb-agent.is-off .live-dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(232, 182, 90, .16); }
.sb-user {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 8px 0; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0;
  background: none; color: var(--text-1); text-align: left;
}
.sb-user:hover .sb-user-caret, .sb-user[aria-expanded="true"] .sb-user-caret { color: var(--text-1); }
.sb-user:focus-visible { outline-offset: -2px; border-radius: var(--r-md); }
.sb-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-user-text strong { font-size: 13.5px; line-height: 18px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-text small { font-size: 12px; line-height: 16px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-caret { color: var(--text-3); transition: color var(--t-fast) var(--ease); }
.nav-scrim { position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); border: 0; background: rgba(4, 5, 7, .62); }
.body-nav-open { overflow: hidden; }

/* Main frame: the inset panel of the render. The document scrolls; the top bar sticks below an 8 px canvas strip. */
.frame-mask { position: fixed; top: 0; left: calc(var(--sidebar-w) - 1px); right: calc(var(--frame-gap) - 1px); z-index: var(--z-nav); height: var(--frame-gap); background: var(--bg-0); pointer-events: none; }
.main {
  position: relative; min-width: 0; min-height: calc(100dvh - 2 * var(--frame-gap));
  margin: var(--frame-gap) var(--frame-gap) var(--frame-gap) var(--sidebar-w);
  display: flex; flex-direction: column; background: var(--bg-1); border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .065), 0 8px 32px rgba(0, 0, 0, .35);
}
.main-glow { position: absolute; inset: 0 0 auto 0; height: 360px; pointer-events: none; border-radius: 12px 12px 0 0; background: radial-gradient(640px 240px at 16% -70px, rgba(255, 131, 63, .075), rgba(255, 131, 63, 0) 72%); }
.topbar {
  position: sticky; top: var(--frame-gap); z-index: var(--z-nav); flex: none; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 16px 0 24px; border-radius: 12px 12px 0 0;
  background: radial-gradient(640px 240px at 16% -70px, rgba(255, 131, 63, .075), rgba(255, 131, 63, 0) 72%), var(--bg-1);
  border-bottom: 1px solid var(--line-soft);
}
/* Rounded corners that stay correct while the page scrolls under the sticky bar (canvas outside, hairline on the curve). */
.topbar::before, .topbar::after { content: ""; position: absolute; top: -1px; width: 13px; height: 13px; pointer-events: none; }
.topbar::before { left: -1px; background: radial-gradient(circle at 100% 100%, transparent 12px, #1B1C1E 12.4px, #1B1C1E 13px, var(--bg-0) 13.4px); }
.topbar::after { right: -1px; background: radial-gradient(circle at 0 100%, transparent 12px, #1B1C1E 12.4px, #1B1C1E 13px, var(--bg-0) 13.4px); }
.mobile-toggle { display: none; margin-left: -6px; box-shadow: none; }
.tb-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; white-space: nowrap; }
.crumb { color: var(--text-3); font-weight: 500; }
button.crumb { padding: 0; border: 0; background: none; }
button.crumb:hover { color: var(--text-1); }
.crumb.is-current { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text-1); }
.crumb-sep { flex: none; color: var(--text-4); }
.crumb-venue { display: none; font-size: 12px; line-height: 16px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-actions .icon-btn { width: 32px; height: 32px; }
.tb-actions .btn { --btn-h: 32px; padding: 0 13px 0 11px; gap: 6px; }
.tb-search { position: relative; width: 304px; min-width: 0; }
.tb-search .search { height: 32px; }
.tb-search-toggle { display: none; }
.chip-status {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 10px; border: 0; border-radius: var(--r-md);
  background: none; color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
button.chip-status:hover { color: var(--text-1); background: rgba(255, 255, 255, .04); }
.chip-status .icon { color: var(--text-3); }
.save-pill { display: inline-flex; }
.bell-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg-1); }
.workspace { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.workspace:focus { outline: none; }
.shell-banners { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 16px 32px 0; }
.shell-banners:empty, .shell-banners:not(:has(> :not([hidden]))) { display: none; }
.context-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 16px 32px 0; }
.context-bar:empty { display: none; }
.room-switches { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.room-switches .segmented { max-width: 100%; }
#view-root { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.module-root { flex: 1; }
.example-note { margin-bottom: 16px; }

/* Search results, notifications */
.search-results { width: min(440px, calc(100vw - 16px)); }
.search-results .menu-item mark { background: none; color: var(--text-1); font-weight: 600; }
.search-hint { display: flex; align-items: center; gap: 12px; padding: 8px 10px 4px; border-top: 1px solid var(--line-soft); margin-top: 6px; font-size: 12px; color: var(--text-3); }
.search-hint .kbd { height: 18px; line-height: 18px; }
.notif-panel { width: min(380px, calc(100vw - 16px)); padding: 0; }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line-soft); }
.notif-head h2 { margin: 0; font-size: 15px; line-height: 20px; }
.notif-head .text-button { margin-left: auto; }
.notif-body { padding: 6px; }
.notif-item { align-items: flex-start; }
.notif-item .menu-item-text small { white-space: normal; }
.notif-item.is-new .menu-item-text > b::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; vertical-align: 2px; border-radius: 50%; background: var(--accent); }
.notif-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--text-2); }
.notif-foot .sync { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.sound-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--text-2); font-size: 13px; }
.sound-toggle:hover { color: var(--text-1); }
.sound-toggle[aria-pressed="true"] .switch { background: var(--accent); box-shadow: inset 0 0 0 1px rgba(255, 131, 63, .6); }
.sound-toggle[aria-pressed="true"] .switch::after { transform: translateX(16px); background: #fff; }

/* Lazy sections and guarded routes */
.lazy-state { display: flex; flex-direction: column; gap: 20px; }
.lazy-loading { display: flex; flex-direction: column; gap: 12px; }
.lazy-loading .skeleton-row:nth-child(2) { width: 92%; }
.lazy-loading .skeleton-row:nth-child(3) { width: 84%; }
.route-off .panel, .lazy-state .panel { max-width: 720px; }

/* Venue picker (legacy dialog kept for the example flow) */
.venue-options { display: grid; gap: 6px; }
.venue-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 10px; border: 0; border-radius: var(--r-md); background: rgba(255, 255, 255, .02); box-shadow: inset 0 0 0 1px var(--line); text-align: left; color: inherit; }
.venue-option:hover { background: rgba(255, 255, 255, .045); }
.venue-option.is-current { box-shadow: inset 0 0 0 1px var(--accent-line); }

/* Guided onboarding / quick guide (legacy dialogs, restyled) */
.guide-steps { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: guide; }
.guide-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; counter-increment: guide; font-size: 13.5px; line-height: 20px; color: var(--text-2); }
.guide-steps li::before { content: counter(guide); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 12px; font-weight: 600; color: var(--text-1); background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line-strong); }
.guide-steps strong { display: block; margin-bottom: 2px; font-size: 14px; font-weight: 600; color: var(--text-1); }
.guide-note { margin: 16px 0 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 13px; line-height: 20px; color: var(--text-3); }
.onboarding-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.onboarding-steps > li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .02); box-shadow: inset 0 0 0 1px var(--line); }
.onboarding-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 12px; font-weight: 600; color: var(--text-1); background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line-strong); }
.onboarding-copy { min-width: 0; }
.onboarding-copy strong { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.onboarding-copy strong .icon { color: var(--text-3); }
.onboarding-copy p { margin: 2px 0 0; font-size: 13px; line-height: 19px; color: var(--text-2); }
.onboarding-link { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin-top: 6px; font-size: 12.5px; color: var(--text-2); }
.onboarding-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onboarding-link:hover { color: var(--text-1); text-decoration: underline; }
.onboarding-note { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 4px; font-size: 13px; line-height: 19px; color: var(--text-3); }

/* ───────────────────────────── 6. Sign-in and first set-up ───────────────────────────── */
.auth { position: relative; min-height: 100dvh; display: flex; overflow: hidden; background: var(--bg-0); }
.auth-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(900px 420px at 18% -120px, rgba(255, 131, 63, .09), rgba(255, 131, 63, 0) 70%), radial-gradient(700px 380px at 100% 110%, rgba(127, 176, 242, .04), rgba(127, 176, 242, 0) 70%); }
.auth-layout { position: relative; flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(400px, .95fr); min-height: 100dvh; }
.auth-story { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 32px 48px 36px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.auth-brand .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
.auth-copy { max-width: 520px; }
.auth-kicker { margin: 0 0 14px; display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 500; color: var(--text-2); background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line); }
.auth-copy h1 { margin: 0; font-size: clamp(32px, 3.4vw, 44px); line-height: 1.1; font-weight: 600; letter-spacing: -.035em; color: var(--text-1); }
.auth-copy h1 em { font-style: normal; color: var(--accent); }
.auth-lead { margin: 14px 0 0; max-width: 460px; font-size: 15px; line-height: 24px; color: var(--text-2); }
.auth-points { display: grid; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-size: 14px; line-height: 20px; color: var(--text-2); }
.auth-points b { color: var(--text-1); font-weight: 500; }
.auth-point-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: var(--r-md); color: var(--text-2); background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px var(--line); }
.auth-foot { margin: 0; font-size: 13px; color: var(--text-3); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-card {
  width: 100%; max-width: 400px; padding: 28px 28px 24px; border-radius: var(--r-xl);
  background: var(--bg-1); box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), var(--highlight), 0 24px 70px rgba(0, 0, 0, .45);
}
.auth-lock { width: 36px; height: 36px; display: grid; place-items: center; margin-bottom: 16px; border-radius: var(--r-lg); color: var(--text-1); background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line-strong), var(--highlight); }
.auth-card h2 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.02em; }
.auth-sub { margin: 6px 0 22px; font-size: 13.5px; line-height: 20px; color: var(--text-2); }
.auth-card .field { margin-bottom: 14px; }
.auth-card .input { min-height: 40px; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 44px; }
.password-toggle { position: absolute; top: 50%; right: 4px; width: 32px; height: 32px; transform: translateY(-50%); box-shadow: none; }
.auth-remember { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 14px; padding: 10px 12px; border-radius: var(--r-md); background: rgba(255, 255, 255, .025); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.auth-remember input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; }
.auth-remember b { display: block; font-size: 13.5px; font-weight: 500; color: var(--text-1); }
.auth-remember small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 18px; color: var(--text-3); }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-security { display: flex; align-items: flex-start; gap: 8px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 12.5px; line-height: 18px; color: var(--text-3); }
.auth-security .icon { margin-top: 1px; }

/* ───────────────────────────── 7. Responsive ───────────────────────────── */
@media (max-width: 1360px) {
  .tb-search { width: 260px; }
}
@media (max-width: 1280px) {
  .tb-search { width: 200px; }
}
@media (min-width: 1101px) and (max-width: 1220px) {
  .tb-search { width: 176px; }
  .tb-actions { gap: 6px; }
}
/* The print chip keeps its label at the desktop program's default width (1180 px); icon and dot only when space is short. */
@media (min-width: 1101px) and (max-width: 1150px), (max-width: 860px) {
  .chip-status .chip-label { display: none; }
  .chip-status { padding: 0 10px; }
}
@media (max-width: 1100px) {
  :root { --sticky-top: var(--topbar-h); }
  .sidebar {
    z-index: var(--z-drawer); width: min(300px, 86vw); transform: translateX(-100%); visibility: hidden; box-shadow: none;
    transition: transform var(--t-med) var(--ease), visibility 0s linear var(--t-med), box-shadow var(--t-med) var(--ease);
  }
  .sidebar.is-open { transform: none; visibility: visible; box-shadow: 1px 0 0 var(--line), 24px 0 80px rgba(0, 0, 0, .6); transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease); }
  .nav-item { height: 40px; }
  .frame-mask, .topbar::before, .topbar::after { display: none; }
  .main { margin: 0; min-height: 100dvh; border-radius: 0; box-shadow: none; }
  .main-glow { border-radius: 0; }
  .topbar { top: 0; padding: 0 16px; gap: 12px; border-radius: 0; }
  .mobile-toggle { display: inline-grid; }
  .page { padding: 24px 24px 40px; }
  .shell-banners, .context-bar { padding: 16px 24px 0; }
  .kpi-strip { --kpi-cols: 2; }
  .kpi-strip > .kpi:nth-child(odd)::before { display: none; }
  .kpi-strip > .kpi:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .auth-layout { grid-template-columns: minmax(0, 1fr) minmax(380px, 1fr); }
  .auth-story { padding: 28px 32px; }
}
@media (max-width: 900px) {
  .tb-search { width: 220px; }
  .crumbs .crumb:not(.is-current), .crumbs .crumb-sep { display: none; }
  .tb-title { flex-direction: column; align-items: flex-start; gap: 0; }
  .crumb-venue { display: block; max-width: 100%; }
  .crumbs { font-size: 15px; font-weight: 600; }
}
@media (max-width: 768px) {
  .page { padding: 20px 20px 32px; }
  .shell-banners, .context-bar { padding: 14px 20px 0; }
  .tb-search { display: none; }
  .tb-search.is-open { display: block; position: absolute; left: 12px; right: 12px; top: 10px; width: auto; z-index: 2; }
  .tb-search.is-open .search { height: 36px; background: var(--bg-2); }
  .tb-search-toggle { display: inline-grid; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .page-header { align-items: flex-start; }
  .table.is-responsive thead { display: none; }
  .table.is-responsive, .table.is-responsive tbody, .table.is-responsive tr, .table.is-responsive td { display: block; width: 100%; }
  .table.is-responsive tr { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
  .table.is-responsive td { height: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 !important; border: 0; }
  .table.is-responsive td::before { content: attr(data-label); flex: none; font-size: 12.5px; color: var(--text-3); }
  .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-story { padding: 20px 20px 0; gap: 0; }
  .auth-copy, .auth-foot { display: none; }
  .auth-panel { align-items: flex-start; padding: 28px 20px 40px; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .kpi { padding: 14px 14px; }
  .kpi-value { font-size: 22px; line-height: 28px; }
  .kpi-value .cur, .kpi-value .dec { font-size: 16px; }
  .kpi-unit { font-size: 14px; }
  .kpi .spark { display: none; }
  .kpi-foot { white-space: normal; }
  .modal, .modal-wide { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .modal[open] { animation: sheet-in var(--t-med) var(--ease); }
  .modal-header { padding: 16px 12px 12px 20px; }
  .modal-body { padding: 16px 20px 4px; }
  .modal-actions { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
  .modal-actions .btn { flex: 1; }
  .modal-error { margin: 0 20px 14px; }
  .toast-container { left: 12px; right: 12px; bottom: 12px; width: auto; align-items: stretch; }
  .tb-actions .btn-primary .btn-label { display: none; }
  .tb-actions .btn-primary { width: 32px; padding: 0; }
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; transform: translateY(100%); }
  .auth-card { padding: 24px 20px 20px; }
}
@media (max-width: 420px) {
  .page { padding: 16px 16px 28px; }
  .shell-banners, .context-bar { padding: 12px 16px 0; }
  .topbar { padding: 0 12px; gap: 8px; }
  .tb-actions { gap: 6px; }
  .btn { --btn-h: 44px; }
  .btn-sm { --btn-h: 36px; }
  .page-actions { width: 100%; }
  .form-actions-sticky { position: sticky; bottom: 0; z-index: 3; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--bg-1); border-top: 1px solid var(--line); }
}
@media (pointer: coarse) {
  .btn, .tb-actions .btn { --btn-h: 40px; }
  .tb-search .search, .chip-status { height: 40px; }
  .tb-actions .btn-primary { min-width: 40px; }
  .btn-sm { --btn-h: 34px; }
  .icon-btn, .tb-actions .icon-btn { width: 40px; height: 40px; }
  .nav-item { height: 40px; }
  .input, .select, .field input:not([type="checkbox"]):not([type="radio"]), .field select { min-height: 40px; }
  .menu-item { min-height: 44px; }
  .chip, .segmented > * { min-height: 34px; }
}

/* ───────────────────────────── 8. Motion ───────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .spinner, .loading-spinner, .btn.is-loading::after { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
  .skeleton { animation: none !important; }
}
