/* Self-hosted fonts (latin subset), so no page waits on Google Fonts. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-latin.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-700-latin.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/barlow-condensed-800-latin.woff2) format('woff2'); }
/* Crestline Operations Intelligence: the one design system.
   See DESIGN.md. Every page links this before its own styles. */

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f1f1ee;
  --surface-3: #e9e9e5;
  --line: #e5e5e1;
  --line-2: #d3d3ce;
  --fg: #161614;
  --fg-2: #45453f;
  --fg-3: #73736c;
  --fg-4: #a3a39b;

  --accent: #B4572A;
  --accent-hover: #9f4b22;
  --accent-text: #9a4720;
  --accent-soft: #f8ebe3;
  --accent-ring: rgba(180, 87, 42, .28);

  --ok: #1f8f4e;   --ok-text: #17703d;   --ok-soft: #e7f4eb;
  --warn: #b86c0c; --warn-text: #8f5308; --warn-soft: #fbf0dc;
  --bad: #cc3a2d;  --bad-text: #ae2f23;  --bad-soft: #fbe9e6;
  --info: #2b6fd6; --info-text: #255fb8; --info-soft: #e8f0fc;
  --brand: #BA8055; --brand-dark: #9A6540;

  --r-1: 4px; --r-2: 6px; --r-3: 8px; --r-4: 12px;
  --shadow-pop: 0 1px 2px rgba(20, 20, 18, .06), 0 12px 32px rgba(20, 20, 18, .12);
  --shadow-drawer: -8px 0 32px rgba(20, 20, 18, .12);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --t-fast: 120ms; --t: 180ms; --t-slow: 240ms;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --ease-out: var(--ease);

  /* Legacy names used by older markup in this repo. Point them at the system. */
  --ink: var(--fg); --ink-muted: var(--fg-3); --ink-2: var(--fg-2);
  --page: var(--bg); --paper: var(--bg); --card: var(--surface);
  --border: var(--line); --border-soft: var(--line); --border-strong: var(--line-2);
  --accent-dark: var(--accent-text); --accent-tint: var(--accent-soft);
  --ink-chip: var(--surface-2); --ink-chip-fg: var(--fg-2);
  --good: var(--ok); --good-tint: var(--ok-soft);
  --bad-tint: var(--bad-soft); --warn-tint: var(--warn-soft);
  --blue: var(--info); --blue-tint: var(--info-soft);
  --green: var(--ok); --green-tint: var(--ok-soft);
  --cost: var(--warn); --cost-tint: var(--warn-soft);
  --violet: var(--info); --violet-tint: var(--info-soft);
  --surface-1: var(--surface); --text-1: var(--fg); --text-2: var(--fg-2); --text-muted: var(--fg-3);
  --grid: var(--line); --hover-wash: var(--surface-2);
  --rail: var(--surface-2); --rail-hover: var(--surface-3); --rail-active: var(--surface-3);
  --rail-text: var(--fg-2); --rail-muted: var(--fg-3);
  --shadow: none;
}
:root[data-theme="dark"], .theme-dark {
  color-scheme: dark;
  /* Warm near-black taken from the Omadli lockup (#17130f ground, #f5f1ea text): readable on an ops desk, not a cold grey. */
  --bg: #17130f; --surface: #1f1a15; --surface-2: #1b1611; --surface-3: #2a231c;
  --line: #2f2820; --line-2: #42392e;
  --fg: #f5f1ea; --fg-2: #d0c9bc; --fg-3: #988f80; --fg-4: #6b6355;
  --accent: #c9693a; --accent-hover: #d9794a; --accent-text: #e08a5c; --accent-soft: #2d1d14; --accent-ring: rgba(224, 138, 92, .35);
  --ok: #34a86a; --ok-text: #6fcf97; --ok-soft: #142a1d;
  --warn: #d58a2a; --warn-text: #e8b06a; --warn-soft: #2c200f;
  --bad: #e05a4c; --bad-text: #f08a7f; --bad-soft: #321614;
  --info: #5b93ea; --info-text: #8fb4f2; --info-soft: #14213a;
  --shadow-pop: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .5);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body {
  margin: 0; font-family: var(--font); font-optical-sizing: auto;
  font-size: 13px; line-height: 1.5; letter-spacing: -0.006em;
  color: var(--fg); background: var(--bg);
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; text-wrap: balance; color: var(--fg); }
h1 { font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 20px; line-height: 1.25; letter-spacing: -0.015em; }
h3 { font-size: 16px; line-height: 1.3; letter-spacing: -0.011em; }
h4 { font-size: 14px; line-height: 1.4; }
p { margin: 0; text-wrap: pretty; }
b, strong { font-weight: 600; }
a { color: inherit; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: inline-block; vertical-align: middle; }
/* Tabular figures on numbers only. Inter's tnum also widens the hyphen, so a whole table
   set to tnum prints "CM - 1129" and "add - on". Put .r or .num on numeric cells instead. */
