/* ==========================================================================
   Punchlist: studio interface (AccessHands Tasks colourway)
   Paper, pigment colours and ink, recoloured to the AccessHands blue ramp and slate. Fraunces for display and numbers,
   Instrument Sans for the interface, IBM Plex Mono only for references.
   Hand-drawn details: wavy rules, highlighter marks, tape, line illustrations.
   ========================================================================== */

@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/fraunces-latin-full-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/fraunces-latin-ext-full-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 100 900; font-display: swap; src: url('/fonts/fraunces-latin-full-italic.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/instrument-sans-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: italic; font-weight: 400 700; font-display: swap; src: url('/fonts/instrument-sans-latin-wght-italic.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+FEFF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+FEFF; }

:root {
  color-scheme: light;
  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* paper and ink */
  --paper: #eef1f5;
  --paper-2: #e3e7ee;
  --sheet: #ffffff;
  --sheet-2: #f3f5f8;
  --sheet-3: #e5eaf0;
  --hover: #edf0f5;
  --rule: #d3dae5;
  --rule-strong: #bcc7d6;
  --ink: #18263a;
  --ink-2: #46566d;
  --ink-3: #596a81;

  /* interaction */
  --accent: #006aaa;
  --accent-hover: #005a91;
  --accent-soft: #e8f4fb;
  --ring: rgba(0, 122, 194, 0.28);
  --marker: rgba(145, 200, 235, 0.5);
  --marker-solid: #5aabe0;
  --primary-bg: #007ac2;
  --primary-fg: #ffffff;
  --primary-hover: #006aaa;
  --primary-edge: #005a91;
  --danger: #b23a2e;
  --danger-soft: #f8e4df;
  --success: #4f6b45;
  --warning: #94661a;

  /* sidebar */
  --sidebar: var(--paper-2);
  --sidebar-ink: var(--ink-2);

  /* chart roles (validated against --sheet) */
  --series-1: #3e71b6;
  --series-2: #d2693c;
  --series-3: #2a9b80;
  --good: #5a8a4a;
  --warn: #d39a2b;
  --bad: #c0443a;
  --grid: #e1e6ed;
  --axis: #bcc7d6;

  /* pigments for status marks */
  --m-gray: #8d9fb8;
  --m-slate: #6d6a7e;
  --m-blue: #5b7a99;
  --m-violet: #85506f;
  --m-teal: #4e8c82;
  --m-green: #5e8150;
  --m-amber: #d99a2b;
  --m-orange: #c8643a;
  --m-red: #b23a2e;

  /* illustrations */
  --illo-ink: #243348;
  --illo-paper: #ffffff;
  --illo-a: #c5e3f5;
  --illo-b: #91c8eb;
  --illo-c: #d3dfc3;
  --illo-accent: #007ac2;

  --overlay-bg: rgba(24, 38, 58, 0.34);
  --shadow: 0 1px 0 rgba(82, 98, 121, 0.05), 0 12px 28px -20px rgba(44, 59, 80, 0.4);
  --shadow-lift: 0 2px 0 rgba(82, 98, 121, 0.05), 0 18px 34px -18px rgba(44, 59, 80, 0.45);
  --float: 0 0 0 1px rgba(47, 62, 83, 0.08), 0 22px 44px -14px rgba(31, 45, 66, 0.32);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.27 0 0 0 0 0.33 0 0 0 0 0.42 0 0 0 .075 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --squiggle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='6' viewBox='0 0 16 6'%3E%3Cpath d='M0 3Q2 .6 4 3T8 3T12 3T16 3' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  --blob: 58% 42% 55% 45% / 46% 58% 42% 54%;

  --r-sm: 6px;
  --r: 11px;
  --r-lg: 18px;
  --r-xl: 24px;
  --sidebar-w: 248px;
  --topbar-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme='light'])) {
    color-scheme: dark;
    --paper: #0b182b; --paper-2: #111e32; --sheet: #142135; --sheet-2: #19273b; --sheet-3: #202e42; --hover: #1b293d;
    --rule: #263449; --rule-strong: #344358;
    --ink: #e4e9ef; --ink-2: #b7c2d3; --ink-3: #8698b1;
    --accent: #5aabe0; --accent-hover: #91c8eb; --accent-soft: rgba(90, 171, 224, 0.14); --ring: rgba(90, 171, 224, 0.32);
    --marker: rgba(145, 200, 235, 0.2); --marker-solid: #2991d6;
    --primary-bg: #2991d6; --primary-fg: #0b182b; --primary-hover: #5aabe0; --primary-edge: #006aaa;
    --danger: #e8806f; --danger-soft: rgba(232, 128, 111, 0.12); --success: #93b77f; --warning: #e5b55a;
    --series-1: #5288cc; --series-2: #d06a40; --series-3: #2fa487;
    --good: #7db36b; --warn: #e0b04a; --bad: #e0705f; --grid: #202e42; --axis: #344358;
    --m-gray: #75869f; --m-slate: #9a97ab; --m-blue: #86a4c4; --m-violet: #b98aa6; --m-teal: #6fb3a7; --m-green: #8db57c; --m-amber: #e5b04d; --m-orange: #e48a5f; --m-red: #e8756a;
    --illo-ink: #d9dfe9; --illo-paper: #1c2a3e; --illo-a: #003a5f; --illo-b: #005a91; --illo-c: #3f4c37; --illo-accent: #5aabe0;
    --overlay-bg: rgba(1, 8, 25, 0.6);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 12px 28px -18px rgba(0, 0, 0, 0.7);
    --shadow-lift: 0 2px 0 rgba(0, 0, 0, 0.25), 0 18px 34px -16px rgba(0, 0, 0, 0.8);
    --float: 0 0 0 1px rgba(240, 243, 246, 0.07), 0 22px 44px -12px rgba(0, 0, 0, 0.7);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.92 0 0 0 0 0.93 0 0 0 0 0.95 0 0 0 .04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #0b182b; --paper-2: #111e32; --sheet: #142135; --sheet-2: #19273b; --sheet-3: #202e42; --hover: #1b293d;
  --rule: #263449; --rule-strong: #344358;
  --ink: #e4e9ef; --ink-2: #b7c2d3; --ink-3: #8698b1;
  --accent: #5aabe0; --accent-hover: #91c8eb; --accent-soft: rgba(90, 171, 224, 0.14); --ring: rgba(90, 171, 224, 0.32);
  --marker: rgba(145, 200, 235, 0.2); --marker-solid: #2991d6;
  --primary-bg: #2991d6; --primary-fg: #0b182b; --primary-hover: #5aabe0; --primary-edge: #006aaa;
  --danger: #e8806f; --danger-soft: rgba(232, 128, 111, 0.12); --success: #93b77f; --warning: #e5b55a;
  --series-1: #5288cc; --series-2: #d06a40; --series-3: #2fa487;
  --good: #7db36b; --warn: #e0b04a; --bad: #e0705f; --grid: #202e42; --axis: #344358;
  --m-gray: #75869f; --m-slate: #9a97ab; --m-blue: #86a4c4; --m-violet: #b98aa6; --m-teal: #6fb3a7; --m-green: #8db57c; --m-amber: #e5b04d; --m-orange: #e48a5f; --m-red: #e8756a;
  --illo-ink: #d9dfe9; --illo-paper: #1c2a3e; --illo-a: #003a5f; --illo-b: #005a91; --illo-c: #3f4c37; --illo-accent: #5aabe0;
  --overlay-bg: rgba(1, 8, 25, 0.6);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 12px 28px -18px rgba(0, 0, 0, 0.7);
  --shadow-lift: 0 2px 0 rgba(0, 0, 0, 0.25), 0 18px 34px -16px rgba(0, 0, 0, 0.8);
  --float: 0 0 0 1px rgba(240, 243, 246, 0.07), 0 22px 44px -12px rgba(0, 0, 0, 0.7);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.92 0 0 0 0 0.93 0 0 0 0 0.95 0 0 0 .04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--grain), var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'kern';
  font-optical-sizing: auto;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 600; }
h1, h2, h3 { font-family: var(--serif); font-variation-settings: 'SOFT' 100; letter-spacing: -0.01em; }
h1 { font-size: 30px; font-weight: 560; }
h2 { font-size: 18px; font-weight: 580; }
h3 { font-size: 15.5px; font-weight: 600; }
h4 { font-size: 13.5px; }
em { font-style: italic; }
p { margin: 0 0 0.75em; }
p:last-child { margin-bottom: 0; }
hr { border: 0; height: 6px; margin: 18px 0; background: var(--rule-strong); -webkit-mask: var(--squiggle) repeat-x left center / 16px 6px; mask: var(--squiggle) repeat-x left center / 16px 6px; }
code, kbd, .mono { font-family: var(--mono); font-size: 0.88em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--marker); color: var(--ink); }
.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; }
.skip-link { position: absolute; left: 12px; top: -40px; z-index: 1000; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: var(--r); }
.skip-link:focus { top: 12px; }

