/* Mental dashboard — read-only, zero-dependency. Tokens first, then shell, then views. */

/* ─── Tokens ─────────────────────────────────────────────────────────────── */

/*
 * Each colour is written once as light-dark(light, dark). `color-scheme` picks the side:
 * the OS preference by default, or the explicit data-theme the toggle sets.
 */
:root {
  color-scheme: light dark;
  --font-sans: "Inter var", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: light-dark(#fafafa, #09090b);
  --bg-canvas: light-dark(#f4f4f5, #0c0c0f);
  --bg-surface: light-dark(#ffffff, #111114);
  --bg-elevated: light-dark(#ffffff, #18181c);
  --bg-sunken: light-dark(#f4f4f5, #0b0b0d);
  --bg-hover: light-dark(rgba(24, 24, 27, 0.045), rgba(255, 255, 255, 0.045));
  --bg-active: light-dark(rgba(24, 24, 27, 0.08), rgba(255, 255, 255, 0.08));
  --border-default: light-dark(#e4e4e7, #232329);
  --border-subtle: light-dark(#ececef, #1b1b20);
  --border-strong: light-dark(#d4d4d8, #2e2e36);
  --border-focus: light-dark(#5eead4, #14b8a6);
  --ink-primary: light-dark(#18181b, #ededf0);
  --ink-secondary: light-dark(#52525b, #a1a1aa);
  --ink-muted: light-dark(#8b8b94, #6e6e78);
  --text: var(--ink-primary);
  --muted: var(--ink-muted);

  --accent: light-dark(#0d9488, #2dd4bf);
  --accent-ink: light-dark(#0f766e, #5eead4);
  --accent-soft: light-dark(rgba(13, 148, 136, 0.1), rgba(45, 212, 191, 0.14));
  --accent-ring: light-dark(rgba(13, 148, 136, 0.35), rgba(45, 212, 191, 0.45));
  --on-accent: light-dark(#ffffff, #042f2e);
  --accent-grad: linear-gradient(180deg, light-dark(#14b8a6, #5eead4), light-dark(#0d9488, #2dd4bf));
  --accent-grad-hover: linear-gradient(180deg, light-dark(#2dd4bf, #99f6e4), light-dark(#0f9e90, #5eead4));

  --k-decision: light-dark(#0284c7, #38bdf8);
  --k-attention: light-dark(#d97706, #f59e0b);
  --k-note: light-dark(#059669, #10b981);
  --k-journal: light-dark(#db2777, #f472b6);
  --c-rose: light-dark(#e11d48, #fb7185);
  --c-amber: light-dark(#d97706, #f59e0b);
  --c-sky: light-dark(#0284c7, #38bdf8);
  --c-green: light-dark(#059669, #34d399);
  --c-teal: light-dark(#0d9488, #2dd4bf);
  --c-zinc: light-dark(#71717a, #a1a1aa);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px light-dark(rgba(24, 24, 27, 0.06), rgba(0, 0, 0, 0.4));
  --shadow-md: 0 4px 12px -2px light-dark(rgba(24, 24, 27, 0.1), rgba(0, 0, 0, 0.55)),
    0 2px 4px -2px light-dark(rgba(24, 24, 27, 0.06), rgba(0, 0, 0, 0.4));
  --shadow-xl: 0 24px 64px -12px light-dark(rgba(24, 24, 27, 0.28), rgba(0, 0, 0, 0.7)),
    0 8px 20px -8px light-dark(rgba(24, 24, 27, 0.12), rgba(0, 0, 0, 0.5));
  --transition-fast: 140ms cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --rail-w: 56px;
  --rail-w-open: 212px;
  --top-h: 52px;
  --insp-w: 440px;

  /* The hero follows the theme like every other surface; the toast stays dark so it pops. */
  --hero-bg: var(--bg-surface);
  --hero-ink: var(--ink-primary);
  --hero-ink-2: var(--ink-secondary);
  --hero-ink-3: var(--ink-muted);
  --hero-line: var(--border-default);
  --hero-accent: var(--accent-ink);
  --hero-sha: var(--accent);
  --hero-ok: light-dark(#059669, #34d399);
  --hero-warn: light-dark(#b45309, #f59e0b);
  --hero-bad: light-dark(#e11d48, #fb7185);
  --hero-idle: light-dark(#71717a, #a1a1aa);
  --hero-title-grad: linear-gradient(180deg, var(--ink-primary) 30%, light-dark(#115e59, #99f6e4));
  --hero-dots: light-dark(rgba(24, 24, 27, 0.06), rgba(255, 255, 255, 0.07));
  --toast-bg: #18181b;
  --toast-ink: #fafafa;
}

:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}

/* ─── Base ───────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body:not(.ready) .app {
  opacity: 0;
}
.app {
  transition: opacity 200ms ease;
}
h1,
h2,
h3,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}
ol,
ul {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  text-align: inherit;
}
[hidden] {
  display: none !important;
}
::selection {
  background: var(--accent-soft);
  color: var(--ink-primary);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--border-strong);
}
::-webkit-scrollbar-track {
  background: transparent;
}

.num,
.mono,
time,
.card-age,
.lane-count,
.seg-count {
  font-variant-numeric: tabular-nums;
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
.muted {
  color: var(--ink-muted);
}
.small {
  font-size: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.icon {
  flex: none;
  display: block;
}
.mark {
  font-size: 0.95em;
  line-height: 1;
  flex: none;
}
.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transition: top var(--transition-fast);
}
.skip:focus {
  top: 12px;
}

/* ─── Primitives ─────────────────────────────────────────────────────────── */

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  border: 1px solid var(--border-default);
  border-bottom-width: 2px;
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}
.kbd + .kbd {
  margin-left: 3px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  max-width: 100%;
}
.chip-kind {
  --k: var(--accent);
  color: var(--k);
  border-color: color-mix(in srgb, var(--k) 28%, transparent);
  background: color-mix(in srgb, var(--k) 9%, transparent);
}
.kind-decision {
  --k: var(--k-decision);
}
.kind-attention {
  --k: var(--k-attention);
}
.kind-note {
  --k: var(--k-note);
}
.kind-journal {
  --k: var(--k-journal);
}
.chip-status {
  --s: var(--c-zinc);
  color: var(--s);
  border-color: color-mix(in srgb, var(--s) 25%, transparent);
  background: color-mix(in srgb, var(--s) 8%, transparent);
  text-transform: lowercase;
}
.chip-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-open,
.status-deferred {
  --s: var(--c-amber);
}
.status-later {
  --s: var(--c-zinc);
}
.status-resolved,
.status-decided,
.status-done,
.status-stopped {
  --s: var(--c-green);
}
.status-superseded,
.status-discarded {
  --s: var(--c-zinc);
}
.status-running {
  --s: var(--c-teal);
}
.chip-tag {
  color: var(--ink-secondary);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
}
button.chip-tag {
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
button.chip-tag:hover {
  border-color: var(--border-strong);
  color: var(--ink-primary);
}
button.chip-tag[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-ring);
  color: var(--accent-ink);
}
.chip-soft {
  border-color: transparent;
  background: var(--bg-active);
  color: var(--ink-secondary);
}
.chip-aging {
  border-color: transparent;
  background: color-mix(in srgb, var(--ink-muted) 14%, transparent);
  color: var(--ink-muted);
}
.chip-outcome {
  border-color: var(--hero-line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--hero-ink-2);
  text-transform: lowercase;
}
.chip-outcome::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--o, var(--hero-idle));
  box-shadow: 0 0 8px var(--o, transparent);
}
.outcome-parked {
  --o: var(--hero-warn);
}
.outcome-done,
.outcome-shipped,
.outcome-complete {
  --o: var(--hero-ok);
}
.outcome-blocked {
  --o: var(--hero-bad);
}
.outcome-inprogress,
.outcome-continuing {
  --o: var(--hero-sha);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform 80ms ease, box-shadow var(--transition-fast);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--accent-grad);
  color: var(--on-accent);
  box-shadow: 0 0 0 1px light-dark(rgba(13, 148, 136, 0.6), rgba(45, 212, 191, 0.6)), 0 6px 20px -6px light-dark(rgba(13, 148, 136, 0.55), rgba(45, 212, 191, 0.5)), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover {
  background: var(--accent-grad-hover);
}
.btn-ghost {
  border: 1px solid var(--border-default);
  color: var(--ink-primary);
  background: var(--bg-surface);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--accent-ink);
  border-radius: 4px;
}
.link-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
}
.icon-btn[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--ink-muted);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.field:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-primary);
  font-size: 13px;
}
.field-input::placeholder {
  color: var(--ink-muted);
}
.field-input::-webkit-search-cancel-button {
  filter: grayscale(1);
  opacity: 0.6;
}

.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}
.seg-btn:hover {
  color: var(--ink-primary);
}
.seg-btn[aria-pressed="true"] {
  background: var(--bg-elevated);
  color: var(--ink-primary);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--border-default);
}
.seg-count {
  font-size: 11px;
  color: var(--ink-muted);
}
.seg-btn[aria-pressed="true"] .seg-count {
  color: var(--accent-ink);
}

.select {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.select select {
  appearance: none;
  height: 34px;
  padding: 0 30px 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 13px;
  cursor: pointer;
}
.select::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink-muted);
  border-bottom: 1.5px solid var(--ink-muted);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-secondary);
  cursor: pointer;
  user-select: none;
}
.toggle input {
  appearance: none;
  position: relative;
  width: 30px;
  height: 18px;
  margin: 0;
  border-radius: 999px;
  background: var(--border-strong);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.toggle input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--on-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 160ms var(--ease-out);
}
.toggle input:checked {
  background: var(--accent);
}
.toggle input:checked::after {
  transform: translateX(12px);
}

.skeleton-stack {
  display: grid;
  gap: 12px;
  padding: 8px 0;
}
.skeleton {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-hover) 0%, var(--bg-active) 50%, var(--bg-hover) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton:nth-child(3n + 1) {
  height: 44px;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  background: radial-gradient(60% 80% at 50% 0%, var(--accent-soft), transparent 70%);
}
.empty-icon {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 4px;
  filter: saturate(0.9);
}
.empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
}
.empty-body {
  max-width: 40ch;
  color: var(--ink-secondary);
  font-size: 13px;
}
.empty-cmd {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-sunken);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.copyable {
  cursor: copy;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 300;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: var(--toast-bg);
  color: var(--toast-ink);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-xl);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px) scale(0.98);
  transition: opacity 160ms ease, transform 200ms var(--ease-out);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* ─── Shell: rail ────────────────────────────────────────────────────────── */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--rail-w);
  padding: 10px 8px;
  gap: 6px;
  border-right: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg) 85%, var(--bg-canvas));
  transition: width 200ms var(--ease-out);
  overflow: hidden;
}
body.rail-open .rail {
  width: var(--rail-w-open);
}
.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 9px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  font-weight: 650;
  letter-spacing: -0.01em;
}
.rail-brand img {
  flex: none;
  border-radius: 6px;
}
.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.rail-link:hover {
  color: var(--ink-primary);
  background: var(--bg-hover);
}
.rail-link.active {
  color: var(--ink-primary);
  background: var(--bg-active);
}
.rail-link.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.rail-label {
  opacity: 0;
  transition: opacity 120ms ease;
}
body.rail-open .rail-label {
  opacity: 1;
}
.rail-link .badge {
  position: absolute;
  top: 3px;
  left: 22px;
  min-width: 16px;
  height: 16px;
  font-size: 9.5px;
  box-shadow: 0 0 0 2px var(--bg);
}
body.rail-open .rail-link .badge {
  position: static;
  margin-left: auto;
  box-shadow: none;
}
.nav-dot {
  position: absolute;
  top: 8px;
  left: 27px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-amber);
  box-shadow: 0 0 0 2px var(--bg), 0 0 10px var(--c-amber);
}
body.rail-open .nav-dot {
  position: static;
  margin-left: auto;
  box-shadow: 0 0 10px var(--c-amber);
}
.rail-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.rail-open .rail-foot {
  flex-direction: row;
  justify-content: space-between;
}
.rail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--ink-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.rail-btn:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
}
#rail-expand .icon {
  transition: transform 200ms var(--ease-out);
}
body.rail-open #rail-expand .icon {
  transform: rotate(180deg);
}

/* ─── Shell: main column + topbar ────────────────────────────────────────── */

.main-col {
  min-width: 0;
  margin-left: var(--rail-w);
  transition: margin 200ms var(--ease-out);
}
body.rail-open .main-col {
  margin-left: var(--rail-w-open);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--top-h);
  padding: 0 16px 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.topbar-spacer {
  flex: 1;
}
.project-switch {
  position: relative;
}
.project-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  max-width: 280px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13.5px;
  transition: background var(--transition-fast);
}
.project-btn:hover,
.project-btn[aria-expanded="true"] {
  background: var(--bg-hover);
}
.project-dot {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: conic-gradient(from 210deg, var(--accent), var(--k-decision), var(--k-note), var(--k-attention), var(--accent));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.project-btn .project-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-caret {
  color: var(--ink-muted);
  font-size: 10px;
}
.project-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  width: min(340px, calc(100vw - 16px));
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-xl);
  animation: pop-in 160ms var(--ease-out);
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}
.project-pop input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  margin-bottom: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-sunken);
  outline: none;
  font-size: 13px;
}
.project-pop input:focus {
  border-color: var(--border-focus);
}
#project-options {
  max-height: 340px;
  overflow: auto;
}
#project-options li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
}
#project-options li.hot,
#project-options li:hover {
  background: var(--bg-hover);
}
#project-options li[aria-selected="true"] .opt-name {
  color: var(--accent-ink);
}
.opt-name {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opt-tag {
  font-size: 11px;
  color: var(--ink-muted);
  align-self: center;
}
.opt-meta {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opt-empty {
  padding: 14px;
  color: var(--ink-muted);
  font-size: 13px;
  cursor: default !important;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
}
.crumbs::before {
  content: "/";
  color: var(--border-strong);
}
.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  color: var(--ink-muted);
  font-size: 11.5px;
  font-weight: 550;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-green) 20%, transparent);
}
.live.is-clock {
  color: var(--accent-ink);
  border-color: var(--accent-ring);
  background: var(--accent-soft);
}
.live.is-clock .live-dot {
  background: var(--accent);
  animation: breathe 2.2s ease-in-out infinite;
}
.live.pulse .live-dot {
  animation: ping 900ms var(--ease-out);
}
@keyframes breathe {
  50% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 12%, transparent);
  }
}
@keyframes ping {
  from {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-green) 60%, transparent);
  }
  to {
    box-shadow: 0 0 0 9px transparent;
  }
}
.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 260px;
  height: 32px;
  padding: 0 6px 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--ink-muted);
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.search-trigger:hover {
  border-color: var(--border-strong);
  color: var(--ink-secondary);
}
.search-trigger-icon {
  display: flex;
}
.search-trigger-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Views ──────────────────────────────────────────────────────────────── */