.tnum, .num, .r, .c-stat-v, .c-table td.r, .c-table th.r { font-variant-numeric: tabular-nums; }
::selection { background: var(--accent-soft); color: var(--fg); }
:root[data-theme="dark"] ::selection { background: #3a2518; }
input { caret-color: var(--accent); }
::placeholder { color: var(--fg-4); opacity: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-1); }
input:focus-visible, select:focus-visible, textarea:focus-visible, .c-input:focus-visible, .c-select:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
/* Scrollbars that belong to the palette. */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid transparent; background-clip: padding-box; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-4); background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* Press feedback, one rule for every control. */
:is(button, [role="button"], [role="tab"], .c-btn, .c-row[href], a.c-stat) {
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform 90ms var(--ease);
}
:is(button, [role="button"], .c-btn):not(:disabled):active { transform: scale(.98); }
:is(button, .c-btn):disabled { cursor: not-allowed; opacity: .5; }

@keyframes c-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes c-fade { from { opacity: 0; } }
@keyframes c-pop { from { opacity: 0; transform: translateY(4px); filter: blur(2px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes c-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 120ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  :is(button, [role="button"], .c-btn):active { transform: none; }
  @keyframes c-rise { from { opacity: 0; } }
  @keyframes c-pop { from { opacity: 0; } }
}

/* --------------------------------------------------------------- buttons */
.c-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--r-2);
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none;
  color: var(--fg); background: var(--surface); border: 1px solid var(--line);
}
.c-btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.c-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.c-btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.c-btn.sm svg { width: 14px; height: 14px; }
.c-btn.lg { height: 36px; padding: 0 14px; font-size: 14px; }
.c-btn.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.c-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.c-btn.ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.c-btn.ghost:hover { background: var(--surface-2); color: var(--fg); }
.c-btn.accent { color: var(--accent-text); }
.c-btn.danger { color: var(--bad-text); }
.c-btn.danger:hover { background: var(--bad-soft); border-color: var(--bad-soft); }
.c-btn[aria-pressed="true"] { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent); }
.c-btn.icon { width: 32px; padding: 0; }
.c-btn.icon.sm { width: 28px; }
.c-btn .c-kbd { margin-left: 4px; }
.c-link { color: var(--accent-text); font-weight: 500; text-decoration: none; }
.c-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- inputs */
.c-input, .c-select, .c-textarea {
  height: 32px; padding: 0 10px; border-radius: var(--r-2);
  font-size: 13px; color: var(--fg); background: var(--surface); border: 1px solid var(--line);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.c-input:hover, .c-select:hover { border-color: var(--line-2); }
.c-textarea { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.c-select {
  appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2373736c' stroke-width='1.5' 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 8px center; background-size: 14px;
}
.c-search { position: relative; display: flex; align-items: center; }
.c-search svg { position: absolute; left: 10px; width: 15px; height: 15px; stroke: var(--fg-3); stroke-width: 1.5; fill: none; pointer-events: none; }
.c-search .c-input { padding-left: 32px; width: 100%; }

/* ------------------------------------------------------------- segmented */
.c-seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-2); }
.c-seg > button, .c-seg > a {
  height: 26px; padding: 0 10px; border: 0; border-radius: var(--r-1); background: transparent;
  font-size: 13px; font-weight: 500; color: var(--fg-3); text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.c-seg > :hover { color: var(--fg); }
.c-seg > .active, .c-seg > [aria-selected="true"], .c-seg > [aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(20, 20, 18, .08); }

/* ------------------------------------------------------------------ tabs */
.c-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); min-height: 40px; align-items: stretch; }
.c-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 0 2px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: none; text-decoration: none;
  font-size: 13px; font-weight: 500; color: var(--fg-3); white-space: nowrap;
}
.c-tab svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.c-tab:hover { color: var(--fg); }
.c-tab.active, .c-tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.c-tab .c-count { font-size: 11px; color: var(--fg-3); background: var(--surface-2); border-radius: 999px; padding: 1px 6px; }

