@font-face { font-family: Inter; src: url(fonts/inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  color-scheme: light;
  --bg: #f7f3ec; --paper: #fffdf8; --side: #2b2866; --side-fg: #e9e6ff; --side-dim: #a9a5d8;
  --fg: #2a2622; --dim: #756d63; --line: #e4dccd; --field: #f2ede2;
  --accent: #3f3a8f; --accent-fg: #fff; --accent-soft: #e8e6fb; --gold: #e59a2f; --gold-soft: #fbecd2;
  --ok: #2f8a4d; --warn: #c27a0e; --bad: #c24a3a; --shadow: 0 1px 2px rgba(60, 40, 10, .06), 0 8px 24px rgba(60, 40, 10, .07);
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif; --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 14px; --coachw: 310px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { color-scheme: dark; --bg: #17151f; --paper: #211e2c; --side: #121019; --fg: #ece8f4; --dim: #a09aae; --line: #353046; --field: #2a2638; --accent: #8e88f0; --accent-fg: #14121f; --accent-soft: #2f2b4f; --gold-soft: #3b2f1b; --shadow: 0 8px 24px rgba(0, 0, 0, .35); } }
:root[data-theme=dark] { color-scheme: dark; --bg: #17151f; --paper: #211e2c; --side: #121019; --fg: #ece8f4; --dim: #a09aae; --line: #353046; --field: #2a2638; --accent: #8e88f0; --accent-fg: #14121f; --accent-soft: #2f2b4f; --gold-soft: #3b2f1b; --shadow: 0 8px 24px rgba(0, 0, 0, .35); }

:root[data-theme=candle] { color-scheme: dark; --bg: #19130e; --paper: #231a13; --side: #120c08; --side-fg: #f1e2c8; --side-dim: #b39c7f; --fg: #f0e3cf; --dim: #b4a089; --line: #3d2f23; --field: #2c2118; --accent: #e0904a; --accent-fg: #1d1006; --accent-soft: #3d2a1a; --gold: #f0b25a; --gold-soft: #3a2a17; --shadow: 0 8px 24px rgba(0, 0, 0, .45); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
.hidden { display: none !important; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--paper); padding: 8px 12px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 2rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .7em; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted, .hint { color: var(--dim); } .hint { font-size: 12.5px; display: block; margin-top: 4px; }
.row { display: flex; gap: 8px; align-items: center; } .row.end { justify-content: flex-end; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }

/* layout */
#app { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: minmax(0, 1fr); height: 100%; }   /* the row must be able to shrink, or the page grows past the window and cannot scroll */
body.coach-on #app { grid-template-columns: 250px 1fr var(--coachw); }
#side { background: var(--side); color: var(--side-fg); display: flex; flex-direction: column; padding: 16px 12px; gap: 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; padding: 2px 6px; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; } .brand small { font: 600 10px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.newbtn { width: 100%; }
#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.navlink { display: flex; align-items: center; gap: 10px; color: var(--side-fg); text-decoration: none; padding: 9px 10px; border-radius: 10px; min-height: 40px; }
.navlink:hover { background: rgba(255, 255, 255, .08); } .navlink.on { background: rgba(255, 255, 255, .16); font-weight: 600; }
.ni { width: 20px; text-align: center; color: var(--gold); } .nt { flex: 1; }
.pdot { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--gold) var(--p), rgba(255, 255, 255, .18) 0); flex: none; }
.navhead { padding: 12px 10px 6px; display: flex; flex-direction: column; border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 8px; } .navhead b { font-family: var(--serif); font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .navhead small { color: var(--side-dim); }
.navsep { flex: 1; min-height: 8px; }
.sidefoot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 12px; }
.goal { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--side-dim); }
.sidefoot .link { color: var(--side-dim); }
#col { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
#top { display: flex; align-items: center; gap: 12px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--paper); }
.crumb { flex: 1; font-family: var(--serif); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.savedot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); } .savedot[data-s=saving] { background: var(--gold); } .savedot[data-s=error] { background: var(--bad); }
#view { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 32px 80px; outline: none; }
#coach { min-height: 0; background: var(--paper); border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; display: none; }
body.coach-on #coach { display: block; }
.coach-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-family: var(--serif); font-size: 1.15rem; }