.views {
  outline: none;
  transition: padding-right 220ms var(--ease-out);
}
.view {
  padding: 28px 32px 72px;
  animation: view-in 260ms var(--ease-out);
}
.view.is-loading {
  cursor: progress;
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
.page {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.page-wide {
  max-width: 1480px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.page-sub {
  margin-top: 4px;
  color: var(--ink-secondary);
  font-size: 13.5px;
}
.page-stat {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-secondary);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-active);
  font-variant-numeric: tabular-nums;
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 640;
  letter-spacing: -0.01em;
}
.section-sub {
  color: var(--ink-muted);
  font-size: 12.5px;
}
.section-head .link-btn {
  margin-left: auto;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), transform 160ms var(--ease-out), box-shadow var(--transition-fast), background var(--transition-fast);
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.card:active {
  transform: translateY(0);
}
.card.is-aging {
  border-left: 2px solid color-mix(in srgb, var(--ink-muted) 45%, transparent);
}
.aging {
  margin-top: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--ink-muted) 25%, transparent);
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
}
.aging-head {
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}
.aging-actions {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.aging-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.aging-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.3rem 0;
}
.aging-title {
  flex: 1;
  text-align: left;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
}
.card.is-done {
  opacity: 0.7;
}
.card.is-done .card-title {
  text-decoration: line-through;
  text-decoration-color: var(--ink-muted);
}
.card-title {
  font-size: 13.5px;
  font-weight: 560;
  line-height: 1.38;
  color: var(--ink-primary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc,
.card-against {
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-against::before {
  content: "↳ ";
  color: var(--ink-muted);
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.card-from {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-spacer {
  flex: 1;
}
.card-age {
  flex: none;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* ─── Today ──────────────────────────────────────────────────────────────── */

.today {
  gap: 28px;
}
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 28px 32px 24px;
  border-radius: var(--radius-xl);
  background: var(--hero-bg);
  color: var(--hero-ink);
  border: 1px solid light-dark(rgba(13, 148, 136, 0.28), rgba(45, 212, 191, 0.22));
  box-shadow: 0 30px 80px -40px light-dark(rgba(13, 148, 136, 0.3), rgba(45, 212, 191, 0.35));
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(var(--hero-dots) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 75%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 75%);
}
.hero-glow {
  position: absolute;
  z-index: -1;
  top: -55%;
  right: -12%;
  width: 70%;
  height: 160%;
  background: radial-gradient(closest-side, light-dark(rgba(45, 212, 191, 0.22), rgba(45, 212, 191, 0.3)), rgba(56, 189, 248, 0.1) 55%, transparent 75%);
  filter: blur(10px);
  animation: drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  to {
    transform: translate(-6%, 8%) scale(1.08);
  }
}
.hero .eyebrow {
  color: var(--hero-accent);
}
.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.hero .chip-soft {
  background: var(--bg-hover);
  color: var(--hero-ink-2);
}
.hero-resume {
  margin-top: 14px;
  max-width: 62ch;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 620;
  line-height: 1.22;
  letter-spacing: -0.028em;
  text-wrap: balance;
  background: var(--hero-title-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin-top: 8px;
  color: var(--hero-ink-2);
}
.hero-against {
  margin-top: 10px;
  max-width: 70ch;
  color: var(--hero-ink-2);
  font-size: 13.5px;
}
.hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--hero-line);
}
.git-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1 1 360px;
}
.git-branch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hero-ink);
  font-size: 12.5px;
}
.git-branch .icon {
  color: var(--hero-ink-3);
}
.dirty-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hero-ok);
}
.dirty-dot.is-dirty {
  background: var(--hero-warn);
  box-shadow: 0 0 10px var(--hero-warn);
}
.git-commits {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.git-commits li {
  display: flex;
  gap: 10px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--hero-ink-2);
}
.sha {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--hero-sha);
}
.commit-msg {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-actions {
  display: flex;
  gap: 8px;
}
.hero .btn-ghost {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--hero-ink);
}
.hero .btn-ghost:hover {
  background: var(--bg-active);
}
.hero-empty {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  color: var(--hero-ink-2);
}
.hero-empty .empty-cmd,
.hero .empty-cmd {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--hero-ink-2);
}

