/* ═══════════════════════════════════════════════════════════════════
   Louveterie — design system
   Two themes. Dark: near-black and warm grey-brown ink. Light: parchment,
   gilt, Versailles. Everything is a token; components never hard-code
   a colour.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── faces (self-hosted, subset to Latin) ───────────────────────── */
@font-face { font-family: 'Wolfsburg';      src: url(/assets/fonts/wolfsburg.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Les Bridgetise'; src: url(/assets/fonts/lesbridgetise.woff2) format('woff2'); font-style: normal; font-display: swap; }
@font-face { font-family: 'Les Bridgetise'; src: url(/assets/fonts/lesbridgetise-italic.woff2) format('woff2'); font-style: italic; font-display: swap; }
@font-face { font-family: 'EB Garamond';    src: url(/assets/fonts/ebgaramond.woff2) format('woff2'); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'EB Garamond';    src: url(/assets/fonts/ebgaramond-italic.woff2) format('woff2'); font-weight: 400 800; font-style: italic; font-display: swap; }

/* ─── tokens ─────────────────────────────────────────────────────── */
:root {
  --display: 'Wolfsburg', 'Bodoni Moda', 'Didot', Georgia, serif;
  --script:  'Les Bridgetise', 'Snell Roundhand', cursive;
  --text:    'EB Garamond', Garamond, Georgia, 'Times New Roman', serif;
  --measure: 40rem;
  --rail:    4.5rem;      /* width of the avatar rail */
  --gutter:  16px;
  --radius:  2px;
  --ease:    180ms ease;
}

/* dark (default) */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --paper:    #0b0a09;
  --paper-2:  #12100e;
  --paper-3:  #1a1714;
  --ink:      #cfc6b8;
  --ink-2:    #8f877c;
  --ink-3:    #55504a;
  --line:     #262220;
  --line-2:   #35302b;
  --accent:   #b08d4a;   /* gilt */
  --accent-2: #8b1e1e;   /* blood */
  --accent-ink: #f2e9dc;
  --shadow:   0 1px 0 rgba(255,255,255,.02), 0 12px 40px rgba(0,0,0,.5);
  --ornament-opacity: .35;
  --unread: #b3262e;   /* blood, for night */
}

/* light: Versailles */
:root[data-theme="light"] {
  color-scheme: light;
  --paper:    #f4ecdc;
  --paper-2:  #ede2cc;
  --paper-3:  #e4d6b9;
  --ink:      #2b2219;
  --ink-2:    #6b5a46;
  --ink-3:    #a3906f;
  --line:     #d8c8a4;
  --line-2:   #c6b287;
  --accent:   #8f6f22;
  --accent-2: #7a1717;
  --accent-ink: #f4ecdc;
  --shadow:   0 1px 0 rgba(255,255,255,.6), 0 12px 40px rgba(80,60,20,.12);
  --ornament-opacity: .6;
  --unread: #2ab3a6;   /* French turquoise, for day */
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --paper:#f4ecdc; --paper-2:#ede2cc; --paper-3:#e4d6b9;
    --ink:#2b2219; --ink-2:#6b5a46; --ink-3:#a3906f;
    --line:#d8c8a4; --line-2:#c6b287;
    --accent:#8f6f22; --accent-2:#7a1717; --accent-ink:#f4ecdc;
    --shadow:0 1px 0 rgba(255,255,255,.6), 0 12px 40px rgba(80,60,20,.12);
    --ornament-opacity:.6; --unread:#2ab3a6;
  }
}

/* ─── base ───────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font: 18px/1.65 var(--text); -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; transition: background var(--ease), color var(--ease); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0 0 .4em; letter-spacing: .03em; text-rendering: optimizeLegibility; }
/* Wolfsburg's hairlines break up on light paper at small sizes; a quarter-pixel stroke steadies them. */
:root[data-theme="light"] :is(h1, h2, h3, h4, .wordmark, .entry .who, .list .title, .scene-row .title, .char-card .name) { -webkit-text-stroke: .25px currentColor; }
h1 { font-size: 3rem; }
h2 { font-size: 2.1rem; }
h3 { font-size: 1.55rem; }
h4 { font-size: 1.2rem; color: var(--ink-2); }
.script { font-family: var(--script); font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--accent); }
.script.big { font-size: 1.9rem; line-height: 1.2; }
p { margin: 0 0 1em; }
em { font-style: italic; }
small, .dim { color: var(--ink-2); }
.faint { color: var(--ink-3); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* chrome: small caps tracking */
.caps { font-family: var(--text); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }

/* ornaments */
.rule { display: flex; align-items: center; gap: 1rem; color: var(--ink-3); margin: 2rem 0; }
.rule::before, .rule::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.rule svg { width: 18px; height: 18px; fill: var(--accent); opacity: var(--ornament-opacity); }
.fleur { width: 1em; height: 1em; fill: currentColor; vertical-align: -.15em; }

/* ─── masthead ───────────────────────────────────────────────────── */
.masthead {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 2.2rem;
  padding: .9rem var(--gutter); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
}
.wordmark { font-family: var(--display); font-weight: 400; font-size: 1.35rem; letter-spacing: .42em; text-transform: uppercase; }
.masthead nav { display: flex; gap: 1.4rem; align-items: center; }
.masthead nav a { color: var(--ink-2); border-bottom: 1px solid transparent; padding-bottom: 2px; transition: color var(--ease), border-color var(--ease); }
.masthead nav a:hover, .masthead nav a[aria-current] { color: var(--ink); border-color: var(--accent); }
.masthead .account { margin-left: auto; gap: 1.1rem; }
.masthead .me { display: flex; align-items: center; gap: .55rem; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: .95rem; }
.masthead .me img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); }
.theme-toggle { background: none; border: 1px solid var(--line); color: var(--ink-2); width: 30px; height: 30px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.theme-toggle:hover { border-color: var(--accent); color: var(--ink); }
.theme-toggle svg { width: 14px; height: 14px; fill: currentColor; }

/* ─── page frames ────────────────────────────────────────────────── */
.page { flex: 1; width: 100%; max-width: 62rem; margin: 0 auto; padding: 3rem var(--gutter) 5rem; }
.colophon { padding: 1.6rem var(--gutter); border-top: 1px solid var(--line); color: var(--ink-3); font-size: .8rem; display: flex; gap: .7rem; justify-content: center; }
.colophon a:hover { color: var(--ink); }
.prose { max-width: var(--measure); }
/* Long words wrap and hyphenate; unbroken strings break anywhere rather than overflow. */
.prose, .entry .body, .ccard, .seeking-card, .premise, .scene-banner { overflow-wrap: anywhere; word-break: break-word; hyphens: auto; }
.prose p { margin-bottom: 1.25em; }
.prose p + p { text-indent: 1.5em; margin-top: -1.1em; }

/* ─── the rail: stacked, vertical, avatars on a line ─────────────── */
.rail { position: relative; padding-left: var(--rail); min-width: 0; }
.rail::before {
  content: ''; position: absolute; left: calc(var(--rail) / 2); top: 0; bottom: 0;
  border-left: 1px solid var(--line-2);
}
.entry { position: relative; padding: 1.4rem 0 2.2rem 1.6rem; }
.entry + .entry { border-top: 1px solid var(--line); }
.entry .avatar {
  position: absolute; left: calc(var(--rail) / -2 - 22px); top: 1.4rem;
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--line-2);
  background: var(--paper-3);
}
.entry .avatar.ring { box-shadow: 0 0 0 1px var(--accent); }
.entry .byline { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; margin-bottom: .5rem; }
.entry .who { font-family: var(--display); font-size: 1.6rem; font-weight: 400; letter-spacing: .02em; }
.entry .who small { font-family: var(--text); font-size: .85rem; color: var(--ink-2); margin-left: .4rem; }
.entry .when { color: var(--ink-3); font-size: .8rem; letter-spacing: .06em; }
.entry .body { max-width: var(--measure); min-width: 0; }
.entry .body p:last-child { margin-bottom: 0; }
.entry .actions { display: flex; gap: 1.4rem; margin-top: 1rem; color: var(--ink-3); font-size: .8rem; letter-spacing: .08em; }
.entry .actions a:hover { color: var(--accent); }
.entry.ooc .body { color: var(--ink-2); font-style: italic; border-left: 2px solid var(--line-2); padding-left: 1rem; }
.entry.narrator .who { color: var(--ink-2); font-style: italic; }
.entry.narrator .avatar { border-radius: var(--radius); }

