/* Reader: the app's Read side, on any screen. */

html.panel-open, html.passage-open { overflow: hidden; }
.r-shell { max-width: 1120px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 10px) 16px calc(150px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .r-shell { padding-left: 32px; padding-right: 32px; } }

/* ---------- Header (HomeHeader) ---------- */
.r-header { display: flex; align-items: center; gap: 12px; padding: 6px 0 0; }
.r-brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.r-brand .logo-mark { --s: 37px; }
.r-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.r-title { font: 700 29px/1.05 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-page { font-size: 11px; letter-spacing: 1.8px; }
.r-actions { display: flex; gap: 10px; flex: none; }
.r-view { outline: none; display: flex; flex-direction: column; gap: 28px; padding-top: 28px; }
.r-view.enter { animation: view-in .45s var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 380px) { .r-title { font-size: 25px; } }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.section-head h2 { margin: 0; font: 700 22px/1.2 var(--serif); }
.section-head span { font: 500 13px/1 var(--sans); color: var(--ink-2); }

/* staggered appear (StaggeredAppear) */
.stagger { animation: stagger-in .38s var(--ease-out) backwards; animation-delay: min(calc(var(--i, 0) * 20ms), 100ms); }
@keyframes stagger-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Continue reading card ---------- */
.continue {
  position: relative; display: flex; align-items: flex-end; gap: 16px; height: 190px; padding: 18px; border-radius: 28px; overflow: hidden; isolation: isolate;
  color: var(--art-ink); text-align: left; width: 100%;
  box-shadow: inset 0 0 0 .75px var(--stroke), 0 8px 18px var(--shadow);
}
.continue .blur { position: absolute; inset: -40%; z-index: -2; background-size: cover; background-position: center; filter: blur(30px); transform: scale(1.1); }
.continue::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .7)); }
:root[data-theme="light"] .continue::after { background: linear-gradient(rgba(255, 255, 255, .2), rgba(255, 255, 255, .75)); }
.continue .tb-cover { box-shadow: 0 6px 12px rgba(0, 0, 0, .35); flex: none; }
.continue .ctext { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.continue .label { font: 700 11px/1 var(--sans); letter-spacing: 1.6px; text-transform: uppercase; opacity: .75; }
.continue .ctitle { font: 700 26px/1.1 var(--serif); }
.continue .cverse { font: 400 14.5px/1.35 var(--serif); opacity: .8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 900px) { .continue { height: 220px; padding: 24px; } .continue .ctitle { font-size: 32px; } .continue .cverse { font-size: 16px; max-width: 640px; } }

/* ---------- Shelves ---------- */
.shelf { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 16px; padding: 4px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
@media (min-width: 700px) { .shelf { padding-left: 32px; padding-right: 32px; margin: 0 -32px; scroll-padding-inline: 32px; } }
.shelf a { flex: none; width: 150px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; }
.shelf .tb-cover { box-shadow: 0 6px 10px rgba(0, 0, 0, .25); transition: transform .45s var(--spring); }
.shelf a:hover .tb-cover { transform: translateY(-4px); }
.shelf .cap { font: 500 13.5px/1.25 var(--sans); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Row card (Reading plans / Preface style) ---------- */
.row-card { display: flex; align-items: center; gap: 14px; padding: 16px; width: 100%; text-align: left; }
.row-card .glyph-badge { width: 44px; height: 44px; border-radius: 13px; }
.row-card .t { flex: 1; min-width: 0; }
.row-card .t strong { display: block; font: 700 20px/1.2 var(--serif); }
.row-card .t span { display: block; font: 400 14px/1.35 var(--sans); color: var(--ink-2); margin-top: 2px; }
.row-card > .glyph:last-child { color: var(--ink-3); }

/* ---------- Book grid ---------- */
.grid-books { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (min-width: 560px) { .grid-books { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); } }
.tile {
  min-height: 58px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: var(--surface); box-shadow: inset 0 0 0 .75px var(--stroke), 0 2px 5px var(--shadow); padding: 4px;
}
.tile .ab { font: 700 16px/1.1 var(--serif); white-space: nowrap; }
.tile .n { font: 600 10.5px/1 var(--sans); color: var(--ink-3); }
.tile.active { background: var(--ink); color: var(--bg); }
.tile.active .n { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.tile:hover { box-shadow: inset 0 0 0 .75px var(--stroke), 0 6px 14px var(--shadow); }

/* ---------- Chapter / verse number grid (panel) ---------- */
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 10px; padding-bottom: 6px; }
.num-grid button {
  height: 54px; border-radius: 16px; background: var(--raised); font: 400 19px/1 var(--serif);
}
.num-grid button.on { background: var(--ink); color: var(--bg); }
.num-grid button:hover { filter: brightness(1.08); }
:root[data-theme="light"] .num-grid button:hover { filter: brightness(.97); }
.verse-grid button { height: 46px; font-size: 16px; border-radius: 14px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40; translate: -50% 0;
  display: flex; gap: 2px; padding: 5px; border-radius: 999px; background: var(--surface);
  box-shadow: inset 0 0 0 .75px var(--stroke), 0 8px 18px var(--shadow);
  transition: transform .45s var(--ease-out), opacity .3s ease;
}
html.panel-open .tabbar, html.passage-open .tabbar { transform: translateY(150px); opacity: 0; pointer-events: none; }
.tabbar a {
  height: 52px; min-width: 60px; padding: 0 18px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--ink-2); font: 600 17px/1 var(--sans); transition: background .3s ease, color .3s ease;
}
.tabbar a.on { background: var(--ink); color: var(--bg); padding: 0 26px; }
:root[data-theme="light"] .tabbar a.on { color: #fff; }
.tabbar a .lbl { display: none; }
.tabbar a.on .lbl { display: inline; }

/* ---------- The chapter screen ---------- */
.passage {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; color: var(--ink); background: var(--bg);
  transform: translateY(100%); transition: transform .5s var(--ease-out); overflow: hidden; isolation: isolate;
}
.passage.open { transform: none; }
.p-bg { position: absolute; inset: 0; z-index: -1; background: var(--bg); overflow: hidden; }
.p-art {
  position: absolute; inset: -30%; background-size: cover; background-position: center;
  filter: blur(70px) saturate(var(--art-sat, 1)); opacity: var(--art-opacity, .85);
  animation: p-drift 24s ease-in-out infinite alternate; transition: opacity .6s ease;
}
.p-art.out { opacity: 0 !important; }
@keyframes p-drift { from { transform: scale(1.35) rotate(0); } to { transform: scale(1.7) rotate(10deg); } }
/* Toward the blue end (dark mode): light blue at the top fading down, as in the app. */
.p-wash { position: absolute; inset: 0; opacity: var(--wash, 0);
  background: linear-gradient(rgba(110, 186, 245, .5), rgba(36, 112, 189, .3), rgba(10, 41, 77, .2)); }
:root[data-theme="light"] .p-wash { background: rgb(140, 184, 235); }
.p-shade { position: absolute; inset: 0; opacity: var(--shade, 1); background: linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .55), rgba(0, 0, 0, .85)); }
:root[data-theme="light"] .p-shade { background: linear-gradient(rgba(255, 255, 255, .35), rgba(255, 255, 255, .6), rgba(255, 255, 255, .85)); }

.p-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 10px) 16px 6px; flex: none; position: relative; z-index: 3; }
.p-bar .left { justify-self: start; display: flex; gap: 10px; }
.p-bar .right { justify-self: end; display: flex; gap: 10px; }
.p-title { display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px; border-radius: 999px; font: 700 21px/1 var(--serif); white-space: nowrap; max-width: 52vw; }
.p-title span { overflow: hidden; text-overflow: ellipsis; }
.p-title:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
@media (min-width: 900px) { .p-bar { padding-left: 28px; padding-right: 28px; } .p-title { font-size: 23px; } }

