/* ============================================================
   Attestia — design tokens + base
   Light-only MVP. Trust is quiet.
   ============================================================ */

:root {
  /* trust spine — warm near-black ink + cream-neutral paper.
     Direction is Linear-recent / Mercury / Anecdotes: monochrome-leaning,
     warm undertones, very low chroma. Trust through restraint. */
  --ink-1:        #18181b;   /* near-black with warm undertone */
  --ink-2:        #3f3f46;   /* zinc-700 */
  --ink-3:        #71717a;   /* zinc-500 — secondary text */
  --ink-4:        #a1a1aa;   /* zinc-400 — hints */
  --paper:        #ffffff;
  --paper-alt:    #fafaf9;   /* stone-50 — warm off-white */
  --paper-shadow: #f4f4f2;   /* warm surface */
  --paper-deep:   #f0efeb;   /* slight cream for deeper surfaces */
  --rule:         #ebe9e4;   /* warm hairline */
  --rule-strong:  #d6d3ce;

  /* brand — near-black ink, single restrained accent.
     Brand "ink" replaces the old navy; serves CTAs, active states. */
  --brand-ink:    #0f0f12;
  --brand-ink-hover: #27272a;
  --brand-accent: #3f7d58;   /* muted sage — replaces candy emerald */
  --brand-accent-soft: #eaf2ec;

  /* verdicts — desaturated, evidentiary palette */
  --verified:        #2f6e47;   /* sage green */
  --verified-soft:   #eaf2ec;
  --partial:         #9a6418;   /* ochre, not bright amber */
  --partial-soft:    #f6efdf;
  --unverif:         #71717a;
  --unverif-soft:    #f4f4f2;
  --contra:          #9b2c2c;   /* brick, not bright red */
  --contra-soft:     #f6e7e6;

  /* utility */
  --link:        #18181b;
  --link-hover:  #3f3f46;
  --focus-ring:  #3f3f46;
  --code-bg:     #f4f4f2;
  --code-fg:     #18181b;

  /* spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  32px;
  --space-8:  40px;
  --space-9:  48px;
  --space-10: 64px;

  /* radii — tighter. Trust looks sharp. */
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 7px;
  --radius-xl: 10px;
  --radius-pill: 9999px;

  /* shadows — almost flat. Only modals/drawers get real depth. */
  --shadow-sm:   0 1px 0 rgba(24, 24, 27, 0.03);
  --shadow-md:   0 1px 2px rgba(24, 24, 27, 0.04), 0 0 0 1px rgba(24, 24, 27, 0.02);
  --shadow-lg:   0 8px 24px rgba(24, 24, 27, 0.06), 0 2px 6px rgba(24, 24, 27, 0.04);
  --shadow-xl:   0 24px 64px rgba(24, 24, 27, 0.12), 0 4px 12px rgba(24, 24, 27, 0.04);
  --shadow-focus: 0 0 0 3px rgba(63, 63, 70, 0.18);

  /* motion */
  --motion-fast: 100ms;
  --motion-base: 200ms;
  --motion-slow: 400ms;
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* type — Geist (sans) + Geist Mono + Instrument Serif (display italic accent).
     The italic serif is the brand's "moment" voice — used for page titles,
     hero numbers, document headings. Sparingly. */
  --font-sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-display: "Instrument Serif", "Tiempos Headline", Georgia, serif;

  /* density */
  --row-h: 48px;
  --pad-card: 24px;
  --btn-h: 40px;
  --sidebar-w: 240px;
}

[data-density="compact"] {
  --row-h: 36px;
  --pad-card: 16px;
  --btn-h: 32px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11", "ss03";
  color: var(--ink-1);
  background: var(--paper-alt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 13.5px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, textarea, select { font-family: inherit; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

::selection { background: rgba(24, 24, 27, 0.14); }

.mono { font-family: var(--font-mono); font-variant-ligatures: none; }
.tabular { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-display); }
.serif-italic { font-family: var(--font-display); font-style: italic; }

/* focus */
*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   App shell
   ============================================================ */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper-alt);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 52px;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.topbar__brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink-1);
  font-size: 16px;
}
.topbar__brand .mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  position: relative;
  top: 2px;
  letter-spacing: -0.04em;
}
.topbar__brand .mark::after {
  content: "·";
  margin-left: 4px;
  color: var(--ink-4);
  font-style: normal;
  font-family: var(--font-sans);
}