/* page */
.page { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; } .page.wide { max-width: 1040px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.sub { color: var(--dim); margin: 6px 0 0; max-width: 560px; }
.sect { margin-top: 18px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); }
.card.hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: linear-gradient(120deg, var(--accent-soft), var(--gold-soft)); } .card.hero p { margin: 4px 0 0; max-width: 480px; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--accent); font-size: 11px; }
.card.empty, .card.welcome { text-align: center; padding: 32px; } .card.welcome { text-align: left; } .steps { padding-left: 20px; } .steps li { margin: 6px 0; }

/* buttons */
.btn { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 0 16px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 500; transition: background .15s, transform .05s; }
.btn:hover { background: var(--field); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; font-weight: 600; } .btn.primary:hover { filter: brightness(1.1); background: var(--accent); }
.btn.lg { min-height: 48px; padding: 0 24px; font-size: 1.05rem; } .btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; } .btn.danger { color: var(--bad); }
.btn:disabled { opacity: .4; pointer-events: none; } .btn[aria-pressed=true] { background: var(--accent-soft); }
#side .btn.primary { background: var(--gold); color: #2a1a00; }
.link { background: none; border: 0; color: var(--accent); padding: 4px 6px; text-decoration: underline; text-underline-offset: 3px; border-radius: 6px; } .link.danger { color: var(--bad); }
.icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; font-size: 20px; color: var(--dim); line-height: 1; flex: none; } .icon-btn:hover { background: var(--field); color: var(--bad); }

