/* Candle on the web, the account dashboard and the sign-in page.
   Colours are desktop Candle's (candle/app.py THEMES); the text is set in
   Literata, as in Candle's editor. */
:root {
  color-scheme: light;
  /* A touch whiter than desktop Candle's beige, with its warmth and accent. */
  --window: #f8f7f4; --surface: #ffffff; --alt: #f0eeea; --side: #f4f3ef; --sheet: #ffffff;
  --ink: #26241f; --muted: #6e695a; --line: #e3dfd7; --accent: #8a5a2b; --accent-ink: #ffffff;
  --highlight: #e8d6bd; --soft: #faf4ec; --error: #b3261e; --ok: #3c9a5f; --warn: #d9952b;
  --shadow: 0 1px 2px rgb(38 36 31 / .04), 0 6px 20px rgb(38 36 31 / .05);
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Literata", "Noto Serif", Georgia, serif;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --window: #1f2023; --surface: #26272b; --alt: #2c2d31; --side: #232428; --sheet: #1b1c1f;
    --ink: #e4e1da; --muted: #8d8a84; --line: #3a3b40; --accent: #d9a066; --accent-ink: #1f2023;
    --highlight: #5a4630; --soft: #2f2a24; --error: #ff8a80; --ok: #6cc28c; --warn: #e5b056;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 18px rgb(0 0 0 / .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --window: #1f2023; --surface: #26272b; --alt: #2c2d31; --side: #232428; --sheet: #1b1c1f;
  --ink: #e4e1da; --muted: #8d8a84; --line: #3a3b40; --accent: #d9a066; --accent-ink: #1f2023;
  --highlight: #5a4630; --soft: #2f2a24; --error: #ff8a80; --ok: #6cc28c; --warn: #e5b056;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 18px rgb(0 0 0 / .25);
}

* { box-sizing: border-box; }
html, body { background: var(--window); }
body { margin: 0; font: 15px/1.5 var(--ui); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; letter-spacing: -.005em; }
h1 { font-size: 1.6rem; margin: 0 0 16px; }
h2 { font-size: 1.2rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 16px 0 6px; }
p { margin: 0 0 14px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
::selection { background: var(--highlight); }

/* -- Controls ----------------------------------------------------------------------- */
button, input, select, textarea { font: inherit; color: var(--ink); }
button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; background: var(--surface);
  cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, color .12s;
}
button:hover, a.button:hover { border-color: var(--muted); }
button.primary, a.button { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover, a.button:hover { filter: brightness(1.08); border-color: var(--accent); }
button.ghost { border-color: transparent; background: none; }
button.ghost:hover { background: var(--alt); border-color: transparent; }
button:disabled { opacity: .55; cursor: default; }
button.link { border: 0; background: none; padding: 2px 0; color: var(--accent); text-align: left; }
input, select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface);
}
textarea { resize: vertical; line-height: 1.5; }
:is(button, input, select, textarea, a, [contenteditable]):focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; }
.message { min-height: 1.5em; margin: 12px 0 0; }
.message.error { color: var(--error); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--alt); font-size: .85em; font-weight: 600; }
.badge.premium { background: var(--accent); color: var(--accent-ink); }

/* -- Sign-in form (static/auth.js) ------------------------------------------------- */
.signin { max-width: 400px; margin: 9vh auto; padding: 0 16px; }
.signin h1 { font-size: 1.5rem; }
.signin input, .signin button { width: 100%; }
.signin input { margin-bottom: 10px; padding: 10px 12px; }
.signin button { padding: 10px 12px; }
.signin .google { gap: 10px; }
.signin .or { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--muted); font-size: .9em; }
.signin .or::before, .signin .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.signin .links { display: flex; justify-content: space-between; margin-top: 12px; font-size: .9em; }