.topbar__brand-mono {
  /* unused now — kept for boot splash compat */
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: var(--ink-1);
  color: var(--paper);
  border-radius: 5px;
  font-weight: 600;
  font-size: 13px;
}

.topbar__divider {
  width: 1px; height: 22px;
  background: var(--rule-strong);
}

.tenant-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  color: var(--ink-1);
  font-weight: 500;
  white-space: nowrap;
}
.tenant-switcher:hover { background: var(--paper-alt); }
.tenant-switcher .tag {
  font-size: 9.5px;
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  background: var(--paper-shadow);
  color: var(--ink-2);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.topbar__spacer { flex: 1; }

.topbar__cmdk {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px 6px 10px;
  border: 1px solid var(--rule);
  background: var(--paper-alt);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--ink-3);
  width: 280px;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
}
.topbar__cmdk > span:first-of-type { overflow: hidden; text-overflow: ellipsis; }
.topbar__cmdk kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink-3);
}
.topbar__cmdk:hover { border-color: var(--rule-strong); color: var(--ink-2); }
.topbar__cmdk kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink-3);
}

.topbar__icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--ink-3);
  position: relative;
}
.topbar__icon:hover { background: var(--paper-alt); color: var(--ink-2); }
.topbar__icon .dot {
  position: absolute; top: 8px; right: 8px;
  width: 5px; height: 5px;
  background: var(--partial);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--paper);
}

.topbar__user {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 4px 8px 4px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--ink-1);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.topbar__user:hover { background: var(--paper-alt); }
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--paper-alt);
  color: var(--ink-1);
  display: grid; place-items: center;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
  border: 1px solid var(--rule-strong);
  font-family: var(--font-mono);
}

/* shell layout */
.shell {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 0;
}

.sidebar {
  background: var(--paper);
  border-right: 1px solid var(--rule);
  padding: var(--space-5) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--rule);
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 0 12px var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
  position: relative;
  white-space: nowrap;
}
.nav-item:hover { background: var(--paper-alt); }
.nav-item--active {
  background: var(--paper-alt);
  color: var(--ink-1);
  font-weight: 600;
}
.nav-item--active::before {
  content: "";
  position: absolute;
  left: -3px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--ink-1);
  border-radius: 2px;
}
.nav-item__count {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-4);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
.nav-item--active .nav-item__count { color: var(--ink-2); }

.nav-spacer { flex: 1; }

/* main */
.main {
  min-width: 0;
  padding: var(--space-7) var(--space-8);
  max-width: 1280px;
  width: 100%;
}

.page-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: flex-end;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.page-header__inner { flex: 1; min-width: 0; }
.page-header__eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.page-header h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink-1);
}
.page-header__sub {
  font-size: 14px;
  color: var(--ink-3);
  margin: 0;
  max-width: 60ch;
}

.page-actions { display: flex; gap: var(--space-2); align-items: center; }

/* ============================================================
   Atoms
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--btn-h);
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-1);
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; }
.btn:active:not(:disabled) { transform: scale(0.98); }

.btn--primary {
  background: var(--ink-1);
  color: var(--paper);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.btn--primary:hover:not(:disabled) { background: var(--ink-2); }

.btn--secondary {
  background: var(--paper);
  border-color: var(--rule-strong);
  color: var(--ink-1);
}
.btn--secondary:hover:not(:disabled) { background: var(--paper-alt); border-color: var(--ink-4); }

.btn--ghost { color: var(--ink-2); }
.btn--ghost:hover:not(:disabled) { background: var(--paper-alt); }

.btn--destructive { background: var(--contra); color: white; }
.btn--destructive:hover:not(:disabled) { background: #a11919; }

.btn--success { background: var(--brand-accent); color: white; }

.btn--link { color: var(--link); padding: 0; height: auto; }
.btn--link:hover { text-decoration: underline; }

.btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn--lg { height: 44px; padding: 0 20px; font-size: 14px; }

.btn__icon { display: inline-flex; }

/* badge / verdict */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge--verified { background: var(--verified-soft); color: var(--verified); }
.badge--partial { background: var(--partial-soft); color: var(--partial); }
.badge--unverif { background: var(--unverif-soft); color: var(--unverif); }
.badge--contra { background: var(--contra-soft); color: var(--contra); }
.badge--info { background: var(--paper-shadow); color: var(--ink-2); }
.badge--neutral { background: var(--paper-shadow); color: var(--ink-3); }
.badge--sealed { background: var(--brand-accent-soft); color: var(--brand-accent); }
.badge--pending { background: var(--paper-shadow); color: var(--ink-2); }
.badge--lg { height: 26px; font-size: 12px; padding: 0 10px; }