/* forms */
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .fld-l { font-size: 12.5px; font-weight: 600; color: var(--dim); }
.fld input[type=text], .fld select, .fld textarea, .dlg input, .dlg select, .search { width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 9px 12px; min-height: 40px; }
.fld textarea { resize: none; line-height: 1.5; overflow: hidden; } .fld input:focus, .fld textarea:focus, .fld select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.titlefld input { font: 600 1.8rem var(--serif); border: 0 !important; background: transparent !important; padding: 0; box-shadow: none !important; }
.fld.inline { flex-direction: row; align-items: center; gap: 6px; } .fld.inline select { width: auto; min-height: 34px; padding: 4px 10px; } .meta { gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 5px 13px; min-height: 32px; font-size: 13px; } .chip:hover { background: var(--field); } .chip.on { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.chips.small .chip { padding: 3px 10px; min-height: 28px; font-size: 12px; }
.slider { display: grid; grid-template-columns: 90px 1fr 24px; align-items: center; gap: 10px; margin: 6px 0; } .slider input { accent-color: var(--accent); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 9px; }
.tag.st-drafting { background: var(--gold-soft); color: var(--warn); } .tag.st-drafted { background: #dff3e5; color: var(--ok); } .tag.st-revised { background: var(--ok); color: #fff; }
.meter { height: 8px; background: var(--field); border-radius: 99px; overflow: hidden; } .meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 99px; transition: width .3s; } .meter.mini { width: 90px; height: 6px; }

/* rings, stats */
.ring-bg { stroke: var(--field); } .ring-fg { stroke: var(--accent); transition: stroke-dasharray .3s; } #side .ring-bg { stroke: rgba(255, 255, 255, .18); } #side .ring-fg { stroke: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; } .stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; display: flex; flex-direction: column; } .stat small { color: var(--dim); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .08em; } .stat b { font: 600 1.6rem var(--serif); } .stat span { color: var(--dim); font-size: 12.5px; }

/* library */
.storygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.storycard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.storycard-main { border: 0; background: none; text-align: left; padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; } .storycard-main:hover { background: var(--field); } .storycard-main p { margin: 0; font-size: 13px; }
.sc-top { display: flex; justify-content: space-between; align-items: center; } .nextline { color: var(--accent); } .sc-actions { border-top: 1px solid var(--line); padding: 4px 8px; display: flex; gap: 4px; }
.newcard { border-style: dashed; align-items: center; justify-content: center; min-height: 190px; color: var(--dim); font-size: 1rem; gap: 6px; } .newcard span { font-size: 2.4rem; line-height: 1; } .newcard:hover { color: var(--accent); border-color: var(--accent); }

/* roadmap */
.roadmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.stagecard { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); background: var(--paper); border-radius: var(--r); } .stagecard:hover { border-color: var(--accent); } .stagecard.next { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.stagecard > div { flex: 1; display: flex; flex-direction: column; } .stagecard small { color: var(--dim); } .num { font: 700 11px var(--sans); color: var(--dim); width: 14px; } .glyph { font-size: 1.4rem; color: var(--accent); width: 28px; text-align: center; }

/* characters, world */
.split { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; } .chars { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; }
.charpick { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 8px 10px; text-align: left; } .charpick.on { border-color: var(--accent); background: var(--accent-soft); } .charpick span:last-child { display: flex; flex-direction: column; min-width: 0; } .charpick b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .charpick small { color: var(--dim); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font: 600 1rem var(--serif); flex: none; }
.chared { display: flex; flex-direction: column; gap: 14px; }
.places { display: flex; flex-direction: column; gap: 10px; } .place { display: grid; grid-template-columns: 200px 1fr 32px; gap: 10px; align-items: start; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }

/* plot */
.structpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; } .structopt { text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; } .structopt small { color: var(--dim); } .structopt.on { border-color: var(--accent); background: var(--accent-soft); }
.timeline { position: relative; height: 10px; margin: 10px 8px 18px; background: var(--field); border-radius: 99px; } .timeline i { position: absolute; top: -3px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 3px solid var(--line); transform: translateX(-50%); } .timeline i.done { border-color: var(--accent); background: var(--accent); }
.beat { display: grid; grid-template-columns: 34px 1fr; gap: 10px; } .beat-n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-top: 2px; }
.beat-b { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; } .beat-h { display: flex; justify-content: space-between; align-items: baseline; } .beat-h small { color: var(--dim); } .q { color: var(--dim); margin: 2px 0 8px; font-style: italic; }
.micekey { display: flex; gap: 8px; flex-wrap: wrap; } .micetag { padding: 3px 10px; border-radius: 99px; font-size: 12px; background: var(--field); } .micetag.mM { background: #dff1e8; color: #1f6b42; } .micetag.mI { background: #e1ebfb; color: #284f9a; } .micetag.mC { background: #f7e3ee; color: #8d2d62; } .micetag.mE { background: var(--gold-soft); color: var(--warn); }
.threads { display: flex; flex-direction: column; gap: 8px; } .thread { display: grid; grid-template-columns: 150px 1fr 150px 150px 32px; gap: 8px; align-items: end; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.try { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; } .attempts { list-style: decimal; padding-left: 24px; margin: 0; display: flex; flex-direction: column; gap: 8px; } .attempts li { padding-left: 4px; } .attempts li > * + * { margin-top: 4px; }

/* scenes */
.tchart-wrap { overflow-x: auto; } .tchart { width: 100%; height: 100px; display: block; } .tline { stroke: var(--fg); stroke-width: 1.3; opacity: .45; vector-effect: non-scaling-stroke; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--dim); margin-top: 6px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.scenelist { display: flex; flex-direction: column; gap: 8px; }
.scene { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; } .scene.dropover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); } .scene[open] { box-shadow: var(--shadow); }
.scene summary, .pass summary, .lesson summary, .plan summary { cursor: pointer; list-style: none; } .scene summary::-webkit-details-marker, .pass summary::-webkit-details-marker, .lesson summary::-webkit-details-marker { display: none; }
.scene summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 48px; } .st { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .st i { color: var(--dim); font-weight: 400; } .sm { display: flex; gap: 8px; align-items: center; } .dot { width: 10px; height: 10px; border-radius: 50%; }
.sn { width: 26px; height: 26px; border-radius: 8px; background: var(--field); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--dim); flex: none; } .grip { cursor: grab; color: var(--dim); letter-spacing: -3px; padding: 4px; user-select: none; }
.scene-b { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; } .sceneactions { flex-wrap: wrap; }

