/* Atlas components — the v7.1 design kit (ui-kit/atlas.css §3-13, common/layers.css) for the plain-JS shell.
   Every colour comes from tokens.css. Class names are v7.1's where a module or the shell will write them
   by hand (.btn--primary, .badge--good, .tabs/.tab, .menu, .glass); the names the current shell and
   modules already write (.btn.primary, .icon-btn, .pill.st-good, .chip, .seg, .skeleton, .empty) are
   kept and drawn the same way. kit.js builds most of these (badge, seg, tabs, statTile, dialog, sheet…).

   Sections: base · type · glass · aura · menu · buttons · inputs · surfaces · badges (+ verdict, mini band,
   band chart) · tabs/seg/chips ·
   data table · stat · empty/skeleton/ring · layers (dialog, sheet, side panel, tooltip) · code ·
   motion · lite / accessibility / touch. */

/* --- base ------------------------------------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
code, kbd, pre { font-family: var(--font-mono); }
code { font-size: .88em; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.icon { flex: none; }
.muted { color: var(--text-3); }
.neg { color: var(--bad-ink); }
.pos { color: var(--text); }
.grow { flex: 1; }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* --- type -------------------------------------------------------------------------------------------------- */

.b1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; letter-spacing: -.028em; font-weight: 660; }
.b2 { font-size: 21px; line-height: 1.25; letter-spacing: -.02em; font-weight: 620; }
.b3 { font-size: 17px; line-height: 1.35; letter-spacing: -.014em; font-weight: 600; }
.body-text { font-size: 15px; }
.body-text-small { font-size: 13.5px; color: var(--text-2); }
.overline { font-size: 11px; font-weight: 640; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: .875em; }
/* A single line that does not fit fades out on the right instead of ending in "…". */
.fade-r { overflow: hidden; white-space: nowrap;
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%); }
.brand-text { background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
kbd { font-size: .85em; padding: 1.5px 6px; border-radius: 5px; border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--text-2); white-space: nowrap; }

/* --- glass -------------------------------------------------------------------------------------------------
   Only for things that float over content: composer, menus, tooltips, dialogs, sheets. Never for the
   content layer, never glass on glass. The edge light is a gradient border (top bright, bottom dim);
   a single border-color cannot do that. Refraction (SVG displacement) is deliberately left out. */

.glass {
  position: relative;
  background: var(--glass-2);
  backdrop-filter: blur(var(--glass-blur-2)) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(var(--glass-blur-2)) saturate(var(--glass-saturation));
  border: 1px solid transparent;
  background-image:
    linear-gradient(var(--glass-2), var(--glass-2)),
    linear-gradient(160deg, var(--glass-edge-top), var(--glass-edge-bottom) 55%, var(--glass-edge-top) 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: inset 0 1px 0 0 var(--glass-inner-light), 0 8px 32px -8px var(--glass-body-shadow);
}
.glass--1 { background: var(--glass-1);
  background-image: linear-gradient(var(--glass-1), var(--glass-1)),
    linear-gradient(160deg, var(--glass-edge-top), var(--glass-edge-bottom) 55%, var(--glass-edge-top) 100%);
  backdrop-filter: blur(var(--glass-blur-1)) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(var(--glass-blur-1)) saturate(var(--glass-saturation)); }
.glass--3 { background: var(--glass-3);
  background-image: linear-gradient(var(--glass-3), var(--glass-3)),
    linear-gradient(160deg, var(--glass-edge-top), var(--glass-edge-bottom) 55%, var(--glass-edge-top) 100%);
  backdrop-filter: blur(var(--glass-blur-3)) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(var(--glass-blur-3)) saturate(var(--glass-saturation));
  box-shadow: inset 0 1px 0 0 var(--glass-inner-light), var(--sh-3); }
.glass--4 { background: var(--glass-4);
  background-image: linear-gradient(var(--glass-4), var(--glass-4)),
    linear-gradient(160deg, var(--glass-edge-top), var(--glass-edge-bottom) 55%, var(--glass-edge-top) 100%);
  backdrop-filter: blur(var(--glass-blur-4)) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(var(--glass-blur-4)) saturate(var(--glass-saturation));
  box-shadow: inset 0 1px 0 0 var(--glass-inner-light), var(--sh-pop); }
/* sheen: light on the surface */
.glass--glow::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, var(--sheen-1) 0%, var(--sheen-2) 22%, transparent 45%);
  mix-blend-mode: plus-lighter;
}
/* texture: a faint noise that also kills gradient banding (inline data: SVG, nothing fetched) */
.glass--texture::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* clear: almost no tint, with a guaranteed dimming floor for readability */
.glass--clear { background: transparent; background-image: none;
  backdrop-filter: blur(var(--glass-blur-1)) saturate(1.2); -webkit-backdrop-filter: blur(var(--glass-blur-1)) saturate(1.2); }
.glass--clear::before { content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--glass-dimming); pointer-events: none; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .glass--1, .glass--3, .glass--4 { background: var(--surface-2); background-image: none; border: 1px solid var(--border); }
}

