/* Layout: sticky left rail (idea journey) + masonry wall of coloured paper notes (paper colour = stage). Admin view swaps the wall for series/tag management. */
:root {
  --paper: #FAFAF7; --surface: #FFFFFF; --raised: #F0EFEA; --overlay: #E4E2DB;
  --ink: #141413; --muted: #6E6B64; --accent: #E63946; --accent-ink: #FFFFFF;
  --dot: rgb(20 20 19 / .09);
  --note-ink: #1A1916; --note-muted: rgb(26 25 22 / .62); --note-line: rgb(26 25 22 / .14);
  /* one paper colour per stage */
  --st-spark: #FFD84D; --st-organize: #FF9EC4; --st-research: #7CC8FF; --st-analyze: #B79CFF;
  --st-write: #FF8A4C; --st-edit: #57E0A6; --st-published: #1D1C1A; --st-parked: #D8D4CA;
  --published-ink: #F6F4EE;
  /* series marker colours, picked in Admin */
  --sc-red: #E63946; --sc-blue: #2F6BFF; --sc-green: #10A36B; --sc-violet: #7B4DFF; --sc-amber: #E59A00; --sc-ink: #141413;
  --shadow: 0 1px 0 rgb(20 20 19 / .06), 0 14px 28px -18px rgb(20 20 19 / .45);
  --shadow-hi: 0 2px 0 rgb(20 20 19 / .06), 0 26px 40px -20px rgb(20 20 19 / .55);
  --f-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --f-text: "Hanken Grotesk", "Helvetica Neue", system-ui, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2,.8,.2,1);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #0F0F0E; --surface: #181816; --raised: #22221F; --overlay: #2E2E2A;
  --ink: #F3F1EC; --muted: #A29E95; --accent: #FF5A66; --accent-ink: #140405; --dot: rgb(243 241 236 / .07);
  --st-spark: #F2C93A; --st-organize: #F28AB4; --st-research: #66B6EE; --st-analyze: #A68BF0;
  --st-write: #F27A3C; --st-edit: #45CC93; --st-published: #F3F1EC; --st-parked: #BDB8AD; --published-ink: #141413;
  --sc-red: #FF5A66; --sc-blue: #6C95FF; --sc-green: #34C98C; --sc-violet: #A084FF; --sc-amber: #FFB938; --sc-ink: #F3F1EC;
  --shadow: 0 14px 30px -18px rgb(0 0 0 / .9); --shadow-hi: 0 26px 44px -18px rgb(0 0 0 / .95);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --paper: #0F0F0E; --surface: #181816; --raised: #22221F; --overlay: #2E2E2A;
  --ink: #F3F1EC; --muted: #A29E95; --accent: #FF5A66; --accent-ink: #140405; --dot: rgb(243 241 236 / .07);
  --st-spark: #F2C93A; --st-organize: #F28AB4; --st-research: #66B6EE; --st-analyze: #A68BF0;
  --st-write: #F27A3C; --st-edit: #45CC93; --st-published: #F3F1EC; --st-parked: #BDB8AD; --published-ink: #141413;
  --sc-red: #FF5A66; --sc-blue: #6C95FF; --sc-green: #34C98C; --sc-violet: #A084FF; --sc-amber: #FFB938; --sc-ink: #F3F1EC;
  --shadow: 0 14px 30px -18px rgb(0 0 0 / .9); --shadow-hi: 0 26px 44px -18px rgb(0 0 0 / .95);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--paper); color: var(--ink); font-family: var(--f-text); font-size: 15px; line-height: 1.5;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.4px); background-size: 22px 22px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- header ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; align-items: center; gap: 12px; padding-block: 14px;
  background: linear-gradient(var(--paper) 70%, transparent); max-width: 1680px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; white-space: nowrap; }
