@font-face { font-family: Manrope; src: url('/static/fonts/manrope-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Manrope; src: url('/static/fonts/manrope-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
.billing-dialog { width: min(640px, calc(100vw - 32px)); max-height: 80dvh; overflow: auto; padding: 24px; background: #171d15; color: #e8eedd; border: 1px solid #4b5b33; border-radius: 18px; }
.billing-dialog::backdrop { background: #050804b8; backdrop-filter: blur(6px); }
.billing-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.billing-heading button { color: inherit; background: transparent; padding: 8px 12px; border: 1px solid #4b5b33; border-radius: 8px; }
.balance-total { font-size: 24px; margin: 24px 0 12px; }
.billing-row { border-top: 1px solid #38412e; padding-top: 16px; margin-top: 16px; font-size: 12px; }
:root {
  color-scheme: dark;
  --ink: #111310; --ink-1: #191d17;
  --text: #edf0e8; --dim: #adb6a4; --faint: #8e9985;
  --rule: #ffffff12; --rule-2: #ffffff24;
  --paper: #1b2019; --paper-ink: #292e27; --paper-dim: #68715f;
  --seal: #c6f36b; --ochre: #dbbd79;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Manrope, sans-serif;
  --mono: 'SF Mono', Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { background-image: radial-gradient(ellipse at 68% 0%, #6b8b3820, transparent 48%); }
button, textarea, input, select { font: inherit; }
button { cursor: pointer; border: 1px solid var(--rule-2); border-radius: 10px; background: #ffffff05; color: inherit; padding: 9px 15px; transition: background .18s, border-color .18s, box-shadow .18s; }
button:hover { background: #ffffff0c; border-color: #ffffff38; }
button:disabled { cursor: default; opacity: .4; }
:is(button, a, textarea, input, summary, select):focus-visible { outline: 2px solid var(--seal); outline-offset: 4px; }
::selection { background: #c6f36b36; color: inherit; }
* { scrollbar-width: thin; scrollbar-color: #ffffff25 transparent; }
#app { display: grid; height: 100dvh; grid-template-rows: 56px minmax(0, 1fr); gap: 12px; padding: 12px; }
#app.layout-talk { grid-template-columns: 216px minmax(0, 1fr) 0; grid-template-areas: 'bar bar bar' 'rail talk side'; column-gap: 0; }
#app.layout-talk.has-outline { grid-template-columns: 216px minmax(0, 1fr) 286px; }
.layout-talk:not(.has-outline) #side, .layout-talk #flow, .layout-flow #side { display: none; }
#app.layout-flow { grid-template-columns: 190px minmax(0, 1fr) 390px; grid-template-areas: 'bar bar bar' 'rail flow talk'; }
.bar { grid-area: bar; display: flex; align-items: center; gap: 20px; padding: 0 20px; min-width: 0; border: 1px solid var(--rule); border-radius: 14px; background: #22271d9e; backdrop-filter: blur(16px); box-shadow: inset 0 1px 0 #ffffff06; }
.mark, .auth-brand { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -.055em; white-space: nowrap; }
.mark { font-size: 25px; line-height: 1; }
.mark img { margin-right: 9px; }
.mark span, .auth-brand span { color: var(--seal); }
.hint { min-width: 0; font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint:empty { display: none; }
.grow { flex: 1; }
.me { display: flex; align-items: center; gap: 14px; font-size: 11px; color: var(--dim); }
.me button { color: var(--dim); border: 0; padding: 8px 0 8px 12px; border-left: 1px solid var(--rule-2); border-radius: 0; }
.bar .go, .me { flex-shrink: 0; white-space: nowrap; }
.me button:hover { color: var(--text); background: transparent; }
.bar .ghost, .bar .go { font-size: 12px; padding: 8px 14px; border-radius: 999px; }
.go, .yes, .auth-go, .wenter { background: #c6f36b1c; color: #d8f6af; border-color: #c6f36b46; box-shadow: inset 0 1px 0 #e9ffd525; }
.go:hover, .yes:hover, .auth-go:hover, .wenter:hover { background: #c6f36b2d; border-color: #d6ff9a80; }
.rail { grid-area: rail; min-width: 0; overflow-y: auto; padding: 28px 18px 20px 6px; }
.rail-caption { font-size: 9px; letter-spacing: .2em; color: var(--faint); margin: 0 12px 17px; }
.new { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font-size: 12px; background: linear-gradient(135deg, #c6f36b16, #ffffff05); border-color: #c6f36b2c; padding: 12px 15px; border-radius: 12px; }
.new > span { font-size: 21px; font-weight: 400; color: var(--seal); line-height: 1; }
.new:hover { background: #c6f36b20; border-color: #c6f36b70; }
.rail-label { margin: 30px 12px 8px; font-size: 10px; color: var(--faint); letter-spacing: .08em; }
.shelf { list-style: none; padding: 0; margin: 0; }
.shelf li { margin: 5px 0; padding: 13px 12px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; transition: background .18s; }
.shelf li.on { background: #c6f36b0d; border-color: #c6f36b20; }
.shelf li:hover { background: #ffffff08; }
.conversations li { padding: 0; }
.conversation { display: block; width: 100%; padding: 12px; border: 0; border-radius: 10px; text-align: left; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: transparent; color: var(--dim); }
.on .conversation { color: #dceacb; }
.conversations li { display: flex; align-items: center; }
.conversations .conversation { flex: 1; min-width: 0; }
.shelf-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shelf-heading .t { min-width: 0; overflow-wrap: anywhere; }
.shelf-delete { flex: 0 0 auto; min-height: 36px; padding: 7px; border-color: transparent; background: transparent; font-size: 10px; color: #ad9c93; }
.shelf-delete:hover { color: #ffb2a2; border-color: #ef9a8738; background: #ef9a8710; }
.shelf-status { position: fixed; top: 82px; right: 24px; z-index: 90; max-width: min(420px, calc(100vw - 32px)); padding: 14px 18px; border: 1px solid #c6f36b44; border-radius: 12px; background: #222b1bf5; box-shadow: 0 12px 40px #00000055; color: var(--text); font-size: 12px; line-height: 1.8; pointer-events: none; }
.shelf-status:empty { display: none; }
.shelf .t { font: 13px/1.6 var(--sans); }
.shelf .m, .shelf .empty { font-size: 10px; color: var(--faint); line-height: 1.8; margin-top: 7px; }
.shelf .empty { cursor: default; }
.track { height: 2px; background: var(--rule); margin-top: 12px; border-radius: 2px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--seal); }
.talkcol { grid-area: talk; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--rule); border-radius: 18px; background: linear-gradient(155deg, #1b211a, #151914 52%, #181d16); box-shadow: 0 16px 54px #00000012, inset 0 1px 0 #ffffff03; }
.talkhead { display: flex; justify-content: space-between; align-items: center; flex: 0 0 auto; gap: 10px; min-height: 62px; padding: 18px 30px; border-bottom: 1px solid var(--rule); font-size: 12px; }
#talk-title { display: inline-flex; align-items: center; gap: 10px; letter-spacing: .04em; }
#talk-title::before { content: ''; width: 5px; height: 14px; border-radius: 3px; background: linear-gradient(var(--seal), #c6f36b24); }
.ctx { font-size: 9px; color: var(--faint); text-align: right; }
.meter { height: 1px; flex: 0 0 auto; background: transparent; }
.meter i { display: block; height: 100%; background: var(--seal); box-shadow: 0 0 12px #c6f36b40; }
/* 跟随由页面控制，避免浏览器锚定将上翻阅读误判为回到底部。 */
.transcript { flex: 1; min-height: 0; overflow-y: auto; padding: 32px clamp(22px, 4vw, 64px) 18px; scroll-behavior: auto; overflow-anchor: none; }
.welcome { width: min(100%, 660px); margin: clamp(36px, 12vh, 150px) auto 48px; }
.welcome-kicker { font-size: 10px; letter-spacing: .2em; color: var(--seal); margin-bottom: 22px; }
.hello { font: 600 clamp(28px, 3vw, 43px)/1.4 var(--sans); letter-spacing: -.04em; margin: 0 0 16px; color: #eff5e8; }
.welcome-copy { font-size: 13px; line-height: 1.9; color: var(--dim); margin: 0; }
.prompt-ideas { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.prompt-idea { min-height: 42px; border-radius: 999px; border-color: #c6f36b25; padding: 10px 15px; font-size: 11px; background: #ffffff03; color: #cbd6c2; }
.prompt-idea::after { content: '↗'; margin-left: 13px; color: var(--seal); }
.prompt-idea:hover { color: var(--text); background: #c6f36b10; border-color: #c6f36b66; }
.line { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 13px; max-width: 860px; margin: 0 auto 28px; }
.line .who { display: grid; place-items: center; align-self: start; width: 32px; height: 32px; margin-top: 4px; border: 1px solid #c6f36b20; border-radius: 10px; background: #c6f36b08; font-size: 9px; color: #d7e9c0; white-space: nowrap; }
.line .body { min-width: 0; font-size: 14px; line-height: 1.95; overflow-wrap: anywhere; white-space: pre-wrap; }
.line.assistant .body { padding: 17px 20px; border: 1px solid #ffffff0a; border-radius: 4px 16px 16px; background: #ffffff03; }
.line.user { grid-template-columns: minmax(0, 1fr) 32px; }
.line.user .who { grid-column: 2; grid-row: 1; background: #c6f36b; color: #263716; border-color: transparent; font-size: 11px; }
.line.user .body { grid-column: 1; grid-row: 1; justify-self: end; max-width: 92%; padding: 13px 18px; border: 1px solid #c6f36b1f; border-radius: 16px 4px 16px 16px; background: #c6f36b0b; color: #e0edcf; }
.line.system .body { color: var(--dim); font-size: 12px; }
.markdown { white-space: normal; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown p { margin: 0 0 .9em; }
.markdown :is(h1, h2, h3, h4, h5, h6) { color: var(--text); font-weight: 600; line-height: 1.5; margin: 1.4em 0 .65em; }
.markdown h1 { font-size: 1.5em; }
.markdown h2 { font-size: 1.3em; }
.markdown h3 { font-size: 1.15em; }
.markdown :is(h4, h5, h6) { font-size: 1em; }
.markdown strong { color: #f1f6e9; font-weight: 600; }
.markdown :is(ul, ol) { padding-left: 1.65em; margin: .65em 0 1em; }
.markdown li { padding-left: .2em; margin: .25em 0; }
.markdown li::marker { color: var(--seal); }
.markdown li > p { margin: .35em 0; }
.markdown li > :is(ul, ol) { margin: .2em 0; }
.markdown blockquote { margin: 1em 0; padding: .45em 1em; border-left: 2px solid var(--seal); background: #c6f36b06; color: var(--dim); }
.markdown blockquote > :last-child { margin-bottom: 0; }
.markdown a { color: var(--seal); text-underline-offset: 3px; text-decoration-color: #c6f36b66; }
.markdown a:hover { text-decoration-color: currentColor; }
.markdown code { font: .86em/1.7 var(--mono); padding: .15em .4em; border: 1px solid var(--rule); border-radius: 4px; background: #ffffff07; color: #d9e9bc; }
.markdown pre { max-width: 100%; margin: 1em 0; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--rule); border-radius: 9px; background: #10140f; white-space: pre; overflow-wrap: normal; }
.markdown pre code { padding: 0; border: 0; border-radius: 0; background: transparent; color: #dce4d4; }
.markdown-table { max-width: 100%; margin: 1em 0; overflow-x: auto; border: 1px solid var(--rule-2); border-radius: 9px; }
.markdown table { width: 100%; border-collapse: collapse; font-size: .9em; }
.markdown :is(th, td) { min-width: 90px; padding: 9px 13px; border-bottom: 1px solid var(--rule); text-align: left; }
.markdown th { color: #d7e9bf; font-weight: 600; background: #c6f36b08; }
.markdown tr:last-child td { border-bottom: 0; }
.markdown :is(th, td)[align="center"] { text-align: center; }
.markdown :is(th, td)[align="right"] { text-align: right; }
.markdown hr { margin: 1.4em 0; border: 0; border-top: 1px solid var(--rule-2); }
.reasoning { margin: 0 0 13px; white-space: normal; border: 1px solid #c6f36b1b; border-radius: 10px; background: #10170f70; }
.reasoning summary { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 11px; color: #bfd7a3; padding: 10px 13px; user-select: none; list-style: none; }
.reasoning summary::-webkit-details-marker { display: none; }
.reasoning summary::before { content: ''; width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.reasoning[open] summary::before { transform: rotate(45deg); }
.reasoning-text { max-height: 240px; overflow-y: auto; white-space: pre-wrap; padding: 0 14px 13px; color: #a7b49b; font-size: 12px; line-height: 1.9; }
.reasoning:not([open]) .reasoning-text { display: none; }
.markdown.streaming::after { content: '▍'; color: var(--seal); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.compose { flex: 0 0 auto; margin: 0; padding: 14px clamp(20px, 4vw, 50px) 14px; background: linear-gradient(transparent, #171c15 35%); }
.compose-shell { padding: 8px 15px 14px 20px; border: 1px solid #ffffff22; border-radius: 17px; background: #1d231b; transition: border-color .2s; }
.compose-shell:focus-within { border-color: #c6f36b60; }
.compose-tools { position: relative; display: flex; justify-content: flex-end; margin-bottom: 4px; }
.model-control { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 5px 2px 5px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--dim); font-size: 11px; }
.model-control:hover, .model-control[aria-expanded='true'] { background: #293124; color: var(--text); }
.model-control svg { margin-right: 5px; }
.effort-label { padding-left: 8px; border-left: 1px solid var(--rule-2); font-size: 10px; color: var(--faint); }
.reasoning-panel { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 4; width: min(260px, 100%); padding: 18px; border: 1px solid #424b3a; border-radius: 12px; background: #232a1f; box-shadow: 0 12px 32px #00000040; }
.reasoning-heading { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }
.reasoning-heading output { color: var(--seal); }
#reasoning-effort { display: block; width: 100%; height: 32px; margin: 10px 0 0; accent-color: var(--seal); cursor: pointer; }
.reasoning-stops { display: flex; justify-content: space-between; padding: 0 2px; color: var(--dim); font-size: 10px; }
.compose-input { display: flex; align-items: flex-end; gap: 14px; }
.compose textarea { flex: 1; width: 0; min-width: 0; min-height: 40px; padding: 8px 0; resize: none; border: 0; background: transparent; color: var(--text); font-size: 13px; line-height: 1.8; outline: none; }
.compose textarea::placeholder { color: var(--faint); }
#btn-say { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: #c6f36b; color: #26351b; }
#btn-say:hover { background: #d6ff94; }
#btn-say:disabled { background: #424d36; color: #acbd96; opacity: .7; }
.compose-meta { display: flex; justify-content: space-between; gap: 12px; padding: 11px 3px 0; font-size: 9px; color: #87917e; letter-spacing: .025em; }
.compose-meta > :last-child { font-size: 8px; letter-spacing: .14em; }
.key-divider { margin: 0 8px; }
.layout-flow .transcript { padding: 24px 18px 12px; }
.layout-flow .line { gap: 9px; grid-template-columns: 28px minmax(0, 1fr); }
.layout-flow .line.user { grid-template-columns: minmax(0, 1fr) 28px; }
.layout-flow .line .who { width: 28px; height: 28px; }
.layout-flow .line.assistant .body { padding: 13px 14px; }
.layout-flow .compose { padding: 14px 16px; }
.layout-flow .welcome { margin-top: 36px; }
.layout-flow .hello { font-size: 24px; }
.pending { flex: 0 0 auto; max-height: 30vh; overflow-y: auto; padding: 0 25px; background: #c6f36b07; }
.pending:empty { display: none; }
.pitem { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 0; border-top: 1px solid #c6f36b20; font-size: 12px; }
.pitem > span { width: 100%; line-height: 1.8; }
.proposal { width: 100%; }
.proposal summary { cursor: pointer; color: var(--seal); }
.proposal pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.8 var(--mono); }
.pack { padding-bottom: 22px; color: var(--dim); font-size: 12px; }
.pack button { border: 0; padding-left: 0; font-size: 11px; }
.pack .sum { display: none; padding: 14px; line-height: 1.8; background: var(--ink-1); border-radius: 10px; }
.pack.open .sum { display: block; }
.outline-card { max-width: 860px; padding: 25px; margin: 20px auto; border: 1px solid #c6f36b30; border-radius: 16px; background: linear-gradient(135deg, #c6f36b10, #c6f36b03); }
.outline-card h3 { font-size: 20px; }
.outline-card p { font: 13px/1.9 var(--sans); color: var(--dim); margin-bottom: 20px; }
#side { grid-area: side; min-width: 0; overflow-y: auto; margin-left: 12px; padding: 28px 23px; border: 1px solid var(--rule); border-radius: 18px; background: #191f17a0; }
#draft .title { margin: 0 0 26px; font: 600 15px/1.6 var(--sans); }
.drow { padding-bottom: 17px; margin-bottom: 18px; border-bottom: 1px solid var(--rule); }
.drow .k { margin-bottom: 8px; font-size: 10px; color: var(--faint); }
.drow .v { font: 12px/1.9 var(--sans); white-space: pre-wrap; overflow-wrap: anywhere; }
.drow .v.empty { font: 11px/1.8 var(--sans); color: var(--faint); }
.wenter { width: 100%; padding: 12px; margin: 8px 0 16px; font-size: 12px; }
.wreset { border: 0; padding: 5px 0; color: var(--dim); font-size: 11px; }
#flow { grid-area: flow; min-width: 0; overflow-y: auto; padding: 28px clamp(20px, 3vw, 42px) 64px; border: 1px solid var(--rule); border-radius: 18px; background: #191e17; }
.chapter-nav { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; font-size: 11px; color: var(--dim); }
.chapter-nav select { color: var(--text); border: 1px solid var(--rule-2); border-radius: 9px; background: var(--paper); padding: 9px 12px; font: inherit; }
.story-panel { margin-bottom: 24px; padding: 24px; border: 1px solid #c6f36b28; border-radius: 14px; background: linear-gradient(135deg, #c6f36b08, #ffffff02); }
.story-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; list-style: none; cursor: pointer; }
.story-head::-webkit-details-marker { display: none; }
.story-panel[open] > .story-head { margin-bottom: 18px; }
.story-head h3::before { content: '›'; display: inline-block; margin-right: 12px; color: var(--seal); }
.story-panel[open] > .story-head h3::before { transform: rotate(90deg); }
.story-head h3 { margin: 0; font: 600 20px/1.5 var(--sans); }
.story-head button { font-size: 11px; }
.outline-label { font-size: 10px; color: var(--seal); margin: 12px 0; }
.outline-synopsis { white-space: pre-wrap; font: 13px/1.95 var(--sans); color: #d7dfd0; }
.chapter-outline { list-style: none; padding: 0; margin: 22px 0; }
.chapter-outline li { padding: 15px 0; border-top: 1px solid var(--rule); }
.chapter-link { border: 0; padding: 0; text-align: left; font-size: 12px; color: #e1edcf; }
.chapter-status { display: inline-block; margin-left: 12px; font-size: 10px; color: var(--seal); }
.chapter-outline p { margin: 9px 0 0; font-size: 12px; line-height: 1.9; color: var(--dim); white-space: pre-wrap; }
.outline-editor summary { font-size: 12px; cursor: pointer; color: var(--seal); }
.outline-editor form { margin-top: 20px; }
.outline-editor textarea, .outline-editor input { box-sizing: border-box; display: block; width: 100%; padding: 12px; border: 1px solid var(--rule-2); border-radius: 8px; background: #10160e; color: var(--text); font: 12px/1.8 var(--sans); margin-bottom: 10px; }
.outline-editor textarea { resize: vertical; }
.outline-editor fieldset { min-width: 0; border: 1px solid var(--rule); border-radius: 10px; margin: 16px 0; padding: 16px; }
.outline-editor legend { padding: 0 8px; font-size: 11px; color: var(--seal); }
.outline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.outline-actions button { font-size: 11px; }
.outline-status { margin-top: 12px; font-size: 12px; line-height: 1.8; color: var(--seal); }
.outline-impact { margin: 20px 0; padding: 16px; border: 1px solid var(--rule-2); border-radius: 10px; background: #10160e88; }
.outline-impact label { display: grid; gap: 10px; font-size: 12px; color: var(--dim); }
.outline-impact select { max-width: 100%; width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--rule-2); border-radius: 8px; background: #171e13; color: var(--text); font: 12px var(--sans); }
.outline-impact .note { margin-bottom: 0; }
.batch-panel { margin-bottom: 28px; }
.batch-title { font-size: 13px; color: var(--text); }
.batch-panel progress { display: block; width: 100%; height: 6px; margin: 14px 0; accent-color: var(--seal); }
.batch-panel select { max-width: 100%; margin: 0 10px 10px 0; padding: 10px; border: 1px solid var(--rule-2); border-radius: 9px; background: #171d13; color: var(--text); font: 12px var(--sans); }
.batch-panel button { font-size: 12px; margin-bottom: 10px; }
.sec { margin-bottom: 32px; }
.sec .n { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 10px; color: var(--dim); letter-spacing: .12em; }
.sec .n b { font: 22px var(--serif); color: #9aab8c; font-weight: 400; }
h3 { font: 23px/1.5 var(--serif); margin: 0 0 20px; }
.note { font-size: 12px; line-height: 1.9; color: var(--dim); }
.rows { margin: 0; font-size: 12px; }
.row { display: grid; grid-template-columns: 82px minmax(0, 1fr); padding: 10px 0; border-bottom: 1px solid var(--rule); line-height: 1.8; }
.row dt { color: var(--dim); }
.row dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tag, .chip { display: inline-block; margin: 2px; padding: 3px 7px; border: 1px solid var(--rule-2); border-radius: 5px; font: 10px var(--mono); }
.sheet { color-scheme: light; padding: clamp(24px, 3vw, 42px); border: 1px solid #e6e6da; border-radius: 12px; background: #f6f4ec; color: var(--paper-ink); box-shadow: 0 14px 40px #00000016; }
.prose { font: 18px/1.8 var(--serif); }
.prose[data-live='1'] { white-space: pre-wrap; }
.prose p { margin: 0 0 1.2em; }
.foot { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 20px; margin-top: 28px; border-top: 1px solid #303b2220; color: var(--paper-dim); font-size: 10px; }
.warn { color: #d2b87f; }
.sheet .warn { color: #8c652f; }
.gate { padding: 22px; margin-bottom: 28px; border: 1px solid #c6f36b30; border-radius: 14px; background: linear-gradient(135deg, #c6f36b0e, #c6f36b04); }
.gate .k { margin-bottom: 12px; font-size: 10px; color: var(--seal); }
.gate h4 { margin: 0 0 10px; font: 20px/1.6 var(--serif); }
.gate pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.8 var(--sans); }
.acts { display: flex; gap: 10px; margin-top: 16px; }
.vers { list-style: none; margin: 0; padding: 0; font-size: 11px; }
.vers li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.vers .c { flex: 1; color: var(--dim); }
.vers button { padding: 6px 9px; font-size: 11px; }
.write textarea { width: 100%; min-height: 160px; padding: 18px; border: 1px solid var(--rule-2); border-radius: 12px; background: #10150f; color: var(--text); font: 15px/1.9 var(--serif); resize: vertical; }
.write button { margin-top: 10px; font-size: 12px; }
.drawer { display: none; position: fixed; inset: 12px 12px 12px auto; z-index: 5; width: min(480px, calc(100vw - 24px)); border: 1px solid var(--rule-2); border-radius: 18px; background: #1a2118; box-shadow: -25px 0 100px #00000070; }
.drawer.on { display: flex; flex-direction: column; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 26px; border-bottom: 1px solid var(--rule); }
.drawer-head button { border: 0; font-size: 22px; }
.drawer-body { padding: 26px; overflow-y: auto; }
.drawer h2 { font: 16px var(--serif); margin-top: 32px; }
.tally { display: flex; gap: 26px; }
.tally b { display: block; font: 30px var(--serif); }
.tally span, .log { font-size: 11px; color: var(--dim); }
.debt { margin-top: 28px; padding: 14px; border-radius: 10px; background: var(--ink-1); font-size: 12px; line-height: 1.8; }
.ledger { padding: 0; list-style: none; }
.ledger li, .arc { padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 13px; line-height: 1.7; }
.top, .ah { display: flex; gap: 12px; margin-bottom: 6px; color: var(--dim); font: 11px var(--mono); }
.auth { display: none; position: fixed; inset: 0; z-index: 10; align-items: center; justify-content: center; padding: 28px; overflow-y: auto; background: linear-gradient(100deg, #11180fe8, #121710b8), url('/images/hero.jpg') center/cover; }
.auth.on { display: flex; }
.auth-card { width: 420px; max-width: 100%; padding: 36px; border: 1px solid #d8f0bc24; border-radius: 22px; background: #1c2418da; backdrop-filter: blur(18px); box-shadow: 0 30px 100px #00000040, inset 0 1px 0 #ffffff08; }
.auth-brand { font-size: 39px; line-height: 1; }
.auth-brand img { margin-right: 10px; }
.auth-label { margin: 20px 0 12px; font-size: 11px; color: #d1e0c2; letter-spacing: .14em; }
.auth-say { font-size: 12px; color: var(--dim); line-height: 1.9; margin-bottom: 28px; }
.auth-tabs { display: flex; gap: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--rule); }
.atab { border: 0; border-radius: 0; padding: 10px 0; color: var(--dim); font-size: 12px; }
.atab.on { border-bottom: 2px solid var(--seal); color: var(--seal); }
.auth label { display: block; margin: 18px 0; font-size: 11px; color: var(--dim); }
.auth input { display: block; width: 100%; margin-top: 9px; padding: 12px 14px; border: 1px solid var(--rule-2); border-radius: 10px; background: #10160e70; color: var(--text); }
.auth input::placeholder { color: var(--faint); opacity: 1; }
.auth-err, #chat-status { color: #edaf9a; font-size: 12px; line-height: 1.8; }
#chat-status { padding: 8px 28px; }
#chat-status:empty { display: none; }
.auth-go { width: 100%; margin-top: 12px; padding: 12px; border-radius: 11px; }
@media (max-width: 1150px) {
  #app.layout-talk { grid-template-columns: 172px minmax(0, 1fr) 0; }
  #app.layout-talk.has-outline { grid-template-columns: 172px minmax(0, 1fr) 248px; }
  #app.layout-flow { grid-template-columns: 160px minmax(0, 1fr) 340px; }
  .transcript { padding: 25px 22px 12px; }
  .bar { gap: 13px; padding: 0 16px; }
  .rail { padding-right: 12px; }
}
@media (max-width: 800px) {
  #app.layout-talk, #app.layout-talk.has-outline, #app.layout-flow { height: auto; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: 54px auto minmax(0, 1fr); grid-template-areas: 'bar' 'rail' 'talk'; gap: 8px; padding: 8px; }
  #app.layout-flow { grid-template-rows: 54px auto auto auto; grid-template-areas: 'bar' 'rail' 'talk' 'flow'; }
  .bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 8px 12px; border-radius: 12px; }
  .bar .hint, .bar .grow { display: none; }
  .bar #btn-balance { grid-column: 2; grid-row: 1; min-width: 0; padding: 6px 8px; font-size: 11px; overflow-wrap: anywhere; }
  .bar .me { grid-column: 3; grid-row: 1; }
  .bar .go { grid-column: 1 / -1; grid-row: 2; width: 100%; white-space: normal; }
  .mark { font-size: 23px; }
  .mark img { width: 21px; height: 24px; margin-right: 7px; }
  .hint { max-width: 28vw; font-size: 9px; }
  .me span, #btn-ledger { display: none; }
  .me button { padding-left: 0; border-left: 0; }
  .bar .go { padding: 8px 10px; font-size: 11px; }
  .rail { display: flex; align-items: center; gap: 9px; padding: 0; overflow-x: auto; scrollbar-width: none; }
  .rail-caption, .rail-label, .shelf .m, .track, .shelf .empty, #side, .ctx { display: none; }
  .new { flex: 0 0 auto; width: auto; min-height: 42px; padding: 9px 12px; font-size: 11px; }
  .new > span { font-size: 17px; }
  .shelf { display: flex; flex: 0 0 auto; gap: 6px; }
  .shelf li { flex: 0 0 auto; margin: 0; padding: 8px 10px; white-space: nowrap; }
  .conversations li { padding: 0; }
  .conversation { min-height: 40px; max-width: 150px; padding: 9px 12px; font-size: 11px; }
  .shelf .t { font-size: 11px; }
  .talkcol { height: calc(100dvh - 128px); min-height: 390px; border-radius: 15px; }
  .layout-flow .talkcol { height: 48dvh; min-height: 370px; }
  .talkhead { min-height: 52px; padding: 14px 18px; }
  .transcript { padding: 22px 16px 12px; }
  .welcome { margin: 8vh auto 30px; }
  .hello { font-size: 27px; }
  .welcome-kicker { font-size: 8px; margin-bottom: 18px; }
  .welcome-copy { max-width: 25em; font-size: 12px; }
  .prompt-ideas { gap: 8px; margin-top: 25px; }
  .prompt-idea { min-height: 44px; padding: 10px 12px; font-size: 10px; }
  .prompt-idea::after { margin-left: 9px; }
  .line { grid-template-columns: 27px minmax(0, 1fr); gap: 8px; margin-bottom: 22px; }
  .line.user { grid-template-columns: minmax(0, 1fr) 27px; }
  .line .who { width: 27px; height: 27px; border-radius: 9px; font-size: 8px; }
  .line .body { font-size: 13px; }
  .line.assistant .body { padding: 12px 13px; }
  .line.user .body { max-width: 100%; padding: 11px 14px; }
  .reasoning summary { padding: 9px 11px; font-size: 10px; }
  .reasoning-text { padding: 0 11px 11px; font-size: 11px; }
  .compose { padding: 10px 12px 12px; }
  .compose-shell { padding: 5px 11px 10px 14px; border-radius: 14px; }
  .compose-input { gap: 10px; }
  .model-control { min-height: 36px; }
  .compose textarea { min-height: 40px; font-size: 12px; }
  .compose-meta { justify-content: flex-end; padding-top: 9px; }
  .compose-meta > :first-child { display: none; }
  #flow { overflow: visible; padding: 24px 18px; border-radius: 15px; }
  .outline-card { padding: 18px; }
  .auth { padding: 20px; }
  .auth-card { padding: 28px; }
}
@media (prefers-reduced-transparency: reduce) {
  .bar, .auth-card { backdrop-filter: none; background: #20271c; }
}
@media (prefers-contrast: more) {
  :root { --dim: #d0d8c8; --faint: #bec8b3; --rule: #ffffff42; --rule-2: #ffffff66; }
  .line.assistant .body, .reasoning, .compose-shell { border-color: var(--rule-2); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

#app { grid-template-rows: 56px 44px minmax(0, 1fr); }
#app.layout-talk { grid-template-areas: 'bar bar bar' 'rail tabs tabs' 'rail talk side'; }
#app.layout-flow { grid-template-areas: 'bar bar bar' 'rail tabs tabs' 'rail flow talk'; }
#app.layout-document { grid-template-columns: 190px minmax(0, 1fr); grid-template-areas: 'bar bar' 'rail tabs' 'rail flow'; }
.layout-document .talkcol, .layout-document #side { display: none; }
.layout-document #flow { display: block; }
#app.is-onboard { grid-template-rows: 56px minmax(0, 1fr); grid-template-areas: 'bar bar bar' 'rail talk side'; }
.is-onboard .workspace-tabs { display: none; }
.workspace-tabs { grid-area: tabs; display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0 8px; border-bottom: 1px solid var(--rule); }
.workspace-tabs button { padding: 9px 18px; border: 0; border-radius: 8px; color: var(--dim); font-size: 12px; white-space: nowrap; }
.workspace-tabs button.on { background: #c6f36b14; color: var(--seal); box-shadow: inset 0 -2px var(--seal); }
.layout-document .story-panel { max-width: 1000px; margin: 0 auto 28px; }
.layout-document .batch-panel { max-width: 1000px; margin: 0 auto 28px; }
.overview-page { border: 0; padding: 24px 12px; background: transparent; }
.overview-page h1 { margin: 12px 0 20px; font: 500 clamp(28px, 4vw, 40px)/1.5 var(--serif); }
.page-kicker { color: var(--seal); font-size: 10px; letter-spacing: .18em; }
.page-intro { color: var(--dim); font-size: 13px; line-height: 1.9; margin: 14px 0 24px; }
.synopsis-editor { display: block; width: 100%; min-height: 290px; padding: 24px; margin: 22px 0; resize: vertical; border: 1px solid #c6f36b32; border-radius: 12px; background: #12180f; color: var(--text); font: 14px/2 var(--sans); }
.planning-link { border: 0; color: var(--seal); font-size: 12px; padding: 9px 0; margin-bottom: 16px; }
.batch-panel:empty { display: none; }
.page-chapters .story-panel > .story-head { cursor: default; }
.page-chapters .story-head h3::before { content: ''; margin: 0; }
@media (max-width: 1150px) and (min-width: 801px) {
  #app.layout-document { grid-template-columns: 160px minmax(0, 1fr); }
}
@media (max-width: 800px) {
  #app.layout-talk, #app.layout-talk.has-outline, #app.layout-document { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 44px minmax(0, 1fr); grid-template-areas: 'bar' 'rail' 'tabs' 'talk'; }
  #app.layout-talk, #app.layout-talk.has-outline { height: 100dvh; }
  #app.layout-document { grid-template-areas: 'bar' 'rail' 'tabs' 'flow'; }
  #app.layout-flow { grid-template-rows: auto auto 44px auto auto; grid-template-areas: 'bar' 'rail' 'tabs' 'talk' 'flow'; }
  #app.is-onboard { grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: 'bar' 'rail' 'talk'; }
  .workspace-tabs { gap: 2px; justify-content: space-between; padding: 0; }
  .workspace-tabs button { padding: 9px 8px; font-size: 11px; }
  .layout-talk .talkcol, .page-chat:not(.is-onboard) .talkcol { height: auto; }
  .layout-document #flow { padding: 20px 14px; }
  .layout-document .story-panel { padding: 18px 12px; }
  .synopsis-editor { padding: 16px; font-size: 13px; }
}