.delta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: -12px;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 13px;
  color: var(--ink-secondary);
}
.delta-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink-primary);
}
.delta-items {
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
}
.delta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.delta-item .num {
  font-weight: 650;
  color: var(--ink-primary);
}
.delta-item::before {
  content: "";
  align-self: center;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--d, var(--c-zinc));
}
.delta-writes {
  --d: var(--c-teal);
}
.delta-attention {
  --d: var(--c-amber);
}
.delta-decisions {
  --d: var(--c-sky);
}
.delta-parks {
  --d: var(--c-green);
}
.delta-quiet {
  color: var(--ink-muted);
}
.delta-hops {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-muted);
}

.lanes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.lane,
.column {
  --lane: var(--c-zinc);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  position: relative;
}
.lane::before,
.column::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto;
  height: 2px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, var(--lane), transparent 80%);
  opacity: 0.8;
}
.lane-eyes,
.col-verify {
  --lane: var(--c-amber);
}
.lane-air,
.col-concern {
  --lane: var(--c-rose);
}
.lane-unsettled,
.col-question {
  --lane: var(--c-sky);
}
.lane-later,
.col-other {
  --lane: var(--c-zinc);
}
.col-thread {
  --lane: var(--c-teal);
}
.lane-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 2px 4px;
}
.lane-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--lane);
  box-shadow: 0 0 10px color-mix(in srgb, var(--lane) 60%, transparent);
}
.lane-title {
  font-size: 13px;
  font-weight: 640;
}
.lane-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}
.lane-hint {
  flex-basis: 100%;
  padding-left: 16px;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.lane-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lane-empty {
  padding: 18px 8px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-muted);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
}
.lane-more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  align-self: flex-start;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-secondary);
}
.lane-more:hover {
  color: var(--accent-ink);
  background: var(--bg-hover);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 340px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  font-size: 12.5px;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.pill:hover {
  color: var(--ink-primary);
  border-color: color-mix(in srgb, var(--k-decision) 50%, var(--border-default));
  background: color-mix(in srgb, var(--k-decision) 6%, var(--bg-surface));
}
.pill-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill-more {
  border-style: dashed;
  color: var(--ink-muted);
}

/* Timeline (Today activity, Sit-down events) */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tl-day-label {
  position: sticky;
  top: calc(var(--top-h) + 4px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-secondary);
}
.tl-day-count {
  color: var(--ink-muted);
  font-weight: 500;
}
.tl-hops {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 22px;
}
.tl-hops::before,
.sit-events::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--border-strong), var(--border-subtle));
}
.tl-hop {
  --node: var(--accent);
  position: relative;
}
.hop-decision,
.hop-decide {
  --node: var(--k-decision);
}
.hop-attention {
  --node: var(--k-attention);
}
.hop-note {
  --node: var(--k-note);
}
.hop-journal,
.hop-handoff,
.hop-park {
  --node: var(--k-journal);
}
.tl-node {
  position: absolute;
  left: -20px;
  top: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--node, var(--accent));
}
.tl-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  text-align: left;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
button.tl-card:hover {
  background: var(--bg-surface);
  border-color: var(--border-default);
}
.tl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tl-time {
  flex: none;
  font-size: 11.5px;
  color: var(--ink-muted);
  width: 44px;
}
.tl-title {
  min-width: 0;
  font-weight: 560;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-via {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.tl-summary,
.tl-resume {
  padding-left: 52px;
  font-size: 12.5px;
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tl-resume::before {
  content: "Resume → ";
  color: var(--accent-ink);
  font-weight: 550;
}

/* ─── Boards (Attention, Decisions) ─────────────────────────────────────── */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar-search {
  flex: 1 1 220px;
  max-width: 340px;
  margin-left: auto;
}
.kind-tabs {
  margin-top: -10px;
}
.board {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.board[data-cols="1"] {
  --cols: 1;
  max-width: 560px;
}
.board[data-cols="2"] {
  --cols: 2;
}
.board[data-cols="3"] {
  --cols: 3;
}
.settled-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--c-green) 30%, var(--border-default));
  background: color-mix(in srgb, var(--c-green) 6%, var(--bg-surface));
  color: var(--ink-secondary);
  font-size: 13px;
}
.dtl {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.dtl-month-label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.dtl-items {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 8px;
}
.dtl-item {
  --node: var(--k-decision);
  position: relative;
}
.dtl-item .tl-node {
  display: none;
}
.dtl-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  height: 100%;
  padding: 11px 14px 11px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.dtl-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--k-decision);
  opacity: 0.7;
}
.dtl-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}
.dtl-title {
  font-weight: 560;
  font-size: 13.5px;
  line-height: 1.38;
}
.dtl-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.dtl-item.is-superseded .dtl-card {
  opacity: 0.6;
}
.dtl-item.is-superseded .dtl-card::before {
  background: var(--c-zinc);
}
.dtl-item.is-superseded .dtl-title {
  text-decoration: line-through;
  text-decoration-color: var(--ink-muted);
}