/* -- Header ---------------------------------------------------------------------------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 900px; margin: 0 auto; padding: 14px 16px; }
.top .brand { display: inline-flex; align-items: center; gap: 8px; font: 600 1.2rem var(--serif); color: var(--ink); text-decoration: none; }
.top .brand img { width: 26px; height: 26px; flex: none; border-radius: 6px; }   /* Candle's icon (static/candle.svg) */
.top .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top .who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -- Account dashboard (/account) -------------------------------------------------- */
main.dashboard { max-width: 900px; margin: 0 auto 48px; padding: 0 16px; display: grid; gap: 16px; }
.project { border-top: 1px solid var(--line); padding: 14px 0; }
.project:first-of-type { border-top: 0; }
.project-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.project-title { font: 600 1.05rem var(--serif); overflow-wrap: anywhere; }
.versions { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .95em; }
.versions td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.versions td.actions { text-align: right; white-space: nowrap; }
.versions button { padding: 5px 10px; font-size: .9em; }
@media (max-width: 560px) {
  .versions td.size { display: none; }
  .versions td.actions { white-space: normal; }
  .versions td.actions button { margin: 2px 0; }
}
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink);
         padding: 24px; width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog label { display: block; margin-bottom: 10px; }
dialog label > span { display: block; font-size: .9em; color: var(--muted); margin-bottom: 4px; }
dialog select, dialog input[type=number] { width: 100%; }
dialog .check { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
dialog .check input { width: auto; }
dialog .buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 4px 0 14px; }
.download { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius);
            padding: 16px; background: var(--window); }
.download h3 { margin: 0; font-size: 1.05rem; }
.download p { margin: 0; }
.download .button { align-self: flex-start; }
.download .small { font-size: .85em; }
a.button.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
code { font-size: .9em; background: var(--alt); padding: 1px 5px; border-radius: 4px; }
footer.support { text-align: center; color: var(--muted); font-size: .85em; padding: 16px; }

/* -- Candle on the web (the home page) ---------------------------------------------- */
body.write { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.write footer.support { padding: 5px 16px; border-top: 1px solid var(--line); background: var(--side); }
.top.wide { max-width: none; margin: 0; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--side); }
.top.wide .brand { font-size: 1.1rem; }
.project-bar { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.project-bar select { max-width: 300px; font-weight: 600; border-color: transparent; background: none; }
.project-bar select:hover { border-color: var(--line); }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: .85em; color: var(--muted);
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.save-state[data-kind="saved"]::before { background: var(--ok); }
.save-state[data-kind="saving"]::before { background: var(--warn); animation: pulse 1s infinite alternate; }
.save-state[data-kind="error"] { color: var(--error); }
.save-state[data-kind="error"]::before { background: var(--error); }
@keyframes pulse { to { opacity: .35; } }
.conflict { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px;
            background: var(--soft); border-bottom: 1px solid var(--line); }
.conflict span { flex: 1 1 260px; }

.app { flex: 1; display: grid; grid-template-columns: 168px 1fr; min-height: 0; }
.rail { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; border-right: 1px solid var(--line);
        background: var(--side); overflow-y: auto; }
.rail button { justify-content: flex-start; gap: 10px; border: 0; background: none; padding: 8px 10px; color: var(--muted); }
.rail button:hover { background: var(--alt); color: var(--ink); }
.rail button.current { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); }
.rail .rail-sep { height: 1px; background: var(--line); margin: 6px 8px; }
.view { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.view > .page { overflow-y: auto; flex: 1; }
.page { padding: 24px 28px 72px; }
.page.narrow { max-width: 680px; width: 100%; margin: 0 auto; }
.page.wide-page { width: 100%; max-width: 1200px; margin: 0 auto; }
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: .85em; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0; cursor: pointer; }
.check input { width: auto; accent-color: var(--accent); }
.progress { display: flex; align-items: center; gap: 12px; }
.progress progress { flex: 1; height: 10px; appearance: none; border: 0; border-radius: 5px; overflow: hidden; background: var(--alt); }
.progress progress::-webkit-progress-bar { background: var(--alt); }
.progress progress::-webkit-progress-value { background: var(--accent); border-radius: 5px; }
.progress progress::-moz-progress-bar { background: var(--accent); border-radius: 5px; }
.empty { text-align: center; margin: 18vh auto 0; padding: 0 16px; max-width: 360px; }
.empty::before { content: "✎"; display: block; font-size: 2rem; color: var(--line); margin-bottom: 8px; }
.title-edit { width: 100%; font: 600 1.45rem/1.3 var(--serif); border: 0; border-bottom: 2px solid transparent;
              border-radius: 0; background: none; padding: 4px 0; margin-bottom: 12px; }
