:root {
  --paper: #f6f0e4; --paper-2: #efe6d4; --card: #fffdf8; --ink: #1d2a44; --ink-2: #5a637a; --line: #e2d7c1;
  --accent: #c2531d; --accent-dark: #a44414; --gold: #b08a3c; --ok: #2f7d5b; --warm: #b8741a; --danger: #b3261e;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", "Songti SC", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Noto Sans", sans-serif;
  --r: 14px; --shadow: 0 1px 2px rgba(29, 42, 68, .06), 0 8px 24px rgba(29, 42, 68, .07);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font: 17px/1.5 var(--sans); -webkit-text-size-adjust: 100%; touch-action: manipulation; overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0; line-height: 1.2; letter-spacing: -.005em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; } h4 { font-size: .98rem; margin: 14px 0 8px; }
p { margin: 0; } img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid rgba(194, 83, 29, .45); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; } .ic.big { width: 44px; height: 44px; opacity: .45; }
.muted { color: var(--ink-2); } .small { font-size: .86rem; }
.eyebrow { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 650; }
.row { display: flex; align-items: center; } .gap { gap: 10px; } .end { justify-content: flex-end; } .between { justify-content: space-between; }
.center { justify-content: center; } .wrap { flex-wrap: wrap; } .grow { flex: 1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover:not(:disabled) { border-color: #cdbf9f; } .btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); } .btn.ghost:hover:not(:disabled) { background: rgba(29, 42, 68, .06); border-color: transparent; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: .9rem; } .btn.small .ic { width: 17px; height: 17px; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.on { background: #e9f3ed; border-color: #b9d8c7; color: var(--ok); }
.btn.apple { background: #111; border-color: #111; color: #fff; }
.wide-btn { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.danger-text { color: var(--danger) !important; }
.icon-btn { width: 46px; height: 46px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); position: relative; }
.icon-btn.on { color: var(--accent); border-color: #e6bfa9; background: #fdf1ea; }
.icon-btn.send { background: var(--accent); border-color: var(--accent); color: #fff; }
.icon-btn.rec { background: var(--danger); border-color: var(--danger); color: #fff; animation: pulse 1.4s infinite; }
.icon-btn.rec b { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: .75rem; color: var(--danger); background: var(--card); padding: 1px 7px; border-radius: 9px; border: 1px solid var(--line); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(179, 38, 30, .35); } 50% { box-shadow: 0 0 0 10px rgba(179, 38, 30, 0); } }

label { display: block; font-size: .86rem; font-weight: 600; color: var(--ink-2); margin: 12px 0 0; }
label small { display: block; font-weight: 400; margin-top: 4px; }
[hidden] { display: none !important; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; margin-top: 6px; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 1rem; font-weight: 400; color: var(--ink); }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(194, 83, 29, .15); }
input:disabled, select:disabled { background: var(--paper); color: var(--ink-2); }
form .btn[type=submit] { margin-top: 18px; } form .row { margin-top: 18px; } form .row .btn { margin-top: 0; }
.form-error { color: var(--danger); font-size: .92rem; margin-top: 12px; }

.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: #e3f1e9; color: var(--ok); } .chip.warm { background: #fbeed9; color: var(--warm); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; } .chips::-webkit-scrollbar { display: none; }
.chip-btn { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-size: .9rem; font-weight: 600; white-space: nowrap; flex: none; }
.chip-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.notice { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 12px; background: #fbeed9; color: #7a4a0d; font-size: .92rem; margin: 10px 0; }
.notice.error { background: #fbe4e2; color: #8a1d17; }
.empty { text-align: center; padding: 44px 20px; border: 1.5px dashed var(--line); border-radius: var(--r); display: grid; gap: 10px; justify-items: center; margin-top: 14px; }
.dots i { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--ink-2); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
#app { position: fixed; inset: 0; }
.boot { height: 100%; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); width: max-content; max-width: min(92vw, 460px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: .93rem; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); } #toast.error { background: #8a1d17; }
#sheet-root { display: none; } #sheet-root.open { display: block; }
.scrim { position: fixed; inset: 0; background: rgba(20, 26, 40, .45); z-index: 40; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow: auto; background: var(--card); border-radius: 22px 22px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); display: grid; gap: 10px; align-content: start; }
.menu { display: grid; margin-top: 6px; }
.menu button { display: flex; align-items: center; gap: 12px; min-height: 52px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; font-weight: 600; padding: 0 4px; }

/* ---------- gate + onboarding */
.gate { height: 100%; overflow: auto; display: grid; grid-template-rows: auto 1fr; }
.gate-art { position: relative; height: 34vh; min-height: 200px; }
.gate-art img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 60%; }
.gate-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(29, 42, 68, .1), rgba(29, 42, 68, .72)); }
.gate-art-text { position: absolute; left: 22px; right: 22px; bottom: 20px; color: #fff; z-index: 1; }
.gate-art-text h1 { font-size: 2.2rem; } .gate-art-text p { font-family: var(--serif); font-size: 1.1rem; opacity: .95; margin-top: 4px; }
.gate-panel { padding: 22px 18px 40px; display: grid; gap: 22px; align-content: start; justify-items: center; }
.gate-card, .onboard-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; box-shadow: var(--shadow); }
.gate-card h2, .onboard-card h2 { font-size: 1.55rem; margin-bottom: 6px; }
.gate-brand { display: none; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 600; color: var(--accent); margin-bottom: 18px; }
.google-slot { margin-top: 16px; min-height: 44px; display: grid; justify-items: center; } .btn.apple { margin-top: 10px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: .82rem; margin: 16px 0 0; } .or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.switch { margin-top: 16px; text-align: center; font-size: .94rem; color: var(--ink-2); }
.gate-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 440px; width: 100%; color: var(--ink-2); font-size: .96rem; }
.gate-points li { display: flex; gap: 12px; align-items: center; } .gate-points .ic { color: var(--accent); }
.onboard { height: 100%; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr); place-items: start center; padding: 28px 16px 40px; background: radial-gradient(1200px 500px at 50% -10%, #fff8ea, var(--paper)); }
.onboard .gate-brand { display: flex; } .onboard-card { max-width: 560px; min-width: 0; } .onboard-card .row { flex-wrap: wrap; } .onboard-card .row .grow { flex: 1 1 200px; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; } .steps i { height: 4px; flex: 1; border-radius: 4px; background: var(--line); } .steps i.on { background: var(--accent); }
.picker { display: grid; gap: 10px; margin: 16px 0; }
.pick { display: flex; align-items: center; gap: 14px; min-width: 0; text-align: left; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; }
.pick.on { border-color: var(--accent); background: #fdf3ec; box-shadow: 0 0 0 3px rgba(194, 83, 29, .12); }
.pick img { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; flex: none; }
.pick div { flex: 1; min-width: 0; display: grid; } .pick strong { font-family: var(--serif); font-size: 1.12rem; }
.pick span { font-size: .78rem; color: var(--accent); font-weight: 650; text-transform: uppercase; letter-spacing: .08em; } .pick small { color: var(--ink-2); font-size: .88rem; }

/* ---------- shell */
.shell { height: 100%; display: grid; grid-template-rows: auto 1fr auto; grid-template-areas: "top" "main" "tabs"; }
.top { grid-area: top; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 14px 8px; border-bottom: 1px solid var(--line); background: rgba(246, 240, 228, .92); }
.brand { display: flex; align-items: center; gap: 8px; background: none; border: 0; font-family: var(--serif); font-weight: 600; font-size: 1.08rem; color: var(--ink); padding: 6px 2px; } .brand .ic { color: var(--accent); width: 24px; height: 24px; }
.top-mid { flex: 1; min-width: 0; text-align: center; color: var(--ink-2); font-family: var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95rem; }
.save-state { background: none; border: 0; font-size: .78rem; color: var(--ink-2); padding: 6px; } .save-state[data-state=error] { color: var(--danger); font-weight: 650; }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-weight: 650; flex: none; }
.tabs { grid-area: tabs; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: var(--card); padding-bottom: env(safe-area-inset-bottom); }
.tab { display: grid; justify-items: center; gap: 2px; padding: 9px 4px 8px; background: none; border: 0; font-size: .74rem; font-weight: 600; color: var(--ink-2); min-height: 58px; }
.tab .ic { width: 23px; height: 23px; } .tab.on { color: var(--accent); }
.main { grid-area: main; overflow: auto; padding: 18px 16px 30px; scrollbar-width: thin; }
.main > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.in-session .tabs { display: none; } .in-session .main { padding: 0; overflow: hidden; display: flex; flex-direction: column; } .in-session .banner { display: none; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; background: #fff8ea; border: 1px solid #ecd9ae; border-radius: 14px; margin-bottom: 16px; font-size: .92rem; } .banner span { flex: 1; min-width: 180px; } .banner .ic { color: var(--gold); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; } .page-head.tight { align-items: center; }
.sub { margin: 28px 0 6px; }

/* ---------- interviews */
.hero-card { display: grid; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); }
.portrait { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 4px 16px rgba(29, 42, 68, .18); }
.hero-text { display: grid; gap: 8px; } .hero-text .row { margin-top: 6px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 10px; }
.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chapter { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; cursor: pointer; }
.chapter:hover { border-color: #cdbf9f; }
.num { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); font-family: var(--serif); font-weight: 600; }
.chapter-body { flex: 1; min-width: 0; } .chapter-body p { color: var(--ink-2); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.queue-note { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--accent); font-weight: 600; margin-top: 4px; } .queue-note .ic { width: 14px; height: 14px; }

.session { flex: 1; min-height: 0; width: 100%; max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; }
.session-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.session-title { flex: 1; min-width: 0; display: grid; } .session-title strong { font-family: var(--serif); font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .session-title span { font-size: .8rem; color: var(--ink-2); }
.seg { display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 3px; flex: none; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font-weight: 600; font-size: .9rem; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(29, 42, 68, .15); } .seg .ic { width: 17px; height: 17px; }
.seg.big { display: flex; width: 100%; max-width: 520px; } .seg.big button { flex: 1; justify-content: center; min-height: 42px; padding: 0 8px; }
.chat { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: none; } .chat::-webkit-scrollbar { display: none; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; } .msg img { width: 34px; height: 34px; border-radius: 50%; flex: none; object-fit: cover; }
.msg.me { align-self: flex-end; }
.bubble { padding: 11px 15px; border-radius: 18px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.ai .bubble { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; font-family: var(--serif); font-size: 1.08rem; }
.msg.me .bubble { background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.replay { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-left: 4px; vertical-align: middle; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--accent); } .replay .ic { width: 16px; height: 16px; }
.skipped { align-self: center; font-size: .78rem; color: var(--ink-2); }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 6px; }
.composer textarea { margin: 0; flex: 1; min-height: 46px; max-height: 180px; border-radius: 22px; resize: none; }
.composer.flat { padding: 0; }
.under-composer { text-align: center; padding: 0 0 6px; font-size: .86rem; } .under-composer .link { color: var(--ink-2); font-weight: 500; }
.session-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.call { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 26px 20px 20px; text-align: center; }
.call-face { position: relative; width: 148px; height: 148px; flex: none; } .call-face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 8px 30px rgba(29, 42, 68, .2); position: relative; z-index: 1; }
.ring { position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--accent); opacity: 0; }
body.speaking .ring { animation: ring 1.6s ease-out infinite; } .call-face.listening .ring { border-color: var(--danger); animation: ring 1.2s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.94); opacity: .7; } 100% { transform: scale(1.16); opacity: 0; } }
.call-state { font-size: .86rem; color: var(--ink-2); letter-spacing: .04em; } .call-state b { color: var(--danger); }
.call-question { margin: 0; font-family: var(--serif); font-size: 1.42rem; line-height: 1.35; max-width: 620px; min-height: 2.6em; }
.heard { max-width: 620px; font-size: 1.05rem; }
.call-btn { width: 92px; height: 92px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 28px rgba(194, 83, 29, .35); flex: none; } .call-btn .ic { width: 36px; height: 36px; }
.call-btn.rec { background: var(--danger); animation: pulse 1.4s infinite; }

