/* Chronicle's styles, as written for Perchance, with the site edits the README lists: light only (the
   dark palette is gone), no styles for the developer chat or the developer tools, and the sign-in
   screen at the end. */
:root {
  --bg: #eceee9;
  --surface: #fbfcfa;
  --surface-2: #f2f4f0;
  --ink: #1c221f;
  --ink-soft: #39423d;
  --muted: #626d67;
  --line: #d7dcd5;
  --line-strong: #b9c1b8;
  --accent: #2b5c50;
  --accent-ink: #ffffff;
  --ribbon: #9b2d48;
  --ribbon-soft: #f4dde3;
  --danger: #a12f29;
  --focus: #1d6bb0;
  --star: #a86a00;
  --c0: #2e6a9a; --c1: #92406a; --c2: #5c7118; --c3: #955800;
  --c4: #4a4ea5; --c5: #1c7164; --c6: #7255a0; --c7: #a13a3a;
  /* Each section of Story and Settings has its own color: the box around it, and a very light fill of it */
  --k-premise: #2e6a9a; --k-canon: #1c7164; --k-places: #5c7118; --k-lore: #955800; --k-secrets: #53606d;
  --k-timeline: var(--ribbon); --k-meter: #69736e; --k-story: #2e6a9a; --k-memory: #7255a0; --k-reading: #ad5520;
  --k-account: #92406a; --k-calendar: #86449a; --k-earlier: #53606d;
  --tint: 10%;
  --serif: "Literata", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --clear: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --story: var(--clear); /* the story text: messages, the message box and timeline events. Settings can change it. */
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); text-align: left; -webkit-text-size-adjust: 100%; }
body[data-font="book"] { --story: var(--serif); }
body[data-font="device"] { --story: var(--sans); }
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 480px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 7px 12px; font-size: .88rem; line-height: 1.2; }
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.primary:hover:not(:disabled) { border-color: var(--accent); filter: brightness(1.06); }
.ghost { background: transparent; }
.small { padding: 5px 10px; font-size: .82rem; }
.danger { color: var(--danger); }
.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.icon { border: 0; background: none; color: var(--muted); padding: 3px 7px; font-size: 1rem; line-height: 1; border-radius: 6px; }
.icon:hover:not(:disabled) { color: var(--ink); background: var(--surface-2); }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font: inherit; text-align: left; }

input[type="text"], input[type="number"], input[type="password"], input:not([type]), select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px;
}
textarea { resize: vertical; line-height: 1.45; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }

/* Top bar */
.topbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.titlewrap { margin: 0; min-width: 0; font-size: 1rem; }
/* The story's title opens Your stories: switch, rename, start new ones and back them up */
.title-btn { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: calc(100% + 16px); margin: -4px -8px; padding: 4px 8px; border: 0; border-radius: 9px; background: none; color: var(--ink); text-align: left; }
.title-btn:hover { background: var(--surface-2); }
.title-caret { flex: none; width: 7px; height: 7px; margin-left: -2px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-2px) rotate(45deg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mark { flex: none; width: 11px; height: 19px; background: var(--ribbon); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%); }
.storytitle { margin: 0; font: 600 1.05rem/1.25 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { flex: none; display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.tab { position: relative; border: 0; background: none; color: var(--muted); padding: 5px 11px; border-radius: 999px; font-size: .86rem; font-weight: 500; }
.tab.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }
.tab .dot { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--ribbon); }
.top-right { flex: none; display: flex; align-items: center; gap: 6px; }
.tab-icon { display: none; width: 17px; height: 17px; fill: currentColor; vertical-align: -3px; }
.help-btn { flex: none; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink-soft); font: 600 .95rem/1 var(--sans); }
.help-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }
/* Explain mode: a thin bar says it's on, everything without an explanation dims, and the rest asks to be tapped */
.explain-bar { flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 5px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .86rem; color: var(--ink); }
.explain-bar[hidden] { display: none; }
.ex-dim { opacity: .32; }
body.explaining [data-explain] { cursor: help; }
.explain-text { margin: 4px 0 6px; line-height: 1.5; }
@media (max-width: 360px) {
  .top-right { gap: 4px; }
  .help-btn { width: 28px; height: 28px; }
  .tab { padding: 5px 6px; }
}
@media (max-width: 600px) {
  .tab-settings .tab-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tab-settings .tab-icon { display: inline-block; }
}
@media (max-width: 430px) {
  .topbar { padding: 8px 10px; gap: 6px; }
  .title-btn { gap: 6px; }
  .tab { padding: 5px 7px; font-size: .82rem; }
}

