/*
 * Lenn dashboard demo. The visual language is the landing page's: warm paper,
 * ink, one red accent, Geist with Instrument Serif italic accents, generous
 * radii and soft shadows. The component class names follow the real dashboard.
 * Breakpoints: sm 640, md 768, lg 1024, xl 1280.
 */

:root {
  --background: #F4F2ED;
  --background-2: #EBE8E1;
  --foreground: #0E0F12;
  --ink-2: #4A4D55;
  --muted: #ECE9E3;
  --muted-foreground: #6B6E76;
  --card: #FFFFFF;
  --card-2: #FAF9F6;
  --border: #E4E0D7;
  --line-strong: #D6D1C6;
  --input: #D9D4CA;
  --ring: rgba(224, 70, 47, 0.5);
  --primary: #0E0F12;
  --primary-foreground: #F4F2ED;
  --secondary: #ECE9E3;
  --secondary-foreground: #0E0F12;
  --accent: #EFECE6;
  --accent-foreground: #0E0F12;
  --red: #E0462F;
  --red-ink: #C13A26;
  --red-soft: #FBE6E1;
  --destructive: #C9392A;
  --destructive-foreground: #FFFFFF;
  --success: #2F8F5F;
  --success-soft: #E2F2E9;
  --warning: #B9770E;
  --warning-soft: #FBF0DC;
  --night: #0D0F13;
  --night-2: #15181E;
  --night-3: #1D2129;
  --night-line: #2A2F38;
  --night-ink: #F1EEE8;
  --night-ink-2: #A3A6AD;
  --night-ink-3: #6C7079;
  --mint: #6FD3A0;
  --person-0: #3F5A8A;
  --person-1: #2F7D5B;
  --person-2: #B4553F;
  --person-3: #6B4F8F;
  --person-4: #2E7480;
  --person-5: #9A6A1E;
  --person-6: #9A4467;
  --person-7: #4F5866;
  --ms-sign-in: #ffffff;
  --ms-sign-in-foreground: #5e5e5e;
  --ms-sign-in-border: #8c8c8c;
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --shadow-xs: 0 1px 2px rgba(14, 15, 18, 0.05);
  --shadow-sm: 0 1px 2px rgba(14, 15, 18, 0.04), 0 10px 28px -18px rgba(14, 15, 18, 0.22);
  --shadow-md: 0 2px 6px rgba(14, 15, 18, 0.05), 0 18px 40px -22px rgba(14, 15, 18, 0.3);
  --shadow-lg: 0 8px 20px -10px rgba(14, 15, 18, 0.14), 0 36px 70px -30px rgba(14, 15, 18, 0.38);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --background: #0B0C0F;
    --background-2: #101216;
    --foreground: #F1EEE8;
    --ink-2: #B0B3BA;
    --muted: #181A1F;
    --muted-foreground: #8F929A;
    --card: #14161A;
    --card-2: #181A1F;
    --border: #23262D;
    --line-strong: #2F333B;
    --input: #30343C;
    --ring: rgba(240, 87, 63, 0.6);
    --primary: #F1EEE8;
    --primary-foreground: #0B0C0F;
    --secondary: #1C1F25;
    --secondary-foreground: #F1EEE8;
    --accent: #1C1F25;
    --accent-foreground: #F1EEE8;
    --red: #F0573F;
    --red-ink: #FF8A75;
    --red-soft: #351B16;
    --destructive: #F0634D;
    --destructive-foreground: #0B0C0F;
    --success: #62C894;
    --success-soft: #142A1F;
    --warning: #E2A645;
    --warning-soft: #2E2413;
    --night: #17191F;
    --night-2: #1E2128;
    --night-3: #252931;
    --night-line: #30343D;
    --person-0: #5B76A8;
    --person-1: #3F9470;
    --person-2: #C26A54;
    --person-3: #8166A6;
    --person-4: #3F8C98;
    --person-5: #B08236;
    --person-6: #B05A7D;
    --person-7: #66707F;
    --ms-sign-in: #2f2f2f;
    --ms-sign-in-foreground: #ffffff;
    --ms-sign-in-border: #2f2f2f;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 30px -18px rgba(0, 0, 0, 0.7);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35), 0 20px 44px -22px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 10px 24px -10px rgba(0, 0, 0, 0.6), 0 40px 80px -30px rgba(0, 0, 0, 0.9);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --background: #0B0C0F;
  --background-2: #101216;
  --foreground: #F1EEE8;
  --ink-2: #B0B3BA;
  --muted: #181A1F;
  --muted-foreground: #8F929A;
  --card: #14161A;
  --card-2: #181A1F;
  --border: #23262D;
  --line-strong: #2F333B;
  --input: #30343C;
  --ring: rgba(240, 87, 63, 0.6);
  --primary: #F1EEE8;
  --primary-foreground: #0B0C0F;
  --secondary: #1C1F25;
  --secondary-foreground: #F1EEE8;
  --accent: #1C1F25;
  --accent-foreground: #F1EEE8;
  --red: #F0573F;
  --red-ink: #FF8A75;
  --red-soft: #351B16;
  --destructive: #F0634D;
  --destructive-foreground: #0B0C0F;
  --success: #62C894;
  --success-soft: #142A1F;
  --warning: #E2A645;
  --warning-soft: #2E2413;
  --night: #17191F;
  --night-2: #1E2128;
  --night-3: #252931;
  --night-line: #30343D;
  --person-0: #5B76A8;
  --person-1: #3F9470;
  --person-2: #C26A54;
  --person-3: #8166A6;
  --person-4: #3F8C98;
  --person-5: #B08236;
  --person-6: #B05A7D;
  --person-7: #66707F;
  --ms-sign-in: #2f2f2f;
  --ms-sign-in-foreground: #ffffff;
  --ms-sign-in-border: #2f2f2f;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 30px -18px rgba(0, 0, 0, 0.7);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35), 0 20px 44px -22px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 10px 24px -10px rgba(0, 0, 0, 0.6), 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  color-scheme: dark;
}
:root[data-theme='light'] { color-scheme: light; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; border: 0 solid var(--border); }
html { -webkit-text-size-adjust: 100%; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: inherit; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; margin: 0; }
button { background: none; cursor: pointer; padding: 0; text-align: inherit; }
button:disabled { cursor: default; }
svg, input[type='checkbox'], input[type='radio'] { flex-shrink: 0; }
table, time { font-variant-numeric: tabular-nums; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: none; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring); border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--red) 22%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }

.root { min-height: 100vh; min-height: 100dvh; background: var(--background); color: var(--foreground); }
em.s, .s { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

/* helpers */
.muted { color: var(--muted-foreground); }
.fg { color: var(--foreground); }
.t-primary { color: var(--foreground); }
.t-red { color: var(--red); }
.t-success { color: var(--success); }
.t-warning { color: var(--warning); }
.t-destructive { color: var(--destructive); }
.mono { font-family: var(--font-mono); }
.text-xs { font-size: 0.75rem; line-height: 1.1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.35rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.medium { font-weight: 500; }
.semibold { font-weight: 600; }
.nums { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break { overflow-wrap: break-word; word-break: break-word; }
.ic { width: 1rem; height: 1rem; }
.ic-sm { width: 0.875rem; height: 0.875rem; }
.ic-xs { width: 0.75rem; height: 0.75rem; }
.ic-md { width: 1.25rem; height: 1.25rem; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-self-center { justify-self: center; }
.content-start { align-content: start; }
.gap-0 { gap: 0; } .gap-1 { gap: 0.25rem; } .gap-1h { gap: 0.375rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; } .gap-5 { gap: 1.25rem; } .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; } .gap-10 { gap: 2.5rem; }
.min-w-0 { min-width: 0; }
.flex-1 { flex: 1 1 0%; min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.ml-auto { margin-left: auto; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.self-start { justify-self: start; }
.w-full { width: 100%; }
.link { font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); text-underline-offset: 4px; transition: text-decoration-color .15s; }
.link:hover { text-decoration-color: var(--red); }
.link-primary { color: var(--foreground); font-weight: 500; text-underline-offset: 4px; }
.link-primary:hover { text-decoration: underline; text-decoration-color: var(--red); }
.list-disc { list-style: disc; padding-left: 1.25rem; }
.divide-y > * + * { border-top-width: 1px; }
.dashed-empty { border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--card) 50%, transparent); padding: 2.5rem 1.5rem; text-align: center; font-size: 0.9375rem; color: var(--muted-foreground); }
.dashed-empty.sm { padding: 1.5rem 1rem; }
.kbd { font-family: var(--font-mono); font-size: 0.75rem; background: var(--muted); border-radius: 5px; padding: 0.05rem 0.3rem; }
.eyebrow { display: flex; align-items: center; gap: 0.5rem; font: 500 0.6875rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.mini-label { font: 500 0.6875rem/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }

/* status dots */
.live-dot, .ok-dot, .off-dot { width: 0.4375rem; height: 0.4375rem; border-radius: 9999px; flex-shrink: 0; display: inline-block; }
.live-dot { background: var(--mint); box-shadow: 0 0 0 0 rgba(111, 211, 160, 0.55); animation: ping 2.4s infinite; }
.ok-dot { background: var(--success); }
.off-dot { background: var(--muted-foreground); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(111, 211, 160, 0.55); } 80%, 100% { box-shadow: 0 0 0 8px rgba(111, 211, 160, 0); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 9999px; font-size: 0.875rem; line-height: 1.25rem; font-weight: 500;
  white-space: nowrap; transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s;
  height: 2.375rem; padding: 0 1.125rem;
  background: var(--primary); color: var(--primary-foreground);
}
.btn svg { width: 1rem; height: 1rem; }
.btn:hover { background: var(--red); color: #fff; }
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .focusable:focus-visible { box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring); border-radius: 9999px; }
.btn:disabled, .btn[aria-disabled='true'] { pointer-events: none; opacity: 0.45; }
.btn-sm { height: 2rem; padding: 0 0.875rem; font-size: 0.8125rem; }
.btn-lg { height: 2.875rem; padding: 0 1.5rem; font-size: 0.9375rem; }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { background: var(--line-strong); color: var(--foreground); }
.btn-outline { border: 1px solid var(--line-strong); background: var(--card); color: var(--foreground); }
.btn-outline:hover { background: var(--foreground); border-color: var(--foreground); color: var(--background); }
.btn-ghost { background: transparent; color: inherit; }
.btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-destructive { background: var(--destructive); color: var(--destructive-foreground); }
.btn-destructive:hover { background: color-mix(in srgb, var(--destructive) 88%, #000); color: var(--destructive-foreground); }
.btn-link { height: auto; padding: 0; background: none; color: var(--foreground); text-underline-offset: 4px; }
.btn-link:hover { background: none; color: var(--foreground); text-decoration: underline; }
.btn-icon { width: 2.5rem; height: 2.5rem; padding: 0; }
.btn-icon-sm { width: 2.25rem; height: 2.25rem; padding: 0; color: var(--muted-foreground); }
.btn-icon-sm:hover { color: var(--foreground); }
.justify-start { justify-content: flex-start; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem; border-radius: 9999px; border: 1px solid var(--border);
  padding: 0.1875rem 0.625rem; font-size: 0.75rem; line-height: 1rem; font-weight: 500; white-space: nowrap;
  background: var(--card-2); color: var(--ink-2);
}
.badge.primary { border-color: transparent; background: var(--muted); color: var(--foreground); }
.badge.success { border-color: transparent; background: var(--success-soft); color: var(--success); }
.badge.success::before { content: ''; width: 0.375rem; height: 0.375rem; border-radius: 9999px; background: currentColor; }
.badge.warning { border-color: transparent; background: var(--warning-soft); color: color-mix(in srgb, var(--warning) 80%, var(--foreground)); }
.badge.destructive { border-color: transparent; background: var(--red-soft); color: var(--red-ink); }
button.badge:hover { color: var(--foreground); border-color: var(--line-strong); }
.badges { display: flex; flex-wrap: wrap; gap: 0.375rem; }

/* ---------- cards ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm); }
.card-h { display: grid; gap: 0.25rem; padding: 1.5rem 1.5rem 1rem; }
.card-t { font-size: 1.0625rem; line-height: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.card-t.base { font-size: 1rem; line-height: 1.5rem; }
.card-d { font-size: 0.875rem; line-height: 1.35rem; color: var(--muted-foreground); }
.card-c { padding: 0 1.5rem 1.5rem; }
.card-f { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0 1.5rem 1.5rem; margin-top: auto; }
.card-p4 { padding: 1.25rem; }
.card.warn, .card.care { border-color: var(--border); background: linear-gradient(180deg, color-mix(in srgb, var(--red-soft) 45%, var(--card)) 0, var(--card) 7rem); }
@media (max-width: 639.98px) {
  .card-h { padding: 1.125rem 1.125rem 0.75rem; }
  .card-c { padding: 0 1.125rem 1.125rem; }
  .card-f { padding: 0 1.125rem 1.125rem; }
}

/* ---------- alerts ---------- */
.alert { border-radius: var(--radius); border: 1px solid var(--border); padding: 0.875rem 1rem; font-size: 0.875rem; line-height: 1.35rem; background: var(--card-2); color: var(--foreground); }
.alert.success { border-color: transparent; background: var(--success-soft); }
.alert.info { border-color: transparent; background: var(--muted); }
.alert.warning { border-color: transparent; background: var(--warning-soft); }
.alert.destructive { border-color: color-mix(in srgb, var(--red) 30%, transparent); background: var(--red-soft); }

/* ---------- forms ---------- */
.field { display: grid; gap: 0.5rem; }
.label { font-size: 0.8125rem; line-height: 1; font-weight: 500; color: var(--ink-2); }
.hint { font-size: 0.75rem; line-height: 1.2rem; color: var(--muted-foreground); }
.err { font-size: 0.8125rem; line-height: 1.25rem; color: var(--destructive); }
.err:empty { display: none; }
.input, .select, .textarea {
  display: flex; width: 100%; height: 2.625rem; border-radius: var(--radius); border: 1px solid var(--input);
  background: var(--card); padding: 0.25rem 0.875rem; font-size: 0.9375rem; line-height: 1.25rem;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--muted-foreground) 80%, transparent); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 14%, transparent); }
.input[aria-invalid='true'] { border-color: var(--destructive); }
.select {
  appearance: none; padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center;
}
.textarea { height: auto; min-height: 6rem; padding: 0.625rem 0.875rem; resize: vertical; line-height: 1.45rem; }
.textarea.mono { font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.4rem; min-height: 16rem; background: var(--card-2); }
.input.h8 { height: 2.375rem; }
input[type='file'].input { padding-top: 0.55rem; font-size: 0.8125rem; }
@media (max-width: 639.98px) {
  .input, .select { height: 2.875rem; font-size: 1rem; }
  .textarea { font-size: 1rem; }
  .input.h8 { height: 2.75rem; }
}
.check { width: 1.0625rem; height: 1.0625rem; accent-color: var(--foreground); }
.check-row { display: flex; align-items: flex-start; gap: 0.625rem; font-size: 0.875rem; padding: 0.25rem 0; }
.check-row .check { margin-top: 0.125rem; }

.radio-cards { display: grid; gap: 0.5rem; border: 0; }
.radio-cards legend { margin-bottom: 0.5rem; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.radio-card { display: flex; cursor: pointer; align-items: flex-start; gap: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.875rem 1rem; font-size: 0.875rem; background: var(--card); transition: border-color .15s, background-color .15s, box-shadow .15s; }
.radio-card:hover { border-color: var(--line-strong); }
.radio-card:has(:checked) { border-color: var(--foreground); box-shadow: 0 0 0 1px var(--foreground) inset; }
.radio-card input { margin-top: 0.15rem; width: 1rem; height: 1rem; accent-color: var(--foreground); }
.radio-card .rc-t { display: grid; gap: 0.125rem; min-width: 0; font-weight: 500; }
.radio-card .rc-d { font-size: 0.8125rem; font-weight: 400; color: var(--muted-foreground); }

/* switch */
.switch { position: relative; display: inline-flex; height: 1.5rem; width: 2.625rem; flex-shrink: 0; align-items: center; border-radius: 9999px; background: var(--line-strong); transition: background-color .2s; }
.switch[aria-checked='true'] { background: var(--success); }
.switch:focus-visible { box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring); }
.switch::after { content: ''; display: block; width: 1.25rem; height: 1.25rem; border-radius: 9999px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transform: translateX(0.125rem); transition: transform .25s var(--spring); }
.switch[aria-checked='true']::after { transform: translateX(1.25rem); }
.switch:disabled { opacity: .45; cursor: not-allowed; }

/* segmented */
.segmented { display: inline-flex; border-radius: 9999px; background: var(--muted); padding: 0.1875rem; gap: 0.125rem; }
.segmented button { border-radius: 9999px; padding: 0.3125rem 0.875rem; font-size: 0.8125rem; line-height: 1.25rem; font-weight: 500; white-space: nowrap; color: var(--muted-foreground); transition: color .15s, background-color .2s, box-shadow .2s; }
.segmented button:hover { color: var(--foreground); }
.segmented button[aria-pressed='true'] { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-xs); }
@media (max-width: 639.98px) {
  .segmented { display: flex; width: 100%; }
  .segmented button { flex: 1 1 auto; padding: 0.5rem 0.5rem; }
}

/* disclosure */
details.disclosure > summary { display: inline-flex; cursor: pointer; list-style: none; align-items: center; gap: 0.375rem; border-radius: var(--radius); font-size: 0.875rem; font-weight: 500; color: var(--muted-foreground); user-select: none; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary:hover { color: var(--foreground); }
details.disclosure > summary svg { transition: transform .2s var(--ease); }
details.disclosure[open] > summary svg { transform: rotate(90deg); }
details.disclosure > .disc-body { margin-top: 1rem; display: grid; gap: 1.5rem; }
details.disclosure > summary.card-sum { display: flex; width: 100%; padding: 1.25rem 1.5rem; color: var(--foreground); }
@media (max-width: 639.98px) { details.disclosure > summary.card-sum { padding: 1.125rem; } }

/* copy field */
.copy-field { display: flex; align-items: center; gap: 0.5rem; }
.copy-field code { width: 0; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card-2); padding: 0.5625rem 0.875rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-2); }
.code-block { border-radius: var(--radius); background: var(--night); color: var(--night-ink); padding: 0.875rem 1rem; display: grid; gap: 0.75rem; }
.code-block pre { margin: 0; font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.35rem; white-space: pre-wrap; word-break: break-all; }
.code-block .btn-outline { background: var(--night-3); border-color: var(--night-line); color: var(--night-ink); }
.code-block .btn-outline:hover { background: var(--night-ink); color: var(--night); }
@media (min-width: 640px) { .code-block { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } }

/* avatar */
.avatar { position: relative; display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden; border-radius: 9999px; font-weight: 600; color: #fff; user-select: none; letter-spacing: 0.01em; }
.avatar.xs { width: 1.375rem; height: 1.375rem; font-size: 0.5625rem; }
.avatar.sm { width: 1.875rem; height: 1.875rem; font-size: 0.6875rem; }
.avatar.md { width: 2.375rem; height: 2.375rem; font-size: 0.8125rem; }
.avatar.lg { width: 3.75rem; height: 3.75rem; font-size: 1.125rem; }
.avatar.xl { width: 5.5rem; height: 5.5rem; font-size: 1.75rem; }
.avatars { display: flex; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--card); }
.avatars .avatar + .avatar { margin-left: -0.375rem; }

/* service mark */
.mark { flex-shrink: 0; width: 1.25rem; height: 1.25rem; border-radius: 5px; object-fit: contain; }
.mark.sm { width: 1rem; height: 1rem; border-radius: 4px; }
.mark.lg { width: 1.75rem; height: 1.75rem; border-radius: 7px; }
.svc-name { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; }
.mark-tile { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 10px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-xs); flex-shrink: 0; }
.mark-tile.lg { width: 3rem; height: 3rem; border-radius: 14px; }

/* ---------- tables (cards below md) ---------- */
.tbl-wrap { position: relative; width: 100%; overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow-sm); contain: inline-size; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.875rem; line-height: 1.35rem; }
.tbl thead tr { border-bottom: 1px solid var(--border); }
.tbl th { height: 2.75rem; padding: 0 1rem; text-align: left; vertical-align: middle; font: 500 0.6875rem/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; color: var(--muted-foreground); }
.tbl th.right { text-align: right; }
.tbl tbody tr { border-bottom: 1px solid var(--border); transition: background-color .15s; }
.tbl tbody tr:hover { background: var(--card-2); }
.tbl tbody tr:last-child { border-bottom: 0; }
.tbl td { padding: 0.875rem 1rem; vertical-align: middle; }
.tbl td.actions { text-align: right; white-space: nowrap; }
.tbl tr.dim { color: var(--muted-foreground); }
.tbl tr.clickable { cursor: pointer; }
@media (max-width: 767.98px) {
  .tbl-wrap { border: 0; background: transparent; box-shadow: none; overflow: visible; border-radius: 0; }
  .tbl, .tbl tbody { display: grid; gap: 0.625rem; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .tbl tbody tr, .tbl tbody tr:last-child { display: grid; gap: 0.5rem; padding: 1rem 1.125rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow-sm); }
  .tbl tbody tr:hover { background: var(--card); }
  .tbl td { display: block; padding: 0; overflow-wrap: anywhere; }
  .tbl td:empty { display: none; }
  .tbl td[data-label] { display: flex; align-items: baseline; gap: 0.75rem; font-size: 0.875rem; }
  .tbl td[data-label]::before { content: attr(data-label); width: 6.5rem; flex-shrink: 0; font: 500 0.625rem/1.35rem var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
  .tbl td[data-label] > .cell { min-width: 0; flex: 1; }
  .tbl td.actions { text-align: left; margin: 0.125rem 0 -0.25rem -0.625rem; white-space: normal; }
  .tbl td.w8 { position: absolute; }
  .tbl tbody tr.has-check { position: relative; padding-left: 2.75rem; }
  .tbl tbody tr.has-check td.w8 { left: 1.125rem; top: 1.45rem; }
  .tbl td.right { text-align: left; }
}

/* ---------- tabs ---------- */
.tabs { display: grid; gap: 1.5rem; }
.tablist { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; padding: 0.1875rem; background: var(--muted); border-radius: 9999px; justify-self: start; max-width: 100%; }
.tablist::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; flex-shrink: 0; align-items: center; gap: 0.375rem; border-radius: 9999px; padding: 0.4375rem 1rem; font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; white-space: nowrap; color: var(--muted-foreground); transition: color .15s, background-color .2s, box-shadow .2s; }
.tab:hover { color: var(--foreground); }
.tab[aria-selected='true'] { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-xs); }
.tab:focus-visible { box-shadow: 0 0 0 2px var(--ring); }
.tab-count { border-radius: 9999px; background: var(--background-2); padding: 0 0.4375rem; font-size: 0.6875rem; font-weight: 500; color: var(--ink-2); }
.tab-picker { display: none; gap: 0.5rem; }
.tab-picker > span { font: 500 0.6875rem/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
@media (max-width: 639.98px) {
  .tabs.has-picker > .tablist { display: none; }
  .tabs.has-picker > .tab-picker { display: grid; }
  .tab { padding: 0.5rem 0.875rem; }
}
.vtabs { display: grid; gap: 1.5rem; }
.vtabs > .vlist { display: none; }
.vtabs > .tab-picker { display: grid; }
@media (min-width: 1280px) {
  .vtabs { grid-template-columns: 13rem minmax(0, 1fr); align-items: start; }
  .vtabs > .vlist { display: grid; align-content: start; gap: 0.125rem; position: sticky; top: 1.5rem; }
  .vtabs > .tab-picker { display: none !important; }
}
.vtab { display: flex; width: 100%; min-width: 0; align-items: center; gap: 0.625rem; border-radius: var(--radius); padding: 0.5625rem 0.75rem; text-align: left; font-size: 0.875rem; line-height: 1.25rem; color: var(--ink-2); transition: background-color .15s, color .15s; }
.vtab:hover { background: var(--accent); color: var(--foreground); }
.vtab[aria-selected='true'] { background: var(--card); font-weight: 500; color: var(--foreground); box-shadow: var(--shadow-xs); }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; background: var(--background); }
@media (min-width: 1024px) { .auth { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); } }
.auth-side { display: none; }
@media (min-width: 1024px) {
  .auth-side { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; margin: 0.875rem; padding: 2.5rem; border-radius: 28px; background: var(--night); color: var(--night-ink); overflow: hidden; }
  .auth-side::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px); background-size: 22px 22px; -webkit-mask-image: radial-gradient(ellipse at 30% 60%, #000 25%, transparent 75%); mask-image: radial-gradient(ellipse at 30% 60%, #000 25%, transparent 75%); pointer-events: none; }
  .auth-side > * { position: relative; }
}
.brand { display: inline-flex; align-items: baseline; gap: 0.5rem; font-weight: 600; letter-spacing: -0.045em; color: var(--foreground); }
.brand-night { color: var(--night-ink); font-size: 1.625rem; }
.auth-h { font-size: clamp(2.5rem, 4.2vw, 3.75rem); line-height: 1; letter-spacing: -0.045em; font-weight: 600; }
.auth-h em.s { color: var(--red); font-size: 1.06em; letter-spacing: -0.02em; }
.auth-points { margin-top: 2rem; display: grid; gap: 0.875rem; font-size: 0.9375rem; color: var(--night-ink-2); }
.auth-points li { display: flex; align-items: center; gap: 0.75rem; }
.auth-points svg { width: 1.125rem; height: 1.125rem; color: var(--mint); }
.auth-foot { font: 500 0.6875rem/1.6 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--night-ink-3); }
.auth-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.75rem; padding: max(3.5rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom)); }
.auth-main .theme-btn { position: absolute; top: max(1rem, env(safe-area-inset-top)); right: max(1rem, env(safe-area-inset-right)); }
.auth-brand { display: grid; gap: 0.625rem; justify-items: center; }
.auth-main main { width: 100%; max-width: 27rem; }
.brand-auth { font-size: 2.75rem; line-height: 1; }
.auth-card { border-radius: 24px; box-shadow: var(--shadow-md); animation: rise .5s var(--ease) both; }
.auth-card .card-h { padding: 2rem 2rem 1.25rem; gap: 0.5rem; }
.auth-card .card-c { padding: 0 2rem 2rem; }
.auth-t { font-size: 1.75rem; line-height: 1.1; letter-spacing: -0.035em; font-weight: 600; }
.auth-step { font: 500 0.6875rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); }
.auth-note { max-width: 27rem; text-align: center; font-size: 0.75rem; color: var(--muted-foreground); }
.demo-hint { display: flex; align-items: center; justify-content: center; gap: 0.5rem; border-radius: var(--radius); background: var(--muted); padding: 0.625rem 0.875rem; font-size: 0.8125rem; color: var(--ink-2); }
.demo-hint svg { color: var(--red); }
.or { display: flex; align-items: center; gap: 0.75rem; font: 500 0.6875rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
@media (max-width: 639.98px) {
  .auth-card .card-h { padding: 1.5rem 1.375rem 1rem; }
  .auth-card .card-c { padding: 0 1.375rem 1.5rem; }
  .brand-auth { font-size: 2.25rem; }
}
.demo-pill { display: inline-flex; align-items: center; gap: 0.375rem; border-radius: 9999px; border: 1px solid var(--border); background: var(--card); padding: 0.1875rem 0.5625rem 0.1875rem 0.5rem; font: 500 0.625rem/1rem var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); white-space: nowrap; }
.demo-pill::before { content: ''; width: 0.375rem; height: 0.375rem; border-radius: 9999px; background: var(--warning); }