/* ─── cards & lists ──────────────────────────────────────────────── */
.card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem; }
.card.raised { box-shadow: var(--shadow); }
.list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.list > a, .list > div { background: var(--paper); padding: 1.1rem 1.3rem; display: grid; grid-template-columns: 1fr auto; gap: .2rem 1.5rem; align-items: baseline; transition: background var(--ease); }
.list > a:hover { background: var(--paper-2); }
.list .title { font-family: var(--display); font-size: 1.6rem; letter-spacing: .02em; }
.list .sub { color: var(--ink-2); font-size: .9rem; grid-column: 1; }
.list .aside { color: var(--ink-3); font-size: .8rem; text-align: right; letter-spacing: .06em; }
.section-title { display: flex; align-items: baseline; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; margin: 0 0 1.5rem; }
.section-title h2 { margin: 0; }
.section-title .count { color: var(--ink-3); font-size: .9rem; }
.section-title .action { margin-left: auto; color: var(--ink-2); }
.section-title .action:hover { color: var(--accent); }

.tag { display: inline-block; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line-2); padding: .15rem .55rem; border-radius: 1px; }
.tag.gilt { color: var(--accent); border-color: var(--accent); }
.tag.blood { color: var(--accent-2); border-color: var(--accent-2); }
.tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.badge { display: inline-block; font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); padding: .1rem .5rem; vertical-align: middle; }
.badge.quiet { color: var(--ink-3); border-color: var(--line-2); }
.badge.open { color: #6f9a6f; border-color: #6f9a6f; }

/* ─── forms & buttons ────────────────────────────────────────────── */
form.sheet { max-width: var(--measure); display: grid; gap: 1.5rem; }
.field { display: grid; gap: .45rem; }
.field .label { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.field input[type=text], .field input[type=url], .field input[type=number], .field textarea, .field select {
  width: 100%; background: var(--paper-2); color: var(--ink); border: 1px solid var(--line);
  padding: .7rem .9rem; font: inherit; border-radius: var(--radius); transition: border-color var(--ease);
}
.field textarea { min-height: 9rem; resize: vertical; line-height: 1.6; }
.field :is(input, textarea, select):focus { outline: none; border-color: var(--accent); }
.field .hint { color: var(--ink-3); font-size: .85rem; }
.field input[type=color] { width: 3rem; height: 2rem; border: 1px solid var(--line); background: none; padding: 0; }
.btn, button.btn {
  display: inline-block; font-family: var(--text); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  background: none; color: var(--ink); border: 1px solid var(--line-2); padding: .75rem 1.3rem; cursor: pointer;
  border-radius: var(--radius); transition: border-color var(--ease), background var(--ease), color var(--ease);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn.danger:hover { border-color: var(--accent-2); color: var(--accent-2); }
.btn.small { padding: .45rem .9rem; font-size: .66rem; }
.notice { border-left: 2px solid var(--accent); padding: .6rem 1rem; color: var(--ink-2); margin-bottom: 2rem; background: var(--paper-2); }
.notice.error { border-left-color: var(--accent-2); }

/* ─── profile: card left, characters right, sections below ──────── */
.profile { max-width: 62rem; margin: 0 auto; }
.profile-top { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.profile-card {
  position: sticky; top: 5rem;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2rem 1.5rem 1.6rem; text-align: center; display: grid; justify-items: center; gap: .55rem;
}
.profile-card::before { content: ''; display: block; width: 100%; height: 3px; background: var(--user-accent, var(--accent)); margin: -2rem 0 1.2rem; }
.profile-card img.avatar {
  width: 132px; height: 132px; border-radius: 50%; object-fit: cover; margin-bottom: .6rem;
  box-shadow: 0 0 0 1px var(--line-2), 0 0 0 5px var(--paper-2), 0 0 0 6px var(--user-accent, var(--accent));
}
.profile-card h1 { margin: 0; font-size: 2.2rem; letter-spacing: .05em; line-height: 1.05; }
.profile-card .handle { color: var(--ink-2); }
.profile-card .handle .sep { color: var(--ink-3); }
.profile-card .badges { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; margin: .3rem 0 .4rem; }
.profile-card .facts { margin: .4rem 0 0; padding: .9rem 0 0; border-top: 1px solid var(--line); width: 100%; display: grid; gap: .45rem; color: var(--ink-2); }
.profile-card .facts div { display: flex; justify-content: space-between; gap: 1rem; }
.profile-card .facts dt { color: var(--ink-3); }
.profile-card .facts dd { margin: 0; text-align: right; }
.profile-card .card-actions { margin-top: 1rem; }
.profile-main { display: grid; gap: 2.4rem; }
.profile-about .prose { max-width: 38rem; }
.profile-characters .section-title { margin-top: .2rem; }
.profile-section { max-width: 44rem; margin: 0 auto 3rem; }
.profile-section .prose { max-width: none; }

.scene-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.scene-row { background: var(--paper); padding: 1rem 1.3rem; display: grid; grid-template-columns: 1fr auto; gap: .2rem 1.5rem; align-items: baseline; transition: background var(--ease); }
a.scene-row:hover { background: var(--paper-2); }
.scene-row .title { font-family: var(--display); font-size: 1.5rem; letter-spacing: .02em; }
.scene-row .sub { color: var(--ink-2); font-size: .9rem; grid-column: 1; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.scene-row .aside { color: var(--ink-3); font-size: .78rem; text-align: right; letter-spacing: .08em; text-transform: uppercase; }
.scene-row.private .title { color: var(--ink-3); font-style: italic; }

.seeking-list { display: grid; gap: 1rem; }
.seeking-card h3 { margin-bottom: .1em; }
.seeking-card p { margin: .5rem 0 0; }
.seeking-card:hover { border-color: var(--accent); }

.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.6rem 1.4rem; }
.char-card { display: grid; gap: .45rem; align-content: start; text-align: center; justify-items: center; }
.char-card .portrait { width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--paper-3); box-shadow: 0 0 0 1px var(--line-2); overflow: hidden; transition: box-shadow var(--ease); }
.char-card .portrait img { width: 100%; height: 100%; object-fit: cover; }
.char-card .name { font-family: var(--display); font-size: 1.45rem; line-height: 1.1; }
.char-card .epithet { font-size: 1.1rem; line-height: 1.2; }
.char-card .tag { justify-self: start; }
.char-card:hover .portrait { box-shadow: 0 0 0 1px var(--line-2), 0 0 0 5px var(--paper), 0 0 0 6px var(--accent); }
.empty { color: var(--ink-3); font-style: italic; }

/* ─── landing ────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 5rem 0 3rem; position: relative; }
.hero-title { letter-spacing: .45em; text-transform: uppercase; font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 400; margin-bottom: 1.2em; }
.hero-line { max-width: 34em; margin: 0 auto 2.4rem; font-style: italic; color: var(--ink-2); font-size: 1.1rem; }
.hero .landscape {
  margin: 2.5rem auto 0; max-width: 48rem; aspect-ratio: 1500 / 730; opacity: var(--ornament-opacity);
  background: var(--ink);
  -webkit-mask: url(/assets/img/landscape.png) center / contain no-repeat;
          mask: url(/assets/img/landscape.png) center / contain no-repeat;
}

@media (max-width: 640px) {
  html { font-size: 17px; }
  .masthead { gap: .8rem 1.2rem; flex-wrap: wrap; }
  .masthead .account { margin-left: 0; width: 100%; }
  .profile-top { grid-template-columns: 1fr; }
  .profile-card { position: static; }
  :root { --rail: 3.4rem; }
  .entry .avatar { width: 36px; height: 36px; left: calc(var(--rail) / -2 - 18px); }
}

/* ─── landscape: the right half of the cutout, fixed bottom-right ── */
body.with-landscape { position: relative; }
body.with-landscape::before {
  content: ''; position: fixed; right: 0; bottom: 0; z-index: 0; pointer-events: none;
  width: min(52vw, 780px); aspect-ratio: 750 / 730;
  background: var(--ink); opacity: calc(var(--ornament-opacity) * .18);
  /* left half of the image, its cut edge tucked against the window edge */
  -webkit-mask: url(/assets/img/landscape.png) 0% 100% / 200% auto no-repeat;
          mask: url(/assets/img/landscape.png) 0% 100% / 200% auto no-repeat;
}
body.with-landscape.custom::before {
  aspect-ratio: var(--landscape-ratio, 1);
  width: min(44vw, 640px);
  -webkit-mask: var(--landscape) right bottom / contain no-repeat;
          mask: var(--landscape) right bottom / contain no-repeat;
}
body.with-landscape .masthead, body.with-landscape .page, body.with-landscape .colophon, body.with-landscape .guide, body.with-landscape .board, body.with-landscape .scene { position: relative; z-index: 1; }
/* landscape presets: pickers and admin */
.landscape-pick { display: flex; flex-wrap: wrap; gap: .6rem; }
.landscape-opt { position: relative; cursor: pointer; display: grid; gap: .3rem; justify-items: center; width: 96px; font-size: .62rem; color: var(--ink-2); }
.landscape-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.landscape-opt .thumb, .landscape-card .thumb { display: block; width: 96px; height: 72px; background: var(--ink); opacity: .55; -webkit-mask: var(--landscape) center bottom / contain no-repeat; mask: var(--landscape) center bottom / contain no-repeat; transition: opacity var(--ease); }
.landscape-opt:hover .thumb { opacity: .8; }
.landscape-opt input:checked ~ .thumb { opacity: 1; background: var(--accent); }
.landscape-opt input:checked ~ .caps { color: var(--ink); }
.landscape-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.landscape-card { display: grid; gap: .5rem; padding: .8rem; border: 1px solid var(--line); background: var(--paper-2); }
.landscape-card .thumb.big { width: 100%; height: 120px; }
.landscape-card .inline-form { display: flex; gap: .4rem; }
.landscape-card .inline-form input[type=text] { flex: 1; min-width: 0; }

/* ─── settings ──────────────────────────────────────────────────── */
.settings { max-width: 62rem; margin: 0 auto; display: grid; grid-template-columns: 17rem 1fr; gap: 2.5rem; align-items: start; }
.settings-aside { position: sticky; top: 5rem; text-align: center; display: grid; justify-items: center; gap: .6rem; padding: 2rem 1.5rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); }
.settings-aside img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line-2), 0 0 0 5px var(--paper-2), 0 0 0 6px var(--user-accent, var(--accent)); margin-bottom: .4rem; }
.settings-aside p { font-size: .9rem; color: var(--ink-2); margin: 0; }
.settings-aside a { color: var(--ink); border-bottom: 1px solid var(--line-2); }
.settings-aside a:hover { border-color: var(--accent); color: var(--accent); }
.settings form.sheet { max-width: 40rem; }
.settings h1 { margin-bottom: 1.4rem; }
.field.inline { grid-template-columns: auto 1fr; align-items: center; gap: 1rem; }
@media (max-width: 800px) { .settings { grid-template-columns: 1fr; } .settings-aside { position: static; } }

