/* ==== Lumin Lookup layer ==========================================================================
   Built on Lumin Vocab's design system above: same tokens, spacing scale (--s1..--s8), type scale (--t-*),
   widths and motion. Reading rules for a dictionary:
   - Definitions 17px/1.5 sans, at most 66ch. Examples 15px Literata italic with a marigold rule.
   - Part of speech headings Literata 600 20px. Section headings in tabs Atkinson 700 20px.
   - Gaps: definition to example 8; meaning to meaning 16; part of speech to part of speech 32; sections 48.
   - Inputs are never under 16px (iPhone zooms otherwise). Every target is at least 44px; list rows 48px or more.
   - Reading text is left-aligned. Centered text only for short display moments.
   ================================================================================================ */

/* The Skip link's rules live in css/boot.css, which loads before the first paint */
.mobile-only { display: inline-flex; }
@media (min-width: 900px) { .mobile-only { display: none !important; } }
.me { width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; background: none; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.me .avatar { width: 38px; height: 38px; font-size: 17px; box-shadow: 0 0 0 2px var(--card), 0 2px 0 var(--lip); }
.app.has-nav .topbar .brand { flex: 0 0 auto; }
.app.has-nav .topbar::after { content: none; }
.topbar { gap: var(--s4); }
.topsearch { flex: 1 1 auto; max-width: 520px; min-width: 0; }
.topsearch:empty { flex: 1 1 auto; }
@media (max-width: 899px) { .topsearch { display: none; } .topbar .me { margin-left: auto; } }
.kicker { font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card { background: var(--card); border-radius: var(--r-l); box-shadow: var(--shadow); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.tabh { margin: 0; font-family: var(--sans); font-weight: 700; font-size: var(--t-l); line-height: 1.3; }
.tabh.small { font-size: var(--t-m); }
.errtext { color: var(--bad); font-weight: 700; }
.danger-text { color: var(--bad) !important; }
.status { display: inline-flex; align-items: center; gap: var(--s2); color: var(--good); font-weight: 700; }
.status .icon { width: 20px; height: 20px; }
.textlink.back { gap: var(--s1); font-weight: 700; color: var(--muted); text-decoration: none; align-self: flex-start; }
.applogo { border-radius: 14px; margin-bottom: var(--s3); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.crumbs { font-size: var(--t-xs); color: var(--muted); }
.crumbs a { color: var(--muted); }
.qrrow { --gap: var(--s5); align-items: center; }
.qrrow .grow { min-width: 200px; flex: 1; }
.skel { display: inline-block; border-radius: 8px; background: linear-gradient(90deg, rgba(127,127,127,.12), rgba(127,127,127,.24), rgba(127,127,127,.12)); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; color: transparent !important; }
.skel.line { width: 100%; height: 1.2em; }
.skel.line.short { width: 60%; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s4); padding: var(--s6) var(--s4); }
.empty-state p { max-width: 42ch; color: var(--muted); margin: 0; }
.empty-state h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: var(--t-2xl); }
.empty-state .art { width: 112px; height: 112px; border-radius: 50%; }
.disc { border-radius: 50%; overflow: hidden; background: var(--tile); box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 6px 0 var(--lip), 0 20px 26px -18px rgba(24,33,43,.6); flex-shrink: 0; display: inline-flex; }
.disc img { width: 100%; height: 100%; object-fit: cover; }

/* ---- The search box ------------------------------------------------------------------------- */
.sbox { position: relative; display: flex; flex-direction: column; gap: var(--s3); width: 100%; z-index: 8; }
.sfield { display: flex; align-items: center; gap: var(--s2); min-height: 56px; padding: 0 var(--s1) 0 var(--s4); border-radius: var(--r-pill); background: var(--card); box-shadow: var(--shadow); transition: box-shadow var(--d2) var(--ease); }
.sfield:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent), var(--shadow); }
.sfield.glass { background: rgba(16, 20, 26, .38); box-shadow: inset 0 0 0 1px var(--glass-line); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); color: #fff; }
.sfield.glass:focus-within { box-shadow: inset 0 0 0 1px var(--glass-line), 0 0 0 3px rgba(242, 181, 68, .7); }
.sicon { display: inline-flex; color: var(--muted); flex-shrink: 0; }
.sfield.glass .sicon { color: rgba(255,255,255,.8); }
.sinput { flex: 1; min-width: 0; height: 52px; border: 0; background: none; outline: none; font-size: max(17px, calc(var(--t-m) + 1px)); color: inherit; padding: 0 var(--s1); -webkit-appearance: none; appearance: none; }
.sinput::-webkit-search-cancel-button { display: none; }
.sinput::placeholder { color: var(--muted); opacity: 1; }
.sfield.glass .sinput::placeholder { color: rgba(255,255,255,.72); }
.sinput:focus-visible { outline: none; box-shadow: none; }
.sclear { width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; color: inherit; display: inline-flex; align-items: center; justify-content: center; opacity: .75; }
.sclear[hidden] { display: none; }
.sbox.compact .sfield { min-height: 48px; }
.sbox.compact .sinput { height: 46px; }
.sugs { position: absolute; left: 0; right: 0; top: calc(100% + var(--s2)); margin: 0; padding: var(--s1); list-style: none; background: var(--card); border-radius: var(--r-m); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 3px 0 var(--lip), 0 24px 40px -16px rgba(10,14,20,.45); max-height: min(70vh, 520px); overflow-y: auto; color: var(--ink); z-index: 30; animation: sugIn var(--d2) var(--ease) both; }
.sbox:not(.compact) .sugs { top: 64px; }
@keyframes sugIn { from { opacity: 0; transform: translateY(-4px); } }
.sug { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 48px; padding: 0 var(--s3); border-radius: var(--r-s); cursor: pointer; font-size: var(--t-m); }
.sug .sw { font-family: var(--serif); font-size: calc(1.125rem * var(--scale)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sug .sw b { font-weight: 600; }
.sug .ssub { font-size: var(--t-xs); color: var(--muted); flex-shrink: 0; }
.sug:hover, .sug[aria-selected="true"] { background: var(--soft); }
.shead { font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: var(--s2) var(--s3) var(--s1); }
.srow2 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.smodes { display: flex; flex-wrap: wrap; gap: var(--s2); }
.gchip { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-pill); border: 0; background: var(--card); color: var(--ink); font-weight: 700; font-size: var(--t-s); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 2px 0 var(--lip); white-space: nowrap; text-decoration: none; }
.gchip .icon { width: 18px; height: 18px; }
.gchip[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.gchip.glass { background: rgba(16, 20, 26, .34); color: #fff; box-shadow: inset 0 0 0 1px var(--glass-line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.gchip.glass[aria-checked="true"] { background: rgba(255,255,255,.92); color: #18212B; }
@media (max-width: 380px) { .dice span { display: none; } .dice { padding: 0 var(--s3); } }

/* ---- Look up (home) ------------------------------------------------------------------------- */
.app[data-route="home"] main { padding: 0 !important; }
.app[data-route="home"] .topbar { position: absolute; left: 0; right: 0; top: 0; max-width: none; padding-top: calc(var(--s3) + var(--safe-top)); }
.app[data-route="home"] .brand { color: #fff; text-shadow: 0 1px 12px rgba(0,0,0,.4); }
/* Over the photo, the bars are dark glass filled enough that the page's white text never reads through (FE-12) */
.app[data-route="home"] .topnav, .app[data-route="home"] .bottomnav { background: rgb(14 19 25 / .97); box-shadow: inset 0 0 0 1px var(--glass-line), 0 18px 34px -16px rgb(0 0 0 / .6); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
.app[data-route="home"] .topnav a, .app[data-route="home"] .bottomnav a { color: rgba(255,255,255,.8); }
.app[data-route="home"] .navind { background: rgba(255,255,255,.18) !important; }
.app[data-route="home"] .topnav a[aria-current="page"] { color: #fff; }
.app[data-route="home"] .bottomnav a[aria-current="page"] { color: #fff; }
body:has(#app[data-route="home"]) .ambient, body:has(#app[data-route="word"]) .ambient { display: none; }
.home { position: relative; min-height: 100dvh; color: #fff; display: flex; justify-content: center; }
.scene-bg { position: fixed; inset: 0; background: #0E1217; overflow: hidden; z-index: 0; }
.scene-bg img { position: absolute; inset: -2%; width: 104%; height: 104%; object-fit: cover; filter: saturate(1.05) brightness(.84); animation: drift 30s ease-in-out infinite alternate; }
.scene-bg .wshade, .ehead .wshade, .dailyhero .wshade { position: absolute; inset: 0; background: radial-gradient(120% 70% at 50% 46%, rgba(6,9,13,.3), rgba(6,9,13,.64) 100%), linear-gradient(to bottom, rgba(6,9,13,.5), rgba(6,9,13,.06) 26%, rgba(6,9,13,.1) 60%, rgba(6,9,13,.66)); }
.hinner { position: relative; z-index: 2; width: 100%; max-width: calc(680px + 2 * var(--gutter)); padding: calc(110px + var(--safe-top)) var(--gutter) calc(120px + var(--safe-bottom)); display: flex; flex-direction: column; gap: var(--s5); }
.htitle { margin: 0; font-family: var(--serif); font-weight: 400; font-size: calc(clamp(34px, 8.6vw, 60px) * var(--scale)); line-height: 1.08; text-align: center; text-wrap: balance; text-shadow: 0 2px 30px rgba(0,0,0,.4); }
.br-phone { display: none; }
@media (max-width: 480px) { .br-phone { display: inline; } }
.wotd { margin-top: auto; border-radius: var(--r-l); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); color: #fff; }
.wotd .kicker { color: rgba(255,255,255,.78); }
.wotd .kicker.soft { letter-spacing: 0; text-transform: none; font-weight: 400; }
.wotd-link { color: #fff; text-decoration: none; display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.wotd-word { font-family: var(--serif); font-size: calc(clamp(36px, 9vw, 52px) * var(--scale)); line-height: 1.05; }
.wotd-pos { font-family: var(--serif); font-style: italic; color: rgba(255,255,255,.8); }
.wotd-def { margin: 0; font-size: var(--t-l); line-height: 1.45; max-width: 46ch; }
@media (min-width: 900px) { .hinner { padding-top: 150px; justify-content: flex-start; } .wotd { margin-top: var(--s7); } }

/* ---- Pronunciation pill --------------------------------------------------------------------- */
.say { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3) 0 var(--s4); border-radius: var(--r-pill); border: 0; font-size: var(--t-m); color: #fff; cursor: pointer; }
.say.glass { background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); }
.say .ipa { font-family: "Atkinson Hyperlegible", "Noto Sans", "DejaVu Sans", "Segoe UI", system-ui, sans-serif; }
.say.small { min-height: 40px; font-size: var(--t-s); }
.say.playing .icon { animation: pulse 1s var(--ease) infinite; }
.say.skel { width: 160px; }

/* ---- A word ---------------------------------------------------------------------------------- */
.app[data-route="word"] main { padding-top: 0 !important; }
.app[data-route="word"] .topbar { display: none; }
@media (min-width: 900px) { .app[data-route="word"] .topbar { display: flex; } }
.entry { position: relative; display: flex; flex-direction: column; width: 100%; }
.ehead { position: relative; min-height: min(56vh, 420px); color: #fff; display: flex; flex-direction: column; overflow: hidden; }
.escene { position: absolute; inset: 0; background: #0E1217; }
.escene img { position: absolute; inset: -2%; width: 104%; height: 104%; object-fit: cover; filter: saturate(1.05) brightness(.82); animation: drift 30s ease-in-out infinite alternate; }
.ebar { position: relative; z-index: 2; display: flex; align-items: center; gap: var(--s2); padding: calc(var(--s3) + var(--safe-top)) var(--gutter) 0; }
.ebar .grow { flex: 1; }
.iconbtn.glass { background: var(--glass); color: #fff; box-shadow: inset 0 0 0 1px var(--glass-line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.ebar .iconbtn { width: 44px; height: 44px; }
.etitle { position: relative; z-index: 2; margin-top: auto; padding: var(--s5) var(--gutter) calc(var(--s6) + 24px); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); width: 100%; max-width: calc(var(--narrow) + 2 * var(--gutter)); margin-inline: auto; }
.epos { font-family: var(--serif); font-style: italic; color: rgba(255,255,255,.86); font-size: var(--t-m); }
.ehead-word { margin: 0; font-family: var(--serif); font-weight: 400; font-size: calc(clamp(44px, 12vw, 84px) * var(--scale)); line-height: 1.05; letter-spacing: -.01em; white-space: nowrap; max-width: 100%; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.eprons { display: flex; flex-wrap: wrap; gap: var(--s2); }
.emeta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); font-size: var(--t-s); color: rgba(255,255,255,.88); }
.syl { letter-spacing: .02em; }
.freq { display: inline-flex; align-items: center; gap: var(--s2); }
.freq .bars { display: inline-flex; align-items: flex-end; gap: 3px; }
.freq .bars i { width: 5px; border-radius: 3px; background: rgba(255,255,255,.3); display: block; }
.freq .bars i.on { background: var(--accent); }
.esheet { position: relative; z-index: 3; margin-top: -24px; background: var(--bg); border-radius: 28px 28px 0 0; padding: var(--s2) 0 var(--s8); box-shadow: 0 -18px 40px -24px rgba(0,0,0,.45); min-height: 50vh; }
.esheet::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: url("/art/grain.png") repeat; background-size: 72px; opacity: .35; pointer-events: none; }
[data-theme="dark"] .esheet::before { opacity: .4; filter: invert(1); }
.etabbar { position: sticky; top: 0; z-index: 6; padding: var(--s3) var(--gutter); background: var(--bg); border-radius: 28px 28px 0 0; display: flex; flex-direction: column; gap: var(--s2); max-width: calc(var(--narrow) + 2 * var(--gutter)); margin: 0 auto; }
.etabbar.stuck { border-radius: 0; box-shadow: 0 10px 20px -18px rgba(0,0,0,.5); }
.emini { display: none; font-size: var(--t-l); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-top: calc(var(--safe-top)); }
.etabbar.stuck .emini { display: block; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--soft); border-radius: var(--r-pill); padding: 4px; gap: 2px; }
.seg button { min-height: 40px; border: 0; background: none; border-radius: var(--r-pill); font-weight: 700; font-size: var(--t-s); color: var(--muted); padding: 0 var(--s2); white-space: nowrap; transition: background-color var(--d2) var(--ease), color var(--d2) var(--ease); }
.seg button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 2px 0 var(--lip); }
@media (max-width: 360px) { .seg button { font-size: var(--t-xs); padding: 0 4px; } }
.epanel { position: relative; padding: var(--s4) var(--gutter) 0; max-width: calc(var(--narrow) + 2 * var(--gutter)); margin: 0 auto; }
.epanel > .stack.loose { --gap: var(--s6); }

/* Meanings */
.posgroup { display: flex; flex-direction: column; gap: var(--s3); }
.poshead { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); }
.poshead h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: calc(1.25rem * var(--scale)); line-height: 1.3; }
.poshead .muted { font-size: var(--t-xs); }
.poshead .forms { flex-basis: 100%; font-size: var(--t-s); color: var(--muted); }
.senses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s4); }
.sense { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--s3); background: var(--card); border-radius: var(--r-l); padding: var(--s4); box-shadow: var(--shadow); }
@media (min-width: 680px) { .sense { padding: var(--s5); } }
.sense .num { width: 24px; height: 24px; border-radius: 50%; background: var(--soft); font-family: var(--serif); font-size: 14px; display: flex; align-items: center; justify-content: center; margin-top: 1px; box-shadow: 0 2px 0 var(--lip); }
.senses > .sense:first-child .num { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 var(--accent-lip); }
.sbody { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.def { margin: 0; font-size: var(--t-m); line-height: 1.5; max-width: var(--measure); }
.labs { display: flex; flex-wrap: wrap; gap: var(--s1); }
.lab { font-size: var(--t-xs); font-weight: 700; letter-spacing: .02em; line-height: 1.2; padding: 4px 10px; border-radius: var(--r-pill); background: var(--soft); color: var(--muted); }
.lab.warn { background: var(--bad-bg); color: var(--bad); }
.exs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.ex { font-family: var(--serif); font-style: italic; font-size: var(--t-s); line-height: 1.5; color: var(--muted); padding-left: var(--s3); border-left: 3px solid var(--accent); max-width: var(--measure); }
.ex mark { background: none; color: var(--ink); font-weight: 600; font-style: italic; }
.ex .exsrc { display: block; font-family: var(--sans); font-style: normal; font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }
a.exsrc { color: var(--muted); }
.ex.quote { border-left-color: var(--line); }
.subs { list-style: none; margin: var(--s1) 0 0; padding: var(--s3) 0 0; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: var(--s3); }
.subs > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--s2); }
.subn { font-size: var(--t-xs); font-weight: 700; color: var(--muted); padding-top: 3px; }
.similar { margin: var(--s1) 0 0; font-size: var(--t-s); display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.similar a { color: var(--link); }
.similar .more { min-height: 32px; margin-left: var(--s2); gap: 2px; text-decoration: none; font-weight: 700; }
.showmore { margin-top: var(--s1); }
.btn.wide { width: 100%; }
.note { display: flex; gap: var(--s3); align-items: flex-start; background: var(--good-bg); color: var(--ink); border-radius: var(--r-m); padding: var(--s3) var(--s4); margin: 0; }
.note .icon { color: var(--good); flex-shrink: 0; margin-top: 2px; }
.note.quiet { background: var(--soft); }
.teaser { display: flex; align-items: center; gap: var(--s4); width: 100%; text-align: left; border: 0; background: var(--card); color: var(--ink); border-radius: var(--r-l); padding: var(--s4); box-shadow: var(--shadow); }
.teaser img { border-radius: 50%; background: var(--tile); flex-shrink: 0; }
.teaser .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.teaser .muted { font-size: var(--t-s); }
.attrib { font-size: var(--t-xs); color: var(--muted); margin: 0; line-height: 1.5; }
.attrib a, .attrib .linkbtn { color: var(--muted); font-size: inherit; min-height: 0; padding: 0; }

/* Synonyms */
.mpick { display: flex; flex-direction: column; gap: var(--s2); }
.mopt { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: var(--s3); min-height: 56px; text-align: left; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: var(--r-m); padding: var(--s3) var(--s4); }
.mopt[aria-checked="true"] { border-color: var(--link); box-shadow: inset 0 0 0 1px var(--link); }
.mpos { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: var(--t-s); min-width: 3.5em; }
.mdef { font-size: var(--t-s); line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tryit { gap: var(--s2); }
.trysent { margin: 0; font-family: var(--serif); font-size: calc(clamp(19px, 4.6vw, 23px) * var(--scale)); line-height: 1.4; }
.trysent mark { background: color-mix(in srgb, var(--accent) 34%, transparent); color: inherit; border-radius: 6px; padding: 0 6px; font-weight: 600; display: inline-block; }
.tier { display: flex; flex-direction: column; gap: var(--s3); }
.tier h3 { margin: 0; font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wchips { gap: var(--s2) var(--s2); }
.wchip { display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--s4); border-radius: var(--r-pill); border: 0; background: var(--card); color: var(--ink); font-family: var(--serif); font-size: calc(1.125rem * var(--scale)); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 3px 0 var(--lip); margin-bottom: 3px; white-space: nowrap; text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; transition: transform var(--d1) var(--ease), background-color var(--d2) var(--ease); }
.wchip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.wchip.small { min-height: 44px; font-size: calc(1.0625rem * var(--scale)); }
.wchip.soft { background: color-mix(in srgb, var(--card) 70%, var(--soft)); }
.wchip.opp { background: color-mix(in srgb, var(--berry) 9%, var(--card)); }
.wchip.sel { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 3px 0 var(--accent-lip); }
.wchip.static { box-shadow: none; background: var(--soft); }

/* Origin: the word's journey */
.ohead { display: flex; flex-direction: column; gap: var(--s1); }
.omap { padding: var(--s5) 0 var(--s6); }
.ostop { width: min(260px, 70%); margin-bottom: var(--s6); }
.ostop .disc { width: 84px; height: 84px; }
.ostop.current .disc { width: 96px; height: 96px; }
.olab { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; background: var(--card); border-radius: var(--r-m); padding: var(--s2) var(--s4); box-shadow: 0 2px 0 var(--lip); max-width: 100%; }
.olang { font-size: var(--t-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.oword { font-family: var(--serif); font-weight: 400; font-size: calc(1.375rem * var(--scale)); line-height: 1.2; overflow-wrap: anywhere; }
.ogloss { font-size: var(--t-s); color: var(--ink); }
.oera { font-size: var(--t-xs); color: var(--muted); }
.trail path.walked.draw { stroke: var(--accent); stroke-width: 6; stroke-dasharray: 2 16; animation: walk 2.4s var(--ease) both .3s; }
@keyframes walk { from { opacity: 0; } to { opacity: 1; } }
.otext { margin: 0; line-height: 1.6; max-width: var(--measure); }
.ocard h3 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: calc(1.25rem * var(--scale)); }
.ostop { animation: nodeIn .6s var(--spring) both; animation-delay: calc(var(--i, 0) * 160ms + 200ms); }
@media (prefers-reduced-motion: reduce) { .ostop, .trail path.walked.draw { animation: none; } }

/* ---- Describe it ------------------------------------------------------------------------------ */
.dhead { display: flex; align-items: center; gap: var(--s4); }
.dhead .disc { width: 96px; height: 96px; }
@media (max-width: 380px) { .dhead .disc { width: 72px; height: 72px; } }
.dform { gap: var(--s3); }
.dinput { width: 100%; border: 0; background: none; resize: vertical; min-height: 84px; font-family: var(--serif); font-size: max(19px, calc(1.1875rem * var(--scale))); line-height: 1.4; color: var(--ink); outline: none; padding: 0; }
.dform:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 40%, transparent), var(--shadow); }
.dbest { text-decoration: none; color: var(--ink); gap: var(--s2); border: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); }
.dword { font-family: var(--serif); font-size: calc(clamp(30px, 7vw, 40px) * var(--scale)); line-height: 1.1; display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s2); }
.dword.small { font-size: calc(1.375rem * var(--scale)); }
.dpos { font-family: var(--serif); font-style: italic; font-size: var(--t-s); color: var(--muted); }
.dgloss { font-size: var(--t-s); color: var(--muted); line-height: 1.45; }
.dlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.drow { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s1); min-height: 64px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.drow .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dmatch { font-size: var(--t-xs); font-weight: 700; color: var(--muted); background: var(--soft); border-radius: var(--r-pill); padding: 4px 10px; white-space: nowrap; }
.dmatch.strong { background: var(--good-bg); color: var(--good); }
.skel-row { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3) 0; }
.dym { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---- Lists of words (Library, Daily, topics) ------------------------------------------------- */
.llist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; background: var(--card); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }
.llist > li { border-bottom: 1px solid var(--line); }
.llist > li:last-child { border-bottom: 0; }
.lrow { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: var(--s3) var(--s4); text-decoration: none; color: var(--ink); }
.lrow:hover { background: color-mix(in srgb, var(--soft) 55%, transparent); }
.ww { font-family: var(--serif); font-size: calc(1.1875rem * var(--scale)); line-height: 1.25; overflow-wrap: anywhere; }
.wd { font-size: var(--t-s); color: var(--muted); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lli { display: flex; align-items: center; }
.lli .lrow { flex: 1; min-width: 0; }
.lli .iconbtn.small { width: 44px; height: 44px; margin-right: var(--s3); box-shadow: none; background: var(--soft); }
.switch.inline { border-bottom: 0; padding: 0; min-height: 48px; gap: var(--s3); }

/* ---- Explore and Daily -------------------------------------------------------------------- */
.lib.explore { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .lib.explore { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lib.explore .gcard { text-decoration: none; }
.lib.explore .gcard small { margin-top: -6px; }
.thead { display: flex; align-items: center; gap: var(--s4); }
.thead .disc { width: 96px; height: 96px; }
.vocab-card { display: flex; align-items: center; gap: var(--s4); text-decoration: none; color: var(--ink); background: var(--card); border-radius: var(--r-l); padding: var(--s4); box-shadow: var(--shadow); }
.vocab-card img { border-radius: 12px; flex-shrink: 0; box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.vocab-card .grow { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.vocab-card .muted { font-size: var(--t-s); }
.panel .vocab-card { box-shadow: none; background: var(--soft); }
.dailyhero { position: relative; display: block; border-radius: var(--r-l); overflow: hidden; min-height: 260px; color: #fff; text-decoration: none; box-shadow: var(--shadow-lift); }
.dh-scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.85); }
.dh-text { position: relative; z-index: 2; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s6) var(--s5) var(--s5); min-height: 260px; justify-content: flex-end; }
.dh-text .kicker { color: rgba(255,255,255,.8); }
.dh-word { font-family: var(--serif); font-size: calc(clamp(40px, 10vw, 60px) * var(--scale)); line-height: 1.05; text-shadow: 0 2px 24px rgba(0,0,0,.4); }
.dh-def { font-size: var(--t-m); max-width: 46ch; line-height: 1.45; }

/* ---- Settings bits ------------------------------------------------------------------------- */
.shead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); }
.shead .page-head { flex: 1; min-width: 200px; }
.people.compact { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.people.compact .person[aria-pressed="true"] .avatar { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent); }
progress { width: 100%; height: 10px; accent-color: var(--accent); }

/* ---- Wide screens: the word on its scene beside the reading column ---------------------------- */
@media (min-width: 1000px) {
  .entry { display: grid; grid-template-columns: minmax(380px, 460px) minmax(0, 1fr); gap: var(--s6); max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s4) var(--gutter) 0; align-items: start; }
  .ehead { position: sticky; top: 88px; min-height: calc(100vh - 120px); max-height: 760px; border-radius: 28px; box-shadow: 0 3px 0 var(--lip), 0 30px 50px -30px rgba(0,0,0,.6); }
  .etitle { padding: var(--s6); max-width: none; }
  .ebar { padding: var(--s4) var(--s5) 0; }
  .ebar .iconbtn[aria-label="Back"] { display: none; }
  .esheet { margin-top: 0; background: none; box-shadow: none; padding-top: 0; }
  .esheet::before { display: none; }
  .etabbar { top: 72px; background: var(--bg); border-radius: var(--r-l); padding-inline: 0; max-width: none; }
  .etabbar.stuck { border-radius: 0; }
  .epanel { padding-inline: 0; max-width: none; }
  .app[data-route="word"] main { padding-top: 0 !important; }
}

