/* ─────────────────────────────────────────────────────────────────────────────
   Taabi Tickets — design system.

   Same skeleton as prom.taabi.co (token names, card/control/chip rhythm, icons),
   recoloured: the Taabi orange ramp becomes a light-green radiant gradient that
   is easy to sit in front of all day. Text always sits on a checked pair
   (--color-primary/--color-primary-ink, --color-ok/--color-ok-soft, …);
   decorative green (rings, gradients, the mark) uses --color-brand-*.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  /* brand ramp — light green */
  --color-brand-50: #f2fbf6;
  --color-brand-100: #ddf5e7;
  --color-brand-200: #bcead1;
  --color-brand-300: #8ddcb4;
  --color-brand-400: #4ec493; /* the mark's green — graphics only */
  --color-brand-500: #2fa873;
  --color-brand-600: #1f8a5e;
  --color-brand-700: #196e4d;
  --color-brand-800: #14573e;
  --color-brand-900: #0f4230;

  /* the one gradient surface (brand panel, headers) */
  --color-accent: #bcead1;
  --color-accent-deep: #4ec493;
  --color-accent-ink: #0f4230;

  --color-primary: #1f8a5e;
  --color-primary-hover: #196e4d;
  --color-primary-ink: #ffffff;
  --color-danger-strong: #b42318;
  --color-danger-strong-ink: #ffffff;

  /* surfaces */
  --color-canvas: #f4f8f5;
  --color-surface: #ffffff;
  --color-surface-2: #eff5f1;
  --color-faint: #e7f0ea;
  --color-line: #dcebe2;
  --color-line-strong: #7d8c85;
  --color-ink: #10221a;
  --color-ink-soft: #35473e;
  --color-muted: #5f7269;

  /* semantic inks + opaque tints */
  --color-ok: #14652f;
  --color-ok-soft: #e6f4ea;
  --color-warn: #8a4d06;
  --color-warn-soft: #fbf0dc;
  --color-danger: #a81f14;
  --color-danger-soft: #fbeae8;
  --color-done: #14652f;
  --color-done-soft: #e6f4ea;
  --color-info: #1d4ed8;
  --color-info-soft: #e8eefc;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-card: 14px;
  --radius-control: 10px;
  --radius-chip: 8px;

  --shadow-card: 0 1px 2px rgb(16 34 26 / 0.05), 0 1px 3px rgb(16 34 26 / 0.05);
  --shadow-pop: 0 10px 28px rgb(16 34 26 / 0.14), 0 2px 6px rgb(16 34 26 / 0.08);

  --text-2xs: 0.6875rem;

  /* the radiant backdrop — calm, low-contrast, nothing near the text */
  --radiant-page:
    radial-gradient(1100px 620px at 6% -10%, rgb(141 220 180 / 0.42), transparent 62%),
    radial-gradient(900px 520px at 100% -5%, rgb(188 234 209 / 0.55), transparent 58%),
    radial-gradient(760px 700px at 62% 112%, rgb(78 196 147 / 0.16), transparent 62%),
    linear-gradient(160deg, #f5fbf8 0%, #edf8f2 45%, #e6f4ee 100%);
  --radiant-panel:
    radial-gradient(900px 520px at 18% 8%, rgb(255 255 255 / 0.78), transparent 60%),
    radial-gradient(720px 720px at 88% 26%, rgb(141 220 180 / 0.72), transparent 62%),
    radial-gradient(820px 620px at 32% 104%, rgb(78 196 147 / 0.42), transparent 60%),
    linear-gradient(150deg, #eafaf1 0%, #d9f4e5 38%, #c6eed9 68%, #b6e7ce 100%);
  --radiant-bar: linear-gradient(135deg, #ddf5e7 0%, #bcead1 100%);
}

:root.dark {
  color-scheme: dark;

  --color-canvas: #0b1310;
  --color-surface: #12201a;
  --color-surface-2: #17281f;
  --color-faint: #1d3226;
  --color-line: #24382d;
  --color-line-strong: #6b8378;
  --color-ink: #eef7f1;
  --color-ink-soft: #c3d6ca;
  --color-muted: #93a89b;

  --color-brand-50: #12261c;
  --color-brand-100: #163024;
  --color-brand-200: #1c4231;
  --color-brand-300: #2a6a4c;
  --color-brand-400: #7fe3ae;
  --color-brand-500: #4ec493;
  --color-brand-600: #8ddcb4;
  --color-brand-700: #bcead1;
  --color-brand-800: #ddf5e7;

  --color-ok: #6ee7a8;
  --color-ok-soft: #14251c;
  --color-warn: #fbbf24;
  --color-warn-soft: #2a1f0a;
  --color-danger: #fca5a5;
  --color-danger-soft: #2a1315;
  --color-done: #6ee7a8;
  --color-done-soft: #14251c;
  --color-info: #a5c4ff;
  --color-info-soft: #141c33;

  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.45);
  --shadow-pop: 0 12px 34px rgb(0 0 0 / 0.55);

  --radiant-page:
    radial-gradient(1000px 600px at 4% -10%, rgb(42 106 76 / 0.45), transparent 62%),
    radial-gradient(860px 520px at 100% -6%, rgb(28 66 49 / 0.6), transparent 58%),
    linear-gradient(160deg, #0b1310 0%, #0d1a14 50%, #0f1f18 100%);
  --radiant-panel:
    radial-gradient(700px 500px at 20% 6%, rgb(58 140 100 / 0.35), transparent 60%),
    radial-gradient(700px 700px at 90% 30%, rgb(28 66 49 / 0.75), transparent 62%),
    linear-gradient(150deg, #0d1c15 0%, #102419 45%, #143024 100%);
  --radiant-bar: linear-gradient(135deg, #163024 0%, #2a6a4c 100%);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--color-canvas);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.app-body { background: var(--radiant-page); background-attachment: fixed; }

a { color: var(--color-brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in oklab, var(--color-muted) 40%, transparent) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: color-mix(in oklab, var(--color-muted) 35%, transparent); border-radius: 8px; }
:focus-visible { outline: 2px solid var(--color-brand-400); outline-offset: 2px; }

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }

/* ── brand lockup ─────────────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-word { display: inline-flex; align-items: baseline; gap: 6px; color: var(--color-ink); }
.brand-word b { font-weight: 700; letter-spacing: -0.02em; }
.brand-word i {
  font-style: normal; font-weight: 700; letter-spacing: 0.06em;
  background: var(--color-brand-50); color: var(--color-brand-700); border-radius: 6px;
}
:root.dark .brand-word i { background: var(--color-brand-100); color: var(--color-brand-700); }

/* ── app frame ────────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

.sidebar {
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px 12px;
  background: color-mix(in oklab, var(--color-surface) 82%, transparent);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--color-line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { padding: 4px 6px 10px; }
.nav { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-group-label {
  font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--color-muted); padding: 0 10px 4px; font-weight: 650;
}
.side-link {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 10px; border-radius: var(--radius-control);
  color: var(--color-ink-soft); font-size: 13.5px; font-weight: 500;
  border: 0; background: transparent; width: 100%; cursor: pointer; text-align: left;
}
.side-link:hover { background: var(--color-faint); color: var(--color-ink); text-decoration: none; }
.side-link.active { background: var(--color-brand-100); color: var(--color-brand-800); font-weight: 650; }
:root.dark .side-link.active { background: var(--color-brand-200); color: var(--color-brand-800); }
.side-ext { margin-left: auto; color: var(--color-muted); display: inline-flex; }
.sidebar-foot { border-top: 1px solid var(--color-line); padding-top: 10px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 20px;
  background: color-mix(in oklab, var(--color-surface) 78%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-line);
}
.topbar-title { font-weight: 650; font-size: 15px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-menu { display: none; }
.who { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 999px; background: var(--color-surface-2); }
.who-text { display: flex; flex-direction: column; line-height: 1.15; }
.who-text b { font-size: 12.5px; font-weight: 600; }
.who-text i { font-style: normal; font-size: 11px; color: var(--color-muted); }
.content { padding: 22px; display: flex; flex-direction: column; gap: 18px; max-width: 1220px; width: 100%; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--radiant-bar); color: var(--color-brand-800);
  font-size: 11px; font-weight: 700; flex: 0 0 auto;
}
:root.dark .avatar { color: var(--color-brand-800); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-control);
  border: 1px solid var(--color-line); background: var(--color-surface);
  color: var(--color-ink-soft); cursor: pointer;
}
.icon-btn:hover { background: var(--color-surface-2); color: var(--color-ink); }

/* ── buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 13px; border: 1px solid transparent;
  border-radius: var(--radius-control); font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; font-family: inherit;
}
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-primary { background: var(--color-primary); color: var(--color-primary-ink); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary { border-color: var(--color-line-strong); background: var(--color-surface); color: var(--color-ink-soft); }
.btn-secondary:hover { background: var(--color-surface-2); color: var(--color-ink); }
.btn-ghost { background: transparent; color: var(--color-muted); }
.btn-ghost:hover { background: var(--color-faint); color: var(--color-ink); }
.btn-danger { background: var(--color-danger-strong); color: var(--color-danger-strong-ink); }
.btn-lg { height: 40px; padding: 0 18px; font-size: 15px; }
.btn-sm { height: 27px; padding: 0 10px; font-size: 12.5px; border-radius: var(--radius-chip); }

/* ── form controls ────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.label { font-size: 12.5px; font-weight: 600; color: var(--color-ink-soft); }
.req { color: var(--color-danger); font-style: normal; }
.hint { font-size: 11.5px; color: var(--color-muted); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--color-line-strong); border-radius: var(--radius-control);
  background: var(--color-surface); color: var(--color-ink); padding: 8px 11px;
  font-size: 14px; font-family: inherit; outline: none;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--color-brand-500);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-brand-400) 30%, transparent);
}
.input::placeholder, .textarea::placeholder { color: var(--color-muted); }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--color-ink-soft); }
.check input { margin-top: 2px; accent-color: var(--color-brand-500); }

/* ── surfaces ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface); border: 1px solid var(--color-line);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
}
.section { overflow: hidden; }
.section-head { padding: 15px 18px; border-bottom: 1px solid var(--color-line); background: color-mix(in oklab, var(--color-surface-2) 55%, transparent); }
.section-head h2 { font-size: 14.5px; }
.section-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--color-muted); }
.section-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.grid { display: grid; gap: 14px; }
.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)); }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }

.stat { padding: 15px 16px; display: flex; flex-direction: column; gap: 3px; }
.stat .stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); font-weight: 650; }
.stat .stat-value { font-size: 25px; font-weight: 680; letter-spacing: -0.02em; }
.stat .stat-note { font-size: 12px; color: var(--color-muted); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650;
  border: 1px solid transparent; white-space: nowrap;
}
.pill-ok, .pill-done { background: var(--color-ok-soft); color: var(--color-ok); border-color: color-mix(in oklab, var(--color-ok) 22%, transparent); }
.pill-warn { background: var(--color-warn-soft); color: var(--color-warn); border-color: color-mix(in oklab, var(--color-warn) 22%, transparent); }
.pill-danger { background: var(--color-danger-soft); color: var(--color-danger); border-color: color-mix(in oklab, var(--color-danger) 22%, transparent); }
.pill-info { background: var(--color-info-soft); color: var(--color-info); border-color: color-mix(in oklab, var(--color-info) 22%, transparent); }
.pill-muted { background: var(--color-faint); color: var(--color-muted); border-color: var(--color-line); }

/* ── tables ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--color-muted); font-weight: 650; padding: 10px 12px;
  border-bottom: 1px solid var(--color-line); background: var(--color-surface-2);
  position: sticky; top: 0; z-index: 1;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--color-line); vertical-align: top; overflow-wrap: anywhere; font-size: 13.5px; }
.table tbody tr:hover { background: color-mix(in oklab, var(--color-surface-2) 60%, transparent); }
.table .num { color: var(--color-muted); font-variant-numeric: tabular-nums; }
.cell-sub { color: var(--color-muted); font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 12px; }

.pagebar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--radius-chip);
  border: 1px solid var(--color-line-strong); background: var(--color-surface); color: var(--color-ink-soft);
}
.page-btn:hover { background: var(--color-surface-2); text-decoration: none; }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }
.page-info { font-size: 12.5px; color: var(--color-ink-soft); padding: 0 6px; }
.page-info em { color: var(--color-muted); font-style: normal; }

.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; }
.filters .field { min-width: 0; }

/* ── alerts, toasts, empty ────────────────────────────────────────────────── */
.alert { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-control); font-size: 13px; }
.alert-ok { background: var(--color-ok-soft); color: var(--color-ok); }
.alert-danger { background: var(--color-danger-soft); color: var(--color-danger); }
.alert-info { background: var(--color-info-soft); color: var(--color-info); }

.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-control);
  background: var(--color-surface); border: 1px solid var(--color-line); box-shadow: var(--shadow-pop);
  font-size: 13px; animation: tk-in 0.18s ease-out both;
}
.toast-ok { color: var(--color-ok); border-color: color-mix(in oklab, var(--color-ok) 30%, var(--color-line)); }
.toast-danger { color: var(--color-danger); border-color: color-mix(in oklab, var(--color-danger) 30%, var(--color-line)); }
.toast-info { color: var(--color-info); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; color: var(--color-muted); text-align: center; }
.empty p { margin: 0; font-weight: 600; color: var(--color-ink-soft); }
.empty small { font-size: 12px; }

/* ── modal ────────────────────────────────────────────────────────────────── */
.modal { border: 0; border-radius: var(--radius-card); padding: 20px; max-width: 420px; box-shadow: var(--shadow-pop); background: var(--color-surface); color: var(--color-ink); }
.modal::backdrop { background: rgb(16 34 26 / 0.42); }
.modal h3 { font-size: 15.5px; margin-bottom: 6px; }
.modal p { margin: 0 0 16px; font-size: 13.5px; color: var(--color-ink-soft); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── landing / sign-in ────────────────────────────────────────────────────── */
.landing { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.landing-left {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 42px 46px; background: var(--radiant-panel);
  color: var(--color-accent-ink);
}
.landing-left::after {
  content: ""; position: absolute; inset: -30% -10% auto auto; width: 70%; height: 70%;
  background: radial-gradient(closest-side, rgb(255 255 255 / 0.55), transparent 70%);
  pointer-events: none;
}
.landing-hero { max-width: 460px; display: flex; flex-direction: column; gap: 18px; position: relative; }
.landing-hero h1 { font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; }
.landing-hero p { margin: 0; font-size: 15px; line-height: 1.6; color: color-mix(in oklab, var(--color-accent-ink) 82%, transparent); }
.landing-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 650;
  background: rgb(255 255 255 / 0.6); color: var(--color-brand-800);
  border: 1px solid rgb(255 255 255 / 0.8);
}
.feature-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; position: relative; }
.feature-list li { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; }
.feature-list .fi {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgb(255 255 255 / 0.72); color: var(--color-brand-700);
  border: 1px solid rgb(255 255 255 / 0.9);
}
.feature-list b { display: block; font-size: 13.5px; }
.feature-list span { color: color-mix(in oklab, var(--color-accent-ink) 76%, transparent); font-size: 12.5px; }
.landing-foot { font-size: 12px; color: color-mix(in oklab, var(--color-accent-ink) 70%, transparent); position: relative; }

.landing-right { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--color-canvas); }
.auth-card { width: 100%; max-width: 400px; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h2 { font-size: 19px; }
.auth-card .sub { margin: 0; font-size: 13px; color: var(--color-muted); }
.auth-tabs { display: flex; gap: 4px; padding: 4px; background: var(--color-surface-2); border-radius: var(--radius-control); }
.auth-tab {
  flex: 1; height: 30px; border: 0; border-radius: 7px; background: transparent;
  font-size: 12.5px; font-weight: 600; color: var(--color-muted); cursor: pointer; font-family: inherit;
}
.auth-tab.active { background: var(--color-surface); color: var(--color-brand-700); box-shadow: var(--shadow-card); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.code-input {
  font-family: var(--font-mono); font-size: 22px; letter-spacing: 0.34em; text-align: center;
  padding: 11px 12px;
}
.auth-foot { font-size: 12px; color: var(--color-muted); text-align: center; }
.auth-foot a { font-weight: 600; }

/* ── ticket detail ────────────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.kv { display: flex; flex-direction: column; gap: 10px; }
.kv-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.kv-row dt { color: var(--color-muted); }
.kv-row dd { margin: 0; text-align: right; font-weight: 550; }
.timeline { display: flex; flex-direction: column; gap: 14px; }
.tl-item { display: flex; gap: 11px; }
.tl-body { flex: 1; min-width: 0; }
.tl-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tl-head b { font-size: 13px; }
.tl-head time { font-size: 11.5px; color: var(--color-muted); }
.tl-text { margin: 4px 0 0; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl-sys { margin: 4px 0 0; font-size: 12.5px; color: var(--color-muted); }
.comment-box { display: flex; flex-direction: column; gap: 10px; }

.ticket-list { display: flex; flex-direction: column; }
.ticket-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--color-line); }
.ticket-row:last-child { border-bottom: 0; }
.ticket-row:hover { background: color-mix(in oklab, var(--color-surface-2) 60%, transparent); }
.ticket-row .tr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ticket-row .tr-title { font-size: 13.8px; font-weight: 600; color: var(--color-ink); overflow-wrap: anywhere; }
.ticket-row .tr-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--color-muted); }
.ticket-row .tr-ref { font-family: var(--font-mono); font-size: 11.5px; color: var(--color-muted); }
.ticket-row .tr-side { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; }
.page-head .sub { font-size: 12.5px; color: var(--color-muted); }
.inline { display: inline-flex; align-items: center; gap: 6px; }

@keyframes tk-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.animate-in { animation: tk-in 0.18s ease-out both; }

/* ── responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; }
  .landing-left { padding: 32px 24px; gap: 26px; }
  .landing-hero h1 { font-size: 27px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform 0.18s ease; }
  body.nav-open .sidebar { transform: none; }
  .topbar-menu { display: inline-flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
@media (pointer: coarse) {
  .btn { height: 38px; }
  .btn-sm { height: 34px; }
  .side-link { height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── appearance switch ────────────────────────────────────────────────────── */
.theme-switch { display: flex; gap: 4px; padding: 4px; background: var(--color-surface-2); border-radius: var(--radius-control); }
.theme-opt {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; border: 0; border-radius: 7px; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 600; color: var(--color-muted);
}
.theme-opt:hover { color: var(--color-ink); }
.theme-opt.is-on { background: var(--color-surface); color: var(--color-brand-700); box-shadow: var(--shadow-card); }

/* ── docs ─────────────────────────────────────────────────────────────────── */
.doc-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.doc-card {
  display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius-card);
  border: 1px solid var(--color-line); background: var(--color-surface); color: var(--color-ink); text-decoration: none;
}
.doc-card:hover { border-color: var(--color-brand-300); background: var(--color-brand-50); text-decoration: none; }
.doc-card b { font-size: 13.5px; }
.doc-card span { font-size: 12.5px; color: var(--color-muted); }

.doc-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.doc-side { padding: 10px; position: sticky; top: 74px; }
.doc-nav { display: flex; flex-direction: column; gap: 2px; }
.doc-body { padding: 24px; max-width: 900px; }
.doc-body > :first-child { margin-top: 0; }
.doc-body p { line-height: 1.65; margin: 0 0 14px; color: var(--color-ink-soft); }
.doc-body h1.md-h1 { font-size: 21px; margin: 0 0 14px; }
.doc-body h2.md-h2 { font-size: 16.5px; margin: 22px 0 10px; }
.doc-body h3.md-h3 { font-size: 14.5px; margin: 18px 0 8px; }
.doc-body h4.md-h4 { font-size: 13px; margin: 16px 0 8px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); }
.doc-body ul, .doc-body ol { margin: 0 0 14px; padding-left: 20px; color: var(--color-ink-soft); }
.doc-body li { margin-bottom: 5px; line-height: 1.6; }
.doc-body code { background: var(--color-surface-2); border: 1px solid var(--color-line); border-radius: 5px; padding: 1px 5px; font-family: var(--font-mono); font-size: 12.5px; }
.doc-body .md-pre { background: var(--color-surface-2); border: 1px solid var(--color-line); border-radius: var(--radius-control); padding: 14px; overflow-x: auto; margin: 0 0 14px; }
.doc-body .md-pre code { background: none; border: 0; padding: 0; font-size: 12.5px; line-height: 1.6; }
.doc-body .md-quote { margin: 0 0 14px; padding: 4px 0 4px 14px; border-left: 3px solid var(--color-brand-300); color: var(--color-muted); }
.doc-body .md-hr { border: 0; border-top: 1px solid var(--color-line); margin: 20px 0; }
.doc-body table.md-table { margin-bottom: 14px; }
.doc-body table.md-table th, .doc-body table.md-table td { font-size: 12.5px; }

@media (max-width: 1080px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-side { position: static; }
}