/* Scroll edge: content softens before it slides under a sticky glass bar. Put
   <div class="scroll-edge"><i></i></div> as the first child of the scrolling box. */
.scroll-edge { position: sticky; top: 0; height: 0; z-index: 30; pointer-events: none; }
.scroll-edge > i {
  display: block; height: 46px; opacity: 0;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}
@supports (animation-timeline: scroll()) {
  .scroll-edge > i { animation: edge-open linear both; animation-timeline: scroll(nearest block); animation-range: 0 120px; }
}

/* --- aura: three slow glows behind the panel (<div class="aura"><b></b><b></b><b></b></div>) ---------- */

.aura { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; opacity: var(--aura-opacity); }
.aura b { position: absolute; display: block; will-change: transform; backface-visibility: hidden; }
.aura b:nth-child(1) { width: 92vw; height: 92vw; left: -26vw; top: -34vw;
  background: radial-gradient(closest-side circle at 50% 50%, var(--aura-1) 0%, transparent 72%);
  animation: slide-1 26s ease-in-out infinite alternate; }
.aura b:nth-child(2) { width: 80vw; height: 80vw; right: -24vw; top: 6vh;
  background: radial-gradient(closest-side circle at 50% 50%, var(--aura-3) 0%, transparent 70%);
  animation: slide-2 33s ease-in-out infinite alternate; }
.aura b:nth-child(3) { width: 104vw; height: 70vw; left: 6vw; bottom: -34vw;
  background: radial-gradient(closest-side ellipse at 50% 50%, var(--aura-2) 0%, transparent 74%);
  animation: slide-3 29s ease-in-out infinite alternate; }

/* --- menu: its own, more opaque backdrop (text between rows must not show through) ------------------ */

.menu { border-radius: var(--r-3); padding: 6px; min-width: 200px;
  background: var(--glass-3); border: 1.5px solid var(--border-2);
  backdrop-filter: blur(var(--glass-blur-3)) saturate(1.5); -webkit-backdrop-filter: blur(var(--glass-blur-3)) saturate(1.5);
  box-shadow: var(--sh-3), inset 0 1px 0 0 var(--glass-inner-light); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .menu { background: var(--surface); } }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 11px; border: 0;
  background: transparent; border-radius: var(--r-1); font: inherit; font-size: 14px; color: var(--text-2);
  text-align: left; cursor: pointer; transition: background .12s linear, color .12s linear; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); color: var(--text); outline: none; }
.menu-item[aria-current="true"], .menu-item.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 560; }
.menu-item--danger { color: var(--bad); }
.menu-item--danger:hover { background: var(--bad-soft); color: var(--bad); }
.menu-item svg { width: 17px; height: 17px; }
.menu-divider { height: 1px; margin: 5px 10px; background: var(--border-2); }
/* a floating menu/popover placed by kit.menu(): opens down (pop-in-down) or up (pop-in) */
.floating { position: fixed; z-index: 400; }
.floating--down { transform-origin: top center; animation: pop-in-down .16s var(--ease-out) both; }
.floating--up { transform-origin: bottom center; animation: pop-in .16s var(--ease-out) both; }

/* --- buttons ------------------------------------------------------------------------------------------------
   primary = the one main action · secondary = safe alternative (also a bare .btn) · ghost = dense
   toolbars · glass = floats over content · danger = irreversible, never the default focus. */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--r-2);
  font: inherit; font-size: 14px; font-weight: 560; line-height: 1; white-space: nowrap; text-decoration: none;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border-2); cursor: pointer;
  transition: transform .18s var(--spring), background .16s linear, border-color .16s linear, box-shadow .2s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active:not(:disabled) { transform: scale(.975); }
.btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn--primary, .btn.primary { background: var(--accent); color: var(--accent-fg); border-color: transparent;
  box-shadow: 0 1px 2px oklch(0% 0 0 / .12), inset 0 1px 0 oklch(100% 0 0 / .18); }
.btn--primary:hover:not(:disabled), .btn.primary:hover:not(:disabled) { background: var(--accent-strong); border-color: transparent; transform: translateY(-1px); }
.btn--primary:active:not(:disabled), .btn.primary:active:not(:disabled) { transform: scale(.975); }
.btn--secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.btn--ghost, .btn.ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn--ghost:hover:not(:disabled), .btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn--glass, .btn.glass { color: var(--text); border-color: transparent;
  background: var(--glass-1);
  background-image: linear-gradient(var(--glass-1), var(--glass-1)),
    linear-gradient(160deg, var(--glass-edge-top), var(--glass-edge-bottom) 55%, var(--glass-edge-top));
  background-origin: border-box; background-clip: padding-box, border-box;
  backdrop-filter: blur(var(--glass-blur-1)) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(var(--glass-blur-1)) saturate(var(--glass-saturation));
  box-shadow: inset 0 1px 0 0 var(--glass-inner-light), 0 4px 16px -6px var(--glass-body-shadow); }