.title-edit:focus { border-bottom-color: var(--accent); }

/* Lists on the left: chapters and scenes, characters… */
.chapters-view, .entity-view { flex: 1; display: grid; min-height: 0; }
.chapters-view { grid-template-columns: 270px 1fr auto; }
.entity-view { grid-template-columns: 270px 1fr; }
.outline { border-right: 1px solid var(--line); background: var(--side); overflow-y: auto; padding: 14px 10px; }
.outline h2 { margin: 0 4px 2px; }
.outline > .muted { margin: 0 4px 8px; font-size: .88em; }
.outline > .row { padding: 0 4px; }
.outline-head { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 10px; }
.chapters, .scenes, .entity-list, .revisions { list-style: none; margin: 0; padding: 0; }
.entity-list { margin: 8px 0 12px; }
.chapter { margin-bottom: 8px; }
.item { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; border-radius: 7px; padding: 2px 6px;
        background: none; text-align: left; color: var(--ink); }
button.item { justify-content: flex-start; padding: 7px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item:hover { background: var(--alt); }
.item.current { background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; padding: 5px 2px; }
.item .tools { display: none; gap: 2px; }
.item:hover .tools, .item.current .tools, .item:focus-within .tools { display: flex; }
.item .tools button { padding: 1px 6px; font-size: .8em; border-color: transparent; background: none; color: var(--muted); }
.item .tools button:hover { background: var(--alt); color: var(--ink); }
.chapter > .item .name { font: 600 .98rem var(--serif); }
.scenes { margin-left: 12px; padding-left: 8px; border-left: 1px solid var(--line); }
.add-scene { margin: 2px 0 0 20px; padding: 2px 6px; border: 0; background: none; color: var(--accent); font-size: .88em; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: transparent; border: 1.5px solid var(--muted); }
.status-dot.progress { background: var(--warn); border-color: var(--warn); }
.status-dot.done { background: var(--ok); border-color: var(--ok); }
.pane { overflow-y: auto; min-width: 0; background: var(--window); }
.pane > .page { max-width: 820px; margin: 0 auto; }
.details { width: 290px; border-left: 1px solid var(--line); background: var(--side); overflow-y: auto; padding: 16px; }
.details h2 { font-size: 1.05rem; }
.details h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 6px; font-family: var(--ui); }
.checklist { max-height: 170px; overflow-y: auto; padding: 4px 0; }
.revisions li { margin: 4px 0; font-size: .88em; }

/* The scene: a sheet of paper, as in Candle's centred column */
.scene-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 2px; }
.scene-head .title-edit { flex: 1 1 220px; margin: 0; }
.scene-head select { padding: 5px 8px; font-size: .9em; }
.scene-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85em; margin: 2px 0 12px; }
.page.scene { padding-top: 18px; }
.page.scene .rich { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.page.scene .toolbar { border-radius: 12px 12px 0 0; padding: 6px 10px; margin: 0; background: var(--sheet); }
.page.scene .editor { min-height: 62vh; padding: 28px clamp(18px, 6vw, 64px) 40vh; border: 0; border-radius: 0 0 12px 12px; }

/* Rich text (static/editor.js) */
.rich { margin-bottom: 14px; }
.toolbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 0;
           background: var(--window); border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.toolbar button { padding: 4px 8px; min-width: 32px; border-color: transparent; background: none; color: var(--muted); font-size: .92em; }
.toolbar button:hover { background: var(--alt); color: var(--ink); }
.toolbar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.editor { min-height: 170px; outline: none; font: 1.12rem/1.75 var(--serif); color: var(--ink);
          border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--sheet); }