.badge svg { width: 12px; height: 12px; }

/* hash chip */
.hash-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-1);
  line-height: 1.4;
}
.hash-chip button {
  background: transparent;
  border: none;
  display: inline-flex;
  padding: 0;
  color: var(--ink-3);
}
.hash-chip button:hover { color: var(--ink-1); }
.hash-chip--boxed { background: var(--paper); }

[data-hash-style="bare"] .hash-chip {
  background: transparent;
  border: none;
  padding: 0;
}

/* card */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card--padded { padding: var(--pad-card); }
.card__header {
  padding: var(--space-3) var(--pad-card);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  background: var(--paper-alt);
}
.card__header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-1);
  letter-spacing: -0.005em;
  white-space: nowrap;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  color: var(--ink-2);
}
.card__header .meta { font-size: 12px; color: var(--ink-3); }
.card__body { padding: var(--pad-card); }
.card__footer {
  padding: var(--space-3) var(--pad-card);
  border-top: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px;
}

/* input */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex; align-items: center; gap: 6px;
}
.field__hint { font-size: 11.5px; color: var(--ink-3); }
.field__error { font-size: 11.5px; color: var(--contra); }
.field__req { color: var(--contra); }

.input, .select, .textarea {
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--rule);
  background: var(--paper);
  font-size: 13.5px;
  color: var(--ink-1);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
  width: 100%;
}
.input:hover, .select:hover { border-color: var(--rule-strong); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--focus-ring);
  box-shadow: var(--shadow-focus);
}
.input::placeholder { color: var(--ink-4); }
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }

.radio-row {
  display: flex; gap: var(--space-2);
  flex-wrap: wrap;
}
.radio-card {
  flex: 1;
  min-width: 160px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--paper);
  display: flex; flex-direction: column; gap: 4px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--motion-fast), background var(--motion-fast);
}
.radio-card:hover { border-color: var(--rule-strong); }
.radio-card--selected {
  border-color: var(--ink-1);
  background: var(--paper-alt);
  box-shadow: inset 0 0 0 1px var(--ink-1);
}
.radio-card__title { font-size: 13.5px; font-weight: 600; color: var(--ink-1); }
.radio-card__sub { font-size: 11.5px; color: var(--ink-3); }

/* toast */
.toast-stack {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 1200;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 280px; max-width: 380px;
  font-size: 13px;
  animation: toast-in var(--motion-base) var(--ease-out);
}
.toast--success { border-color: var(--verified-soft); }
.toast--success .toast__icon { color: var(--verified); }
.toast--warn { border-color: var(--partial-soft); }
.toast--warn .toast__icon { color: var(--partial); }
.toast--error { border-color: var(--contra-soft); }
.toast--error .toast__icon { color: var(--contra); }
.toast__icon { display: inline-flex; padding-top: 1px; }
.toast__body { flex: 1; }
.toast__title { font-weight: 600; color: var(--ink-1); }
.toast__sub { color: var(--ink-3); margin-top: 2px; font-size: 12px; }
.toast__close { background: none; border: none; color: var(--ink-4); }

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* skeleton */
.skeleton {
  background: var(--paper-shadow);
  border-radius: var(--radius-sm);
  animation: skeleton-pulse var(--motion-slow) ease-in-out infinite;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; opacity: 0.8; }
}

/* divider */
.hr { height: 1px; background: var(--rule); border: none; margin: var(--space-4) 0; }

/* keyboard hint */
kbd.kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--ink-2);
}

/* tabs */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--space-5);
}
.tab {
  padding: 10px 14px;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink-2); }
.tab--active {
  color: var(--ink-1);
  border-bottom-color: var(--ink-1);
  font-weight: 600;
}