/* ─── Library ────────────────────────────────────────────────────────────── */

.lib {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.lib-facets {
  position: sticky;
  top: calc(var(--top-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: calc(100dvh - var(--top-h) - 40px);
  overflow: auto;
  padding-right: 4px;
}
.facet-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.facet-group .eyebrow {
  margin: 0 8px 6px;
}
.facet {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 520;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.facet:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
}
.facet[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--ink-primary);
}
.facet-label {
  flex: 1;
}
.facet-count {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 4px;
}
.tag-n {
  color: var(--ink-muted);
  font-size: 10px;
}
.facet-clear {
  align-self: flex-start;
  margin: 4px 8px 0;
  font-size: 12px;
  color: var(--accent-ink);
}
.lib-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.lib-search {
  height: 40px;
  font-size: 14px;
}
.lib-summary {
  font-size: 12.5px;
  color: var(--ink-muted);
}
.lib-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  outline: none;
}
.lib-group {
  display: flex;
  flex-direction: column;
}
.lib-group-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0 0 4px 10px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.lib-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 80ms ease;
}
.lib-row:hover {
  background: var(--bg-hover);
}
.lib-row[aria-selected="true"] {
  background: var(--bg-active);
  border-color: var(--border-default);
}
.lib-row.is-open {
  background: var(--accent-soft);
  border-color: var(--accent-ring);
}
.lib-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 14px;
}
.lib-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.lib-title {
  font-weight: 560;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lib-desc {
  font-size: 12.5px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lib-desc mark,
.palette-snippet mark,
.palette-label mark {
  background: color-mix(in srgb, var(--c-amber) 28%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}
.lib-meta {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lib-date {
  font-size: 11.5px;
  color: var(--ink-muted);
  min-width: 54px;
  text-align: right;
}
.lib-more {
  align-self: center;
}

/* ─── Map ────────────────────────────────────────────────────────────────── */

.view-map {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100dvh - var(--top-h));
  padding: 16px 20px 12px;
}
.view-map[hidden] {
  display: none;
}
.map-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.map-search {
  width: 240px;
}
.map-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.map-tag {
  --tag: var(--accent);
}
.tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tag);
}
.map-tag[aria-pressed="true"] {
  border-color: var(--tag);
  background: color-mix(in srgb, var(--tag) 14%, transparent);
  color: var(--ink-primary);
}
.view-map #map-wrap {
  flex: 1;
  height: auto;
  min-height: 360px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 1px 1px, var(--border-default) 1px, transparent 0) 0 0 / 24px 24px,
    var(--bg-canvas);
}
.map-help {
  font-size: 12px;
  color: var(--ink-muted);
}