/* write */
.write .wlayout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.wlist { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; max-height: calc(100vh - 160px); overflow-y: auto; }
.witem { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 7px 8px; border-radius: 9px; text-align: left; min-height: 38px; } .witem:hover { background: var(--field); } .witem.on { background: var(--accent-soft); font-weight: 600; } .wt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .witem small { color: var(--dim); }
.wmain { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding: 8px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; } .wstats { display: flex; gap: 16px; align-items: center; font-size: 13px; color: var(--dim); } .wstats b { color: var(--fg); } .clock { font: 600 1.1rem ui-monospace, monospace; color: var(--accent); }
.wtitle input { font: 600 1.5rem var(--serif) !important; border: 0 !important; background: transparent !important; padding: 0 !important; box-shadow: none !important; }
.prompt { background: var(--gold-soft); border-radius: 10px; padding: 10px 14px; margin: 0; }
.plan { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; } .plan summary { font-weight: 600; color: var(--dim); } .plan dl { display: grid; grid-template-columns: 80px 1fr; gap: 4px 12px; margin: 8px 0 0; } .plan dt { color: var(--dim); font-size: 12.5px; font-weight: 600; } .plan dd { margin: 0; }
.manuscript { width: 100%; min-height: 55vh; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); padding: 36px clamp(18px, 6%, 64px); font: 1.15rem/1.8 var(--serif); resize: none; overflow: hidden; box-shadow: var(--shadow); } .manuscript:focus { outline: none; border-color: var(--accent); }
body.focus #side, body.focus #coach, body.focus #top, body.focus .wlist, body.focus .pager, body.focus .plan { display: none !important; } body.focus #app { grid-template-columns: 1fr !important; } body.focus .wlayout { grid-template-columns: 1fr; } body.focus #view { padding-top: 24px; }