.btn--glass:hover:not(:disabled), .btn.glass:hover:not(:disabled) { transform: translateY(-1px); border-color: transparent;
  background: var(--glass-1);
  background-image: linear-gradient(var(--glass-1), var(--glass-1)),
    linear-gradient(160deg, var(--glass-edge-top), var(--glass-edge-bottom) 55%, var(--glass-edge-top));
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: inset 0 1px 0 0 var(--glass-inner-light), 0 8px 22px -6px var(--glass-body-shadow); }
.btn--danger, .btn.danger { background: var(--bad); color: oklch(99% 0 0); border-color: transparent; }
.btn--danger:hover:not(:disabled), .btn.danger:hover:not(:disabled) { background: var(--bad); border-color: transparent; filter: brightness(.92); }

.btn--sm, .btn.small { height: 30px; padding: 0 11px; font-size: 13px; border-radius: var(--r-1); gap: 6px; }
.btn--sm svg, .btn.small svg { width: 14px; height: 14px; }
.btn--lg, .btn.large { height: 46px; padding: 0 22px; font-size: 15.5px; border-radius: var(--r-3); }
.btn--pill, .btn.pill { border-radius: var(--r-pill); }
.btn--full, .btn.wide { width: 100%; }
.btn.wide { height: 42px; }

/* round icon button (v7.1) and the square one the current shell and cards use */
.iconbtn { width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; flex: none;
  border-radius: var(--r-pill); background: transparent; border: 0; color: var(--text-2); cursor: pointer;
  transition: background .14s linear, color .14s linear, transform .18s var(--spring); }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn:active { transform: scale(.92); }
.iconbtn svg { width: 17px; height: 17px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; flex: none;
  border-radius: var(--r-1); border: 0; background: transparent; color: var(--text-3);
  transition: background .14s linear, color .14s linear, transform .18s var(--spring); }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn:disabled { opacity: .45; cursor: default; }
.icon-btn.tiny { width: 24px; height: 24px; border-radius: 6px; }
.link { border: 0; background: none; color: var(--accent-text); padding: 0; font: inherit; font-weight: 550; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* --- inputs -------------------------------------------------------------------------------------------------- */

/* Bare inputs are styled through :where() (no specificity), so a module's own `.x input` rule still wins. */
.input,
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]), select, textarea) {
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  border-radius: var(--r-2); padding: 8px 12px; font-size: 14px; line-height: 1.4; outline: none; min-width: 0;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.input { width: 100%; height: 38px; padding: 0 13px; }
textarea.input, .input--field { height: auto; min-height: 84px; padding: 10px 13px; resize: vertical; line-height: 1.55; }
.input:focus, :where(input, select, textarea):focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder, :where(input, textarea)::placeholder { color: var(--text-faint); }
.input:disabled, :where(input, select, textarea):disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }
.input[aria-invalid="true"], :where(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in oklab, var(--bad) 20%, transparent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
.label { display: block; font-size: 13px; font-weight: 560; color: var(--text-2); margin-bottom: 6px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field .label { margin-bottom: 0; }
.help { font-size: 12.5px; color: var(--text-3); margin-top: 5px; }
.error { font-size: 12.5px; color: var(--bad); margin-top: 5px; font-weight: 520; }

/* switch: <label class="switch"><input type="checkbox"><span></span> Hafif mod</label> */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch > span { position: relative; width: 32px; height: 18px; flex: none; border-radius: var(--r-pill);
  background: var(--border-strong); transition: background .16s var(--ease); }
.switch > span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: oklch(100% 0 0); box-shadow: var(--sh-1); transition: transform .18s var(--spring); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }

/* slider: the value is always also written as text (.slider-value) */
.slider .label { display: flex; align-items: baseline; gap: 8px; }
.slider-value { margin-left: auto; font-weight: 600; color: var(--text); font-size: 12.5px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; cursor: pointer; display: block; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: var(--track, var(--surface-3)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 999px; background: var(--track, var(--surface-3)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-shadow: var(--sh-1); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
  border: 2px solid var(--surface); box-shadow: var(--sh-1); }
input[type="range"]:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; }
input[type="range"]:disabled { opacity: .5; cursor: default; }

/* --- surfaces ---------------------------------------------------------------------------------------------- */

.card { border-radius: var(--r-3); padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1); min-width: 0; }
.card--glass { background: var(--glass-2); border-color: transparent; }
.panel { border-radius: var(--r-4); padding: 22px 24px; }
.panel.glass { padding: 22px 24px; }
.divider { height: 1px; background: var(--border); border: 0; margin: 16px 0; }
/* A thin veil behind long reading over the aura: not glass, just enough to keep text contrast. */
.reading-base { position: relative; isolation: isolate; }
.reading-base::before { content: ""; position: absolute; inset: -24px -32px; z-index: -1; border-radius: var(--r-4);
  background: var(--bg); opacity: .55; pointer-events: none; }

/* --- badges and status ----------------------------------------------------------------------------------------
   Status is never colour alone: kit.status() and kit.badge() put an icon and a word in it. */

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 580; line-height: 1.4; white-space: nowrap; max-width: 100%; }
.badge svg { width: 12px; height: 12px; flex: none; }
.badge--neutral { background: var(--surface-3); color: var(--text-2); }
.badge--good { background: var(--good-soft); color: var(--good-ink); }
.badge--warning { background: var(--warn-soft); color: var(--warn-ink); }
.badge--serious { background: var(--serious-soft); color: var(--serious-ink); }
.badge--bad { background: var(--bad-soft); color: var(--bad-ink); }
.badge--info { background: var(--info-soft); color: var(--info-ink); }
.badge--highlight { background: var(--accent-soft); color: var(--accent-text); }
.badge--admin { background: var(--admin-soft); color: var(--admin-text); }
.badge--done { background: var(--surface-2); color: var(--text-2); }
/* "assigned" is green TEXT with no fill: the colour grammar keeps fills for boundaries */
.badge--assigned { background: transparent; color: var(--assigned); padding-inline: 2px; }
.badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border-2); }
/* the current shell's and modules' pills (kit.status adds .badge too) */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 580; line-height: 1.4; white-space: nowrap; }
.pill.st-good { background: var(--good-soft); color: var(--good-ink); }
.pill.st-done { background: var(--surface-2); color: var(--text-2); }
.pill.st-warning { background: var(--warn-soft); color: var(--warn-ink); }
.pill.st-serious { background: var(--serious-soft); color: var(--serious-ink); }
.pill.st-critical { background: var(--bad-soft); color: var(--bad-ink); }
.pill.st-info { background: var(--accent-soft); color: var(--accent-text); }
.pill.st-neutral { background: var(--surface-3); color: var(--text-2); }
.pill.st-assigned { background: transparent; color: var(--assigned); padding-inline: 2px; }
.pill.st-admin { background: var(--admin-soft); color: var(--admin-text); }
/* evidence superscript and quote highlight (where the answer came from) */
.evidence { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  margin: 0 2px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-text); font-size: 10.5px; font-weight: 660;
  font-variant-numeric: tabular-nums; vertical-align: super; cursor: pointer; border: 0; transition: background .14s linear; }