/* Serif voice: headings and quiet labels in Fraunces. */
.serif, .nav-section, .section-title, .card-header h2, .card-header h3, .column-header, .day-divider, .menu-heading, .palette-group, .metric-value, .kpi-value, .hero-number, .label-voice {
  font-family: var(--serif);
  font-variation-settings: 'SOFT' 100;
}
.label-voice { font-style: italic; font-size: 13.5px; }

/* Hand-drawn rule, drawn with the wavy mask in any colour. */
.squiggle { display: block; height: 6px; background: var(--rule-strong); -webkit-mask: var(--squiggle) repeat-x left center / 16px 6px; mask: var(--squiggle) repeat-x left center / 16px 6px; }

/* ------------------------------------------------------------------ layout */

.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--grain), var(--paper-2); color: var(--sidebar-ink);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; padding: 0 0 14px;
  scrollbar-width: thin;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 10px; color: var(--ink); flex: none; }
.brand:hover { text-decoration: none; }
.brand:hover .brand-mark { transform: rotate(-14deg) scale(1.04); }
.brand-mark { width: 34px; height: 34px; flex: none; display: block; transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.brand-name { font-family: var(--serif); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 640; font-size: 22px; letter-spacing: -0.02em; line-height: 1; display: block; }
.brand small { display: block; font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-3); font-weight: 400; margin-top: 3px; }
.project-switch { padding: 12px 16px 4px; }
.project-switch .select { background-color: var(--sheet); border-color: var(--rule-strong); }
.nav-section { color: var(--ink-3); padding: 20px 22px 6px; font-size: 14px; font-style: italic; font-weight: 450; display: flex; align-items: center; gap: 8px; }
.nav-section::after { content: ''; flex: 1; height: 6px; background: var(--rule-strong); opacity: 0.8; -webkit-mask: var(--squiggle) repeat-x left center / 12px 5px; mask: var(--squiggle) repeat-x left center / 12px 5px; }
.nav { display: flex; flex-direction: column; padding: 0 10px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 0 12px; height: 36px; border-radius: 12px;
  color: var(--ink-2); font-size: 14px; font-weight: 500; isolation: isolate;
}
.nav a .icon { color: var(--ink-3); transition: transform 0.2s; }
.nav a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); text-decoration: none; }
.nav a:hover .icon { transform: rotate(-8deg); }
.nav a.active { color: var(--ink); font-weight: 600; background: none; }
.nav a.active::before {
  content: ''; position: absolute; z-index: -1; left: 4px; right: 6px; top: 5px; bottom: 5px;
  background: var(--marker); border-radius: 14px 9px 16px 8px / 9px 15px 8px 14px; transform: rotate(-0.8deg);
}
.nav a.active .icon { color: var(--accent); }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 22px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 10px; }
.nav .count.hot { color: var(--primary-fg); background: var(--primary-bg); }
.nav .count.alarm { color: #fff; background: var(--m-red); }
.sidebar-footer { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.lan-hint {
  margin: 4px 16px 0; padding: 10px 12px 11px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45;
  background: color-mix(in srgb, var(--marker-solid) 22%, var(--sheet)); border-radius: 4px 4px 14px 4px;
  box-shadow: 0 8px 14px -12px rgba(44, 59, 80, 0.5); transform: rotate(-1.2deg);
}
.lan-hint .icon { color: var(--ink-3); }
.lan-hint strong { display: block; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 13.5px; color: var(--ink); }
.lan-hint a, .lan-hint code { color: var(--ink); }
.lan-hint code { font-size: 11.5px; }

/* Settings uses .nav on a page surface */
.page .nav { padding: 0; }
.page .nav a { height: 38px; }
.page .nav a.active .icon { color: var(--accent); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px; padding: 0 28px;
  background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}
.topbar .menu-toggle { display: none; }
.search-trigger {
  display: flex; align-items: center; gap: 9px; width: min(400px, 100%); height: 38px; padding: 0 8px 0 14px;
  border: 1px solid var(--rule); background: var(--sheet); border-radius: 19px; color: var(--ink-3); cursor: pointer; text-align: left; font-size: 13.5px;
  box-shadow: inset 0 1px 2px rgba(44, 59, 80, 0.05); transition: border-color 0.15s, box-shadow 0.15s;
}
.search-trigger:hover { border-color: var(--rule-strong); box-shadow: 0 0 0 4px color-mix(in srgb, var(--marker-solid) 18%, transparent); }
.search-trigger kbd { margin-left: auto; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.page { padding: 34px 40px 64px; max-width: 1440px; width: 100%; margin: 0 auto; animation: page-in 0.35s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
.page.narrow { max-width: 900px; }
.page.medium { max-width: 1200px; }
.page-header { display: flex; align-items: flex-end; gap: 16px 20px; margin-bottom: 28px; flex-wrap: wrap; padding-bottom: 20px; position: relative; }
.page-header::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--rule-strong); -webkit-mask: var(--squiggle) repeat-x left center / 16px 6px; mask: var(--squiggle) repeat-x left center / 16px 6px; }
.page-header .titles { min-width: min(100%, 320px); flex: 1; }
.page-header .kicker { font-family: var(--serif); font-style: italic; font-size: 15.5px; color: var(--accent); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.page-header .kicker svg { width: 28px; height: 12px; flex: none; }
.page-header h1 { font-size: 36px; line-height: 1.08; letter-spacing: -0.022em; font-variation-settings: 'SOFT' 100, 'WONK' 0; }
.page-header h1 em, .detail-title em, .auth-aside h2 em { font-style: italic; font-weight: 440; color: var(--accent); font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.page-header .subtitle { color: var(--ink-2); margin-top: 8px; font-size: 14.5px; max-width: 720px; line-height: 1.5; }
.page-header .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.breadcrumb { color: var(--ink-3); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.breadcrumb a { color: var(--ink-2); font-family: var(--serif); font-style: italic; font-size: 14.5px; }
.breadcrumb .icon { width: 12px; height: 12px; color: var(--ink-3); }
.breadcrumb .ref { font-size: 11.5px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid.top { align-items: start; }
.span-2 { grid-column: span 2; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.detail-side { position: sticky; top: calc(var(--topbar-h) + 18px); display: flex; flex-direction: column; gap: 18px; }

.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 8px; }
.stack > * + * { margin-top: 18px; }
.stack-sm > * + * { margin-top: 8px; }
.grow { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 18px; } .mb-24 { margin-bottom: 26px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tabular { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.right { text-align: right; }
.hidden { display: none !important; }
.danger-text { color: var(--danger); }
.success-text { color: var(--success); }
.warning-text { color: var(--warning); }

/* ------------------------------------------------------------------ icons */

.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon.sm { width: 14px; height: 14px; }
.icon.lg { width: 18px; height: 18px; }
.icon.xl { width: 26px; height: 26px; stroke-width: 1.35; }
.card-header h2 > .icon, .card-header h3 > .icon, .section-title > .icon, .kpi-label > .icon, .empty-icon, .h-icon { display: none; }
.callout > .icon { color: var(--ink-3); margin-top: 2px; }
.toast > .icon { display: none; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px; border-radius: 12px; border: 1px solid var(--rule-strong);
  background: var(--sheet); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1.5px 0 var(--rule-strong);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s, box-shadow 0.12s;
}
.btn .icon { width: 15px; height: 15px; }
.btn:hover { background: var(--hover); border-color: var(--ink-3); text-decoration: none; }
.btn:active { transform: translateY(1.5px); box-shadow: 0 0 0 var(--rule-strong); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); box-shadow: 0 2px 0 var(--primary-edge); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.primary:active { box-shadow: 0 0 0 var(--primary-edge); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 2px 0 color-mix(in srgb, var(--danger) 70%, #000); }
.btn.danger:hover { filter: brightness(1.07); }
.btn.success { background: var(--m-green); border-color: var(--m-green); color: #fff; box-shadow: 0 2px 0 color-mix(in srgb, var(--m-green) 70%, #000); }
.btn.success:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); border-color: transparent; }
.btn.sm { height: 31px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 12px; gap: 4px; border-radius: 8px; box-shadow: none; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
.btn.icon-only { width: 36px; padding: 0; }
.btn.icon-only.sm { width: 31px; }
.btn.icon-only.xs { width: 24px; }
.btn.icon-only .icon { width: 17px; height: 17px; }
.btn.icon-only.xs .icon { width: 13px; height: 13px; }
.btn.block { width: 100%; }
.btn.has-dot { position: relative; }
.btn .badge-dot { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; background: var(--primary-bg); color: var(--primary-fg); font-size: 10px; font-weight: 700; display: grid; place-items: center; border-radius: 9px; border: 2px solid var(--paper); }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 12px 0 0 12px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 12px 12px 0; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 14px; background: color-mix(in srgb, var(--ink) 6%, var(--paper)); border: 1px solid var(--rule); }
.segmented button { border: 0; background: transparent; padding: 0 12px; height: 30px; border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed='true'] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 0 var(--rule-strong), 0 3px 8px -4px rgba(44, 59, 80, 0.3); }

/* ------------------------------------------------------------------ forms */

.field { display: flex; flex-direction: column; gap: 7px; }
.field + .field { margin-top: 18px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.field-row + .field, .field + .field-row, .field-row + .field-row { margin-top: 18px; }
.field-row > .field + .field { margin-top: 0; }
.label { font-weight: 600; font-size: 13.5px; color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
.label .optional { font-weight: 400; color: var(--ink-3); font-size: 12.5px; font-family: var(--serif); font-style: italic; }
.hint { font-size: 12.5px; color: var(--ink-3); }
.error-text { font-size: 13px; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 7px 12px; border-radius: 12px; border: 1px solid var(--rule-strong);
  background: var(--sheet); color: var(--ink); font-size: 14px; transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: inset 0 1px 2px rgba(44, 59, 80, 0.05);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: 0.85; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.input.sm, .select.sm { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 10px; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%23887a6d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 6.5c1.5 1.3 3 2.8 4.5 4.3 1.5-1.5 3-3 4.5-4.3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; cursor: pointer; }
.select.sm { padding-right: 28px; background-position: right 9px center; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.textarea.tall { min-height: 170px; }
.input-with-icon { position: relative; }
.input-with-icon .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; width: 15px; height: 15px; }
.input-with-icon .input { padding-left: 34px; }
.checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary-bg); margin: 0; cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { appearance: none; width: 36px; height: 21px; border-radius: 11px; background: var(--rule-strong); position: relative; cursor: pointer; transition: background 0.2s; margin: 0; flex: none; }
.switch input::after { content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 50%; background: var(--sheet); box-shadow: 0 1px 3px rgba(31, 45, 66, 0.3); transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1); }
.switch input:checked { background: var(--m-green); }
.switch input:checked::after { transform: translateX(15px); }
.form-section { padding: 22px 24px; }
.form-section + .form-section { border-top: 1px dashed var(--rule-strong); }
.form-section h3 { margin-bottom: 4px; font-size: 17px; }
.form-section > .hint:first-of-type { margin-bottom: 16px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 24px; border-top: 1px dashed var(--rule-strong); background: var(--sheet-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.choice {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--rule-strong);
  border-radius: 14px; cursor: pointer; background: var(--sheet); transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.choice:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .choice-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.choice .choice-title .icon { color: var(--ink-3); }
.choice .choice-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 70%, var(--sheet)); box-shadow: 0 0 0 1px var(--accent); }
.choice:has(input:checked) .choice-title .icon { color: var(--accent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice-grid.compact .choice { padding: 9px 12px; }

/* ------------------------------------------------------------------ cards */

.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); min-width: 0; box-shadow: var(--shadow); position: relative; }
.card-header { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 20px; border-bottom: 1px dashed var(--rule-strong); }
.card-header h2, .card-header h3 { font-size: 18px; font-weight: 580; color: var(--ink); letter-spacing: -0.01em; }
.card-header .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }
.card-header .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 8px; }
.card-body.flush { padding: 0; }
.card-footer { padding: 12px 20px; border-top: 1px dashed var(--rule-strong); font-size: 13px; background: var(--sheet-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card.pad { padding: 18px 20px; }
.card.hoverable { transition: border-color 0.15s, transform 0.2s, box-shadow 0.2s; }
.card.hoverable:hover { border-color: var(--rule-strong); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
a.card { color: inherit; display: block; }
a.card:hover { text-decoration: none; }
/* Washi tape on featured cards. */
.card.taped::before, .auth-card::before {
  content: ''; position: absolute; top: -11px; left: 50%; width: 92px; height: 24px; margin-left: -46px; transform: rotate(-3deg);
  background: color-mix(in srgb, var(--marker-solid) 55%, transparent);
  clip-path: polygon(0 8%, 5% 0, 10% 10%, 15% 0, 20% 8%, 80% 4%, 85% 0, 90% 10%, 95% 0, 100% 8%, 100% 92%, 95% 100%, 90% 90%, 85% 100%, 80% 92%, 20% 96%, 15% 100%, 10% 90%, 5% 100%, 0 92%);
  opacity: 0.85;
}
.section-title { color: var(--ink-2); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; font-style: italic; font-size: 16px; font-weight: 480; }
.section-title .badge { font-style: normal; font-family: var(--font); }

.callout { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 14px; background: var(--sheet); align-items: flex-start; color: var(--ink); position: relative; overflow: hidden; }
.callout::before { content: ''; flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: var(--blob); background: var(--m-slate); }
.callout.info { background: color-mix(in srgb, var(--m-blue) 8%, var(--sheet)); border-color: color-mix(in srgb, var(--m-blue) 25%, var(--rule)); }
.callout.info::before { background: var(--m-blue); }
.callout.success { background: color-mix(in srgb, var(--m-green) 9%, var(--sheet)); border-color: color-mix(in srgb, var(--m-green) 25%, var(--rule)); }
.callout.success::before { background: var(--m-green); }
.callout.warning { background: color-mix(in srgb, var(--m-amber) 12%, var(--sheet)); border-color: color-mix(in srgb, var(--m-amber) 30%, var(--rule)); }
.callout.warning::before { background: var(--m-amber); }
.callout.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--m-red) 30%, var(--rule)); }
.callout.danger::before { background: var(--m-red); }
.callout > .icon { display: none; }
.callout .callout-body { flex: 1; min-width: 0; color: var(--ink-2); }
.callout .callout-body strong { display: block; margin-bottom: 2px; color: var(--ink); font-weight: 600; }
.callout .callout-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ status tags */

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 9px 0 8px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1;
  background: var(--sheet-3); color: var(--ink-2); border: 0;
}
.badge .dot { width: 8px; height: 8px; border-radius: var(--blob); background: var(--m-gray); flex: none; }
.badge .icon { width: 13px; height: 13px; }
.badge.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--rule-strong); }
.badge.outline .icon { color: var(--ink-3); }
.tone-gray .dot { background: var(--m-gray); }
.tone-slate .dot { background: var(--m-slate); }
.tone-blue .dot { background: var(--m-blue); }
.tone-violet .dot { background: var(--m-violet); }
.tone-teal .dot { background: var(--m-teal); }
.tone-green .dot { background: var(--m-green); }
.tone-amber .dot { background: var(--m-amber); }
.tone-orange .dot { background: var(--m-orange); }
.tone-red .dot { background: var(--m-red); }
.badge.tone-gray { background: color-mix(in srgb, var(--m-gray) 16%, var(--sheet)); }
.badge.tone-slate { background: color-mix(in srgb, var(--m-slate) 14%, var(--sheet)); color: var(--ink); }
.badge.tone-blue { background: color-mix(in srgb, var(--m-blue) 15%, var(--sheet)); color: var(--ink); }
.badge.tone-violet { background: color-mix(in srgb, var(--m-violet) 14%, var(--sheet)); color: var(--ink); }
.badge.tone-teal { background: color-mix(in srgb, var(--m-teal) 15%, var(--sheet)); color: var(--ink); }
.badge.tone-green { background: color-mix(in srgb, var(--m-green) 16%, var(--sheet)); color: var(--success); }
.badge.tone-amber { background: color-mix(in srgb, var(--m-amber) 20%, var(--sheet)); color: var(--warning); }
.badge.tone-orange { background: color-mix(in srgb, var(--m-orange) 15%, var(--sheet)); color: var(--ink); }
.badge.tone-red { background: color-mix(in srgb, var(--m-red) 13%, var(--sheet)); color: var(--danger); }

.label-chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--sheet-2); box-shadow: inset 0 0 0 1px var(--rule); white-space: nowrap; }
.label-chip .swatch { width: 8px; height: 8px; border-radius: var(--blob); }
.ref { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); font-weight: 400; white-space: nowrap; letter-spacing: 0; }
a.ref:hover { color: var(--accent); }

.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; color: var(--ink-2); }
.prio-code { display: inline-grid; place-items: center; min-width: 25px; height: 19px; padding: 0 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.01em; border-radius: 10px; color: var(--ink-3); box-shadow: inset 0 0 0 1.25px var(--rule-strong); line-height: 1; }
.prio-urgent .prio-code { background: var(--m-red); color: #fff; box-shadow: none; }
.prio-high .prio-code { color: var(--m-orange); box-shadow: inset 0 0 0 1.25px var(--m-orange); }
.prio-medium .prio-code { color: var(--ink-2); box-shadow: inset 0 0 0 1.25px var(--ink-3); }
.prio-urgent { color: var(--danger); font-weight: 600; }

.sev { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; color: var(--ink-2); }
.sev-mark { width: 9px; height: 9px; flex: none; border-radius: var(--blob); }
.sev-critical .sev-mark { background: var(--m-red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--m-red) 20%, transparent); }
.sev-critical { color: var(--danger); font-weight: 600; }
.sev-high .sev-mark { background: var(--m-orange); }
.sev-medium .sev-mark { background: var(--m-amber); }
.sev-low .sev-mark { background: var(--m-gray); }

