:root{
  color-scheme:dark;
  --bg:#0c0c0f;--surface:#121216;--surface-2:#1a1a20;--surface-3:#23232b;--line:#26262e;--line-2:#33333d;
  --text:#ececf1;--muted:#8d8d99;--faint:#5f5f6b;--narr:#a7a7b4;
  --accent:#6b5bd6;--accent-hi:#7d6ee6;--accent-soft:rgba(107,91,214,.14);--accent-text:#c9c0ff;
  --her:#1e1e25;--ok:#3fb37f;--ok-soft:rgba(63,179,127,.16);--bad:#d65b5b;--bad-soft:rgba(214,91,91,.14);--live:#7fd4a8;--warn:#d6a35b;
  --r:18px;--ease:cubic-bezier(.2,.8,.2,1);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font:15px/1.45 Geist,-apple-system,system-ui,"Segoe UI",sans-serif}
body.app{overflow:hidden}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;padding:0}
a{color:var(--accent-text)}
button:focus-visible,textarea:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible,.sw input:focus-visible+i{outline:2px solid var(--accent-hi);outline-offset:2px}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
[hidden]{display:none!important}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:9px 18px;border-radius:12px;background:var(--accent);color:#fff;font-weight:500;transition:background .15s,opacity .15s}
.btn:hover{background:var(--accent-hi)}.btn:disabled{opacity:.5;cursor:default}
.btn.ghost{background:var(--surface-2);border:1px solid var(--line-2);color:var(--text)}.btn.ghost:hover{background:var(--surface-3)}
.btn.danger{background:none;border:1px solid rgba(214,91,91,.4);color:#eba3a3}.btn.danger:hover{background:var(--bad-soft)}
.btn.sm{min-height:32px;padding:5px 12px;font-size:13px;border-radius:10px}
.icon{width:40px;height:40px;display:grid;place-items:center;border-radius:12px;color:var(--muted);transition:background .15s,color .15s}
.icon:hover{background:var(--surface-2);color:var(--text)}

input[type=text],input[type=email],input[type=password],input[type=number],select,textarea.in{width:100%;font:inherit;font-size:16px;color:var(--text);background:var(--surface-2);border:1px solid var(--line-2);border-radius:12px;padding:10px 13px;outline:0;transition:border-color .15s}
input:focus,select:focus,textarea.in:focus{border-color:var(--accent)}
label.f{display:block;margin-bottom:14px}label.f>span{display:block;font-size:13px;color:var(--muted);margin-bottom:6px}
.check{display:flex;gap:10px;align-items:flex-start;font-size:14px;margin:10px 0;cursor:pointer}.check input{margin-top:3px;accent-color:var(--accent);width:18px;height:18px;flex:none}
.err{color:#eba3a3;font-size:13.5px;min-height:20px;margin:6px 0}

/* invite: the first page of the book prepared for that person (05-nov) */
.invite-page{min-height:100dvh;display:flex;flex-direction:column;align-items:center;padding:0 0 calc(40px + env(safe-area-inset-bottom))}
.inv-cover{width:100%;max-width:720px;position:relative;aspect-ratio:1/1;max-height:62vh;overflow:hidden}
.inv-cover img{width:100%;height:100%;object-fit:cover;object-position:50% 30%;display:block;animation:inv-in 1.2s var(--ease) both}
.inv-cover::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(17,14,11,0) 45%,var(--bg) 98%)}
@keyframes inv-in{from{opacity:0;transform:scale(1.04)}}
.inv-sheet{position:relative;width:min(100%,600px);padding:32px 22px 0}
.inv-cover:not([hidden])+.inv-sheet{margin-top:-110px}
.inv-sheet .brand{margin-bottom:22px}
body.book .inv-sheet .brand{display:none}
.inv-sheet h1{margin:6px 0 6px;font-size:26px;font-weight:600}
body.book .inv-sheet h1{font:600 clamp(32px,8vw,44px)/1.08 Literata,Georgia,serif;letter-spacing:-.015em;text-wrap:balance}
.inv-tag{margin:0 0 22px;color:var(--muted)}
body.book .inv-tag{font:italic 16px/1.5 Literata,Georgia,serif;margin-bottom:28px}
.inv-letter{font:400 18px/1.75 Literata,Georgia,serif;color:var(--text);hyphens:auto;-webkit-hyphens:auto;text-wrap:pretty}
.inv-letter:empty{display:none}
.inv-letter .greet{font-style:italic;color:var(--accent-text);margin:0 0 10px}
.inv-letter p{margin:0}.inv-letter p+p{text-indent:1.4em}
.inv-letter p.first{text-indent:0}
.inv-letter p.first::first-letter{float:left;font-size:3.3em;line-height:.82;padding:.06em .04em 0 0;color:var(--accent-text);font-weight:600}
.inv-letter p.last{margin-top:14px;text-indent:0;font-style:italic;color:var(--muted)}
.orn{text-align:center;color:var(--accent-text);letter-spacing:.3em;margin:34px 0 18px;font-size:18px}
.inv-sign{margin:0 0 4px;text-align:center;font:600 22px/1.3 Literata,Georgia,serif}
.inv-for{margin:0 0 20px;text-align:center;color:var(--muted);font-size:13.5px}.inv-for:empty{display:none}
.inv-go{width:100%;margin-top:6px}
body.book .inv-go{min-height:50px;font:600 17px Literata,Georgia,serif;letter-spacing:.01em}
body.book .terms{background:var(--surface);font-size:12.5px}
@media (prefers-reduced-motion:reduce){.inv-cover img{animation:none}}
.key-ic{display:none}
body.book .auth .box{background:var(--surface);text-align:center}
body.book .auth .brand{display:none}
body.book .key-ic{display:block;width:54px;height:54px;margin:4px auto 14px;color:var(--accent-text);stroke-width:1.4}
body.book .auth h1{font:600 30px/1.15 Literata,Georgia,serif}
body.book .auth p.sub{font:400 16.5px/1.65 Literata,Georgia,serif;color:var(--muted)}
body.book #pk-now{min-height:50px;font:600 17px Literata,Georgia,serif}