.editor:focus { border-color: var(--highlight); }
.editor:empty::before { content: attr(data-placeholder); color: var(--muted); font-style: italic; }
.editor p { margin: 0 0 .9em; }
.editor h1, .editor h2, .editor h3 { font-family: var(--serif); margin: 1em 0 .5em; }
.revision-text { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px;
                 font-family: var(--serif); background: var(--sheet); }
dialog .buttons .grow { flex: 1; }

/* Tabs, tables, analysis */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 16px; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 12px; color: var(--muted); }
.tabs button:hover { color: var(--ink); }
.tabs button.current { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.interview .question { color: var(--ink); font-weight: 500; font-size: .95rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.grid { border-collapse: collapse; width: 100%; font-size: .93em; }
table.grid th, table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid th { color: var(--muted); font-weight: 600; font-size: .8em; text-transform: uppercase; letter-spacing: .04em; background: var(--side); }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--soft); }
.bar-cell { width: 40%; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--accent); min-width: 2px; }
table.matrix td { text-align: center; }
table.matrix td:first-child { text-align: left; font-weight: 500; }
table.matrix td.hit { background: var(--soft); color: var(--accent); font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface); box-shadow: var(--shadow); }
.stat .value { font: 600 1.7rem var(--serif); color: var(--accent); }
.stat .muted { font-size: .88em; }

/* -- Full view and focus mode (as in Candle: Ctrl+Shift+F, F11, Esc) ------------------ */
.app.full, .app.focus { grid-template-columns: 1fr; }
.app.full .rail, .app.full .outline, .app.full .details,
.app.focus .rail, .app.focus .outline, .app.focus .details { display: none; }
.app.full .chapters-view, .app.focus .chapters-view { grid-template-columns: 1fr; }
body.focusing .top, body.focusing footer.support { display: none; }
body.focusing, .app.focus .pane { background: var(--sheet); }
.app.focus .page.scene { padding-top: 8vh; }
.app.focus .scene-head, .app.focus .scene-meta, .app.focus .toolbar { display: none; }
.app.focus .page.scene .rich { background: none; border: 0; box-shadow: none; }
.app.focus .page.scene .editor { font-size: 1.22rem; line-height: 1.85; padding: 0 clamp(18px, 6vw, 64px) 50vh; }
.focus-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 10;
             display: flex; align-items: center; gap: 14px; padding: 7px 8px 7px 16px; border-radius: 999px;
             background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
             color: var(--muted); font-size: .85em; transition: opacity .5s; white-space: nowrap; }
.focus-bar.quiet { opacity: 0; pointer-events: none; }
.focus-bar button { padding: 3px 12px; border-radius: 999px; font-size: .95em; }

@media (max-width: 980px) {
  .chapters-view { grid-template-columns: 230px 1fr; }
  .details { grid-column: 1 / -1; width: auto; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  body.write { height: auto; overflow: visible; }
  .app { grid-template-columns: 1fr; }
  .rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; }
  .rail button { white-space: nowrap; padding: 6px 10px; }
  .rail .rail-sep { display: none; }
  .chapters-view, .entity-view { grid-template-columns: 1fr; }
  .outline { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .item .tools { display: flex; }
  .project-bar select { max-width: 150px; }
  .page { padding: 16px; }
}

/* -- Refinements ----------------------------------------------------------------------- */
button, a.button, input, select, textarea { border-radius: 9px; }
button.primary:hover, a.button:hover { filter: brightness(.94); }
:is(button, input, select, textarea, a, [contenteditable]):focus-visible { outline: 2px solid var(--highlight); outline-offset: 1px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--soft); }
.card, .section, .stat, .table-wrap { border-color: var(--line); }
.card { border-radius: 16px; }

/* Header: white, with a soft rule */
.top.wide { background: var(--surface); padding: 10px 18px; }
body.write footer.support { background: var(--surface); }

/* Navigation: the current section marked by an accent bar, not a raised card */
.rail { padding: 14px 10px; gap: 3px; }
.rail button { position: relative; border-radius: 8px; padding: 9px 12px; }
.rail button.current { background: var(--surface); box-shadow: none; }
.rail button.current::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
                               border-radius: 0 3px 3px 0; background: var(--accent); }