/* Layout: one panel at a time on phones, three columns on wide screens */
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.panel { min-height: 0; display: none; flex-direction: column; }
body[data-view="chat"] #chatPanel, body[data-view="cast"] #castPanel,
body[data-view="story"] #storyPanel, body[data-view="settings"] #settingsPanel { display: flex; }
@media (min-width: 900px) {
  .layout { grid-template-columns: 280px minmax(0, 1fr) 330px; }
  #castPanel { display: flex; grid-column: 1; grid-row: 1; border-right: 1px solid var(--line); }
  #storyPanel { display: flex; grid-column: 3; grid-row: 1; border-left: 1px solid var(--line); }
  #chatPanel, #settingsPanel { grid-column: 2; grid-row: 1; }
  #chatPanel { display: flex; }
  body[data-view="settings"] #chatPanel { display: none; }
  .mobile-only { display: none; }
}
@media (min-width: 1300px) { .layout { grid-template-columns: 300px minmax(0, 1fr) 380px; } }

.panel-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 6px; }
.panel-head h2 { margin: 0; font: 600 1rem/1.3 var(--sans); }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 28px; }
/* Each section is a box in its own color with a very light fill of it, so sections never run together */
.block { margin: 12px 0 0; padding: 12px 14px 14px; border: 4px solid var(--sec, var(--line-strong)); border-radius: 12px; background: var(--surface); background: color-mix(in srgb, var(--sec, var(--line-strong)) var(--tint), var(--surface)); }
.block:first-child { margin-top: 4px; }
.k-premise { --sec: var(--k-premise); }
.k-canon { --sec: var(--k-canon); }
.k-places { --sec: var(--k-places); }
.k-lore { --sec: var(--k-lore); }
.k-secrets { --sec: var(--k-secrets); }
.k-timeline { --sec: var(--k-timeline); }
.k-meter { --sec: var(--k-meter); }
.k-story { --sec: var(--k-story); }
.k-memory { --sec: var(--k-memory); }
.k-reading { --sec: var(--k-reading); }
.k-account { --sec: var(--k-account); }
.k-calendar { --sec: var(--k-calendar); }
/* A Story section folds to its heading and one line about it: an empty one by itself, any of them when you tap its name. */
.block.folded { padding-top: 10px; padding-bottom: 11px; }
.block.folded h3 { margin: 0; }
.fold-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; border-radius: 6px; }
.fold-chev { flex: none; width: 7px; height: 7px; margin-top: -2px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); }
.fold-btn[aria-expanded="true"] .fold-chev { margin-top: -5px; transform: rotate(45deg); }
.fold-cap { margin: 2px 0 0; cursor: pointer; }
.fold-badge { padding: 2px 9px; border-radius: 999px; background: var(--sec, var(--accent)); color: var(--surface); font: 600 .74rem/1.35 var(--sans); white-space: nowrap; }
/* The Calendar: days coming up */
.cal { list-style: none; margin: 6px 0 2px; padding: 0; }
.cal-entry { padding: 8px 0; border-top: 1px solid var(--line); }
.cal-entry:first-child { border-top: 0; padding-top: 2px; }
.cal-main { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; color: var(--ink); }
.cal-when { display: block; font: 600 .82rem/1.35 var(--sans); color: var(--ink-soft); }
.cal-away { font-weight: 500; color: var(--muted); }
.cal-entry.today .cal-away { color: var(--ink); font-weight: 600; }
.cal-what { display: block; margin-top: 2px; font-size: .92rem; line-height: 1.4; }
.cal-who { display: block; margin-top: 2px; font-size: .78rem; color: var(--muted); }
.time-pick { display: flex; gap: 10px; }
.time-pick .field { flex: 1 1 0; min-width: 0; }
.clock-field .hint { margin: 0 0 6px; }
@media (max-width: 430px) {
  .panel-head, .panel-body { padding-left: 12px; padding-right: 12px; }
  .block { padding: 12px 11px 13px; }
}
.block h3 { margin: 0 0 6px; font: 600 .92rem/1.3 var(--sans); }
.block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
.hint { margin: 4px 0 8px; color: var(--muted); font-size: .84rem; }
.warn { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--ribbon-soft); font-size: .84rem; }
.field { display: block; margin: 0 0 10px; }
.field > span { display: block; margin-bottom: 4px; font-size: .8rem; font-weight: 500; color: var(--muted); }
.field.inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field.inline > span { margin: 0; }
.field.inline input { width: 5.5rem; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-size: .9rem; }
.check input { margin-top: 3px; flex: none; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* Chat */
.chat { background: var(--surface); }
.log { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 12px 10px; }
#msgs, #streamSlot { max-width: 44rem; margin: 0 auto; }
.more { text-align: center; margin: 0 0 14px; }
.msg { position: relative; padding: 8px 12px 10px 20px; border-radius: 10px; margin: 0 0 6px; }
.msg::before { content: ""; position: absolute; left: 7px; top: 11px; bottom: 11px; width: 3px; border-radius: 3px; background: var(--cc, transparent); }
.msg.is-user { background: var(--surface-2); --cc: var(--accent); }
.msg.is-guest { --cc: var(--muted); }
/* The story clock's stamp: a quiet line of its own under the name and place. Tapping it is how you fix the time. */
.m-time { display: block; margin: -2px 0 3px; padding: 1px 0; min-height: 22px; border: 0; border-radius: 4px; background: none; font: 500 .74rem/1.3 var(--sans); color: var(--muted); text-align: left; cursor: pointer; }
.m-time:hover { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
/* Group replies: a short back-and-forth. Each person keeps a side: the first on the left, the next set in a little from
   the left edge, alternating. The color line stays on the left for everyone, and the turns sit close together. */
.msg.grp { padding-top: 6px; padding-bottom: 7px; margin-bottom: 3px; }
.msg.grp.grp-end { margin-bottom: 10px; }
.msg.grp-l { margin-right: 14%; }
.msg.grp-r { margin-left: 14%; }
.group-stream .net-note { margin: 0 0 8px 20px; }
.msg.is-narrator::before { background: var(--muted); opacity: .5; } /* a soft gray line, so every message lines up the same */
.who { display: flex; align-items: center; gap: 6px; min-height: 22px; margin-bottom: 2px; font: 600 .78rem/1.3 var(--sans); color: var(--cc, var(--muted)); }
.msg.is-narrator .who { color: var(--muted); font-weight: 500; font-style: italic; }
.in-tl { flex: none; width: 7px; height: 11px; background: var(--ribbon); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); opacity: .75; }
/* Each message's actions: a drop-down from the ⋯ in its top right corner. Tapping the message itself does nothing. */
.more-btn { margin-left: auto; border: 0; border-radius: 8px; background: none; color: var(--muted); min-width: 38px; min-height: 30px; padding: 2px 10px; font-size: 1.25rem; line-height: 1; opacity: 0; }
.more-btn:hover, .msg.open .more-btn { background: var(--surface-2); }
.msg:hover .more-btn, .msg.open .more-btn, .more-btn:focus-visible { opacity: 1; }
@media (hover: none) { .more-btn { opacity: .85; } }
/* ‹ 2 of 3 › on a message with more than one version */
.vers { display: inline-flex; align-items: center; margin-left: auto; font: 500 .76rem/1 var(--sans); color: var(--muted); white-space: nowrap; }
.vers + .more-btn { margin-left: 2px; }
.vers button { border: 0; background: none; border-radius: 6px; min-width: 30px; min-height: 28px; padding: 0 6px; font-size: 1.05rem; line-height: 1; color: var(--ink-soft); }
.vers button:disabled { opacity: .3; }
.tl-mark { display: inline-flex; align-items: center; border: 0; background: none; padding: 6px 5px; margin: -6px -1px; }
.msg .text { font-family: var(--story); font-size: 1.04rem; line-height: 1.6; overflow-wrap: anywhere; }
.msg .text p { margin: 0 0 .6em; }
.msg .text p:last-child { margin-bottom: 0; }
.msg.is-narrator .text { color: var(--ink-soft); }
.acts { display: none; position: absolute; top: 36px; right: 8px; z-index: 25; flex-direction: column; min-width: 12.5rem; max-width: calc(100% - 16px); padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .18); }
.msg.open .acts { display: flex; }
.acts button { display: block; width: 100%; border: 0; border-radius: 7px; background: none; padding: 10px 12px; text-align: left; font-size: .92rem; color: var(--ink); }
.acts button:hover, .acts button:focus-visible { background: var(--surface-2); }
.acts button.danger { color: var(--danger); }
/* While a message is being edited, the message bar steps aside: Save and Cancel are on the edit box. */
body.editing-msg .composer { display: none; }
.msg.editing textarea { font-family: var(--story); font-size: 1rem; margin-top: 4px; }
.edit-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .8rem; color: var(--muted); margin: 2px 0 6px; }
.edit-who select { width: auto; min-width: 0; max-width: 100%; padding: 4px 8px; font-size: .82rem; }
.edit-acts { display: flex; gap: 6px; margin-left: auto; }
.msg.streaming .text p:last-child::after { content: ""; display: inline-block; width: .45em; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--ribbon); opacity: .7; }
@media (prefers-reduced-motion: no-preference) {
  .msg.streaming .text p:last-child::after { animation: blink 1s steps(2, start) infinite; }
  @keyframes blink { to { visibility: hidden; } }
}
.msg.streaming.waiting .text p:last-child::after { animation: none; opacity: .25; }
.net-note { margin: 6px 0 0; font-size: .85rem; line-height: 1.4; color: var(--muted); }
.empty { max-width: 30rem; margin: 9vh auto 0; padding: 0 8px; color: var(--ink-soft); }
.empty h2 { margin: 0 0 10px; font: 600 1.4rem/1.3 var(--serif); color: var(--ink); }
.empty .intro { margin: 0 0 12px; font-size: .9rem; line-height: 1.5; }
.empty ol { margin: 0; padding-left: 1.3em; }
.empty li { margin: 7px 0; }
.empty .mode-note { margin: 18px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .88rem; color: var(--ink-soft); }
.empty .empty-name { margin: 4px 0 2px; }
.empty .empty-name-hint { margin: 0 0 12px; }
.empty .empty-example { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; font-size: .86rem; line-height: 1.4; }
.empty .empty-example button { flex: none; }
.empty .empty-help { margin: 14px 0 0; font-size: .86rem; line-height: 1.45; }
.help-glyph { display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-weight: 600; font-size: .9em; line-height: 1; vertical-align: .05em; }
.mode-pick { border: 0; margin: 12px 0 0; padding: 0; }
.head-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.file-pick { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px 10px; font-size: .82rem; cursor: pointer; background: var(--surface); }
.file-pick:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.import-pick { max-height: 50vh; overflow-y: auto; }
.mode-pick legend { padding: 0; margin-bottom: 2px; font-weight: 600; font-size: .9rem; }