.logo i { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); display: block; box-shadow: 7px 0 0 -2px var(--st-spark), 14px 0 0 -4px var(--st-research); margin-right: 14px; }
.tabs { display: flex; gap: 2px; background: var(--raised); border-radius: 999px; padding: 3px; }
.tabs button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--muted); }
.tabs button[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.search { flex: 1; min-width: 0; max-width: 420px; display: flex; align-items: center; gap: 8px; background: var(--raised); border-radius: 999px; padding: 9px 16px; }
.search input { border: 0; background: none; outline: none; width: 100%; min-width: 0; }
.search kbd { font-family: var(--f-mono); font-size: .68rem; color: var(--muted); border: 1px solid var(--overlay); border-radius: 6px; padding: 1px 6px; }
.spacer { flex: 1; }
.btn { border: 0; border-radius: 999px; padding: 9px 16px; background: var(--raised); cursor: pointer; font-weight: 600; white-space: nowrap; transition: transform .15s var(--ease), background .15s; }
.btn:hover { transform: translateY(-1px); background: var(--overlay); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.danger { background: var(--accent); color: var(--accent-ink); }
.btn.sm { padding: 6px 12px; font-size: .82rem; }
.icon-btn { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; }

/* ---------- page layout: rail left, content right ---------- */
.wrap { max-width: 1680px; margin: 0 auto; display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; padding-block: 4px 64px; align-items: start; }
.content { min-width: 0; display: grid; gap: 16px; }
.hero { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 32px; padding-block: 14px 2px; }
.hero h1 { margin: 0; font-family: var(--f-display); font-weight: 700; letter-spacing: -.035em; line-height: .95;
  font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.8rem); text-wrap: balance; max-width: 13ch; }
.hero h1 em { font-style: normal; background: var(--st-spark); color: var(--note-ink); padding: 0 .12em; border-radius: .12em; display: inline-block; transform: rotate(-2deg); }
.hero .meta { font-family: var(--f-mono); font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 18px; flex-wrap: wrap; }
.hero .meta b { color: var(--ink); font-weight: 500; font-size: 1.6rem; display: block; letter-spacing: -.02em; font-family: var(--f-display); text-transform: none; }
.sample { margin: 0; font-family: var(--f-mono); font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sample span { background: var(--raised); padding: 3px 8px; border-radius: 6px; }

/* chips: series filter */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 0; background: var(--raised); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: .85rem; font-weight: 500; display: flex; gap: 7px; align-items: center; transition: background .15s; }
.chip:hover { background: var(--overlay); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip small { font-family: var(--f-mono); opacity: .6; font-size: .7rem; }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); flex-shrink: 0; display: inline-block; }