/* --------------------------------------------------------- chips and tags */
.c-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 7px;
  border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  color: var(--fg-2); background: var(--surface-2);
}
.c-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--fg-4); flex: 0 0 auto; }
.c-chip.ok { color: var(--ok-text); background: var(--ok-soft); } .c-chip.ok::before { background: var(--ok); }
.c-chip.warn { color: var(--warn-text); background: var(--warn-soft); } .c-chip.warn::before { background: var(--warn); }
.c-chip.bad { color: var(--bad-text); background: var(--bad-soft); } .c-chip.bad::before { background: var(--bad); }
.c-chip.info { color: var(--info-text); background: var(--info-soft); } .c-chip.info::before { background: var(--info); }
.c-chip.accent { color: var(--accent-text); background: var(--accent-soft); } .c-chip.accent::before { background: var(--accent); }
.c-chip.neutral { color: var(--fg-2); background: var(--surface-2); }
button.c-chip { border: 0; font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
button.c-chip:hover { filter: brightness(.97); }
.c-chip.nodot::before { display: none; }
:is(.c-chip, .c-tag, .c-btn, .c-sample, .c-stat, .c-row)[hidden] { display: none; }
.c-chip.nodot { padding-left: 8px; }
.c-tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--r-1);
  font-size: 12px; font-weight: 500; color: var(--fg-2); background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap;
}
.c-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-4); vertical-align: middle; }
.c-dot.ok { background: var(--ok); } .c-dot.warn { background: var(--warn); } .c-dot.bad { background: var(--bad); } .c-dot.info { background: var(--info); } .c-dot.accent { background: var(--accent); }

/* ----------------------------------------------------------------- panel */
.c-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); }
.c-panel-hd { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 48px; }
.c-panel-hd h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.006em; }
.c-panel-hd .sub { font-size: 12px; color: var(--fg-3); }
.c-panel-hd .spacer { flex: 1; }
.c-panel-bd { padding: 16px; }
.c-panel-bd.flush { padding: 0; }
.c-panel-ft { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--fg-3); }

/* ------------------------------------------------------------- stat strip */
.c-stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.c-stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 12px; min-width: 0; text-decoration: none; color: inherit; border-left: 1px solid var(--line); position: relative; }
.c-stat:first-child { border-left: 0; }
.c-stat-l { font-size: 12px; font-weight: 500; color: var(--fg-3); display: flex; align-items: center; gap: 6px; }
.c-stat-v { font-size: 24px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; color: var(--fg); white-space: nowrap; }
.c-stat-s { font-size: 12px; color: var(--fg-3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 22px; }
.c-stat-v.bad, .c-stat-v .neg { color: var(--bad-text); }
.c-stat-v.ok, .c-stat-v .pos { color: var(--ok-text); }
/* Zero-specificity reset so the strip's own hairline rules (and their media queries) still win. */
:where(button.c-stat) { border: 0; background: none; font: inherit; color: inherit; }
.c-stat[role="button"], button.c-stat { cursor: pointer; text-align: left; }
a.c-stat:hover, button.c-stat:hover, .c-stat.clickable:hover, .c-stat[role="button"]:hover { background: var(--surface-2); }
a.c-stat::after, .c-stat.clickable::after {
  content: ""; position: absolute; right: 12px; top: 16px; width: 14px; height: 14px; opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2373736c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") no-repeat center / contain;
  transition: opacity var(--t-fast);
}
a.c-stat:hover::after, .c-stat.clickable:hover::after { opacity: 1; }
.c-stat.active { background: var(--accent-soft); }
.c-stat.active .c-stat-l { color: var(--accent-text); }
@media (max-width: 900px) { .c-stats { grid-auto-flow: row; grid-template-columns: 1fr 1fr; } .c-stat { border-left: 0; border-top: 1px solid var(--line); } .c-stat:nth-child(-n+2) { border-top: 0; } .c-stat:nth-child(even) { border-left: 1px solid var(--line); } }
@media (max-width: 560px) { .c-stats { grid-template-columns: 1fr; } .c-stat:nth-child(even) { border-left: 0; } .c-stat:nth-child(2) { border-top: 1px solid var(--line); } }

/* ------------------------------------------------------------------ rows */
.c-rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; margin: 0; padding: 0; list-style: none; }
.c-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 44px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.c-row:first-child { border-top: 0; }
a.c-row:hover, .c-row.clickable:hover { background: var(--surface-2); }
.c-row-ic { width: 28px; height: 28px; border-radius: var(--r-2); background: var(--surface-2); color: var(--fg-2); display: grid; place-items: center; flex: 0 0 auto; }
.c-row-ic svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.c-row-main { flex: 1; min-width: 0; }
.c-row-t { font-size: 13px; font-weight: 500; color: var(--fg); }
.c-row-d { font-size: 12px; color: var(--fg-3); }
.c-row-end { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--fg-3); font-size: 12px; flex: 0 0 auto; }
.c-row-end svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.5; fill: none; }