/* revise / craft */
.diag { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; } .dx { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--field); } .dx.warn { background: var(--gold-soft); } .dxi { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--accent); color: var(--accent-fg); flex: none; } .dx.warn .dxi { background: var(--warn); color: #fff; } .dxm { flex: 1; } .ok { color: var(--ok); }
.pass, .lesson { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; } .pass summary, .lesson summary { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 0; } .lesson summary small, .count { color: var(--dim); } .lesson summary { flex-direction: column; align-items: flex-start; gap: 0; }
.pass[open] summary, .lesson[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.checklist { list-style: none; padding: 0; margin: 0 0 8px; } .checklist label { display: flex; gap: 10px; padding: 7px 0; cursor: pointer; } .checklist input { accent-color: var(--accent); width: 18px; height: 18px; margin-top: 2px; flex: none; }
.lessons { display: flex; flex-direction: column; gap: 8px; } .try-it { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; } #coach .lesson { margin-bottom: 8px; } #coach .lesson p { font-size: 13.5px; }
.preview { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 20px; white-space: pre-wrap; font: 1rem/1.7 var(--serif); max-height: 400px; overflow: auto; margin: 0; }
.wheel { background: linear-gradient(120deg, var(--gold-soft), var(--accent-soft)); } .wheel-out { font: 1.1rem var(--serif); font-style: italic; margin: 8px 0 12px; } .genrehint { background: var(--field); border-radius: 10px; padding: 8px 12px; margin: 0; color: var(--dim); } .card.celebrate { text-align: center; background: var(--gold-soft); }
.pager { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

/* toolbox */
.toolgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tooltile { text-align: left; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.tooltile:hover { border-color: var(--accent); transform: translateY(-2px); } .tooltile span:not(.ticon) { color: var(--dim); font-size: 13.5px; } .tooltile small { color: var(--accent); font-weight: 600; margin-top: auto; padding-top: 6px; font-size: 11.5px; }
.ticon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 1.1rem var(--serif); margin-bottom: 4px; }
.back { padding-left: 0; margin-bottom: 6px; } .toolpanel { padding: 20px; } .tool { display: flex; flex-direction: column; gap: 12px; }
.micechart { display: grid; gap: 4px 2px; align-items: center; overflow-x: auto; padding: 10px; background: var(--field); border-radius: 12px; } .mc-n { font-size: 10px; color: var(--dim); text-align: center; } .mc-l { font-size: 12px; font-weight: 600; padding-right: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-bar { height: 18px; border-radius: 99px; font-size: 10px; padding: 0 8px; line-height: 18px; color: rgba(0, 0, 0, .65); } .mc-bar.mM { background: #b9e4cb; } .mc-bar.mI { background: #bcd2f5; } .mc-bar.mC { background: #f1c5dc; } .mc-bar.mE { background: #f6d8a0; } .mc-bar.open { border-right: 3px dashed var(--bad); border-radius: 99px 0 0 99px; }
.promise { display: grid; grid-template-columns: 1.3fr 150px 1.3fr 150px 32px; gap: 10px; align-items: start; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.nudge { background: var(--gold-soft); border-radius: 10px; padding: 8px 12px; margin: 0; font-size: 13.5px; }
.struct { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--paper); } .struct.on { border-color: var(--accent); background: var(--accent-soft); } .struct .hint { margin: 2px 0 10px; } .beatnames { font-size: 12.5px; color: var(--dim); margin: 14px 0 0; }
.timeline.small { height: 6px; margin: 8px 8px 6px; } .timeline.small i { width: 12px; height: 12px; top: -3px; border-width: 2px; background: var(--accent); border-color: var(--accent); }
.seqcols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .seqcol { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); } .seqcol h4 { margin: 0; font: 600 1rem var(--serif); color: var(--accent); }
.slidercard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--paper); display: flex; flex-direction: column; gap: 4px; } .slidercard .row { justify-content: space-between; }
.names { display: flex; flex-wrap: wrap; gap: 8px; } .namechip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 6px 4px 14px; } .namechip .link { font-size: 12px; text-decoration: none; padding: 2px 6px; background: var(--accent-soft); border-radius: 99px; }
.gencards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; } .gencard { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--paper); display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); } .gencard h4 { margin: 0; font: 600 1.15rem var(--serif); } .gencard small { color: var(--dim); font: 400 13px var(--sans); } .gencard dl { margin: 0; display: grid; grid-template-columns: 62px 1fr; gap: 4px 8px; font-size: 13.5px; } .gencard dt { color: var(--dim); font-weight: 600; font-size: 12px; } .gencard dd { margin: 0; } .gencard .btn { margin-top: auto; }
.law { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--paper); display: flex; flex-direction: column; gap: 10px; }
.logbox { background: var(--gold-soft); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; } .logout { font: 1.15rem/1.5 var(--serif); margin: 0; }
.fld-row { display: flex; justify-content: space-between; align-items: center; } .dice { border: 0; background: transparent; min-height: 22px; padding: 0 4px; border-radius: 6px; font-size: 14px; opacity: .55; line-height: 1; } .dice:hover { opacity: 1; background: var(--field); transform: rotate(20deg); }

/* editors */
.prose-wrap { display: flex; flex-direction: column; gap: 8px; } .prose-wrap .manuscript { max-width: 720px; margin: 0 auto; width: 100%; } .prose-wrap.wide .manuscript { max-width: 960px; }
.manuscript[data-font=sans] { font-family: var(--sans); line-height: 1.7; } .manuscript[data-font=mono] { font-family: 'Courier Prime', 'Courier New', Courier, monospace; line-height: 1.7; }
.tbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 6px 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; position: sticky; top: 0; z-index: 5; }
.tb { border: 0; background: transparent; min-width: 34px; min-height: 34px; padding: 0 8px; border-radius: 8px; font-size: 14px; } .tb:hover { background: var(--field); } .tb.on { background: var(--accent-soft); color: var(--accent); }
.tbar select { border: 1px solid var(--line); background: var(--paper); border-radius: 8px; min-height: 34px; padding: 0 8px; } .tbar .tsep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.sp-wrap { position: relative; max-width: 760px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.sp-keys { font-size: 12.5px; color: var(--dim); background: var(--field); border-radius: 10px; padding: 7px 12px; margin: 0; } .sp-keys b { color: var(--fg); background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; font-weight: 600; }
.sp-list { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 40px 48px 56px 88px; min-height: 55vh; font: 15.5px/1.55 'Courier Prime', 'Courier New', Courier, monospace; }
.sp-list .el { position: relative; outline: none; padding: 1px 0; border-radius: 3px; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.55em; }
.sp-list .el:empty::after { content: attr(data-ph); color: var(--dim); opacity: .45; } .sp-list .el:focus { background: var(--accent-soft); }
.sp-list .el:focus::before { content: attr(data-label); position: absolute; right: 100%; margin-right: 14px; top: 3px; font: 600 10px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); white-space: nowrap; }
.sp-scene { font-weight: 700; text-transform: uppercase; margin-top: 1.5em; } .sp-action { margin-top: .9em; } .sp-character { margin: .9em 0 0 36%; text-transform: uppercase; }
.sp-paren { margin-left: 29%; max-width: 34%; } .sp-dialogue { margin-left: 17%; max-width: 62%; } .sp-transition { text-align: right; text-transform: uppercase; margin-top: .9em; }
.sp-list .el:first-child { margin-top: 0; }
.sp-sugg { position: absolute; z-index: 6; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; min-width: 160px; } .sugg { border: 0; background: none; text-align: left; font: 14px 'Courier New', monospace; padding: 5px 10px; border-radius: 6px; min-height: 30px; } .sugg.first { background: var(--accent-soft); } .sugg:hover { background: var(--field); }

