/* Harrox app styles: the locked mockup's minimal look (flat charcoal, quiet ember outlines, cream text)
   on today's screens. Colors are tokens on :root; the background swatch in Settings swaps --bg1 and --bg2. */
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-display: swap; src: url(/fonts/cormorant-garamond/cormorant-garamond-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-display: swap; src: url(/fonts/cormorant-garamond/cormorant-garamond-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-style: italic; font-display: swap; src: url(/fonts/cormorant-garamond/cormorant-garamond-latin-500-italic.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-style: italic; font-display: swap; src: url(/fonts/cormorant-garamond/cormorant-garamond-latin-600-italic.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 400; font-display: swap; src: url(/fonts/instrument-sans/instrument-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 500; font-display: swap; src: url(/fonts/instrument-sans/instrument-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 600; font-display: swap; src: url(/fonts/instrument-sans/instrument-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 700; font-display: swap; src: url(/fonts/instrument-sans/instrument-sans-latin-700-normal.woff2) format('woff2'); }

:root {
  --ink: #EFE3C8; --mist: #B3A28F; --ember: #E0915A; --ember-soft: rgba(224, 145, 90, .14); --onaccent: #1E1612;
  --edge: rgba(224, 145, 90, .32); --line: rgba(239, 227, 200, .08); --soft: #1C1815; --danger: #C2553F;
  --bg1: #25201C; --bg2: #171310;
  --ui: 'Instrument Sans', system-ui, -apple-system, sans-serif; --story: 'Cormorant Garamond', Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg2); color: var(--ink); font: 15px/1.5 var(--ui); -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
a { color: var(--ember); }
button, input, textarea, select { font-family: var(--ui); }
button { cursor: pointer; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* ---- Shell: one phone-sized column; the page in the middle scrolls ---- */
.phone { position: relative; width: 100%; max-width: 480px; height: 100vh; height: 100dvh; margin: 0 auto; background: var(--bg2); display: flex; flex-direction: column; overflow: clip; }
@media (min-width: 520px) { .phone { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.preview { position: relative; z-index: 4; flex: none; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; text-align: center; color: var(--mist); padding: calc(6px + env(safe-area-inset-top)) 8px 0; }
.banner { position: relative; z-index: 4; flex: none; margin: 6px 16px 0; padding: 8px 12px; border: 1px solid var(--edge); border-radius: 12px; font-size: 13px; color: var(--ink); background: var(--ember-soft); }
header { position: relative; z-index: 3; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 8px 20px 4px; }
main { position: relative; z-index: 1; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 20px 24px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
main::-webkit-scrollbar { display: none; }
#composer-slot, #np-slot { position: relative; z-index: 2; flex: none; }
.screen { display: flex; flex-direction: column; gap: 16px; }
@media (prefers-reduced-motion: no-preference) { .screen.enter { animation: enter .32s cubic-bezier(.2, .7, .2, 1); } }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hello { flex: 1; min-width: 0; }
.hello span { color: var(--mist); font-size: 12px; }
.hello b { display: block; font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--edge); border-radius: 50%; background: var(--bg1); color: var(--ink); font-size: 17px; text-decoration: none; }
.round.initial { background: var(--ember); color: var(--onaccent); border: none; font-weight: 700; }
.back { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: none; border-radius: 50%; background: none; color: var(--ink); font-size: 28px; line-height: 1; text-decoration: none; }
.htitle { flex: 1; min-width: 0; font-family: var(--story); font-weight: 600; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { font-family: var(--ui); letter-spacing: .2em; font-size: 13px; color: var(--mist); }

/* Tabs: five across, Chat raised in the middle */
nav#tabs { position: relative; z-index: 3; flex: none; display: flex; justify-content: space-between; align-items: center; margin: 4px 16px calc(10px + env(safe-area-inset-bottom)); padding: 6px 8px; background: var(--bg1); border: 1px solid var(--line); border-radius: 999px; }
nav#tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 56px; padding: 8px 4px; border-radius: 16px; color: var(--mist); font-size: 11px; text-decoration: none; }
nav#tabs a span { font-size: 20px; line-height: 1; }
nav#tabs a.on:not(.bigtab) { color: var(--ember); font-weight: 600; }
nav#tabs a.bigtab { justify-content: center; width: 64px; height: 64px; min-width: 64px; margin-top: -22px; border-radius: 50%; background: var(--ember); color: var(--onaccent); font-weight: 700; font-size: 12px; box-shadow: 0 0 0 6px var(--bg2); }
nav#tabs a.bigtab span { font-size: 24px; }

/* Bottom sheets */
.scrim { position: absolute; inset: 0; z-index: 8; background: rgba(0, 0, 0, .5); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; display: flex; flex-direction: column; gap: 14px; max-height: 86%; overflow-y: auto; padding: 22px 22px calc(28px + env(safe-area-inset-bottom)); background: var(--bg1); border-top: 1px solid var(--edge); border-radius: 28px 28px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .4); }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: up .22s cubic-bezier(.2, .7, .2, 1); } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

.toastpop { position: absolute; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 12; transform: translateX(-50%); width: max-content; max-width: calc(100% - 40px); padding: 10px 16px; border-radius: 14px; background: var(--ink); color: #171310; font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }

/* ---- Type ---- */
h1 { font-family: var(--story); font-size: 30px; font-weight: 600; line-height: 1.12; margin: 0; text-wrap: balance; }
h2 { font-family: var(--story); font-size: 22px; font-weight: 600; margin: 0; }
p { margin: 0; line-height: 1.5; }
.label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--mist); font-weight: 600; opacity: .85; }
.muted { color: var(--mist); font-size: 13px; }
.small { font-size: 12px; }
.center { text-align: center; }
.pad { padding: 40px 0; }
.serif { font-family: var(--story); font-style: italic; font-weight: 600; font-size: 34px; line-height: 1.08; text-wrap: balance; }
.serif em { background: linear-gradient(90deg, #F6C28E, #E0915A 60%, #C86B3C); -webkit-background-clip: text; background-clip: text; color: transparent; }
.story { font-family: var(--story); font-size: 20px; line-height: 1.45; }
.error { color: #F0A59F; font-size: 14px; }
.error:empty { display: none; }
.secthead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.secthead a, .secthead button { background: none; border: none; padding: 0; color: var(--mist); font-size: 13px; text-decoration: none; }

/* ---- Blocks ---- */
.card { border: 1px solid var(--edge); background: var(--bg1); border-radius: 24px; padding: 16px; }
.card.flat { border-color: var(--line); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag { display: inline-block; align-self: flex-start; font-size: 11px; color: var(--ember); background: var(--ember-soft); border-radius: 999px; padding: 3px 9px; font-weight: 600; }
.qi { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--ember-soft); color: var(--ember); font-size: 15px; }
.rows { display: flex; flex-direction: column; background: var(--bg1); border: 1px solid var(--edge); border-radius: 24px; padding: 4px 16px; }
.sheet .rows { padding: 0; border: none; }
.r { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 0; border: none; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font-size: 15px; text-align: left; text-decoration: none; }
.r:last-child { border-bottom: none; }
.r > span:not(.portrait):not(.go):not(.cover) { flex: 1; min-width: 0; }
.r small { display: block; margin-top: 2px; font-size: 12px; color: var(--mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r .go { margin-left: auto; color: var(--mist); }
.r .cover { width: 56px; height: 56px; border-radius: 12px; }
.r .cover .badge { display: none; }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 50px; padding: 14px 18px; border: none; border-radius: 999px; background: var(--ember); color: var(--onaccent); font-weight: 600; font-size: 15px; text-align: center; text-decoration: none; }
.btn.light { background: none; border: 1px solid var(--edge); color: var(--ink); }
.btn.danger { background: var(--danger); color: #FFF3E6; }
.btn.small { display: inline-flex; width: auto; min-height: 38px; padding: 8px 16px; font-size: 14px; }
.btn[disabled], button[disabled] { opacity: .55; }
.morebtn { align-self: flex-start; padding: 4px 0; border: none; background: none; color: var(--ember); font-size: 14px; font-weight: 600; text-decoration: none; }
.linkbtn { border: none; background: none; padding: 0; color: var(--ember); font: inherit; font-weight: 600; }
.dcbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border: none; border-radius: 999px; background: #5865F2; color: #fff; font-weight: 600; font-size: 15px; }
.send { flex: none; width: 36px; height: 36px; border: none; border-radius: 50%; background: var(--ember); color: var(--onaccent); font-size: 16px; font-weight: 700; }

/* Chips and segmented choices. Radio and checkbox inputs sit hidden behind their labels. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 13px; padding: 7px 13px; border-radius: 999px; background: var(--soft); border: 1px solid transparent; color: var(--ink); text-decoration: none; }
.chip.add { background: none; border: 1px dashed var(--mist); color: var(--mist); }
.chip.on { background: var(--ember); color: var(--onaccent); border-color: var(--ember); }
.pick input, .segpick input { position: absolute; opacity: 0; pointer-events: none; }
.pick label { display: inline-block; font-size: 14px; padding: 8px 14px; border-radius: 999px; background: none; border: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.pick input:checked + label { background: var(--ember); color: var(--onaccent); border-color: transparent; font-weight: 600; }
.pick input:focus-visible + label, .segpick input:focus-visible + label { outline: 2px solid var(--ember); outline-offset: 2px; }
.pick label small { display: block; font-size: 11px; color: var(--mist); font-weight: 400; }
.pick input:checked + label small { color: rgba(30, 22, 18, .75); }
.seg, .segpick { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; background: var(--soft); border-radius: 999px; }
.seg button, .segpick label { padding: 7px 13px; border: none; border-radius: 999px; background: none; color: var(--mist); font-size: 13px; text-transform: capitalize; cursor: pointer; }
.seg button.on, .segpick input:checked + label { background: var(--ember); color: var(--onaccent); }
.seg.full, .segpick.full { display: grid; grid-auto-columns: 1fr; width: 100%; }

/* Inputs: 16px so iPhones don't zoom in */
input[type=text], input[type=number], input:not([type]), textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); color: var(--ink); font: 16px var(--ui); outline: none; }
input:focus, textarea:focus { border-color: var(--ember); }
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
textarea.tall { min-height: 50vh; font: 15px/1.5 ui-monospace, Menlo, monospace; }
.fld { display: flex; flex-direction: column; gap: 8px; }
.fld > span:first-child { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--mist); font-weight: 600; }
.fld small { color: var(--mist); font-size: 12px; }
details.more { border-top: 1px solid var(--line); padding-top: 4px; }
details.more summary { list-style: none; cursor: pointer; padding: 8px 0; color: var(--ember); font-size: 14px; font-weight: 600; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: ' ▾'; }
details.more[open] summary::after { content: ' ▴'; }
details.more > .stack { gap: 16px; padding: 8px 0 4px; }

/* Settings rows and switches */
.sgroup { display: flex; flex-direction: column; background: var(--bg1); border: 1px solid var(--line); border-radius: 18px; padding: 6px 14px; }
.set { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink); }
.set > span:first-child { min-width: 0; }
.set small { display: block; color: var(--mist); font-size: 12px; }
.sgroup .set:last-child { border-bottom: none; }
a.set, button.set { width: 100%; background: none; border-left: none; border-right: none; border-top: none; font: inherit; font-size: 14px; text-align: left; text-decoration: none; }
.set .muted { white-space: nowrap; }
.switch { position: relative; flex: none; width: 46px; height: 28px; padding: 0; border: none; border-radius: 999px; background: var(--soft); }
.switch span { position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--mist); transition: left .2s, background .2s; }
.switch.on { background: var(--ember); }
.switch.on span { left: 21px; background: #1E1612; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.sw { display: flex; align-items: flex-end; justify-content: center; width: 58px; height: 58px; padding-bottom: 6px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); font-size: 10px; }
.sw.on { outline: 2px solid var(--ember); outline-offset: 2px; }

/* Portraits, covers and art */
.portrait { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; background: var(--c); color: rgba(20, 14, 10, .75); font-weight: 600; font-size: 30px; }
.portrait.big { flex: none; width: 64px; height: 64px; border-radius: 50%; font-size: 24px; }
.portrait.big.sm { width: 42px; height: 42px; font-size: 16px; }
.portrait.big.xs { width: 24px; height: 24px; font-size: 10px; font-weight: 700; }
.portrait.plus { background: none; border: 1px dashed var(--edge); color: var(--mist); font-weight: 400; }
.cover { position: relative; flex: none; display: block; overflow: hidden; max-width: 100%; aspect-ratio: 4/3; border-radius: 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--hue) 30%, #120D0A) 0%, color-mix(in srgb, var(--hue) 75%, #2A201A) 70%, var(--hue) 100%); }
.cover.wide { aspect-ratio: 16/7; }
.cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover .badge { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(18, 13, 10, .45); color: #FBEBD8; font: 600 10px var(--ui); letter-spacing: .06em; text-transform: uppercase; }
.feat { display: flex; flex-direction: column; gap: 0; width: 100%; padding: 0; overflow: hidden; text-align: left; color: var(--ink); text-decoration: none; }
.feat .cover { aspect-ratio: 16/8; border-radius: 0; }
.feat .fbody { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.feat .fbody .serif { font-size: 28px; }
.meta { font-size: 12px; color: var(--mist); }

/* ---- Play tab ---- */
.wcont { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--edge); border-radius: 18px; background: var(--bg1); color: var(--ink); text-align: left; text-decoration: none; }
.wcont .cover { width: 64px; height: 64px; border-radius: 14px; }
.wcont .cover .badge { display: none; }
.wcont > span:nth-child(2) { flex: 1; min-width: 0; }
.wcont b { display: block; font-size: 16px; }
.wcont small { display: block; color: var(--mist); font-size: 13px; }
.wcont .go { color: var(--mist); }
.wcont.done { border-color: var(--line); }
.npbar { display: flex; align-items: center; gap: 12px; margin: 0 16px 6px; padding: 8px 10px; border: 1px solid var(--edge); border-radius: 14px; background: var(--bg1); color: var(--ink); text-align: left; text-decoration: none; }
.npbar .npart { flex: none; width: 36px; height: 36px; border-radius: 8px; overflow: hidden; }
.npbar .npart .cover { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.npbar > span:nth-child(2) { flex: 1; min-width: 0; }
.npbar b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.npbar small { color: var(--mist); font-size: 12px; }
.npbar .npplay { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--edge); border-radius: 50%; color: var(--ember); }
.partybar { display: flex; align-items: center; }
.pav { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--bg2); background: #6E9AA6; color: #10181A; font-size: 12px; font-weight: 700; }
.pav.me { background: var(--ember); color: var(--onaccent); }
.pav.ghost { background: none; border: 1px dashed var(--edge); color: var(--mist); }
.partybar .pav + .pav { margin-left: -10px; }
.pav.big { position: relative; width: 44px; height: 44px; font-size: 17px; }
.pav.huge { width: 60px; height: 60px; font-size: 24px; }

/* Story start page */
.spine { position: relative; display: flex; flex-direction: column; padding-left: 26px; }
.spine::before { content: ''; position: absolute; left: 8px; top: 16px; bottom: 16px; border-left: 2px dashed var(--line); }
.node { position: relative; padding: 10px 0; }
.node::before { content: ''; position: absolute; left: -23px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--ember); }
.node.open::before { width: 8px; height: 8px; background: var(--bg1); border: 2px dashed var(--ember); }
.node .label { display: block; margin-bottom: 4px; }
.node .label.lock::after { content: ' · fixed'; color: var(--ember); }
.sealed { padding: 10px 12px; border-radius: 14px; background: var(--soft); color: var(--mist); font-size: 14px; }

/* ---- Play itself: full screen, scene art behind the story ---- */
#immbg { position: absolute; inset: 0; z-index: 0; display: none; pointer-events: none; }
.phone.imm #immbg, .phone.hasbg #immbg { display: block; }
#immbg .layer { position: absolute; inset: 0 0 auto 0; height: 62%; opacity: 0; transition: opacity 1.2s ease; }
#immbg .layer.on { opacity: 1; }
#immbg .layer .cover { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
#immbg .badge { display: none; }
@media (prefers-reduced-motion: no-preference) { #immbg .layer.on .cover svg { animation: drift 30s ease-in-out infinite alternate; } }
@keyframes drift { from { transform: scale(1.05) translateX(0); } to { transform: scale(1.15) translateX(-12px); } }
#immbg .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 7, 6, .1) 0%, rgba(8, 7, 6, .3) 25%, rgba(10, 9, 8, .88) 42%, #0B0A09 52%); }
#immbg .aura { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; background: radial-gradient(90% 45% at 50% -8%, var(--aura) 0%, transparent 70%), radial-gradient(60% 30% at 100% 100%, var(--aura) 0%, transparent 70%); }
#immbg .aura.on { opacity: .42; }
@media (prefers-reduced-motion: no-preference) { #immbg .aura.on { animation: breathe 9s ease-in-out infinite alternate; } }
@keyframes breathe { from { opacity: .3; } to { opacity: .52; } }
#immbg .layer.hero { height: 46%; }
#immbg .shade.hero { background: linear-gradient(180deg, rgba(8, 7, 6, .2) 0%, rgba(8, 7, 6, .4) 20%, var(--bg2) 36%); }
.phone.herobg #main > .screen { padding-top: 22vh; }
.phone.imm { background: #0B0A09; }
.phone.imm #hdr, .phone.imm #tabs, .phone.imm #np-slot, .phone.imm .motes, .phone.full #tabs, .phone.full #np-slot, .phone.bare #tabs, .phone.bare #np-slot { display: none !important; }
.phone.imm main, .phone.imm #composer-slot, .phone.hasbg main, .phone.hasbg header, .phone.hasbg #composer-slot { background: transparent; }
.phone.imm .composer .field { background: rgba(20, 18, 16, .85); }
.immtop { position: sticky; top: -10px; z-index: 3; display: flex; align-items: center; gap: 10px; margin: 0 -20px; padding: 10px 20px 18px; background: linear-gradient(180deg, rgba(11, 10, 9, .7) 50%, rgba(11, 10, 9, .25)); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent); mask-image: linear-gradient(180deg, #000 72%, transparent); }
.immtop .x { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(239, 227, 200, .25); border-radius: 50%; background: rgba(10, 9, 8, .45); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; }
.immtop .x.on { border-color: var(--ember); color: var(--ember); }
.immtop .x.snd.off { position: relative; color: rgba(239, 227, 200, .45); }
.immtop .x.snd.off::after { content: ''; position: absolute; left: 9px; right: 9px; top: 50%; height: 1.5px; background: currentColor; transform: rotate(-45deg); }
.immtop .tt { flex: 1; min-width: 0; }
.immtop .tt b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.immtop .tt small { font-size: 12px; color: rgba(239, 227, 200, .7); }
.immgap { height: 26vh; }
.beat { margin: 0 0 22px; }
.beat .place { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ember); }
.beat .story { font-family: var(--story); font-size: 21px; line-height: 1.5; color: #F3EAD6; text-shadow: 0 1px 14px rgba(0, 0, 0, .7); }
.beat .story p + p { margin-top: 10px; }
.speak { flex: none; padding: 2px 6px; border: none; background: none; color: rgba(239, 227, 200, .6); font-size: 15px; }
.speak.on { color: var(--ember); }
.youact { max-width: 82%; margin: 0 0 22px auto; text-align: right; font-style: italic; color: rgba(239, 227, 200, .75); font-size: 15px; }
.youact::before { content: attr(data-who) ' · '; color: var(--ember); font-style: normal; font-size: 12px; letter-spacing: .06em; }
.immmem { margin: 0 0 22px; padding: 2px 0 2px 12px; border-left: 2px solid var(--ember); color: rgba(239, 227, 200, .88); font-size: 15px; }
.immmem span { display: block; margin-bottom: 4px; font-size: 11px; color: var(--ember); letter-spacing: .1em; text-transform: uppercase; }
.chapmark { margin: 30px 0 22px; text-align: center; }
.chapmark small { display: block; color: var(--ember); letter-spacing: .16em; text-transform: uppercase; font-size: 11px; }
.chapmark p { font-family: var(--story); font-size: 26px; color: #F3EAD6; }
.endtitle { text-align: center; font-family: var(--story); font-size: 28px; color: var(--ember); }
.immchoices { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 10px; }
.immchoices button { padding: 13px 16px; border: 1px solid rgba(224, 145, 90, .4); border-radius: 14px; background: rgba(20, 18, 16, .6); color: var(--ink); font-size: 15px; text-align: left; }
.thinkbeat { display: flex; gap: 6px; padding: 6px 0 22px; }
.thinkbeat i { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); animation: blink 1s infinite; }
.thinkbeat i:nth-child(2) { animation-delay: .15s; }
.thinkbeat i:nth-child(3) { animation-delay: .3s; }
.titlecard { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; text-align: center; background: #0B0A09; pointer-events: none; animation: tcard 2.2s ease forwards; }
.titlecard p { margin: 0; font-family: var(--story); font-size: 32px; color: #F3EAD6; }
.titlecard small { display: block; margin-top: 10px; color: var(--ember); letter-spacing: .16em; text-transform: uppercase; font-size: 11px; }
@keyframes tcard { 0%, 55% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.tw .w { font-style: normal; opacity: 0; animation: wordin .35s ease forwards; }
@keyframes wordin { to { opacity: 1; } }
/* Scene drawings: rain over outdoor places, fireflies in the garden. */
.scene .rainfx rect { animation: rainfx .55s linear infinite; }
.scene .rainfx rect + rect { animation-duration: .45s; }
@keyframes rainfx { to { transform: translateY(36px); } }
.scene .ff { animation: ff 3.2s ease-in-out infinite alternate; }
@keyframes ff { from { opacity: .15; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tw .w, .screen.enter, #immbg .aura.on, #immbg .layer.on .cover svg, .scene .rainfx rect, .scene .ff { animation: none !important; opacity: 1 !important; } .titlecard { display: none; } }
.invlink { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--edge); border-radius: 14px; font-size: 14px; }
.invlink span { flex: 1; min-width: 0; color: var(--ember); font-weight: 600; overflow-wrap: anywhere; }

/* ---- Chat ---- */
.wbots { display: flex; gap: 14px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px; scrollbar-width: none; }
.wbots::-webkit-scrollbar { display: none; }
.wbots a, .wbots button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 66px; padding: 0; border: none; background: none; color: var(--ink); text-decoration: none; }
.wbots small { font-size: 11px; color: var(--mist); text-align: center; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gchat { min-height: 100%; gap: 20px; padding-top: 4px; }
.gpt { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; }
.gpt .portrait { margin-top: 2px; }
.gtext { min-width: 0; font-size: 16px; line-height: 1.6; color: var(--ink); padding-top: 1px; overflow-wrap: anywhere; }
.gtext p + p, .gtext ul { margin-top: 8px; }
.gtext ul { padding-left: 20px; margin-bottom: 0; }
.gyou { align-self: flex-end; max-width: 80%; padding: 10px 16px; border-radius: 22px; background: rgba(224, 145, 90, .18); font-size: 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.typing { display: flex; gap: 5px; padding: 10px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--mist); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.starters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
.starters a, .starters button { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg1); color: var(--ink); text-align: left; text-decoration: none; font-size: inherit; }
.starters b { font-size: 14px; font-weight: 600; }
.starters small { font-size: 12px; color: var(--mist); }
.botswitch { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 8px 12px; border: none; border-radius: 12px; background: none; color: var(--ink); font-size: 18px; font-weight: 600; }
.botswitch b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.botswitch span { color: var(--mist); font-size: 13px; }
.composer { display: flex; gap: 10px; align-items: center; padding: 10px 20px 8px; }
.helpbar { display: flex; align-items: center; gap: 10px; width: calc(100% - 40px); margin: 6px 20px 0; padding: 9px 14px; border: 1px solid var(--edge); border-radius: 14px; background: rgba(20, 18, 16, .78); color: var(--ink); font-size: 14px; text-align: left; }
.helpbar b { color: var(--ember); font-weight: 600; }
.helpbar span { flex: 1; min-width: 0; color: var(--mist); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.helpbar i { font-style: normal; color: var(--mist); font-size: 18px; line-height: 1; }
.sheet .immchoices button { background: var(--soft); }
.composer .field { flex: 1; display: flex; align-items: center; min-width: 0; padding: 0 6px 0 16px; border: 1px solid var(--edge); border-radius: 999px; background: var(--bg1); }
.composer input { flex: 1; min-width: 0; padding: 13px 0; border: none; background: none; color: var(--ink); font: 16px var(--ui); outline: none; }
.composer input:focus { border: none; }
.ainote { margin: 0 0 calc(8px + env(safe-area-inset-bottom)); text-align: center; font-size: 11px; color: var(--mist); }
.phone:not(.full):not(.imm) .ainote { margin-bottom: 4px; }

/* Cards Harrox adds in play and chat */
.keepcard { display: flex; flex-direction: column; gap: 8px; border-style: dashed; }
.keepcard p { font-size: 14px; }
.crisis { border-color: #8E9BE8; white-space: pre-line; }
.crisis ul { padding-left: 18px; margin: 6px 0; }

/* ---- Create ---- */
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ccard { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; border: 1px solid var(--edge); border-radius: 20px; background: var(--bg1); color: var(--ink); text-align: center; text-decoration: none; }
.ccard b { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.ccard small { font-size: 12px; color: var(--mist); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ccard.add { border-style: dashed; background: none; }
.prev { display: flex; gap: 14px; align-items: flex-start; }
.pv { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pv b { font-family: var(--story); font-size: 22px; font-weight: 600; overflow-wrap: anywhere; }
.pv small { font-size: 13px; color: var(--mist); line-height: 1.4; }
.pv .say { margin-top: 8px; padding: 8px 12px; border: 1px solid var(--edge); border-radius: 4px 16px 16px 16px; font-size: 13px; }
.locknote { font-size: 13px; color: var(--mist); }

/* ---- Friends ---- */
.circles { display: flex; gap: 14px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 4px; scrollbar-width: none; }
.circles::-webkit-scrollbar { display: none; }
.circle { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 68px; color: var(--ink); text-decoration: none; }
.circle .ring { padding: 2px; border-radius: 50%; border: 2px solid var(--line); }
.circle.new .ring { border-color: var(--ember); }
.circle .pav { width: 54px; height: 54px; font-size: 20px; border: none; }
.circle small { font-size: 11px; color: var(--mist); text-align: center; line-height: 1.25; max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addfr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.addfr .btn { padding: 13px 10px; font-size: 14px; }
.frreq { display: flex; align-items: center; gap: 10px; padding: 12px; }
.frreq > span:nth-child(2) { flex: 1; min-width: 0; }
.frreq b { display: block; }
.frreq small { color: var(--mist); font-size: 12px; }
.frreq .chip { flex: none; }
.frlist { display: flex; flex-direction: column; gap: 10px; }
.frrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 18px; background: var(--bg1); color: var(--ink); text-align: left; text-decoration: none; }
.frrow > span:nth-child(2) { flex: 1; min-width: 0; }
.frrow b { display: block; font-size: 15px; }
.frrow small { display: block; color: var(--mist); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frrow .go { color: var(--mist); }
.frwhere { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.frwhere span { padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: var(--mist); font-size: 11px; }
.bookhero { display: flex; gap: 16px; align-items: flex-end; }
.bookface { flex: none; display: grid; place-items: center; width: 104px; height: 140px; border-radius: 6px 12px 12px 6px; background: var(--c); color: rgba(255, 245, 230, .85); font-weight: 600; font-size: 30px; box-shadow: inset 6px 0 0 rgba(0, 0, 0, .25); }
.bookhero .serif { font-size: 30px; margin: 4px 0; }
.pg { font-size: 11px; color: var(--mist); }
.memmo2 { display: flex; flex-direction: column; gap: 6px; }
.mem { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 9px 10px 9px 12px; border-radius: 12px; background: var(--soft); font-size: 14px; line-height: 1.4; }
.mem > span { min-width: 0; }
.mem small { display: block; color: var(--mist); font-size: 12px; }
.mem button { flex: none; padding: 2px 4px; border: none; background: none; color: var(--mist); font-size: 12px; }
.mem a { color: var(--ink); text-decoration: none; }

/* ---- Notebook ---- */
.searchbox { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 16px; border: 1px solid var(--edge); border-radius: 999px; background: var(--bg1); }
.searchbox input { flex: 1; min-width: 0; padding: 10px 0; border: none; background: none; color: var(--ink); font: 16px var(--ui); outline: none; -webkit-appearance: none; appearance: none; }
.searchbox input:focus { border: none; }
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fold { display: flex; flex-direction: column; gap: 3px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg1); color: var(--ink); text-align: left; text-decoration: none; min-width: 0; }
.fold.on { border-color: var(--ember); }
.fold .qi { width: 30px; height: 30px; margin-bottom: 6px; font-size: 14px; background: color-mix(in srgb, var(--tint) 22%, transparent); color: var(--tint); }
.fold b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold small { font-size: 11px; color: var(--mist); }
.hist { display: flex; flex-direction: column; gap: 8px; }
.hrow2 { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg1); color: var(--ink); text-align: left; text-decoration: none; }
.hrow2 > span:last-child { min-width: 0; flex: 1; }
.hrow2 b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow2 span span { display: block; font-size: 12px; color: var(--mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow2 .qi { background: color-mix(in srgb, var(--tint, #E0915A) 18%, transparent); color: var(--tint, #E0915A); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modes a, .modes button { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; border: 1px solid var(--edge); border-radius: 20px; background: var(--bg1); color: var(--ink); text-align: left; text-decoration: none; font-size: inherit; }
.modes b { font-family: var(--story); font-size: 20px; font-weight: 600; margin-top: 8px; }
.modes small { font-size: 11px; color: var(--mist); line-height: 1.35; }
.modes .qi { background: color-mix(in srgb, var(--tint) 22%, transparent); color: var(--tint); }
.note-body { font-family: var(--story); font-size: 19px; line-height: 1.5; overflow-wrap: anywhere; }
.note-body h2, .note-body h3, .note-body h4 { margin: 14px 0 6px; font-family: var(--story); }
.note-body ul { padding-left: 20px; }
.note-body code { font-size: 14px; }
.wl { color: var(--ember); border-bottom: 1px dashed var(--edge); text-decoration: none; }
blockquote { margin: 8px 0; padding: 2px 12px; border-left: 3px solid var(--ember); color: var(--mist); }
.code { margin: 12px 0; text-align: center; color: var(--ember); font: 600 30px ui-monospace, Menlo, monospace; letter-spacing: .12em; }

/* ---- Welcome and sign-in ---- */
.welcome { min-height: 100%; display: flex; flex-direction: column; gap: 16px; padding: 12px 4px 8px; }
.welcome .grow { flex: 1; }
.welcome .wordmark { text-align: center; color: var(--ember); font-size: 28px; letter-spacing: .2em; }
.big { margin: 0; text-align: center; font-size: 34px; line-height: 1.15; font-weight: 600; text-wrap: balance; }
.big em { font-style: normal; color: var(--ember); }
.invited { display: flex; gap: 12px; align-items: center; }
footer.fine { margin: 8px 0 0; text-align: center; color: var(--mist); font-size: 12px; }

/* Glow and floating embers (Settings > Look) */
.motes { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.motes i { position: absolute; bottom: -10px; width: var(--s); height: var(--s); border-radius: 50%; background: #FFB679; box-shadow: 0 0 8px 2px rgba(255, 150, 70, .6); opacity: 0; }
.phone.nofx .motes, .phone.nofx::after { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .motes i { animation: rise2 var(--d) linear var(--w) infinite; }
  .phone::after { content: ''; position: absolute; inset: -20%; z-index: 1; pointer-events: none; mix-blend-mode: screen; background: radial-gradient(40% 30% at 30% 30%, rgba(255, 150, 70, .16), transparent 70%), radial-gradient(35% 25% at 70% 75%, rgba(224, 110, 50, .12), transparent 70%); animation: glow 14s ease-in-out infinite alternate; }
}
@keyframes rise2 { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: .8; } 60% { opacity: .5; } 100% { transform: translate(var(--x), -900px); opacity: 0; } }
@keyframes glow { 0% { transform: translate(-8%, -6%); } 50% { transform: translate(10%, 4%); } 100% { transform: translate(-4%, 10%); } }
@media (prefers-reduced-motion: reduce) { .motes { display: none; } }