.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700; flex: none; letter-spacing: 0.02em; user-select: none; position: relative; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12); }
.avatar.sm { width: 20px; height: 20px; font-size: 8.5px; }
.avatar.lg { width: 30px; height: 30px; font-size: 11.5px; }
.avatar.xl { width: 44px; height: 44px; font-size: 15px; }
.avatar.unassigned { background: transparent; border: 1.5px dashed var(--rule-strong); color: var(--ink-3); box-shadow: none; }
.avatar.unassigned .icon { width: 11px; height: 11px; }
.avatar.online::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--m-green); border: 2px solid var(--sheet); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--sheet); }
.avatar-stack .avatar + .avatar { margin-left: -6px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.user-chip .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; border: 1px solid var(--rule-strong); border-bottom-width: 2px; background: var(--sheet); font-size: 11px; color: var(--ink-2); font-family: var(--font); font-weight: 600; }

/* ------------------------------------------------------------------ tabs */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px 12px; border: 0; background: none; cursor: pointer; color: var(--ink-3); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tab .icon { display: none; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-selected='true'], .tab.active { color: var(--ink); }
.tab[aria-selected='true']::after, .tab.active::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -2px; height: 6px; background: var(--accent); -webkit-mask: var(--squiggle) repeat-x left center / 12px 6px; mask: var(--squiggle) repeat-x left center / 12px 6px; }
.tab .count { font-size: 11.5px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; background: var(--sheet-3); border-radius: 9px; padding: 1px 7px; }
.tab[aria-selected='true'] .count, .tab.active .count { color: var(--primary-fg); background: var(--primary-bg); }