/* ─── patron mark ───────────────────────────────────────────────── */
.patron-mark { color: var(--accent); display: inline-block; vertical-align: -.05em; }
.patron-mark .fleur { width: .8em; height: .8em; }

/* ─── character repo ────────────────────────────────────────────── */
.repo-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.new-char summary { list-style: none; cursor: pointer; display: grid; gap: .45rem; justify-items: center; }
.new-char summary::-webkit-details-marker { display: none; }
.new-char summary { align-content: center; width: 100%; aspect-ratio: 1; gap: .7rem; }
.plus-mark { font-family: var(--text); font-weight: 700; font-size: 4.5rem; line-height: 1; color: var(--ink-3); transition: color var(--ease); display: block; height: 1em; }
.new-label { font-family: var(--text); font-size: .7rem; color: var(--ink-3); transition: color var(--ease); }
.new-char:hover .plus-mark { color: var(--accent); }
.new-char:hover .new-label { color: var(--accent); }
.new-char:hover .portrait.plus { color: var(--accent); }
.new-char[open] { grid-column: 1 / -1; }
.new-char[open] summary { display: none; }
.new-char-form { margin: 0 auto; padding: 1.5rem; background: var(--paper-2); border: 1px solid var(--line); text-align: left; justify-items: stretch; }