.evidence:hover { background: var(--accent); color: var(--accent-fg); }
.quote-highlight { background: var(--quote); border-radius: 3px; padding: 1px 2px; }

/* verdict tones (kit.VERDICT): one colour variable per tone, for marks, dots and spans */
.vt-good { --vt: var(--good); }
.vt-warning { --vt: var(--warn); }
.vt-critical { --vt: var(--critical); }
.vt-serious { --vt: var(--serious); }
.vt-neutral { --vt: var(--text-3); }
.vt-highlight { --vt: var(--accent); }

/* a verdict pill (kit.verdict): a badge, a size larger or smaller */
.verdict { font-variant-numeric: tabular-nums; }
.verdict--sm { padding: 1px 7px; font-size: 11px; }
.verdict--lg { padding: 5px 12px; font-size: 13px; gap: 6px; }
.verdict--lg svg { width: 14px; height: 14px; }

/* the mini band (kit.miniBand): a value against its limits on one strip */
.mini-band { position: relative; min-width: 120px; padding: 4px 0 0; }
.mini-band--none { padding: 2px 0; font-size: 12px; }
.mini-band-track { position: relative; height: 10px; border-radius: var(--r-pill); background: var(--surface-3); }
.mini-band-ok, .mini-band-warn { position: absolute; top: 0; bottom: 0; }
.mini-band-ok { background: var(--good-soft); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--good) 30%, transparent); }
.mini-band-warn { background: var(--warn-soft); }
.mini-band-target { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text-2); }
.mini-band-mark {
  position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--vt, var(--text-2)); box-shadow: 0 0 0 2px var(--surface), var(--sh-1);
  display: grid; place-items: center; color: oklch(99% 0 0); font-size: 8px; line-height: 1;
}
.mini-band-mark.is-off { border-radius: 4px; }
.mini-band-labels { position: relative; height: 16px; margin-top: 3px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mini-band-labels > span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.mini-band-labels > span:first-child { transform: translateX(-20%); }
.mini-band-labels > span:last-child { transform: translateX(-80%); }
.mini-band-labels > span:only-child { transform: translateX(-50%); }
[data-touch] .mini-band-track { height: 12px; }
[data-touch] .mini-band-mark { width: 18px; height: 18px; margin: -9px 0 0 -9px; }

/* the band chart (kit.bandChart): the .chart look, plus the band, the limit steps, state dots and event spans */
.band-chart .bc-ok { fill: var(--good-soft); }
.band-chart .bc-warn { fill: var(--warn-soft); }
.band-chart .bc-limit { fill: none; stroke: color-mix(in oklab, var(--good) 60%, var(--text-3)); stroke-width: 1.25; }
.band-chart .bc-target { fill: none; stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 4 3; opacity: .85; }
.band-chart .bc-line { stroke: var(--s1); }
.band-chart .bc-dot { fill: var(--vt, var(--text-3)); stroke: var(--surface); stroke-width: 1.5; }
.band-chart .bc-event { fill: var(--vt, var(--text-3)); opacity: .12; }
.band-chart .bc-event.vt-neutral { opacity: .1; }

/* --- tabs, segmented, chips ------------------------------------------------------------------------------------ */

.tabs { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2);
  width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 15px; border-radius: var(--r-pill); border: 0;
  background: transparent; font: inherit; font-size: 13.5px; font-weight: 540; color: var(--text-3); cursor: pointer;
  white-space: nowrap; text-decoration: none; transition: background .18s var(--ease), color .18s var(--ease); }
