/* ---------- tokens ---------- */
:root {
  --bg: #fafafa;
  --bg-elev: #ffffff;
  --bg-sunk: #f3f3f1;
  --ink: #0d0d0d;
  --ink-2: #3a3a38;
  --ink-3: #6e6e6a;
  --ink-4: #a4a49f;
  --rule: rgba(0, 0, 0, 0.08);
  --rule-strong: rgba(0, 0, 0, 0.14);
  --accent: oklch(0.55 0.2 252);
  --accent-ink: #ffffff;
  --accent-soft: oklch(0.96 0.03 252);
  --accent-soft-ink: oklch(0.4 0.18 252);
  --danger: oklch(0.55 0.2 25);
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sidebar-w: 264px;
  --topbar-h: 60px;
  --content-max: 720px;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-elev: #131313;
  --bg-sunk: #1a1a1a;
  --ink: #ededed;
  --ink-2: #c8c8c8;
  --ink-3: #8a8a8a;
  --ink-4: #555555;
  --rule: rgba(255, 255, 255, 0.08);
  --rule-strong: rgba(255, 255, 255, 0.14);
  --accent: oklch(0.7 0.17 252);
  --accent-ink: #0a0a0a;
  --accent-soft: oklch(0.25 0.07 252);
  --accent-soft-ink: oklch(0.85 0.1 252);
  --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- password gate ---------- */
.gate {
  position: fixed; inset: 0;
  background: var(--bg);
  display: grid; place-items: center;
  z-index: 1000;
  padding: 24px;
}
.gate-card {
  width: 100%;
  max-width: 380px;
  text-align: left;
}
.gate-mark {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 10px;
}
.gate-mark::before {
  content: "";
  display: inline-block;
  width: 18px; height: 18px;
  background: var(--ink);
  border-radius: 4px;
  position: relative;
}
.gate h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.gate p {
  color: var(--ink-3);
  margin: 0 0 24px;
  font-size: 14px;
}
.gate form { display: flex; flex-direction: column; gap: 10px; }
.gate input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  outline: none;
  transition: border-color 120ms;
}
.gate input[type="password"]:focus { border-color: var(--accent); }
.gate button[type="submit"] {
  padding: 11px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  font-weight: 500;
  transition: opacity 120ms;
}
.gate button[type="submit"]:hover { opacity: 0.86; }
.gate-err {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
}
.gate-foot {
  margin-top: 28px;
  font-size: 12px;
  color: var(--ink-4);
  font-family: var(--font-mono);
}

/* ---------- app shell ---------- */
.app { display: grid; grid-template-rows: auto 1fr; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center;
  padding: 0 22px;
  background: color-mix(in oklab, var(--bg), transparent 8%);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
  gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px;
  letter-spacing: -0.005em;
}
.brand-mark {
  width: 22px; height: 22px;
  background: var(--ink);
  border-radius: 5px;
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1.5px solid var(--bg);
  border-radius: 50%;
  border-top-color: transparent;
  border-right-color: transparent;
}
.brand-meta {
  display: flex; flex-direction: column;
  line-height: 1.1;
}
.brand-meta small {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar-spacer { flex: 1; }

.search {
  flex: 1; max-width: 460px;
  position: relative;
}
.search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--bg-sunk);
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  transition: border-color 120ms, background 120ms;
}
.search input:focus {
  border-color: var(--rule-strong);
  background: var(--bg-elev);
}
.search svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.search kbd {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg);
}

.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--ink-2);
  transition: background 120ms;
}
.icon-btn:hover { background: var(--bg-sunk); color: var(--ink); }

/* ---------- main grid ---------- */
.main {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 22px 14px 40px 22px;
  border-right: 1px solid var(--rule);
}
.sidebar-section {
  margin-bottom: 24px;
}
.sidebar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 10px;
  margin-bottom: 8px;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--ink-2);
  transition: background 120ms, color 120ms;
  line-height: 1.3;
}
.sidebar a:hover { background: var(--bg-sunk); color: var(--ink); }
.sidebar a.active { background: var(--bg-sunk); color: var(--ink); font-weight: 500; }
.sidebar a .num {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
}