/* drawer */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(11, 18, 32, 0.4);
  z-index: 500;
  animation: fade-in var(--motion-base) var(--ease-out);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 480px; max-width: 100vw;
  background: var(--paper);
  border-left: 1px solid var(--rule);
  z-index: 501;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: drawer-in var(--motion-base) var(--ease-out);
}
.drawer--wide { width: 640px; }
.drawer__header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: var(--space-3);
}
.drawer__header h2 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--space-6); }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11, 18, 32, 0.5);
  z-index: 900;
  display: grid; place-items: center;
  padding: 24px;
  animation: fade-in var(--motion-base) var(--ease-out);
}
.modal {
  background: var(--paper);
  border-radius: var(--radius-xl);
  width: 480px;
  max-width: 100%;
  max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modal-in var(--motion-base) var(--ease-out);
}
.modal--wide { width: 640px; }
@keyframes modal-in { from { transform: scale(0.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal__header { padding: var(--space-5) var(--space-6) 0; }
.modal__header h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.modal__sub { color: var(--ink-3); font-size: 13px; }
.modal__body { padding: var(--space-5) var(--space-6); overflow-y: auto; flex: 1; }
.modal__footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--rule);
  display: flex; justify-content: flex-end; gap: var(--space-3);
}

/* progress bar */
.progress {
  height: 6px;
  background: var(--paper-shadow);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--ink-1);
  border-radius: inherit;
  transition: width var(--motion-base) var(--ease-out);
}
.progress__bar--accent { background: var(--brand-accent); }

/* table */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px var(--space-4);
  border-bottom: 1px solid var(--rule);
  background: var(--paper-alt);
}
.table tbody tr { transition: background var(--motion-fast); }
.table tbody tr:hover { background: var(--paper-alt); }
.table td {
  padding: 12px var(--space-4);
  border-bottom: 1px solid var(--rule);
  height: var(--row-h);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr.clickable { cursor: pointer; }

/* search input in toolbar */
.search-input {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 36px;
  flex: 1;
  min-width: 240px;
}
.search-input input {
  border: none; background: transparent; outline: none;
  flex: 1; font-size: 13px; color: var(--ink-1);
}
.search-input svg { color: var(--ink-4); }

/* segmented */
.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--paper-shadow);
  border-radius: var(--radius-md);
  gap: 2px;
}
.segmented button {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--ink-3);
}
.segmented button.active {
  background: var(--paper);
  color: var(--ink-1);
  box-shadow: var(--shadow-sm);
}

/* utility */
.row { display: flex; align-items: center; gap: var(--space-3); }
.col { display: flex; flex-direction: column; gap: var(--space-3); }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-4); }
.text-xs { font-size: 11.5px; }
.text-sm { font-size: 12.5px; }
.text-md { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 28px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.right { margin-left: auto; }
.spacer { flex: 1; }
.center { display: grid; place-items: center; }
.no-wrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   LAYOUT — sidebar restored alongside topbar (editorial style kept)
   ============================================================ */

.shell {
  flex: 1;
  display: grid !important;
  grid-template-columns: 220px minmax(0, 1fr) !important;
  min-height: 0;
}

.sidebar {
  display: flex !important;
  flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  padding: 0;
  gap: 0;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow: hidden;
}

.sidebar__top {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.sidebar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit; cursor: pointer;
  text-align: left; width: 100%;
}
.sidebar__user:hover { background: var(--paper-alt); }
.sidebar__user-body { flex: 1; min-width: 0; }
.sidebar__user-body .fw-600 { color: var(--ink-1); }

.sidebar__cmdk-mini {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  font-family: inherit; cursor: pointer;
  font-size: 12px; color: var(--ink-3);
}
.sidebar__cmdk-mini:hover { border-color: var(--rule-strong); color: var(--ink-1); }

.sidebar__scroll {
  flex: 1; overflow-y: auto;
  padding: 10px 10px 14px;
  display: flex; flex-direction: column; gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}
.sidebar__scroll::-webkit-scrollbar { width: 6px; }
.sidebar__scroll::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 3px; }

.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group + .nav-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.nav-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 2px 10px 8px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.nav-label__hint {
  font-size: 9px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: none;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  color: var(--ink-2);
  font-size: 13px; font-weight: 500;
  background: transparent; border: none;
  text-align: left; width: 100%;
  position: relative; cursor: pointer;
  font-family: inherit;
}
.nav-item:hover { background: var(--paper-alt); color: var(--ink-1); }
.nav-item--active {
  background: var(--paper-alt);
  color: var(--ink-1);
  font-weight: 600;
}
.nav-item--active::before {
  content: "";
  position: absolute;
  left: -3px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--ink-1);
  border-radius: 2px;
}
.nav-item__icon {
  display: inline-flex;
  color: var(--ink-3);
}
.nav-item--active .nav-item__icon { color: var(--ink-1); }
.nav-item__label { flex: 1; min-width: 0; }
.nav-item__count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  font-weight: 500;
}
.nav-item--active .nav-item__count { color: var(--ink-2); }
.nav-item__kbd {
  font-size: 9.5px;
  padding: 1px 4px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}
