/* ─────────────────────────────────────────────────────────────────────
   The Woven Life — stylesheet
   Everything is scoped under #wl-root so nothing here can touch the
   rest of Crux, and nothing in app.css can leak in.
   Fonts are self-hosted (public/fonts/woven-life/, SIL Open Font
   Licence) — no request ever goes to Google.
   ───────────────────────────────────────────────────────────────────── */

@font-face { font-family: 'WL Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/woven-life/fraunces-latin-opsz-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'WL Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/woven-life/fraunces-latin-ext-opsz-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'WL Fraunces'; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url(/fonts/woven-life/fraunces-latin-opsz-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: 'WL Newsreader'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(/fonts/woven-life/newsreader-latin-opsz-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'WL Newsreader'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(/fonts/woven-life/newsreader-latin-ext-opsz-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'WL Newsreader'; font-style: italic; font-weight: 200 800; font-display: swap;
  src: url(/fonts/woven-life/newsreader-latin-opsz-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: 'WL Newsreader'; font-style: italic; font-weight: 200 800; font-display: swap;
  src: url(/fonts/woven-life/newsreader-latin-ext-opsz-italic.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'WL Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/woven-life/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'WL Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/woven-life/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'WL Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/woven-life/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); }

/* ── Tokens ─────────────────────────────────────────────────────────── */
#wl-root {
  --wl-bg: #F4EFE6; --wl-ink: #1C1813; --wl-text: #2A251E; --wl-muted: #5E564B; --wl-faint: #6A6154;
  --wl-line: #D8CDBA; --wl-card: #FBF8F2; --wl-soft: #EAE1D0; --wl-chip: #E6DCCB;
  --wl-accent: #2F4275; --wl-on-accent: #FFFFFF; --wl-thread: #A4462F; --wl-dim: #857C6E;
  --wl-ai-bg: #E6E9F1; --wl-ai-fg: #2A2F3D; --wl-ai-label: #2F4275;
  --wl-pill: #221E18; --wl-on-pill: #F4EFE6; --wl-review-bg: #E7DDF0; --wl-review-fg: #4A3A66;
  --wl-danger: #9B2C1F;
  --wl-display: 'WL Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --wl-serif: 'WL Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --wl-sans: 'WL Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --wl-pad: 56px;
}
#wl-root[data-wl-theme="dark"] {
  --wl-bg: #16130F; --wl-ink: #F3ECDF; --wl-text: #E3DACA; --wl-muted: #B9AE9B; --wl-faint: #A89E8C;
  --wl-line: #3A342B; --wl-card: #1F1B16; --wl-soft: #2A221B; --wl-chip: #2F2821;
  --wl-accent: #A9BAEB; --wl-on-accent: #16130F; --wl-thread: #E08A6D; --wl-dim: #938978;
  --wl-ai-bg: #1E2433; --wl-ai-fg: #D5DBEA; --wl-ai-label: #A9BAEB;
  --wl-pill: #ECE4D4; --wl-on-pill: #16130F; --wl-review-bg: #2F2740; --wl-review-fg: #D3C4EC;
  --wl-danger: #F0A08F;
}

/* ── Shell ──────────────────────────────────────────────────────────── */
#wl-root {
  position: fixed; inset: 0; z-index: 2000; display: none;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  background: var(--wl-bg); color: var(--wl-text);
  font-family: var(--wl-serif); font-size: 18px; line-height: 1.5;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
#wl-root.wl-open { display: block; }
/* Resets use :where() so they carry zero specificity: every component
   rule below wins over them without needing an id in its selector. */
:where(#wl-root) *, :where(#wl-root) *::before, :where(#wl-root) *::after { box-sizing: border-box; }
:where(#wl-root) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(#wl-root) button { cursor: pointer; }
:where(#wl-root) :focus-visible { outline: 2px solid var(--wl-accent); outline-offset: 3px; border-radius: 6px; }
:where(#wl-root) a { color: var(--wl-accent); text-decoration: underline; text-underline-offset: 3px; }
:where(#wl-root) :where(h1, h2, h3, p) { margin: 0; }
html.wl-lock, html.wl-lock body { overflow: hidden !important; }

.wl-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Top bar ────────────────────────────────────────────────────────── */
.wl-bar {
  position: sticky; top: 0; z-index: 5; height: 72px; padding: 0 var(--wl-pad);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--wl-bg); border-bottom: 1px solid var(--wl-line); font-family: var(--wl-sans);
}
.wl-back { height: 44px; display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0;
  font-size: 14px; font-weight: 500; color: var(--wl-muted); }
.wl-back:hover { color: var(--wl-ink); }
.wl-bar-actions { display: flex; align-items: center; gap: 10px; }
.wl-icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--wl-line); background: var(--wl-card);
  color: var(--wl-muted); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wl-icon-btn:hover { color: var(--wl-ink); }
.wl-btn { height: 44px; padding: 0 20px; border-radius: 22px; border: 1px solid var(--wl-line); background: transparent;
  color: var(--wl-ink); font-family: var(--wl-sans); font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.wl-btn:hover { border-color: var(--wl-muted); }
.wl-btn-primary { border: 0; background: var(--wl-accent); color: var(--wl-on-accent); }
.wl-btn-primary:hover { filter: brightness(1.08); }
.wl-btn-danger { border-color: var(--wl-danger); color: var(--wl-danger); }
.wl-btn[disabled] { opacity: .5; cursor: default; }

/* ── Masthead ───────────────────────────────────────────────────────── */
.wl-mast { padding: 72px var(--wl-pad) 40px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.wl-mast-kicker { font-family: var(--wl-sans); font-size: 13px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--wl-faint); }
.wl-mast h1 { font-family: var(--wl-display); font-weight: 300; font-size: clamp(56px, 9vw, 112px); line-height: 1; letter-spacing: -.02em;
  color: var(--wl-ink); font-variation-settings: 'opsz' 144; }
.wl-mast-stats { font-size: 20px; font-style: italic; color: var(--wl-muted); }
.wl-mast-stats button { border: 0; background: none; padding: 0; font-style: italic; color: var(--wl-accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── Filter bar ─────────────────────────────────────────────────────── */
.wl-filters { margin: 0 var(--wl-pad); padding: 18px 0; border-top: 1px solid var(--wl-line); border-bottom: 1px solid var(--wl-line);
  display: flex; align-items: center; justify-content: space-between; gap: 20px; font-family: var(--wl-sans); }
.wl-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.wl-pill { height: 40px; padding: 0 18px; border-radius: 20px; border: 1px solid var(--wl-line); background: transparent;
  color: var(--wl-text); font-size: 14px; font-weight: 500; }
.wl-pill[aria-pressed="true"] { background: var(--wl-pill); border-color: var(--wl-pill); color: var(--wl-on-pill); }
.wl-search { display: flex; align-items: center; gap: 10px; height: 44px; width: 320px; flex-shrink: 0; padding: 0 16px;
  border: 1px solid var(--wl-line); border-radius: 22px; background: var(--wl-card); color: var(--wl-faint); }
.wl-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--wl-ink); }
.wl-search:focus-within { border-color: var(--wl-accent); }

/* ── Home layout ────────────────────────────────────────────────────── */
.wl-home { padding: 48px var(--wl-pad) 120px; display: flex; gap: 64px; }
.wl-rail { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 36px; font-family: var(--wl-sans); }
.wl-rail-h { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--wl-faint); margin-bottom: 12px; }
.wl-years { display: flex; flex-direction: column; gap: 10px; }
.wl-year-link { border: 0; background: none; padding: 0; text-align: left; font-family: var(--wl-display); font-size: 22px; color: var(--wl-muted); }
.wl-year-link:hover { color: var(--wl-ink); }
.wl-year-link span { font-family: var(--wl-sans); font-size: 13px; color: var(--wl-faint); margin-left: 6px; }
.wl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wl-chip { min-height: 32px; padding: 6px 12px; border-radius: 16px; border: 0; background: var(--wl-chip); color: var(--wl-text); font-size: 13px; }
.wl-chip[aria-pressed="true"] { background: var(--wl-pill); color: var(--wl-on-pill); }
.wl-chapter-link { display: block; border: 0; background: none; padding: 0; text-align: left; margin-bottom: 12px;
  font-family: var(--wl-serif); font-size: 18px; line-height: 1.35; color: var(--wl-ink); }
.wl-chapter-link small { display: block; font-family: var(--wl-sans); font-size: 13px; color: var(--wl-faint); }
.wl-drafts-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; border-radius: 12px; border: 0;
  background: var(--wl-soft); color: var(--wl-text); font-size: 14px; text-align: left; }

.wl-timeline { flex: 1; min-width: 0; max-width: 860px; display: flex; flex-direction: column; }
.wl-result-line { margin-bottom: 28px; display: flex; align-items: center; gap: 14px; font-family: var(--wl-sans); font-size: 14px; color: var(--wl-muted); }
.wl-year { display: flex; align-items: baseline; gap: 20px; padding-bottom: 24px; scroll-margin-top: 96px; }
.wl-year h2 { font-family: var(--wl-display); font-weight: 300; font-size: 68px; line-height: 1; color: var(--wl-ink); }
.wl-year::after { content: ''; flex: 1; height: 1px; background: var(--wl-line); }

.wl-item { display: flex; gap: 26px; }
.wl-spine { width: 18px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.wl-dot { width: 11px; height: 11px; border-radius: 6px; margin-top: 12px; background: var(--wl-accent); border: 1.5px solid var(--wl-accent); }
.wl-dot-chapter { background: var(--wl-thread); border-color: var(--wl-thread); }
.wl-dot-locked { background: transparent; border-color: var(--wl-faint); }
.wl-spine::after { content: ''; width: 1.5px; flex: 1; background: var(--wl-line); }
.wl-item:last-child .wl-spine::after { display: none; }
.wl-card { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 0 0 44px; color: var(--wl-text);
  display: flex; flex-direction: column; gap: 9px; font-family: var(--wl-serif); }
.wl-card:hover .wl-card-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.wl-kicker { font-family: var(--wl-sans); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--wl-faint); }
.wl-card-title { display: flex; align-items: center; gap: 12px; font-family: var(--wl-display); font-size: 31px; font-weight: 400; line-height: 1.15; color: var(--wl-ink); }
.wl-card-summary { font-size: 20px; line-height: 1.55; }
.wl-card.wl-superseded .wl-card-title { color: var(--wl-dim); }
.wl-card.wl-superseded .wl-card-summary { color: var(--wl-faint); }
.wl-card-sealed { font-size: 18px; font-style: italic; color: var(--wl-muted); display: flex; align-items: center; gap: 10px; }
.wl-card-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-family: var(--wl-sans); font-size: 14px; color: var(--wl-faint); }
.wl-note { color: var(--wl-thread); }
.wl-badge { padding: 3px 10px; border-radius: 10px; background: var(--wl-review-bg); color: var(--wl-review-fg); font-size: 13px; }
.wl-more { margin: 8px 0 0 44px; align-self: flex-start; }

.wl-empty { padding: 72px 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.wl-empty p { font-size: 22px; font-style: italic; color: var(--wl-muted); max-width: 520px; }

/* ── Reading ────────────────────────────────────────────────────────── */
.wl-read { width: min(680px, calc(100% - 40px)); margin: 0 auto; padding: 80px 0 140px; display: flex; flex-direction: column; }
.wl-banner { margin-bottom: 40px; width: 100%; text-align: left; padding: 16px 20px; border-radius: 14px; border: 0; background: var(--wl-soft);
  display: flex; flex-direction: column; gap: 4px; font-family: var(--wl-serif); color: var(--wl-text); }
.wl-banner strong { font-family: var(--wl-sans); font-size: 13px; font-weight: 600; color: var(--wl-thread); }
.wl-banner span { font-size: 18px; }
.wl-read-kicker { font-family: var(--wl-sans); font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--wl-accent); }
.wl-read-kicker button { border: 0; background: none; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--wl-muted); }
.wl-read-kicker button:hover { color: var(--wl-ink); }
.wl-read h1 { margin-top: 22px; font-family: var(--wl-display); font-weight: 400; font-size: clamp(38px, 6vw, 58px); line-height: 1.06; letter-spacing: -.015em; color: var(--wl-ink); overflow-wrap: anywhere; }
.wl-dek { margin-top: 26px; font-size: clamp(20px, 2.6vw, 25px); line-height: 1.45; font-style: italic; color: var(--wl-muted); }
.wl-meta { margin-top: 34px; padding: 16px 0; border-top: 1px solid var(--wl-line); border-bottom: 1px solid var(--wl-line);
  display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-family: var(--wl-sans); font-size: 14px; color: var(--wl-muted); }

.wl-record { margin-top: 44px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 14px; background: var(--wl-soft); overflow: hidden; }
.wl-record > div { padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.wl-record > div + div { border-left: 1px solid var(--wl-line); }
.wl-record-h { font-family: var(--wl-sans); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--wl-muted); }
.wl-record-v { font-family: var(--wl-display); font-size: 23px; color: var(--wl-ink); overflow-wrap: anywhere; }
.wl-record-v.wl-quiet { color: var(--wl-muted); }
.wl-record small { font-family: var(--wl-sans); font-size: 13px; color: var(--wl-thread); }

.wl-body { margin-top: 44px; font-size: 22px; line-height: 1.72; color: var(--wl-text); overflow-wrap: break-word; }
.wl-body > * + * { margin-top: 26px; }
.wl-body > p:first-child::first-letter { float: left; font-family: var(--wl-display); font-weight: 300; font-size: 88px; line-height: .82;
  padding: 8px 12px 0 0; color: var(--wl-accent); }
.wl-body h2 { margin-top: 56px; font-family: var(--wl-display); font-weight: 600; font-size: 28px; line-height: 1.25; color: var(--wl-ink); }
.wl-body h3 { margin-top: 40px; font-family: var(--wl-display); font-weight: 600; font-size: 23px; color: var(--wl-ink); }
.wl-body h2 + *, .wl-body h3 + * { margin-top: 16px; }
.wl-body > h2:first-child, .wl-body > h3:first-child { margin-top: 12px; }
.wl-body ul, .wl-body ol { padding-left: 1.3em; margin-bottom: 0; }
.wl-body li + li { margin-top: 8px; }
.wl-body blockquote { margin-left: 0; margin-right: 0; padding-left: 22px; border-left: 2px solid var(--wl-line); font-style: italic; color: var(--wl-muted); }
.wl-body .wl-pull { margin: 56px 0 8px; padding: 0; border: 0; text-align: center; font-family: var(--wl-display); font-weight: 300;
  font-style: italic; font-size: 34px; line-height: 1.3; color: var(--wl-ink); }
.wl-body .wl-ai { padding: 22px 26px; border-radius: 14px; background: var(--wl-ai-bg); color: var(--wl-ai-fg); font-size: 20px; line-height: 1.6; }
.wl-body .wl-ai-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-family: var(--wl-sans); font-size: 13px; font-weight: 600; color: var(--wl-ai-label); }
.wl-body code { font-size: .85em; padding: 1px 6px; border-radius: 5px; background: var(--wl-soft); }
.wl-body hr { border: 0; height: 1px; background: var(--wl-line); margin: 48px 0; }
.wl-body .wl-inline-link { border: 0; background: none; padding: 0; font: inherit; color: var(--wl-accent); text-decoration: underline; text-underline-offset: 3px; }
.wl-body .wl-img-note { font-style: italic; color: var(--wl-faint); }

.wl-panel { margin-top: 48px; padding: 32px; border-radius: 16px; background: var(--wl-soft); display: flex; flex-direction: column; gap: 14px; font-family: var(--wl-sans); }
.wl-panel h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; color: var(--wl-ink); }
.wl-panel p { font-size: 15px; line-height: 1.55; color: var(--wl-muted); }
.wl-panel-center { align-items: center; text-align: center; }
.wl-panel-center h2 { font-family: var(--wl-display); font-weight: 400; font-size: 26px; }
.wl-panel-center p { font-family: var(--wl-serif); font-size: 19px; font-style: italic; }
.wl-pin-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.wl-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wl-field > label, .wl-field > .wl-field-label { font-family: var(--wl-sans); font-size: 13px; font-weight: 500; color: var(--wl-muted); }
.wl-input, .wl-select { height: 44px; padding: 0 12px; border: 1px solid var(--wl-line); border-radius: 10px; background: var(--wl-card);
  color: var(--wl-ink); font-family: var(--wl-sans); font-size: 15px; width: 100%; }
.wl-input:focus, .wl-select:focus { outline: 2px solid var(--wl-accent); outline-offset: 0; }
.wl-pin { width: 160px; font-size: 18px; letter-spacing: .3em; }
.wl-error-text { font-family: var(--wl-sans); font-size: 14px; color: var(--wl-danger); }

.wl-threads { margin-top: 80px; display: flex; flex-direction: column; gap: 16px; }
.wl-threads-h { display: flex; align-items: center; gap: 14px; font-family: var(--wl-sans); font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--wl-muted); }
.wl-thread { width: 100%; text-align: left; padding: 22px 26px; border-radius: 14px; border: 1px solid var(--wl-line); background: var(--wl-card);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--wl-ink); }
.wl-thread:hover { border-color: var(--wl-muted); }
.wl-thread > span { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wl-thread-label { font-family: var(--wl-sans); font-size: 13px; font-weight: 500; color: var(--wl-thread); }
.wl-thread-title { font-family: var(--wl-display); font-size: 23px; overflow-wrap: anywhere; }
.wl-thread-meta { font-family: var(--wl-sans); font-size: 13px; color: var(--wl-faint); }
.wl-quiet-text { font-size: 18px; font-style: italic; color: var(--wl-faint); }
.wl-provenance { margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--wl-line); display: flex; justify-content: space-between; gap: 8px 20px;
  flex-wrap: wrap; font-family: var(--wl-sans); font-size: 13px; color: var(--wl-faint); overflow-wrap: anywhere; }