/* ---------- masonry wall ---------- */
.wall { columns: 240px; column-gap: 18px; padding-top: 8px; }
@supports (display: grid-lanes) { .wall { columns: auto; display: grid-lanes; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; } }
.note { --bg: var(--st-spark); --fg: var(--note-ink); --fg2: var(--note-muted); --line: var(--note-line);
  break-inside: avoid; margin: 0 0 18px; position: relative; display: block; width: 100%; cursor: pointer;
  background: var(--bg); color: var(--fg); border-radius: 4px 4px 16px 4px; padding: 26px 20px 18px; box-shadow: var(--shadow);
  transform: rotate(var(--tilt, 0deg)); transition: transform .28s var(--ease), box-shadow .28s var(--ease);
  animation: drop .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
@supports (display: grid-lanes) { .note { margin: 0; } }
.note:hover, .note:focus-visible { transform: rotate(0deg) translateY(-6px) scale(1.015); box-shadow: var(--shadow-hi); z-index: 2; }
.note::before { /* washi tape */ content: ""; position: absolute; top: -9px; left: 50%; width: 74px; height: 20px; translate: -50% 0; rotate: var(--tape, -3deg);
  background: color-mix(in srgb, var(--surface) 62%, transparent); border-left: 1px dashed var(--line); border-right: 1px dashed var(--line); }
.note::after { /* folded corner */ content: ""; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; border-radius: 0 0 16px 0;
  background: linear-gradient(135deg, transparent 50%, color-mix(in srgb, var(--bg) 70%, #000 12%) 50%); }
@keyframes drop { from { transform: translateY(14px) rotate(calc(var(--tilt, 0deg) * 3)); } }
.note[data-stage="organize"] { --bg: var(--st-organize); } .note[data-stage="research"] { --bg: var(--st-research); }
.note[data-stage="analyze"] { --bg: var(--st-analyze); } .note[data-stage="write"] { --bg: var(--st-write); }
.note[data-stage="edit"] { --bg: var(--st-edit); } .note[data-stage="parked"] { --bg: var(--st-parked); }
.note[data-stage="published"] { --bg: var(--st-published); --fg: var(--published-ink); --fg2: color-mix(in srgb, var(--published-ink) 65%, transparent); --line: color-mix(in srgb, var(--published-ink) 20%, transparent); }
.note.stale { filter: saturate(.55) sepia(.18); }
.note .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--fg2); }
.note .row > span:first-child { display: flex; align-items: center; gap: 6px; min-width: 0; }
.note .sdot { box-shadow: 0 0 0 2px color-mix(in srgb, var(--bg) 60%, #fff 40%); }
.note h3 { margin: 10px 0 8px; font-family: var(--f-display); font-weight: 700; font-size: 1.32rem; line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; }
.note p { margin: 0 0 10px; font-size: .9rem; color: var(--fg2); }
.note.quote h3 { font-size: 1.6rem; font-weight: 600; font-style: italic; letter-spacing: -.025em; }
.note.quote h3::before { content: "“"; display: block; font-size: 3rem; line-height: .5; margin-top: 12px; }
.note.big h3 { font-size: 1.7rem; }
.note ul { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 4px; font-size: .86rem; }
.note li { display: flex; gap: 8px; } .note li::before { content: "○"; opacity: .55; }
.note .key { border-left: 3px solid var(--fg); padding-left: 10px; font-weight: 600; font-size: .9rem; margin: 2px 0 12px; }
.note .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; font-family: var(--f-mono); font-size: .7rem; color: var(--fg2); }
.track { display: flex; gap: 3px; flex-shrink: 0; } .track i { width: 9px; height: 4px; border-radius: 2px; background: var(--line); }
.track i.on { background: var(--fg); }
.empty { text-align: center; padding: 64px 0; color: var(--muted); }
.empty b { display: block; font-family: var(--f-display); font-size: 1.6rem; color: var(--ink); }

/* ---------- left rail: the journey ---------- */
.rail { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 76px); display: grid; gap: 16px; max-height: calc(100vh - 96px); overflow-y: auto; scrollbar-width: none; padding-bottom: 8px; }
.panel { background: var(--surface); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 4px; font-family: var(--f-display); font-size: 1.15rem; letter-spacing: -.02em; }
.panel .sub { margin: 0 0 14px; font-size: .82rem; color: var(--muted); }
.journey { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 2px; }
.journey::before { content: ""; position: absolute; left: 19px; top: 18px; bottom: 58px; border-left: 2px dashed var(--overlay); }
.step { position: relative; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 7px 8px 7px 0; border-radius: 14px; cursor: pointer; text-align: left; transition: background .15s; }
.step:hover, .step[aria-pressed="true"] { background: var(--raised); }
.step[aria-pressed="true"] .dot { transform: scale(1.12) rotate(-6deg); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.dot { width: 34px; height: 34px; margin-left: 2px; border-radius: 11px; display: grid; place-items: center; font-family: var(--f-mono); font-weight: 500; font-size: .8rem; color: var(--note-ink); transition: transform .25s var(--ease); position: relative; z-index: 1; }
.step b { display: block; font-weight: 600; font-size: .92rem; line-height: 1.2; }
.step small { color: var(--muted); font-size: .76rem; }
.bar { width: 40px; height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 3px; transition: width .4s var(--ease); }
.step.sep { margin-top: 10px; border-top: 1px dashed var(--overlay); border-radius: 0 0 14px 14px; padding-top: 12px; }
.mini { display: grid; gap: 8px; }
.mini button { display: flex; gap: 10px; align-items: center; border: 0; background: var(--raised); border-radius: 12px; padding: 9px 10px; cursor: pointer; text-align: left; width: 100%; }
.mini button:hover { background: var(--overlay); }
.mini i { width: 10px; height: 26px; border-radius: 3px; flex-shrink: 0; }
.mini span { flex: 1; min-width: 0; font-size: .85rem; font-weight: 500; line-height: 1.25; }
.mini small { font-family: var(--f-mono); font-size: .7rem; color: var(--accent); white-space: nowrap; }
.pulse { display: flex; align-items: end; gap: 5px; height: 54px; margin-top: 6px; }
.pulse i { flex: 1; border-radius: 4px 4px 2px 2px; background: var(--ink); min-height: 4px; }
.pulse-l { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: .66rem; color: var(--muted); margin-top: 6px; }

/* ---------- admin ---------- */
.admin { display: grid; gap: 22px; padding-top: 6px; }
.admin-head h1 { margin: 0; font-family: var(--f-display); font-size: clamp(2rem, 1.4rem + 2vw, 3rem); letter-spacing: -.035em; line-height: 1; }
.admin-head p { margin: 8px 0 0; color: var(--muted); max-width: 62ch; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.admin .panel { padding: 20px; }
.ph { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ph h2 { margin: 0; } .ph small { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); }
.srs { display: grid; gap: 12px; }
.sr { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 14px; background: var(--raised); border-radius: 16px; padding: 14px; border-left: 5px solid var(--c); }
.sr .emo { width: 54px; height: 54px; border-radius: 14px; background: var(--surface); border: 0; font-size: 1.6rem; text-align: center; }
.sr .body { display: grid; gap: 8px; min-width: 0; }
.sr .line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sr .name { flex: 1; min-width: 140px; font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; border: 0; background: none; border-bottom: 1px dashed var(--overlay); padding: 2px 0; }
.sr .count { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); white-space: nowrap; }
.sr textarea { width: 100%; border: 1px solid var(--overlay); background: var(--surface); border-radius: 10px; padding: 8px 10px; font-size: .86rem; resize: vertical; min-height: 54px; }
.sr label { font-family: var(--f-mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.swatches { display: flex; gap: 6px; }
.swatches button { width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--raised), 0 0 0 4px var(--c); }
.confirm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--surface); border-radius: 10px; padding: 8px 10px; font-size: .85rem; }
.confirm select { border: 1px solid var(--overlay); background: var(--paper); border-radius: 8px; padding: 4px 8px; }
.add-row { display: flex; gap: 8px; margin-top: 12px; } .add-row .inp { min-width: 0; }
.tag-tools { display: flex; gap: 8px; margin-bottom: 12px; }
.tag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tag-list li { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--raised); flex-wrap: wrap; }
.tag-list .tname { flex: 1; min-width: 100px; border: 0; background: none; font-family: var(--f-mono); font-size: .85rem; padding: 4px 0; }
.tag-list .tname:focus { outline: none; border-bottom: 1px solid var(--accent); }
.tag-list .tc { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); min-width: 56px; text-align: right; }
.tag-list .unused { color: var(--accent); }
.tag-list .confirm { flex-basis: 100%; }
.ghost { border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: 8px; padding: 4px 8px; font-size: .8rem; font-weight: 600; }
.ghost:hover { background: var(--overlay); color: var(--ink); }