/* ------------------------------------------------------------------ toolbar */

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { width: 280px; max-width: 100%; }
.toolbar .select, .toolbar .input { width: auto; min-width: 0; }
.toolbar .spacer { flex: 1; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 31px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--rule-strong); background: var(--sheet); font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: all 0.15s; }
.filter-chip:hover { border-color: var(--ink-3); color: var(--ink); }
.filter-chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.bulk-bar { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--ink); color: var(--paper); border-radius: 14px; margin-bottom: 14px; flex-wrap: wrap; box-shadow: var(--float); }
.bulk-bar .select { width: auto; background-color: var(--sheet); color: var(--ink); }

/* ------------------------------------------------------------------ lists & tables */

.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--rule); align-items: center; color: inherit; min-width: 0; transition: background 0.12s; }
.list-item:last-child { border-bottom: 0; }
.card > .list:last-child > .list-item:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card > .list:first-child > .list-item:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
a.list-item:hover, .list-item.clickable:hover { background: var(--hover); text-decoration: none; cursor: pointer; }
.list-item .main-col { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; color: var(--ink); }
.list-item .meta { display: flex; gap: 6px 12px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.list-item .meta > * { display: inline-flex; align-items: center; gap: 4px; }
.list-item .meta .icon { width: 12px; height: 12px; }
.list-item.selected { background: var(--accent-soft); }
.list.compact .list-item { padding: 10px 18px; }

.fb-row .thumb { width: 80px; height: 54px; border-radius: 9px; object-fit: cover; object-position: top left; border: 1px solid var(--rule); background: var(--sheet-3); flex: none; }
.fb-row .thumb.placeholder { display: grid; place-items: center; color: var(--ink-3); background: repeating-linear-gradient(-45deg, var(--sheet-2) 0 6px, var(--sheet-3) 6px 7px); }
.fb-row .vote { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 42px; height: 54px; border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--sheet); cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 15px; flex: none; color: var(--ink-2); transition: all 0.15s; }
.fb-row .vote .icon { width: 11px; height: 11px; }
.fb-row .vote:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.fb-row .vote.voted { border-color: var(--primary-bg); background: var(--primary-bg); color: var(--primary-fg); }
.fb-row .side { display: flex; align-items: center; gap: 12px; flex: none; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; font-weight: 600; font-size: 12.5px; }
.table th .icon { width: 11px; height: 11px; vertical-align: -1px; margin-left: 2px; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--ink); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: var(--hover); }
.table tr.clickable { cursor: pointer; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.num { font-weight: 600; }
.table .title-cell { font-weight: 600; max-width: 440px; }
.table .title-cell a { color: var(--ink); }

/* ------------------------------------------------------------------ empty & loading */

.empty { padding: 36px 28px 40px; color: var(--ink-2); max-width: 520px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.empty .illo { margin-bottom: 14px; }
.empty h3 { margin-bottom: 6px; color: var(--ink); font-size: 20px; font-weight: 560; }
.empty p { margin: 0 0 16px; color: var(--ink-2); max-width: 420px; }
.empty.sm { padding: 20px 18px; text-align: left; align-items: flex-start; max-width: none; margin: 0; }
.empty.sm .illo { margin-bottom: 6px; }
.empty.sm h3 { font-size: 16px; }
.empty.sm p { color: var(--ink-3); font-size: 13px; margin-bottom: 10px; }
.card > .empty, .card-body > .empty, .list > .empty { max-width: none; }
.illo { display: block; flex: none; overflow: visible; }
.loading { display: grid; place-items: center; padding: 72px; color: var(--ink-3); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--rule); border-top-color: var(--accent); border-right-color: var(--marker-solid); animation: spin 0.9s cubic-bezier(0.5, 0.2, 0.5, 0.8) infinite; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.refreshing { opacity: 0.6; transition: opacity 0.2s; }

/* ------------------------------------------------------------------ meters & progress */

.meter { height: 7px; background: var(--sheet-3); overflow: hidden; border-radius: 4px; box-shadow: inset 0 1px 1px rgba(44, 59, 80, 0.06); }
.meter > span { display: block; height: 100%; background: var(--m-blue); border-radius: 4px; transition: width 0.5s cubic-bezier(0.3, 1, 0.4, 1); }
.meter.good > span { background: var(--good); }
.meter.warn > span { background: var(--warn); }
.meter.bad > span { background: var(--bad); }
.meter.lg { height: 11px; border-radius: 6px; }
.meter.lg > span { border-radius: 6px; }
.meter-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; gap: 12px; }

.stepper { display: flex; align-items: flex-start; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; font-size: 12.5px; color: var(--ink-3); text-align: center; min-width: 0; }
.step::before { content: ''; position: absolute; top: 7px; left: calc(-50% + 11px); right: calc(50% + 11px); height: 0; border-top: 1.5px dashed var(--rule-strong); }
.step:first-child::before { display: none; }
.step .step-dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--rule-strong); background: var(--sheet); display: grid; place-items: center; z-index: 1; }
.step .step-dot .icon { width: 10px; height: 10px; stroke-width: 2.6; }
.step.done { color: var(--ink-2); }
.step.done .step-dot { background: var(--m-green); border-color: var(--m-green); color: #fff; }
.step.done::before, .step.current::before { border-top-style: solid; border-color: var(--m-green); }
.step.current { color: var(--ink); font-weight: 600; }
.step.current .step-dot { border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.step.current .step-dot::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.step.stopped .step-dot { border-color: var(--ink-3); background: var(--sheet-3); color: var(--ink-3); }

/* ------------------------------------------------------------------ metrics (index cards) */

.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.metric {
  --pig: var(--m-blue);
  position: relative; padding: 16px 18px 15px; color: inherit; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.metric::after { content: ''; position: absolute; right: -18px; top: -20px; width: 64px; height: 58px; border-radius: var(--blob); background: var(--pig); opacity: 0.16; transition: transform 0.4s; }
.metric:nth-child(6n + 1) { --pig: var(--m-orange); }
.metric:nth-child(6n + 2) { --pig: var(--m-blue); }
.metric:nth-child(6n + 3) { --pig: var(--m-green); }
.metric:nth-child(6n + 4) { --pig: var(--m-amber); }
.metric:nth-child(6n + 5) { --pig: var(--m-violet); }
.metric:nth-child(6n + 6) { --pig: var(--m-teal); }
a.metric:hover { text-decoration: none; transform: translateY(-3px) rotate(-0.4deg); box-shadow: var(--shadow-lift); border-color: var(--rule-strong); }
a.metric:hover::after { transform: scale(1.25) rotate(20deg); }
.metric-label { color: var(--ink-2); font-size: 13px; font-weight: 600; position: relative; z-index: 1; }
.metric-value { font-size: 42px; font-weight: 480; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: lining-nums; position: relative; z-index: 1; }
.metric-value .faint { font-family: var(--font); letter-spacing: 0; }
.metric-foot { font-size: 12.5px; color: var(--ink-3); min-height: 19px; line-height: 1.4; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; color: inherit; }
a.kpi:hover { text-decoration: none; border-color: var(--rule-strong); }
.kpi .kpi-label { color: var(--ink-2); display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.kpi .kpi-value { font-size: 36px; font-weight: 480; letter-spacing: -0.03em; line-height: 1.1; }
.kpi .kpi-foot { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; min-height: 19px; }
.kpi .kpi-foot .meter { flex: 1; }
.delta { font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; gap: 2px; padding: 0 5px; border-radius: 6px; }
.delta .icon { width: 11px; height: 11px; }
.delta.up-good, .delta.down-good { color: var(--success); background: color-mix(in srgb, var(--m-green) 14%, transparent); }
.delta.up-bad, .delta.down-bad { color: var(--danger); background: color-mix(in srgb, var(--m-red) 12%, transparent); }
.delta.flat { color: var(--ink-3); }
.hero-number { font-size: 60px; font-weight: 440; letter-spacing: -0.04em; line-height: 0.95; font-variation-settings: 'SOFT' 100, 'WONK' 1; }

/* ------------------------------------------------------------------ charts */

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--ink-3); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .crosshair { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart .end-label { font-size: 11.5px; fill: var(--ink-2); font-weight: 600; }
.chart .hit { fill: transparent; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 14px; }
.chart-legend .key { display: inline-flex; align-items: center; gap: 8px; }
.chart-legend .swatch-line { width: 16px; height: 3px; border-radius: 2px; }
.chart-legend .swatch-rect { width: 10px; height: 10px; border-radius: 3px; }
.chart-tooltip { position: fixed; z-index: 200; pointer-events: none; background: var(--sheet); border-radius: 12px; box-shadow: var(--float); padding: 9px 12px; font-size: 12.5px; min-width: 140px; opacity: 0; transform: translateY(3px); transition: opacity 0.1s, transform 0.1s; }
.chart-tooltip.show { opacity: 1; transform: none; }
.chart-tooltip .tt-title { font-family: var(--serif); font-style: italic; font-size: 13.5px; color: var(--ink-2); margin-bottom: 5px; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 8px; line-height: 1.7; }
.chart-tooltip .tt-row .v { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 22px; }
.chart-tooltip .tt-row .n { color: var(--ink-2); }
.chart-tooltip .tt-key { width: 12px; height: 3px; flex: none; border-radius: 2px; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(88px, 36%) 1fr; gap: 12px; align-items: center; font-size: 13px; }
.bar-row .bar-label { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 7px; }
.bar-row .bar-label .icon { color: var(--ink-3); }
.bar-row .bar-track { position: relative; height: 16px; display: flex; align-items: center; gap: 8px; }
.bar-row .bar-fill { height: 12px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 3px; transition: width 0.5s cubic-bezier(0.3, 1, 0.4, 1); }
.bar-row .bar-fill.zero { background: var(--rule-strong); }
.bar-row .bar-value { color: var(--ink); font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; }
a.bar-row { color: inherit; }
a.bar-row:hover { text-decoration: none; }
a.bar-row:hover .bar-label { color: var(--ink); }
a.bar-row:hover .bar-fill { filter: brightness(1.1); }

.score-mark { display: inline-flex; flex-direction: column; gap: 6px; flex: none; }
.score-mark .score-num { font-family: var(--serif); font-variation-settings: 'SOFT' 100; font-weight: 520; font-variant-numeric: lining-nums tabular-nums; line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.score-mark .score-num small { font-family: var(--font); font-size: 0.36em; color: var(--ink-3); margin-left: 3px; font-weight: 500; letter-spacing: 0; }
.score-mark .score-bar { height: 5px; background: var(--sheet-3); position: relative; border-radius: 3px; overflow: hidden; }
.score-mark .score-bar span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; }
.score-mark.good .score-bar span { background: var(--good); }
.score-mark.warn .score-bar span { background: var(--warn); }
.score-mark.bad .score-bar span { background: var(--bad); }
.score-mark.none .score-num { color: var(--ink-3); }
.score-mark.sm { width: 40px; } .score-mark.sm .score-num { font-size: 18px; } .score-mark.sm .score-bar { height: 4px; }
.score-mark.md { width: 64px; } .score-mark.md .score-num { font-size: 28px; }
.score-mark.lg { width: 120px; } .score-mark.lg .score-num { font-size: 52px; letter-spacing: -0.04em; } .score-mark.lg .score-bar { height: 8px; border-radius: 4px; }
.score-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 22px; font-weight: 700; font-size: 12px; padding: 0 7px; border-radius: 8px; font-variant-numeric: tabular-nums; background: var(--sheet-3); }
.score-good { background: color-mix(in srgb, var(--good) 18%, var(--sheet)); color: var(--success); }
.score-ok { background: color-mix(in srgb, var(--warn) 22%, var(--sheet)); color: var(--warning); }
.score-bad { background: color-mix(in srgb, var(--bad) 15%, var(--sheet)); color: var(--danger); }

/* ------------------------------------------------------------------ workflow health */

.health-item { display: flex; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--rule); align-items: flex-start; }
.health-item::before { content: ''; flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: var(--blob); background: var(--m-slate); }
a.health-item { align-items: center; }
a.health-item::before { margin-top: 0; }
a.health-item:hover { background: var(--hover); text-decoration: none; }
.health-item:last-child { border-bottom: 0; }
.health-item.critical::before { background: var(--m-red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--m-red) 20%, transparent); }
.health-item.warning::before { background: var(--m-amber); }
.health-item.info::before { background: var(--m-blue); }
.health-item .h-count { font-family: var(--serif); font-weight: 600; font-size: 17px; font-variant-numeric: lining-nums tabular-nums; }
.health-summary { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ kanban */

.board-wrap { overflow-x: auto; padding-bottom: 14px; margin: 0 -40px; padding-left: 40px; padding-right: 40px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr); gap: 14px; align-items: start; min-height: 60vh; }
.column { background: color-mix(in srgb, var(--paper-2) 80%, var(--paper)); border: 1px solid var(--rule); border-radius: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 230px); min-width: 0; transition: background 0.15s, border-color 0.15s; }
.column-header { display: flex; align-items: center; gap: 8px; padding: 13px 14px 10px 16px; color: var(--ink); font-size: 16px; }
.column-header .badge { font-family: var(--serif); font-variation-settings: 'SOFT' 100; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; background: transparent; padding: 0; height: auto; color: var(--ink); gap: 8px; }
.column-header .badge .dot { width: 11px; height: 11px; }
.column-header .count { color: var(--ink-3); font-variant-numeric: tabular-nums; font-family: var(--font); font-size: 12px; font-weight: 700; background: var(--sheet); border-radius: 9px; padding: 1px 8px; box-shadow: inset 0 0 0 1px var(--rule); }
.column-header .col-desc { color: var(--ink-3); font-family: var(--font); font-size: 12px; }
.column-body { padding: 4px 10px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 90px; flex: 1; }
.column.drag-over { border-color: var(--accent); border-style: dashed; background: color-mix(in srgb, var(--accent-soft) 60%, var(--paper)); }
.column-gate { margin: 0 10px 6px; padding: 7px 10px; font-size: 12px; color: var(--ink-2); border: 1.5px dashed var(--rule-strong); border-radius: 12px; display: flex; gap: 6px; align-items: center; font-family: var(--serif); font-style: italic; }
.kcard { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px; cursor: grab; display: flex; flex-direction: column; gap: 9px; color: inherit; box-shadow: 0 1px 0 var(--rule), 0 6px 14px -12px rgba(44, 59, 80, 0.4); transition: border-color 0.15s, opacity 0.15s, transform 0.2s, box-shadow 0.2s; }
.kcard:nth-child(3n + 1):hover { transform: translateY(-2px) rotate(-0.5deg); }
.kcard:nth-child(3n + 2):hover { transform: translateY(-2px) rotate(0.4deg); }
.kcard:nth-child(3n):hover { transform: translateY(-2px) rotate(-0.25deg); }
.kcard:hover { border-color: var(--rule-strong); text-decoration: none; box-shadow: var(--shadow-lift); }
.kcard.dragging { opacity: 0.4; transform: rotate(2deg); }
.kcard .k-title { font-weight: 600; font-size: 14px; line-height: 1.38; color: var(--ink); }
.kcard .k-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.kcard .k-meta > span { display: inline-flex; align-items: center; gap: 3px; }
.kcard .k-meta .icon { width: 12px; height: 12px; }
.kcard .k-thumb { height: 90px; border-radius: 9px; object-fit: cover; object-position: top left; width: 100%; border: 1px solid var(--rule); }
.kcard.blocked { border-left: 4px solid var(--m-red); }
.drop-marker { height: 3px; background: var(--accent); margin: -1px 4px; border-radius: 2px; }
.quick-add { margin: 0 10px 10px; }
.overdue { color: var(--danger) !important; font-weight: 600; }