.tab:hover { color: var(--text-2); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.tab svg { width: 15px; height: 15px; }
.count { font-size: 11.5px; color: var(--text-3); padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-3);
  font-variant-numeric: tabular-nums; }

/* segmented: kit.seg() builds .segmented with a sliding indicator (.seg-ind) under the chosen segment. A
   hand-made .seg of plain buttons with .on is drawn the same way (veri's view switch); the kit uses its own
   class so a module's `.seg button` rules cannot reach it. */
.seg, .segmented { position: relative; display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-2);
  background: var(--surface-3); max-width: 100%; overflow-x: auto; scrollbar-width: none; isolation: isolate; }
.seg > button, .segmented > button { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 0; border-radius: var(--r-1); background: transparent; color: var(--text-2); font: inherit; font-size: 13px;
  font-weight: 560; cursor: pointer; white-space: nowrap; transition: color .16s var(--ease), background .16s var(--ease); }
.seg > button:hover, .segmented > button:hover { color: var(--text); }
.seg > button svg, .segmented > button svg { width: 15px; height: 15px; }
.seg > button.on, .seg > button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.segmented > button.on { color: var(--text); }
.segmented .seg-ind { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: var(--r-1);
  background: var(--surface); box-shadow: var(--sh-1); transition: transform .26s var(--spring), width .26s var(--spring); }
.seg--sm > button { height: 26px; padding: 0 9px; font-size: 12.5px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px;
  cursor: pointer; white-space: nowrap; transition: border-color .14s linear, color .14s linear, background .14s linear; }
.chip svg { width: 14px; height: 14px; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-pressed="true"], .chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); font-weight: 560; }
/* a chip tinted by its module: style="--mc: var(--s3)" */
.chip.tinted { border-color: color-mix(in oklab, var(--mc) 28%, var(--border-2)); }
.chip.tinted svg { color: var(--mc); }
.chip.tinted:hover { background: color-mix(in oklab, var(--mc) 8%, var(--surface)); border-color: color-mix(in oklab, var(--mc) 45%, var(--border-2)); }

/* --- data table ---------------------------------------------------------------------------------------------- */

.table-wrap, .dtable-box { overflow: auto; max-height: 440px; border: 1px solid var(--border); border-radius: var(--r-2);
  background: var(--surface); overscroll-behavior: contain; max-width: 100%; }
.dtable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.dtable th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--text-2); font-weight: 600;
  font-size: 12.5px; text-align: left; padding: 8px 12px; white-space: nowrap; border-bottom: 1px solid var(--border-2); }
.dtable th.sortable { cursor: pointer; user-select: none; }
.dtable th.sortable:hover { color: var(--text); }
.dtable th[data-sort]::after { display: inline-block; margin-left: 4px; color: var(--accent-text); }
.dtable th[data-sort="asc"]::after { content: "↑"; }
.dtable th[data-sort="desc"]::after { content: "↓"; }
.dtable td { padding: 7px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle;
  overflow-wrap: break-word; max-width: 40ch; }