/* Synonym sorting, mix-ups and "choosing the right word" */
.sortrow { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.sorter { flex-wrap: wrap; }
.card.usage, .card.mix { gap: var(--s2); }
.uwords { margin: 0; font-family: var(--serif); font-size: var(--t-l); line-height: 1.4; overflow-wrap: anywhere; }
.uwords a, .mixpair a { color: var(--link); text-decoration: none; }
.uwords .dot { color: var(--muted); }
.unote { margin: 0; font-size: var(--t-m); line-height: 1.55; max-width: 62ch; }
.mixrow + .mixrow { border-top: 1px solid var(--line); padding-top: var(--s3); margin-top: var(--s1); }
.mixpair { margin: 0 0 var(--s1); font-family: var(--serif); font-size: var(--t-l); }
.ofacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--s3); }
.ofact { background: var(--card); border-radius: var(--r-m); padding: var(--s3) var(--s4); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: var(--s1); min-width: 0; overflow-wrap: anywhere; }
.ofact strong { font-family: var(--serif); font-size: var(--t-l); font-weight: 600; }
.ofact .muted { font-size: var(--t-s); }
.note.form { align-items: center; flex-wrap: wrap; }
.note.form .grow { flex: 1 1 200px; min-width: 0; }
.wchip.static.here { background: color-mix(in srgb, var(--accent) 30%, var(--card)); font-weight: 600; }
.sense { position: relative; }
.sact { position: absolute; top: 0; right: 0; opacity: .7; }
.sact:hover, .sact:focus-visible { opacity: 1; }
.sense .sbody { padding-right: 44px; }
.sense.flash { animation: flashSense 2.2s var(--ease) 1; border-radius: var(--r-m); }
@keyframes flashSense { 0%, 30% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }
.cite { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.citetext { margin: 0; font-size: var(--t-s); line-height: 1.5; overflow-wrap: anywhere; user-select: all; }
@media print {
  .topbar, .bottomnav, .etabbar, .sact, .iconbtn, footer, .teaser, .attrib button, .sbox, .toast, #layer, .freq, .etabs, .emini, .nearby, .eprons .slow, .ios-statusband, .showmore, .findm { display: none !important; }
  .ehead-word { text-shadow: none !important; color: #000 !important; }
  .say { display: inline-flex !important; background: none !important; box-shadow: none !important; color: #000 !important; border: 0 !important; padding: 0 !important; }
  .say .icon { display: none !important; }
  .teaser.origin { display: flex !important; box-shadow: none !important; }
  .esheet::after { content: "lumin-lookup.theimagination.space"; display: block; margin-top: 16px; font-size: 11px; color: #555; }
  .escene { display: none !important; }
  .ehead { min-height: 0 !important; color: #000 !important; }
  body { background: #fff !important; color: #000 !important; }
  .sense { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
.findm { width: 100%; min-height: 48px; font-size: max(16px, var(--t-m)); }
.teaser.vocab { text-decoration: none; color: var(--ink); }
/* The search field's own input never takes the general input styling */
.sfield .sinput, .sfield .sinput:focus { background: none; box-shadow: none; border: 0; border-radius: 0; }
/* Top bar on phones: logo, a compact Install button and the profile always fit */
@media (max-width: 599px) {
  .topbar { gap: var(--s2); }
  .topbar .brand span { font-size: 20px; }
  .topbar .btn.getapp { padding: 0 var(--s3); min-height: 44px; }
  .topbar .getapp .wide-only { display: none; }
}
@media (max-width: 379px) { .topbar .brand span { display: none; } }
.sact { background: none; box-shadow: none; color: var(--muted); }
.sact .icon { width: 18px; height: 18px; }

/* ---- Text fields: even padding, text centered vertically, and fields that grow with what you type ---------------- */
.app input[type="text"], .app input[type="search"]:not(.sinput), .app input[type="password"], .app input[type="number"], .app select {
  min-height: 52px; padding: 0 var(--s4); line-height: 1.3; border-radius: var(--r-m);
}
.app textarea, .sheet textarea {
  display: block; width: 100%; min-height: 52px; padding: 14px var(--s4); line-height: 1.45; resize: none; overflow-y: hidden;
  border-radius: var(--r-m); box-sizing: border-box; font-size: max(16px, var(--t-m)); max-height: 50vh;
}
.app textarea.scrolls, .sheet textarea.scrolls { overflow-y: auto; }
/* Describe it: the description box is a real field, starting at one line and growing as the description does */
.dinput { min-height: 60px; padding: 16px var(--s4); border-radius: var(--r-m); background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); line-height: 1.4; }
.dinput:focus { box-shadow: inset 0 0 0 2px var(--link); }
.dform .split { align-items: center; }
.findm { padding: 0 var(--s4); }

/* ---- Buttons, pills and chips: label centered both ways, icon and text on one line ------------------------------- */
.btn, .chip, .gchip, .wchip, .tab, .say, .mode, .linkbtn.more, .iconbtn { justify-content: center; text-align: center; line-height: 1.2; }
.btn > span, .chip > span, .gchip > span { display: inline-flex; align-items: center; }
.btn .icon, .chip .icon, .gchip .icon, .iconbtn .icon { flex-shrink: 0; }
.iconbtn { display: inline-flex; align-items: center; }
.sfield .sinput { color: inherit; }
.sfield.glass .sinput { color: #fff; caret-color: #fff; }
.sheet textarea.input { min-height: 112px; }

/* ---- Installed app: full screen ------------------------------------------------------------------------------------
   Android and desktop hide the status bar, navigation bar and taskbar (manifest display: fullscreen). iPhone and iPad
   always show the status bar; the app draws under it, with a soft dark band so the clock stays readable. */
@media (display-mode: fullscreen), (display-mode: standalone) {
  html { overscroll-behavior-y: none; }
}
.ios-statusband { position: fixed; left: 0; right: 0; top: 0; height: env(safe-area-inset-top, 0px); z-index: 50; pointer-events: none;
  background: linear-gradient(to bottom, rgba(10, 14, 20, .55), rgba(10, 14, 20, .25)); }

/* ---- Foldables -----------------------------------------------------------------------------------------------------
   Every layout is fluid from a 280px cover screen up, so folded and unfolded phones get the same app at their size.
   When a page spans two screens side by side (a book-style fold, or a dual-screen device), the word sits on the left
   screen and its meanings on the right, so nothing falls into the hinge. Stacked screens (tabletop posture) put the
   word above the hinge and the meanings below it. */
@media (max-width: 300px) {
  :root { --gutter: 12px; }
  .btn { padding: 0 var(--s3); }
  .gchip, .chip, .wchip { padding: 0 var(--s3); }
  .smodes { gap: var(--s1); }
  .ehead-word { font-size: clamp(30px, 11vw, 44px) !important; }
}
@media (horizontal-viewport-segments: 2) {
  .entry:not(.loading) { display: grid; grid-template-columns: env(viewport-segment-width 0 0, 50%) env(viewport-segment-width 1 0, 50%);
    column-gap: calc(env(viewport-segment-left 1 0, 0px) - env(viewport-segment-right 0 0, 0px)); align-items: start; }
  .entry:not(.loading) > .ehead { position: sticky; top: 0; height: 100dvh; }
  .entry:not(.loading) > .esheet { margin-top: 0; border-radius: 0; min-height: 100dvh; }
  .hinner { max-width: env(viewport-segment-width 0 0, 50%); }
  .page { max-width: min(var(--wide), env(viewport-segment-width 1 0, 100%)); margin-left: env(viewport-segment-left 1 0, auto); }
}
@media (vertical-viewport-segments: 2) {
  .entry:not(.loading) > .ehead { height: env(viewport-segment-height 0 0, 50dvh); min-height: 0; }
  .entry:not(.loading) > .esheet { margin-top: calc(env(viewport-segment-top 0 1, 0px) - env(viewport-segment-bottom 0 0, 0px)); }
}
.gram { display: block; font-family: var(--serif); font-style: italic; color: var(--muted); font-size: var(--t-s); margin-bottom: 2px; }
.sayslike { font-size: var(--t-s); color: rgba(255,255,255,.86); }
.sayslike strong { font-weight: 700; letter-spacing: .02em; }
.wchip.rare { opacity: .8; font-style: italic; }
.split.start { justify-content: flex-start; gap: var(--s4); flex-wrap: wrap; }
.note.fix { background: color-mix(in srgb, var(--accent) 16%, var(--card)); }
/* The search field is a one-line text area that grows: icon and clear button stay on the first line */
.sfield { align-items: flex-start; }
.sfield .sicon, .sfield .sclear { height: 56px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.app .sfield .sinput, .sheet .sfield .sinput { display: block; min-height: 56px; height: 56px; padding: 15px var(--s1); line-height: 26px; resize: none; overflow-y: hidden;
  max-height: calc(4 * 26px + 30px); border-radius: 0; box-shadow: none; background: none; font-size: max(17px, calc(var(--t-m) + 1px)); }
.sbox.compact .sfield { min-height: 48px; }
.sbox.compact .sfield .sicon, .sbox.compact .sfield .sclear { height: 48px; }
.app .sbox.compact .sfield .sinput { min-height: 48px; height: 48px; padding: 11px var(--s1); }
@media (max-width: 360px) { .btn { white-space: normal; line-height: 1.25; padding-block: 10px; } }
.sfield .sclear[hidden] { display: none; }

/* ---- Every screen, every fold (continued) ---------------------------------------------------------------------- */
/* Cover screens: credits wrap (the tab bar fits five places at 280 px in app.css, labels stay 13 px) */
.attrib { display: flex; flex-wrap: wrap; column-gap: var(--s2); row-gap: 2px; align-items: baseline; }
/* Short landscape (an unfolded phone held sideways, a phone turned sideways): places as icons in the top bar */
@media (max-width: 899px) and (orientation: landscape) and (max-height: 540px) {
  .topnav .lbl { display: none; }
  .topnav a { padding: 0 var(--s2); }
  .topbar .getapp .wide-only { display: none; }
}
@media (max-width: 1099px) { .topbar { min-width: 0; } .topnav { flex-shrink: 1; min-width: 0; } }
@media (max-width: 1099px) and (min-width: 900px) { .topnav .lbl { display: none; } }
/* Book-style unfolded screens held open (about 760 to 999 wide, wider than tall): two equal panes, so the word sits
   on one half and its meanings on the other, and nothing lands on the crease */
@media (min-width: 760px) and (max-width: 999px) and (min-aspect-ratio: 1/1) {
  .entry:not(.loading) { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; padding: var(--s3) var(--gutter) 0; align-items: start; }
  .entry:not(.loading) .ehead { position: sticky; top: var(--s3); min-height: calc(100dvh - 2 * var(--s3)); max-height: none; border-radius: 28px; }
  .entry:not(.loading) .esheet { margin-top: 0; background: none; box-shadow: none; padding-top: 0; }
  .entry:not(.loading) .etabbar { top: 0; background: var(--bg); }
}
/* Big text, zoomed pages and short windows: a shorter scene, so the first meaning shows on arrival */
@media (max-width: 999px) { .ehead { min-height: min(46vh, 420px); } }
@media (max-height: 640px) and (max-width: 999px) { .ehead { min-height: min(40vh, 300px); } .ebar { padding-top: calc(var(--s2) + var(--safe-top)); } }
@media (min-width: 1000px) { .ehead { max-height: min(760px, calc(100vh - 120px)); } }
@media (horizontal-viewport-segments: 2) {
  .sheet { left: env(viewport-segment-left 1 0) !important; right: 0; width: auto; }
  .bottomnav { left: calc(env(viewport-segment-left 1 0) + 10px) !important; }
}
@media (display-mode: fullscreen) { .getapp { display: none !important; } }
/* The word and home pages paint under the status bar themselves (their bars add the safe area), so no double gap */
@media (max-width: 999px) { .app[data-route="word"], .app[data-route="home"] { padding-top: 0; } }
.app[data-route="home"] { padding-top: 0; }
.say .pron { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.say .ipa2 { display: block; font-size: var(--t-xs); opacity: .8; font-weight: 400; }
.eprons { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
/* a button beside a setting's text keeps its label on one line; the text takes the squeeze */
.switch > .btn { flex-shrink: 0; white-space: nowrap; }
.switch > .txt { min-width: 0; }
/* Layout audit fixes (reviews/layout.md, items 1 to 18) */
.page > .shead { font-size: inherit; font-weight: inherit; letter-spacing: normal; text-transform: none; color: inherit; padding: 0; }
.seg { display: flex; flex-wrap: wrap; border-radius: 24px; }
.seg button { flex: 1 1 0; min-width: max-content; min-height: var(--tap); padding: 0 var(--s3); }
.etabbar { container: etab / inline-size; }
@container etab (max-width: 18em) { .etabs button { flex: 1 1 calc(50% - 1px); } }
.app .sfield .sinput.scrolls { overflow-y: auto; }
.sfield { border-radius: 28px; }
.sbox.compact .sfield { border-radius: 24px; }
.btn > span { display: inline; text-align: center; }
.topbar .btn.getapp { font-size: min(var(--t-s), 16px); }
.topbar .brand { min-width: 0; }
.topbar .brand span { overflow: hidden; text-overflow: ellipsis; }
.app .dinput { min-height: 56px; padding: 15px var(--s4); line-height: 26px; }
.dform:focus-within { box-shadow: var(--shadow); }
.seg button, .segctl button, .say.small, .similar .more { min-height: var(--tap); }
.topnav a { min-height: var(--tap); min-width: var(--tap); justify-content: center; }
@media (max-width: 360px) { .btn.small { white-space: nowrap; } .btn:not(.small) { text-wrap: balance; } }
@media (horizontal-viewport-segments: 2) {
  .home { justify-content: flex-start; }
  .hinner { margin-right: auto; }
  .entry:not(.loading) { padding: 0; margin: 0; max-width: none; width: 100%; }
  .entry:not(.loading) > .ehead { border-radius: 0; top: 0; }
  .app.has-nav .topbar { max-width: none; }
  .topnav { margin-left: auto; }
  .topnav .lbl { display: none; }
  .topsearch { max-width: calc(env(viewport-segment-right 0 0, 50vw) - 240px); }
}
.sense .sbody { padding-right: 0; }
/* the quote button sits in the card's top right corner and reaches 32px into the text column and 32px down;
   only the first line or two of a meaning give way to it, so definitions keep their full width below */
.sense .sbody > :first-child { padding-right: 34px; }
.sense .sbody > .labs:first-child + * { padding-right: 34px; }
@media (min-width: 760px) and (max-width: 999px) and (min-aspect-ratio: 1/1) and (max-height: 639px) {
  .entry:not(.loading) { display: flex; padding: 0; }
  .entry:not(.loading) .ehead { position: relative; top: 0; min-height: min(40vh, 300px); border-radius: 0; }
  .entry:not(.loading) .esheet { margin-top: -24px; background: var(--bg); }
}
.htitle { font-size: min(calc(clamp(34px, 8.6vw, 60px) * var(--scale)), 13vw); }
@media (max-width: 300px) { .ehead-word { font-size: calc(clamp(30px, 11vw, 44px) * var(--scale)) !important; } }
.page .dhead { flex-direction: row; align-items: center; }
[data-theme="dark"] .btn { box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 4px 0 var(--lip), 0 12px 20px -14px rgba(0,0,0,.6); }
[data-theme="dark"] .btn.quiet, [data-theme="dark"] .wchip { box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 3px 0 var(--lip); }
[data-theme="dark"] .gchip:not(.glass), [data-theme="dark"] .chip { box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 2px 0 var(--lip); }
[data-theme="dark"] .seg button[aria-selected="true"] { background: color-mix(in srgb, var(--ink) 10%, var(--card)); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 2px 0 var(--lip); }
[data-theme="dark"] .btn.primary { box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 4px 0 var(--accent-lip), 0 12px 20px -14px rgba(0,0,0,.6); }
:root:not([data-theme="dark"]) .note.quiet a, :root:not([data-theme="dark"]) .wchip.static a { color: #1A5E66; }
.actions > .btn.quiet, .dym > .btn.quiet { min-height: 52px; border-radius: var(--r-m); margin-bottom: 4px; }
.say { padding: 0 14px; }
.mopt { align-content: center; }
.llist.mix .wd { -webkit-line-clamp: 5; line-clamp: 5; }
/* "Open the entry for happy" on Letters and Describe when a real word was typed there */
.card.nudge { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); min-height: var(--tap); text-decoration: none; color: inherit; margin-bottom: var(--s4); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.card.nudge .nudge-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card.nudge small { color: var(--muted); font-size: var(--t-s); }
.card.nudge .icon { flex-shrink: 0; color: var(--accent); }
/* Recent searches header: the label on the left, Clear on the right, both on one centered line */
.sugs .rhead { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding-right: var(--s1); }
.sugs .rhead .sclearall { min-height: var(--tap); padding: 0 var(--s3); font-size: var(--t-s); font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--link); text-decoration: none; }
.sugs .rhead .sclearall:hover { text-decoration: underline; }
/* Home: the word of the day sits a fixed step below the search on every phone, instead of being pushed to the bottom
   of the screen (which left a tall gap on tall Android screens and none on shorter iPhones) */
.wotd { margin-top: var(--s6); }
@media (min-width: 900px) { .wotd { margin-top: var(--s7); } }


/* =====================================================================================================================
   Lumin Reader
   ===================================================================================================================== */

/* ---- Home: the scene, then the shelves on paper ---- */
.app[data-route="home"] .home { min-height: min(78dvh, 760px); }
.app[data-route="home"] .hinner { padding-bottom: calc(var(--s8) + 24px); justify-content: center; align-items: center; text-align: center; }
.hlead { max-width: 30ch; font-size: calc(clamp(18px, 2.4vw, 21px) * var(--scale)); line-height: 1.5; text-shadow: 0 1px 18px rgba(0,0,0,.5); margin: 0 auto; }
.btn.big { min-height: 54px; padding: 0 var(--s5); font-size: var(--t-l); }
.continue { display: flex; align-items: center; gap: var(--s4); width: 100%; max-width: 520px; margin: 0 auto; padding: var(--s3) var(--s4) var(--s3) var(--s3); border-radius: var(--r-l); color: #fff; text-decoration: none; text-align: left;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); transition: transform var(--d2) var(--spring); }
.continue:active { transform: scale(.98); }
.continue .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.continue .kicker { color: rgba(255,255,255,.8); }
.continue .ct2 { font-family: var(--serif); font-size: var(--t-xl); line-height: 1.15; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.homebody { position: relative; z-index: 2; background: var(--bg); border-radius: 28px 28px 0 0; margin-top: -28px; max-width: none !important; width: 100%;
  padding: var(--s6) var(--gutter) calc(var(--s7) + 92px + var(--safe-bottom)); display: flex; flex-direction: column; gap: var(--s6); }
.homebody > * { width: 100%; max-width: var(--wide); margin-left: auto; margin-right: auto; }
.center { text-align: center; }

/* ---- Covers ---- */
.cover { position: relative; display: block; aspect-ratio: 2 / 3; width: 100%; border-radius: 10px; overflow: hidden; flex: none;
  background: linear-gradient(160deg, hsl(var(--hue) 34% 34%), hsl(calc(var(--hue) + 30) 30% 18%));
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 22px -14px rgba(10,14,20,.6), 0 2px 0 rgba(0,0,0,.08); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .ctext { position: absolute; left: 8%; right: 8%; bottom: 7%; padding: 8% 7% 7%; border-radius: 8px; background: rgba(250,247,240,.92); color: #18212B; display: flex; flex-direction: column; gap: 3px; text-align: center; }
.cover .ct { font-family: var(--serif); font-size: clamp(11px, 1.05em, 15px); line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; text-wrap: balance; }
.cover .ca { font-size: clamp(9px, .72em, 11px); color: #4A5560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .02em; }
.cover.small { width: 54px; border-radius: 7px; } .cover.small .ctext { display: none; }
.cover.big { width: min(240px, 52vw); border-radius: 14px; font-size: 20px; }

/* ---- Book cards, shelves and the grid ---- */
.bcard { display: flex; flex-direction: column; gap: var(--s2); text-decoration: none; color: var(--ink); min-width: 0; -webkit-tap-highlight-color: transparent; }
.bcard .cover { transition: transform var(--d2) var(--spring), box-shadow var(--d2) var(--ease); font-size: 14px; }
.bcard:hover .cover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 18px 30px -16px rgba(10,14,20,.6); }
.bcard:active .cover { transform: scale(.97); }
.bmeta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bt { font-family: var(--serif); font-size: var(--t-m); line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ba { font-size: var(--t-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btags { display: flex; align-items: center; gap: var(--s2); flex-wrap: nowrap; white-space: nowrap; overflow: hidden; font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }
.bprog { display: block; height: 4px; border-radius: 4px; background: var(--soft); overflow: hidden; margin-top: 6px; }
.bprog i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bprog.light { background: rgba(255,255,255,.22); }
.shelf { display: flex; flex-direction: column; gap: var(--s3); }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.shelf-head .sec-title { margin: 0; }
.shelf-sub { margin-top: calc(-1 * var(--s2)); }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(118px, 30vw, 150px); gap: var(--s4); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  padding: 4px var(--gutter) var(--s3); margin: 0 calc(-1 * var(--gutter)); scrollbar-width: none; }
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-row > * { scroll-snap-align: start; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(120px, 28vw, 160px), 1fr)); gap: var(--s5) var(--s4); }
.fit { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 700; color: var(--ink); white-space: nowrap; }
.fit i { width: 9px; height: 9px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 22%, transparent); }
.fit.stretch i { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
.fit.challenging i { background: var(--berry); box-shadow: 0 0 0 3px color-mix(in srgb, var(--berry) 22%, transparent); }
.dot::before { content: "·"; margin-right: var(--s2); }

/* ---- Library filters ---- */
.libsearch { max-width: 680px; }
.libsearch .sfield { display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s4); }
.libsearch .sinput { flex: 1; min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); }
.fsel select { appearance: none; -webkit-appearance: none; min-height: 40px; padding: 0 34px 0 var(--s4); border-radius: var(--r-pill); border: 0; background: var(--card) no-repeat right 12px center / 14px
  url("/art/chev.svg");
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 2px 0 var(--lip); font-size: var(--t-s); color: var(--ink); cursor: pointer; }
[data-theme="dark"] .fsel select { box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 2px 0 var(--lip); }

/* ---- A book's page ---- */
.bookpage { gap: var(--s6); }
.bhero { display: grid; grid-template-columns: auto 1fr; gap: var(--s6); align-items: start; }
.btitle { margin: 0; font-family: var(--serif); font-weight: 400; font-size: var(--t-2xl); line-height: 1.08; }
.bauthor { font-size: var(--t-l); }
.tag { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--s3); border-radius: var(--r-pill); background: var(--soft); color: var(--ink); text-decoration: none; font-size: var(--t-xs); font-weight: 700; }
.fitbox .fit { min-height: 32px; padding: 0 var(--s3); border-radius: var(--r-pill); background: var(--card); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 2px 0 var(--lip); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--s3); margin: var(--s2) 0 0; }
.facts div { background: var(--card); border-radius: var(--r-m); padding: var(--s3) var(--s4); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 2px 0 var(--lip); }
.facts dt { font-size: var(--t-xs); color: var(--muted); font-weight: 700; }
.facts dd { margin: 2px 0 0; font-family: var(--serif); font-size: var(--t-l); }
.about-book p { max-width: var(--measure); }
@media (max-width: 640px) {
  .bhero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .bhero .cluster, .bhero .actions { justify-content: center; }
  .bhero .stack { align-items: center; width: 100%; }
  .facts { width: 100%; text-align: left; }
}

/* ---- Words ---- */
.vnote { display: flex; flex-direction: row; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.vnote img { flex: none; }
.vnote p { flex: 1 1 200px; min-width: 0; }
.wlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.witem { background: var(--card); border-radius: var(--r-l); padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s2); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 2px 0 var(--lip); }
.witem .ww { font-size: var(--t-xl); }
.wsent { margin: 0; padding-left: var(--s4); border-left: 3px solid var(--line); font-style: italic; color: var(--muted); }
.cluster.tight { gap: 4px; }

/* =====================================================================================================================
   Reading (PB-U1): the page, what sits around it, and the cards that float over it (design 3, build plan 6.1 to 6.5).
   The page box never changes size when the menu cards come and go; every card floats over the page.
   ===================================================================================================================== */
html.reading .topbar, html.reading .bottomnav, html.reading .footer, html.reading .ambient { display: none !important; }
html.reading .app.has-nav main { padding: 0 !important; }
html.reading .app { padding-top: 0; }
html.reading body { background: var(--rpaper-bg, #F7F3EA); }
html[data-rpaper="sepia"] { --rpaper-bg: #F1E4CB; } html[data-rpaper="dusk"] { --rpaper-bg: #3F444A; } html[data-rpaper="night"] { --rpaper-bg: #14191F; }

/* Papers (design 23; Dusk's muted color raised to 5.5:1, tested by pb-u1/contrast.mjs) */
.reader { --paper: #F7F3EA; --ink: #1F2328; --pmuted: #6B6458; --prule: #E3DCCD; --pchrome: rgb(251 248 241 / .86); --pcard: #FFFDF8; --pline2: rgb(31 35 40 / .08);
  --pink: var(--ink); --pline: var(--prule); --rsize: 1; --rspace: 1; --rletter: 0; --rword: 0; --cscale: 1; --pt: 52px; --pb: 46px;
  --rfont: var(--serif); --rbase: 19px;
  position: fixed; inset: 0; background: var(--paper); color: var(--ink); overflow: hidden; -webkit-tap-highlight-color: transparent; }
.reader[data-paper="sepia"] { --paper: #F1E4CB; --ink: #3B2F22; --pmuted: #6A5B47; --prule: #E0CFAE; --pchrome: rgb(246 236 214 / .88); --pcard: #FAF1DF; --pline2: rgb(59 47 34 / .10); }
.reader[data-paper="dusk"] { --paper: #3F444A; --ink: #DCDFE2; --pmuted: #BCC3C9; --prule: #555B62; --pchrome: rgb(72 78 85 / .88); --pcard: #2A3036; --pline2: rgb(255 255 255 / .08); --hl-a: .32; }
.reader[data-paper="night"] { --paper: #14191F; --ink: #D8DDE2; --pmuted: #8E98A3; --prule: #26303A; --pchrome: rgb(30 37 45 / .86); --pcard: #1E262F; --pline2: rgb(255 255 255 / .07); --hl-a: .30; }
.reader[data-paper="night"], .reader[data-paper="dusk"] { color-scheme: dark; }
.reader[data-contrast="1"][data-paper="paper"] { --ink: #000; --pmuted: #4A453D; }
.reader[data-contrast="1"][data-paper="sepia"] { --ink: #1E160D; --pmuted: #4C3F2E; }
.reader[data-contrast="1"][data-paper="dusk"] { --ink: #FFFFFF; --pmuted: #D6DBE0; }
.reader[data-contrast="1"][data-paper="night"] { --ink: #FFFFFF; --pmuted: #B4BDC6; }
.reader[data-font="clear"] { --rfont: "Atkinson Hyperlegible", var(--sans); }
.reader[data-font="system"] { --rfont: ui-serif, "Iowan Old Style", "Noto Serif", Georgia, serif; }
@media (min-width: 600px) { .reader { --rbase: 20px; } }
.reader:focus { outline: none; }

/* The whole screen takes the gestures (build plan 6.1); pinch zoom is never blocked */
.rsurface { position: absolute; inset: 0; touch-action: pinch-zoom; }
.rpage { position: absolute; top: var(--pt); bottom: var(--pb); left: 28px; width: calc(100% - 56px); }
.rcols { height: 100%; overflow: hidden; overflow: clip; overflow-clip-margin: 6px; }
.reader[data-mode="pages"] .prose { height: 100%; column-width: var(--colw); column-gap: var(--gap); column-fill: auto; }
.reader[data-mode="pages"] .prose > * { break-inside: auto; }
/* While a page turns, a clear layer over the page takes stray taps (pointer-events on the text itself would restyle
   every paragraph and lay a long chapter out again) */
.reader[data-mode="pages"] .rpage::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.reader.turning .rpage::after { pointer-events: auto; }
/* A turn slides a window three pages wide (.rcols) inside the page box, never the whole chapter (read.js). Its width
   never changes while reading, so a turn lays nothing out again. */
.reader[data-mode="pages"] .rpage { overflow: clip; overflow-clip-margin: 6px; contain: strict; }
.reader[data-mode="pages"] .rcols { width: calc(3 * var(--step, 100%)); transform: translateX(0); }
.reader[data-mode="pages"] .rstrip { height: 100%; }

/* Scroll mode: the book scrolls with the window; the cards float as in pages mode */
.reader[data-mode="scroll"] { position: relative; inset: auto; min-height: 100dvh; overflow: visible; }
.reader[data-mode="scroll"] .rsurface { position: relative; inset: auto; touch-action: pan-y pinch-zoom; }
.reader[data-mode="scroll"] .rpage { position: relative; top: auto; bottom: auto; left: auto; width: auto; max-width: var(--pagew, 36em); margin: 0 auto; padding: calc(28px + var(--safe-top)) 0 calc(120px + var(--safe-bottom)); }
.reader[data-mode="scroll"] .rcols { overflow: visible; }
.reader[data-mode="scroll"] .rhead, .reader[data-mode="scroll"] .rstatus, .reader[data-mode="scroll"] .rspine, .reader[data-mode="scroll"] .rhover { display: none; }
.reader[data-mode="scroll"] .rchrome, .reader[data-mode="scroll"] .rfade, .reader[data-mode="scroll"] .rpill, .reader[data-mode="scroll"] .rribbon { position: fixed; }
.reader[data-mode="scroll"] .prose > * { scroll-margin-top: calc(76px + var(--safe-top)); }

/* The text (TY: Literata 19 px, 20 on wide screens; 1.62; old-style figures; ragged right with hyphenation) */
.prose { font-family: var(--rfont); font-size: calc(var(--rbase) * var(--rsize)); line-height: calc(1.62 * var(--rspace)); color: var(--ink); hyphens: auto; -webkit-hyphens: auto; text-wrap: pretty;
  font-kerning: normal; font-variant-numeric: oldstyle-nums proportional-nums; letter-spacing: var(--rletter); word-spacing: var(--rword);
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.reader[data-font="clear"] .prose { font-size: calc(var(--rbase) * .95 * var(--rsize)); line-height: calc(1.7 * var(--rspace)); font-variant-numeric: normal; }
.reader[data-hyphens="0"] .prose { hyphens: manual; -webkit-hyphens: manual; }
.reader[data-justify="1"] .prose p { text-align: justify; }
.reader[data-bold="1"] .prose { font-weight: 600; }
.prose p { margin: 0; text-indent: 1.4em; }
.prose > p:first-of-type, .prose h2 + p, .prose h3 + p, .prose .hgroup + p, .prose hr + p, .prose blockquote + p, .prose .poem + p, .prose .epigraph + p, .prose .sitting + p { text-indent: 0; }
.prose h2, .prose h3, .prose h4 { font-family: var(--rfont); font-weight: 400; text-align: center; margin: 1.2em 0 .9em; line-height: 1.25; text-indent: 0; break-after: avoid; text-wrap: balance; }
.prose h2 { font-size: 1.45em; } .prose h3 { font-size: 1.2em; } .prose h4 { font-size: 1.05em; font-style: italic; }
/* A part's opening: kicker, title, a short marigold rule (design 3.4) */
.prose .hgroup { text-align: center; margin: 1.3em 0 1.7em; break-after: avoid; break-inside: avoid; }
.prose .hgroup > h2, .prose .hgroup > h3 { margin: 0 0 .7em; font-family: var(--sans); font-size: max(12px, .63em); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--pmuted); line-height: 1.3; }
.prose .hgroup .ctitle, .prose > h2.ctitle { font-family: var(--rfont); font-size: 1.75em; font-style: normal; font-weight: 400; line-height: 1.15; color: var(--ink); margin: 0; text-indent: 0; text-wrap: balance; letter-spacing: -.005em; }
.prose > h2.ctitle { text-align: center; margin: 1.3em 0 1.7em; }
.prose .hgroup::after, .prose > h2.ctitle::after { content: ""; display: block; width: 36px; height: 2px; margin: .9em auto 0; border-radius: 2px; background: var(--accent, #F2B544); }
.prose .ctitle { text-indent: 0; }
/* Drop cap: three lines where the browser sets one properly (never a floated fallback), the first word in small capitals */
@supports (initial-letter: 3) or (-webkit-initial-letter: 3) {
  .prose p.drop::first-letter { -webkit-initial-letter: 3; initial-letter: 3; font-weight: 600; margin-right: .1em; color: var(--ink); }
  .prose p.drop .sc { font-variant-caps: small-caps; letter-spacing: .04em; }
}
.prose p.drop { text-indent: 0; }
/* Large text (from 170%): no drop cap, as no hyphens or justified lines (FE-09: a giant "M" beside "R." read "M R.") */
.reader[data-large="1"] .prose p.drop::first-letter { -webkit-initial-letter: normal; initial-letter: normal; font-weight: inherit; margin-right: 0; }
.reader[data-large="1"] .prose p.drop .sc { font-variant-caps: normal; letter-spacing: inherit; }
/* Headings never break inside a word: at large sizes they shrink to fit the column instead ("Sherloc / k") */
.prose h2, .prose h3, .prose h4, .prose .ctitle { overflow-wrap: normal; word-break: normal; hyphens: manual; -webkit-hyphens: manual; }
.reader[data-large="1"] .prose .hgroup .ctitle, .reader[data-large="1"] .prose > h2.ctitle { font-size: min(1.75em, calc(var(--colw, 600px) / 6.5)); }
.reader[data-large="1"] .prose h2:not(.ctitle) { font-size: min(1.45em, calc(var(--colw, 600px) / 8)); }
.reader[data-large="1"] .prose h3:not(.ctitle) { font-size: min(1.2em, calc(var(--colw, 600px) / 9)); }
/* Sacred texts: one rule for where a verse paragraph starts (RDR-QAR-18): flush, with a little space above, and verses
   run on inside it, so no verse starts indented on one line and flush on the next */
.reader[data-scripture="1"] .prose p { text-indent: 0; }
.reader[data-scripture="1"] .prose p + p { margin-top: .5em; }
.prose hr { border: 0; margin: 1.4em auto; width: 30%; border-top: 1px solid var(--prule); }
.prose blockquote { margin: 1em 0 1em 1.2em; }
.prose blockquote p { text-indent: 0; }
.prose .poem, .prose .poem p { text-indent: 0; }
.prose .poem { margin: 1em 0 1em 1em; }
.prose .poem p { margin: 0 0 .8em; }
.prose .poem span { display: block; padding-left: 1.5em; text-indent: -1.5em; }
.prose .poem span span { display: inline; padding: 0; text-indent: 0; }
.prose .poem br { display: none; }
.prose .poem .i1 { padding-left: 2.5em; } .prose .poem .i2 { padding-left: 3.5em; } .prose .poem .i3 { padding-left: 4.5em; } .prose .poem .i4 { padding-left: 5.5em; }
.prose .letter { margin: 1em 0 1em 1em; } .prose .letter p { text-indent: 0; margin-bottom: .5em; }
.prose .sign, .prose .salute { text-indent: 0; }
.prose .sign { text-align: right; font-style: italic; }
.prose .epigraph, .prose .dedication { text-align: center; font-style: italic; margin: 2em 0; } .prose .epigraph p, .prose .dedication p { text-indent: 0; }
.prose .figure { text-align: center; color: var(--pmuted); font-size: .85em; font-style: italic; text-indent: 0; }
.prose table { border-collapse: collapse; margin: .8em 0; width: 100%; font-size: .95em; }
.prose td, .prose th { vertical-align: top; padding: .15em .4em; text-align: left; }
.prose .persona { font-variant: small-caps; letter-spacing: .03em; white-space: nowrap; }
.prose .stage { font-style: italic; color: var(--pmuted); }
.prose ol, .prose ul { padding-left: 1.4em; }
.prose em, .prose i { font-style: italic; }
/* Verse numbers in sacred texts: small, quiet, never a word to tap or copy */
.prose sup.v { font-size: .62em; color: var(--pmuted); -webkit-user-select: none; user-select: none; font-family: var(--sans); font-variant-numeric: lining-nums; margin-right: .15em; }
/* The tapped word: the teal selection tint with a ring, never the marigold of a highlight */
::highlight(tapped) { background-color: var(--sel, rgb(31 111 120 / .20)); color: inherit; }
.reader[data-paper="night"] ::highlight(tapped), .reader[data-paper="dusk"] ::highlight(tapped) { background-color: rgb(31 111 120 / .45); }
.prose .rpulse { animation: rpulse 1.3s var(--ease) 1; border-radius: 4px; }
/* Where a jump landed (a verse, a search result, a note): a marigold tint on that verse or passage for a few seconds */
::highlight(rjump) { background-color: color-mix(in srgb, var(--accent, #F2B544) 34%, transparent); }
.reader[data-paper="dusk"] ::highlight(rjump), .reader[data-paper="night"] ::highlight(rjump) { background-color: rgb(242 181 68 / .26); }
@keyframes rpulse { 0%, 35% { background: color-mix(in srgb, var(--accent, #F2B544) 30%, transparent); } 100% { background: transparent; } }
/* Touch screens: the book text can't be selected by the browser, so a hold is Lumin's own (build plan 6.1). The text is
   selectable for the moment of finding the word under a finger (.pick, the Safari fallback). */
@media (pointer: coarse) { .prose { -webkit-user-select: none; user-select: none; } }
.prose.nosel { -webkit-user-select: none; user-select: none; }
.prose.pick { -webkit-user-select: text; user-select: text; }

/* A good place to stop (Daily sitting) */
.sitting { margin: 1.6em 0; display: flex; align-items: center; gap: var(--s3); font-family: var(--sans); font-size: max(13px, .7em); color: var(--pmuted); text-indent: 0; }
.sitting::before, .sitting::after { content: ""; flex: 1; height: 1px; background: var(--prule); }
.sitting span { max-width: 22ch; text-align: center; }

/* ---- Around the page: running head, status line, ribbon, spine ---- */
.rhead { position: absolute; top: 0; left: 64px; right: 64px; height: var(--pt); padding-top: var(--safe-top); display: flex; align-items: center; justify-content: center; gap: var(--gap);
  font-family: var(--sans); font-size: calc(12px * var(--cscale)); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--pmuted); pointer-events: none; box-sizing: border-box; }
.rhead span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; flex: 1; }
.rhead .rh1:empty { display: none; }
.reader[data-spread="1"] .rhead { left: var(--pagel); right: auto; width: var(--pagew); }
.rhead.off { visibility: hidden; }
.rstatus { position: absolute; left: 0; right: 0; bottom: 0; height: var(--pb); padding-bottom: var(--safe-bottom); display: flex; align-items: center; justify-content: center; gap: 12px; box-sizing: border-box;
  font-family: var(--sans); font-size: calc(13px * var(--cscale)); color: var(--pmuted); font-variant-numeric: tabular-nums; }
@media (min-width: 600px) { .rstatus { font-size: calc(14px * var(--cscale)); } }
.rstext { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; padding: 0 8px; pointer-events: none; }
.rstatus.off .rstext { visibility: hidden; }
/* Kids: two visible arrows at the ends of the status band */
.rarrow { position: absolute; bottom: calc(var(--safe-bottom) + max(0px, (var(--pb) - var(--safe-bottom) - 44px) / 2)); width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, var(--paper)); box-shadow: inset 0 0 0 1px var(--pline2); }
.rarrow.l { left: 10px; } .rarrow.r { right: 10px; }
.rarrow[hidden] { display: none; }
.rarrow:disabled { opacity: .35; }
.rarrow .icon { width: 24px; height: 24px; }
.rstatus.kid .rstext { padding: 0 60px; }
.rribbon { position: absolute; top: 0; right: max(12px, calc(100% - var(--pagel, 28px) - var(--pagew, 100px) + 4px)); width: 16px; height: 34px; background: var(--berry, #B4527A); display: none; pointer-events: none;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%); filter: drop-shadow(0 2px 3px rgb(0 0 0 / .2)); }
.rribbon.on { display: block; }
.rribbon.drop { animation: ribbonDrop 240ms var(--spring, cubic-bezier(.3,1.4,.5,1)) both; }
@keyframes ribbonDrop { from { transform: translateY(-36px); } }
.reader[data-paper="night"] .rribbon, .reader[data-paper="dusk"] .rribbon { background: #D77A9E; }
.reader[data-chrome="shown"] .rribbon { opacity: 0; }
.rspine { display: none; position: absolute; top: var(--pt); bottom: var(--pb); left: 50%; width: 1px; background: linear-gradient(transparent, var(--prule) 12%, var(--prule) 88%, transparent); pointer-events: none; }
.reader[data-spread="1"] .rspine { display: block; left: calc(var(--pagel) + var(--colw) + var(--gap) / 2); }
/* Desktop: hover arrows in the margins while the pointer moves near an edge (fade 2 s after it stops) */
.rhover { display: none; position: absolute; top: 50%; margin-top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 0; padding: 0; align-items: center; justify-content: center; color: var(--pmuted);
  background: color-mix(in srgb, var(--paper) 70%, var(--ink) 5%); box-shadow: 0 0 0 1px var(--pline2); opacity: 0; transition: opacity 400ms var(--ease); pointer-events: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
  .reader[data-mode="pages"] .rhover { display: inline-flex; }
  .rhover.l { left: max(16px, calc(var(--pagel) / 2 - 26px)); } .rhover.r { right: max(16px, calc(var(--pagel) / 2 - 26px)); }
  .reader.hovering .rhover { opacity: .55; pointer-events: auto; }
  .reader.hovering .rhover:hover { opacity: 1; }
  .reader[data-inset="1"] .rhover.r { right: calc(var(--rinset, 0px) + max(16px, calc(var(--pagel) / 2 - 26px))); }
}
/* A panel beside the page (Text and page, the Notebook on wide screens) took room on the right (ctx.inset): the page
   lays out in what is left, and the running head and status line center over it */
.reader[data-inset="1"] .rhead { right: calc(64px + var(--rinset, 0px)); }
.reader[data-inset="1"] .rstatus { right: var(--rinset, 0px); }
.reader[data-inset="1"][data-mode="scroll"] .rpage { margin-left: var(--pagel); margin-right: 0; }
/* A panel docked under the page (phones, tablets): the page sits above it in whole lines; the status band is under it */
.reader[data-insetb="1"] .rstatus, .reader[data-insetb="1"] .rarrow { visibility: hidden; }
.reader[data-insetb="1"][data-mode="scroll"] .rpage { padding-bottom: calc(var(--rinsetb, 0px) + 24px); }

/* ---- The menu cards (hidden by default; the page never moves) ---- */
.rchrome { position: absolute; z-index: 10; background: var(--pchrome); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); box-shadow: var(--float, 0 10px 30px rgb(0 0 0 / .18), 0 2px 6px rgb(0 0 0 / .10)); color: var(--ink);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease); font-size: calc(1rem * var(--cscale)); }
.reader[data-paper="night"] .rchrome, .reader[data-paper="dusk"] .rchrome { box-shadow: 0 0 0 1px var(--pline2), 0 24px 44px -18px rgb(0 0 0 / .7); }
.reader[data-chrome="hidden"] .rchrome { opacity: 0; pointer-events: none; transition-duration: 160ms; }
.reader[data-chrome="hidden"] .rtop { transform: translateY(-8px); }
.reader[data-chrome="hidden"] .rbot { transform: translateY(12px); }
.reader[data-chrome="shown"] .rbot .rtools { animation: toolsIn 200ms var(--ease) 40ms both; }
@keyframes toolsIn { from { opacity: 0; transform: translateY(6px); } }
.rchrome .iconbtn { color: var(--ink); background: transparent; box-shadow: none; width: 44px; height: 44px; flex-shrink: 0; }
.rchrome .iconbtn.small { width: 44px; height: 44px; color: var(--pmuted); }
.rchrome .iconbtn.small .icon { width: 18px; height: 18px; }
.rchrome .iconbtn:disabled { opacity: .35; }
.rchrome button:focus-visible, .rchrome a:focus-visible, .rchrome [role=slider]:focus-visible, .rpill:focus-visible, .rmenu button:focus-visible, .rarrow:focus-visible, .rcoach button:focus-visible, .endpart button:focus-visible, .endpart a:focus-visible {
  outline: 2px solid var(--link, #1F6F78); outline-offset: 3px; }
.reader[data-paper="night"] .rchrome :focus-visible, .reader[data-paper="dusk"] .rchrome :focus-visible { outline-color: #7CC6CE; }
/* The top card (phones and tablets) */
.rtop { top: calc(8px + var(--safe-top)); left: 8px; right: 8px; height: 56px; border-radius: 22px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px; padding: 0 6px; }
.rgroup { display: flex; align-items: center; gap: 2px; min-width: 0; }
.rtitle { min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.2; padding: 0 4px; }
.rtitle b { font-family: var(--serif); font-weight: 400; font-size: calc(16px * var(--cscale)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rtitle small { font-family: var(--sans); font-size: calc(12px * var(--cscale)); color: var(--pmuted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rtop .rme { width: 44px; height: 44px; }
.rtop .rme .avatar { width: 30px; height: 30px; font-size: 14px; box-shadow: 0 0 0 2px var(--paper); }
.rtop .rmark.on { color: var(--berry, #B4527A); }
.reader[data-paper="night"] .rtop .rmark.on, .reader[data-paper="dusk"] .rtop .rmark.on { color: #E58AAE; }
.rtop .tl { display: none; }
/* The bottom card: scrubber, place line, tool row */
.rbot { bottom: calc(8px + var(--safe-bottom)); left: 8px; right: 8px; border-radius: 26px; padding: 12px 8px 6px; }
.scrubrow { display: flex; align-items: center; gap: 2px; }
.track { position: relative; flex: 1; height: 44px; cursor: pointer; touch-action: none; border-radius: 12px; }
.track .rail { position: absolute; left: 0; right: 0; top: 21px; height: 3px; border-radius: 3px; background: var(--prule); }
.track .fill { position: absolute; left: 0; top: 21px; height: 3px; border-radius: 3px; background: var(--accent, #F2B544); width: 0; }
.track .ticks .tick { position: absolute; top: 17px; width: 2px; height: 11px; margin-left: -1px; border-radius: 1px; background: color-mix(in srgb, var(--pmuted) 45%, transparent); }
.track .mks .mk { position: absolute; top: 6px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; box-shadow: 0 0 0 1px var(--paper); background: rgb(var(--hl-y, 242 181 68)); }
.track .mk.c-g { background: rgb(var(--hl-g, 120 170 110)); } .track .mk.c-b { background: rgb(var(--hl-b, 104 152 214)); } .track .mk.c-p { background: rgb(var(--hl-p, 222 122 152)); } .track .mk.c-u { background: var(--ink); }
.track .mks .mk.bm { width: 8px; height: 11px; margin-left: -4px; border-radius: 1px; top: 4px; background: var(--berry, #B4527A); box-shadow: none; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); }
.track .knob { position: absolute; top: 12px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: #FFFDF8; box-shadow: 0 0 0 1px rgb(0 0 0 / .08), 0 2px 0 rgb(0 0 0 / .08), 0 6px 12px -4px rgb(0 0 0 / .35); }
.reader[data-paper="night"] .track .knob, .reader[data-paper="dusk"] .track .knob { background: var(--pcard); box-shadow: 0 0 0 1.5px var(--pmuted), 0 6px 12px -4px rgb(0 0 0 / .6); }
.track .bubble { position: absolute; bottom: 44px; transform: translateX(-50%); white-space: nowrap; padding: 6px 12px; border-radius: 12px; background: var(--bar-ink, #1B232C); color: var(--bar-text, #F4F1EA);
  font-family: var(--sans); font-size: calc(13px * var(--cscale)); font-weight: 700; opacity: 0; pointer-events: none; transition: opacity 120ms; }
.track.seeking .bubble { opacity: 1; }
.where { display: flex; justify-content: space-between; gap: 12px; font-family: var(--sans); font-size: calc(13px * var(--cscale)); color: var(--pmuted); padding: 0 14px 2px; font-variant-numeric: tabular-nums; }
.where b { color: var(--ink); font-weight: 700; white-space: nowrap; }
.where span { text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtools { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-top: 6px; border-top: 1px solid var(--pline2); padding-top: 4px; }
.rtool { position: relative; border: 0; background: none; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; min-width: 44px;
  font-family: var(--sans); font-size: calc(13px * var(--cscale)); font-weight: 700; border-radius: 16px; padding: 0 2px; }
.rtool .tlab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rtool .icon { width: 22px; height: 22px; }
.rtool .aa { font-family: var(--serif); font-size: 21px; line-height: 22px; height: 22px; font-weight: 400; }
.rtool[aria-expanded="true"], .rtool.on { background: color-mix(in srgb, var(--ink) 8%, transparent); }
@media (max-width: 319px) { .rtools .tlab { display: none; } .rtool { min-height: 48px; } .where { padding: 0 6px 2px; } }
/* Soft paper fades under the cards, so lines behind them read as under the glass */
.rfade { position: absolute; left: 0; right: 0; height: 90px; pointer-events: none; z-index: 9; opacity: 0; transition: opacity 200ms var(--ease); }
.rfade.t { top: 0; background: linear-gradient(var(--paper), transparent); }
.rfade.b { bottom: 0; background: linear-gradient(transparent, var(--paper)); }
.reader[data-chrome="shown"] .rfade { opacity: .7; }
/* Foldables and small tablets: the same cards, narrower and centered */
@media (min-width: 600px) and (max-width: 1023px) {
  .rtop { left: 50%; right: auto; width: min(760px, calc(100vw - 32px)); transform: translateX(-50%); top: calc(12px + var(--safe-top)); }
  .rbot { left: 50%; right: auto; width: min(560px, calc(100vw - 32px)); transform: translateX(-50%); bottom: calc(12px + var(--safe-bottom)); }
  .reader[data-chrome="hidden"] .rtop { transform: translate(-50%, -8px); }
  .reader[data-chrome="hidden"] .rbot { transform: translate(-50%, 12px); }
}
/* Wide screens: one top bar holds every tool; the bottom card keeps the scrubber and the place line (design 3.2) */
@media (min-width: 1024px) {
  .rtop { left: 50%; right: auto; width: min(1240px, calc(100vw - 48px)); transform: translateX(-50%); top: calc(14px + var(--safe-top)); height: 60px; border-radius: 20px; padding: 0 10px; gap: 8px; }
  .reader[data-chrome="hidden"] .rtop { transform: translate(-50%, -8px); }
  .rtop .tl { display: inline-flex; flex-direction: row; gap: 8px; min-height: 44px; height: 44px; padding: 0 12px; border-radius: 12px; font-size: calc(14px * var(--cscale)); }
  .rtop .tl .icon { width: 20px; height: 20px; }
  .rtop .tl .aa { font-size: 19px; height: auto; line-height: 1; }
  .rbot { left: 50%; right: auto; width: min(760px, calc(100vw - 48px)); transform: translateX(-50%); bottom: calc(14px + var(--safe-bottom)); padding: 8px 10px; border-radius: 20px; }
  .reader[data-chrome="hidden"] .rbot { transform: translate(-50%, 12px); }
  .rbot .rtools { display: none; }
}
/* Large tablets in portrait (1024 to 1279): icons only in the top bar, with names for screen readers and as tooltips */
@media (min-width: 1024px) and (max-width: 1279px) { .rtop .tl .tlab { display: none; } .rtop .tl { padding: 0 10px; } }

/* More menu: a small card of rows */
.rmenu { position: absolute; z-index: 30; background: var(--pcard); color: var(--ink); border-radius: 18px; padding: 6px; box-shadow: var(--float, 0 10px 30px rgb(0 0 0 / .18)), 0 0 0 1px var(--pline2);
  display: flex; flex-direction: column; max-height: calc(100dvh - 120px); overflow-y: auto; animation: menuIn 160ms var(--ease) both; }
@keyframes menuIn { from { opacity: 0; transform: translateY(6px); } }
.rmi { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border: 0; background: none; color: inherit; border-radius: 12px; text-align: left; font-family: var(--sans); font-size: calc(15px * var(--cscale)); }
.rmi:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.rmi .icon { width: 20px; height: 20px; color: var(--pmuted); flex-shrink: 0; }

/* Back to page N: an ink pill in the status band under the page (the status line steps aside), for 10 seconds after a
   jump. It never sits on the book's text (RDR-QAR-06, FE-07). 38 px to the eye, 44 px to the finger. */
.rpill { position: absolute; z-index: 12; left: 50%; bottom: calc(var(--safe-bottom, 0px) + max(0px, (var(--pb) - var(--safe-bottom, 0px) - 38px) / 2)); transform: translate(-50%, 6px); min-height: 38px; padding: 0 18px; border-radius: 19px; border: 0;
  background: var(--bar-ink, #1B232C); color: var(--bar-text, #F4F1EA); font-family: var(--sans); font-weight: 700; font-size: calc(14px * var(--cscale)); box-shadow: 0 14px 30px -12px rgb(0 0 0 / .5); opacity: 0; transition: opacity 200ms var(--ease), transform 200ms var(--ease); white-space: nowrap; }
.rpill.in { opacity: 1; transform: translate(-50%, 0); }
.rpill[hidden] { display: none; }
.rpill::before { content: ""; position: absolute; inset: -3px 0; }
.reader[data-pill="1"] .rstatus .rstext { visibility: hidden; }
.reader[data-mode="scroll"] .rpill { bottom: calc(16px + var(--safe-bottom, 0px)); }
.reader[data-chrome="shown"] .rpill { bottom: calc(var(--pb) + 150px); }
@media (min-width: 1024px) { .reader[data-chrome="shown"] .rpill { bottom: calc(var(--pb) + 96px); } }

/* ---- The Part's end (build plan 6.4) ---- */
.prose .endpart { break-before: column; text-indent: 0; font-family: var(--sans); text-align: left; letter-spacing: normal; word-spacing: normal; font-weight: 400; hyphens: manual; }
.reader[data-mode="pages"] .prose .endpart { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; touch-action: pan-y pinch-zoom; }
.reader[data-mode="scroll"] .prose .endpart { margin-top: 3em; padding-top: 2em; border-top: 1px solid var(--prule); min-height: 50vh; }
.epinner { min-height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 8px 0 12px; box-sizing: border-box; }
.epkick { margin: 0; font-size: max(12px, .63em); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--pmuted); text-align: center; }
.eptitle { margin: 0 !important; font-family: var(--rfont) !important; font-size: 1.5em !important; line-height: 1.2 !important; font-weight: 400; text-align: center; color: var(--ink); }
.eprule { display: block; width: 36px; height: 2px; margin: 4px auto 6px; border-radius: 2px; background: var(--accent, #F2B544); }
.eprows { display: flex; flex-direction: column; gap: 18px; }
.eprow { display: flex; flex-direction: column; gap: 8px; }
.ephead { margin: 0; font-size: max(15px, .8em); font-weight: 700; color: var(--ink); }
.ephead:empty { display: none; }
.epchips { display: flex; flex-wrap: wrap; gap: 8px; }
.epchip { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 0; background: var(--pcard); color: var(--ink); font-family: var(--rfont); font-size: max(16px, .85em); box-shadow: 0 0 0 1px var(--pline2), 0 2px 0 var(--pline2); }
.epchipk { display: inline-flex; align-items: center; gap: 2px; }
.epsay { width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; color: var(--pmuted); display: inline-flex; align-items: center; justify-content: center; }
.endpart.kid .epchip { min-height: 52px; font-size: max(20px, 1em); padding: 0 18px; }
.eplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.epline { display: flex; align-items: baseline; gap: 10px; width: 100%; min-height: 44px; padding: 8px 4px; border: 0; background: none; color: var(--ink); text-align: left; font-family: var(--rfont); font-size: max(15px, .82em); line-height: 1.4; border-radius: 10px; }
.epdot { flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; background: rgb(var(--hl-y, 242 181 68)); transform: translateY(-1px); }
.epdot.c-g { background: rgb(var(--hl-g, 120 170 110)); } .epdot.c-b { background: rgb(var(--hl-b, 104 152 214)); } .epdot.c-p { background: rgb(var(--hl-p, 222 122 152)); } .epdot.c-u { background: var(--ink); }
.eptime .ephead { font-weight: 400; color: var(--pmuted); }
.epnote { width: 100%; min-height: 84px; border-radius: 14px; border: 0; padding: 12px 14px; background: var(--pcard); color: var(--ink); font: inherit; font-size: 16px; box-shadow: inset 0 0 0 1.5px var(--pline2); resize: vertical; }
.epacts { display: flex; flex-wrap: wrap; gap: 8px; }
.epnext { margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; width: 100%; min-height: 72px; padding: 12px 18px; border: 0; border-radius: 20px;
  background: var(--pcard); color: var(--ink); text-align: left; text-decoration: none; box-shadow: 0 0 0 1px var(--pline2), 0 3px 0 var(--pline2); font-family: var(--sans); }
.epnext .epread { grid-column: 1; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pmuted); }
.epnext .epnk { grid-column: 1; font-size: max(13px, .7em); font-weight: 700; color: var(--pmuted); }
.epnext .epnt { grid-column: 1; font-family: var(--rfont); font-size: max(19px, 1.05em); line-height: 1.2; }
.epnext .icon { grid-column: 2; grid-row: 1 / span 3; color: var(--pmuted); }
.epnext.btn { display: flex; justify-content: center; min-height: 56px; text-align: center; }

/* ---- First-run coach (design 3.5) ---- */
.rcoach { position: absolute; z-index: 40; left: 12px; right: 12px; bottom: calc(16px + var(--safe-bottom)); max-width: 440px; margin: 0 auto; background: var(--bar-ink, #1B232C); color: var(--bar-text, #F4F1EA);
  border-radius: 24px; padding: 18px 18px 14px; box-shadow: 0 30px 60px -20px rgb(0 0 0 / .6); font-family: var(--sans); display: flex; flex-direction: column; gap: 8px; animation: coachIn 260ms var(--ease) both; max-height: calc(100dvh - 32px); overflow-y: auto; }
@keyframes coachIn { from { opacity: 0; transform: translateY(14px); } }
.rcstep { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bar-muted, #AEB6BF); }
.rct { margin: 0; font-family: var(--serif); font-weight: 400; font-size: calc(21px * var(--cscale)); line-height: 1.25; outline: none; }
.rcs { margin: 0; font-size: calc(15px * var(--cscale)); line-height: 1.45; color: var(--bar-muted, #AEB6BF); }
.rcx { color: var(--bar-text, #F4F1EA); }
.rcbtns { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.rcdots { display: inline-flex; gap: 6px; margin-right: auto; }
.rcdots i { width: 7px; height: 7px; border-radius: 50%; background: rgb(255 255 255 / .28); }
.rcdots i.on { background: var(--accent, #F2B544); }
.rcskip, .rcnext { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 0; font-weight: 700; font-size: 15px; }
.rcskip { background: none; color: var(--bar-text, #F4F1EA); }
.rcnext { background: var(--accent, #F2B544); color: #18212B; }
.rcchoice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 359px) { .rcchoice { grid-template-columns: 1fr; } }
.rcopt { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px; min-height: 44px; border-radius: 16px; border: 0; background: rgb(255 255 255 / .08); color: inherit; box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .16); }
.rcopt b { font-size: 15px; }
.rcopt span { font-size: 13px; line-height: 1.4; color: var(--bar-muted, #AEB6BF); }
.rcopt.on { box-shadow: inset 0 0 0 2px var(--accent, #F2B544); }
.rcring { position: absolute; z-index: 39; border-radius: 10px; box-shadow: 0 0 0 2px var(--sel-edge, #1F6F78); pointer-events: none; animation: ringPulse 1.8s ease-in-out infinite; }
.rcring.still { animation: none; }
.rcring[hidden] { display: none; }
@keyframes ringPulse { 0%, 100% { box-shadow: 0 0 0 2px var(--sel-edge, #1F6F78), 0 0 0 0 rgb(31 111 120 / .35); } 50% { box-shadow: 0 0 0 2px var(--sel-edge, #1F6F78), 0 0 0 10px rgb(31 111 120 / 0); } }

/* Cover to page: a short fade where view transitions are missing; nothing under reduced motion */
.reader.fadein { animation: rfadein 160ms ease-out both; }
@keyframes rfadein { from { opacity: 0; } }
::view-transition-group(book-cover) { animation-duration: 320ms; animation-timing-function: var(--ease, ease); }

/* Reduced motion and Calmer motion: every chrome movement becomes a 120 ms fade, turns are instant */
@media (prefers-reduced-motion: reduce) {
  .rchrome, .reader[data-chrome="hidden"] .rchrome { transition: opacity 120ms linear !important; transform: none !important; }
  @media (min-width: 600px) { .rtop, .rbot, .reader[data-chrome="hidden"] .rtop, .reader[data-chrome="hidden"] .rbot { transform: translateX(-50%) !important; } }
  .reader[data-chrome="shown"] .rbot .rtools, .rmenu, .rcoach, .reader.fadein, .rribbon.drop, .rcring, .prose .rpulse { animation: none !important; }
  .rpill { transition: opacity 120ms linear; transform: translateX(-50%) !important; }
  .rfade { transition: opacity 120ms linear; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
html.calm .rchrome, html.calm .reader[data-chrome="hidden"] .rchrome { transition: opacity 120ms linear !important; }
html.calm .reader[data-chrome="hidden"] .rtop, html.calm .reader[data-chrome="hidden"] .rbot { transform: none; }
@media (min-width: 600px) { html.calm .rtop, html.calm .rbot, html.calm .reader[data-chrome="hidden"] .rtop, html.calm .reader[data-chrome="hidden"] .rbot { transform: translateX(-50%); } }
html.calm .reader[data-chrome="shown"] .rbot .rtools, html.calm .rmenu, html.calm .rcoach, html.calm .reader.fadein, html.calm .rribbon.drop, html.calm .rcring, html.calm .prose .rpulse { animation: none !important; }
html.calm .rpill { transition: opacity 120ms linear; transform: translateX(-50%); }

/* ---- Sheets while reading: no blur over the page, a light tint, and the colors of the paper ---- */
html.reading .scrim { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(10, 14, 20, .14); }
html[data-rpaper="paper"] .sheet { --bg: #FBF8F1; --card: #FFFDF8; }
html[data-rpaper="sepia"] .sheet { --bg: #F4E8D2; --card: #F8EEDC; --ink: #3B2F22; --muted: #6A5B47; --line: #E0CFAE; --soft: #EADBBE; --lip: #D6C29C; }
html[data-rpaper="dusk"] .sheet { --bg: #2A3036; --card: #353C43; }
html[data-rpaper="night"] .sheet { --bg: #1A2129; }
@media (min-width: 720px) { .sheet.tapsheet { width: min(400px, 44vw); } }
@media (max-width: 719px) { .sheet.tapsheet { max-height: 62dvh; } }

/* The word sheet (the fallback meaning card until PB-U2's card replaces it) */
.tapsheet .wsay { align-items: center; gap: var(--s2); }
.tapsheet .say { background: var(--soft); color: var(--ink); }
.tapsheet .say.slow { font-size: var(--t-s); font-weight: 700; padding: 0 var(--s4); }
.tapsheet .wacts { margin-top: calc(-1 * var(--s2)); }
.wgroup { display: flex; flex-direction: column; gap: 4px; }
.wpos { font-style: italic; color: var(--muted); }
.wdefs { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.wdefs li::marker { color: var(--accent-lip); font-weight: 700; }
.wnote { margin: 0; color: var(--muted); }
.wnote strong { color: var(--ink); font-family: var(--serif); font-weight: 600; }
.wsimple, .walso { display: flex; flex-direction: column; gap: 4px; }
.wsimple .kicker, .walso .kicker, .wmore .kicker { margin: 0; }
.wdef1 { margin: 0; font-size: var(--t-m); line-height: 1.5; }
.wmore { display: flex; flex-direction: column; gap: var(--s3); }
.wmore > summary { min-height: var(--tap); display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; font-weight: 700; color: var(--link); list-style: none; }
.wmore > summary::-webkit-details-marker { display: none; }
.wmore > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform var(--d2) var(--ease); }
.wmore[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.wmore > *:not(summary) { margin-top: var(--s2); }
.reader.failed { position: relative; inset: auto; min-height: 100dvh; display: flex; align-items: center; justify-content: center; }

/* ---- Reader-only additions to the shared app.css (kept here so app.css stays the same in the three apps) ---- */
/* A second, quieter toast button ("Add a note" before Undo) */
.toast button.quiet { background: none; color: var(--bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bg) 45%, transparent); }
/* In the book: low over the page while the menu cards are hidden, above the scrubber card while they show */
.app[data-route="read"] ~ #layer .toast { bottom: calc(20px + var(--safe-bottom)); }
html:has(.reader[data-chrome="shown"]) #layer .toast { bottom: calc(var(--rbot-h, 184px) + 12px); }
/* A control reached with Tab scrolls clear of the floating tab bar, never under it (APD-06, WCAG 2.4.11) */
@media (max-width: 899px) { html:has(.app.has-nav) { scroll-padding-bottom: calc(100px + var(--safe-bottom)); } }
/* A big book opened from its part: turning into a part whose text is still on its way */
.reader[data-waiting="1"]::after { content: "Opening the rest of the book…"; position: absolute; z-index: 13; left: 50%; bottom: calc(var(--safe-bottom, 0px) + 6px); transform: translateX(-50%);
  padding: 8px 16px; border-radius: 18px; background: var(--bar-ink, #1B232C); color: var(--bar-text, #F4F1EA); font-family: var(--sans); font-weight: 700; font-size: 14px; white-space: nowrap; }