/* ------------------------------------------------------------------ detail pages */

.detail-title { font-family: var(--serif); font-variation-settings: 'SOFT' 100; font-size: 32px; font-weight: 560; line-height: 1.15; letter-spacing: -0.02em; word-break: break-word; }
.detail-title[contenteditable='true'] { outline: none; padding: 2px 6px; margin: -2px -6px; border-radius: 10px; }
.detail-title[contenteditable='true']:hover { background: var(--hover); }
.detail-title[contenteditable='true']:focus { box-shadow: 0 0 0 4px var(--ring); background: var(--sheet); }
.prop-list { display: flex; flex-direction: column; }
.prop { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 0; font-size: 13.5px; min-height: 42px; }
.prop + .prop { border-top: 1px dashed var(--rule); }
.prop .prop-label { color: var(--ink-3); font-size: 13px; }
.prop .select, .prop .input { min-height: 32px; padding-top: 4px; padding-bottom: 4px; font-size: 13.5px; border-color: transparent; background-color: transparent; box-shadow: none; }
.prop .select:hover, .prop .input:hover { border-color: var(--rule-strong); background-color: var(--sheet); }
.prop .select:focus, .prop .input:focus { border-color: var(--accent); background-color: var(--sheet); box-shadow: 0 0 0 4px var(--ring); }
.prose { font-size: 14.5px; line-height: 1.7; word-wrap: break-word; overflow-wrap: anywhere; }
.prose p { margin: 0 0 0.85em; }
.prose ul, .prose ol { margin: 0 0 0.85em; padding-left: 1.4em; }
.prose li::marker { color: var(--accent); }
.prose code { background: var(--sheet-3); padding: 1px 5px; border-radius: 5px; }
.prose pre { background: var(--sheet-2); border: 1px solid var(--rule); padding: 12px 14px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 0 0 0.85em; padding: 2px 0 2px 16px; border-left: 3px solid var(--marker-solid); color: var(--ink-2); font-family: var(--serif); font-style: italic; font-size: 15.5px; }
.prose h1, .prose h2, .prose h3 { margin: 1em 0 0.45em; font-size: 17px; }
.prose .mention { color: var(--accent); font-weight: 600; background: var(--accent-soft); padding: 0 4px; border-radius: 5px; }
.prose .task-ref { font-family: var(--mono); font-size: 12px; }
.prose.empty-text { color: var(--ink-3); font-style: italic; font-family: var(--serif); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; margin: 0; }
.kv dt { color: var(--ink-3); font-size: 12.5px; padding-top: 1px; }
.kv dd { margin: 0; color: var(--ink-2); word-break: break-word; }
.repro { display: grid; gap: 16px; }
.repro h4 { font-family: var(--serif); font-variation-settings: 'SOFT' 100; font-style: italic; font-size: 15px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
.linked-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--sheet); color: inherit; transition: border-color 0.15s, transform 0.15s; }
.linked-item + .linked-item { margin-top: 8px; }
a.linked-item:hover { border-color: var(--rule-strong); text-decoration: none; transform: translateX(2px); }
.linked-item .thumb { width: 44px; height: 30px; border-radius: 6px; object-fit: cover; object-position: top left; flex: none; border: 1px solid var(--rule); }