.p-reader { position: relative; flex: 1; min-height: 0; touch-action: pan-y pinch-zoom; }
/* On phones a verse is chosen by tapping it, as in the app (Copy is in the bar that appears), so a
   long press doesn't start the browser's own text selection and its menu. */
@media (pointer: coarse) { .p-reader { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }
.p-viewport { position: absolute; overflow: hidden; touch-action: pan-y pinch-zoom; }
.p-flow { position: absolute; top: 0; left: 0; will-change: transform; }
.p-flow.turning { transition: transform .5s var(--ease-out); }
.p-flow.swap { transition: opacity .18s ease, transform .18s ease; }
.p-flow .end { display: block; height: 1px; }
@media (pointer: coarse) { .p-reader { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }
.p-spine {
  position: absolute; top: 4%; bottom: 4%; width: 60px; translate: -50% 0; pointer-events: none; opacity: .9;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 4%, transparent) 46%, color-mix(in srgb, var(--ink) 9%, transparent) 50%, color-mix(in srgb, var(--ink) 4%, transparent) 54%, transparent);
}
.p-count { position: absolute; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); text-align: center; font: italic 12px/1 var(--serif); color: var(--ink-2); pointer-events: none; transition: opacity .3s ease; }
.p-side {
  position: absolute; top: 50%; z-index: 2; translate: 0 -50%; opacity: 0; transition: opacity .3s ease;
  --s: 46px;
}
.p-reader:hover .p-side { opacity: .9; }
.p-side.prev { left: 18px; }
.p-side.next { right: 18px; }
.p-side[disabled] { visibility: hidden; }
@media (pointer: coarse), (max-width: 699px) { .p-side { display: none; } }