/* ─── character page ────────────────────────────────────────────── */
.character { max-width: 66rem; margin: 0 auto; }
.edit-bar { display: flex; gap: 1.2rem; align-items: center; color: var(--ink-2); margin-bottom: 1.6rem; }
.edit-bar a { color: var(--accent); border-bottom: 1px solid var(--accent); }
.char-top { display: grid; grid-template-columns: 18rem minmax(0, 1fr); gap: 3rem; align-items: start; }
.char-sidebar { position: sticky; top: 5rem; display: grid; gap: .7rem; align-content: start; max-height: calc(100vh - 6rem); overflow-y: auto; scrollbar-width: none; padding-bottom: 1rem; }
.char-sidebar::-webkit-scrollbar { display: none; }
.editing .char-sidebar { position: static; max-height: none; overflow: visible; }
.honours { margin-top: .5rem; padding-top: .7rem; border-top: 1px solid var(--line); text-align: center; }
.honours .label { color: var(--ink-3); margin-bottom: .35rem; }
.char-portrait { width: 100%; aspect-ratio: 4 / 5; background: var(--paper-3); border: 1px solid var(--line); box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--accent); overflow: hidden; margin-bottom: .6rem; }
.char-portrait img { width: 100%; height: 100%; object-fit: cover; }
.char-head { display: grid; gap: .15rem; margin-bottom: .2rem; }
.char-sidebar h1 { font-size: 2.6rem; margin: 0; line-height: 1; }
.char-sidebar .tagline { margin: .2rem 0 0; font-style: italic; }
.played-by { margin: 0; }
.played-by a { color: var(--ink); border-bottom: 1px solid var(--line-2); }
.played-by a:hover { color: var(--accent); border-color: var(--accent); }
.char-sidebar .facts { margin: .8rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); display: grid; gap: .4rem; color: var(--ink-2); }
.char-sidebar .facts div { display: flex; justify-content: space-between; gap: 1rem; }
.char-sidebar .facts dt { color: var(--ink-3); }
.char-sidebar .facts dd { margin: 0; text-align: right; color: var(--ink); }
.seals { display: flex; flex-wrap: wrap; justify-content: center; gap: .15rem .3rem; }
.seal { position: relative; width: 28px; height: 28px; display: grid; place-items: center; color: var(--accent); cursor: default; outline: none; transition: transform var(--ease), filter var(--ease); }
.seal svg { width: 22px; height: 22px; fill: currentColor; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.seal:hover, .seal:focus-visible { transform: translateY(-3px); filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); z-index: 3; }
.seal.tinted { color: var(--seal-1); }
.seal .tip { position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translate(-50%, 4px); min-width: 140px; max-width: 230px; padding: .5rem .75rem; background: var(--paper-2); color: var(--ink); border: 1px solid var(--line-2); font-family: var(--text); font-size: .82rem; line-height: 1.3; text-align: center; border-radius: 2px; box-shadow: 0 6px 18px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity var(--ease), transform var(--ease); display: grid; gap: .05rem; white-space: normal; }
.seal .tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--line-2); }
.seal .tip b { font-family: var(--display); font-weight: normal; font-size: 1rem; letter-spacing: .03em; }
.seal .tip small { color: var(--ink-3); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; margin-top: .2rem; }
.seal:hover .tip, .seal:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }


.char-cards { display: grid; gap: 3rem; min-width: 0; }
.ccard { position: relative; }
.ccard.private { opacity: .75; }
.ccard .section-title { margin-bottom: 1.2rem; }
.ccard .prose { max-width: none; overflow-wrap: anywhere; }
.epigraph { margin: 0; padding: 0 0 0 1.2rem; border-left: 2px solid var(--accent); line-height: 1.3; }
.readon summary { list-style: none; cursor: pointer; }
.readon summary::-webkit-details-marker { display: none; }
.readon summary p:last-of-type { display: inline; }
.readon-label { display: inline-block; margin-left: .6rem; color: var(--accent); border-bottom: 1px solid var(--accent); }
.readon[open] summary { display: none; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.gallery-item { position: relative; margin: 0; cursor: zoom-in; background: var(--paper-3); border: 1px solid var(--line); overflow: hidden; }
.gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: transform 300ms ease; }
.gallery-item:hover img { transform: scale(1.03); }
.gallery-item figcaption { padding: .5rem .7rem; font-size: .85rem; color: var(--ink-2); line-height: 1.35; }
.gallery-item.mature:not(.unveiled) img { filter: blur(18px) saturate(.6); transform: scale(1.1); }
.gallery-item.locked img { filter: blur(28px) saturate(.3); }
.gallery-item.locked { cursor: default; }
.gallery-item .veil a { color: var(--accent); }
.nsfw-locked { overflow: hidden; }
.nsfw-locked img, img.nsfw-locked { filter: blur(14px) saturate(.3) !important; transform: scale(1.15); }
.gallery-item .veil { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink); background: rgba(0,0,0,.25); text-align: center; padding: 1rem; }
.gallery-item.unveiled .veil { display: none; }
.img-tools { position: absolute; top: .4rem; right: .4rem; display: flex; align-items: center; gap: .7rem; white-space: nowrap; font-size: .62rem; letter-spacing: .1em; background: color-mix(in srgb, var(--paper) 88%, transparent); padding: .3rem .6rem; border: 1px solid var(--line); }
.img-tools .linkish, .img-tools .dim { font-size: inherit; letter-spacing: inherit; }
.char-portrait.editable { position: relative; }
.portrait-change { position: absolute; inset: auto 0 0 0; padding: .55rem; background: color-mix(in srgb, var(--paper) 88%, transparent); border: 0; border-top: 1px solid var(--line); color: var(--ink); font-size: .68rem; letter-spacing: .14em; cursor: pointer; opacity: 0; transform: translateY(100%); transition: opacity var(--ease), transform var(--ease); }
.char-portrait.editable:hover .portrait-change, .char-portrait.editable:focus-within .portrait-change { opacity: 1; transform: none; }
.modal .sheet { max-width: none; padding: 2rem 2.2rem 2.2rem; display: grid; gap: 1.3rem; }
.modal .sheet > form { display: grid; gap: .8rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.modal .sheet > form:first-of-type { border-top: 0; padding-top: 0; }
.focal-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 1rem; align-items: start; }
.focal-pick { position: relative; cursor: crosshair; background: var(--paper-3); border: 1px solid var(--line); user-select: none; touch-action: none; }
.focal-pick img { display: block; width: 100%; max-height: 50vh; object-fit: contain; pointer-events: none; }
.focal-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px rgba(0,0,0,.3); pointer-events: none; }
.focal-preview { width: 120px; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--accent); }
.focal-preview.portrait-shape { aspect-ratio: 4 / 5; }
.focal-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; }
.pick-item { position: relative; cursor: pointer; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); }
.pick-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.pick-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity var(--ease); }
.pick-item:hover img { opacity: .8; }
.pick-item input:checked + img { outline: 3px solid var(--accent); outline-offset: -3px; }
.layout-broadsheet .gallery { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.lightbox[hidden] { display: none; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(6,5,4,.94); display: grid; place-items: center; grid-template-rows: 1fr auto; }
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; grid-row: 1; }
.lightbox button { position: absolute; background: none; border: 0; color: #cfc6b8; font-family: var(--display); font-size: 3rem; cursor: pointer; padding: 1rem; opacity: .6; }
.lightbox button:hover { opacity: 1; }
.lb-close { top: .5rem; right: 1rem; }
.lb-prev { left: .5rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .5rem; top: 50%; transform: translateY(-50%); }
.lb-caption { grid-row: 2; padding: .8rem 1rem 1.4rem; color: #8f877c; font-style: italic; text-align: center; }

/* record */
.record-stats { display: flex; flex-wrap: wrap; gap: .6rem 2rem; margin: 0 0 1.4rem; color: var(--ink-2); }
.record-stats div { display: flex; gap: .6rem; align-items: baseline; }
.record-stats dt { color: var(--ink-3); }
.record-stats dd { margin: 0; color: var(--ink); font-family: var(--display); font-size: 1.4rem; }

/* editing chrome */
.ccard-tools { position: absolute; right: 0; top: -.2rem; display: flex; gap: 1rem; align-items: center; color: var(--ink-3); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; letter-spacing: inherit; text-transform: inherit; }
.linkish:hover { color: var(--accent); }
.linkish.danger:hover { color: var(--accent-2); }
.linkish[disabled] { color: var(--accent); cursor: default; }
.edit-block { border: 1px dashed var(--line-2); padding: .8rem 1rem; margin-top: 1rem; }
.edit-block summary { cursor: pointer; color: var(--ink-2); }
.edit-block[open] summary { margin-bottom: 1rem; }
.edit-block form.sheet { gap: 1rem; }
.facts-note { margin: -0.4rem 0 1rem; font-style: italic; }
.facts-form { gap: 1.6rem; }
.facts-group { border: 1px solid var(--line); padding: 1.1rem 1.3rem 1.3rem; margin: 0; min-width: 0; }
.facts-group[hidden] { display: none; }
.facts-group legend { color: var(--ink-2); padding: 0 .5rem; }
.facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.6rem; align-items: start; }
.facts-grid .field { grid-template-rows: auto auto auto; align-content: start; gap: .35rem; }
.facts-grid .field .label { line-height: 1.2; }
.facts-grid .field :is(input, select) { height: 2.75rem; padding-top: 0; padding-bottom: 0; line-height: 2.75rem; }
.facts-grid .field select { line-height: normal; }
.facts-grid .hint { font-size: .78rem; line-height: 1.3; }
.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.kind-opt { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; align-items: baseline; padding: .9rem 1rem; border: 1px solid var(--line); cursor: pointer; transition: border-color var(--ease); }
.kind-opt:hover { border-color: var(--line-2); }
.kind-opt:has(input:checked) { border-color: var(--accent); }
.kind-opt input { accent-color: var(--accent); }
.kind-opt .kind-name { font-family: var(--display); font-size: 1.35rem; }
.kind-opt .hint { grid-column: 2; }
.add-card { display: flex; gap: 1.2rem; align-items: center; justify-content: center; color: var(--ink-3); margin: 1.6rem 0 2.4rem; padding: .5rem 0; position: relative; }
.add-card::before, .add-card::after { content: ''; flex: 1; border-top: 1px dashed var(--line-2); }
.editing .ccard { padding: 1.4rem 1.2rem 1.2rem; border: 1px solid var(--line); background: var(--paper-2); border-radius: var(--radius); }
.editing .ccard .ccard-tools { right: 1.2rem; top: .6rem; }
.editing .char-cards { gap: 0; }
.guide.editing .guide-body .ccard { margin-bottom: 0; }
.add-card span { font-family: var(--display); font-size: 1.6rem; }
.danger-zone { border-color: color-mix(in srgb, var(--accent-2) 50%, transparent); }
.field input[type=file] { color: var(--ink-2); font-size: .9rem; }
.field input[type=checkbox] { width: 1rem; height: 1rem; accent-color: var(--accent); }

@media (max-width: 800px) {
  .char-top { grid-template-columns: 1fr; gap: 2rem; }
  .char-sidebar { position: static; }
  .char-portrait { max-width: 18rem; }
  .facts-grid, .kind-pick { grid-template-columns: 1fr; }
}

/* ─── boards (scenes, seeking) ───────────────────────────────────── */
.board { max-width: 66rem; margin: 0 auto; }
.board-head { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 2.2rem; }
.board-head h1 { margin: 0; }
.plus { width: 3.2rem; height: 3.2rem; border-radius: 50%; border: 1px solid var(--accent); background: none; color: var(--accent); font-family: var(--display); font-size: 2.4rem; line-height: 1; display: grid; place-items: center; cursor: pointer; transition: background var(--ease), color var(--ease); }
.plus span { transform: translateY(-2px); }
.plus:hover { background: var(--accent); color: var(--accent-ink); }
.board-cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
.board-col { min-width: 0; }
.byline-mini { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--ink-2); margin-bottom: .4rem; }
.byline-mini img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.byline-mini .faint { margin-left: auto; font-size: .8rem; }
.seeking-card .prose { margin-top: .5rem; }
.seeking-foot { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: 1rem; color: var(--ink-2); align-items: center; }
.seeking-foot a:hover { color: var(--accent); }
.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; max-width: 66rem; margin: 3rem auto 0; align-items: start; }
.hero.compact { padding: 2.5rem 0 0; }
.hero.compact .hero-title { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: .8em; }
.hero.compact .hero-line { font-size: 1rem; margin-bottom: 1rem; }