/* auth screens */
.auth{min-height:100dvh;display:grid;place-items:center;padding:24px 16px}
.auth .box{width:100%;max-width:420px;background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:28px 24px}
.auth h1{margin:0 0 4px;font-size:24px;font-weight:600}.auth p.sub{margin:0 0 22px;color:var(--muted)}
.auth p.sub+p.sub{margin-top:-16px}.auth p.sub:empty{display:none}
.pw-login{margin-top:14px}.pw-login summary{cursor:pointer;color:var(--muted);font-size:14px;text-align:center;list-style:none;padding:6px}
.pw-login summary::-webkit-details-marker{display:none}.pw-login[open] summary{margin-bottom:12px}
#pk-list{display:flex;flex-direction:column;gap:8px;margin:4px 0 14px}
.pk{display:flex;align-items:center;gap:10px;background:var(--surface-2);border:1px solid var(--line);border-radius:14px;padding:10px 12px}
.pk>div{flex:1;min-width:0}.pk b{display:block;font-size:14px}.pk small{color:var(--muted);font-size:12px}
.terms{font-size:13px;color:var(--muted);background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:12px 14px;max-height:180px;overflow:auto;line-height:1.5}
.terms li{margin-bottom:6px}
.brand{display:flex;align-items:center;gap:10px;margin-bottom:18px;font-weight:600}
.brand i{width:30px;height:30px;border-radius:9px;background:var(--accent);display:grid;place-items:center;font-style:normal}

/* top bar (characters, account) */
.top{display:flex;align-items:center;gap:10px;padding:12px 16px;padding-top:calc(12px + env(safe-area-inset-top));background:var(--surface);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:5}
.top b{flex:1;font-size:17px;font-weight:600}
.page{max-width:980px;margin:0 auto;padding:20px 16px calc(40px + env(safe-area-inset-bottom))}
.page h2{font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;margin:6px 0 14px}
.scroll{height:100dvh;overflow-y:auto}