/* code input */
.code-input { position: relative; display: grid; width: 100%; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; }
.code-input input { position: absolute; inset: 0; z-index: 10; width: 100%; height: 100%; cursor: text; background: transparent; color: transparent; caret-color: transparent; border: 0; outline: none; font-size: 1rem; }
.code-input input:focus-visible { box-shadow: none; }
.code-input input::selection { background: transparent; }
.code-box { display: flex; height: 3.5rem; min-width: 0; align-items: center; justify-content: center; border-radius: 14px; border: 1px solid var(--input); background: var(--card); font-size: 1.5rem; font-weight: 500; font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s, transform .2s var(--ease); }
.code-box:not(:empty) { border-color: var(--line-strong); background: var(--card-2); }
.code-box.lit { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 14%, transparent); transform: translateY(-1px); }
.code-box .caret { width: 2px; height: 1.6rem; border-radius: 1px; background: var(--red); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.15; } }
@media (min-width: 640px) { .code-input { gap: 0.625rem; } .code-box { height: 3.75rem; font-size: 1.625rem; } }
.dialog .code-box { height: 3.25rem; font-size: 1.375rem; }

/* ---------- app layout ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
@media (min-width: 1024px) { .shell { display: grid; grid-template-columns: 16.25rem minmax(0, 1fr); } }

/* phone and tablet: a top bar and a tab bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; height: calc(3.5rem + env(safe-area-inset-top)); align-items: center; gap: 0.625rem; background: color-mix(in srgb, var(--background) 84%, transparent); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); padding: env(safe-area-inset-top) max(0.75rem, env(safe-area-inset-right)) 0 max(1.125rem, env(safe-area-inset-left)); }
.brand-top { font-size: 1.375rem; }
.top-me { display: inline-flex; border-radius: 9999px; padding: 0.25rem; }
@media (min-width: 1024px) { .topbar { display: none; } }

.tabbar { position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0.375rem max(0.5rem, env(safe-area-inset-right)) max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left)); background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: saturate(1.5) blur(18px); -webkit-backdrop-filter: saturate(1.5) blur(18px); border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent); }
@media (min-width: 1024px) { .tabbar { display: none; } }
.tab-i { position: relative; display: grid; justify-items: center; gap: 0.1875rem; min-height: 3.125rem; padding: 0.375rem 0.25rem 0.25rem; border-radius: 14px; font-size: 0.6875rem; line-height: 1rem; font-weight: 500; color: var(--muted-foreground); transition: color .2s; }
.tab-i .tab-ic { position: relative; display: grid; place-items: center; width: 3.25rem; height: 1.875rem; border-radius: 9999px; transition: background-color .25s var(--ease), transform .25s var(--spring); }
.tab-i svg { width: 1.3125rem; height: 1.3125rem; stroke-width: 1.8; }
.tab-i.on { color: var(--foreground); }
.tab-i.on .tab-ic { background: var(--muted); }
.tab-i:active .tab-ic { transform: scale(0.9); }
.tab-badge { position: absolute; top: -0.125rem; right: 0.5rem; min-width: 1.0625rem; height: 1.0625rem; padding: 0 0.25rem; border-radius: 9999px; background: var(--red); color: #fff; font-size: 0.625rem; line-height: 1.0625rem; font-weight: 600; text-align: center; box-shadow: 0 0 0 2px var(--card); }

/* desktop: the sidebar */
.sidebar { display: none; }
@media (min-width: 1024px) {
  .sidebar { display: flex; flex-direction: column; gap: 0.875rem; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; padding: 1.375rem 0.875rem 1rem; border-right: 1px solid var(--border); background: var(--background-2); scrollbar-width: thin; }
}
.nav-brand { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0 0.5rem 0 0.625rem; }
.brand-side { font-size: 1.5rem; line-height: 1.75rem; }
.firm-chip { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.625rem; border-radius: 14px; background: var(--card); border: 1px solid var(--border); font-size: 0.8125rem; line-height: 1.15rem; box-shadow: var(--shadow-xs); }
.firm-ini { display: grid; place-items: center; width: 2rem; height: 2rem; flex-shrink: 0; border-radius: 9px; background: var(--night); color: var(--night-ink); font: 400 1rem/1 var(--font-serif); font-style: italic; }
.nav-scroll { display: grid; gap: 0.625rem; }
.nav-label { padding: 0 0.75rem 0.375rem; font: 500 0.625rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.nav-list { display: grid; gap: 0.0625rem; }
.nav-row { position: relative; display: flex; width: 100%; align-items: center; gap: 0.6875rem; border-radius: 10px; padding: 0.375rem 0.75rem; text-align: left; font-size: 0.875rem; line-height: 1.25rem; color: var(--ink-2); transition: background-color .15s, color .15s; }
.nav-row svg { width: 1.0625rem; height: 1.0625rem; color: var(--muted-foreground); transition: color .15s; }
.nav-row:hover { background: color-mix(in srgb, var(--card) 70%, transparent); color: var(--foreground); }
.nav-row.active { background: var(--card); color: var(--foreground); font-weight: 500; box-shadow: var(--shadow-xs); }
.nav-row.active svg { color: var(--red); }
.nav-row .nav-t { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { display: inline-flex; min-width: 1.25rem; height: 1.25rem; align-items: center; justify-content: center; border-radius: 9999px; background: var(--red); padding: 0 0.375rem; font-size: 0.6875rem; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.nav-foot { margin-top: auto; display: flex; align-items: center; gap: 0.25rem; border-top: 1px solid var(--border); padding: 0.875rem 0.25rem 0 0.25rem; }
.me-row { display: flex; align-items: center; gap: 0.625rem; min-width: 0; flex: 1; padding: 0.25rem 0.375rem; border-radius: 12px; font-size: 0.875rem; line-height: 1.2rem; transition: background-color .15s; }
.me-row:hover { background: var(--accent); }
.me-row .who { display: grid; min-width: 0; }

.main { min-width: 0; padding: 2.25rem 3rem 4rem; }
@media (max-width: 1279.98px) { .main { padding: 2rem 2rem 4rem; } }
@media (max-width: 1023.98px) { .main { padding: 1.5rem max(1.5rem, env(safe-area-inset-right)) calc(6.5rem + env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left)); } }
@media (max-width: 639.98px) { .main { padding: 1.25rem 1rem calc(6.25rem + env(safe-area-inset-bottom)); } }
.page { max-width: 68rem; margin: 0 auto; }
.page.wide, .page.home { max-width: 80rem; }
.page.full { max-width: none; }
.page.enter { animation: rise .45s var(--ease) backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* the More sheet (phone) */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(10, 11, 14, 0.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade-in 200ms ease-out; }
.overlay.out { opacity: 0; transition: opacity .18s; }
.sheet { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: grid; gap: 1rem; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--background); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg); padding: 0.75rem max(1rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); animation: sheet-in-bottom 380ms var(--spring); }
.sheet.out { transform: translateY(100%); transition: transform .2s ease-in; }
.grab { justify-self: center; width: 2.5rem; height: 0.3125rem; border-radius: 9999px; background: var(--line-strong); }
.sheet-me { display: flex; align-items: center; gap: 0.5rem; border-radius: 18px; background: var(--card); border: 1px solid var(--border); padding: 0.5rem; }
.more-sec { display: grid; gap: 0.5rem; }
.more-sec .nav-label { padding: 0 0.25rem; }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.more-grid > li { display: flex; }
.more-grid .more-tile { width: 100%; }
.more-tile { display: grid; justify-items: start; gap: 0.625rem; min-height: 4.75rem; padding: 0.75rem 0.75rem 0.6875rem; border-radius: 18px; background: var(--card); border: 1px solid var(--border); font-size: 0.8125rem; line-height: 1.1rem; font-weight: 500; transition: transform .2s var(--spring), border-color .15s; animation: rise .4s var(--ease) both; }
.more-tile:active { transform: scale(0.96); }
.more-tile.on { border-color: var(--foreground); }
.more-ic { display: grid; place-items: center; width: 2.125rem; height: 2.125rem; border-radius: 11px; background: var(--muted); }
.more-ic svg { width: 1.125rem; height: 1.125rem; }
.more-tile.on .more-ic { background: var(--night); color: var(--night-ink); }
.more-grid li:nth-child(2) .more-tile { animation-delay: 30ms; } .more-grid li:nth-child(3) .more-tile { animation-delay: 60ms; } .more-grid li:nth-child(4) .more-tile { animation-delay: 90ms; } .more-grid li:nth-child(5) .more-tile { animation-delay: 120ms; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in-bottom { from { transform: translateY(100%); } }
@keyframes dialog-in { from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); } }