/* ─── Projects ───────────────────────────────────────────────────────────── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), transform 160ms var(--ease-out), box-shadow var(--transition-fast);
}
.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.project-card.is-current {
  border-color: var(--accent-ring);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.project-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.project-avatar {
  --tag: var(--accent);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--tag) 18%, var(--bg-surface));
  color: var(--tag);
  font-weight: 700;
  font-size: 14px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tag) 30%, transparent);
}
.project-card .project-name {
  flex: 1;
  min-width: 0;
  font-weight: 640;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-resume {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.6em;
}
.project-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--ink-muted);
}
.project-outcome {
  display: block;
  line-height: 20px;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-stat {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.project-stat b {
  font-weight: 600;
  color: var(--ink-secondary);
}
.project-stat.is-hot b {
  color: var(--c-amber);
}

/* ─── Sit-downs ──────────────────────────────────────────────────────────── */

.sit {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.sit-list {
  position: sticky;
  top: calc(var(--top-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100dvh - var(--top-h) - 40px);
  overflow: auto;
}
.sit-day {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sit-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  grid-template-areas: "dot title wall" ". time time";
  gap: 2px 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background var(--transition-fast);
}
.sit-row:hover {
  background: var(--bg-hover);
}
.sit-row[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-ring);
}
.sit-dot {
  grid-area: dot;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-zinc);
}
.sit-dot.status-running {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.sit-dot.status-stopped {
  background: var(--c-green);
}
.sit-title {
  grid-area: title;
  font-weight: 560;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sit-time {
  grid-area: time;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.sit-wall {
  grid-area: wall;
  font-size: 12px;
  color: var(--ink-secondary);
}
.sit-detail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  min-height: 240px;
}
.sit-detail-title {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 640;
  letter-spacing: -0.02em;
}
.sit-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-secondary);
}
.sit-events {
  position: relative;
  gap: 4px;
  padding-left: 22px;
}

/* ─── Inspector ──────────────────────────────────────────────────────────── */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(9, 9, 11, 0.42);
  backdrop-filter: blur(2px);
  animation: fade-in 160ms ease;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
.inspector {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: min(var(--insp-w), 100vw);
  border-left: 1px solid var(--border-default);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-xl);
  transform: translateX(16px);
  opacity: 0;
  transition: transform 220ms var(--ease-out), opacity 160ms ease;
}
.inspector.show {
  transform: none;
  opacity: 1;
}

