:root {
  --bg: #0e0f12;
  --panel: #16181d;
  --line: #262a31;
  --text: #f2f1ec;
  --read: #6b6f78;
  --muted: #8a8f99;
  --accent: #ffb547;
  --accent-soft: rgba(255, 181, 71, 0.28);
  --edit: #7ad7a8;
  --edit-soft: rgba(122, 215, 168, 0.32);
  --warn: #ff7a6b;
  --fs: 44px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf9f6; --panel: #ffffff; --line: #e6e3dc; --text: #1b1c1f; --read: #a9abb1; --muted: #6d717a;
    --accent: #c47600; --accent-soft: rgba(230, 150, 20, 0.22); --edit: #138a55; --edit-soft: rgba(19, 138, 85, 0.2);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif; }
body { display: flex; flex-direction: column; overflow: hidden; }
button, select, input { font: inherit; color: inherit; }

.bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: var(--panel); flex-wrap: wrap; font-size: 13px; }
.brand { font-weight: 650; letter-spacing: 0.02em; }
.spacer { flex: 1; }
.field { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.field select { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; color: var(--text); }
.field input[type=range] { width: 70px; accent-color: var(--accent); }
.switch { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.switch input { accent-color: var(--edit); }
.ghost-btn { background: none; border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; cursor: pointer; }
.ghost-btn:hover { border-color: var(--muted); }
.primary { background: var(--accent); color: #1b1300; border: 0; border-radius: 7px; padding: 6px 14px; font-weight: 600; cursor: pointer; }

.mic { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg);
  border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; }
.mic .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.mic.on { border-color: var(--warn); }
.mic.on .dot { background: var(--warn); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.8); } }

.banner { padding: 10px 18px; background: rgba(255, 122, 107, 0.15); color: var(--warn); font-size: 14px; }

main { position: relative; flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.reading-line { position: sticky; top: 38%; height: 0; z-index: 0; pointer-events: none; }
.reading-line::before { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--fs) * -0.85);
  height: calc(var(--fs) * 1.7); background: linear-gradient(90deg, transparent, var(--accent-soft) 8%, var(--accent-soft) 92%, transparent);
  opacity: 0.25; }
/* The text column is centered and measured in the text's own size (about 26 of its em), so it fills a
   wide window at large sizes and stays readable at small ones. Comments take a column only when there are some. */
.page { display: flex; align-items: flex-start; justify-content: center; gap: 24px; padding: 0 clamp(8px, 3vw, 64px); }
#doc { position: relative; flex: 0 1 calc(var(--fs) * 26 + 80px); min-width: 0; padding: 38vh 40px 60vh; font-size: var(--fs);
  line-height: 1.45; font-weight: 500; letter-spacing: -0.005em; }
#doc p { margin: 0 0 1em; }

/* One sentence per line: an edit can only re-wrap its own sentence, never the lines around it. */
.sent { display: block; margin: 0 0 0.25em; border-radius: 6px; transition: background-color 0.4s; }
.w { cursor: pointer; border-radius: 5px; transition: color 0.25s; }
.w.read { color: var(--read); }
.w.now { color: var(--accent); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.18em; }

.sent.revising { background: var(--edit-soft); box-shadow: 0 0 0 4px var(--edit-soft); }
.sent.thinking { background-image: linear-gradient(90deg, transparent 0%, var(--edit-soft) 40%, transparent 80%);
  background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

.w.fresh { animation: fresh 3.6s ease-out both; }
@keyframes fresh {
  0% { color: var(--edit); background: var(--edit-soft); filter: blur(3px); opacity: 0; }
  12% { filter: blur(0); opacity: 1; }
  45% { color: var(--edit); background: var(--edit-soft); }
  100% { background: transparent; }
}
.ghost { position: absolute; overflow: hidden; pointer-events: none; color: var(--warn);
  text-decoration: line-through; text-decoration-thickness: 2px; background: var(--bg);
  animation: ghost 1.4s ease-in forwards; }
@keyframes ghost { 0% { opacity: 0.85; } 35% { opacity: 0.75; } 100% { opacity: 0; } }

.caption { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line);
  background: var(--panel); font-size: 15px; min-height: 48px; }