/* page header + section */
.page-h { margin-bottom: 1.75rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.page-h .titles { display: grid; min-width: 0; gap: 0.375rem; }
.page-h h1 { font-size: 2rem; line-height: 2.25rem; font-weight: 600; letter-spacing: -0.04em; overflow-wrap: break-word; }
.page-h .desc { font-size: 0.9375rem; line-height: 1.45rem; color: var(--muted-foreground); overflow-wrap: break-word; max-width: 42rem; }
.page-h .acts { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
@media (max-width: 639.98px) {
  .page-h { flex-direction: column; align-items: stretch; gap: 1rem; margin-bottom: 1.25rem; }
  .page-h h1 { font-size: 1.75rem; line-height: 2rem; }
  .page-h .acts .btn { flex: 1 1 auto; }
}
.back { margin-bottom: 1rem; display: inline-flex; align-items: center; gap: 0.375rem; border-radius: 9999px; padding: 0.3125rem 0.75rem 0.3125rem 0.5rem; margin-left: -0.5rem; font-size: 0.8125rem; font-weight: 500; color: var(--muted-foreground); transition: background-color .15s, color .15s; }
.back:hover { color: var(--foreground); background: var(--accent); }
.section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.875rem; }
.section-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.section-h .titles { display: grid; min-width: 0; gap: 0.25rem; }
.section-h h2, .section-h h3 { font-size: 1.125rem; line-height: 1.5rem; font-weight: 600; letter-spacing: -0.025em; }
.section-h .desc { font-size: 0.875rem; color: var(--muted-foreground); }
.section-h .acts { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
@media (max-width: 639.98px) { .section-h { flex-direction: column; align-items: stretch; gap: 0.75rem; } }
.h-mini { font: 500 0.6875rem/1.2 var(--font-mono); letter-spacing: 0.06em; color: var(--muted-foreground); text-transform: uppercase; }

/* lists inside bordered boxes */
.boxlist { display: grid; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow-sm); }
.boxlist > li { padding: 0.875rem 1.125rem; }
.boxlist.tight > li { padding: 0.625rem 1.125rem; }
@media (max-width: 639.98px) { .boxlist > li, .boxlist.tight > li { padding-left: 1rem; padding-right: 1rem; } }
.row-link { flex-shrink: 0; font-size: 0.875rem; font-weight: 500; text-underline-offset: 4px; }
.row-link:hover { text-decoration: underline; }
.health-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; }
.health-dot.working { background: var(--success); }
.health-dot.failing { background: var(--destructive); }
.health-dot.paused { background: var(--warning); }
.health-dot.unknown { background: var(--line-strong); }

/* detail list */
.details { display: grid; gap: 0.875rem; font-size: 0.875rem; }
.detail { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0.75rem; align-items: baseline; }
.detail dt { color: var(--muted-foreground); }
@media (max-width: 639.98px) { .detail { grid-template-columns: 1fr; gap: 0.125rem; } }

/* ================= Home ================= */
.hero-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin: 0.5rem 0 1.75rem; }
.hero-h .titles { display: grid; gap: 0.75rem; min-width: 0; }
.hero-h h1 { font-size: clamp(2.25rem, 3.6vw, 3.25rem); line-height: 1; letter-spacing: -0.05em; font-weight: 600; }
.hero-h h1 em.s { color: var(--red); font-size: 1.08em; letter-spacing: -0.02em; padding-right: 0.04em; }
.hero-h .desc { max-width: 38rem; font-size: 1rem; line-height: 1.5rem; color: var(--ink-2); }
.hero-h .acts { display: flex; flex-wrap: wrap; gap: 0.5rem; flex-shrink: 0; }
@media (max-width: 767.98px) {
  .hero-h { flex-direction: column; align-items: stretch; gap: 1.125rem; margin: 0.25rem 0 1.25rem; }
  .hero-h .desc { font-size: 0.9375rem; }
  .hero-h .acts .btn { flex: 1 1 0; }
}

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 1279.98px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi-tile { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; padding: 1.25rem 1.25rem 1.125rem; border-radius: var(--radius-xl); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .35s var(--ease), box-shadow .35s; }
.kpi-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi-top { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 0.375rem; }
.kpi-ic { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 10px; background: var(--muted); color: var(--foreground); flex-shrink: 0; }
.kpi-ic svg { width: 1rem; height: 1rem; }
.kpi-k { min-width: 0; flex: 1; font-size: 0.875rem; font-weight: 500; color: var(--ink-2); }
.delta { display: inline-flex; align-items: center; gap: 0.25rem; border-radius: 9999px; background: var(--success-soft); color: var(--success); padding: 0.125rem 0.5rem; font: 500 0.6875rem/1.1rem var(--font-mono); flex-shrink: 0; }
.kpi-v { display: flex; align-items: baseline; gap: 0.25rem; font-size: 2.25rem; line-height: 1.1; font-weight: 600; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.kpi-v small { font-size: 1.125rem; font-weight: 500; letter-spacing: -0.02em; color: var(--muted-foreground); }
.kpi-s { font-size: 0.8125rem; line-height: 1.2rem; color: var(--muted-foreground); }
.kpi-vis { margin-top: auto; padding-top: 0.875rem; }
.mini-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.375rem; height: 3.5rem; }
.mini-bars .mb { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 0.25rem; justify-items: center; min-width: 0; }
.mini-bars .mb i { align-self: end; display: block; width: 100%; max-width: 1.375rem; border-radius: 5px 5px 3px 3px; background: color-mix(in srgb, var(--foreground) 10%, var(--card)); transform-origin: bottom; }
.mini-bars .mb.now i { background: var(--foreground); }
.mini-bars .mb b { font: 500 0.5625rem/1 var(--font-mono); color: var(--muted-foreground); }
.enter .mini-bars .mb i { animation: grow .7s var(--ease) both; }
.enter .mini-bars .mb:nth-child(2) i { animation-delay: 40ms; } .enter .mini-bars .mb:nth-child(3) i { animation-delay: 80ms; } .enter .mini-bars .mb:nth-child(4) i { animation-delay: 120ms; } .enter .mini-bars .mb:nth-child(5) i { animation-delay: 160ms; } .enter .mini-bars .mb:nth-child(6) i { animation-delay: 200ms; } .enter .mini-bars .mb:nth-child(7) i { animation-delay: 240ms; }
@keyframes grow { from { transform: scaleY(0); } }
.src-bar { display: flex; gap: 3px; height: 0.625rem; border-radius: 9999px; overflow: hidden; }
.src-bar i { display: block; height: 100%; border-radius: 3px; }
.enter .src-bar { animation: wipe .9s var(--ease) both; }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.s0 { background: var(--foreground); } .s1 { background: var(--red); } .s2 { background: color-mix(in srgb, var(--foreground) 45%, var(--card)); } .s3 { background: color-mix(in srgb, var(--foreground) 18%, var(--card)); }
.src-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 0.75rem; margin-top: 0.625rem; font-size: 0.75rem; color: var(--muted-foreground); }
.src-legend li { display: flex; align-items: center; gap: 0.375rem; min-width: 0; white-space: nowrap; }
.src-legend li i { width: 0.5rem; height: 0.5rem; border-radius: 2px; flex-shrink: 0; }
.src-legend li b { margin-left: auto; font-weight: 500; color: var(--foreground); font-variant-numeric: tabular-nums; }
.meter { height: 0.625rem; border-radius: 9999px; background: color-mix(in srgb, var(--foreground) 9%, var(--card)); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 9999px; background: linear-gradient(90deg, var(--foreground), var(--red)); transform-origin: left; }
.enter .meter i { animation: grow-x 1s var(--ease) both .15s; }
@keyframes grow-x { from { transform: scaleX(0); } }
.meter-l { display: flex; justify-content: space-between; margin-top: 0.5rem; font-size: 0.75rem; color: var(--muted-foreground); }
.meter-l span:last-child { color: var(--foreground); font-weight: 500; }
@media (max-width: 639.98px) { .meter-l span:first-child { display: none; } .sys .truncate { white-space: normal; } }
.enter .kpi-tile { animation: rise .5s var(--ease) both; }
.enter .kpi-tile:nth-child(2) { animation-delay: 50ms; } .enter .kpi-tile:nth-child(3) { animation-delay: 100ms; } .enter .kpi-tile:nth-child(4) { animation-delay: 150ms; }
@media (max-width: 639.98px) {
  .kpis { gap: 0.625rem; }
  .kpi-tile { padding: 0.9375rem; border-radius: 18px; gap: 0.25rem; }
  .kpi-top { margin-bottom: 0.25rem; gap: 0.5rem; }
  .kpi-ic { width: 1.75rem; height: 1.75rem; border-radius: 9px; }
  .kpi-k { font-size: 0.75rem; line-height: 1rem; }
  .delta { display: none; }
  .kpi-v { font-size: 1.75rem; }
  .kpi-v small { font-size: 0.9375rem; }
  .kpi-s { font-size: 0.75rem; line-height: 1.05rem; }
  .kpi-vis { padding-top: 0.625rem; }
  .mini-bars { height: 2.75rem; gap: 0.25rem; }
  .src-legend { grid-template-columns: 1fr; }
  .src-legend li:nth-child(n+3) { display: none; }
}