/* ---------- materials */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 10px; }
.mat { position: relative; display: grid; grid-template-rows: auto auto; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.mat > img, .mat-note { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--paper-2); }
.mat-note { display: grid; align-content: start; gap: 8px; padding: 12px; font-family: var(--serif); font-size: .86rem; color: var(--ink-2); background: #fffaf0; overflow: hidden; }
.mat-meta { padding: 9px 11px 11px; display: grid; } .mat-meta strong { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .mat-meta span { font-size: .78rem; color: var(--ink-2); }
.mat-badge { position: absolute; top: 8px; left: 8px; background: rgba(29, 42, 68, .86); color: #fff; font-size: .72rem; font-weight: 650; padding: 3px 9px; border-radius: 999px; }
.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0; }
.add-opt { margin: 0; display: grid; gap: 4px; justify-items: start; text-align: left; padding: 16px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; color: var(--ink); }
.add-opt .ic { color: var(--accent); width: 26px; height: 26px; } .add-opt strong { font-size: .98rem; font-weight: 650; } .add-opt span { font-size: .8rem; color: var(--ink-2); font-weight: 400; }
.mat-detail { display: grid; gap: 16px; } .mat-view img { width: 100%; max-height: 46dvh; object-fit: contain; border-radius: 12px; background: var(--paper-2); }
.mat-text, .transcript { font-family: var(--serif); background: #fffaf0; border: 1px solid var(--line); border-radius: 12px; padding: 14px; max-height: 40dvh; overflow: auto; } .mat-text p, .transcript p { margin-bottom: .7em; }
.block { margin-top: 14px; } .block h4 { margin-top: 0; }
.q { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 11px 13px; margin-top: 8px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-family: var(--serif); font-size: .98rem; } .q .ic { color: var(--accent); } .q:hover { border-color: var(--accent); }
.mat-side > .row:last-child { margin-top: 16px; }

/* ---------- studio */
.studio { display: grid; gap: 16px; }
.studio-chapters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; } .studio-chapters::-webkit-scrollbar { display: none; }
.studio-chapters button { display: flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 5px 12px 5px 6px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font-weight: 600; font-size: .9rem; }
.studio-chapters button.on { border-color: var(--ink); background: var(--ink); color: #fff; } .studio-chapters .num { width: 28px; height: 28px; font-size: .85rem; color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; } .dot.ok { background: var(--ok); } .dot.warm { background: var(--warm); }
.stage { min-width: 0; display: grid; gap: 12px; align-content: start; }
.stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.paper { background: #fffefb; border: 1px solid var(--line); border-radius: 6px; padding: 34px 26px; box-shadow: var(--shadow); position: relative; }
.paper h2 { font-size: 1.8rem; margin: 6px 0 20px; } .paper.working .prose { opacity: .45; }
.prose { font-family: var(--serif); font-size: 1.12rem; line-height: 1.75; } .prose p { margin: 0 0 1em; } .prose p:last-child { margin: 0; }
.dropcap p:first-child::first-letter { float: left; font-size: 3.3em; line-height: .86; padding: .06em .08em 0 0; color: var(--accent); }
.empty-page { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 50px 24px; }
.hand { font-family: var(--serif); font-size: 1.08rem; line-height: 1.7; min-height: 360px; }
.working-note { margin-top: 16px; color: var(--ink-2); font-size: .9rem; }
.editor-bar { position: sticky; bottom: -18px; margin-top: 6px; background: linear-gradient(180deg, rgba(246, 240, 228, 0), var(--paper) 22%); padding: 22px 0 14px; display: grid; gap: 8px; }
.quick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.team { display: grid; gap: 10px; align-content: start; } .team-title { font-size: 1rem; color: var(--ink-2); }
.agent { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.agent-head { display: flex; gap: 12px; align-items: center; } .agent-head div { display: grid; min-width: 0; } .agent-head span { font-size: .84rem; color: var(--ink-2); }
.agent-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; flex: none; color: var(--accent); overflow: hidden; } .agent-ic img { width: 100%; height: 100%; object-fit: cover; }
.agent .btn { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .88rem; } .timeline li { display: grid; grid-template-columns: 46px 1fr; gap: 8px; } .timeline b { font-family: var(--serif); color: var(--accent); }
.agent .q { margin-top: 0; font-size: .92rem; padding: 9px 11px; }

.spread { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; scrollbar-width: none; } .spread::-webkit-scrollbar { display: none; }
.pg { flex: none; width: min(84vw, 420px); aspect-ratio: 5 / 7.2; background: #fffefb; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 7% 8% 9%; position: relative; overflow: hidden; scroll-snap-align: center; display: flex; flex-direction: column; gap: 4%; }
.pg figure { margin: 0; } .pg figure img { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; } .pg figcaption { font-family: var(--serif); font-style: italic; font-size: .72rem; color: var(--ink-2); margin-top: 5px; text-align: center; }
.pg-empty { aspect-ratio: 4 / 3.4; border: 1.5px dashed var(--line); display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; font-size: .8rem; color: var(--ink-2); padding: 12px; }
.pg-open { text-align: center; margin-top: 8%; } .pg-open span { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); } .pg-open h2 { font-size: 1.6rem; margin-top: 8px; }
.pg .prose { font-size: .74rem; line-height: 1.6; text-align: justify; hyphens: auto; } .pg .prose p { margin-bottom: .55em; }
.pull { margin: 0; padding: 0 6%; font-family: var(--serif); font-style: italic; font-size: .95rem; line-height: 1.4; color: var(--accent); text-align: center; }
.pg-pics { display: grid; grid-template-columns: 1fr 1fr; gap: 6%; margin-top: auto; } .pg-pics img { aspect-ratio: 1 !important; }
.folio { position: absolute; bottom: 3.5%; left: 0; right: 0; text-align: center; font-family: var(--serif); font-style: normal; font-size: .7rem; color: var(--ink-2); }
.tray { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; } .tray h4 { margin: 0; }
.tray-row { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px; scrollbar-width: thin; }
.tray-item { position: relative; flex: none; width: 74px; height: 74px; padding: 0; border: 2.5px solid transparent; border-radius: 10px; overflow: hidden; background: var(--paper-2); font-size: .78rem; color: var(--ink-2); }
.tray-item img { width: 100%; height: 100%; object-fit: cover; } .tray-item.on { border-color: var(--accent); }
.tray-item b { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .72rem; display: grid; place-items: center; }
.cover-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; justify-items: center; } .cover-form { width: 100%; max-width: 480px; min-width: 0; } .cover-form .btn { margin-top: 12px; } .ideas { margin-top: 6px; }
.cover-wrap { width: min(72vw, 300px); } .cover-wrap.small { width: 128px; flex: none; }
.cover { aspect-ratio: 5 / 7.4; border-radius: 4px 8px 8px 4px; box-shadow: -3px 0 0 rgba(0, 0, 0, .18) inset, 0 14px 34px rgba(29, 42, 68, .3); display: flex; flex-direction: column; overflow: hidden; position: relative; container-type: inline-size; }
.cover-text { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 9cqw 9cqw; gap: 3cqw; }
.cover h2 { font-size: 10.500cqw; line-height: 1.08; } .cover p { font-family: var(--serif); font-style: italic; font-size: 4.800cqw; opacity: .9; } .cover span { font-size: 4cqw; letter-spacing: .18em; text-transform: uppercase; margin-top: 4cqw; }
.rule { width: 16cqw; height: 2px; background: currentColor; opacity: .7; }
.cover-photo img { width: 100%; height: 100%; object-fit: cover; }
.c-navy { background: #1d2a44; color: #f6f0e4; } .c-navy .rule { background: #e07a3f; opacity: 1; } .c-navy .cover-photo { width: 52cqw; height: 52cqw; border-radius: 50%; overflow: hidden; margin: 12cqw auto 0; border: 1.200cqw solid #f6f0e4; flex: none; }
.c-ivory { background: #f8f2e6; color: #1d2a44; border: 1px solid var(--line); } .c-ivory .cover-photo { height: 56%; flex: none; margin: 6cqw 6cqw 0; } .c-ivory .rule { background: var(--accent); opacity: 1; }
.c-rust { background: linear-gradient(160deg, #c2531d, #9b3f12); color: #fff8ee; } .c-rust .cover-photo { width: 62cqw; height: 46cqw; margin: 12cqw auto 0; border: 1.600cqw solid #fff8ee; flex: none; }
.c-photo { background: #1d2a44; color: #fff; } .c-photo .cover-photo { position: absolute; inset: 0; } .c-photo .cover-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 26, 40, .1) 30%, rgba(20, 26, 40, .88)); }
.c-photo.has-photo .cover-text { position: relative; justify-content: flex-end; }
.cover-wrap.small .cover { box-shadow: -2px 0 0 rgba(0, 0, 0, .18) inset, 0 6px 16px rgba(29, 42, 68, .25); }
.proof-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; } .proof-stats div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; } .proof-stats b { font-family: var(--serif); font-size: 1.5rem; } .proof-stats span { font-size: .8rem; color: var(--ink-2); }
.checks { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; } .checks h4 { margin-top: 0; }
.check { display: flex; align-items: center; gap: 12px; min-height: 46px; margin: 0; font-size: .96rem; color: var(--ink); font-weight: 500; border-top: 1px solid var(--line); cursor: pointer; } .check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.reader section { margin-top: 46px; } .reader h3 { font-size: 1.5rem; margin: 6px 0 16px; } .reader figure { margin: 0 0 18px; } .reader figure img { width: 100%; max-height: 420px; object-fit: cover; } .reader figcaption { font-family: var(--serif); font-style: italic; font-size: .86rem; color: var(--ink-2); margin-top: 6px; text-align: center; }
.title-page { text-align: center; padding: 30px 0 10px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 34px; } .title-page h2 { font-size: 2.2rem; margin: 0; } .title-page p { font-family: var(--serif); font-style: italic; } .title-page span { letter-spacing: .16em; text-transform: uppercase; font-size: .8rem; margin-top: 12px; } .title-page em { font-family: var(--serif); color: var(--ink-2); margin-top: 12px; }

/* ---------- publish */
.pub-summary { display: flex; gap: 18px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); }
.pub-facts { display: grid; gap: 10px; min-width: 0; }
.formats, .partners { display: grid; gap: 10px; margin-top: 12px; }
.format, .partner { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.format p, .partner p { font-size: .9rem; color: var(--ink-2); } .partner small { font-size: .78rem; color: var(--ink-2); opacity: .85; }
.format .btn, .partner .btn { grid-column: 1 / -1; justify-self: start; }
.format-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--paper-2); color: var(--accent); display: grid; place-items: center; }

/* ---------- wider screens */
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(520px, 92vw); border-radius: 22px; padding: 26px; }
  .sheet.wide { width: min(940px, 94vw); }
  .mat-detail { grid-template-columns: 1.1fr 1fr; align-items: start; } .mat-view img { max-height: 72dvh; }
  .hero-card { grid-template-columns: auto 1fr; align-items: center; padding: 26px; } .portrait { width: 120px; height: 120px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .proof-stats { grid-template-columns: repeat(4, 1fr); }
  .format, .partner { grid-template-columns: auto 1fr auto; } .format .btn, .partner .btn { grid-column: auto; }
  .formats { grid-template-columns: 1fr 1fr; }
  .cover-stage { grid-template-columns: auto 1fr; justify-items: start; align-items: start; gap: 34px; }
  .paper { padding: 48px 56px; }
  #toast { bottom: 34px; }
}
@media (min-width: 960px) {
  .gate { grid-template-columns: 1.1fr 1fr; grid-template-rows: 1fr; } .gate-art { height: 100%; } .gate-art img { object-position: 78% 50%; }
  .gate-art-text { left: 48px; bottom: 56px; } .gate-art-text h1 { font-size: 3.4rem; } .gate-art-text p { font-size: 1.5rem; }
  .gate-panel { display: flex; flex-direction: column; align-items: center; padding: 40px; overflow: auto; } .gate-panel > :first-child { margin-top: auto; } .gate-panel > :last-child { margin-bottom: auto; } .gate-brand { display: flex; }
  .shell { grid-template-columns: 224px 1fr; grid-template-rows: auto 1fr; grid-template-areas: "top top" "tabs main"; }
  .top { padding: 10px 22px; } .brand { font-size: 1.2rem; }
  .tabs { grid-template-columns: 1fr; align-content: start; gap: 4px; border-top: 0; border-right: 1px solid var(--line); background: transparent; padding: 18px 12px; }
  .tab { display: flex; align-items: center; justify-items: start; gap: 12px; padding: 0 14px; min-height: 48px; border-radius: 12px; font-size: .98rem; } .tab.on { background: var(--card); box-shadow: var(--shadow); }
  .in-session .tabs { display: grid; }
  .main { padding: 26px 30px 40px; }
  .chat { padding: 22px 20px 8px; } .msg { max-width: 76%; }
  .pg { width: min(40vw, 400px); } .spread { justify-content: center; gap: 0; } .pg.left { border-right: 0; box-shadow: inset -14px 0 18px -14px rgba(29, 42, 68, .18), var(--shadow); }
}
@media (min-width: 1180px) {
  .studio { grid-template-columns: 196px minmax(0, 1fr) 300px; align-items: start; } .studio.no-chapters { grid-template-columns: minmax(0, 1fr) 300px; }
  .studio-chapters { flex-direction: column; overflow: visible; position: sticky; top: 0; }
  .studio-chapters button { border-radius: 12px; width: 100%; text-align: left; } .studio-chapters .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .team { position: sticky; top: 0; }
  .pg { width: min(27vw, 400px); }
}

/* ---------- print (book export) */
#print-root { display: none; }
@media print {
  @page { size: A5; margin: 18mm 16mm 20mm; }
  html, body { height: auto; overflow: visible; background: #fff; }
  #app, #sheet-root, #toast { display: none !important; }
  #print-root { display: block; font-family: var(--serif); color: #111; font-size: 11pt; line-height: 1.55; }
  #print-root section { break-before: page; } #print-root section:first-child { break-before: auto; }
  .p-title { text-align: center; padding-top: 40%; } .p-title h1 { font-size: 26pt; } .p-title p { font-style: italic; margin-top: 8pt; } .p-title span { display: block; margin-top: 40pt; letter-spacing: .16em; text-transform: uppercase; font-size: 9pt; } .p-kicker { letter-spacing: .14em; text-transform: uppercase; font-style: normal !important; font-size: 9pt; }
  .p-dedication { text-align: center; padding-top: 45%; } .p-contents h2 { text-align: center; margin-bottom: 18pt; } .p-contents ol { line-height: 2; }
  .p-num { display: block; text-align: center; letter-spacing: .2em; text-transform: uppercase; font-size: 8pt; margin-top: 30pt; } .p-chapter h2 { text-align: center; font-size: 20pt; margin: 8pt 0 22pt; }
  .p-prose p { margin: 0; text-indent: 1.4em; text-align: justify; orphans: 2; widows: 2; } .p-prose p:first-child { text-indent: 0; }
  #print-root figure { margin: 0 0 16pt; break-inside: avoid; text-align: center; } #print-root figure img { max-width: 100%; max-height: 90mm; margin: 0 auto; } #print-root figcaption { font-style: italic; font-size: 8.500pt; margin-top: 4pt; }
}

.chips.wrap { flex-wrap: wrap; overflow: visible; }