.dtable tr:last-child td { border-bottom: 0; }
.dtable tbody tr:hover td { background: var(--surface-2); }
.dtable tr.is-action { cursor: pointer; }
.dtable tr.is-action:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.dtable tr.is-selected td { background: var(--accent-soft); }
.dtable .num, .k-num, .k-signed, .k-pct { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable-empty { text-align: center; color: var(--text-3); padding: 24px 12px !important; }

/* --- stat tile ---------------------------------------------------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--r-3);
  background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 560; min-width: 0; }
.stat-label > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-label svg { width: 15px; height: 15px; }
.stat-value { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.stat-value b { font-size: 24px; font-weight: 650; letter-spacing: -.02em; color: var(--text); line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-value i { font-style: normal; font-size: 13px; color: var(--text-3); white-space: nowrap; }
.stat-foot { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; color: var(--text-3); }
.stat--good { border-color: color-mix(in oklab, var(--good) 35%, var(--border)); }
.stat--warning { border-color: color-mix(in oklab, var(--warn) 45%, var(--border)); }
.stat--serious { border-color: color-mix(in oklab, var(--serious) 42%, var(--border)); }
.stat--bad, .stat--critical { border-color: color-mix(in oklab, var(--bad) 40%, var(--border)); }
.stat--info { border-color: color-mix(in oklab, var(--info) 35%, var(--border)); }
/* a small status disc before the label: icon + word, never colour alone */
.stat-st { width: 17px; height: 17px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; color: oklch(99% 0 0); }
.stat-st svg { width: 11px; height: 11px; }
.stat-st.st-good { background: var(--good); }
.stat-st.st-warning { background: var(--warn); color: oklch(25% .05 70); }
.stat-st.st-serious { background: var(--serious); }
.stat-st.st-critical { background: var(--bad); }
.stat-st.st-info, .stat-st.st-neutral, .stat-st.st-done { background: var(--text-3); }
.delta { font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.delta.up-good { color: var(--good-ink); }
.delta.up-bad { color: var(--bad-ink); }
.delta.flat { color: var(--text-2); }

/* --- empty, skeleton, progress ring ------------------------------------------------------------------------------ */

/* .empty alone is the small "nothing here" line inside a card; .empty--big is a whole screen's empty
   state: what happens here, why it is empty, what to do (kit.empty()). */
.empty { color: var(--text-3); padding: 18px 4px; text-align: center; font-size: 14px; }
.empty--big { display: grid; place-items: center; text-align: center; gap: 3px; padding: 60px 24px; min-height: 260px; }
.empty__icon, .empty--big > svg:first-child { width: 42px; height: 42px; color: var(--text-faint); margin-bottom: 12px; stroke-width: 1.4; }
.empty__title { font-size: 16px; font-weight: 600; color: var(--text-2); }
.empty__text { font-size: 13.5px; color: var(--text-3); max-width: 48ch; line-height: 1.65; }
.empty__action { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.skeleton { display: block; min-height: 160px; border-radius: var(--r-3); background: var(--surface-3);
  animation: pulse 1.4s ease-in-out infinite; }
.skeleton.line { min-height: 12px; height: 12px; border-radius: var(--r-1); }
.skeleton-bars { display: flex; flex-direction: column; gap: 8px; }
.skeleton-bars > .skeleton { min-height: 12px; height: 12px; border-radius: var(--r-1); }
.skeleton-bars > .skeleton:nth-child(3n + 2) { width: 86%; }
.skeleton-bars > .skeleton:nth-child(3n) { width: 64%; }
.skeleton-bars--rows > .skeleton { height: 28px; width: 100% !important; }
.skeleton-bars--tiles { flex-direction: row; flex-wrap: wrap; }
.skeleton-bars--tiles > .skeleton { height: 84px; width: auto !important; flex: 1 1 160px; border-radius: var(--r-3); }

.ring { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.ring svg { position: absolute; inset: 0; }
.ring-track { stroke: var(--surface-3); }
.ring-arc { stroke: var(--accent); transition: stroke-dashoffset .4s var(--ease); }
.ring--good .ring-arc { stroke: var(--good); }
.ring--warning .ring-arc { stroke: var(--warn); }
.ring--serious .ring-arc { stroke: var(--serious); }
.ring--bad .ring-arc, .ring--critical .ring-arc { stroke: var(--bad); }
.ring-figure { position: relative; font-size: 12px; font-weight: 640; color: var(--text); font-variant-numeric: tabular-nums; }

/* --- layers: dialog, sheet, side panel, tooltip ------------------------------------------------------------------- */

.overlay { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px;
  background: var(--overlay); animation: fade-in .15s linear both; }
.dialog { position: relative; width: min(420px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 20px 20px 16px;
  border: 1.5px solid var(--border-2); border-radius: 20px; background: var(--glass-4); color: var(--text);
  backdrop-filter: blur(var(--glass-blur-3)) saturate(1.5); -webkit-backdrop-filter: blur(var(--glass-blur-3)) saturate(1.5);
  box-shadow: var(--sh-3), inset 0 1px 0 0 var(--glass-inner-light); animation: pop-in .2s var(--spring) both; outline: none; }
.dialog--wide { width: min(560px, 100%); }
.dialog-title { margin: 0 0 14px; font-size: 17px; font-weight: 620; letter-spacing: -.01em; padding-right: 28px; }
.dialog-close { position: absolute; top: 12px; right: 12px; }
.dialog-body { display: flex; flex-direction: column; gap: 14px; font-size: 14px; color: var(--text-2); }
.dialog-body p { margin: 0; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.dialog-note { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-3); }
.dialog-note.neg { color: var(--bad-ink); }

/* sheet: from the right on a desk (480px), from the bottom on a phone (88dvh) */
.sheet-layer { position: fixed; inset: 0; z-index: 450; display: flex; justify-content: flex-end; }
.sheet-layer.sheet-layer--left { justify-content: flex-start; }
.sheet-layer.sheet-layer--bottom { align-items: flex-end; justify-content: stretch; }
.sheet-scrim { position: absolute; inset: 0; border: 0; padding: 0; background: var(--scrim); cursor: default;
  animation: fade-in .2s var(--ease) both; }
.sheet { position: relative; display: flex; flex-direction: column; width: min(480px, 100%); height: 100%; max-width: 100%;
  background: var(--glass-4); color: var(--text); outline: none;
  backdrop-filter: blur(var(--glass-blur-4)) saturate(var(--glass-saturation)); -webkit-backdrop-filter: blur(var(--glass-blur-4)) saturate(var(--glass-saturation));
  border-left: 1px solid var(--border-2); box-shadow: var(--sh-pop);
  border-start-start-radius: var(--r-4); border-end-start-radius: var(--r-4);
  animation: sheet-in-right .26s var(--ease-out) both; }
.sheet--narrow { width: min(300px, 100%); }
.sheet--wide { width: min(640px, 100%); }
.sheet-layer--left .sheet { border-left: 0; border-right: 1px solid var(--border-2); border-radius: 0;
  border-start-end-radius: var(--r-4); border-end-end-radius: var(--r-4); animation-name: sheet-in-left; }
.sheet-layer--bottom .sheet, .sheet--bottom { width: 100%; height: auto; max-height: 88dvh; border-left: 0; border-radius: 0;
  border-start-start-radius: var(--r-4); border-start-end-radius: var(--r-4); animation-name: sheet-in-bottom; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px 10px 20px;
  border-bottom: 1px solid var(--border); flex: none; }
.sheet-head h2 { margin: 0; min-width: 0; font-size: 15.5px; font-weight: 620; overflow-wrap: anywhere; }
.sheet-body { flex: 1; overflow: auto; padding: 16px 20px; overscroll-behavior: contain; min-height: 0; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); flex: none; }
@media (max-width: 760px) {
  .sheet-layer { align-items: flex-end; }
  .sheet, .sheet--narrow, .sheet--wide { width: 100%; height: auto; max-height: 88dvh; border-left: 0; border-right: 0; border-radius: 0;
    border-start-start-radius: var(--r-4); border-start-end-radius: var(--r-4); animation-name: sheet-in-bottom; }
}

/* side panel: a document opened next to the chat. The shell puts the chat and the panel in a .split;
   the panel takes clamp(340px, 38%, 640px) on the right, and stacks on top below 900px. */
.split { display: flex; flex-direction: row; min-height: 0; min-width: 0; }
.split > .split-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.sidepanel { width: clamp(340px, 38%, 640px); flex-shrink: 0; display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border-left: 1px solid var(--border); animation: fade-in .2s var(--ease) both; }
.sidepanel-head { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 8px 8px 18px;
  border-bottom: 1px solid var(--border); flex: none; }
.sidepanel-title { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 620; }
.sidepanel-body { flex: 1; overflow: auto; min-height: 0; padding: 16px 18px; overscroll-behavior: contain; }
@media (max-width: 900px) {
  .split { flex-direction: column; }
  .split > .sidepanel { order: -1; width: auto; max-height: 45vh; border-left: 0; border-bottom: 1px solid var(--border); }
}

/* name bubble: rail names, icon-only buttons (kit.nameTip). Fixed, because rails clip. */
.tip-pill { position: fixed; z-index: 300; transform: translateY(-50%); padding: 7px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border-2); background: var(--glass-3); color: var(--text);
  backdrop-filter: blur(var(--glass-blur-3)) saturate(var(--glass-saturation)); -webkit-backdrop-filter: blur(var(--glass-blur-3)) saturate(var(--glass-saturation));
  font-size: 12.5px; font-weight: 540; line-height: 1.1; white-space: nowrap; pointer-events: none; box-shadow: var(--sh-2);
  animation: tooltip-enter .14s var(--ease) both; }

/* --- code block: language and Copy in a top strip, the code scrolls inside -------------------------------------- */

.code-block { margin: 0 0 12px; border-radius: var(--r-2); border: 1px solid var(--border); background: var(--code-bg); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 12px;
  border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.code-copy { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border: 0; border-radius: var(--r-1);
  background: transparent; color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
.code-copy:hover { background: var(--surface-3); color: var(--text); }
.code-copy svg { width: 13px; height: 13px; }
.code-block pre { margin: 0; padding: 12px 14px; overflow-x: auto; scrollbar-width: thin; }
.code-block code { font-family: var(--font-mono); font-size: 13px; line-height: 1.6; color: var(--text); white-space: pre;
  overflow-wrap: normal; background: none; border: 0; padding: 0; }

/* --- motion ------------------------------------------------------------------------------------------------------ */

.an-fade-up { animation: fade-up .5s var(--ease-out) both; }
.an-fade-in { animation: fade-in .26s var(--ease) both; }
.an-pop { animation: pop-in .4s var(--spring) both; }
.an-pulse { animation: pulse 1.4s ease-in-out infinite; }
.thinking-dot { display: inline-block; width: 3.5px; height: 3.5px; border-radius: 50%; background: currentColor;
  animation: dot-bounce 1.1s var(--ease) infinite; animation-delay: var(--delay, 0s); }
.orb-running { animation: orb-spin 2.6s linear infinite, orb-breathe 1.6s ease-in-out infinite alternate; border-radius: 50%; }
.spinner { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--border-2);
  border-top-color: var(--accent); animation: spin .7s linear infinite; }

@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
/* opacity is done at 60% while the spring still settles: no "bouncing while fading" */
@keyframes pop-in { 0% { opacity: 0; transform: scale(.9) translateY(8px); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes pop-in-down { 0% { opacity: 0; transform: scale(.9) translateY(-8px); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes tooltip-enter { from { opacity: 0; transform: translateY(-50%) translateX(-6px); } to { opacity: 1; transform: translateY(-50%) translateX(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes dot-bounce { 0%, 70%, 100% { transform: translateY(0); opacity: .45; } 35% { transform: translateY(-3.5px); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes orb-spin { to { rotate: 360deg; } }
@keyframes orb-breathe { from { box-shadow: 0 4px 14px var(--ring); } to { box-shadow: 0 0 22px 2px oklch(75% .14 220 / .55); } }
@keyframes slide-1 { from { transform: translate3d(-3vw, -2vh, 0) scale(1); } to { transform: translate3d(6vw, 4vh, 0) scale(1.12); } }
@keyframes slide-2 { from { transform: translate3d(4vw, 2vh, 0) scale(1.1); } to { transform: translate3d(-6vw, -4vh, 0) scale(.95); } }
@keyframes slide-3 { from { transform: translate3d(-4vw, 3vh, 0) scale(1.05); } to { transform: translate3d(5vw, -3vh, 0) scale(.94); } }
@keyframes sheet-in-right { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-in-left { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-in-bottom { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes edge-open { from { opacity: 0; } to { opacity: 1; } }
@keyframes md-cursor { 50% { opacity: 0; } }
/* names the earlier shell animates with; kept so its leftovers keep moving */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }
/* backdrop-filter is never transitioned: every frame would be a full backdrop pass. */

/* --- lite mode, reduced transparency, contrast, forced colours ---------------------------------------------------
   html[data-lite] is the main switch (prefers-reduced-transparency exists only in Chromium): glass turns
   opaque, never "transparent but unblurred", and the aura goes. */

[data-lite] .glass, [data-lite] .glass--1, [data-lite] .glass--3, [data-lite] .glass--4, [data-lite] .glass--clear,
[data-lite] .dialog, [data-lite] .sheet, [data-lite] .tip-pill {
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  background-image: none !important; background: var(--surface-2) !important; border: 1px solid var(--border) !important;
}
[data-lite] .menu { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
[data-lite] .btn--glass, [data-lite] .btn.glass { backdrop-filter: none; -webkit-backdrop-filter: none;
  background: var(--surface-2); background-image: none; border-color: var(--border); }
[data-lite] .glass--glow::after, [data-lite] .glass--texture::before, [data-lite] .glass--clear::before,
[data-lite] .aura, [data-lite] .scroll-edge { display: none; }

@media (prefers-reduced-transparency: reduce) {
  .glass, .glass--1, .glass--3, .glass--4, .glass--clear, .menu, .btn--glass, .btn.glass, .dialog, .sheet, .tip-pill {
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    background-image: none !important; background: var(--surface-2) !important; border: 1px solid var(--border) !important;
  }
  .glass--glow::after, .glass--texture::before, .aura, .scroll-edge { display: none; }
}
@media (prefers-contrast: more) {
  .glass, .glass--1, .glass--3, .glass--4, .menu, .dialog, .sheet {
    background-image: none !important; background: var(--surface) !important; border: 1px solid var(--text-3) !important;
  }
  .glass--glow::after, .glass--texture::before { display: none; }
  .aura { opacity: .25; }
}
@media (forced-colors: active) {
  .glass, .glass--1, .glass--3, .glass--4, .menu, .btn--glass, .dialog, .sheet, .tip-pill {
    backdrop-filter: none; background: Canvas; border: 1px solid ButtonBorder; forced-color-adjust: none; box-shadow: none;
  }
  .aura, .glass--glow::after, .glass--texture::before { display: none; }
}

/* reduced motion is a requirement, not a preference: nothing below may override it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .orb-running { animation: none !important; }
}

/* --- touch mode (html[data-touch], set in prefs): every target 44px, for gloves ------------------------------------- */

[data-touch] .btn { min-height: var(--touch-target); padding-inline: 20px; }
[data-touch] .iconbtn, [data-touch] .icon-btn { width: var(--touch-target); height: var(--touch-target); }
[data-touch] .icon-btn.tiny { width: 36px; height: 36px; }
[data-touch] .seg > button, [data-touch] .segmented > button, [data-touch] .chip, [data-touch] .tab, [data-touch] .menu-item { min-height: var(--touch-target); }
[data-touch] .input, [data-touch] :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select) { min-height: var(--touch-target); }
[data-touch] input[type="checkbox"], [data-touch] input[type="radio"] { width: 22px; height: 22px; }