.nav-item--active .nav-item__kbd { background: var(--paper); }

.nav-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}
.nav-pill--sealed { background: var(--verified-soft); color: var(--verified); }
.nav-pill--partial { background: var(--partial-soft); color: var(--partial); }
.nav-pill--contra  { background: var(--contra-soft); color: var(--contra); }

.nav-item--pinned {
  padding: 8px 10px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
}
.nav-item--pinned:hover { background: var(--paper); }

.sidebar__bottom {
  padding: 10px 10px 12px;
  border-top: 1px solid var(--rule);
  background: var(--paper-alt);
  display: flex; flex-direction: column; gap: 8px;
  max-height: 50vh; overflow-y: auto;
  scrollbar-width: thin;
}

/* Status card */
.status-card, .bulletin-card, .plan-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 11.5px;
}
.status-card__head, .bulletin-card__head, .plan-card__head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.status-card__title, .bulletin-card__title, .plan-card__name {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  flex: 1;
}
.status-card__rows {
  display: flex; flex-direction: column; gap: 4px;
}
.status-row {
  display: flex; justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--ink-1);
}
.status-row .muted { color: var(--ink-3); font-size: 11px; }

.status-pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  position: relative;
}
.status-pulse--ok {
  background: var(--verified);
  box-shadow: 0 0 0 0 rgba(47, 110, 71, 0.4);
  animation: status-pulse 2s var(--ease-out) infinite;
}
@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 110, 71, 0.45); }
  60% { box-shadow: 0 0 0 5px rgba(47, 110, 71, 0); }
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  vertical-align: 1px;
}
.status-dot--ok { background: var(--verified); }
.status-dot--warn { background: var(--partial); }
.status-dot--err { background: var(--contra); }

.bulletin-card__date {
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0;
}
.bulletin-card__link {
  background: transparent; border: none;
  color: var(--ink-3); padding: 2px; cursor: pointer;
  display: inline-flex;
}
.bulletin-card__link:hover { color: var(--ink-1); }

.plan-card__pct {
  font-size: 10.5px;
  color: var(--ink-1);
  font-weight: 600;
  letter-spacing: 0;
}
.plan-card__bar {
  height: 3px;
  background: var(--paper-shadow);
  border-radius: 2px;
  overflow: hidden;
}
.plan-card__fill {
  height: 100%;
  background: var(--ink-1);
}
.plan-card__cta {
  display: block; width: 100%;
  margin-top: 8px; padding: 4px 0;
  background: transparent; border: none;
  color: var(--ink-1); font-weight: 500;
  text-align: left; cursor: pointer;
  font-size: 11.5px;
}
.plan-card__cta:hover { color: var(--link-hover); }

.sidebar__foot {
  display: flex; gap: 6px;
  margin-top: 4px;
}
.sidebar__foot-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 8px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  color: var(--ink-2);
  font-size: 11.5px;
  font-family: inherit; cursor: pointer;
}
.sidebar__foot-btn:hover {
  background: var(--paper);
  color: var(--ink-1);
}

/* Slightly wider sidebar to fit the new content */
.shell {
  flex: 1;
  display: grid !important;
  grid-template-columns: 248px minmax(0, 1fr) !important;
  min-height: 0;
}
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: 52px;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.topbar__row1, .topbar__row2 { display: contents; }

/* Wider main canvas, content-led */
.main {
  min-width: 0;
  padding: var(--space-8) var(--space-7) var(--space-9);
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  display: block;
}

/* Brand mark */
.topbar__brand {
  display: flex; align-items: baseline; gap: 6px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--ink-1);
  line-height: 1;
  text-decoration: none;
  cursor: default;
}
.topbar__brand::after {
  content: "";
  width: 4px; height: 4px;
  background: var(--ink-1);
  border-radius: 50%;
  align-self: center;
}

/* Sidebar nav items — editorial, quiet */
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.sidebar-footer {
  margin-top: var(--space-5);
  padding: var(--space-3);
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  font-size: 11.5px;
}
.sidebar-footer__title {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.sidebar-footer__sub {
  color: var(--ink-2);
  line-height: 1.5;
  font-size: 11px;
}

.topnav-tab { display: none; }
.topbar__brand-mono { display: none !important; }