.status { flex: none; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.status.listening { color: var(--warn); }
.status.revising, .status.thinking { color: var(--edit); border-color: var(--edit); }
.status.escalated { color: var(--accent); border-color: var(--accent); }
.heard { color: var(--muted); white-space: nowrap; overflow: hidden; flex: 1; display: flex; justify-content: flex-end; }
.heard > * { flex: none; }
.heard .off { color: var(--edit); font-style: italic; }
.heard .interim { opacity: 0.6; }

.editor { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; padding: 24px; z-index: 10; }
.editor[hidden] { display: none; }
.editor-card { width: min(900px, 100%); height: min(80vh, 760px); background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.editor-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.muted { color: var(--muted); }
.editor textarea { flex: 1; resize: none; border: 0; outline: none; padding: 18px; background: var(--bg); color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, sans-serif; }

@media (max-width: 640px) {
  #doc { padding-left: 16px; padding-right: 16px; }
  .bar { gap: 8px; padding: 8px 12px; }
}

/* Comments: requests made by voice, shown beside the text they're about (like Word). */
#comments { position: relative; flex: 0 0 clamp(280px, 21vw, 400px); align-self: stretch; transition: flex-basis 0.3s ease, margin 0.3s ease; }
body:not(.has-comments) #comments { flex-basis: 0; margin-left: -24px; overflow: hidden; }
.comment { position: absolute; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 12px 12px; font-size: 14px; line-height: 1.45;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); transition: top 0.25s ease, opacity 0.5s ease; }
.comment.fading { opacity: 0; }
.comment[data-state="done"] { border-left-color: var(--edit); }
.comment[data-state="error"] { border-left-color: var(--warn); }
.c-head { display: flex; align-items: center; margin-bottom: 6px; }
.c-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); flex: 1; }
.c-close { border: 0; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.c-msg { padding: 4px 0; white-space: pre-wrap; }
.c-msg.user { color: var(--muted); font-style: italic; }
.c-msg.user::before { content: "🎙 "; font-style: normal; }
.c-msg.assistant { color: var(--text); }
.c-trace { font-size: 12.5px; color: var(--muted); }
.c-tool { padding: 2px 0; }
.c-tool::before { content: "🔎 "; }
.c-note { padding: 2px 0; color: var(--text); opacity: 0.8; }
.c-thinking { white-space: pre-wrap; font-style: italic; opacity: 0.75; padding-top: 2px; max-height: 9em; overflow: hidden; }
.c-trace details summary { cursor: pointer; padding-top: 4px; }
.c-status { font-size: 12.5px; color: var(--muted); padding-top: 4px; }
.comment[data-state="working"] .c-status, .comment[data-state="listening"] .c-status { color: var(--accent); }
.comment[data-state="done"] .c-status { color: var(--edit); font-weight: 600; }
.c-reply { width: 100%; margin-top: 8px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px;
  font: inherit; background: var(--bg); color: var(--text); }
.c-reply:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.sent.anchored { background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); }
.sent.anchored.working { animation: anchor-pulse 1.4s ease-in-out infinite; }
@keyframes anchor-pulse { 50% { background: transparent; box-shadow: 0 0 0 4px transparent; } }
@media (max-width: 900px) { #comments { flex-basis: 240px; } #doc { padding-left: 16px; padding-right: 16px; } }

/* "Go to": a brief flash on the line it jumped to. */
.sent.arrived { animation: arrived 1.6s ease-out; }
@keyframes arrived { 0% { background: var(--accent-soft); box-shadow: 0 0 0 6px var(--accent-soft); } 100% { background: transparent; box-shadow: 0 0 0 6px transparent; } }

.saved-note { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* History navigator: a timeline rail on the right; the version you pick shows in the page itself. */
.workspace { flex: 1; display: flex; min-height: 0; }
.history { flex: 0 0 340px; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--panel); font-size: 14px; }
.history[hidden] { display: none; }
.history-head { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.history-title { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.nav-what-head { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.history-controls { display: flex; align-items: center; gap: 8px; }
.history-head button:disabled { opacity: 0.35; cursor: default; }
.history-body { flex: 1; display: flex; min-height: 0; }
.nav-track { position: relative; flex: 0 0 34px; margin: 14px 0; cursor: pointer; touch-action: none; }
.nav-track::before { content: ""; position: absolute; top: 0; bottom: 0; left: 16px; width: 2px; background: var(--line); }
.nav-track .tick { position: absolute; left: 10px; height: 2px; width: 14px; margin-top: -1px; background: var(--muted); opacity: 0.6; }
.nav-track .tick.checkpoint { width: 9px; height: 9px; left: 12.5px; margin-top: -4.5px; background: var(--accent); opacity: 1; transform: rotate(45deg); }
.nav-track .tick.start { background: var(--text); }
.nav-track .knob { position: absolute; left: 5px; width: 24px; height: 14px; margin-top: -7px; border-radius: 4px; background: var(--edit);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); transition: top 0.12s; }
.nav-list { flex: 1; overflow-y: auto; padding: 6px 6px 6px 0; }
.nav-row { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; width: 100%; text-align: left; background: none; border: 0;
  border-radius: 8px; padding: 7px 8px; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.nav-row:hover { background: var(--bg); }
.nav-row.selected { background: var(--edit-soft); }
.nav-row.checkpoint .nav-what { color: var(--accent); font-weight: 600; }
.nav-time { color: var(--muted); font-size: 12px; grid-row: span 2; white-space: nowrap; padding-top: 1px; }
.nav-cause { color: var(--muted); font-style: italic; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* While browsing, the page shows the picked version (same type as the script) instead of the live one. */
body.browsing #doc, body.browsing #comments, body.browsing .reading-line { display: none; }
#navDoc { flex: 0 1 calc(var(--fs) * 26 + 80px); min-width: 0; padding: 24vh 40px 50vh; font-size: var(--fs); line-height: 1.45; font-weight: 500; }
#navDoc[hidden] { display: none; }
#navDoc p { margin: 0 0 1em; }
.nav-new { background: var(--edit-soft); border-radius: 4px; box-shadow: 0 0 0 3px var(--edit-soft); }
.nav-old { color: var(--warn); text-decoration: line-through; opacity: 0.7; }
@media (max-width: 760px) { .workspace { flex-direction: column; } .history { flex: 0 0 45%; border-left: 0; border-top: 1px solid var(--line); order: 2; } #navDoc { padding: 8vh 16px 30vh; } }

/* Structure: section headings, and the margin (line numbers on request, a mark where each page starts). */
#doc .head { font-size: calc(var(--fs) * 0.62); line-height: 1.25; margin: 1.6em 0 0.7em; color: var(--muted); font-weight: 650;
  letter-spacing: 0.005em; border-radius: 6px; }
#doc h1.head { font-size: calc(var(--fs) * 0.78); color: var(--text); }
#doc h3.head { font-size: calc(var(--fs) * 0.5); }
#doc .head.fresh-head { animation: arrived 1.6s ease-out; }
#doc .sent:not(.head) { position: relative; }
.ln, .pg { position: absolute; right: calc(100% + 12px); font-size: 12px; font-weight: 500; letter-spacing: 0; line-height: 1;
  color: var(--muted); user-select: none; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.ln { top: calc(var(--fs) * 0.55); display: none; opacity: 0.8; }
body.numbers .ln { display: block; }
.pg { top: calc(var(--fs) * -0.15); color: var(--accent); opacity: 0.75; }
.sent.page-top::before { content: ""; position: absolute; left: -4px; right: 0; top: calc(var(--fs) * -0.08); border-top: 1px dashed var(--line); }
body.numbers .pg { top: calc(var(--fs) * -0.3); }
#numbersBtn.on { border-color: var(--accent); color: var(--accent); }
#navDoc .head { font-size: 0.62em; color: var(--muted); margin: 1.4em 0 0.6em; }
@media (max-width: 640px) { .ln, .pg { display: none !important; } }

/* Library rail: books and scripts, on the left. History is on the right. */
.crumb { display: flex; align-items: center; gap: 8px; max-width: 42ch; background: var(--bg); border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 10px; cursor: pointer; }
.crumb:hover { border-color: var(--muted); }
#crumbText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb-icon { color: var(--muted); }
.library { flex: 0 0 280px; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); font-size: 13.5px; }
.library[hidden] { display: none; }
.lib-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 17px; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.icon-btn:hover { color: var(--text); background: var(--bg); }
.lib-filter { margin: 4px 12px 8px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); outline: none; }
.lib-filter:focus { border-color: var(--accent); }
.lib-list { flex: 1; overflow-y: auto; padding: 0 6px 20px; }
.lib-group { margin-bottom: 10px; }
.lib-label { font-size: 11.5px; color: var(--muted); padding: 8px 8px 4px; border-radius: 6px; }
.lib-toggle { cursor: pointer; }
.lib-row { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 7px; cursor: pointer; min-height: 30px; }
.lib-row:hover { background: var(--bg); }
.lib-row.current { background: var(--accent-soft); }
.lib-project { font-weight: 600; }
.lib-icon { width: 10px; color: var(--muted); font-size: 11px; }
.lib-num { width: 16px; text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.lib-chapter { padding-left: 14px; }
.lib-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-meta { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.lib-status { font-size: 10.5px; padding: 1px 6px; border-radius: 99px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.lib-status.s-todo { color: var(--muted); }
.lib-status.s-draft { color: var(--accent); background: var(--accent-soft); }
.lib-status.s-revised { color: var(--edit); background: var(--edit-soft); }
.lib-status.s-final { color: var(--bg); background: var(--edit); }
.lib-more { visibility: hidden; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 4px; border-radius: 5px; font-size: 15px; }
.lib-row:hover .lib-more, .lib-more:focus { visibility: visible; }
.lib-more:hover { color: var(--text); background: var(--panel); }
.lib-add { display: block; margin: 2px 0 0 30px; background: none; border: 0; color: var(--muted); font-size: 12.5px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.lib-add:hover { color: var(--text); background: var(--bg); }
.lib-empty { color: var(--muted); font-size: 12px; padding: 2px 8px 6px; }
.lib-trashed { cursor: default; opacity: 0.8; }
.lib-restore { background: none; border: 1px solid var(--line); border-radius: 6px; font-size: 11.5px; padding: 1px 7px; cursor: pointer; }
.lib-rename { flex: 1; min-width: 0; padding: 2px 6px; border: 1px solid var(--accent); border-radius: 5px; background: var(--bg); outline: none; font-weight: inherit; }
.drop-before { box-shadow: inset 0 2px 0 var(--accent); }

/* Menus (the ⋯ on a row, ＋ New) */
.menu { position: fixed; z-index: 30; min-width: 190px; padding: 5px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); font-size: 13.5px; }
.menu[hidden] { display: none; }
.menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.menu-item:hover { background: var(--bg); }
.menu-item.danger { color: var(--warn); }
.menu-item.has-sub::after { content: " ›"; color: var(--muted); }
.menu-sub { display: none; padding-left: 10px; border-left: 2px solid var(--line); margin: 2px 0 4px 10px; }
.menu-sub.open { display: block; }

/* Home: what you see with nothing open */
body.home #doc, body.home #navDoc, body.home #comments, body.home .reading-line { display: none; }
.home { max-width: 1000px; margin: 0 auto; padding: 36px 32px 80px; }
.home[hidden] { display: none; }
.home-top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.home-top h1 { flex: 1; margin: 0; font-size: 26px; font-weight: 650; }
.home-actions { display: flex; gap: 8px; }
.home-label { color: var(--muted); font-size: 13px; margin: 26px 0 10px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; cursor: pointer; min-height: 86px; }
.card:hover { border-color: var(--muted); }
.card-big { border-color: var(--accent); min-height: 0; }
.card-kicker { font-size: 11.5px; color: var(--muted); }
.card-title { font-size: 15.5px; font-weight: 600; }
.card-meta { font-size: 12px; color: var(--muted); }
.card-line { font-family: Georgia, "Times New Roman", serif; font-size: 15px; color: var(--muted); margin-top: 6px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-add { align-items: center; justify-content: center; border-style: dashed; color: var(--muted); font-size: 13.5px; }
.home-empty { max-width: 520px; margin: 60px auto; text-align: center; color: var(--muted); line-height: 1.6; }
.home-empty h2 { color: var(--text); font-weight: 650; }

/* ⌘K switcher */
.switcher { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.4); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.switcher[hidden] { display: none; }
.switcher-card { width: min(620px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
#switchInput { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 15px 18px; font-size: 17px; outline: none; }
.switch-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.switch-row { display: flex; align-items: baseline; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.switch-row.on { background: var(--accent-soft); }
.switch-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-row.line .switch-label { font-family: Georgia, "Times New Roman", serif; font-size: 15px; }
.switch-row.new .switch-label { color: var(--accent); }
.switch-sub { color: var(--muted); font-size: 12px; white-space: nowrap; }
.switch-empty { color: var(--muted); padding: 12px; font-size: 13px; }

/* Dropping files */
.drop-hint { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); z-index: 40; background: var(--panel); border: 2px dashed var(--accent);
  border-radius: 14px; padding: 16px 26px; text-align: center; font-weight: 600; pointer-events: none; }
.drop-hint[hidden] { display: none; }
.drop-hint span { font-weight: 400; color: var(--muted); font-size: 13px; }
.title-input { flex: 1; min-width: 0; font-weight: 650; font-size: 16px; border: 0; border-bottom: 1px solid transparent; background: none; outline: none; padding: 2px 0; }
.title-input:focus { border-bottom-color: var(--accent); }
@media (max-width: 760px) { .library { position: absolute; z-index: 15; top: 0; bottom: 0; left: 0; width: 86vw; box-shadow: 0 0 40px rgba(0, 0, 0, 0.4); } .workspace { position: relative; } }

/* Drafts, scraps, notes, next chapter */
.nav-compare { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; color: var(--text); max-width: 100%; }
.nav-row.named .nav-what { color: var(--accent); }
.nav-track .tick.named { width: 12px; height: 12px; margin-top: -6px; left: 11px; }
.lib-status.s-milestone { color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.lib-extras { display: flex; gap: 4px; margin: 2px 0 0 26px; }
.lib-extra { background: none; border: 0; color: var(--muted); font-size: 12.5px; cursor: pointer; padding: 3px 6px; border-radius: 6px; }
.lib-extra:hover { color: var(--text); background: var(--bg); }
.menu-ask { display: flex; flex-direction: column; gap: 8px; padding: 8px; width: 280px; }
.menu-ask-label { color: var(--muted); font-size: 12.5px; }
.menu-ask .lib-rename { padding: 6px 8px; }
.menu-ask .primary { align-self: flex-end; }
.scraps-list { flex: 1; overflow-y: auto; padding: 8px 12px 30px; }
.scrap { border-bottom: 1px solid var(--line); padding: 12px 2px; }
.scrap-text { font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.5; }
.scrap-meta { color: var(--muted); font-size: 12px; margin: 6px 0 8px; }
.scrap-actions { display: flex; gap: 6px; }
.scrap-actions .ghost-btn { font-size: 12px; padding: 3px 8px; }
.scrap-actions .ghost-btn:disabled { opacity: 0.4; cursor: default; }
.next-up { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; margin-top: 2em; padding: 18px 22px;
  background: none; border: 1px dashed var(--line); border-radius: 14px; cursor: pointer; text-align: left; font-size: 15px; }
.next-up:hover { border-color: var(--accent); }
.next-kicker { color: var(--muted); font-size: 12px; }
.next-title { font-size: 22px; font-weight: 650; }
.next-hint { color: var(--accent); font-size: 13px; }

/* Hosted: Claude connection and account */
.claude-status { display: flex; align-items: center; gap: 7px; background: none; border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px; cursor: pointer; color: var(--muted); }
.claude-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.claude-status.on { color: var(--text); }
.claude-status.on::before { background: var(--edit); }
.account-btn { text-decoration: none; color: inherit; }

/* Writing by voice: the write point (a caret where new words go) and the words being heard. */
.write-point { display: inline; }
.write-point .write-text { color: var(--muted); }
.write-point .write-text:not(:empty)::after { content: " "; }
.write-point .caret { display: inline-block; width: 3px; height: 1.05em; margin-left: 1px; vertical-align: -0.15em; border-radius: 2px;
  background: var(--accent); animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.write-point[data-hint]:not([data-hint=""])::after { content: attr(data-hint); margin-left: 0.35em; font-size: 0.42em; vertical-align: middle;
  color: var(--muted); font-weight: 500; letter-spacing: 0.01em; }
p.write-p { margin-bottom: 1em; }
@media (prefers-reduced-motion: reduce) { .write-point .caret { animation: none; } }