.home-row { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1rem; margin-bottom: 1rem; align-items: stretch; }
@media (max-width: 1023.98px) { .home-row { grid-template-columns: minmax(0, 1fr); } .home-row > .approvals { order: -1; } }
.panel { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; padding: 1.5rem; border-radius: var(--radius-xl); }
@media (max-width: 639.98px) { .panel { padding: 1.25rem 1.125rem; gap: 1rem; border-radius: 20px; } }
.panel-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.panel-t { font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.035em; font-weight: 600; }
.panel-t em.s { color: var(--red); font-size: 1.1em; letter-spacing: -0.01em; }
.panel-d { margin-top: 0.25rem; font-size: 0.875rem; line-height: 1.35rem; color: var(--muted-foreground); }
.panel-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.8125rem; color: var(--muted-foreground); }
.panel-foot b { color: var(--foreground); font-weight: 600; }
@media (max-width: 639.98px) { .panel-t { font-size: 1.25rem; } .panel-h { flex-direction: column; gap: 0.75rem; } }

/* trend chart */
.trend-nums { display: flex; gap: 1.5rem; flex-shrink: 0; }
.trend-nums span { display: grid; font-size: 0.75rem; line-height: 1rem; color: var(--muted-foreground); }
.trend-nums b { font-size: 1.5rem; line-height: 1.75rem; letter-spacing: -0.04em; font-weight: 600; color: var(--foreground); font-variant-numeric: tabular-nums; }
.trend-nums b.t-red { color: var(--red); }
@media (max-width: 1279.98px) and (min-width: 1024px) { .trend .panel-h { flex-direction: column; } }
@media (max-width: 639.98px) { .trend-nums { gap: 1.25rem; } .trend-nums b { font-size: 1.25rem; } }
.chart { display: grid; gap: 0.5rem; flex: 1; min-height: 12rem; overflow-x: clip; }
.plot { position: relative; height: 100%; min-height: 11rem; color: var(--foreground); }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plot .gl line { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 4; }
.plot .ar { fill: url(#lg-a); }
.plot .ln { fill: none; stroke-width: 2.25; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.plot .ln.a { stroke: var(--foreground); }
.plot .ln.b { stroke: var(--red); }
.enter .plot svg { animation: wipe 1.2s var(--ease) both .15s; }
.cols { position: absolute; inset: 0; }
.cols .col { position: absolute; top: 0; bottom: 0; width: 2.5rem; margin-left: -1.25rem; }
.cols .col::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-strong); opacity: 0; transition: opacity .15s; }
.cols .dot { position: absolute; left: 50%; width: 0.625rem; height: 0.625rem; margin: -0.3125rem 0 0 -0.3125rem; border-radius: 9999px; border: 2px solid var(--card); opacity: 0; transform: scale(0.4); transition: opacity .15s, transform .2s var(--spring); }
.cols .dot.a { background: var(--foreground); }
.cols .dot.b { background: var(--red); }
.cols .col:last-child .dot { opacity: 1; transform: none; }
.cols .col:hover::before, .cols .col:hover .dot { opacity: 1; transform: none; }
.cols .tip { position: absolute; bottom: calc(100% + 0.25rem); left: 50%; transform: translate(-50%, 4px); z-index: 2; display: grid; gap: 0.125rem; white-space: nowrap; border-radius: 10px; background: var(--night); color: var(--night-ink-2); padding: 0.5rem 0.625rem; font-size: 0.75rem; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: opacity .15s, transform .2s var(--ease); }
.cols .tip b { color: var(--night-ink); font-weight: 500; }
.cols .col:hover .tip { opacity: 1; transform: translate(-50%, 0); }
.cols .col:first-child .tip { left: 0; transform: translate(0, 4px); }
.cols .col:last-child .tip { left: auto; right: 0; transform: translate(0, 4px); }
.cols .col:first-child:hover .tip, .cols .col:last-child:hover .tip { transform: translate(0, 0); }
.xlabels { display: flex; justify-content: space-between; font: 500 0.625rem/1 var(--font-mono); letter-spacing: 0.04em; color: var(--muted-foreground); }
@media (max-width: 639.98px) { .xlabels .hide-sm { visibility: hidden; width: 0; } .chart { min-height: 10rem; } .plot { min-height: 9rem; } }
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.75rem; color: var(--muted-foreground); }
.legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.legend i { width: 0.75rem; height: 0.1875rem; border-radius: 2px; display: inline-block; }
.legend .lg-a { background: var(--foreground); }
.legend .lg-b { background: var(--red); }

/* approvals: the night panel */
.card.night { background: var(--night); color: var(--night-ink); border-color: var(--night); box-shadow: var(--shadow-md); position: relative; overflow: hidden; }
.card.night::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px); background-size: 20px 20px; -webkit-mask-image: radial-gradient(ellipse at 100% 0%, #000 10%, transparent 60%); mask-image: radial-gradient(ellipse at 100% 0%, #000 10%, transparent 60%); pointer-events: none; }
.card.night > * { position: relative; }
.card.night .eyebrow { color: var(--night-ink-3); }
.card.night .panel-d { color: var(--night-ink-2); }
.card.night .panel-t em.s { color: #FF8A75; }
.apv-list { display: grid; gap: 0.625rem; }
.apv { display: flex; gap: 0.875rem; align-items: flex-start; padding: 0.875rem; border-radius: 16px; background: var(--night-2); border: 1px solid var(--night-line); transition: border-color .2s, background-color .2s; }
.apv:hover { border-color: color-mix(in srgb, var(--night-ink) 22%, transparent); }
.apv-ic { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 11px; background: var(--night-3); color: var(--night-ink); flex-shrink: 0; }
.apv-ic svg { width: 1.0625rem; height: 1.0625rem; }
.apv-b { display: grid; gap: 0.1875rem; min-width: 0; flex: 1; }
.apv-k { font: 500 0.625rem/1.2 var(--font-mono); letter-spacing: 0.07em; text-transform: uppercase; color: #FF8A75; }
.apv-title { font-size: 0.9375rem; line-height: 1.3rem; font-weight: 500; color: var(--night-ink); letter-spacing: -0.01em; }
.apv-d { font-size: 0.8125rem; line-height: 1.2rem; color: var(--night-ink-2); }
.apv-acts { display: flex; gap: 0.5rem; margin-top: 0.625rem; }
.nbtn { display: inline-flex; align-items: center; gap: 0.375rem; height: 2.125rem; padding: 0 0.875rem; border-radius: 9999px; font-size: 0.8125rem; font-weight: 500; transition: background-color .2s, color .2s, transform .15s; }
.nbtn svg { width: 0.875rem; height: 0.875rem; }
.nbtn:active { transform: scale(0.95); }
.nbtn.go { background: var(--night-ink); color: var(--night); }
.nbtn.go:hover { background: var(--red); color: #fff; }
.nbtn.ghost { color: var(--night-ink-2); border: 1px solid var(--night-line); }
.nbtn.ghost:hover { color: var(--night-ink); background: var(--night-3); }
.nbtn:focus-visible { box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--ring); }
.apv.done { align-items: center; padding: 0.75rem 0.875rem; background: color-mix(in srgb, var(--mint) 8%, var(--night-2)); border-color: color-mix(in srgb, var(--mint) 22%, transparent); }
.apv.done .apv-title { font-size: 0.875rem; }
.apv.done .apv-d { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apv-ok { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 9999px; background: var(--mint); color: #0D0F13; flex-shrink: 0; }
.apv-ok svg { width: 1.0625rem; height: 1.0625rem; stroke-width: 2.5; }
.apv-time { font: 500 0.6875rem/1 var(--font-mono); color: var(--night-ink-3); flex-shrink: 0; }
.apv.just { animation: settle .55s var(--spring) both; }
.apv.just .apv-ok { animation: pop .5s var(--spring) both .08s; }
@keyframes settle { from { opacity: 0.4; transform: scale(0.97); } }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } }

/* what the team asked */
.ask-list { display: grid; }
.ask { display: flex; gap: 0.875rem; align-items: flex-start; padding: 0.875rem 0; }
.ask + .ask { border-top: 1px solid var(--border); }
.ask:first-child { padding-top: 0.25rem; }
.ask-b { display: grid; gap: 0.375rem; min-width: 0; flex: 1; }
.ask-q { font-size: 0.9375rem; line-height: 1.35rem; letter-spacing: -0.01em; }
.ask-q::before { content: '\201C'; font-family: var(--font-serif); color: var(--red); font-size: 1.25em; line-height: 0; margin-right: 0.0625rem; }
.ask-q::after { content: '\201D'; font-family: var(--font-serif); color: var(--muted-foreground); font-size: 1.25em; line-height: 0; margin-left: 0.0625rem; }
.ask-m { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; font-size: 0.75rem; color: var(--muted-foreground); }
.ask-svcs { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.svc-chip { display: inline-flex; align-items: center; gap: 0.3125rem; border-radius: 9999px; background: var(--card-2); border: 1px solid var(--border); padding: 0.125rem 0.5rem 0.125rem 0.25rem; font-size: 0.6875rem; color: var(--ink-2); }
.svc-chip .mark { width: 0.875rem; height: 0.875rem; }
.ask-t { display: inline-flex; align-items: center; gap: 0.25rem; flex-shrink: 0; border-radius: 9999px; background: var(--success-soft); color: var(--success); padding: 0.125rem 0.5rem; font: 500 0.6875rem/1.1rem var(--font-mono); }
@media (max-width: 639.98px) { .ask .avatar { width: 2rem; height: 2rem; font-size: 0.6875rem; } .ask-t { display: none; } }

/* your assistant */
.assistant { gap: 1.125rem; }
.app-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.app-chip { display: inline-flex; align-items: center; gap: 0.5rem; border-radius: 9999px; border: 1px solid var(--border); background: var(--card-2); padding: 0.3125rem 0.75rem 0.3125rem 0.3125rem; font-size: 0.875rem; font-weight: 500; }
.app-glyph { display: grid; place-items: center; width: 1.625rem; height: 1.625rem; border-radius: 9999px; background: var(--night); color: var(--night-ink); font: 400 0.9375rem/1 var(--font-serif); font-style: italic; }
.mark-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.assist-stat { margin-top: auto; display: flex; align-items: center; gap: 0.875rem; padding: 0.875rem 1rem; border-radius: 16px; background: var(--card-2); border: 1px solid var(--border); }
.assist-stat b { white-space: nowrap; font-size: 1.75rem; line-height: 1; letter-spacing: -0.045em; font-weight: 600; }
.assist-stat span { font-size: 0.8125rem; line-height: 1.2rem; color: var(--muted-foreground); }

/* connected systems */
.systems { margin-bottom: 0.5rem; }
.health-line { display: inline-flex; align-items: center; gap: 0.5rem; flex-shrink: 0; border-radius: 9999px; background: var(--card-2); border: 1px solid var(--border); padding: 0.375rem 0.75rem; font-size: 0.8125rem; color: var(--ink-2); }
.sys-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 1279.98px) { .sys-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639.98px) { .sys-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; } }
.sys { display: grid; justify-items: start; gap: 0.75rem; min-width: 0; padding: 0.875rem; border-radius: 16px; border: 1px solid var(--border); background: var(--card-2); font-size: 0.875rem; transition: transform .3s var(--ease), border-color .2s, box-shadow .3s; }
.sys:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.sys-s { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: var(--muted-foreground); }
@media (max-width: 639.98px) { .sys { display: flex; align-items: center; padding: 0.625rem; gap: 0.625rem; } .sys .mark-tile.lg { width: 2.5rem; height: 2.5rem; border-radius: 12px; } }
.enter .home-row > *, .enter .systems { animation: rise .55s var(--ease) both .12s; }

/* review dialog */
.review-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem; border-radius: 14px; background: var(--card-2); border: 1px solid var(--border); font-size: 0.875rem; }
.review { display: grid; gap: 0; border-radius: 14px; border: 1px solid var(--border); overflow: hidden; }
.review > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; padding: 0.75rem 1rem; font-size: 0.875rem; }
.review > div + div { border-top: 1px solid var(--border); }
.review dt { font: 500 0.6875rem/1.35rem var(--font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-foreground); }
@media (max-width: 639.98px) { .review > div { grid-template-columns: 1fr; gap: 0.125rem; } }