/* Outlines: the same accent bar for the current chapter, scene or entry */
.item.current { position: relative; box-shadow: none; background: var(--surface); }
.item.current::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 3px;
                        background: var(--accent); }
.outline { padding: 16px 12px; }

/* The writing sheet: white paper with a little more air */
.page.scene .rich { border-radius: 14px; }
.page.scene .toolbar { border-radius: 14px 14px 0 0; padding: 8px 14px; }
.page.scene .editor { padding: 36px clamp(20px, 7vw, 72px) 40vh; }
.title-edit { font-size: 1.55rem; }
.empty::before { color: var(--highlight); }

/* -- Reviews (/review/…): reading, and notes beside the text --------------------------- */
.reader { flex: 1; display: grid; grid-template-columns: 240px 1fr 330px; min-height: 0; }
.review-title { font: 600 1rem var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader .outline > .muted { font-size: .88em; }
.item .count { margin-left: auto; padding: 0 7px; border-radius: 999px; background: var(--soft); color: var(--accent);
               font-size: .78em; font-weight: 700; }
.page.reading { max-width: 720px; margin: 0 auto; padding: 40px 28px 30vh; }
.page.reading h1 { text-align: center; margin: 2vh 0 32px; }
.scene-text { font: 1.12rem/1.8 var(--serif); }
.scene-text p { margin: 0; text-indent: 1.4em; }
.scene-text p:first-child, .scene-text h1 + p, .scene-text h2 + p, .scene-text h3 + p { text-indent: 0; }
.scene-text p[align] { text-indent: 0; }
.scene-break { text-align: center; color: var(--muted); margin: 1.4em 0; letter-spacing: .3em; }
.chapter-nav { display: flex; justify-content: space-between; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); }
mark.note-mark { background: color-mix(in srgb, var(--warn) 30%, transparent); color: inherit; border-radius: 2px;
                 cursor: pointer; padding: 1px 0; }
mark.note-mark:hover { background: color-mix(in srgb, var(--warn) 50%, transparent); }
mark.note-mark.resolved { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.add-note { position: fixed; z-index: 20; box-shadow: var(--shadow); }
.details.notes { width: auto; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px;
        transition: box-shadow .3s, border-color .3s; }
.note.flash { border-color: var(--accent); box-shadow: 0 0 0 3px var(--soft); }
.note.resolved { opacity: .7; }
.note .who { font-size: .8em; color: var(--muted); margin-bottom: 6px; }
.note blockquote { margin: 0 0 8px; padding: 4px 10px; border-left: 3px solid var(--warn); color: var(--muted);
                   font: italic .95em/1.5 var(--serif); cursor: pointer; max-height: 6.5em; overflow: hidden; }
.note .note-text { white-space: pre-wrap; margin-bottom: 8px; }
.note textarea { width: 100%; }
.note .replies .reply { border-top: 1px dashed var(--line); padding: 6px 0; white-space: pre-wrap; font-size: .95em; }
.note .reply.writer .who { color: var(--accent); }
.note .reply-row { flex-wrap: nowrap; align-items: flex-end; margin: 6px 0; }
.note .reply-row textarea { flex: 1; }
.note .row button.ghost { padding: 3px 8px; font-size: .88em; color: var(--muted); }
.note.composer { border-color: var(--accent); }
.small { font-size: .85em; }
@media (max-width: 980px) {
  .reader { grid-template-columns: 200px 1fr; }
  .reader .details.notes { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .reader { grid-template-columns: 1fr; }
  .reader .outline { max-height: 30vh; }
}

/* Reviews in Candle on the web */
.review-card h2 { margin: 0; }
.review-card.fresh { border-color: var(--accent); box-shadow: 0 0 0 3px var(--soft); }
.readers { list-style: none; padding: 0; margin: 8px 0 14px; }
.readers li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.readers li button { padding: 1px 7px; color: var(--muted); }
.badge.muted { background: var(--alt); color: var(--muted); }