/* Review cards for new characters, places and lore */
.draft { margin: 0 0 10px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface); }
#msgs .draft { margin: -2px 0 12px 20px; }
.draft-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.draft-kind { font-size: .76rem; color: var(--muted); }
.draft-name { font: 600 .95rem/1.3 var(--sans); }
.draft-desc { margin: 4px 0 8px; font-size: .88rem; color: var(--ink-soft); }
.draft-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.autoname-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: -2px 0 12px; }
.autoname-row .hint { margin: 0; }
.more-fields { display: block; margin: 0 0 12px; }
.review { padding: 4px 0 6px; }
.review h3 { margin: 0 0 8px; font: 600 .92rem/1.3 var(--sans); }

.bgstatus { flex: none; padding: 5px 16px; font-size: .8rem; color: var(--muted); text-align: center; background: var(--surface); border-top: 1px solid var(--line); }
.composer { flex: none; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
.crow { display: flex; gap: 8px; align-items: flex-end; max-width: 44rem; margin: 0 auto; }
.crow + .crow { margin-top: 8px; }
/* The row above the message box always fits on one line: names get cut short if they must. */
.controls { align-items: center; flex-wrap: nowrap; }
.pick { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 0; font-size: .8rem; color: var(--muted); }
.pick select { min-width: 0; padding: 5px 8px; font-size: .86rem; color: var(--ink); }
/* One button flips between Auto (the menu beside it is grayed out: whoever you talk to answers) and Reply (you pick).
   It shows one word at a time. Reply stays set until you tap it back to Auto. */
.reply-pick select { flex: 1 1 auto; }
.reply-pick select:disabled { opacity: .45; }
.reply-mode { flex: none; min-width: 3.6rem; padding: 5px 8px; font-size: .8rem; color: var(--muted); }
.reply-mode[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
/* "Who" opens a menu on the page instead of the phone's own picker, so the keyboard stays open */
.as-pick { position: relative; }
.as-btn { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; font-size: .86rem; color: var(--ink); text-align: left; }
.as-btn::after { content: ""; flex: none; width: 6px; height: 6px; margin-right: 2px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-2px) rotate(45deg); }
.as-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-menu { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 30; min-width: 13rem; max-width: min(20rem, 86vw); max-height: min(45vh, 20rem); overflow-y: auto; padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .2); }
.as-menu button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; border-radius: 7px; background: none; padding: 10px 10px; text-align: left; font-size: .94rem; color: var(--ink); }
.as-menu button::before { content: ""; flex: none; width: 4px; height: 16px; border-radius: 2px; background: var(--cc, var(--muted)); }
.as-menu button:hover, .as-menu button:focus-visible { background: var(--surface-2); }
.as-menu button[aria-checked="true"] { font-weight: 600; }
/* "Scene": who's here right now, with a way to send them off */
.scene-pick { position: relative; flex: none; }
/* Who's here: just a box with how many characters are in the scene. Tapping it explains the rest. */
.scene-btn { position: relative; display: flex; align-items: center; justify-content: center; min-width: 2.6rem; padding: 5px 9px; font-size: .9rem; color: var(--ink); }
.scene-count { min-width: 1em; font-weight: 600; text-align: center; }
.scene-btn .dot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--ribbon); box-shadow: 0 0 0 2px var(--surface); }
.scene-pop { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 30; width: min(22rem, calc(100vw - 24px)); max-height: min(60vh, 28rem); overflow-y: auto; padding: 10px 12px 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .2); }
.sp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sp-head strong { font-size: .92rem; }
.sp-where { min-width: 0; font-size: .8rem; color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-list { list-style: none; margin: 0; padding: 0; }
.sp-list li { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 9px 0 9px 12px; border-top: 1px solid var(--line); }
.sp-list li::before { content: ""; position: absolute; left: 0; top: 12px; width: 4px; height: 16px; border-radius: 2px; background: var(--cc); }
.sp-main { flex: 1; min-width: 0; }
.sp-name { display: block; font-weight: 600; font-size: .92rem; }
.sp-flag { margin-left: 6px; font-size: .74rem; font-weight: 600; color: var(--ribbon); }
.sp-note { display: block; margin-top: 2px; font-size: .82rem; color: var(--ink-soft); }
.sp-empty { margin: 6px 0 2px; font-size: .86rem; color: var(--muted); }
.sp-room { padding: 9px 0 4px; border-top: 1px solid var(--line); font-size: .82rem; }
.sp-room-head { font-weight: 600; color: var(--ink); }
.sp-room ul { margin: 4px 0 0; padding-left: 16px; color: var(--ink-soft); }
.sp-room li { margin: 3px 0; }
.sp-room .sp-note { margin-top: 3px; }
.sp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .82rem; }
#input { flex: 1; min-height: 44px; max-height: 40vh; resize: none; font-family: var(--story); font-size: 1rem; line-height: 1.5; }
.send { flex: none; min-width: 5.6rem; height: 44px; }
.send.stop { background: var(--ribbon); border-color: var(--ribbon); color: #fff; }
/* The line under the message box keeps a fixed two-line height. Notices cover it for a few seconds, so nothing above
   it ever moves while you're reaching for a button. */
.mode-line { position: relative; max-width: 44rem; margin: 5px auto 0; height: calc(2 * 1.35 * .76rem + 2px); }
.mode { margin: 0; font-size: .76rem; line-height: 1.35; color: var(--muted); overflow: hidden; max-height: 100%; }
.notice { position: absolute; left: 0; right: 0; bottom: 0; min-height: 100%; display: flex; align-items: center; gap: 8px; padding: 2px 4px 2px 10px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: .8rem; line-height: 1.25; }
.notice[hidden] { display: none; }
.notice .n-text { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notice.tap { cursor: pointer; }
.notice.tap .n-text::after { content: " ›"; font-weight: 600; }
.notice button { flex: none; background: transparent; color: inherit; border-color: currentColor; padding: 3px 9px; font-size: .78rem; }
.draft.flash { animation: flash 1.8s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--focus); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Cast */
.you-tag { flex: none; font-size: .78rem; color: var(--muted); }
.roster { list-style: none; margin: 4px 0 0; padding: 0; }
/* Each character is a box in their own color, faded while they're offstage. It grows with the card when it opens. */
.char { position: relative; margin-top: 10px; padding: 9px 12px 10px; border: 4px solid var(--cc); border-radius: 12px; }
.char:first-child { margin-top: 0; }
.char.offstage { border-color: color-mix(in srgb, var(--cc) 35%, var(--bg)); }
@media (max-width: 430px) { .char { padding: 9px 10px 10px; } }
.char-row { display: flex; align-items: center; gap: 8px; }
.char-name { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 2px 0; font: 600 .96rem/1.3 var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char.offstage .char-name { color: var(--muted); }
.scene-toggle { flex: none; display: flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--muted); }
.char-state { margin-top: 3px; font-size: .84rem; color: var(--ink-soft); }
.char-edit { margin-top: 10px; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 0 12px; }
.core-pick { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; font-size: .92rem; line-height: 1.35; }
.core-name { color: var(--muted); font-weight: 400; }
.core-level { margin-top: 8px; }
.core-level input[type="range"] { display: block; width: 100%; margin: 0; accent-color: var(--accent); }
.core-read { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; font-size: .8rem; color: var(--muted); }
.core-now { color: var(--ink); font-weight: 600; }
.core-ends { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; font-size: .74rem; color: var(--muted); }
.core-field .hint { margin-bottom: 0; }
.core-list { display: grid; gap: 8px; }
.core-opt { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; }
.core-opt.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.core-opt-head { display: block; margin-bottom: 3px; font-size: .92rem; }
.core-about { display: block; font-size: .84rem; line-height: 1.45; color: var(--ink-soft); }
.swatch { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid transparent; background: var(--sw); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Story: canon, places, lore and timeline */
.canon { list-style: none; margin: 6px 0 4px; padding: 0; }
.canon li { display: flex; gap: 4px; align-items: flex-start; padding-left: 8px; border-left: 3px solid var(--sec, var(--accent)); }
.canon li + li { margin-top: 6px; }
.flat { border: 1px solid transparent !important; background: transparent !important; padding: 4px 6px !important; resize: none !important; overflow: hidden; }
.flat:hover { border-color: var(--line) !important; }
.flat:focus { background: var(--surface) !important; border-color: var(--line-strong) !important; }
.add-row { display: flex; gap: 6px; margin-top: 8px; }
.add-row input { flex: 1; }

.world { list-style: none; margin: 6px 0 8px; padding: 0; }
.wentry { position: relative; padding: 8px 0 8px 12px; border-top: 1px solid var(--line); }
.wentry:first-child { border-top: 0; }
.wentry::before { content: ""; position: absolute; left: 0; top: 12px; width: 3px; height: 16px; border-radius: 2px; background: var(--sec, var(--accent)); opacity: .7; }
.w-row { display: flex; align-items: center; gap: 8px; }
.w-name { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 2px 0; font: 600 .92rem/1.3 var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-tag { flex: none; font-size: .74rem; color: var(--muted); }
.w-tag.here { color: var(--accent); font-weight: 600; }
.w-desc { margin-top: 2px; font-size: .84rem; color: var(--ink-soft); }
.w-edit { margin-top: 8px; }
.wentry.off::before { opacity: .25; }
.wentry.off .w-name { color: var(--muted); }
.wentry.off .w-desc { color: var(--muted); }
.wentry.here::before { background: var(--ribbon); opacity: 1; }
.here-field { margin-bottom: 6px; }
.review h4 { margin: 0 0 8px; font: 600 .86rem/1.3 var(--sans); color: var(--muted); }

/* On/off switches */
.switch { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0 4px 4px; font-size: .78rem; color: var(--muted); cursor: pointer; }
.switch input[type="checkbox"] { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 34px; height: 20px; margin: 0; border-radius: 999px; background: var(--line-strong); cursor: pointer; }
.switch input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.switch input[type="checkbox"]:checked { background: var(--accent); }
.switch input[type="checkbox"]:checked::after { transform: translateX(14px); }
.switch input[type="checkbox"]:checked + span { color: var(--accent); font-weight: 600; }
.switch span { min-width: 1.6em; }
@media (prefers-reduced-motion: no-preference) {
  .switch input[type="checkbox"], .switch input[type="checkbox"]::after { transition: background-color .15s, transform .15s; }
}

/* One-tap suggestions under messages. The × sits in the top right corner, so it never takes a line of its own. */
.sug { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: -2px 0 12px 20px; padding: 6px 40px 6px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--surface-2); font-size: .86rem; color: var(--ink-soft); }
.sug-text { flex: 1 1 6rem; min-width: 0; }
.sug-text strong { color: var(--ink); }
.sug.enter { border-left-color: var(--ribbon); }
.sug.exit .sug-text { flex-basis: 100%; }
.sug.note { padding-right: 12px; }
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; flex-basis: 100%; }
.week-days button { min-width: 0; padding: 5px 0; }
@media (max-width: 360px) { .week-days { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sug.note .sug-text { flex-basis: 100%; }
.sug .sug-x { position: absolute; top: 3px; right: 3px; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; font-size: 1.05rem; }

/* Who heard what: a thin line where people came and went, and who heard a message when you picked that yourself */
.presence { display: flex; align-items: center; gap: 10px; max-width: 34rem; margin: 2px auto 10px; font: 500 .74rem/1.3 var(--sans); color: var(--muted); text-align: center; }
.presence::before, .presence::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
/* The line above the replies after an edit you had rewritten, with arrows that flip all of them */
.take-bar { display: flex; align-items: center; gap: 8px; max-width: 34rem; margin: 4px auto 10px; padding: 2px 4px 2px 12px; border: 1px dashed var(--line); border-radius: 10px; font: 500 .76rem/1.3 var(--sans); color: var(--muted); }
.take-bar > span:first-child { flex: 1; min-width: 0; }
.take-bar .vers { margin-left: 0; }
.heard-note { display: block; margin-top: 6px; padding: 0; border: 0; background: none; font: 500 .74rem/1.3 var(--sans); color: var(--muted); text-align: left; cursor: pointer; }
.heard-note:hover { color: var(--ink-soft); text-decoration: underline; }
.who-list { display: flex; flex-direction: column; margin: 2px 0 8px; max-height: 45vh; overflow-y: auto; }
.who-list .check, .who-all, .who-after { margin: 6px 0; }
.who-after, .who-answer { padding-top: 10px; border-top: 1px solid var(--line); }
.who-answer + .who-after { padding-top: 0; border-top: 0; }
.who-answer { margin: 6px 0; }
.who-ticks { display: flex; flex-wrap: wrap; gap: 0 16px; }
.who-ticks .check { margin: 4px 0; }
.w-who { margin-top: 2px; font-size: .78rem; color: var(--muted); }
.wentry.secret::before { background: var(--sec, var(--ink-soft)); }
/* Secrets are lore only some people know: a box of their own inside the Lore box */
.secrets { margin-top: 14px; padding: 10px 12px 12px; border: 4px solid var(--sec); border-radius: 12px; background: var(--surface); background: color-mix(in srgb, var(--sec) var(--tint), var(--surface)); }
@media (max-width: 430px) { .secrets { padding: 10px 9px 11px; } }
.secrets h4 { margin: 0; font: 600 .95rem/1.3 var(--sans); }
.tl-who { margin-right: auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Two scenes. Every message header can read "Name – Place"; the place is a button (move the scene, or say someone
   left). A long place gets cut short before the name does. */
.who > span:first-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who.has-place > span:first-child { max-width: calc(100% - 10.5em); } /* leaves the place a few letters on a narrow phone */
.m-place { display: inline-flex; align-items: center; gap: 6px; flex: 0 1000 auto; min-width: 0; font-weight: 500; color: var(--muted); }
.m-place > span { flex: none; }
.place-btn { flex: 0 1 auto; min-width: 0; min-height: 28px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; border-radius: 6px; background: none; padding: 0 2px; font: inherit; color: inherit; text-align: left; }
.place-btn:hover { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
/* While there's a second scene, a bar on the right of each message says which scene it's in: light for the one with
   your character, dark for the second one. */
.msg.sc-main, .msg.sc-side { padding-right: 20px; }
.msg.sc-main::after, .msg.sc-side::after { content: ""; position: absolute; right: 7px; top: 11px; bottom: 11px; width: 3px; border-radius: 3px; }
.msg.sc-main::after { background: var(--line-strong); }
.msg.sc-side::after { background: var(--ink-soft); }
.presence.link-line { color: var(--ink-soft); font-weight: 600; }
.as-menu .as-sep { padding: 9px 10px 3px; font: 600 .72rem/1.3 var(--sans); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-menu .as-sep:first-child { padding-top: 5px; }
.scene-where { flex: none; width: auto; max-width: 48%; padding: 4px 6px; font-size: .8rem; color: var(--ink-soft); }
.char.at-side { border-color: color-mix(in srgb, var(--cc) 70%, var(--bg)); }
.sp-side { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.sp-side .sp-list li:first-child { border-top: 0; }
.place-pick { display: grid; gap: 8px; }
.place-pick button { width: 100%; text-align: left; padding: 11px 12px; font-size: .92rem; }
.here-field.flash select { animation: flash 1.8s ease-out; }

/* How full each reply's prompt is */
.meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.meter-head h3 { margin: 0; }
.meter-pct { font-size: .84rem; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.meter-pct.full { color: var(--danger); }
.meter-bar { display: flex; height: 14px; margin: 9px 0 9px; border-radius: 7px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.meter-bar span { flex: none; height: 100%; background: var(--seg); }
.meter-bar span + span { box-shadow: -1px 0 0 var(--surface); }
.meter-legend { display: flex; flex-wrap: wrap; gap: 3px 14px; margin: 0; padding: 0; list-style: none; font-size: .78rem; color: var(--ink-soft); }
.meter-legend li { display: inline-flex; align-items: center; gap: 5px; }
.meter-legend i { flex: none; width: 9px; height: 9px; border-radius: 2px; background: var(--seg); }
.meter-legend li.room i { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.meter-legend b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.meter-note { margin: 8px 0 0; font-size: .82rem; color: var(--muted); }
.meter .warn { margin-bottom: 0; }

/* Sharing and the developer's tools in Settings */
.plain-list { margin: 8px 0; padding-left: 18px; }
.plain-list li { margin: 5px 0; }
.app-version { user-select: none; -webkit-user-select: none; }

.timeline { list-style: none; margin: 10px 0 0; padding: 0; position: relative; counter-reset: ev; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 0; width: 2px; background: var(--ribbon); }
.timeline li { position: relative; padding: 0 0 6px 34px; counter-increment: ev; }
.timeline li::before { content: counter(ev); position: absolute; left: 0; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ribbon); color: var(--ribbon); font: 600 .66rem/20px var(--sans); text-align: center; }
.timeline li.mine::before { background: var(--ribbon); color: var(--surface); }
.timeline textarea { font-family: var(--story); font-size: .94rem; line-height: 1.45; }
.tl-day { display: block; margin: 3px 0 -2px 6px; font: 600 .72rem/1.3 var(--sans); color: var(--muted); }
.tl-pick .tl-day { margin: 0 0 2px; font: 600 .72rem/1.3 var(--sans); color: var(--muted); white-space: normal; }
.tl-acts { display: none; justify-content: flex-end; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.timeline li.active .tl-acts { display: flex; }
.tl-act { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); border-radius: 999px; padding: 3px 10px 3px 8px; font: 500 .76rem/1.25 var(--sans); }
.tl-act span { font-size: .92rem; line-height: 1; }
.tl-act:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); }
.tl-act:disabled { opacity: .4; }
.tl-act.danger { color: var(--danger); }
.timeline li.active textarea { background: var(--surface) !important; border-color: var(--line-strong) !important; }
.tl-now { position: relative; padding: 2px 0 4px 34px; font-size: .82rem; color: var(--muted); }
.tl-now::before { content: ""; position: absolute; left: 11px; top: 0; height: 12px; border-left: 2px dashed var(--ribbon); }
.tl-now::after { content: ""; position: absolute; left: 4px; top: 10px; width: 12px; height: 12px; border-radius: 50%; border: 2px dashed var(--ribbon); background: var(--surface); }
.tl-now p { margin: 8px 0 0; }
/* Starred events: always sent, never removed or condensed by the app */
.timeline li.star::after { content: "★"; position: absolute; left: 15px; top: -4px; width: 15px; height: 15px; border-radius: 50%; background: var(--surface); color: var(--star); font: 11px/15px var(--sans); text-align: center; }
.star-btn.on { color: var(--star); }
/* Picking events to combine, star or delete */
.tl-pick { display: block; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.tl-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tl-pick:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.tl-pick span { display: block; font-family: var(--story); font-size: .94rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline li.picking.checked .tl-pick { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.timeline li.picking.checked::before { content: "✓"; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: .8rem; }
.tl-window { margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.tl-scroll { max-height: min(55vh, 460px); overflow-y: auto; padding: 4px 10px 6px 8px; overscroll-behavior: contain; }
.tl-scroll .timeline { margin-top: 6px; }
.tl-foot { padding: 8px 10px 10px; border-top: 1px solid var(--line); background: var(--surface-2); }
.tl-foot .add-row { margin-top: 0; }
.tl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tl-count { flex: 1 1 auto; font-size: .84rem; color: var(--muted); }

/* Settings */
.settings { background: var(--bg); }
.settings-inner { max-width: 40rem; margin: 0 auto; }
.stories { list-style: none; margin: 4px 0 10px; padding: 0; }
.stories li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.stories li:first-child { border-top: 0; }
.st-main { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 2px 0; }
.st-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stories li.current .st-title { color: var(--accent); }
.st-meta { display: block; font-size: .78rem; color: var(--muted); }
.st-warn { margin: 0 0 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--ink-soft); }
.st-keep { margin: 10px 0 4px; font-size: .84rem; color: var(--ink-soft); }
.stories li .small { flex: none; }
.app-version { margin: 14px 0 0; text-align: center; font-size: .76rem; }

/* Dialogs and notices */
.scrim { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 12, 10, .45); }
.modal { width: 100%; max-width: 36rem; max-height: 86vh; display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .28); }
.modal h2 { margin: 0; padding: 16px 18px 6px; font: 600 1.05rem/1.3 var(--sans); }
.modal-body { padding: 4px 18px 8px; overflow: auto; }
.modal-body h4 { margin: 12px 0 6px; font: 600 .82rem/1.3 var(--sans); color: var(--muted); }
.modal-acts { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 10px 18px 16px; }
.modal pre, .mono { font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.modal pre { margin: 0; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 8px; }
.ai-read p { margin: 4px 0 8px; }
.ai-read ul { margin: 0 0 8px; padding-left: 1.1em; }
.ai-read li { margin: 4px 0; overflow-wrap: anywhere; }
.ai-read .q { color: var(--muted); }
.ai-read details { margin: 0 0 8px; }
.ai-read summary { cursor: pointer; color: var(--accent); font-size: .9rem; padding: 2px 0; }
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 60; width: min(92vw, 28rem); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toasts .toast { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--ink); color: var(--surface); font-size: .88rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); }
.toasts .toast button { flex: none; background: transparent; color: inherit; border-color: currentColor; padding: 4px 10px; font-size: .8rem; }
@media (prefers-reduced-motion: no-preference) {
  .toast, .notice { animation: drop .18s ease-out; }
  @keyframes drop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* ---------- Site edit: the sign-in screen, shown until someone with access is signed in ---------- */
.door { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.door-card { width: min(100%, 24rem); padding: 22px 20px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.door-brand { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; font: 600 1.05rem/1.2 var(--serif); color: var(--ink); }
.door h1 { margin: 0 0 8px; font: 600 1.4rem/1.3 var(--serif); color: var(--ink); }
.door-lede { margin: 0 0 16px; color: var(--ink-soft); font-size: .92rem; line-height: 1.5; }
.door .field input { display: block; width: 100%; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-size: 1rem; }
.door .field input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.door-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.door-foot button { padding: 9px 16px; font-size: .95rem; }
.door-status { margin: 0; font-size: .86rem; color: var(--ink-soft); }
.door-fine { margin: 16px 0 0; font-size: .84rem; color: var(--muted); line-height: 1.5; }
.door a { color: var(--accent); }
.door-studio { margin: 16px 0 0; font-size: .78rem; color: var(--muted); }