.content { padding: 28px 44px 80px; min-width: 0; }

/* ---------- home hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 28px 0 56px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 40px;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero-lede {
  color: var(--ink-2);
  font-size: 16.5px;
  line-height: 1.55;
  max-width: 52ch;
  margin: 0 0 24px;
}
.hero-meta {
  display: flex; gap: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-meta b { color: var(--ink); font-weight: 500; }

/* abstract illustration slot — link-analysis graph */
.hero-art {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
  color: var(--ink-3);
}
.hero-art svg { display: block; width: 100%; height: 100%; }
.hero-art .hero-grid { color: var(--ink-4); }
.hero-art .hero-edges { stroke: var(--ink-3); opacity: 0.55; }
.hero-art .hero-nodes circle { fill: var(--ink); stroke: var(--bg-elev); stroke-width: 1.5; }
.hero-art .hero-node-accent { fill: var(--accent) !important; stroke: var(--bg-elev) !important; stroke-width: 2 !important; }
.hero-art .hero-node-halo { fill: var(--accent); opacity: 0.18; stroke: none !important; }
.hero-art .hero-cross { color: var(--accent); opacity: 0.7; }
.hero-art .hero-labels { fill: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; }
.hero-art .hero-ticks { letter-spacing: 0.06em; }

/* ---------- section headings ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 40px 0 18px;
}
.section-head h2 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.005em;
  margin: 0;
}
.section-head .more {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.section-head .more:hover { color: var(--accent); }

/* ---------- card grid ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.card {
  background: var(--bg);
  padding: 20px 22px 22px;
  display: flex; flex-direction: column;
  gap: 8px;
  transition: background 140ms;
  min-height: 168px;
}
.card:hover { background: var(--bg-sunk); }
.card-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.card h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 0 0 4px;
}
.card p {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}
.card-foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.card-foot .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ink-4);
}

/* ---------- article (two-col with TOC) ---------- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 56px;
  align-items: start;
}
@media (max-width: 1100px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
}
.article {
  max-width: var(--content-max);
}
.crumbs {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 18px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.crumbs a:hover { color: var(--accent); }
.crumbs span { color: var(--ink-4); }
.article h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(32px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}
.article-lede {
  font-size: 17px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0 0 24px;
  max-width: 58ch;
}
.article-meta {
  display: flex; gap: 18px;
  padding: 14px 0;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 36px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.article-meta b { color: var(--ink); font-weight: 500; }

.article h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 44px 0 14px;
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}
.article h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15.5px;
  margin: 28px 0 10px;
  letter-spacing: -0.005em;
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}
.article p, .article ul, .article ol {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 16px;
}
.article ul, .article ol { padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article li::marker { color: var(--ink-4); }
.article a:not(.card):not(.btn) {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in oklab, var(--accent), transparent 70%);
  transition: border-color 120ms;
}
.article a:not(.card):not(.btn):hover { border-bottom-color: var(--accent); }
.article code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 5px;
  background: var(--bg-sunk);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.article pre {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-sunk);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  line-height: 1.55;
  margin: 0 0 20px;
}
.article pre code { background: none; border: 0; padding: 0; font-size: inherit; }

.callout {
  display: flex; gap: 14px;
  padding: 16px 18px;
  background: var(--bg-sunk);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  margin: 18px 0 24px;
}
.callout.warn { border-left-color: var(--danger); }
.callout-icon {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
  flex-shrink: 0;
  width: 56px;
  padding-top: 2px;
}
.callout.warn .callout-icon { color: var(--danger); }
.callout-body { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.callout-body p:last-child { margin-bottom: 0; }

.spec-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 24px;
  font-size: 14px;
}
.spec-table th, .spec-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table th {
  background: var(--bg-sunk);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.spec-table td.mono { font-family: var(--font-mono); font-size: 13px; }

/* TOC */
.toc {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  font-size: 13px;
  padding-left: 22px;
  border-left: 1px solid var(--rule);
}
.toc-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.toc a {
  display: block;
  padding: 4px 0;
  color: var(--ink-3);
  line-height: 1.4;
}
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent); }
.toc a.h3 { padding-left: 12px; font-size: 12.5px; }