/* ─── modal ─────────────────────────────────────────────────────── */
.modal { border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); padding: 0; width: min(46rem, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); box-shadow: var(--shadow); border-radius: var(--radius); }
.modal::backdrop { background: rgba(6,5,4,.78); backdrop-filter: blur(4px); }
.modal form.sheet { max-width: none; padding: 2rem 2.2rem 2.2rem; gap: 1.3rem; }
.modal-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: .8rem; }
.modal-head h2 { margin: 0; }
.modal-head .linkish { font-family: var(--display); font-size: 2rem; line-height: 1; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.4rem; }
.modal-foot { display: flex; gap: .8rem; padding-top: .4rem; }
.vis-pick { border: 0; padding: 0; margin: 0; display: grid; gap: .6rem; }
.vis-pick legend { color: var(--ink-2); margin-bottom: .5rem; }
.vis-opt { display: grid; grid-template-columns: auto 1fr; gap: .1rem .7rem; align-items: baseline; padding: .7rem .9rem; border: 1px solid var(--line); cursor: pointer; }
.vis-opt .kind-name { font-family: var(--display); font-size: 1.25rem; }
.vis-opt .hint { grid-column: 2; }
.vis-opt:has(input:checked) { border-color: var(--accent); }
.vis-opt.disabled { opacity: .55; cursor: not-allowed; }
.vis-opt.disabled a { color: var(--accent); border-bottom: 1px solid var(--accent); }
.identity-row { display: flex; gap: 1.4rem; align-items: end; flex-wrap: wrap; }
.identity-row .field { flex: 1 1 14rem; }
.check { display: inline-flex; gap: .45rem; align-items: center; padding-bottom: .7rem; color: var(--ink-2); font-size: .95rem; }
.check input { accent-color: var(--accent); width: 1rem; height: 1rem; }