/* ---------- job page ---------- */
.job-grid { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 1024px) { .job-grid { grid-template-columns: minmax(0, 1fr) 17rem; } .job-aside-phone { display: none; } }
.job-aside { display: none; }
@media (min-width: 1024px) { .job-aside { display: block; position: sticky; top: 1.5rem; } }
.sw-row { display: flex; align-items: flex-start; gap: 1rem; padding: 0.875rem 0; }
.sw-row + .sw-row { border-top: 1px solid var(--border); }
.sw-row .txt { display: grid; min-width: 0; flex: 1; gap: 0.1875rem; font-size: 0.875rem; overflow-wrap: break-word; }
.sw-row .txt .t { font-weight: 500; display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.sw-row .txt .d { font-size: 0.75rem; color: var(--muted-foreground); }
.sw-row .ctl { display: flex; width: 2.625rem; flex-shrink: 0; justify-content: flex-end; padding-top: 0.0625rem; }
.note-line { margin-top: 0.25rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; border-radius: 10px; background: var(--muted); padding: 0.375rem 0.75rem; font-size: 0.75rem; }
.action-bar { position: fixed; right: 0; bottom: 0; left: 16.25rem; z-index: 20; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding: 0.875rem 3rem max(0.875rem, env(safe-area-inset-bottom)); animation: sheet-in-bottom 300ms var(--spring); }
.action-bar > div { display: flex; max-width: 80rem; margin: 0 auto; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
@media (max-width: 1023.98px) { .action-bar { left: 0.75rem; right: 0.75rem; bottom: calc(4.5rem + env(safe-area-inset-bottom)); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 0.75rem 1rem; } }
.bar-space { padding-bottom: 5rem; }
@media (max-width: 1023.98px) { .bar-space { padding-bottom: 8rem; } }
.access-lines { display: grid; gap: 0.25rem; font-size: 0.875rem; }
.access-lines li { display: flex; gap: 0.5rem; align-items: baseline; justify-content: space-between; }

/* services grid */
.svc-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) { .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .svc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.svc-grid > li { display: flex; }
.svc-grid > li > .card { display: flex; flex-direction: column; width: 100%; transition: transform .35s var(--ease), box-shadow .35s; }
.svc-grid > li > .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.svc-grid .card-t .mark { width: 1.75rem; height: 1.75rem; }
.svc-grid .card-t { font-size: 1.125rem; }

/* ---------- task board ---------- */
.board-tools { margin-bottom: 1.125rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.board-search { position: relative; min-width: 0; flex: 1; }
@media (min-width: 640px) { .board-search { width: 17rem; flex: none; } }
.board-search svg { pointer-events: none; position: absolute; top: 50%; left: 0.875rem; transform: translateY(-50%); color: var(--muted-foreground); }
.board-search .input { padding-left: 2.375rem; border-radius: 9999px; }
.tag-filters { display: flex; flex-wrap: wrap; gap: 0.375rem; }
@media (max-width: 639.98px) { .tag-filters { margin: 0 -1rem; width: calc(100% + 2rem); flex-wrap: nowrap; overflow-x: auto; padding: 0.25rem 1rem; scrollbar-width: none; } .tag-filters::-webkit-scrollbar { display: none; } }
.tag-filter { display: inline-flex; align-items: center; gap: 0.375rem; border-radius: 9999px; border: 1px solid var(--border); background: var(--card); padding: 0.3125rem 0.75rem; font-size: 0.75rem; line-height: 1.25rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: border-color .15s, background-color .15s; }
.tag-filter:hover { border-color: var(--line-strong); color: var(--foreground); }
.tag-filter[aria-pressed='true'] { border-color: var(--foreground); background: var(--foreground); color: var(--background); }
.tag-filter .sw { width: 0.5rem; height: 0.5rem; border-radius: 9999px; border: 0; }
.board { display: grid; max-width: calc(4 * 26rem + 3 * 1rem); scroll-snap-type: x mandatory; grid-auto-columns: minmax(15rem, 1fr); grid-auto-flow: column; align-items: start; gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem; scrollbar-width: thin; }
@media (max-width: 639.98px) { .board { margin: 0 -1rem; scroll-padding: 0 1rem; grid-auto-columns: 84%; gap: 0.75rem; padding-left: 1rem; padding-right: 1rem; scrollbar-width: none; } .board::-webkit-scrollbar { display: none; } }
.column { display: flex; min-width: 0; scroll-snap-align: start; flex-direction: column; border-radius: var(--radius-xl); background: var(--background-2); transition: background-color .2s, box-shadow .2s; }
.column.drop { background: color-mix(in srgb, var(--red) 8%, var(--background-2)); box-shadow: 0 0 0 2px var(--red) inset; }
.column > header { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 0.5rem 0.5rem 0.875rem; }
.column > header h2 { font-size: 0.875rem; font-weight: 600; letter-spacing: -0.01em; }
.stage-dot { width: 0.5rem; height: 0.5rem; flex-shrink: 0; border-radius: 9999px; }
.stage-backlog { background: var(--line-strong); } .stage-in_progress { background: var(--foreground); } .stage-review { background: var(--red); } .stage-done { background: var(--success); }
.col-cards { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 3rem; gap: 0.5rem; padding: 0 0.5rem 0.5rem; }
.col-foot { border-top: 1px solid var(--border); padding: 0.625rem 0.875rem; font-size: 0.75rem; color: var(--muted-foreground); }
.col-foot a { display: inline-flex; align-items: center; gap: 0.375rem; }
.col-foot a:hover { color: var(--foreground); }
.tcard { position: relative; min-width: 0; border-radius: 14px; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow-xs); transition: border-color .15s, transform .25s var(--ease), box-shadow .25s; cursor: pointer; }
.tcard:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.tcard.dragging { opacity: 0.5; }
.tcard .blocked { display: flex; align-items: center; gap: 0.375rem; border-bottom: 1px solid var(--border); background: var(--card-2); padding: 0.375rem 0.75rem; font-size: 0.75rem; color: var(--muted-foreground); border-radius: 14px 14px 0 0; }
.tcard .blocked > .truncate { min-width: 0; flex: 1; }
.tcard .blocked > span.medium { flex-shrink: 0; white-space: nowrap; color: var(--ink-2); }
.tcard .body { display: grid; gap: 0.5rem; padding: 0.75rem 0.8125rem; }
.tcard .ttl { font-size: 0.875rem; font-weight: 500; line-height: 1.3rem; letter-spacing: -0.005em; overflow-wrap: break-word; }
.tcard .meta { display: flex; align-items: flex-end; gap: 0.5rem; font-size: 0.75rem; color: var(--muted-foreground); }
.tcard .meta .l { display: flex; min-width: 0; flex: 1; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.tcard .move { position: absolute; top: 0.5rem; right: 0.5rem; border-radius: 8px; padding: 0.3125rem; color: var(--muted-foreground); opacity: 0; transition: opacity .15s; }
.tcard:hover .move, .tcard:focus-within .move { opacity: 1; }
.tcard .move:hover { background: var(--accent); color: var(--foreground); }
@media (hover: none), (max-width: 639.98px) { .tcard .move { opacity: 1; } }
.tag { display: inline-flex; align-items: center; border-radius: 9999px; padding: 0.0625rem 0.5rem; font-size: 0.6875rem; line-height: 1.1rem; font-weight: 500; white-space: nowrap; }
.tag-bug, .sw.tag-bug { background: var(--red-soft); color: var(--red-ink); }
.tag-urgent, .sw.tag-urgent { background: var(--red-soft); color: var(--red-ink); }
.tag-idea, .sw.tag-idea { background: color-mix(in srgb, var(--person-0) 14%, var(--card)); color: var(--person-0); }
.tag-discuss, .sw.tag-discuss { background: var(--success-soft); color: var(--success); }
.tag-later, .sw.tag-later { background: var(--muted); color: var(--muted-foreground); }
.sw.tag-bug, .sw.tag-urgent { background: var(--red); } .sw.tag-idea { background: var(--person-0); } .sw.tag-discuss { background: var(--success); } .sw.tag-later { background: var(--line-strong); }
.due { display: inline-flex; align-items: center; gap: 0.25rem; border-radius: 9999px; font-size: 0.6875rem; line-height: 1.1rem; padding: 0.0625rem 0.5rem; background: var(--muted); color: var(--ink-2); }
.due.soon { background: var(--warning-soft); color: color-mix(in srgb, var(--warning) 75%, var(--foreground)); }
.due.late { background: var(--red-soft); color: var(--red-ink); }
.add-card { width: 100%; justify-content: flex-start; color: var(--muted-foreground); border-radius: 12px; }
.comment { display: flex; gap: 0.75rem; }
.comment .bubble { display: grid; gap: 0.25rem; min-width: 0; font-size: 0.875rem; padding: 0.625rem 0.875rem; border-radius: 4px 16px 16px 16px; background: var(--card-2); border: 1px solid var(--border); }
.mention { color: var(--red-ink); font-weight: 500; }

/* ---------- activity ---------- */
.usage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1023.98px) { .usage-grid { grid-template-columns: 1fr; } }
.bars { display: flex; height: 7rem; align-items: flex-end; gap: 2px; }
.bars li { display: flex; height: 100%; min-width: 0; flex: 1; flex-direction: column; justify-content: flex-end; }
.bars .ok { display: block; width: 100%; background: var(--foreground); border-radius: 3px 3px 1px 1px; opacity: 0.85; }
.bars .bad { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--red); margin-bottom: 1px; }
.bars li:hover .ok { opacity: 1; }
.filters3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 767.98px) { .filters3 { grid-template-columns: 1fr; } }
.activity-head { flex-wrap: wrap; }
@media (max-width: 639.98px) { .activity-head { flex-direction: column; align-items: stretch; } }