/* Card deck: ghost cards peek out behind the drawer, one per step back (max 2). */
.insp-deck {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 79;
  display: none;
  width: min(var(--insp-w), 100vw);
  pointer-events: none;
}
body.insp-open .insp-deck {
  display: block;
}
.insp-ghost {
  position: absolute;
  inset: 14px 0;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-right: 0;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: -6px 0 18px rgb(0 0 0 / 0.28);
  opacity: 0;
  cursor: pointer;
  transition: transform 280ms var(--ease-out), opacity 200ms ease, background-color 140ms ease;
}
.insp-ghost[data-n="2"] {
  inset: 28px 0;
  background: var(--bg-surface);
}
.insp-deck[data-depth="1"] .insp-ghost[data-n="1"],
.insp-deck[data-depth="2"] .insp-ghost[data-n="1"] {
  opacity: 1;
  transform: translateX(-12px);
  pointer-events: auto;
}
.insp-deck[data-depth="2"] .insp-ghost[data-n="2"] {
  opacity: 1;
  transform: translateX(-24px);
  pointer-events: auto;
}
.insp-deck[data-depth="1"] .insp-ghost[data-n="1"]:hover,
.insp-deck[data-depth="2"] .insp-ghost[data-n="1"]:hover {
  transform: translateX(-17px);
  background: var(--bg-hover);
}
.insp-deck[data-depth="2"] .insp-ghost[data-n="2"]:hover {
  transform: translateX(-30px);
}
body:has(.insp-deck:not([data-depth="0"])) .inspector {
  border-left-color: var(--border-strong);
}
@media (min-width: 1024px) {
  body.insp-pinned .scrim {
    display: none !important;
  }
  body.insp-pinned .inspector {
    top: var(--top-h);
    box-shadow: none;
    background: var(--bg-surface);
  }
  body.insp-pinned .insp-deck {
    top: var(--top-h);
  }
  body.insp-pinned .views {
    padding-right: var(--insp-w);
  }
}
.insp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--top-h);
  padding: 0 10px 0 18px;
  border-bottom: 1px solid var(--border-subtle);
  flex: none;
}
.insp-kind {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
.insp-date {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.insp-actions {
  display: flex;
  gap: 2px;
}
.insp-back {
  margin-left: -8px;
  color: var(--ink-secondary);
}
.insp-back:hover {
  color: var(--ink-primary);
}
.insp-trail {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 36px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 12px;
  color: var(--ink-muted);
  overflow: hidden;
  flex: none;
}
.insp-trail.open {
  flex-wrap: wrap;
  row-gap: 2px;
}
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 132px;
  padding: 3px 7px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-secondary);
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
  flex: 0 1 auto;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.crumb:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
}
.crumb:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}
.crumb-here {
  max-width: none;
  flex: 1 1 0;
  color: var(--ink-primary);
  font-weight: 560;
  cursor: default;
}
.crumb-here:hover {
  background: none;
}
.crumb-mark {
  flex: none;
  font-size: 11px;
}
.crumb-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb-more {
  flex: none;
  padding: 3px 6px;
  letter-spacing: 0.08em;
}
.crumb-sep {
  display: inline-flex;
  flex: none;
  opacity: 0.55;
}
.insp-scroll.enter-fwd {
  animation: insp-enter-fwd 240ms var(--ease-out);
}
.insp-scroll.enter-back {
  animation: insp-enter-back 240ms var(--ease-out);
}
@keyframes insp-enter-fwd {
  from {
    opacity: 0;
    transform: translateX(22px);
  }
}
@keyframes insp-enter-back {
  from {
    opacity: 0;
    transform: translateX(-22px);
  }
}
.insp-scroll {
  flex: 1;
  overflow: auto;
  padding: 22px 24px 48px;
  overscroll-behavior: contain;
}
.insp-title {
  font-size: 21px;
  font-weight: 660;
  letter-spacing: -0.022em;
  line-height: 1.25;
  text-wrap: balance;
}
.insp-path {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  word-break: break-all;
}
#insp-fm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 6px;
}
#insp-fm:empty {
  display: none;
}
.insp-against {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--ink-secondary);
}
.insp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.insp-fm-details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-muted);
  list-style: none;
}
.insp-fm-details summary::before {
  content: "▸ ";
}
.insp-fm-details[open] summary::before {
  content: "▾ ";
}
dl.fm {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  font-size: 12px;
}
dl.fm dt {
  font-family: var(--font-mono);
  color: var(--ink-muted);
}
dl.fm dd {
  color: var(--ink-secondary);
  word-break: break-word;
}
.insp-section {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}
.insp-section .eyebrow {
  margin-bottom: 8px;
}
.mini-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.mini-row:hover {
  background: var(--bg-hover);
}
.mini-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-meta {
  font-size: 11px;
  color: var(--ink-muted);
}

/* Markdown */
.md {
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.68;
  color: var(--ink-primary);
  overflow-wrap: anywhere;
}
.md > * + * {
  margin-top: 0.85em;
}
.md h1,
.md h2,
.md h3,
.md h4 {
  margin-top: 1.5em;
  line-height: 1.3;
  letter-spacing: -0.012em;
}
.md h1 {
  font-size: 18px;
}
.md h2 {
  font-size: 16px;
}
.md h3,
.md h4 {
  font-size: 14px;
}
.md p,
.md li {
  color: var(--ink-secondary);
}
.md strong {
  color: var(--ink-primary);
  font-weight: 620;
}
.md ul,
.md ol {
  padding-left: 1.3em;
}
.md ul {
  list-style: disc;
}
.md ol {
  list-style: decimal;
}
.md li + li {
  margin-top: 0.3em;
}
.md li::marker {
  color: var(--ink-muted);
}
.md a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-ring);
  text-underline-offset: 3px;
}
.md code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.12em 0.36em;
  border-radius: 4px;
  background: var(--bg-active);
}
.md-code {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-sunken);
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.55;
}
.md-code code {
  padding: 0;
  background: none;
}
.md blockquote {
  margin-left: 0;
  padding: 2px 14px;
  border-left: 3px solid var(--accent-ring);
  color: var(--ink-secondary);
}
.md hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
}
.md table {
  border-collapse: collapse;
  font-size: 13px;
}
.md th,
.md td {
  border: 1px solid var(--border-subtle);
  padding: 5px 9px;
}

/* ─── Palette + shortcuts ────────────────────────────────────────────────── */

dialog {
  color: inherit;
}
.palette,
.sheet-dialog {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: none;
  max-height: none;
  overflow: visible;
}
.palette {
  width: min(640px, calc(100vw - 24px));
  margin: 12dvh auto auto;
}
.palette::backdrop,
.sheet-dialog::backdrop {
  background: rgba(9, 9, 11, 0.5);
  backdrop-filter: blur(4px);
}
.palette[open] .palette-box,
.sheet-dialog[open] .sheet-box {
  animation: pop-in 180ms var(--ease-out);
}
.palette-box,
.sheet-box {
  border-radius: 16px;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
}
.palette-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.palette-icon {
  display: flex;
  color: var(--ink-muted);
}
#palette-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--ink-primary);
}
#palette-input::placeholder {
  color: var(--ink-muted);
}
.palette-list {
  max-height: min(56dvh, 460px);
  overflow: auto;
  padding: 6px;
  scroll-padding: 8px;
}
.palette-group {
  padding: 10px 10px 4px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.palette-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.palette-row[aria-selected="true"] {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}
.palette-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  color: var(--ink-secondary);
  font-size: 13px;
}
.palette-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.palette-label {
  font-size: 13.5px;
  font-weight: 540;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-snippet {
  font-size: 12px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-meta {
  flex: none;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.palette-empty {
  padding: 28px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}
.palette-foot {
  display: flex;
  gap: 16px;
  padding: 9px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-sunken);
  font-size: 11.5px;
  color: var(--ink-muted);
}
.palette-foot span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sheet-dialog {
  width: min(720px, calc(100vw - 24px));
  margin: auto;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 14px 22px;
  border-bottom: 1px solid var(--border-subtle);
}
.sheet-head h2 {
  font-size: 15px;
  font-weight: 640;
}
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 22px 28px;
  padding: 20px 22px 24px;
  max-height: 70dvh;
  overflow: auto;
}
.shortcut-group .eyebrow {
  margin-bottom: 8px;
}
.shortcut-group dl {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-secondary);
}
.shortcut-row dt {
  order: 2;
  flex: none;
}
.shortcut-row dd {
  order: 1;
}

/* ─── Tabbar (mobile) ────────────────────────────────────────────────────── */