/* ------------------------------------------------------------------ attachments */

.dropzone { border: 1.5px dashed var(--rule-strong); border-radius: 16px; padding: 18px 20px; color: var(--ink-2); background: var(--sheet-2); transition: border-color 0.15s, background 0.15s; cursor: pointer; display: flex; align-items: center; gap: 16px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--sheet)); }
.dropzone:hover .dz-icon, .dropzone.over .dz-icon { transform: rotate(-8deg) scale(1.05); }
.dropzone .dz-icon { width: 44px; height: 44px; border-radius: var(--blob); background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); flex: none; transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); }
.dropzone strong { color: var(--ink); font-weight: 600; }
.dropzone .dz-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.dropzone.compact { padding: 12px 14px; }
.dropzone.compact .dz-icon { width: 34px; height: 34px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.thumbs.lg { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.thumb-card { position: relative; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--sheet); display: flex; flex-direction: column; box-shadow: 0 6px 14px -12px rgba(44, 59, 80, 0.45); transition: transform 0.2s; }
.thumb-card:hover { transform: translateY(-2px); }
.thumb-card .thumb-img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; object-position: top left; background: var(--sheet-3); cursor: zoom-in; display: block; border-bottom: 1px solid var(--rule); }
.thumb-card .thumb-file { aspect-ratio: 16 / 10; display: grid; place-items: center; background: var(--sheet-2); color: var(--ink-3); border-bottom: 1px solid var(--rule); }
.thumb-card .thumb-meta { padding: 7px 10px; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; min-height: 32px; }
.thumb-card .thumb-meta .ref { font-size: 10.5px; }
.thumb-card .thumb-actions { position: absolute; top: 7px; right: 7px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.thumb-card .thumb-actions .btn { background: var(--sheet); }
.thumb-card:hover .thumb-actions, .thumb-card:focus-within .thumb-actions { opacity: 1; }
.thumb-card .kind-tag { position: absolute; top: 7px; left: 7px; font-size: 11px; font-weight: 700; }
.thumb-card .progress { position: absolute; left: 0; right: 0; bottom: 32px; height: 3px; background: var(--sheet-3); }
.thumb-card .progress span { display: block; height: 100%; background: var(--accent); }
.thumb-card.uploading .thumb-img { opacity: 0.5; }
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.before-after figure { margin: 0; }
.before-after figcaption { margin-bottom: 7px; display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); font-family: var(--serif); font-style: italic; }
.before-after img { border: 1px solid var(--rule); cursor: zoom-in; width: 100%; border-radius: 10px; }