/* ----------------------------------------------------------------- table */
.c-table-wrap { overflow: auto; }
.c-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.c-table th {
  position: sticky; top: 0; z-index: 1; text-align: left; font-size: 12px; font-weight: 500; color: var(--fg-3);
  background: var(--surface-2); padding: 0 12px; height: 36px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.c-table th:first-child, .c-table td:first-child { padding-left: 16px; }
.c-table th:last-child, .c-table td:last-child { padding-right: 16px; }
.c-table td { padding: 8px 12px; height: 40px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--fg); }
.c-table tr:last-child td { border-bottom: 0; }
.c-table tbody tr:hover td, .c-table tbody tr:hover th { background: var(--surface-2); }
.c-table tbody tr.selected td { background: var(--accent-soft); }
.c-table tbody tr.clickable { cursor: pointer; }
.c-table .r, .c-table th.r, .c-table td.r, .c-table th.num, .c-table td.num { text-align: right; white-space: nowrap; }
.c-table .muted { color: var(--fg-3); }
.c-table .total td { font-weight: 600; background: var(--surface-2); }
.c-table th.sortable { cursor: pointer; user-select: none; }
.c-table th.sortable:hover { color: var(--fg); }
.c-table th .sort { font-size: 11px; margin-left: 4px; color: var(--fg-4); }
.c-table th.sorted .sort { color: var(--accent-text); }

/* ----------------------------------------------------------------- misc */
.c-kbd {
  display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border-radius: var(--r-1);
  font-size: 11px; font-weight: 500; color: var(--fg-3); background: var(--surface-2); border: 1px solid var(--line); line-height: 1;
}
.c-divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.c-vdivider { width: 1px; align-self: stretch; background: var(--line); }
.c-muted { color: var(--fg-3); }
.c-small { font-size: 12px; }
.c-sample { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-3); }
.c-sample::before { flex: 0 0 auto; }
.c-sample::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }

.c-empty { padding: 40px 24px; text-align: center; color: var(--fg-3); }
.c-empty h3 { font-size: 14px; color: var(--fg); margin-bottom: 4px; }
.c-empty p { font-size: 13px; margin-bottom: 12px; }
.c-skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 200% 100%; animation: c-shimmer 1.4s linear infinite; border-radius: var(--r-1); color: transparent; }

/* number pop-in (transitions.dev recipe, trimmed): add .is-animating to replay */
.c-num.is-animating { animation: c-pop 300ms var(--ease) both; display: inline-block; }

/* --------------------------------------------------- dialog and drawers */
.c-dialog {
  width: min(600px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 64px));
  margin: 15vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: var(--r-4);
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow-pop);
}
.c-dialog[open] { animation: c-rise var(--t) var(--ease); }
.c-dialog::backdrop { background: rgba(22, 22, 20, .35); }
.c-dialog[open]::backdrop { animation: c-fade var(--t) var(--ease); }
.c-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 40;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-drawer);
  transform: translateX(100%); transition: transform var(--t-slow) var(--ease-drawer); display: flex; flex-direction: column;
}
.c-drawer.open, .c-drawer.show { transform: none; }
.c-drawer.wide { width: min(680px, 100vw); }
.c-drawer-bd .c-table-wrap { overflow: visible; }
.c-drawer-hd { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 52px; }
.c-drawer-hd h3 { font-size: 16px; }
.c-drawer-bd { flex: 1; overflow: auto; padding: 16px; }
.c-drawer-ft { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.c-scrim { position: fixed; inset: 0; background: rgba(22, 22, 20, .3); z-index: 39; opacity: 0; pointer-events: none; transition: opacity var(--t); }
.c-scrim.open, .c-scrim.show { opacity: 1; pointer-events: auto; }
.c-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 130;
  background: var(--fg); color: var(--bg); font-size: 13px; padding: 10px 14px; border-radius: var(--r-3);
  box-shadow: var(--shadow-pop); animation: c-rise var(--t-slow) var(--ease); display: flex; align-items: center; gap: 10px;
}
.c-toast b { font-weight: 600; }
.c-menu { position: absolute; z-index: 30; min-width: 180px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-pop); animation: c-rise var(--t) var(--ease); }
.c-menu button, .c-menu a { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0 8px; height: 30px; border: 0; border-radius: var(--r-1); background: none; text-align: left; font-size: 13px; color: var(--fg); text-decoration: none; }
.c-menu button:hover, .c-menu a:hover { background: var(--surface-2); }

/* ---------------------------------------------------- dashboard header */
.c-top {
  display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.c-top .crest-logo { height: 28px; width: auto; display: block; flex: 0 0 auto; }
.c-top .crest-div { width: 1px; height: 22px; background: var(--line-2); flex: 0 0 auto; }
.c-top h1, .c-top .c-title { font-size: 16px; font-weight: 600; letter-spacing: -0.011em; white-space: nowrap; margin: 0; }
.c-top .c-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
html.embedded .c-top .crest-logo, html.embedded .c-top .crest-div { display: none; }
@media (min-width: 641px) { html.embedded .c-top { height: 48px; } }
@media (max-width: 640px) { .c-top { padding: 0 16px; gap: 10px; height: auto; min-height: 48px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; } .c-top .crest-div { display: none; } .c-top h1 { white-space: normal; } }

/* Icons: one stroke, one weight. */
.c-ic { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