/* ── Menu ───────────────────────────────────────────────────────────── */
.wl-menu-wrap { position: relative; }
.wl-menu { position: absolute; right: 0; top: 52px; min-width: 240px; padding: 8px; border-radius: 14px; border: 1px solid var(--wl-line);
  background: var(--wl-card); box-shadow: 0 12px 32px rgba(20, 16, 10, .16); display: flex; flex-direction: column; z-index: 10; }
.wl-menu button { text-align: left; border: 0; background: none; padding: 12px 14px; border-radius: 8px; font-family: var(--wl-sans); font-size: 15px; color: var(--wl-ink); }
.wl-menu button:hover { background: var(--wl-soft); }
.wl-menu .wl-menu-danger { color: var(--wl-danger); }

/* ── Writing ────────────────────────────────────────────────────────── */
.wl-write { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 140px; display: flex; flex-direction: column; gap: 22px; font-family: var(--wl-sans); }
.wl-write-status { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 13px; color: var(--wl-faint); }
.wl-write-status strong { font-weight: 600; letter-spacing: .16em; text-transform: uppercase; font-size: 13px; }
.wl-title-input { border: 0; outline: 0; background: transparent; padding: 0; width: 100%; font-family: var(--wl-display); font-weight: 400;
  font-size: clamp(36px, 5.5vw, 52px); line-height: 1.12; color: var(--wl-ink); }