.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(7, 20, 38, 0.95); display: flex; flex-direction: column; color: #e4e9ef; animation: fade 0.15s ease-out; }
.lightbox-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid rgba(240, 243, 246, 0.08); font-size: 13px; }
.lightbox-bar .btn { background: transparent; border-color: rgba(240, 243, 246, 0.2); color: #e4e9ef; box-shadow: none; }
.lightbox-bar .btn:hover { background: rgba(240, 243, 246, 0.08); }
.lightbox-stage { flex: 1; display: grid; place-items: center; overflow: auto; padding: 16px 64px 24px; position: relative; }
.lightbox-stage img, .lightbox-stage video { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 6px; }
.lightbox-stage.zoomed { place-items: start; }
.lightbox-stage.zoomed img { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev { left: 14px; } .lightbox-nav.next { right: 14px; }
.lightbox-nav .btn { width: 42px; height: 42px; border-radius: 50%; }

.annotator { position: fixed; inset: 0; z-index: 310; background: #071426; display: flex; flex-direction: column; color: #e4e9ef; }
.annotator-bar { display: flex; align-items: center; gap: 4px; padding: 9px 14px; border-bottom: 1px solid #1f2d42; flex-wrap: wrap; background: #0f1d30; }
.annotator-bar .sep { width: 1px; height: 24px; background: #253448; margin: 0 6px; }
.annotator-bar .tool { width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: #b7c2d3; display: grid; place-items: center; cursor: pointer; }
.annotator-bar .tool:hover { background: #1b293d; color: #fff; }
.annotator-bar .tool[aria-pressed='true'] { background: #e4e9ef; color: #18263a; }
.annotator-bar .color { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(240, 243, 246, 0.25); cursor: pointer; padding: 0; margin: 0 2px; }
.annotator-bar .color[aria-pressed='true'] { box-shadow: 0 0 0 2px #0f1d30, 0 0 0 4px #5aabe0; }
.annotator-bar .btn { background: transparent; border-color: #344358; color: #e4e9ef; box-shadow: none; }
.annotator-bar .btn:hover { background: #1b293d; }
.annotator-bar .btn.primary { background: #2991d6; border-color: #2991d6; color: #0b182b; }
.annotator-bar select { background: #1b293d; color: #e4e9ef; border: 1px solid #344358; border-radius: 10px; height: 32px; padding: 0 8px; font-size: 13px; }
.annotator-stage { flex: 1; overflow: auto; display: grid; place-items: center; padding: 20px; }
.annotator-stage canvas { max-width: 100%; max-height: calc(100vh - 100px); box-shadow: 0 0 0 1px #1f2d42, 0 20px 40px -10px rgba(0, 0, 0, 0.6); cursor: crosshair; touch-action: none; background: #fff; border-radius: 4px; }
.annotator-text-input { position: fixed; z-index: 320; font: 600 18px var(--font); background: #fff; color: #18263a; border: 1.5px solid #18263a; border-radius: 6px; padding: 2px 6px; min-width: 140px; outline: none; }
.annotator .tip { font-family: var(--serif); font-style: italic; font-size: 13px; color: #8698b1; margin-left: auto; }

/* ------------------------------------------------------------------ discussion & history */

.thread { display: flex; flex-direction: column; gap: 18px; }
.comment { display: flex; gap: 12px; }
.comment .bubble { flex: 1; min-width: 0; }
.comment .c-head { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; margin-bottom: 5px; }
.comment .c-head .who { font-weight: 700; }
.comment .c-head .when { color: var(--ink-3); font-size: 12px; }
.comment .c-actions { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.comment:hover .c-actions, .comment:focus-within .c-actions { opacity: 1; }
.comment .c-body { background: var(--sheet-2); border: 1px solid var(--rule); padding: 10px 14px; border-radius: 4px 16px 16px 16px; }
.comment .c-body .thumbs { margin-top: 8px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.composer { border: 1px solid var(--rule-strong); border-radius: 16px; background: var(--sheet); transition: border-color 0.15s, box-shadow 0.15s; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.composer textarea { border: 0; background: transparent; width: 100%; resize: vertical; min-height: 76px; padding: 12px 14px; outline: none; line-height: 1.55; }
.composer .composer-bar { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-top: 1px dashed var(--rule-strong); background: var(--sheet-2); border-radius: 0 0 16px 16px; }
.composer .composer-files { padding: 0 14px 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.composer .composer-files .mini { position: relative; width: 64px; height: 44px; border-radius: 8px; overflow: hidden; border: 1px solid var(--rule); }
.composer .composer-files .mini img { width: 100%; height: 100%; object-fit: cover; }
.composer .composer-files .mini button { position: absolute; top: 2px; right: 2px; width: 17px; height: 17px; border: 0; border-radius: 50%; background: rgba(24, 38, 58, 0.75); color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }

.timeline { position: relative; display: flex; flex-direction: column; }
.timeline .t-item { display: flex; gap: 11px; padding: 7px 0; font-size: 13.5px; color: var(--ink-2); position: relative; }
.timeline .t-item::before { content: ''; position: absolute; left: 11px; top: 32px; bottom: -6px; width: 0; border-left: 1.5px dashed var(--rule-strong); }
.timeline .t-item:last-child::before { display: none; }
.timeline .t-icon { width: 23px; height: 23px; border-radius: 50%; background: var(--sheet-3); color: var(--ink-3); display: grid; place-items: center; flex: none; z-index: 1; }
.timeline .t-icon .icon { width: 12px; height: 12px; }
.timeline .t-icon .avatar { width: 23px; height: 23px; font-size: 9px; }
.timeline .t-body { flex: 1; min-width: 0; padding-top: 2px; line-height: 1.5; }
.timeline .t-body strong { color: var(--ink); font-weight: 700; }
.timeline .t-when { color: var(--ink-3); font-size: 12px; white-space: nowrap; padding-top: 3px; }
.timeline .t-item.status .t-icon { background: var(--accent-soft); color: var(--accent); }
.timeline .t-item.verified .t-icon { background: color-mix(in srgb, var(--m-green) 18%, var(--sheet)); color: var(--success); }
.timeline .t-item.reopened .t-icon, .timeline .t-item.deleted .t-icon { background: var(--danger-soft); color: var(--danger); }
.day-divider { color: var(--ink-2); padding: 20px 0 8px; font-style: italic; font-size: 16px; display: flex; align-items: center; gap: 12px; }
.day-divider::after { content: ''; flex: 1; height: 6px; background: var(--rule-strong); -webkit-mask: var(--squiggle) repeat-x left center / 14px 6px; mask: var(--squiggle) repeat-x left center / 14px 6px; }

/* ------------------------------------------------------------------ overlays */

.overlay { position: fixed; inset: 0; z-index: 100; background: var(--overlay-bg); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 9vh 16px 16px; overflow-y: auto; animation: fade 0.15s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.modal { background: var(--sheet); border-radius: var(--r-xl); box-shadow: var(--float); width: 100%; max-width: 540px; display: flex; flex-direction: column; animation: rise 0.22s cubic-bezier(0.3, 1.3, 0.5, 1); max-height: calc(100vh - 9vh - 16px); }
.modal.md { max-width: 660px; } .modal.lg { max-width: 840px; } .modal.xl { max-width: 1100px; }
.modal-header { display: flex; align-items: center; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px dashed var(--rule-strong); }
.modal-header h2 { font-size: 21px; flex: 1; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px dashed var(--rule-strong); background: var(--sheet-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.modal-footer .left { margin-right: auto; display: flex; gap: 8px; align-items: center; }

.menu { position: fixed; z-index: 250; min-width: 210px; max-width: 330px; max-height: 380px; overflow-y: auto; background: var(--sheet); border-radius: 16px; box-shadow: var(--float); padding: 6px; animation: rise 0.14s ease-out; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; font-size: 13.5px; color: var(--ink); text-align: left; }
.menu-item .icon { width: 15px; height: 15px; color: var(--ink-3); }
.menu-item:hover, .menu-item.focused, .menu-item:focus-visible { background: var(--hover); text-decoration: none; outline: none; }
.menu-item:hover .icon { color: var(--accent); }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.menu-item .hint { margin-left: auto; }
.menu-item .check { margin-left: auto; color: var(--accent); }
.menu-sep { height: 1px; background: var(--rule); margin: 5px 4px; }
.menu-heading { color: var(--ink-3); padding: 8px 10px 5px; font-size: 14px; font-style: italic; }
.menu .input { margin: 4px 0; }

.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 400; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 11px; min-width: 260px; max-width: 430px; padding: 11px 12px 11px 16px; background: var(--ink); color: var(--paper); border-radius: 16px; box-shadow: var(--float); font-size: 13.5px; animation: toast-in 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) rotate(1.5deg); } }
.toast::before { content: ''; flex: none; width: 10px; height: 10px; border-radius: var(--blob); background: var(--marker-solid); }
.toast.success::before { background: #9cc58a; }
.toast.error::before { background: #f0907f; }
.toast .toast-action { margin-left: auto; background: none; border: 0; color: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.toast .toast-close { background: none; border: 0; color: inherit; opacity: 0.6; cursor: pointer; padding: 3px; display: grid; margin-left: auto; border-radius: 50%; }
.toast .toast-close:hover { opacity: 1; }
.toast .toast-action + .toast-close { margin-left: 0; }

.palette { max-width: 660px; padding: 0; overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px dashed var(--rule-strong); }
.palette-input .icon { color: var(--accent); width: 18px; height: 18px; }
.palette-input input { border: 0; outline: none; background: none; flex: 1; font-size: 17px; }
.palette-results { max-height: 440px; overflow-y: auto; padding: 8px; }
.palette-group { color: var(--ink-3); padding: 10px 12px 5px; font-size: 14px; font-style: italic; }
.palette-item { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 11px; cursor: pointer; color: var(--ink); }
.palette-item .icon { color: var(--ink-3); }
.palette-item.focused { background: var(--marker); }
.palette-item.focused .icon { color: var(--ink); }
.palette-item .p-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-footer { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px dashed var(--rule-strong); font-size: 12px; color: var(--ink-3); background: var(--sheet-2); }

.notif-panel { width: 390px; max-width: calc(100vw - 24px); max-height: 540px; padding: 0; display: flex; flex-direction: column; }
.notif-head { display: flex; align-items: center; padding: 12px 14px 10px 18px; border-bottom: 1px dashed var(--rule-strong); font-family: var(--serif); font-variation-settings: 'SOFT' 100; font-size: 18px; font-weight: 580; color: var(--ink); }
.notif-head .btn { font-family: var(--font); }
.notif-list { overflow-y: auto; }
.notif { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--rule); color: inherit; font-size: 13.5px; }
.notif:hover { background: var(--hover); text-decoration: none; }
.notif.unread { background: color-mix(in srgb, var(--marker-solid) 9%, var(--sheet)); }
.notif .n-dot { width: 8px; height: 8px; border-radius: var(--blob); background: var(--accent); margin-top: 7px; flex: none; }
.notif .n-dot.read { background: transparent; }
.notif .n-title { font-weight: 600; }
.notif .n-body { color: var(--ink-2); font-size: 13px; }
.notif .n-when { color: var(--ink-3); font-size: 12px; margin-top: 3px; }

.live-pill { position: fixed; top: calc(var(--topbar-h) + 14px); left: 50%; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--paper); border: 0; border-radius: 20px; padding: 8px 16px; font-weight: 600; font-size: 13.5px; box-shadow: var(--float); cursor: pointer; display: flex; gap: 7px; align-items: center; animation: rise 0.25s cubic-bezier(0.3, 1.4, 0.5, 1); }
.live-pill:hover { background: var(--accent); }

/* ------------------------------------------------------------------ sign in */

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.1fr) minmax(0, 1fr); }
.auth-aside { background: var(--grain), var(--paper-2); border-right: 1px solid var(--rule); color: var(--ink-2); padding: 44px 56px 36px; display: flex; flex-direction: column; gap: 26px; position: relative; overflow: hidden; }
.auth-aside::before { content: ''; position: absolute; right: -120px; bottom: -140px; width: 380px; height: 340px; border-radius: var(--blob); background: var(--illo-c); opacity: 0.45; }
.auth-aside > * { position: relative; }
.auth-aside .brand { padding: 0; }
.auth-aside h2 { font-size: clamp(34px, 3.6vw, 50px); line-height: 1.05; font-weight: 520; letter-spacing: -0.03em; color: var(--ink); max-width: 560px; margin-top: auto; }
.auth-aside .illo { width: min(100%, 420px); height: auto; margin: -6px 0 -8px; }
.auth-aside p { color: var(--ink-2); max-width: 460px; margin: 0; }
.auth-steps { list-style: none; margin: 0 0 auto; padding: 0; max-width: 480px; display: grid; gap: 2px; counter-reset: step; }
.auth-steps li { display: grid; grid-template-columns: 34px 1fr; align-items: baseline; padding: 7px 0; font-size: 14.5px; }
.auth-steps li span:first-child { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--accent); line-height: 1; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.auth-steps li span:last-child { color: var(--ink-2); }
.auth-aside .foot { font-family: var(--serif); font-style: italic; font-size: 13.5px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { position: relative; width: 100%; max-width: 410px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-xl); box-shadow: var(--shadow-lift); padding: 36px 34px 30px; transform: rotate(0.4deg); }
.auth-card > * { transform: rotate(-0.4deg); }
.auth-card h1 { font-size: 30px; margin-bottom: 6px; }
.auth-card .lead { color: var(--ink-2); margin-bottom: 24px; }
.auth-switch { margin-top: 20px; font-size: 13.5px; color: var(--ink-3); }

/* ------------------------------------------------------------------ audits & checks */

.audit-section { margin-bottom: 24px; }
.audit-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.audit-section-head h3 { font-size: 18px; }
.audit-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 14px 20px; border-bottom: 1px solid var(--rule); align-items: start; transition: background 0.15s; }
.audit-item:last-child { border-bottom: 0; }
.audit-item.result-fail { background: var(--danger-soft); box-shadow: inset 4px 0 0 var(--m-red); }
.audit-item.result-pass .ai-text { color: var(--ink-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--m-green) 60%, transparent); text-decoration-thickness: 1.5px; }
.audit-item .ai-text { font-weight: 600; }
.audit-item .ai-guidance { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.audit-item .ai-extra { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }
.result-toggle { display: inline-flex; padding: 3px; gap: 2px; border-radius: 13px; background: color-mix(in srgb, var(--ink) 6%, var(--paper)); border: 1px solid var(--rule); }
.result-toggle button { border: 0; background: transparent; padding: 0 11px; height: 28px; border-radius: 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink-3); display: inline-flex; gap: 5px; align-items: center; transition: all 0.15s; }
.result-toggle button .icon { width: 13px; height: 13px; }
.result-toggle button:hover { color: var(--ink); }
.result-toggle button[aria-pressed='true'][data-result='pass'] { background: var(--m-green); color: #fff; }
.result-toggle button[aria-pressed='true'][data-result='fail'] { background: var(--m-red); color: #fff; }
.result-toggle button[aria-pressed='true'][data-result='na'] { background: var(--ink-2); color: var(--sheet); }
.check-issue { padding: 14px 20px; border-bottom: 1px solid var(--rule); display: flex; gap: 12px; align-items: flex-start; }
.check-issue:last-child { border-bottom: 0; }
.check-issue .ci-icon { flex: none; margin-top: 1px; }
.check-issue .ci-detail { white-space: pre-wrap; font-size: 12px; color: var(--ink-2); margin-top: 8px; font-family: var(--mono); background: var(--sheet-2); border: 1px solid var(--rule); padding: 8px 10px; border-radius: 10px; max-height: 170px; overflow: auto; }
.sev-icon-error { color: var(--m-red); }
.sev-icon-warning { color: var(--m-amber); }
.sev-icon-info { color: var(--m-blue); }
.sev-icon-pass { color: var(--m-green); }
.new-flag { font-size: 11px; font-weight: 700; color: var(--ink); background: var(--marker-solid); padding: 2px 7px; border-radius: 7px; transform: rotate(-2deg); display: inline-block; }
.cat-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 10px; }
.cat-score { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 14px; background: var(--sheet); text-align: left; cursor: pointer; color: inherit; font: inherit; transition: all 0.15s; }
.cat-score:hover { border-color: var(--rule-strong); transform: translateY(-1px); }
.cat-score[aria-pressed='true'] { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 60%, var(--sheet)); box-shadow: 0 0 0 1px var(--accent); }

/* ------------------------------------------------------------------ changelog */

.changelog-week { margin-bottom: 26px; }
.changelog-week h3 { font-family: var(--serif); font-style: italic; font-size: 17px; font-weight: 500; color: var(--ink-2); margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.changelog-week h3::after { content: ''; flex: 1; height: 6px; background: var(--rule-strong); -webkit-mask: var(--squiggle) repeat-x left center / 14px 6px; mask: var(--squiggle) repeat-x left center / 14px 6px; }
.changelog-week h3 .icon { display: none; }
.changelog-entry { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--rule); align-items: flex-start; }
.changelog-entry:last-child { border-bottom: 0; }
.changelog-entry .check-mark { width: 20px; height: 20px; border-radius: 50%; background: var(--m-green); color: #fff; display: grid; place-items: center; flex: none; margin-top: 1px; }
.changelog-entry .check-mark .icon { width: 12px; height: 12px; stroke-width: 2.2; }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .detail-side { position: static; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: 272px; transform: translateX(-100%); transition: transform 0.28s cubic-bezier(0.3, 1.1, 0.5, 1), visibility 0.28s; visibility: hidden; }
  .app.nav-open .sidebar { transform: none; visibility: visible; box-shadow: var(--float); }
  .app.nav-open::after { content: ''; position: fixed; inset: 0; background: var(--overlay-bg); z-index: 50; }
  .topbar { padding: 0 14px; }
  .topbar .menu-toggle { display: inline-flex; }
  .search-trigger .label-text, .search-trigger kbd { display: none; }
  .search-trigger { width: 38px; justify-content: center; padding: 0; }
  .page { padding: 22px 16px 48px; }
  .page-header { margin-bottom: 22px; }
  .page-header h1 { font-size: 28px; }
  .detail-title { font-size: 26px; }
  .board-wrap { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-value { font-size: 34px; }
  .hide-sm { display: none !important; }
  .fb-row .thumb { display: none; }
  .choice-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .before-after { grid-template-columns: 1fr; }
  .toolbar .search { width: 100%; }
  .audit-item { grid-template-columns: minmax(0, 1fr); }
  .lightbox-stage { padding: 8px 8px 24px; }
  .modal-footer { flex-wrap: wrap; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { padding: 26px 22px 22px; gap: 14px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .auth-aside h2 { font-size: 30px; margin-top: 4px; }
  .auth-aside .illo { width: 260px; margin: 0; }
  .auth-steps, .auth-aside .foot { display: none; }
  .auth-card { transform: none; padding: 28px 22px 24px; }
  .auth-card > * { transform: none; }
}
@media (max-width: 520px) {
  .btn .btn-text { display: none; }
  .step { font-size: 10.5px; line-height: 1.3; padding: 0 2px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { min-width: 0; width: 100%; }
  .page-header h1 { font-size: 26px; }
}

@media print {
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .app { display: block; }
  .page { padding: 0; max-width: none; animation: none; }
  .card { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