.tabbar {
  display: none;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1279px) {
  .lanes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .board {
    grid-template-columns: repeat(min(var(--cols, 4), 2), minmax(0, 1fr));
  }
  .search-trigger {
    width: 200px;
  }
}
@media (max-width: 960px) {
  .lib {
    grid-template-columns: 1fr;
  }
  .lib-facets {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px 24px;
  }
  .sit {
    grid-template-columns: 1fr;
  }
  .sit-list {
    position: static;
    max-height: 320px;
  }
  .live {
    display: none;
  }
}
@media (max-width: 720px) {
  .rail {
    display: none;
  }
  .main-col,
  body.rail-open .main-col {
    margin-left: 0;
  }
  .topbar {
    padding: 0 8px;
    gap: 4px;
  }
  .crumbs {
    display: none;
  }
  .search-trigger {
    width: 36px;
    padding: 0;
    justify-content: center;
    box-shadow: none;
  }
  .search-trigger-text,
  .search-trigger .kbd {
    display: none;
  }
  .view {
    padding: 18px 14px calc(88px + env(safe-area-inset-bottom));
  }
  .view-map {
    height: calc(100dvh - var(--top-h) - 64px - env(safe-area-inset-bottom));
    padding: 10px;
  }
  .page-title {
    font-size: 22px;
  }
  .hero {
    padding: 22px 18px 18px;
    border-radius: var(--radius-lg);
  }
  .hero-actions {
    width: 100%;
  }
  .hero-actions .btn {
    flex: 1;
  }
  .lanes,
  .board {
    grid-template-columns: 1fr;
  }
  .toolbar-search {
    max-width: none;
    margin-left: 0;
  }
  .delta-hops {
    margin-left: 0;
  }
  .tl-summary,
  .tl-resume {
    padding-left: 0;
  }
  .inspector {
    top: auto;
    left: 0;
    width: 100%;
    height: 92dvh;
    border-left: 0;
    border-top: 1px solid var(--border-default);
    border-radius: 18px 18px 0 0;
    transform: translateY(24px);
  }
  .insp-deck {
    top: auto;
    left: 0;
    width: 100%;
    height: 92dvh;
  }
  .insp-ghost,
  .insp-ghost[data-n="2"] {
    inset: 0 14px;
    border: 1px solid var(--border-default);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }
  .insp-ghost[data-n="2"] {
    inset: 0 28px;
  }
  .insp-deck[data-depth="1"] .insp-ghost[data-n="1"],
  .insp-deck[data-depth="2"] .insp-ghost[data-n="1"],
  .insp-deck[data-depth="1"] .insp-ghost[data-n="1"]:hover,
  .insp-deck[data-depth="2"] .insp-ghost[data-n="1"]:hover {
    transform: translateY(-8px);
  }
  .insp-deck[data-depth="2"] .insp-ghost[data-n="2"],
  .insp-deck[data-depth="2"] .insp-ghost[data-n="2"]:hover {
    transform: translateY(-16px);
  }
  .tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    display: flex;
    justify-content: space-around;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-subtle);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
  }
  .tab-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex: 1;
    padding: 6px 0;
    border-radius: var(--radius-md);
    color: var(--ink-muted);
    font-size: 10.5px;
    font-weight: 550;
  }
  .tab-link.active {
    color: var(--accent-ink);
  }
  .tab-link .badge {
    position: absolute;
    top: 2px;
    left: calc(50% + 6px);
    min-width: 16px;
    height: 16px;
    font-size: 9.5px;
  }
  .palette {
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Server status ──────────────────────────────────────────────────────── */

.net-banner {
  position: sticky;
  top: var(--top-h);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--c-rose) 35%, transparent);
  background: color-mix(in srgb, var(--c-rose) 10%, var(--bg-surface));
  color: var(--ink-primary);
  font-size: 13px;
}
.net-banner[hidden] {
  display: none;
}
.net-banner-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-rose);
}
.net-retry {
  flex: none;
  height: 28px;
  margin-left: auto;
}
.boot-error {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  background: var(--bg);
  text-align: center;
}
.boot-error .empty-body {
  max-width: 46ch;
}

/* ─── Embed (?embed=1): editor panels and iframes ────────────────────────── */

.embed .rail,
.embed .tabbar,
.embed .crumbs,
.embed .live,
.embed .search-trigger-text,
.embed .search-trigger .kbd {
  display: none;
}
.embed .main-col,
.embed body.rail-open .main-col {
  margin-left: 0;
}
.embed .topbar {
  height: 44px;
  padding: 0 8px;
  gap: 6px;
}
.embed .search-trigger {
  width: 34px;
  padding: 0;
  justify-content: center;
  box-shadow: none;
}
.embed .view {
  padding: 16px 12px 24px;
}
.embed .lanes,
.embed .board,
.embed .lib,
.embed .sit {
  grid-template-columns: 1fr;
}

@media (max-width: 480px) {
  .topbar {
    gap: 2px;
  }
  .project-btn .project-name {
    max-width: 44vw;
  }
  .view {
    padding-left: 10px;
    padding-right: 10px;
  }
  .hero {
    padding: 18px 14px 16px;
  }
  .net-banner {
    flex-wrap: wrap;
    padding: 8px 10px;
  }
}

/* ─── Map internals (ported from the previous dashboard) ─────────────────── */

main.map-mode {
  grid-template-columns: minmax(32rem, 3fr) minmax(20rem, 1fr);
}

#map-wrap {
  position: relative;
  width: 100%;
  height: max(38rem, calc(100dvh - 16rem));
  background: var(--bg-canvas);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}

#map-wrap.expanded {
  position: fixed;
  inset: 1rem;
  z-index: 1000;
  width: auto;
  height: calc(100dvh - 2rem) !important;
  max-height: none !important;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1000vmax rgba(0, 0, 0, 0.72), var(--shadow-xl);
}

#map {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.mind-map-svg {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  cursor: grab;
}
.mind-map-svg:active {
  cursor: grabbing;
}

.graph-link {
  stroke: var(--ink-secondary);
  stroke-opacity: 0.28;
  stroke-width: 1;
  transition: stroke-opacity 0.15s;
}

.graph-link.dimmed {
  stroke-opacity: 0.05;
}

.graph-link.faded {
  stroke-opacity: 0.06;
}

.graph-link.highlighted {
  stroke: var(--accent);
  stroke-opacity: 0.95;
  stroke-width: 1.6;
}