/* ---------- tools ---------- */
.tools-head {
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
}
.tools-head h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(32px, 3.4vw, 44px);
  line-height: 1.05;
  margin: 0 0 8px;
  letter-spacing: -0.015em;
}
.tools-head p { color: var(--ink-3); margin: 0; max-width: 60ch; }

.tools-controls {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tools-search {
  flex: 1; min-width: 220px;
  position: relative;
}
.tools-search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 8px;
  outline: none;
}
.tools-search input:focus { border-color: var(--accent); }
.tools-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  color: var(--ink-2);
  transition: background 120ms, border-color 120ms, color 120ms;
  white-space: nowrap;
}
.pill:hover { border-color: var(--rule-strong); color: var(--ink); }
.pill.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.tool {
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 140ms, transform 140ms;
}
.tool:hover { border-color: var(--rule-strong); }
.tool-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tool h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14.5px;
  margin: 0;
  letter-spacing: -0.005em;
}
.tool-cost {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tool-cost.paid { color: var(--accent); }
.tool p { font-size: 13.5px; color: var(--ink-2); margin: 0; line-height: 1.5; flex: 1; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.tool-links {
  font-size: 12.5px;
  line-height: 1.4;
  margin: 2px 0 6px;
}
.tool-links p { margin: 0; }
.tool-links a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in oklab, var(--accent), transparent 70%);
  transition: border-color 120ms;
}
.tool-links a:hover { border-bottom-color: var(--accent); }

.tool-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}
.tool-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 2px 7px;
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.empty {
  padding: 60px 0;
  text-align: center;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- sessions ---------- */
.session {
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.session:last-child { border-bottom: 0; }
.session-head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 0;
}
.session-head-toggle {
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  border-radius: 4px;
}
.session-head-toggle:hover .session-num,
.session-head-toggle:hover .session-date { color: var(--ink-2); }
.session-head-toggle:hover h3 { color: var(--accent); }
.session-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  flex-shrink: 0;
}
.session h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 18px;
  margin: 0;
  letter-spacing: -0.005em;
  transition: color 120ms;
}
.session-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-transform: uppercase;
  flex-shrink: 0;
}
.session-body {
  font-size: 15px; line-height: 1.6; color: var(--ink-2);
  margin-top: 14px;
}
.session-body p { margin: 0 0 14px; }
.session-body p:last-child { margin-bottom: 0; }
.session-body ul, .session-body ol { padding-left: 22px; margin: 0 0 14px; }
.session-body li { margin-bottom: 4px; }
.session-body li::marker { color: var(--ink-4); }
.session-body h2 { font-family: var(--font-sans); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); margin: 22px 0 8px; }
.session-body h3 { font-family: var(--font-sans); font-weight: 600; font-size: 15.5px; color: var(--ink); margin: 18px 0 6px; }
.session-body h4 { font-family: var(--font-sans); font-weight: 600; font-size: 14px; color: var(--ink); margin: 14px 0 4px; }
.session-body strong { color: var(--ink); font-weight: 600; }
.session-body a { color: var(--accent); border-bottom: 1px solid color-mix(in oklab, var(--accent), transparent 70%); }
.session-body a:hover { border-bottom-color: var(--accent); }
.session-body code { font-family: var(--font-mono); font-size: 0.88em; padding: 2px 5px; background: var(--bg-sunk); border: 1px solid var(--rule); border-radius: 4px; }
.session-body pre { font-family: var(--font-mono); font-size: 13px; background: var(--bg-sunk); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; line-height: 1.55; margin: 0 0 16px; }
.session-body pre code { background: none; border: 0; padding: 0; }
.session-body blockquote { margin: 0 0 14px; padding: 10px 16px; border-left: 3px solid var(--rule-strong); color: var(--ink-3); font-style: italic; }
.session-collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
.session-collapse.open {
  grid-template-rows: 1fr;
}
.session-collapse-inner {
  overflow: hidden;
  padding-bottom: 0;
  transition: padding-bottom 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
.session-collapse.open .session-collapse-inner {
  padding-bottom: 4px;
}
.session-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.session-editor {
  margin-bottom: 32px;
  padding: 18px;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.session-editor[hidden] { display: none; }
.session-editor h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  margin: 0 0 14px;
  color: var(--ink-3);
  letter-spacing: 0.01em;
}
.session-editor .field {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 10px;
}
.session-editor label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.session-editor input,
.session-editor textarea,
.session-editor select {
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  outline: none;
}
.session-editor input:focus,
.session-editor textarea:focus { border-color: var(--accent); }
.session-editor textarea { min-height: 140px; resize: vertical; font-family: inherit; line-height: 1.55; }
.session-editor .row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Password-gated delete modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: oklch(0 0 0 / 0.5);
  z-index: 100;
  display: grid; place-items: center;
  padding: 24px;
  animation: kol-fade-in 0.12s ease-out;
}
.modal {
  background: var(--bg-elev);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 22px 24px;
  width: 100%; max-width: 400px;
  box-shadow: 0 12px 32px oklch(0 0 0 / 0.25);
}
.modal h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.modal p {
  color: var(--ink-2);
  font-size: 14px;
  margin: 0 0 14px;
  line-height: 1.5;
}
.modal input[type="password"] {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  outline: none;
  font: inherit;
  font-size: 14px;
}
.modal input[type="password"]:focus { border-color: var(--accent); }
.modal-err {
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--danger);
  min-height: 18px;
  margin-top: 6px;
}
.modal-actions {
  display: flex; gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}