/* scroll layout (ContinuousReader) */
.p-scrollbox { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(transparent, #000 3%, #000 92%, transparent); mask-image: linear-gradient(transparent, #000 3%, #000 92%, transparent); }
.p-scroll { max-width: 700px; margin: 0 auto; padding: 18px 26px 40vh; text-align: left; }
.p-scroll .ch + .ch { margin-top: calc(var(--fs) * 1.6); }
.p-scroll .opener { padding-top: calc(var(--fs) * 1.2); }
.p-scroll .end-note { text-align: center; font: italic 17px/1.4 var(--serif); color: var(--ink-2); padding: 40px 0; }
.sentinel { height: 1px; }

/* selection bar */
.p-select {
  position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 5; translate: -50% 0;
  width: min(440px, calc(100% - 32px)); padding: 12px 10px 10px; border-radius: 26px; background: var(--surface);
  box-shadow: inset 0 0 0 .75px var(--stroke), 0 12px 30px var(--shadow);
  transform: translateY(160%); opacity: 0; transition: transform .45s var(--spring), opacity .25s ease; pointer-events: none;
}
.p-select.show { transform: none; opacity: 1; pointer-events: auto; }
.p-select .sel-title { text-align: center; font: 600 14px/1.2 var(--sans); color: var(--ink-2); margin-bottom: 8px; }
.p-select .acts { display: flex; justify-content: space-around; gap: 2px; }
.p-select .acts button { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 1 76px; min-width: 0; padding: 6px 4px; border-radius: 14px; font: 500 13px/1 var(--sans); }
.p-select .acts button:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.p-select .acts button[hidden] { display: none; }

/* ---------- Linked passages (the app's LinksPanel) ---------- */
.links-panel { display: flex; flex-direction: column; gap: 14px; }
.links-intro { margin: 0; font: 500 13.5px/1.45 var(--sans); color: var(--ink-2); }
.links-words { display: flex; gap: 10px; align-items: baseline; font: 600 17px/1.4 var(--scripture); color: var(--ink); }
.links-letter { flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 50%;
  font: 600 13px/1 var(--scripture); color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.links-heading { margin-top: 6px; font: 700 11px/1 var(--sans); letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-2); }
.links-card { padding: 16px; border-radius: 22px; display: flex; flex-direction: column; gap: 10px; }
.links-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.links-ref { font: 700 11px/1.2 var(--sans); letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); }
.links-text { --fs: 17px; text-align: left; }
.links-text .v { margin: 0 0 6px; }
.links-read { width: 100%; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.passage.selecting .p-count { opacity: 0; }

/* ---------- Word study (the app's VerseStudyView) ---------- */
@media (min-width: 760px) { .sheet.study-sheet { width: min(620px, calc(100vw - 48px)); max-height: min(86vh, 900px); } }
.ws-head { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.ws-head .glyph-badge { width: 40px; height: 40px; border-radius: 12px; }
.ws-titles { min-width: 0; flex: 1; }
.ws-titles .eyebrow { font-size: 11px; }
.sheet .ws-head h2 { margin-top: 2px; font-size: 24px; }
.ws { display: flex; flex-direction: column; gap: 16px; }
.ws-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.ws-label { font: 700 11px/1.2 var(--sans); letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-2); }
.ws-label.accent { color: var(--accent); }
.ws-hint { margin: 0; font: 500 13px/1.4 var(--sans); color: var(--ink-2); }

/* The English verse: every word a button, linked words dotted, the chosen one in a blue lozenge. */
.ws-verse { margin: 0; font: 400 20px/1.7 var(--scripture); color: var(--ink); text-align: left; overflow-wrap: break-word; }
.ws-chunk { white-space: nowrap; }
.ws-w { position: relative; z-index: 0; display: inline-block; line-height: 1.3; color: inherit; border-radius: 6px; }
.ws-w::before { content: ""; position: absolute; inset: -1px -3px; z-index: -1; border-radius: 7px; background: transparent; transition: background-color .2s ease; }
.ws-w.w-blue { color: var(--blue); }
.ws-w.linked { text-decoration: underline dotted color-mix(in srgb, var(--accent) 60%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: .22em; }
.ws-w.from-greek::before { background: rgba(0, 118, 186, .22); }
.ws-w[aria-pressed="true"] { color: #fff; text-decoration-color: transparent; }
.ws-w[aria-pressed="true"]::before { background: var(--blue); }
.ws-w:focus-visible { outline-offset: 2px; border-radius: 4px; }

/* No sure link for the chosen word */
.ws-none { gap: 8px; }
.ws-big { font: 600 22px/1.25 var(--scripture); color: var(--ink); }
.ws-none p { margin: 0; font: 400 14.5px/1.45 var(--sans); color: var(--ink-2); }

/* The Greek verse */
.ws-gbody { display: flex; flex-direction: column; gap: 12px; }
.ws-gbody .loading { padding: 6px 0; }
.ws-ref { margin: 0; font: 400 13px/1.35 var(--sans); color: var(--ink-2); }
.ws-caption { margin: 0; font: 400 13.5px/1.45 var(--sans); color: var(--ink-2); }
.ws-notice { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: var(--raised); font: 400 15px/1.4 var(--sans); color: var(--ink-2); }
.ws-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-g { position: relative; padding: 5px 10px; border-radius: 999px; background: var(--raised); color: var(--ink); font: 400 19px/1.25 var(--greek); transition: background-color .2s ease, color .2s ease, transform .32s var(--spring); }
.ws-g[aria-pressed="true"] { background: var(--blue); color: #fff; box-shadow: none; }
.ws-g:disabled { opacity: .45; cursor: default; box-shadow: none; }

/* One Greek word */
.ws-detail { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 8px; }
.ws-detail:empty { display: none; }
.ws-word { padding: 16px; border-radius: 20px; background: var(--raised); box-shadow: inset 0 0 0 1px rgba(0, 118, 186, .4); display: flex; flex-direction: column; gap: 14px; animation: ws-in .3s var(--ease-out); }
.ws-none { animation: ws-in .3s var(--ease-out); }
@keyframes ws-in { from { opacity: 0; transform: translateY(-6px); } }
.ws-rest { display: flex; flex-direction: column; gap: 14px; }
.ws-rest:empty { display: none; }
.ws-rest > .loading { padding: 0; }
.ws-tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font: 400 14px/1.3 var(--sans); color: var(--ink-2); }
.ws-en { font: 600 20px/1.25 var(--scripture); color: var(--ink); }
.ws-gw { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; margin-top: -4px; }
.ws-greek { font: 400 32px/1.2 var(--greek); color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.ws-strongs { flex: none; padding: 4px 9px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 700 12px/1.1 var(--sans); white-space: nowrap; }
:root[data-theme="light"] .ws-strongs { color: #fff; }
.ws-lemma { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; }
.ws-lg { font: 400 19px/1.3 var(--greek); color: var(--ink); }
.ws-tl { font: italic 400 16px/1.3 var(--scripture); color: var(--ink-2); }
.ws-gl { font: 400 15px/1.3 var(--sans); color: var(--ink-2); }
.ws-small { margin: -10px 0 0; font: 400 11.5px/1.35 var(--sans); color: var(--ink-3); }
.ws-sec { display: flex; flex-direction: column; gap: 6px; }
.ws-title { font: 700 10.5px/1.2 var(--sans); letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); }
.ws-val { margin: 0; font: 400 15px/1.45 var(--sans); color: var(--ink); }
.ws-sense { display: flex; align-items: baseline; gap: 6px; font: 400 15px/1.45 var(--sans); color: var(--ink); }
.ws-sl { flex: none; font: 600 13px/1.45 var(--sans); color: var(--accent); }
.ws-st { min-width: 0; overflow-wrap: anywhere; }
.ws-st strong { font-weight: 650; }
.ws-src { font: 400 11px/1.3 var(--sans); color: var(--ink-3); }
.ws-rends { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ws-rend { display: inline-flex; align-items: baseline; gap: 4px; padding: 5px 10px; border-radius: 999px; background: var(--surface); }
.ws-re { font: 400 15px/1.25 var(--scripture); color: var(--ink); }
.ws-rn { font: 600 12px/1 var(--sans); color: var(--ink-2); }
.ws-occ-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ws-link { font: 600 13px/1 var(--sans); color: var(--accent); padding: 8px 2px; margin: -8px 0; }
.ws-occ { display: flex; flex-direction: column; }
.ws-orow { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 0; text-align: left; box-shadow: inset 0 -.75px 0 var(--stroke); }
.ws-oref { flex: none; font: 500 14.5px/1.3 var(--sans); color: var(--ink); }
.ws-oen { flex: 1; min-width: 0; text-align: right; font: italic 400 15px/1.3 var(--scripture); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-orow .glyph { flex: none; color: var(--ink-3); }
.ws-more { align-self: flex-start; margin: 4px 0 0; }
.ws-credit { margin: 0; padding: 0 4px; font: 400 11px/1.45 var(--sans); color: var(--ink-3); }
.ws-credit a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) {
  .ws-w:hover::before { background: color-mix(in srgb, var(--blue) 12%, transparent); }
  .ws-g:not(:disabled):hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 45%, transparent); }
  .ws-link:hover, .ws-orow:hover .ws-oref { text-decoration: underline; text-underline-offset: 3px; }
}

/* ---------- Panels: reading settings ---------- */
.set-group { display: flex; flex-direction: column; gap: 14px; }
.set-group + .set-group { margin-top: 22px; }
.set-label { font: 700 12px/1 var(--sans); letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink-2); padding-left: 4px; }
.layout-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.layout-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.layout-card .art { width: 100%; aspect-ratio: 1.45; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 .75px var(--stroke); display: grid; place-items: center; transition: box-shadow .25s ease; }
.layout-card[aria-pressed="true"] .art { box-shadow: inset 0 0 0 2.5px var(--ink); }
.layout-card .name { font: 600 17px/1.2 var(--sans); margin-top: 4px; }
.layout-card .desc { font: 400 13px/1.3 var(--sans); color: var(--ink-2); }
.layout-card[aria-pressed="false"] .name { color: var(--ink-2); }
.size-row { display: flex; align-items: center; gap: 12px; }
.size-row .aa { width: 40px; height: 40px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; font-family: var(--serif); flex: none; }
.tint-labels { display: flex; justify-content: space-between; font: 500 13px/1 var(--sans); color: var(--ink-2); padding: 0 2px; }
.tint-labels button { font: inherit; color: inherit; }
.tint-labels button.on { color: var(--accent); }
.set-card { padding: 4px 16px; }
.set-card .switch-row + .switch-row { box-shadow: inset 0 .75px 0 var(--stroke); }

/* ---------- Navigator ---------- */
.nav-search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 .75px var(--stroke); color: var(--ink-2); }
.nav-search input, .search-field input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: 400 17px/1 var(--sans); color: var(--ink); }
.nav-search input::placeholder, .search-field input::placeholder { color: var(--ink-3); }
.suggest { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.suggest button { text-align: left; padding: 12px 16px; border-radius: 16px; background: var(--raised); font: 600 15px/1.3 var(--sans); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.suggest button small { font: 400 13px/1.3 var(--serif); color: var(--ink-2); display: block; margin-top: 3px; }
.nav-pills { margin: 18px 0 6px; }
.group-title { font: 700 12px/1 var(--sans); letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink-2); padding: 18px 4px 10px; }
.book-list { padding: 4px 0; }
.book-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 14px; text-align: left; }
.book-row + .book-row { box-shadow: inset 0 .75px 0 var(--stroke); }
.book-row .tile-art { width: 40px; height: 40px; border-radius: 22%; overflow: hidden; flex: none; box-shadow: inset 0 0 0 .5px var(--stroke); }
.book-row .tile-art img { width: 100%; height: 100%; }
.book-row .nm { flex: 1; font: 400 20px/1.2 var(--serif); }
.book-row .badge { font: 700 12px/1 var(--sans); background: var(--blue); color: #fff; padding: 6px 10px; border-radius: 999px; }
.book-row .cnt { font: 600 14px/1 var(--sans); color: var(--ink-2); min-width: 24px; text-align: right; }
.book-row .glyph { color: var(--ink-3); }
.step-head { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.step-head h2 { flex: 1; }
.step-head .icon-btn { --s: 40px; background: var(--raised); }
.from-start { margin-top: 14px; width: 100%; }

/* ---------- Search ---------- */
.search-field { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 10px 0 18px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 .75px var(--stroke), 0 4px 10px var(--shadow); color: var(--ink-2); }
.search-field .clear { --s: 32px; background: var(--raised); box-shadow: none; }
.search-opts { display: flex; flex-direction: column; gap: 12px; }
.search-opts .pills { max-width: 520px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 16px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 .75px var(--stroke); font: 600 14px/1 var(--sans); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); }
:root[data-theme="light"] .chip.on { color: #fff; }
.chips .spacer { flex: 1; }
.try-chips .chip { font: 400 16px/1 var(--sans); min-height: 46px; padding: 0 18px; }
.hint { font: 400 14px/1.4 var(--sans); color: var(--ink-2); margin: 0; }
.results-head { font: 700 26px/1.2 var(--serif); margin: 0; }
.results { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .results { grid-template-columns: 1fr 1fr; } }
.result { padding: 16px 18px 18px; text-align: left; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.result .eyebrow { font-size: 11px; }
.result .txt { font: 400 17px/1.5 var(--serif); }
.result mark { background: color-mix(in srgb, var(--blue) 26%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.goto-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; width: 100%; text-align: left; }
.goto-card .t { flex: 1; min-width: 0; }
.goto-card .t strong { font: 700 20px/1.2 var(--serif); display: block; }
.goto-card .t span { font: 400 15px/1.4 var(--serif); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.loading { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font: 500 14px/1 var(--sans); padding: 20px 4px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--stroke); border-top-color: var(--ink-2); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.more-btn { justify-self: center; grid-column: 1 / -1; }

/* ---------- Preface ---------- */
.preface { max-width: 760px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 18px; }
.paper { background: var(--page); border-radius: 22px; padding: 34px 22px; box-shadow: inset 0 0 0 .75px var(--stroke), 0 6px 14px var(--shadow); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.pf-body { display: flex; flex-direction: column; gap: 16px; padding: 18px 6px 0; }
.pf { margin: 0; font-family: var(--serif); line-height: 1.6; }
.pf.heading { text-align: center; padding-top: 16px; line-height: 1.25; }
.pf.center { text-align: center; }
.pf.quote { padding-left: 16px; box-shadow: inset 3px 0 0 var(--blue); margin-top: 10px; }
.pf.signature { text-align: right; }
.paper .pf { line-height: 1.3; }

/* ---------- Footer note in the library ---------- */
.r-foot { margin-top: 10px; text-align: center; font: 400 13px/1.5 var(--sans); color: var(--ink-3); }
.r-foot a { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) { .p-art { animation: none; } }