.graph-bubble {
  cursor: zoom-in;
  transition: opacity 0.2s;
}

.graph-bubble .bubble-fill {
  fill-opacity: 0.07;
  stroke-opacity: 0.35;
  stroke-width: 1.2;
  transition: fill-opacity 0.15s, stroke-opacity 0.15s;
}

.graph-bubble:hover .bubble-fill {
  fill-opacity: 0.13;
  stroke-opacity: 0.6;
}

.graph-bubble.dimmed {
  opacity: 0.25;
}

.bubble-label {
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
  display: none;
  paint-order: stroke;
  stroke: var(--bg-canvas);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.bubble-label.visible {
  display: block;
}

.bubble-label .bubble-count {
  font-weight: 500;
  fill: var(--ink-secondary);
}

.graph-node {
  cursor: pointer;
  transition: opacity 0.15s;
}

.graph-node circle {
  stroke: var(--bg-canvas);
  stroke-width: 1.5;
}

.graph-node.done circle {
  fill-opacity: 0.25;
  stroke-width: 1.5;
}

.graph-node.dimmed {
  opacity: 0.18;
}

.graph-node.faded {
  opacity: 0.3;
}

.graph-node.selected circle,
.graph-node.linked-highlight circle {
  stroke: var(--accent);
  stroke-width: 2.5;
}

.graph-node.filter-matched circle {
  stroke: var(--ink-primary);
  stroke-width: 2;
}

.graph-label {
  fill: var(--ink-primary);
  pointer-events: none;
  display: none;
  paint-order: stroke;
  stroke: var(--bg-canvas);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}

.graph-label.visible {
  display: block;
}

.map-legend {
  position: absolute;
  left: 0.75rem;
  bottom: 0.65rem;
  z-index: 2;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.8rem;
  max-width: calc(100% - 6rem);
  padding: 0.3rem 0.6rem;
  font-size: 0.6875rem;
  color: var(--ink-secondary);
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

#map-wrap[data-layout="graph"] .map-legend {
  display: flex;
}

.map-legend i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.3rem;
  border-radius: 50%;
  background: var(--dot);
  vertical-align: baseline;
}

.map-legend .legend-sep {
  opacity: 0.8;
}

/* Floating Zoom & Fit Controls */
.map-controls {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 10;
}

.map-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.map-ctrl-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-focus);
  color: var(--ink-primary);
}

/* Tooltip */
.mind-map-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 20;
  padding: 0.5rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  color: var(--ink-primary);
  font-size: 0.75rem;
  line-height: 1.4;
  max-width: 18rem;
  backdrop-filter: blur(8px);
}
.mind-map-tooltip .tt-title {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--ink-primary);
  margin-bottom: 0.2rem;
  word-break: break-word;
}
.mind-map-tooltip .tt-meta {
  color: var(--ink-secondary);
  font-size: 0.6875rem;
  font-family: var(--font-mono);
}
.mind-map-tooltip .tt-path {
  color: var(--ink-muted);
  font-size: 0.6875rem;
  margin-top: 0.15rem;
  word-break: break-all;
}

/* SVG Nodes */
.mindmap-node {
  cursor: pointer;
  transition: opacity 0.2s;
}

.node-root rect {
  fill: var(--bg-surface);
  stroke: var(--accent);
  stroke-width: 2;
  filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.25));
}
.node-root text {
  fill: var(--ink-primary);
  font-family: var(--font-sans);
  font-weight: 650;
  font-size: 13px;
}

.node-hub rect.hub-rect {
  fill: var(--bg-surface);
  stroke-width: 1.8;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
  transition: all 0.2s;
}
.node-hub:hover rect.hub-rect {
  fill: var(--bg-elevated);
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.35));
}
.node-hub text.hub-label {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 650;
}

.node-concept rect.pill-bg {
  fill: var(--bg-surface);
  stroke: var(--border-default);
  stroke-width: 1;
  transition: stroke 0.15s, fill 0.15s;
}
.node-concept:hover rect.pill-bg {
  stroke: var(--accent);
  fill: var(--bg-elevated);
}
.node-concept.selected rect.pill-bg {
  stroke: var(--accent);
  stroke-width: 2;
  fill: var(--bg-elevated);
  filter: drop-shadow(0 0 6px var(--accent));
}
.node-concept.pinned rect.pill-bg {
  stroke: var(--accent);
  stroke-dasharray: 3, 2;
  stroke-width: 1.5;
}
.node-concept text.concept-title {
  fill: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 550;
}
.node-concept text.status-badge {
  font-size: 9px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.mind-map-tooltip .tt-pinned {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.6875rem;
  margin-top: 0.25rem;
}

/* SVG Links */
.link-structural {
  fill: none;
  stroke-opacity: 0.38;
  stroke-width: 1.4;
  transition: stroke-opacity 0.2s, stroke-width 0.2s;
}
.link-structural.highlighted {
  stroke-opacity: 0.95;
  stroke-width: 2.6;
}

.link-cross {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.16;
  stroke-width: 1.2;
  stroke-dasharray: 4, 3;
  transition: stroke-opacity 0.25s, stroke-width 0.25s, stroke 0.25s;
  cursor: pointer;
}
.link-cross.link-intra {
  stroke: var(--accent);
  stroke-opacity: 0.18;
  stroke-dasharray: 4, 3;
}
.link-cross.link-inter {
  stroke: var(--k-journal);
  stroke-opacity: 0.16;
  stroke-dasharray: 5, 3;
}
.link-cross:hover,
.link-cross.highlighted {
  stroke-opacity: 1 !important;
  stroke-width: 2.6px !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 6px var(--accent));
}

.mindmap-node.linked-highlight rect.pill-bg,
.mindmap-node.linked-highlight rect.hub-rect {
  stroke: var(--accent) !important;
  stroke-width: 2px !important;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.45));
}

.mindmap-node.dimmed {
  opacity: 0.18;
  transition: opacity 0.25s ease;
}

.mindmap-node.filter-matched rect.pill-bg,
.mindmap-node.filter-matched rect.hub-rect {
  stroke: var(--accent) !important;
  stroke-width: 2.2px !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 6px var(--accent));
}

.mindmap-link.dimmed,
.link-cross.dimmed {
  opacity: 0.04 !important;
}

.map-overlay-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-secondary);
  pointer-events: none;
  text-align: center;
}
.map-overlay-empty p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 550;
}