.btn.modal-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.btn.modal-danger:hover { filter: brightness(1.08); }
.btn.modal-danger:disabled { opacity: 0.55; cursor: not-allowed; }
@keyframes kol-fade-in { from { opacity: 0; } to { opacity: 1; } }
.btn {
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: opacity 120ms;
}
.btn:hover { opacity: 0.85; }
.btn.ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--rule-strong);
}
.btn.ghost:hover { color: var(--ink); border-color: var(--ink); opacity: 1; }

.session-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- tweaks panel ---------- */
.tweaks-fab {
  position: fixed;
  bottom: 22px; right: 22px;
  z-index: 60;
  width: 38px; height: 38px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  display: none;
  place-items: center;
  box-shadow: var(--shadow-md);
}
.tweaks-fab.visible { display: grid; }
.tweaks-panel {
  position: fixed;
  bottom: 70px; right: 22px;
  z-index: 60;
  width: 280px;
  background: var(--bg-elev);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 14px;
  display: none;
}
.tweaks-panel.open { display: block; }
.tweaks-panel h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
  color: var(--ink-3);
  display: flex; align-items: center; justify-content: space-between;
}
.tweak-group { margin-bottom: 14px; }
.tweak-group:last-child { margin-bottom: 0; }
.tweak-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.swatch-row { display: flex; gap: 6px; }
.swatch {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
}
.swatch.active { border-color: var(--ink); }
.segment {
  display: flex;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  overflow: hidden;
}
.segment button {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
  background: var(--bg);
  color: var(--ink-2);
  border-right: 1px solid var(--rule);
}
.segment button:last-child { border-right: 0; }
.segment button.active { background: var(--ink); color: var(--bg); }

/* responsive */
@media (max-width: 860px) {
  .main { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 14px 18px;
  }
  .content { padding: 22px 20px 60px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 16px 0 40px; }
  .hero-art { aspect-ratio: 5 / 3; }
  .search { display: none; }
}