/* dialog, toast */
.dlg { border: 1px solid var(--line); border-radius: 18px; padding: 0; background: var(--paper); color: var(--fg); width: min(440px, 92vw); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); } .dlg::backdrop { background: rgba(20, 15, 40, .5); } .dlg-in { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; } .toast { background: var(--side); color: #fff; padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow); animation: up .25s; } @keyframes up { from { opacity: 0; transform: translateY(8px); } }
#print { display: none; }
/* ---------- daily page, resume, cover, questions, progress, timeline, writing tools, revise tools ---------- */
.dailyrow { display: grid; gap: 14px; } .dailyrow.two { grid-template-columns: 3fr 2fr; }
.card.today { background: linear-gradient(135deg, var(--gold-soft), var(--paper) 70%); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); display: flex; flex-direction: column; gap: 8px; }
.today-h { display: flex; justify-content: space-between; align-items: baseline; } .today h2 { font-size: 1.5rem; }
.plines { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; } .angle { margin: 2px 0 4px; color: var(--dim); } .angle b { color: var(--fg); }
.ask { font-weight: 600; color: var(--warn); margin: 0; }
.card.resume { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; } .card.resume p { margin: 0; }
.recap { margin: 0; font-family: var(--serif); font-style: italic; color: var(--dim); border-left: 3px solid var(--line); padding: 2px 0 2px 12px; }
.nextnote { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; } .nextnote .link { margin-left: 6px; }
.pinned { background: var(--gold-soft); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; } .pinned .row { align-items: center; }
.wtools { gap: 6px; } .wtools .btn { min-height: 32px; }
.pagehead.withcover { align-items: flex-start; flex-wrap: nowrap; }
.cover { flex: none; width: 112px; aspect-ratio: 2 / 3; border-radius: 10px; padding: 0; overflow: hidden; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.cover.empty { border: 2px dashed var(--line); box-shadow: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--dim); font-size: 12.5px; }
.cover.empty .plus { font-size: 26px; line-height: 1; color: var(--accent); } .cover.empty:hover, .cover.dropover { border-color: var(--accent); color: var(--fg); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; } .cover.has:hover img { filter: brightness(1.06); }
.dlg.wide { width: min(760px, 94vw); } .dlg-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.coverview img { display: block; max-width: 100%; max-height: 62vh; margin: 0 auto 10px; border-radius: 10px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 40px; } .sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--line); padding: 0; } .sw.on { box-shadow: 0 0 0 2px var(--fg); }
.storycard { border-top: 4px solid var(--sa, transparent); } .sc-cover { border: 0; padding: 0; height: 150px; overflow: hidden; background: var(--field); } .sc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.navhead.withcover { display: grid; grid-template-columns: 38px 1fr; column-gap: 10px; } .navhead.withcover img { grid-row: span 2; width: 38px; height: 54px; object-fit: cover; border-radius: 4px; }
.questions { display: flex; flex-direction: column; gap: 8px; } .questions .sect { align-items: baseline; }
.qlist { display: flex; flex-direction: column; gap: 8px; } .qitem { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.qitem.st-leaning { border-left-color: var(--gold); } .qitem.st-decided { border-left-color: var(--ok); opacity: .85; }
.q-top { display: flex; gap: 8px; align-items: center; } .qitem .fld { margin: 0; } .qitem .answer input { font-size: 13.5px; }
.progress .row { align-items: center; } .progress p { margin: 0; } .meter.wk { width: 180px; }
.heat { width: 100%; max-width: 420px; display: block; margin: 12px 0 4px; } .heat-l { font-size: 9px; fill: var(--dim); }
.heat .hl0 { fill: var(--field); } .heat .hl1 { fill: color-mix(in srgb, var(--accent) 25%, var(--field)); } .heat .hl2 { fill: color-mix(in srgb, var(--accent) 50%, var(--field)); } .heat .hl3 { fill: color-mix(in srgb, var(--accent) 75%, var(--field)); } .heat .hl4 { fill: var(--accent); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); } .tab { border: 0; background: none; padding: 8px 14px; border-bottom: 2px solid transparent; color: var(--dim); font-weight: 600; } .tab.on { color: var(--fg); border-bottom-color: var(--accent); }
.tlpanel { display: flex; flex-direction: column; gap: 12px; } .lanes { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.lane { display: flex; gap: 8px; align-items: center; border-left: 4px solid var(--ln); padding-left: 8px; } .lane .fld { margin: 0; } .lane input[type=color] { width: 34px; height: 34px; border: 0; padding: 0; background: none; }
.lanekey { width: 44px !important; text-align: center; font-weight: 700; border: 1px solid var(--line); border-radius: 8px; min-height: 36px; background: var(--paper); }
.lanedot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ln); flex: none; } .lanechip.on { background: color-mix(in srgb, var(--ln) 18%, var(--paper)); border-color: var(--ln); color: var(--fg); } .lanechip .lanedot { margin-right: 5px; vertical-align: -1px; }
.scene summary .when { font-size: 12px; } .scene summary .lanedot { margin-right: -2px; }
.lanehint { align-self: end; margin-bottom: 10px; }
.tlbar { align-items: center; } .tlwrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.tl { border-collapse: collapse; width: 100%; font-size: 13.5px; } .tl th { text-align: left; font-size: 12px; color: var(--dim); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); }
.tl td { padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; } .tl tr:last-child td { border-bottom: 0; } .tl .num { color: var(--dim); width: 28px; }
.tl .whenin { width: 118px; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 4px 6px; } .tl .whenin:hover, .tl .whenin:focus { border-color: var(--line); background: var(--field); }
.tl td small { margin-left: 4px; } .tl .lanecol { text-align: center; width: 34px; padding: 4px 2px; } .tl th.lanecol { color: var(--ln); text-align: center; }
.lanecell { width: 22px; height: 22px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ln) 40%, var(--line)); background: transparent; padding: 0; } .lanecell.on { background: var(--ln); border-color: var(--ln); } .lanecell:hover { border-color: var(--ln); }
.tl tr.st-drafted td, .tl tr.st-revised td { background: color-mix(in srgb, var(--ok) 5%, transparent); }
.bible { display: flex; flex-direction: column; gap: 8px; max-height: 58vh; overflow-y: auto; margin-top: 10px; } .bhit { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; } .bhit p { margin: 2px 0 0; color: var(--dim); font-size: 13.5px; } .bhit .eyebrow { display: block; }
.history { display: grid; grid-template-columns: 200px 1fr; gap: 12px; } .snaps { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.snap { text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; } .snap small { color: var(--dim); } .snap.on { border-color: var(--accent); background: var(--accent-soft); }
.diff { white-space: pre-wrap; font-family: var(--serif); line-height: 1.6; max-height: 52vh; overflow-y: auto; background: var(--field); border-radius: 10px; padding: 12px; }
.diff del, .diffview del { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); } .diff ins, .diffview ins { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); text-decoration-thickness: 1px; }
.cb { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; } .fr .fld { margin: 0; } .fr .fld input { width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 9px 12px; min-height: 40px; }
.hits { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; max-height: 320px; overflow-y: auto; } .hits mark { background: var(--gold-soft); color: var(--fg); font-weight: 700; border-radius: 3px; padding: 0 2px; }
.wf { margin: 0; padding-left: 20px; font-size: 13.5px; display: flex; flex-direction: column; gap: 2px; } .wf li.hot b { color: var(--warn); } h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.cc { border-top: 1px solid var(--line); padding: 8px 0; } .cc summary { cursor: pointer; display: flex; gap: 8px; align-items: center; } .tag.warn { background: var(--gold-soft); color: var(--warn); }
.ccl { font-size: 13.5px; margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--line); } .ccl.warn { border-left-color: var(--warn); } .ccl.check { color: var(--dim); }
@media (max-width: 820px) {
  .dailyrow.two, .history { grid-template-columns: 1fr; } .cover { width: 84px; } .pagehead.withcover { gap: 12px; } .hide-sm { display: none; } .meter.wk { width: 100%; }
  .q-top { flex-wrap: wrap; } .q-top .grow { flex-basis: 100%; }
}
@media print { #print.script { font: 12pt/1.25 'Courier Prime', 'Courier New', Courier, monospace; } #print.script h1 { margin: 3in 0 0; text-transform: uppercase; } #print.script p { text-indent: 0; margin: 0; } #print.script .sp-scene { font-weight: 700; text-transform: uppercase; margin: 2em 0 1em; } #print.script .sp-action { margin: 1em 0; } #print.script .sp-character { margin: 1em 0 0 2.2in; text-transform: uppercase; break-after: avoid; } #print.script .sp-paren { margin-left: 1.6in; break-after: avoid; } #print.script .sp-dialogue { margin-left: 1in; width: 3.5in; } #print.script .sp-transition { text-align: right; text-transform: uppercase; margin: 1em 0; }
  body { overflow: visible; background: #fff; } #app, #toasts { display: none !important; } #print { display: block; font: 12pt/1.6 var(--serif); color: #000; } #print h1 { text-align: center; margin: 3in 0 1in; } #print p { text-indent: 1.5em; margin: 0; } #print .brk { text-align: center; text-indent: 0; margin: 1em 0; } #print h2 { page-break-before: always; text-align: center; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* narrower screens */
@media (max-width: 1280px) { body.coach-on #app { grid-template-columns: 250px 1fr; } body.coach-on #coach { position: fixed; right: 0; top: 0; bottom: 0; width: min(340px, 88vw); z-index: 30; box-shadow: -10px 0 30px rgba(0, 0, 0, .2); } }
@media (max-width: 820px) {
  body { overflow: auto; } #app, body.coach-on #app { display: flex; flex-direction: column; height: auto; min-height: 100%; }
  #side { flex-direction: row; align-items: center; padding: 8px; gap: 8px; overflow-x: auto; position: sticky; top: 0; z-index: 20; } .brand span, .newbtn, .sidefoot, .navhead, .navsep { display: none; } .brand { padding: 0; }
  #nav { flex-direction: row; flex: none; } .navlink { flex-direction: column; gap: 0; padding: 4px 10px; font-size: 11px; min-height: 48px; white-space: nowrap; } .nt { flex: none; } .pdot { display: none; }
  #col { height: auto; } #view { padding: 18px 14px 80px; overflow: visible; } #top { padding: 8px 14px; }
  .split, .write .wlayout, .grid2, .grid3 { grid-template-columns: 1fr; } .chars, .wlist { position: static; flex-direction: row; overflow-x: auto; max-height: none; } .charpick, .witem { flex: none; }
  .thread, .place, .promise, .seqcols { grid-template-columns: 1fr; } .sp-list { padding: 20px 14px 40px 14px; } .sp-list .el:focus::before { display: none; } .sp-character { margin-left: 24%; } .sp-dialogue { margin-left: 8%; max-width: 88%; } .sp-paren { margin-left: 16%; max-width: 70%; } .card.hero { flex-direction: column; align-items: flex-start; } h1 { font-size: 1.6rem; } .manuscript { padding: 20px 16px; }
}