/* stat tiles (accounting, clients) */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 767.98px) { .stats { grid-template-columns: 1fr; gap: 0.625rem; } }
.stat { display: grid; gap: 0.375rem; padding: 1.25rem; border-radius: var(--radius-xl); }
.stat .k { font: 500 0.6875rem/1.2 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
.stat .v { font-size: 1.875rem; line-height: 2.25rem; font-weight: 600; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 0.8125rem; color: var(--muted-foreground); }
.flowbars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.75rem; align-items: end; height: 10rem; }
.flowbars .m { display: grid; gap: 0.375rem; justify-items: center; height: 100%; align-content: end; }
.flowbars .pair { display: flex; gap: 4px; align-items: flex-end; height: 8rem; width: 100%; justify-content: center; }
.flowbars .in { width: 38%; max-width: 1.75rem; background: var(--foreground); border-radius: 5px 5px 2px 2px; }
.flowbars .out { width: 38%; max-width: 1.75rem; background: var(--line-strong); border-radius: 5px 5px 2px 2px; }
.right { text-align: right; }

/* ---------- dialogs ---------- */
.dialog { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; margin: 0 auto; display: grid; width: 100%; max-width: 30rem; gap: 1.25rem; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--border); background: var(--card); color: var(--foreground); padding: 1.75rem 1.375rem max(1.5rem, env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); border-radius: 26px 26px 0 0; animation: sheet-in-bottom 380ms var(--spring); }
.dialog::before { content: ''; position: absolute; top: 0.625rem; left: 50%; width: 2.5rem; height: 0.3125rem; margin-left: -1.25rem; border-radius: 9999px; background: var(--line-strong); }
.dialog.lg { max-width: 42rem; }
.dialog:focus { outline: none; }
@media (min-width: 640px) {
  .dialog { top: 50%; left: 50%; right: auto; bottom: auto; max-height: calc(100dvh - 4rem); transform: translate(-50%, -50%); border-radius: 24px; padding: 1.75rem; animation: dialog-in 220ms var(--ease); }
  .dialog::before { display: none; }
}
.dialog h2.dt { font-size: 1.3125rem; line-height: 1.6rem; font-weight: 600; letter-spacing: -0.03em; padding-right: 0.5rem; }
.dialog .dd { font-size: 0.875rem; line-height: 1.35rem; color: var(--muted-foreground); }
.dialog .dhead { display: grid; gap: 0.5rem; }
.dfoot { display: flex; flex-direction: column-reverse; gap: 0.5rem; padding-top: 0.25rem; }
.dfoot .btn { height: 2.75rem; }
@media (min-width: 640px) { .dfoot { flex-direction: row; justify-content: flex-end; } .dfoot .btn { height: 2.375rem; } }
.secret-box { display: grid; gap: 0.5rem; border-radius: 14px; border: 1px dashed var(--line-strong); background: var(--card-2); padding: 0.875rem; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.375rem 1rem; font-family: var(--font-mono); font-size: 0.875rem; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 60; right: 1.5rem; bottom: 1.5rem; display: grid; gap: 0.5rem; width: min(24rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 0.75rem; border-radius: 16px; background: var(--night); color: var(--night-ink); padding: 0.75rem 1rem 0.75rem 0.75rem; font-size: 0.875rem; line-height: 1.3rem; box-shadow: var(--shadow-lg); animation: toast-in 320ms var(--spring); }
.toast .muted { color: var(--night-ink-2); }
.toast-ic { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 9999px; background: var(--mint); color: #0D0F13; flex-shrink: 0; }
.toast-ic svg { width: 0.9375rem; height: 0.9375rem; stroke-width: 2.75; }
.toast.out { opacity: 0; transform: translateY(0.5rem) scale(0.98); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(0.75rem) scale(0.96); } }
@media (max-width: 1023.98px) { .toasts { left: 0.75rem; right: 0.75rem; bottom: calc(5rem + env(safe-area-inset-bottom)); width: auto; justify-items: center; } .toast { width: 100%; max-width: 26rem; } }
body.has-bar .toasts { bottom: 5.5rem; }
@media (max-width: 1023.98px) { body.has-bar .toasts { bottom: calc(10rem + env(safe-area-inset-bottom)); } }

/* misc */
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; padding: 0.875rem 0; font-size: 0.875rem; }
.kv-row + .kv-row { border-top: 1px solid var(--border); }
.px6 { padding-left: 1.5rem; padding-right: 1.5rem; }
@media (max-width: 639.98px) { .px6 { padding-left: 1.125rem; padding-right: 1.125rem; } }
.passage { border-left: 2px solid var(--red); padding-left: 0.875rem; font-size: 0.9375rem; line-height: 1.5rem; color: var(--ink-2); }
.passage mark { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--foreground); border-radius: 3px; padding: 0 2px; }
.skill-name { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; color: var(--foreground); text-underline-offset: 4px; }
a.skill-name:hover { text-decoration: underline; text-decoration-color: var(--red); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.two-col { display: grid; gap: 1.5rem; }
@media (min-width: 1024px) { .two-col { grid-template-columns: minmax(0, 1fr) 19rem; align-items: start; } }
.steps { display: grid; gap: 0.5rem; font-size: 0.875rem; }
.steps li { display: flex; align-items: center; gap: 0.5rem; }
.progress { height: 0.375rem; border-radius: 9999px; background: var(--muted); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 9999px; background: linear-gradient(90deg, var(--foreground), var(--red)); }
.photo-row { display: flex; align-items: center; gap: 1.25rem; }
.emergency { background: var(--card); }
.emergency.on { border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.stopped-banner { position: sticky; top: 0; z-index: 20; }
@media (max-width: 1023.98px) { .stopped-banner { top: calc(3.75rem + env(safe-area-inset-top)); } }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.job-row { transition: background-color .15s; }
.job-row:hover { background: var(--card-2); }
.job-row:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.job-row:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.job-row:only-child { border-radius: var(--radius-lg); }
@media (max-width: 639.98px) { .job-row { padding: 1rem 1.125rem !important; } }
.sec-h { padding: 1.5rem 1.5rem 0.25rem; }
@media (max-width: 639.98px) { .sec-h { padding: 1.125rem 1.125rem 0.25rem; } }

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