.wl-dek-input { border: 0; outline: 0; background: transparent; padding: 0; width: 100%; font-family: var(--wl-serif); font-style: italic;
  font-size: 22px; color: var(--wl-muted); }
.wl-body-input { border: 0; outline: 0; background: transparent; padding: 0; width: 100%; min-height: 280px; resize: none; overflow: hidden;
  font-family: var(--wl-serif); font-size: 22px; line-height: 1.7; color: var(--wl-text); }
.wl-title-input::placeholder, .wl-dek-input::placeholder, .wl-body-input::placeholder { color: var(--wl-dim); }
.wl-hint { font-size: 13px; line-height: 1.5; color: var(--wl-faint); }
.wl-details { padding: 26px; border-radius: 16px; background: var(--wl-soft); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.wl-details-h { grid-column: 1 / -1; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--wl-faint); }
.wl-span2 { grid-column: 1 / -1; }
.wl-check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--wl-muted); }
.wl-check input { width: 18px; height: 18px; accent-color: var(--wl-accent); }
.wl-thread-edit { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--wl-card); font-size: 14px; }
.wl-thread-edit button { border: 0; background: none; color: var(--wl-danger); font-size: 13px; min-height: 36px; }
.wl-picker { display: flex; flex-direction: column; gap: 6px; }
.wl-picker-results { display: flex; flex-direction: column; border-radius: 10px; border: 1px solid var(--wl-line); background: var(--wl-card); overflow: hidden; }
.wl-picker-results button { text-align: left; border: 0; background: none; padding: 12px 14px; font-size: 14px; color: var(--wl-ink); }
.wl-picker-results button + button { border-top: 1px solid var(--wl-line); }
.wl-picker-results button:hover { background: var(--wl-soft); }
.wl-picker-results small { color: var(--wl-faint); margin-left: 6px; }
.wl-errors { padding: 18px 22px; border-radius: 14px; border: 1px solid var(--wl-danger); display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--wl-text); }
.wl-errors strong { color: var(--wl-danger); }
.wl-write-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.wl-write-actions > div { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Lists (drafts, settings) ───────────────────────────────────────── */
.wl-page { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 140px; display: flex; flex-direction: column; gap: 20px; font-family: var(--wl-sans); }
.wl-page h1 { font-family: var(--wl-display); font-weight: 300; font-size: clamp(40px, 6vw, 60px); line-height: 1.05; color: var(--wl-ink); }
.wl-page > p { font-family: var(--wl-serif); font-size: 20px; font-style: italic; color: var(--wl-muted); }
.wl-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--wl-line); background: var(--wl-card); }
.wl-row-main { border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.wl-row-title { font-family: var(--wl-display); font-size: 22px; color: var(--wl-ink); overflow-wrap: anywhere; }
.wl-row-meta { font-size: 13px; color: var(--wl-faint); }
.wl-status-list { display: flex; flex-direction: column; border-radius: 14px; border: 1px solid var(--wl-line); background: var(--wl-card); }
.wl-status-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; font-size: 15px; }
.wl-status-list > div + div { border-top: 1px solid var(--wl-line); }
.wl-status-list span:last-child { color: var(--wl-muted); text-align: right; overflow-wrap: anywhere; }
.wl-ok { color: #2F6B3F !important; }
#wl-root[data-wl-theme="dark"] .wl-ok { color: #9FD0A8 !important; }
.wl-report { font-size: 14px; line-height: 1.6; color: var(--wl-muted); display: flex; flex-direction: column; gap: 4px; }
.wl-segment { display: inline-flex; border: 1px solid var(--wl-line); border-radius: 22px; overflow: hidden; }
.wl-segment button { height: 42px; padding: 0 18px; border: 0; background: transparent; font-size: 14px; color: var(--wl-text); }
.wl-segment button[aria-pressed="true"] { background: var(--wl-pill); color: var(--wl-on-pill); }

/* ── Council ────────────────────────────────────────────────────────── */
.wl-textarea { height: auto; min-height: 44px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.wl-cs { gap: 24px; }
.wl-cs-question { font-family: var(--wl-display); font-weight: 400; font-size: clamp(30px, 4.5vw, 44px); line-height: 1.15; color: var(--wl-ink); overflow-wrap: anywhere; }
.wl-cs-section { display: flex; flex-direction: column; gap: 14px; padding-top: 28px; border-top: 1px solid var(--wl-line); }
.wl-cs-h { display: flex; align-items: center; gap: 12px; font-family: var(--wl-display); font-weight: 400; font-size: 26px; color: var(--wl-ink); }
.wl-cs-h span { width: 32px; height: 32px; border-radius: 16px; background: var(--wl-soft); display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--wl-sans); font-size: 14px; font-weight: 600; color: var(--wl-muted); flex-shrink: 0; }
.wl-cs-entries { display: flex; flex-direction: column; border-radius: 14px; border: 1px solid var(--wl-line); background: var(--wl-card); }
.wl-cs-entry { display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px; cursor: pointer; }
.wl-cs-entry + .wl-cs-entry { border-top: 1px solid var(--wl-line); }
.wl-cs-entry input { width: 20px; height: 20px; margin-top: 3px; flex-shrink: 0; accent-color: var(--wl-accent); }
.wl-cs-entry > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wl-cs-entry-title { font-family: var(--wl-display); font-size: 19px; color: var(--wl-ink); overflow-wrap: anywhere; }
.wl-cs-entry strong { font-weight: 600; color: var(--wl-text); }
.wl-cs-reason { font-size: 13px; color: var(--wl-thread); }
.wl-cs-role { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; cursor: pointer; }
.wl-cs-role input { width: 16px; height: 16px; accent-color: var(--wl-accent); }
.wl-cs-card { padding: 24px; border-radius: 16px; border: 1px solid var(--wl-line); background: var(--wl-card); display: flex; flex-direction: column; gap: 16px; }
.wl-cs-card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.wl-cs-card-h h3 { margin: 0; font-family: var(--wl-display); font-weight: 400; font-size: 24px; color: var(--wl-ink); }
.wl-cs-card-h p { margin: 4px 0 0; font-size: 14px; color: var(--wl-muted); }
.wl-cs-card-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.wl-cs-prompt { margin: 0; max-height: 360px; overflow: auto; padding: 16px 18px; border-radius: 12px; background: var(--wl-soft);
  font-family: var(--wl-sans); font-size: 13px; line-height: 1.55; color: var(--wl-text); white-space: pre-wrap; overflow-wrap: anywhere; }
.wl-cs-answer { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 640px) { .wl-cs-answer { grid-template-columns: 1fr; } .wl-cs-card { padding: 18px; } }

/* ── Dialog + toast ─────────────────────────────────────────────────── */
.wl-dialog-back { position: fixed; inset: 0; z-index: 2100; background: rgba(20, 16, 10, .45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.wl-dialog { width: min(480px, 100%); padding: 30px; border-radius: 18px; background: var(--wl-bg); color: var(--wl-text); display: flex; flex-direction: column; gap: 16px; font-family: var(--wl-sans); }
.wl-dialog h2 { font-family: var(--wl-display); font-weight: 400; font-size: 28px; color: var(--wl-ink); }
.wl-dialog p { font-size: 15px; line-height: 1.55; color: var(--wl-muted); }
.wl-dialog-actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.wl-toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 2200;
  max-width: calc(100% - 40px); padding: 14px 22px; border-radius: 24px; background: var(--wl-ink); color: var(--wl-bg);
  font-family: var(--wl-sans); font-size: 15px; box-shadow: 0 8px 24px rgba(20, 16, 10, .2); }
.wl-loading { padding: 120px 0; text-align: center; font-style: italic; color: var(--wl-faint); }

/* ── Crux sidebar entry ─────────────────────────────────────────────── */
.nitem[data-page="woven-life"] .nicon svg { width: 1em; height: 1em; }

.wl-mobile-only { display: none !important; }

/* ── Small screens ──────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  #wl-root { --wl-pad: 24px; }
  .wl-filters { flex-direction: column; align-items: stretch; }
  .wl-search { width: 100%; }
  .wl-home { flex-direction: column; gap: 40px; padding-top: 32px; }
  .wl-rail { width: auto; order: 2; }
  .wl-years { flex-direction: row; flex-wrap: wrap; gap: 16px; }
}
@media (max-width: 640px) {
  #wl-root { --wl-pad: 18px; font-size: 17px; }
  .wl-bar { height: 60px; }
  .wl-bar .wl-btn-label { display: none; }
  .wl-desktop-only { display: none !important; }
  .wl-mobile-only { display: block !important; }
  .wl-bar .wl-btn { padding: 0 14px; }
  .wl-mast { padding-top: 48px; }
  .wl-pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .wl-pill { flex-shrink: 0; }
  .wl-item { gap: 14px; }
  .wl-year h2 { font-size: 52px; }
  .wl-card-title { font-size: 26px; }
  .wl-card-summary { font-size: 18px; }
  .wl-read { padding-top: 40px; }
  .wl-body { font-size: 19px; }
  .wl-body > p:first-child::first-letter { font-size: 68px; }
  .wl-record { grid-template-columns: 1fr; }
  .wl-record > div + div { border-left: 0; border-top: 1px solid var(--wl-line); }
  .wl-details { grid-template-columns: 1fr; padding: 20px; }
  .wl-body-input { font-size: 19px; }
  .wl-thread { padding: 18px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  #wl-root * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ── Where the time went (figures from Crux) ───────────────────────── */
.wl-time { margin-top: 64px; display: flex; flex-direction: column; gap: 12px; }
.wl-time-lead { font-family: var(--wl-sans); font-size: 13px; color: var(--wl-faint); }
.wl-time-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--wl-line); }
.wl-time-bar .wl-tb-seg { min-width: 3px; display: flex; }
.wl-time-bar b { display: block; }
.wl-tb-light { opacity: .38; }
.wl-tb-key { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.wl-tb-key i { width: 14px; height: 8px; border-radius: 2px; background: var(--wl-muted); }
.wl-time-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--wl-sans); font-size: 13px; color: var(--wl-muted); }
.wl-time-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wl-time-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.wl-time-sentence { font-size: 19px; line-height: 1.55; color: var(--wl-text); }
.wl-link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--wl-accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wl-cs-time { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; background: var(--wl-soft); }

/* ── The Woven Life inside Chronicle ───────────────────────────────── */
/* Chronicle's own language: thin rules, small labels, no colour blocks. */
#wl-chr-strip { margin: 0 0 14px; padding: 10px 0 12px; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 12.5px; }
#wl-chr-strip:empty { display: none; }
.wl-chr-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text4, var(--text3)); }
.wl-chr-keep { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--border2); background: transparent; color: var(--text2); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.wl-chr-keep:hover { border-color: var(--text3); color: var(--text1); }
.wl-chr-item { border: 0; background: none; padding: 0; font-size: 12.5px; color: var(--text2); cursor: pointer; text-align: left; }
.wl-chr-item:hover { color: var(--text1); text-decoration: underline; text-underline-offset: 2px; }
.wl-chr-item em { font-style: normal; color: var(--text3); }
.wl-chr-letter { color: var(--text1); font-weight: 600; }
.wl-chr-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }

.wl-time-ctx { font-family: var(--wl-sans); font-size: 13px; color: var(--wl-muted); }
.wl-label-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; }
.wl-label-grid .wl-field > label { font-family: var(--wl-mono, monospace); letter-spacing: .04em; }