/* character picker */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:14px}
.card{display:flex;flex-direction:column;gap:12px;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:18px;transition:border-color .15s,transform .15s var(--ease),background .15s}
.card:hover{border-color:var(--line-2);background:var(--surface-2);transform:translateY(-1px)}
.card .row1{display:flex;gap:12px;align-items:center}
.card b{display:block;font-size:17px;font-weight:600}.card small{color:var(--muted);font-size:13px}
.card .tag{font-size:14px}.card .premise{font-size:13px;color:var(--muted);line-height:1.45}
.card .last{font-size:13px;color:var(--faint);border-top:1px solid var(--line);padding-top:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card .last.new{color:var(--accent-text)}
.avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;font-weight:600;font-size:17px;position:relative;flex:none;color:#fff;background:var(--accent)}
.avatar.sm{width:40px;height:40px;font-size:16px}
.avatar.lg{width:64px;height:64px;font-size:22px}
.avatar img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block}
.look{font-size:13px;color:var(--narr);line-height:1.45}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chips span{font-size:12px;padding:3px 10px;border-radius:999px;background:var(--surface-3);border:1px solid var(--line-2);color:var(--text)}
.profile{display:flex;flex-direction:column;gap:6px;margin-bottom:18px}
.profile:empty{display:none}
.profile .hero{width:100%;aspect-ratio:1;object-fit:cover;border-radius:16px;margin-bottom:6px}
.profile b{font-size:17px;font-weight:600}.profile small{color:var(--muted);font-size:13px}
.profile p{margin:2px 0 4px;font-size:13px;color:var(--narr);line-height:1.45}
.avatar.on::after{content:"";position:absolute;right:0;bottom:0;width:11px;height:11px;border-radius:50%;background:var(--ok);border:2px solid var(--surface)}