/* ─── scene page ────────────────────────────────────────────────── */
.scene { max-width: 66rem; margin: 0 auto; }
.scene-head { margin-bottom: 2.5rem; }
.scene-where { margin-bottom: .3rem; }
.scene-head h1 { margin-bottom: .1em; }
.premise { max-width: var(--measure); font-style: italic; margin: .6rem 0 0; }
.scene-meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.scene-meta a { border-bottom: 1px solid var(--line-2); }
.scene-banner { margin-top: 1rem; border-left: 2px solid var(--accent); padding: .5rem 1rem; color: var(--ink-2); font-style: italic; max-width: var(--measure); }
.scene-body { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 3rem; align-items: start; }
.scene-side { position: sticky; top: 5rem; }
.writers { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: .5rem; font-size: .95rem; }
.writers li { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.writers a:hover { color: var(--accent); }
.post-epithet { margin: -.3rem 0 .6rem; }
.entry .when { color: var(--ink-3); }
.entry .when:hover { color: var(--accent); }
.post-edit { margin-top: .8rem; }
.post-edit summary { color: var(--ink-3); cursor: pointer; list-style: none; }
.post-edit summary::-webkit-details-marker { display: none; }
.post-edit summary:hover { color: var(--accent); }
.post-edit[open] summary { margin-bottom: .8rem; }
.entry.compose form.sheet { max-width: var(--measure); gap: 1rem; }
.entry.compose .avatar { border-radius: 50%; }
@media (max-width: 800px) {
  .board-cols, .home-cols, .modal-grid { grid-template-columns: 1fr; }
  .scene-body { grid-template-columns: 1fr; }
  .scene-side { position: static; }
}

.scene-list.compact .scene-row { padding: .7rem 1rem; }
.scene-list.compact .scene-row .title { font-size: 1.2rem; }
.scene-list.compact .scene-row .sub { font-size: .82rem; }
.dl { color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.dl:hover { color: var(--accent); border-color: var(--accent); }

/* ─── full lists ────────────────────────────────────────────────── */
.narrow-board { max-width: 52rem; }
.list-switch { margin-left: auto; display: flex; gap: 1.2rem; }
.list-switch a { color: var(--ink-2); border-bottom: 1px solid transparent; }
.list-switch a:hover, .list-switch a[aria-current] { color: var(--ink); border-color: var(--accent); }
.filters { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.6rem; }
.filters input[type=search], .filters select { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); padding: .5rem .7rem; font: inherit; font-size: .95rem; border-radius: var(--radius); }
.filters input[type=search] { flex: 1 1 12rem; }
.filters :is(input, select):focus { outline: none; border-color: var(--accent); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.pager a { color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.pager a:hover { color: var(--accent); border-color: var(--accent); }

/* ─── unread ribbon ─────────────────────────────────────────────── */
.scene-row { position: relative; }
.scene-row .ribbon {
  position: absolute; top: -1px; right: 1.1rem; width: 11px; height: 26px;
  background: var(--unread);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.scene-row.unread .title { padding-right: 1.6rem; }

/* ─── admin ─────────────────────────────────────────────────────── */
.admin { max-width: 70rem; margin: 0 auto; display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.admin-nav { display: grid; gap: .6rem; position: sticky; top: 5rem; }
.admin-nav a { color: var(--ink-2); padding: .3rem 0; border-left: 2px solid transparent; padding-left: .8rem; }
.admin-nav a:hover, .admin-nav a[aria-current] { color: var(--ink); border-color: var(--accent); }
.admin-body h1 { margin-bottom: 1.4rem; }
.admin-stats { margin-bottom: 2.5rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .95rem; margin-bottom: 2.5rem; }
.admin-table th { text-align: left; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: .4rem .6rem; border-bottom: 1px solid var(--line-2); font-weight: normal; }
.admin-table td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table .actions { white-space: nowrap; }
.admin-table details summary { cursor: pointer; color: var(--ink-2); list-style: none; }
.inline-form { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; flex-wrap: wrap; }
.inline-form select, .inline-form input[type=text] { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); padding: .35rem .5rem; font: inherit; font-size: .9rem; }
.crud-form { max-width: 34rem; }
.swatch { display: inline-block; width: .9em; height: .9em; border-radius: 2px; vertical-align: -.1em; margin-right: .4em; border: 1px solid var(--line-2); }
.btn.danger { border-color: var(--accent-2); color: var(--accent-2); }
@media (max-width: 800px) { .admin { grid-template-columns: 1fr; } .admin-nav { position: static; display: flex; flex-wrap: wrap; gap: 1rem; } }

/* ─── guide ─────────────────────────────────────────────────────── */
.guide { max-width: 70rem; margin: 0 auto; display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3.5rem; align-items: start; }
.guide-rail { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow-y: auto; scrollbar-width: none; font-size: .95rem; }
.guide-rail::-webkit-scrollbar { display: none; }
.rail-title { margin-bottom: .8rem; }
.guide-rail ul { list-style: none; margin: 0; padding: 0; }
.guide-rail ul ul { padding-left: .9rem; }
.guide-rail li { margin: 0; }
.guide-rail > ul > li > a { font-family: var(--display); font-size: 1.25rem; letter-spacing: .02em; }
.guide-rail a { display: block; padding: .25rem 0 .25rem .8rem; color: var(--ink-2); border-left: 1px solid var(--line); transition: color var(--ease), border-color var(--ease); }
.guide-rail a:hover { color: var(--ink); }
.guide-rail li.current > a { color: var(--ink); border-left: 2px solid var(--accent); padding-left: calc(.8rem - 1px); }
.guide-rail ul.cards a { font-size: .85rem; color: var(--ink-3); }
.guide-rail ul.cards a.active { color: var(--accent); }
.rail-admin { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.rail-admin a { border-left: 0; padding-left: 0; color: var(--accent); }
.guide-rail .edit-block { margin-top: .8rem; font-size: .9rem; }
.guide-body { min-width: 0; }
.guide-head { margin-bottom: 2.5rem; }
.guide-head h1 { margin-bottom: .1em; }
.guide-body .ccard { margin-bottom: 3rem; }
.guide-children { margin-top: 3rem; }
.plates { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.plate { margin: 0; cursor: zoom-in; background: var(--paper-3); border: 1px solid var(--line); position: relative; }
.plate.wide { grid-column: 1 / -1; }
.plate img { width: 100%; display: block; }
.plate.wide img { max-height: 70vh; object-fit: cover; }
.plate figcaption { padding: .5rem .7rem; font-size: .85rem; color: var(--ink-2); font-style: italic; }
.stud-group { color: var(--ink-2); margin: 1.2rem 0 1rem; }
.stud { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 1.5rem; }
.stud-entry { background: var(--paper); padding: 1.3rem 1.5rem; display: grid; grid-template-columns: 1fr; gap: .4rem; }
.line-visual { margin: .6rem 0 0; }
.line-visual img { width: 100%; max-width: 26rem; display: block; border: 1px solid var(--line); }
.line-visual figcaption { font-size: .85rem; color: var(--ink-3); margin-top: .35rem; }
.line-more { margin-top: .5rem; }
.line-more summary { cursor: pointer; color: var(--ink-2); list-style: none; }
.line-more summary::-webkit-details-marker { display: none; }
.line-more summary::before { content: "+ "; color: var(--accent); }
.line-more[open] summary::before { content: "− "; }
.line-more summary:hover { color: var(--accent); }
.line-more .line-visual { margin-top: .8rem; }
.swatch-row { display: flex; flex-wrap: wrap; gap: .1rem .4rem; margin: .1rem 0 .3rem; }
.swatch-stroke { display: inline-block; width: 5.2rem; height: 1.1rem; background: var(--fill); -webkit-mask: var(--brush) center / contain no-repeat; mask: var(--brush) center / contain no-repeat; }
.swatch-admin { display: grid; gap: .3rem; margin-bottom: 1rem; }
.swatch-admin-row { display: flex; align-items: center; gap: 1rem; }
.swatch-admin-row form { margin-left: auto; }
.visual-admin { display: grid; gap: .3rem; font-size: .75rem; }
.visual-admin img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); }
.visual-admin .caps { display: flex; gap: .6rem; }
.stud-entry h4 { font-size: 1.6rem; color: var(--ink); margin: 0; }
.stud-entry h4 .script { font-size: 1.2rem; }
.stud-entry .facts { display: flex; gap: .4rem 1.6rem; flex-wrap: wrap; color: var(--ink-2); margin: .2rem 0 .4rem; }
.stud-entry .facts div { display: flex; gap: .5rem; }
.stud-entry .facts dt { color: var(--ink-3); }
.stud-entry .facts dd { margin: 0; }
.stud-entry .prose { max-width: 40rem; }
.eras { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.era-entry { background: var(--paper); padding: 1.3rem 1.5rem; display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .3rem 1.5rem; align-items: baseline; }
.era-entry.closed { opacity: .7; }
.era-entry h4 { font-size: 1.6rem; color: var(--ink); margin: 0; }
.era-entry .era-years { font-size: 1.5rem; }
.era-entry .prose { grid-column: 2; }
@media (max-width: 800px) {
  .guide { grid-template-columns: 1fr; gap: 2rem; }
  .guide-rail { position: static; max-height: none; }
  .era-entry { grid-template-columns: 1fr; }
  .era-entry .prose { grid-column: 1; }
}

.patron-nudge { margin-left: auto; display: inline-flex; align-items: center; gap: .5rem; color: var(--ink-2); font-size: .8rem; letter-spacing: 0; text-transform: none; }
.patron-nudge .fleur { width: 1em; height: 1em; color: var(--accent); }
.patron-nudge:hover { color: var(--accent); }

.recent-chars > a { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: .8rem; row-gap: 0; padding: .55rem .9rem; }
.recent-chars .mini-portrait { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--paper-3); box-shadow: 0 0 0 1px var(--line-2); }
.recent-chars .mini-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recent-chars .title { grid-column: 2; grid-row: 1; font-size: 1.15rem; line-height: 1.15; align-self: end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-chars .sub { grid-column: 2; grid-row: 2; font-size: .78rem; line-height: 1.3; align-self: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-chars .aside { grid-column: 3; grid-row: 1 / 3; align-self: center; }
.new-char[open] { grid-column: 1 / -1; }

/* admin colour pickers and swatches */
.colour-pick { display: flex; align-items: center; gap: .8rem; }
.colour-pick input[type="color"] { width: 44px; height: 30px; padding: 2px; border: 1px solid var(--line-2); background: var(--paper); border-radius: 2px; cursor: pointer; }
.colour-pick .inline-check { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--ink-2); }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line-2); vertical-align: middle; }

/* glyph picker (admin) */
.glyph-pick { display: flex; flex-wrap: wrap; gap: .35rem; padding: .5rem; border: 1px solid var(--line); background: var(--paper-2); }
.glyph-pick label { position: relative; cursor: pointer; }
.glyph-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.glyph-pick .seal { width: 40px; height: 40px; border-radius: 3px; border: 1px solid transparent; transition: border-color var(--ease), background var(--ease); }
.glyph-pick .seal svg { width: 28px; height: 28px; }
.glyph-pick label:hover .seal { background: var(--paper); border-color: var(--line-2); }
.glyph-pick input:checked + .seal { background: var(--paper); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); transform: none; }
.glyph-pick input:focus-visible + .seal { outline: 2px solid var(--accent); outline-offset: 1px; }
.admin-table .seal { width: 26px; height: 26px; }
.admin-table .seal svg { width: 20px; height: 20px; }

.publish-bar { display: flex; align-items: center; gap: 1rem; margin: .4rem 0 1rem; padding: .5rem .8rem; border: 1px solid var(--line); background: var(--paper-2); }
.publish-bar form { display: flex; align-items: center; gap: 1rem; }
.publish-bar .spaced { margin-left: auto; }

/* tag picker */
.tag-pick { display: grid; gap: .5rem; padding: .6rem .8rem; border: 1px solid var(--line); background: var(--paper-2); }
.tag-group { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .4rem; }
.tag-group > .caps { min-width: 4.5rem; font-size: .7rem; }
.tag-chip { position: relative; cursor: pointer; }
.tag-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.tag-chip span { display: inline-block; padding: .15rem .6rem; border: 1px solid var(--line-2); border-radius: 999px; font-size: .8rem; color: var(--ink-2); transition: all var(--ease); }
.tag-chip:hover span { border-color: var(--accent); color: var(--ink); }
.tag-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.tag-chip.nsfw input:checked + span { background: var(--accent-2); border-color: var(--accent-2); }
.tag-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.tag.blood { border-color: var(--accent-2); color: var(--accent-2); }

.admin-table td.danger { color: var(--accent-2); }

.move-form { display: inline-flex; gap: .15rem; margin-right: .5rem; }
.move-form .linkish { font-size: .95rem; line-height: 1; padding: 0 .15rem; }

/* ─── support / patronage ───────────────────────────────────────── */
.support { max-width: 62rem; margin: 0 auto; }
.support-head { margin-bottom: 2rem; }
.support-head h1 { margin: 0; }
.support-cols { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: 3rem; align-items: start; margin-bottom: 3rem; }
.perks { list-style: none; margin: 1.2rem 0; padding: 0; display: grid; gap: .6rem; }
.perks li { display: flex; gap: .7rem; align-items: baseline; }
.perks svg { width: 14px; height: 14px; flex: none; fill: var(--accent); transform: translateY(2px); }
.support-buy { border: 1px solid var(--line); background: var(--paper-2); padding: 1.5rem; display: grid; gap: 1.3rem; }
.support-buy .status { display: grid; gap: .2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.support-buy .status strong { font-family: var(--display); font-weight: normal; font-size: 1.5rem; }
.support-buy form.sheet { gap: 1.1rem; max-width: none; }
.cur-switch { display: flex; gap: .3rem; }
.cur-switch label { position: relative; cursor: pointer; }
.cur-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cur-switch span { display: inline-block; padding: .3rem .8rem; border: 1px solid var(--line-2); color: var(--ink-2); }
.cur-switch input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tiers { display: grid; gap: .5rem; }
.tier { position: relative; display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; padding: .8rem 1rem; border: 1px solid var(--line-2); background: var(--paper); cursor: pointer; transition: border-color var(--ease); }
.tier input { position: absolute; opacity: 0; width: 0; height: 0; }
.tier .months { font-family: var(--display); font-size: 1.35rem; }
.tier .price { font-family: var(--display); font-size: 1.35rem; color: var(--accent); text-align: right; }
.tier .hint { grid-column: 1 / -1; }
.tier:hover { border-color: var(--accent); }
.tier:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
@media (max-width: 860px) { .support-cols { grid-template-columns: 1fr; } }