/* ---------- detail page ---------- */
.detail { position: fixed; inset: 0; z-index: 20; background: var(--paper); overflow-y: auto; overscroll-behavior: contain;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px));
  animation: rise .42s var(--ease); }
@keyframes rise { from { transform: translateY(24px); opacity: .4; } }
.d-in { max-width: 1180px; margin: 0 auto; padding-block: 14px 64px; }
.d-bar { display: flex; align-items: center; gap: 8px; padding-block: 6px 16px; position: sticky; top: 0; z-index: 2; background: linear-gradient(var(--paper) 75%, transparent); }
.d-bar .crumb { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.d-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 28px; align-items: start; }
.sheet { --bg: var(--st-spark); background: var(--bg); color: var(--note-ink); border-radius: 6px 6px 28px 6px; padding: clamp(24px, 4vw, 48px); box-shadow: var(--shadow-hi); position: relative; }
.sheet[data-stage="published"] { color: var(--published-ink); }
.sheet .row { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--f-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.sheet h1 { margin: 14px 0 14px; font-family: var(--f-display); font-weight: 700; letter-spacing: -.035em; line-height: 1; font-size: clamp(2rem, 1.3rem + 2.8vw, 3.6rem); text-wrap: balance; outline: none; border-radius: 6px; }
.sheet h1:focus { box-shadow: 0 0 0 2px currentColor; }
.sheet .summary { width: 100%; border: 0; background: rgb(255 255 255 / .28); border-radius: 12px; padding: 12px 14px; font-size: 1.05rem; resize: vertical; min-height: 70px; line-height: 1.5; color: inherit; }
.sheet[data-stage="published"] .summary, .sheet[data-stage="published"] .field textarea { background: rgb(128 128 128 / .16); }
.sheet section { margin-top: 26px; }
.sheet h4 { margin: 0 0 8px; font-family: var(--f-mono); font-weight: 500; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.field textarea { width: 100%; border: 0; background: rgb(255 255 255 / .28); border-radius: 12px; padding: 10px 14px; resize: vertical; min-height: 52px; line-height: 1.55; color: inherit; }
.raw { font-family: var(--f-display); font-size: 1.15rem; font-style: italic; border-left: 3px solid currentColor; padding-left: 14px; margin: 0; opacity: .85; }
.side { display: grid; gap: 16px; position: sticky; top: 64px; }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.stepper button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; border-radius: 12px; padding: 7px 8px; cursor: pointer; text-align: left; font-weight: 500; transition: background .15s; }
.stepper button:hover { background: var(--raised); }
.stepper .sw { width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0; display: grid; place-items: center; font-size: .7rem; color: var(--note-ink); }
.stepper .done .sw::after { content: "✓"; }
.stepper .done { color: var(--muted); }
.stepper .cur, .stepper .cur:hover { background: var(--ink); color: var(--paper); }
.stepper small { margin-left: auto; font-family: var(--f-mono); font-size: .68rem; opacity: .7; }
.lbl { display: block; font-family: var(--f-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.lbl.gap { margin-top: 14px; }
.inp { width: 100%; border: 1px solid var(--overlay); background: var(--paper); border-radius: 12px; padding: 9px 12px; }
.link-row { display: flex; gap: 8px; } .link-row .inp { min-width: 0; }
.link-row a { display: grid; place-items: center; padding: 0 14px; border-radius: 12px; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; white-space: nowrap; }
.link-row a[aria-disabled="true"] { opacity: .3; pointer-events: none; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; font-size: .86rem; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--c, var(--overlay)); }
.timeline time { display: block; font-family: var(--f-mono); font-size: .68rem; color: var(--muted); }
.add-note { display: grid; gap: 8px; margin-bottom: 14px; }
.add-note textarea { min-height: 64px; resize: vertical; }
.nav-hint { font-family: var(--f-mono); font-size: .68rem; color: var(--muted); text-align: center; }

/* quick add */
.quick { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgb(10 10 9 / .45); padding: 16px; }
.quick form { width: min(520px, 100%); background: var(--st-spark); color: var(--note-ink); border-radius: 6px 6px 24px 6px; padding: 26px; box-shadow: var(--shadow-hi); rotate: -1.5deg; animation: rise .3s var(--ease); display: grid; gap: 12px; }
.quick h3 { margin: 0; font-family: var(--f-display); font-size: 1.5rem; letter-spacing: -.02em; }
.quick textarea { min-height: 120px; border: 0; border-radius: 12px; padding: 12px; background: rgb(255 255 255 / .45); color: var(--note-ink); resize: vertical; }
.quick .acts { display: flex; justify-content: flex-end; gap: 8px; }
.quick .btn { background: rgb(255 255 255 / .55); color: var(--note-ink); } .quick .btn.primary { background: var(--note-ink); color: #fff; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; z-index: 40; background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .88rem; animation: rise .24s var(--ease); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) { .admin-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 960px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; max-height: none; overflow: visible; }
  .rail .panel:not(.journey-panel) { display: none; }
  .journey-panel { padding: 12px; border-radius: 18px; }
  .journey-panel h2, .journey-panel .sub { display: none; }
  .journey { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .journey::before { display: none; }
  .step, .step.sep { grid-template-columns: auto auto; padding: 6px 12px 6px 6px; width: auto; white-space: nowrap; margin: 0; border: 0; border-radius: 999px; }
  .step small, .step .bar { display: none; }
  .dot { width: 28px; height: 28px; border-radius: 50%; margin: 0; }
  .d-grid { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; order: 2; }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; } .search { order: 5; flex-basis: 100%; max-width: none; }
  .search kbd, .top .btn.primary span { display: none; }
  .wall { columns: 2 150px; column-gap: 12px; }
  .note { padding: 22px 14px 14px; margin-bottom: 12px; } .note h3 { font-size: 1.08rem; } .note.quote h3, .note.big h3 { font-size: 1.22rem; }
  .note p, .note ul, .note .key { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- live-site additions ---------- */
.loading { padding: 64px 0; text-align: center; color: var(--muted); font-family: var(--f-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.empty code { font-family: var(--f-mono); background: var(--raised); padding: 1px 6px; border-radius: 6px; }
.empty p { margin: 8px auto 0; max-width: 46ch; }
.quick form[aria-busy="true"] { opacity: .75; pointer-events: none; }
.quick .status { margin: 0; font-size: .85rem; min-height: 1.3em; }
.danger-zone { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: .85rem; }
.toast.error { background: var(--accent); color: var(--accent-ink); }
.links { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.links a { color: inherit; word-break: break-all; }

/* ---------- detail pickers: series (single) + tags (multi, Admin list only) ---------- */
.picker-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.picker-head.gap { margin-top: 18px; }
.picker-head .lbl { margin: 0; }
.picker-link { font-size: .78rem; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 6px; padding: 2px 6px; }
.picker-link:hover { background: var(--raised); color: var(--ink); }
.picker-empty { margin: 0; font-size: .84rem; color: var(--muted); }
.picker-empty a { color: var(--ink); }

.series-pick { display: grid; gap: 6px; }
.spick { --c: var(--muted); display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  border: 1.5px solid var(--overlay); background: var(--paper); border-radius: 14px; padding: 7px 12px 7px 7px;
  font-weight: 600; font-size: .9rem; transition: border-color .15s, background .15s, transform .15s var(--ease); }
.spick:hover { border-color: var(--c); transform: translateX(2px); }
.spick-emo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; font-size: 1rem;
  background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
.spick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spick-check { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; background: var(--c); color: var(--surface); }
.spick[aria-checked="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.spick[aria-checked="true"] .spick-emo { background: var(--c); }

.tag-find { padding: 7px 12px; font-size: .86rem; margin-bottom: 8px; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; max-height: 168px; overflow-y: auto; padding: 2px; }
.tpick { border: 1.5px dashed var(--overlay); background: none; border-radius: 999px; padding: 4px 11px; cursor: pointer;
  font-family: var(--f-mono); font-size: .76rem; color: var(--muted); transition: background .15s, color .15s, border-color .15s; }
.tpick:hover { border-color: var(--ink); color: var(--ink); }
.tpick[aria-pressed="true"] { border-style: solid; border-color: var(--ink); background: var(--ink); color: var(--paper); }