/* chat layout */
#chatview{display:flex;height:var(--app-h,100dvh)}
#chat{flex:1;min-width:0;display:flex;flex-direction:column;position:relative}
#chat header{display:flex;align-items:center;gap:8px;padding:10px 12px 10px 8px;padding-top:calc(10px + env(safe-area-inset-top));background:var(--surface);border-bottom:1px solid var(--line);z-index:5}
.who-btn{flex:1;min-width:0;display:flex;align-items:center;gap:11px;text-align:left;border-radius:12px;padding:2px 4px 2px 2px}
.who{min-width:0}.who b{display:block;font-weight:600;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.who small{display:block;color:var(--muted);font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.who small.t{color:var(--live)}
#msgs{flex:1;overflow-y:auto;overscroll-behavior:contain}
#list{max-width:780px;margin:0 auto;padding:18px 16px 12px;display:flex;flex-direction:column}
.b{max-width:min(80%,560px);padding:8px 12px 7px;border-radius:var(--r);white-space:pre-wrap;overflow-wrap:anywhere;margin-top:3px}
.b.new{animation:pop .24s var(--ease)}
@keyframes pop{from{opacity:0;transform:translateY(6px)}}
.me{align-self:flex-end;background:var(--accent);color:#fff;border-bottom-right-radius:6px}
.her{align-self:flex-start;background:var(--her);border-bottom-left-radius:6px}
.me+.her,.her+.me,.meta+.me,.alts+.me,.time+.b,.sys+.b,.b+.sys{margin-top:16px}
.ts{float:right;font-size:10.5px;line-height:1;margin:7px -2px -3px 10px;color:rgba(255,255,255,.6);font-variant-numeric:tabular-nums}
.her .ts{color:var(--faint)}
.rol{max-width:min(94%,640px);background:var(--surface-2);border:1px solid var(--line);border-radius:16px;border-bottom-left-radius:6px;padding:11px 15px 9px;line-height:1.55}
.rol em{color:var(--narr);font-style:italic}
.time{align-self:center;color:var(--muted);font-size:12px;background:var(--surface-2);border:1px solid var(--line);border-radius:999px;padding:4px 13px;margin:18px 0 6px}
.sys{align-self:center;max-width:92%;text-align:center;color:#eba3a3;font-size:12.5px;background:var(--bad-soft);border:1px solid rgba(214,91,91,.25);border-radius:12px;padding:6px 12px;margin-top:12px}
.meta{align-self:flex-start;display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:7px 0 2px 2px;font-size:12px;color:var(--muted)}
.meta .mm{padding-right:2px;color:var(--faint)}
.meta button{display:inline-flex;align-items:center;gap:5px;min-height:28px;padding:3px 10px;border-radius:999px;border:1px solid var(--line-2);color:var(--muted);transition:background .15s,color .15s,border-color .15s}
.meta button:hover{color:var(--text);border-color:var(--faint)}
.meta button.ok{background:var(--ok-soft);border-color:var(--ok);color:#9fe3c2}
.meta button.bad{background:var(--bad-soft);border-color:var(--bad);color:#f0a9a9}
.meta .alt-btn{color:var(--accent-text);border-color:rgba(107,91,214,.45)}
.meta .alt-btn:disabled{opacity:.6;cursor:progress}
.meta .use{background:var(--accent);border-color:var(--accent);color:#fff}.meta .use:hover{background:var(--accent-hi);color:#fff}
.alts{align-self:stretch;margin:8px 0 4px 6px;padding:10px 12px 8px;border-left:2px solid var(--accent);background:linear-gradient(90deg,var(--accent-soft),transparent 85%);border-radius:0 14px 14px 0;display:flex;flex-direction:column;gap:10px}
.alts:empty{display:none}
.alt{display:flex;flex-direction:column}.alt+.alt{padding-top:10px;border-top:1px dashed var(--line-2)}
.alt .b{max-width:min(90%,560px)}.alt .meta{margin-left:0}
body.nocmp .alt-btn,body.nocmp .alts{display:none!important}
.typing{align-self:flex-start;background:var(--her);border-radius:var(--r);border-bottom-left-radius:6px;padding:12px 14px;display:none;gap:4px;margin-top:10px}
.typing.on{display:flex}
.typing i{width:7px;height:7px;border-radius:50%;background:var(--muted);animation:d 1.2s infinite}
.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}
@keyframes d{0%,60%,100%{opacity:.3;transform:none}30%{opacity:1;transform:translateY(-2px)}}
#down{position:absolute;right:16px;bottom:calc(var(--composer-h,72px) + 12px);width:42px;height:42px;border-radius:50%;background:var(--surface-3);border:1px solid var(--line-2);color:var(--text);display:grid;place-items:center;box-shadow:0 6px 20px rgba(0,0,0,.4);opacity:0;transform:translateY(8px) scale(.9);pointer-events:none;transition:opacity .18s,transform .18s var(--ease)}
#down.on{opacity:1;transform:none;pointer-events:auto}
#down span{position:absolute;top:-6px;right:-4px;min-width:20px;height:20px;border-radius:999px;background:var(--accent);font-size:11px;font-weight:600;display:grid;place-items:center;padding:0 5px}
#down span:empty{display:none}
#composer{background:var(--surface);border-top:1px solid var(--line);padding:10px 12px calc(10px + env(safe-area-inset-bottom))}
.field{max-width:780px;margin:0 auto;display:flex;align-items:flex-end;gap:8px;background:var(--surface-2);border:1px solid var(--line-2);border-radius:24px;padding:5px 5px 5px 16px;transition:border-color .15s}
.field:focus-within{border-color:var(--accent)}
#t{flex:1;resize:none;font:inherit;font-size:16px;color:var(--text);background:none;border:0;outline:0;padding:7px 0;max-height:160px;line-height:1.4}
#t::placeholder{color:var(--faint)}
#send{width:38px;height:38px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;flex:none;transition:background .15s,opacity .15s,transform .1s}
#send:hover{background:var(--accent-hi)}#send:active{transform:scale(.94)}
#send:disabled{opacity:.35;cursor:default;background:var(--accent)}
#send svg{stroke-width:2.2}
.lockbar{max-width:780px;margin:0 auto;text-align:center;color:#eba3a3;font-size:13.5px;padding:8px}

/* side panel (desktop) / bottom sheet (mobile) */
#panel{width:360px;flex:none;background:var(--surface);border-left:1px solid var(--line);overflow-y:auto;overscroll-behavior:contain}
.ph{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:8px;padding:14px 12px 12px 20px;background:var(--surface);border-bottom:1px solid var(--line)}
.ph b{flex:1;font-weight:600}
.grab{display:none}
#panel section{padding:18px 20px;border-bottom:1px solid var(--line);transition:background .6s}
#panel section.flash{background:var(--accent-soft)}
#panel section:last-child{border-bottom:0;padding-bottom:calc(24px + env(safe-area-inset-bottom))}
h3{margin:0 0 12px;font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:40px;font-size:14px}
.row+.row{margin-top:6px}
.row small{display:block;color:var(--muted);font-size:12px;line-height:1.35;margin-top:2px}
.seg{display:flex;background:var(--bg);border:1px solid var(--line);border-radius:11px;padding:3px;gap:2px;flex-wrap:wrap;justify-content:flex-end}
.seg button{padding:6px 12px;border-radius:8px;font-size:13px;color:var(--muted);white-space:nowrap;transition:background .15s,color .15s}
.seg button:hover{color:var(--text)}
.seg button.on{background:var(--accent);color:#fff}
.sw{cursor:pointer}
.sw input{position:absolute;opacity:0;pointer-events:none}
.sw i{flex:none;width:42px;height:24px;border-radius:999px;background:var(--surface-3);border:1px solid var(--line-2);position:relative;transition:background .2s}
.sw i::after{content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:#cfcfd8;transition:transform .2s var(--ease)}
.sw input:checked+i{background:var(--accent);border-color:var(--accent)}
.sw input:checked+i::after{transform:translateX(18px);background:#fff}
.clock{font-size:13px;color:var(--muted);margin:-4px 0 12px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:8px}
.grid3 button{padding:11px 6px;border-radius:12px;background:var(--surface-2);border:1px solid var(--line-2);font-size:13.5px;transition:background .15s,border-color .15s}
.grid3 button:hover{background:var(--surface-3);border-color:var(--faint)}
#mem .mcard{background:var(--surface-2);border:1px solid var(--line);border-radius:14px;padding:12px 14px;margin-bottom:10px}
#mem .mcard>b{display:block;font-size:13px;margin-bottom:6px}
#mem dl{margin:0;font-size:13px}#mem dt{color:var(--muted);font-size:11.5px;margin-top:8px}#mem dd{margin:1px 0 0}
.empty{color:var(--faint);font-size:13px;margin:0}
.meter{margin:9px 0}.meter span{display:flex;justify-content:space-between;font-size:12.5px;color:var(--muted);margin-bottom:4px}
.meter i{display:block;height:6px;border-radius:6px;background:var(--surface-3);overflow:hidden}
.meter i b{display:block;height:100%;border-radius:6px;background:var(--accent);transition:width .4s var(--ease)}
.meter.anger i b{background:var(--bad)}
.pill{display:inline-block;padding:2px 9px;border-radius:999px;font-size:12px;background:var(--surface-3);border:1px solid var(--line-2);color:var(--text)}
#scrim{display:none}
#toast{position:fixed;left:50%;top:calc(70px + env(safe-area-inset-top));transform:translate(-50%,-10px);background:var(--surface-3);border:1px solid var(--line-2);padding:9px 16px;border-radius:12px;font-size:13.5px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s var(--ease);z-index:40;max-width:calc(100vw - 32px)}
#toast.on{opacity:1;transform:translate(-50%,0)}

@media (min-width:1024px){ .only-m{display:none!important} }
@media (max-width:1023px){
  #panel{position:fixed;left:0;right:0;bottom:0;width:auto;max-height:86dvh;border:1px solid var(--line-2);border-bottom:0;border-radius:22px 22px 0 0;transform:translateY(102%);transition:transform .3s var(--ease);z-index:30;box-shadow:0 -12px 40px rgba(0,0,0,.5)}
  body.panel #panel{transform:none}
  .ph{padding-top:22px;border-radius:22px 22px 0 0}
  .grab{display:block;position:absolute;top:8px;left:50%;width:38px;height:4px;margin-left:-19px;border-radius:4px;background:var(--line-2)}
  #scrim{display:block;position:fixed;inset:0;background:rgba(0,0,0,.55);opacity:0;pointer-events:none;transition:opacity .25s;z-index:29}
  body.panel #scrim{opacity:1;pointer-events:auto}
}
@media (max-width:480px){
  #list{padding:14px 12px 10px}
  .b{max-width:86%}.rol{max-width:96%}
  .icon{width:38px;height:38px}
  .auth .box{padding:24px 18px}
}
@media (prefers-reduced-motion:reduce){ *{animation:none!important;transition:none!important} }

/* story mode: the chat reads as a novel */
.card.story{position:relative;overflow:hidden;background:linear-gradient(170deg,#1f1813,var(--surface) 60%);border-color:#3a2c22}
.card.story:hover{background:linear-gradient(170deg,#261d16,var(--surface-2) 60%);border-color:#54402f}
.card.story .cover{width:calc(100% + 36px);margin:-18px -18px 2px;aspect-ratio:16/9;object-fit:cover;object-position:center 22%;display:block}
.kicker{font-size:11px!important;letter-spacing:.12em;text-transform:uppercase;color:#d29a72!important}
.btitle{font:600 23px/1.2 Literata,Georgia,serif!important;letter-spacing:-.01em}
body.book{--bg:#110e0b;--surface:#16120e;--surface-2:#1e1913;--surface-3:#2a221a;--line:#2b231b;--line-2:#3b3025;--text:#ece3d4;--muted:#a3937f;--faint:#6f6252;
  --accent:#b5623a;--accent-hi:#c8714a;--accent-soft:rgba(181,98,58,.14);--accent-text:#f0b48f}
body.book .no-book,body.book:not(.admin) .dev-book,body.book:not(.admin) .meta{display:none!important}
body.book #chat header{background:color-mix(in srgb,var(--surface) 92%,transparent);backdrop-filter:blur(8px)}
body.book .who b{font:600 17px/1.25 Literata,Georgia,serif}
body.book #list{max-width:700px;padding:28px 22px 18px}
.chap{align-self:stretch;text-align:center;font:600 clamp(24px,5vw,32px)/1.2 Literata,Georgia,serif;color:var(--text);margin:34px 0 18px;letter-spacing:-.01em}
.chap small{display:block;font:500 11.5px/1 Geist,system-ui,sans-serif;letter-spacing:.2em;text-transform:uppercase;color:var(--accent-text);margin-bottom:12px}
.chap::after{content:"";display:block;width:42px;height:1px;background:var(--accent);margin:18px auto 0;opacity:.7}
.chap:first-child{margin-top:12px}
.prose{align-self:stretch;font:400 18px/1.75 Literata,Georgia,serif;color:var(--text);hyphens:auto;-webkit-hyphens:auto;text-wrap:pretty;margin-top:6px}
.prose p{margin:0 0 .85em;text-indent:1.4em}
.prose p:first-of-type{text-indent:0}
.chap+.prose p:first-of-type::first-letter{float:left;font-size:3.3em;line-height:.82;padding:.06em .02em 0 0;margin-right:-.02em;color:var(--accent-text);font-weight:600}
.prose.new{animation:fadein .7s var(--ease)}
@keyframes fadein{from{opacity:0}}
.you{align-self:stretch;margin:14px 0 22px;padding:10px 0 10px 18px;border-left:2px solid var(--accent);font:italic 400 16.5px/1.65 Literata,Georgia,serif;color:var(--muted)}
.you small{display:block;font:500 11px/1 Geist,system-ui,sans-serif;letter-spacing:.14em;text-transform:uppercase;color:var(--accent-text);font-style:normal;margin-bottom:8px}
.you p{margin:0 0 .5em}.you p:last-child{margin:0}
body.book .typing{align-self:center;background:none;padding:14px 0;gap:6px;align-items:center;color:var(--muted)}
body.book .typing i{width:5px;height:5px;background:var(--accent-text)}
body.book .typing::after{content:attr(data-label);font:italic 14px Literata,Georgia,serif;margin-left:6px}
body.book .field{border-radius:16px}
body.book #t{font-family:Literata,Georgia,serif}
body.book .meta{align-self:center}
details.plot{margin-top:10px;font-size:12px}details.plot pre{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--muted);max-height:320px;overflow:auto}
@media (max-width:480px){ body.book #list{padding:20px 18px 14px} .prose{font-size:17px;line-height:1.7} }

/* story codex: portraits of who enters, the place the scene moves to, the reader's codex in the panel */
body:not(.book) .book-only{display:none!important}
.cameos{display:flex;flex-wrap:wrap;gap:10px 18px;margin:2px 0 18px}
.cameo{display:flex;align-items:center;gap:9px;font:500 11.5px/1 Geist,system-ui,sans-serif;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);transition:color .15s}
.cameo:hover{color:var(--text)}
.cameo img,.cameo i{width:40px;height:40px;border-radius:50%;object-fit:cover;flex:none;box-shadow:0 0 0 2px var(--bg),0 0 0 3px color-mix(in srgb,var(--accent-text) 40%,transparent)}
.cameo i{display:grid;place-items:center;background:var(--surface-3);font:600 16px Literata,Georgia,serif;font-style:normal;color:var(--text)}
.scene{display:block;position:relative;width:100%;margin:4px 0 20px;border-radius:14px;overflow:hidden;aspect-ratio:16/7;background:var(--surface-2)}
.scene img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .6s var(--ease)}
.scene:hover img{transform:scale(1.02)}
.scene::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,transparent 50%,rgba(12,9,6,.78))}
.scene span{position:absolute;left:16px;bottom:13px;z-index:1;font:500 11.5px/1 Geist,system-ui,sans-serif;letter-spacing:.2em;text-transform:uppercase;color:#f1e6d3}
body.book .time{align-self:stretch;text-align:center;background:none;border:0;padding:0;margin:30px 0 12px;font:italic 15.5px/1.4 Literata,Georgia,serif;color:var(--muted)}
body.book .time::before{content:"⁂";display:block;font-style:normal;color:var(--accent-text);margin-bottom:8px;letter-spacing:.2em}
#codex h4{margin:16px 0 8px;font-size:11.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);font-weight:500}
#codex h4:first-child{margin-top:0}
.cx-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.cx{display:flex;flex-direction:column;gap:3px;text-align:left;padding:7px 7px 10px;border-radius:14px;background:var(--surface-2);border:1px solid var(--line);transition:background .15s,border-color .15s}
.cx:hover{background:var(--surface-3);border-color:var(--line-2)}
.cx img,.cx i{width:100%;aspect-ratio:1;object-fit:cover;border-radius:10px;display:grid;place-items:center;background:var(--surface-3);font:600 28px Literata,Georgia,serif;font-style:normal;color:var(--muted)}
.cx-grid.place img,.cx-grid.place i{aspect-ratio:16/9}
.cx b{font:600 14px/1.25 Literata,Georgia,serif;margin:5px 2px 0}
.cx small{margin:0 2px;font-size:12px;line-height:1.35;color:var(--muted);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.cx i.pending{background:linear-gradient(100deg,var(--surface-3) 30%,var(--line-2) 50%,var(--surface-3) 70%);background-size:200% 100%;animation:shimmer 1.4s linear infinite}
@keyframes shimmer{to{background-position:-200% 0}}
.cx-more{font-size:12.5px;color:var(--faint);margin:12px 0 0;font-style:italic}
#lightbox{position:fixed;inset:0;z-index:50;background:rgba(6,5,4,.8);backdrop-filter:blur(6px);display:grid;place-items:center;padding:16px;animation:fadein .2s}
.lb{position:relative;width:min(520px,100%);max-height:calc(100dvh - 32px);overflow:auto;background:var(--surface);border:1px solid var(--line-2);border-radius:20px;padding:12px 12px 20px}
.lb img{width:100%;display:block;aspect-ratio:1;object-fit:cover;border-radius:13px;margin-bottom:14px}
.lb img.place{aspect-ratio:16/9}
.lb .kicker{display:block;margin:0 6px}
.lb b{display:block;font:600 22px/1.25 Literata,Georgia,serif;margin:6px 6px 8px}
.lb p{margin:0 6px;color:var(--narr);font:400 15.5px/1.6 Literata,Georgia,serif}
.lb-x{position:absolute;top:20px;right:20px;background:rgba(0,0,0,.55);color:#fff}
.lb-x:hover{background:rgba(0,0,0,.75);color:#fff}
