/* Monochrome workspace with coloured icons. Geist throughout; Geist Mono for structure; Geist Pixel Line, sparingly. */
/* Geist (Vercel, SIL OFL 1.1), self-hosted so nothing is fetched from a font service. */
@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/Geist-Italic-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Pixel Line"; src: url("fonts/GeistPixel-Line.woff2") format("woff2"); font-display: swap; }

/* Clean neutrals, black or white, with colour reserved for icons and small marks. */
:root {
  --bg: #fafafa;
  --bg-2: #000000;
  --surface: #ffffff;
  --surface-2: #f1f1f1;
  --surface-3: #e6e6e6;
  --ink: #0a0a0a;
  --ink-2: #404040;
  --muted: #8a8a8a;
  --line: rgba(0, 0, 0, .07);
  --line-2: rgba(0, 0, 0, .12);
  --accent: #e8930c;
  --accent-ink: #ffffff;
  --accent-soft: rgba(232, 147, 12, .12);
  --glow: rgba(240, 160, 30, .28);
  --dots: rgba(0, 0, 0, .07);
  --rose: #e0457b;
  --rose-soft: rgba(224, 69, 123, .1);
  --sky: #2f7cf6;
  --sky-soft: rgba(47, 124, 246, .09);
  --sage: #12a36a;
  --sage-soft: rgba(18, 163, 106, .1);
  --violet: #7c5cf0;
  --violet-soft: rgba(124, 92, 240, .1);
  --mark: rgba(255, 196, 0, .3);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .9);
  --shadow: 0 1px 1px rgba(0, 0, 0, .03), 0 3px 6px rgba(0, 0, 0, .025), 0 16px 36px -14px rgba(0, 0, 0, .14);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .04), 0 30px 60px -20px rgba(0, 0, 0, .25);
  --grain-o: .035;
  --sans: "Geist", ui-sans-serif, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pixel: "Geist Pixel Line", "Geist Mono", ui-monospace, monospace;
  /* The reading face (Scripture, quotes, journal writing). It is Geist too now; the name stays
     so every rule that asks for "reading text" keeps working. */
  --serif: "Geist", ui-sans-serif, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --radius: 20px;
  --tabs-h: 62px;
  --tabs-gap: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --dock: calc(var(--tabs-h) + var(--tabs-gap) + var(--safe-b));
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.35, .45, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --bg-2: #000000; --surface: #0f0f0f; --surface-2: #181818; --surface-3: #242424;
    --ink: #f5f5f5; --ink-2: #c8c8c8; --muted: #8a8a8a; --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .13);
    --accent: #ffb020; --accent-ink: #120c00; --accent-soft: rgba(255, 176, 32, .13); --glow: rgba(255, 176, 32, .24); --dots: rgba(255, 255, 255, .06);
    --rose: #ff6b9d; --rose-soft: rgba(255, 107, 157, .12); --sky: #5aa2ff; --sky-soft: rgba(90, 162, 255, .11);
    --sage: #3ddc97; --sage-soft: rgba(61, 220, 151, .11); --violet: #a58bff; --violet-soft: rgba(165, 139, 255, .12); --mark: rgba(255, 200, 40, .22);
    --hi: inset 0 1px 0 rgba(255, 255, 255, .06); --shadow: 0 1px 0 rgba(0, 0, 0, .6), 0 18px 40px -16px rgba(0, 0, 0, .9);
    --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .95); --grain-o: .05;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --bg-2: #000000; --surface: #0f0f0f; --surface-2: #181818; --surface-3: #242424;
  --ink: #f5f5f5; --ink-2: #c8c8c8; --muted: #8a8a8a; --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .13);
  --accent: #ffb020; --accent-ink: #120c00; --accent-soft: rgba(255, 176, 32, .13); --glow: rgba(255, 176, 32, .24); --dots: rgba(255, 255, 255, .06);
  --rose: #ff6b9d; --rose-soft: rgba(255, 107, 157, .12); --sky: #5aa2ff; --sky-soft: rgba(90, 162, 255, .11);
  --sage: #3ddc97; --sage-soft: rgba(61, 220, 151, .11); --violet: #a58bff; --violet-soft: rgba(165, 139, 255, .12); --mark: rgba(255, 200, 40, .22);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .06); --shadow: 0 1px 0 rgba(0, 0, 0, .6), 0 18px 40px -16px rgba(0, 0, 0, .9);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .95); --grain-o: .05;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg-2); }
body {
  margin: 0; background: var(--bg-2); color: var(--ink); font: 16px/1.5 var(--sans); letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow: hidden;
}
/* Film grain over everything: a tactile, printed feel for almost no cost. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: var(--grain-o); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--mark); }
h1, h2, h3, h4, h5 { font-family: var(--sans); font-weight: 580; line-height: 1.14; margin: 0; letter-spacing: -.03em; }
p { margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); letter-spacing: 0; font-feature-settings: "zero" 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Shell: the app is a card floating on black, so sheets can push it back in space ---- */
#app {
  position: fixed; inset: 0; overflow: hidden;
  background: var(--bg);
  transform-origin: 50% 40%; transition: transform .55s var(--ease), border-radius .55s var(--ease), filter .55s var(--ease);
}
#app::before {
  content: ""; position: absolute; left: 50%; top: -220px; width: 760px; height: 520px; margin-left: -380px; pointer-events: none;
  background: radial-gradient(closest-side, var(--glow), transparent 72%); opacity: .55;
  transform: translate(calc(var(--gx, 0) * 18px), calc(var(--gy, 0) * 12px));
  animation: ambient 9s ease-in-out infinite;
}
@keyframes ambient { 50% { opacity: .38; transform: translate(calc(var(--gx, 0) * 18px), calc(var(--gy, 0) * 12px)) scale(1.08); } }
body.locked #app { transform: scale(.93) translateY(10px); border-radius: 28px; filter: brightness(.8) saturate(.85); }
#view {
  position: relative; height: 100%; overflow-y: auto; overscroll-behavior: contain; outline: none; scrollbar-width: none;
  padding: calc(var(--safe-t) + 14px) max(16px, calc(50% - 320px)) calc(var(--dock) + 36px);
}
#view::-webkit-scrollbar { display: none; }

#tabs {
  position: absolute; left: 50%; bottom: calc(var(--safe-b) + var(--tabs-gap)); z-index: 20; transform: translateX(-50%);
  width: min(calc(100% - 24px), 480px); height: var(--tabs-h); padding: 6px;
  display: grid; grid-template-columns: repeat(5, 1fr); border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid var(--line-2); box-shadow: var(--hi), var(--shadow-lg);
  view-transition-name: tabs;
}
.tab-ind {
  position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 5); border-radius: 16px;
  background: var(--surface-2); box-shadow: var(--hi), 0 1px 2px rgba(0, 0, 0, .06);
  transform: translateX(calc(var(--tab-i, 0) * 100%)); transition: transform .5s var(--spring);
}
#tabs button {
  position: relative; z-index: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font: 600 10.5px var(--sans); letter-spacing: .01em; border-radius: 16px; transition: color .2s;
}
#tabs svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--spring); }
#tabs button.on { color: var(--ink); }
#tabs button.on svg { transform: translateY(-1px) scale(1.06); }
#tabs button.on[data-tab="today"] svg { color: var(--accent); filter: drop-shadow(0 0 6px var(--glow)); }
#tabs button:active svg { transform: scale(.88); }

/* Tab changes slide in the direction you moved. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .4s; animation-timing-function: var(--ease); }
html[data-nav="fwd"]::view-transition-old(root) { animation-name: vt-out-l; }
html[data-nav="fwd"]::view-transition-new(root) { animation-name: vt-in-r; }
html[data-nav="back"]::view-transition-old(root) { animation-name: vt-out-r; }
html[data-nav="back"]::view-transition-new(root) { animation-name: vt-in-l; }
@keyframes vt-out-l { to { opacity: 0; transform: translateX(-28px) scale(.985); filter: blur(3px); } }
@keyframes vt-in-r { from { opacity: 0; transform: translateX(28px) scale(.985); filter: blur(3px); } }
@keyframes vt-out-r { to { opacity: 0; transform: translateX(28px) scale(.985); filter: blur(3px); } }
@keyframes vt-in-l { from { opacity: 0; transform: translateX(-28px) scale(.985); filter: blur(3px); } }

/* Arriving on a tab, sections rise in one after another. */
#view.enter > * { animation: rise .7s var(--ease) both; }
#view.enter > :nth-child(2) { animation-delay: .05s; } #view.enter > :nth-child(3) { animation-delay: .1s; }
#view.enter > :nth-child(4) { animation-delay: .15s; } #view.enter > :nth-child(5) { animation-delay: .2s; }
#view.enter > :nth-child(6) { animation-delay: .25s; } #view.enter > :nth-child(7) { animation-delay: .3s; }
#view.enter > :nth-child(n+8) { animation-delay: .35s; }
#view.enter .entry, #view.enter .lib-card, #view.enter .root-card { animation: rise .6s var(--ease) both; animation-delay: calc(.12s + var(--i, 0) * 35ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 0 22px; }
.topbar h1 { font-size: 34px; }
.topbar .sub { color: var(--muted); font-size: 14px; margin-top: 6px; letter-spacing: 0; }
.topbar-actions { display: flex; gap: 2px; margin-right: -8px; }
.icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center; border: 0; border-radius: 14px;
  background: none; color: var(--ink-2); transition: background .15s, transform .2s var(--spring);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.9); }

.eyebrow {
  font: 600 10.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.section { margin-top: 30px; }
.section > .eyebrow { margin: 0 2px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.section > .eyebrow button { border: 0; background: none; color: var(--ink-2); font: inherit; letter-spacing: inherit; padding: 4px 0; }
.eyebrow .count { color: var(--muted); letter-spacing: .04em; text-transform: none; font-weight: 500; }

/* ---- Surfaces ------------------------------------------------------------------ */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--hi), var(--shadow);
}
.card + .card { margin-top: 10px; }
.card.tap { cursor: pointer; text-align: left; width: 100%; display: block; transition: transform .25s var(--spring), border-color .2s; }
.card.tap:hover { border-color: var(--line-2); }
.card.tap:active { transform: scale(.985); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 15px; letter-spacing: -.01em;
  box-shadow: var(--hi), 0 1px 2px rgba(0, 0, 0, .05); transition: transform .2s var(--spring), background .15s, opacity .15s;
}
.btn .ico { width: 18px; height: 18px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 8px 20px -8px rgba(0, 0, 0, .45); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn.small { min-height: 36px; padding: 0 13px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; }
.btn:active:not(:disabled) { transform: scale(.96); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent); }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 7px 12px;
  font-size: 13.5px; font-weight: 550; white-space: nowrap; color: var(--ink-2); line-height: 1.2;
  transition: transform .2s var(--spring), background .15s, border-color .15s;
}
.chip:active { transform: scale(.94); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip.theme { color: var(--accent); background: var(--accent-soft); border-color: transparent; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.chip.theme::before { content: "#"; opacity: .55; margin-right: 1px; }
.chip.verse { color: var(--sky); background: var(--sky-soft); border-color: transparent; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.chip.root { color: var(--rose); background: var(--rose-soft); border-color: transparent; }
.chip.link { color: var(--ink-2); background: var(--surface-2); border-color: transparent; font-family: var(--mono); font-size: 12.5px; }
.chip.link::before { content: "[["; opacity: .45; } .chip.link::after { content: "]]"; opacity: .45; }
.chip.mini { padding: 3px 8px; font-size: 11.5px; border-radius: 7px; }

.fab {
  position: fixed; right: max(18px, calc(50% - 300px)); bottom: calc(var(--dock) + 16px); z-index: 15;
  width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--ink); color: var(--bg);
  display: grid; place-items: center; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  transition: transform .25s var(--spring);
}
.fab:active { transform: scale(.9) rotate(90deg); }
.fab .ico { width: 24px; height: 24px; }

/* ---- Forms ---------------------------------------------------------------- */
textarea, input[type="text"], input[type="search"], select {
  width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 14px; padding: 12px 14px;
  font-size: 16px; line-height: 1.5; outline: none; transition: border-color .15s, box-shadow .2s; box-shadow: var(--hi);
}
textarea { resize: none; min-height: 96px; font-family: var(--serif); font-size: 18px; line-height: 1.65; letter-spacing: 0; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
::placeholder { color: var(--muted); opacity: .75; }
input[type="search"]::-webkit-search-cancel-button { filter: grayscale(1); }
label.field { display: block; margin-top: 16px; }
label.field > span { display: block; font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 2px 7px; }
.title-input { border: 0 !important; box-shadow: none !important; background: none !important; padding: 2px 0 12px !important; font: 650 26px var(--sans) !important; letter-spacing: -.03em !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; margin-bottom: 12px; }
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; }
.switch input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--accent); }
.search { position: relative; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search input { padding-left: 42px; border-radius: 14px; background: var(--surface); }

.suggest { display: none; gap: 6px; overflow-x: auto; margin-top: 8px; padding-bottom: 2px; scrollbar-width: none; }
.suggest.show { display: flex; animation: rise .25s var(--ease); }
.suggest button { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 9px; padding: 6px 10px; font: 500 13px var(--mono); }
.suggest button .ico { width: 14px; height: 14px; color: var(--muted); }

/* ---- Layers: sheets and full screens stack in depth -------------------------- */
.layer { position: fixed; inset: 0; z-index: 40; }
.sheet .backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity .35s; }
.sheet.open .backdrop { opacity: 1; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 640px; max-height: 90dvh;
  display: flex; flex-direction: column; background: var(--bg); border-radius: 26px 26px 0 0; outline: none;
  border: 1px solid var(--line-2); border-bottom: 0; box-shadow: var(--hi), 0 -20px 60px rgba(0, 0, 0, .28);
  transform: translateY(104%); transition: transform .5s var(--ease), filter .4s;
}
.sheet-panel.tall { height: 90dvh; }
.sheet.open .sheet-panel { transform: none; }
.sheet.behind .sheet-panel { transform: scale(.94) translateY(-14px); filter: brightness(.8); }
.sheet-head { position: relative; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 6px; padding: 20px 12px 8px; touch-action: none; }
.sheet-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -.015em; text-align: center; line-height: 1.3; }
.grab { position: absolute; top: 8px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--line-2); }
.sheet-body { overflow-y: auto; padding: 8px 20px 24px; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn.ghost:first-child:not(:only-child) { flex: 0 0 auto; }

.overlay {
  background: var(--bg); opacity: 0; transform: scale(1.04); transition: opacity .4s var(--ease), transform .5s var(--ease), border-radius .5s, filter .5s;
  overflow-y: auto; overscroll-behavior: contain;
}
.overlay.open { opacity: 1; transform: none; }
.overlay.behind { transform: scale(.93) translateY(10px); border-radius: 28px; filter: brightness(.75); overflow: hidden; }
.overlay.closing { transform: scale(1.03); opacity: 0; }

#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--dock) + 14px); z-index: 60; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: 520px; padding: 12px 16px; border-radius: 14px;
  background: #151515; color: #f2f2f0; font-size: 14.5px; border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6); opacity: 0; transform: translateY(12px) scale(.96); transition: .4s var(--spring);
}
.toast.show { opacity: 1; transform: none; }
.toast button { border: 0; background: none; color: #ffaa55; font-weight: 700; padding: 4px; }

/* ---- Today: the lamp in the dark ------------------------------------------- */
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 24px 22px 20px; color: #f4efe6;
  background: radial-gradient(120% 100% at 88% -10%, rgba(255, 150, 60, .32), transparent 55%), radial-gradient(80% 60% at 10% 120%, rgba(255, 120, 40, .1), transparent 60%), #100e0b;
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 30px 60px -24px rgba(40, 20, 0, .55);
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d;
  transition: transform .6s var(--ease);
}
.hero.tilt:hover { transition: transform .12s linear; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(400px circle at var(--mx, 70%) var(--my, 0%), rgba(255, 220, 170, .09), transparent 45%); }
.hero .eyebrow { color: rgba(255, 196, 140, .75); }
.hero .flame-bg { position: absolute; right: 14px; top: 10px; width: 96px; height: 120px; transform: translateZ(50px) translate(calc(var(--gx, 0) * -6px), calc(var(--gy, 0) * -6px)); pointer-events: none; }
.hero .flame-bg::before { content: ""; position: absolute; inset: -20px -30px; background: radial-gradient(closest-side, rgba(255, 150, 50, .55), transparent); filter: blur(10px); animation: halo 3.4s ease-in-out infinite; }
.hero .flame-bg .ico, .hero .flame-bg svg { position: relative; width: 100%; height: 100%; }
.hero .flame-bg svg { stroke: none; fill: #ffb062; filter: drop-shadow(0 0 14px rgba(255, 150, 50, .8)); transform-origin: 50% 90%; animation: flicker 2.6s ease-in-out infinite; }
@keyframes halo { 50% { opacity: .65; transform: scale(1.12); } }
.hero h2 { font-size: 34px; margin: 10px 0 4px; color: #fff; }
.hero .hint { font-family: var(--serif); font-style: italic; color: rgba(244, 239, 230, .7); font-size: 18px; letter-spacing: 0; }
.hero .row { margin-top: 20px; }
.hero .btn.primary { background: #ffaa55; border-color: #ffaa55; color: #1a0f04; box-shadow: 0 0 0 1px rgba(255, 255, 255, .2) inset, 0 10px 30px -6px rgba(255, 150, 50, .6); }
.hero .btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: #f4efe6; box-shadow: none; }
.hero .btn.ghost { background: transparent; border-color: transparent; color: rgba(244, 239, 230, .75); }
.hero.done { background: radial-gradient(120% 100% at 88% -10%, rgba(140, 210, 160, .22), transparent 55%), #0d0f0d; }
.plan-line { display: flex; align-items: center; gap: 12px; margin-top: 18px; font: 500 11.5px var(--mono); color: rgba(244, 239, 230, .5); }
.bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #ff8a3d, #ffc27a); border-radius: 2px; box-shadow: 0 0 10px rgba(255, 160, 70, .8); }

.carry { font-family: var(--serif); font-size: 21px; line-height: 1.45; letter-spacing: 0; padding: 20px 22px 20px 26px; overflow: hidden; }
.carry::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--accent), transparent); box-shadow: 0 0 12px var(--glow); }
.carry .src { display: block; margin-top: 10px; font: 500 11.5px var(--mono); color: var(--muted); }

.rhythm { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; }
.rhythm i { aspect-ratio: 1; border-radius: 4px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.rhythm i.on { background: var(--accent); box-shadow: 0 0 10px var(--glow); }
#view.enter .rhythm i { animation: pop .5s var(--spring) both; animation-delay: calc(.25s + var(--n, 0) * 14ms); }
.rhythm i.today { outline: 1.5px solid var(--ink); outline-offset: 2px; }
@keyframes pop { from { transform: scale(0); opacity: 0; } }
.rhythm-note { margin-top: 14px; font-size: 14px; color: var(--muted); }

.prayer-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.prayer-row:first-child { border-top: 0; padding-top: 0; }
.prayer-row .t { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 0; }
.prayer-row .t b { display: block; font-weight: 600; font-size: 15.5px; letter-spacing: -.015em; }
.prayer-row .t small { color: var(--muted); font: 500 11.5px var(--mono); }
.tick { width: 32px; height: 32px; flex: none; border-radius: 10px; border: 1.5px solid var(--line-2); background: none; display: grid; place-items: center; color: transparent; transition: .25s var(--spring); }
.tick .ico { width: 16px; height: 16px; }
.tick:hover, .tick:focus-visible { color: var(--sage); border-color: var(--sage); }
.tick:active { transform: scale(.85); }

.root-mini { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.root-mini .t { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 0; }
.root-mini .t b { display: block; font-size: 16.5px; letter-spacing: -.02em; }
.root-mini .t small { color: var(--muted); font-size: 11.5px; }
.roots-invite b { display: block; font-size: 17px; letter-spacing: -.02em; margin-bottom: 4px; }

.remember q { display: block; font-family: var(--serif); font-size: 19px; line-height: 1.5; quotes: "“" "”"; letter-spacing: 0; }
.remember .meta { margin-top: 12px; font: 500 11.5px var(--mono); color: var(--muted); }

/* ---- Scripture ------------------------------------------------------------- */
.scripture { font-family: var(--serif); font-size: 20px; line-height: 1.8; color: var(--ink); letter-spacing: 0; }
.scripture .v {
  display: inline; padding: 3px 1px; border-radius: 5px; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: linear-gradient(var(--mark), var(--mark)) no-repeat 0 0 / 0% 100%; transition: background-size .45s var(--ease);
}
.scripture .v sup { font: 600 10px var(--mono); color: var(--accent); margin: 0 4px 0 2px; vertical-align: .6em; }
.scripture .v.marked, .scripture .v.flash { background-size: 100% 100%; }
.scripture .v.noted { text-decoration: underline dotted var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.scripture.reveal .w { display: inline-block; animation: word-in .7s var(--ease) both; animation-delay: calc(var(--w) * 12ms); }
@keyframes word-in { from { opacity: 0; transform: translateY(5px); filter: blur(4px); } }
.translation { margin-top: 20px; font: 500 11px var(--mono); color: var(--muted); letter-spacing: .02em; }

/* ---- Focus loop ---------------------------------------------------------------- */
.loop { min-height: 100%; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; padding: calc(var(--safe-t) + 8px) 20px calc(var(--safe-b) + 18px); }
.loop-top { display: flex; align-items: center; gap: 8px; height: 54px; margin: 0 -8px; }
.loop-dots { flex: 1; display: flex; gap: 5px; padding: 0 8px; }
.loop-dots i { flex: 1; height: 3px; border-radius: 2px; background: var(--line-2); transition: background .4s; position: relative; overflow: hidden; }
.loop-dots i.done { background: var(--ink); }
.loop-dots i.on { background: var(--line-2); }
.loop-dots i.on::after { content: ""; position: absolute; inset: 0; background: var(--accent); box-shadow: 0 0 8px var(--glow); transform-origin: left; animation: seg 1s var(--ease) both; }
@keyframes seg { from { transform: scaleX(0); } }
.loop-step { flex: 1; display: flex; flex-direction: column; padding-top: 12px; animation: step-in .65s var(--ease) both; transform-origin: 50% 0; }
@keyframes step-in { from { opacity: 0; transform: perspective(900px) translateZ(-80px) translateY(18px) rotateX(8deg); } }
.loop-step > .eyebrow { color: var(--accent); }
.loop-step h2 { font-size: 34px; margin: 10px 0 10px; }
.loop-step .lede { color: var(--ink-2); font-size: 16.5px; margin-bottom: 20px; }
.lede.prompt { margin-bottom: 6px; font-family: var(--serif); font-size: 20px; color: var(--ink); letter-spacing: 0; line-height: 1.45; }
.lede.prompt.swap { animation: rise .45s var(--ease); }
.loop-foot { display: flex; gap: 10px; padding-top: 22px; position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); }
.loop-foot .btn.primary { flex: 1; min-height: 52px; font-size: 16px; }

.breath { position: relative; display: grid; place-items: center; margin: 26px auto 14px; width: 230px; height: 230px; }
.breath::before, .breath::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 1px solid var(--accent); opacity: 0; animation: ripple 5s var(--ease) infinite; }
.breath::after { animation-delay: 2.5s; }
@keyframes ripple { 0% { transform: scale(.7); opacity: .6; } 100% { transform: scale(1.6); opacity: 0; } }
.breath .ring { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 66%); animation: breathe 10s ease-in-out infinite; }
.breath .core {
  width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff1dc 0%, #ffc98a 18%, var(--accent) 52%, #7a3404 100%);
  box-shadow: 0 0 60px var(--glow), 0 20px 40px -10px rgba(120, 50, 0, .45), inset -12px -16px 30px rgba(60, 20, 0, .3);
  animation: breathe-core 10s ease-in-out infinite;
}
.breath .cue { position: absolute; bottom: -38px; left: 0; right: 0; text-align: center; font: 500 12px var(--mono); color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
@keyframes breathe { 0%, 100% { transform: scale(.62); } 40%, 50% { transform: scale(1); } }
@keyframes breathe-core { 0%, 100% { transform: scale(.8); } 40%, 50% { transform: scale(1.14); } }
.marked-quote { position: relative; font-family: var(--serif); font-size: 18px; line-height: 1.6; padding: 16px 18px 16px 20px; border-radius: 16px; background: var(--accent-soft); margin-bottom: 18px; letter-spacing: 0; }
.marked-quote::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.marked-quote sup { font: 600 10px var(--mono); color: var(--accent); margin-right: 4px; }
.prompt-swap { border: 0; background: none; color: var(--muted); font: 500 12px var(--mono); padding: 8px 0 12px; align-self: flex-start; letter-spacing: .02em; }
.prompt-swap::before { content: "↻ "; color: var(--accent); }
.finish { text-align: center; margin: auto 0; padding: 30px 0; }
.flame-wrap { position: relative; width: 120px; height: 140px; margin: 0 auto 22px; }
.flame-wrap::before { content: ""; position: absolute; inset: -30px; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); animation: halo 3s ease-in-out infinite; }
.finish .flame { position: absolute; inset: 20px 16px 0; color: var(--accent); filter: drop-shadow(0 0 22px var(--glow)); animation: flicker 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
.finish .flame .ico, .finish .flame svg { width: 100%; height: 100%; }
.finish .flame svg { fill: currentColor; stroke: none; }
.embers i { position: absolute; left: 50%; bottom: 40%; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: #ffc27a; box-shadow: 0 0 6px #ff9a40; opacity: 0; animation: ember 2.8s ease-out infinite; animation-delay: var(--d); }
@keyframes ember { 0% { transform: translate(0, 0) scale(var(--s)); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(var(--x), -150px) scale(0); opacity: 0; } }
.finish h2 { font-size: 38px; }
.finish p { color: var(--ink-2); margin-top: 12px; font-family: var(--serif); font-size: 20px; letter-spacing: 0; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.03, .97) rotate(-1.5deg); } 55% { transform: scale(.97, 1.04) rotate(1.2deg); } 80% { transform: scale(1.02, .98) rotate(-.6deg); } }

/* ---- Word ---------------------------------------------------------------------- */
#view[data-view="word"] { padding-top: 0; }
.reader-bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 4px; margin: 0 -16px 14px; padding: calc(var(--safe-t) + 8px) 8px 8px;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.ref-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; font: 650 19px var(--sans); letter-spacing: -.03em; padding: 8px; border-radius: 12px; }
.ref-btn .ico { width: 16px; height: 16px; color: var(--muted); }
.ref-btn:hover { background: var(--surface-2); }
.chapter-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 34px; flex-wrap: wrap; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.book-grid button, .ch-grid button { border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 10px 6px; font-size: 13.5px; text-align: center; transition: transform .2s var(--spring); }
.book-grid button:active, .ch-grid button:active { transform: scale(.93); }
.book-grid button.cur, .ch-grid button.cur { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 6px; }
.ch-grid button { padding: 12px 0; font: 500 14px var(--mono); }
.ch-grid button.cached::after { content: ""; display: block; width: 4px; height: 4px; border-radius: 2px; background: var(--accent); margin: 3px auto -7px; }
.sub-head { margin: 24px 2px 10px; }
.status-box { text-align: center; padding: 50px 20px; color: var(--muted); }
.status-box h3 { color: var(--ink); margin-bottom: 8px; font-size: 20px; }
.status-box .btn { margin-top: 18px; }
.verse-preview { font-family: var(--serif); font-size: 18.5px; line-height: 1.65; padding: 2px 0 14px; letter-spacing: 0; }
.verse-preview sup { font: 600 10px var(--mono); color: var(--accent); margin-right: 4px; }
.action-list { display: grid; gap: 6px; margin-top: 4px; }
.action-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; font-size: 15.5px; box-shadow: var(--hi); transition: transform .2s var(--spring); }
.action-list button:active { transform: scale(.98); }
.action-list .ico { color: var(--accent); }
.skeleton { height: 16px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin: 14px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- Journal ------------------------------------------------------------------- */
.entry {
  display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--hi), var(--shadow); transition: transform .25s var(--spring), border-color .2s;
}
.entry:hover { border-color: var(--line-2); transform: translateY(-1px); }
.entry:active { transform: scale(.985); }
.entry + .entry { margin-top: 8px; }
.entry-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.entry-head .ico { width: 16px; height: 16px; }
.entry-head .kind-loop { color: var(--accent); } .entry-head .kind-prayer { color: var(--rose); } .entry-head .kind-note { color: var(--sky); }
.entry-head .mono { font-size: 11.5px; }
.entry-head .links { color: var(--ink-2); }
.entry-title { font-size: 17px; font-weight: 600; letter-spacing: -.02em; line-height: 1.35; margin-top: 7px; color: var(--ink); }
.entry-body { color: var(--muted); font-size: 14.5px; margin-top: 3px; line-height: 1.45; }
.entry .chips { margin-top: 11px; gap: 5px; }
.answered-badge { margin-left: auto; color: var(--sage); font-weight: 600; }
.day-head { margin: 26px 2px 10px; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.detail-block { margin-top: 22px; }
.detail-block > .eyebrow { margin-bottom: 9px; display: flex; gap: 8px; align-items: center; }
.prose { font-family: var(--serif); font-size: 18px; line-height: 1.65; letter-spacing: 0; white-space: pre-wrap; }
.note-title { font-size: 28px; margin: 8px 0 12px; }
.md { white-space: normal; }
.md p + p, .md p + ul, .md ul + p, .md p + ol, .md ol + p, .md blockquote, .md .md-h { margin-top: .7em; }
.md .md-h { font-family: var(--sans); letter-spacing: -.03em; } .md h3 { font-size: 22px; } .md h4 { font-size: 19px; } .md h5 { font-size: 16px; }
.md ul, .md ol { margin: .4em 0 0; padding-left: 1.3em; }
.md li + li { margin-top: .2em; }
.md blockquote { margin-left: 0; padding: 2px 0 2px 16px; border-left: 2px solid var(--accent); color: var(--ink-2); font-style: italic; }
.md hr { border: 0; border-top: 1px solid var(--line-2); margin: 1.2em 0; }
.md code { font: 500 .8em var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.md-tasks { list-style: none; padding-left: 0 !important; }
.md-tasks label { display: flex; gap: 10px; align-items: flex-start; }
.md-tasks input { margin-top: .45em; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.md-tasks li.done span { text-decoration: line-through; color: var(--muted); }
.wikilink, .tag, .ref { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
.wikilink { color: var(--accent); font-family: var(--sans); font-size: .9em; font-weight: 600; letter-spacing: -.01em; text-decoration: underline; text-decoration-color: var(--accent-soft); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.wikilink.unresolved { color: var(--muted); text-decoration-style: dashed; text-decoration-color: var(--line-2); }
.tag { font: 500 .78em var(--mono); color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; vertical-align: .08em; }
.ref { color: var(--sky); text-decoration: underline dotted; text-underline-offset: 4px; }
.detected { margin-top: 12px; min-height: 28px; }
.detected .chips { gap: 5px; }
.kind-toggle { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2); margin-bottom: 16px; }
.kind-toggle button { border: 0; border-radius: 10px; background: none; padding: 8px; font-weight: 600; font-size: 14px; color: var(--muted); }
.kind-toggle button.on { background: var(--surface); color: var(--ink); box-shadow: var(--hi), 0 1px 3px rgba(0, 0, 0, .08); }
.linked-list { display: grid; gap: 6px; }
.linked-list button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 13px; padding: 11px 14px; font-size: 15px; box-shadow: var(--hi); transition: transform .2s var(--spring); }
.linked-list button:active { transform: scale(.98); }
.linked-list small { display: block; color: var(--muted); font: 500 11.5px var(--mono); margin-top: 3px; }

.cmd-list { display: grid; gap: 2px; margin-top: 12px; }
.cmd-row { display: flex; align-items: center; gap: 14px; text-align: left; border: 0; background: none; border-radius: 12px; padding: 11px 12px; }
.cmd-row:first-child { background: var(--surface-2); }
.cmd-row:hover { background: var(--surface-2); }
.cmd-row .ico { color: var(--muted); }
.cmd-row b { display: block; font-weight: 550; font-size: 15px; letter-spacing: -.01em; }
.cmd-row small { display: block; color: var(--muted); font: 500 11.5px var(--mono); }

/* ---- Roots --------------------------------------------------------------------- */
.lib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lib-card { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px; box-shadow: var(--hi); transition: transform .25s var(--spring), border-color .2s; }
.lib-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.lib-card:active { transform: scale(.97); }
.lib-card b { display: block; font-size: 15px; letter-spacing: -.02em; margin-bottom: 3px; }
.lib-card small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.lib-card.custom { border-style: dashed; border-color: var(--line-2); background: transparent; box-shadow: none; }

.root-card { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 22px; padding: 18px; box-shadow: var(--hi), var(--shadow); transition: transform .3s var(--spring), border-color .2s; }
.root-card + .root-card { margin-top: 10px; }
.root-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.root-card:active { transform: scale(.985); }
.root-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.root-card h3 { font-size: 24px; margin-top: 6px; }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: var(--line-2); }
.ring .fill { stroke: var(--accent); stroke-linecap: round; filter: drop-shadow(0 0 4px var(--glow)); transition: stroke-dashoffset 1.2s var(--ease); }
.ring em { position: absolute; font: 600 12px var(--mono); font-style: normal; }
.trace-dots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 16px; }
.trace-dots i { height: 4px; border-radius: 2px; background: var(--surface-3); }
.trace-dots i.on { background: var(--accent); }
.trace-dots i.on:nth-child(-n+4) { opacity: calc(.45 + .15 * var(--n, 1)); }
.trace-dots i:nth-child(1) { --n: 0; } .trace-dots i:nth-child(2) { --n: 1; } .trace-dots i:nth-child(3) { --n: 2; } .trace-dots i:nth-child(4) { --n: 3; }
.trace-dots i:nth-child(5).on, .trace-dots i:nth-child(6).on { background: var(--sage); }
.root-card .lie { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-2); letter-spacing: 0; }
.next-up { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-up .mono { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.next-up .muted { overflow: hidden; text-overflow: ellipsis; }

.explain-lede { font-family: var(--serif); font-size: 18px; line-height: 1.55; margin: 10px 0 18px; letter-spacing: 0; }
.mini-trace { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; perspective: 800px; }
.mini-trace li { display: flex; align-items: baseline; gap: 10px; margin-left: calc(var(--d) * 16px); font-size: 14px; transform: translateZ(calc(var(--d) * -10px)); animation: rise .6s var(--ease) both; animation-delay: calc(.2s + var(--i) * 70ms); }
.mini-trace li.up { margin-left: calc((5 - var(--i)) * 16px); }
.mini-trace .node { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); opacity: calc(.35 + var(--d) * .2); flex: none; transform: translateY(-1px); box-shadow: 0 0 8px var(--glow); }
.mini-trace li.up .node { background: var(--sage); opacity: 1; box-shadow: none; }
.mini-trace b { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; min-width: 66px; }
.mini-trace span:last-child { color: var(--muted); }

.hub { max-width: 640px; margin: 0 auto; padding: 0 18px calc(var(--safe-b) + 24px); }
.hub-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; margin: 0 -18px; padding: calc(var(--safe-t) + 6px) 8px 6px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.hub-head { padding: 8px 0 4px; }
.hub-head h1 { font-size: 42px; margin: 10px 0 8px; }
.trace { position: relative; display: grid; gap: 10px; perspective: 900px; }
.trace-row {
  position: relative; display: flex; align-items: flex-start; gap: 14px; width: calc(100% - var(--d) * 18px); margin-left: calc(var(--d) * 18px);
  padding: 13px 16px 13px 14px; border-radius: 16px; text-align: left; border: 1px dashed var(--line-2); background: transparent;
  transition: transform .3s var(--spring), border-color .2s, background .2s;
  animation: rise .6s var(--ease) both; animation-delay: calc(var(--i) * 60ms);
}
.trace-row:active { transform: scale(.98); }
.trace-row.filled { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--hi), var(--shadow); }
.trace-row .node { position: relative; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; flex: none; border: 1.5px solid var(--line-2); background: var(--bg); }
.trace-row.filled.down .node { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 calc(4px + var(--d) * 4px) var(--glow); }
.trace-row.filled.up .node { border-color: var(--sage); background: var(--sage); }
.trace-row.link::after { content: ""; position: absolute; left: 20px; top: 30px; bottom: -11px; width: 1.5px; background: var(--line-2); }
.trace-row.down + .trace-row.down::before, .trace-row.up + .trace-row.up::before { content: ""; position: absolute; top: -1px; height: 25px; border: 0 solid var(--line-2); border-bottom-width: 1.5px; }
.trace-row.down + .trace-row.down::before { left: 2px; width: 12px; border-left-width: 1.5px; border-bottom-left-radius: 9px; }
.trace-row.up + .trace-row.up::before { left: 28px; width: 11.5px; border-right-width: 1.5px; border-bottom-right-radius: 9px; }
.trace-text { min-width: 0; }
.trace-text small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.trace-row.filled.down small { color: var(--accent); } .trace-row.filled.up small { color: var(--sage); }
.trace-text > span { display: block; font-size: 15.5px; line-height: 1.45; color: var(--ink); }
.trace-row:not(.filled) .trace-text > span { color: var(--muted); }
.trace-row.filled .trace-text > span { font-family: var(--serif); font-size: 17px; letter-spacing: 0; }
.trace-turn { margin: 10px 2px 4px; font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.up-next { margin-bottom: 18px; overflow: hidden; }
.up-next::before { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; background: radial-gradient(closest-side, var(--glow), transparent); opacity: .7; pointer-events: none; }
.up-next .eyebrow { color: var(--accent); }
.up-next h3 { font-size: 26px; margin: 8px 0 4px; }
.angle { margin-top: 16px; }
.angle-label { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 2px 8px; }
.q-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 12px 12px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; box-shadow: var(--hi); transition: transform .2s var(--spring); }
.q-row + .q-row { margin-top: 6px; }
.q-row:active { transform: scale(.98); }
.q-row > .ico { color: var(--muted); width: 16px; height: 16px; }
.q-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--line-2); display: grid; place-items: center; flex: none; }
.q-row.done .q-check { background: var(--muted); border: 0; color: var(--bg); }
.q-row.next .q-check { background: var(--ink); border: 0; color: var(--bg); }
.q-row.next .q-check::after { content: "92"; font: 700 12px var(--sans); }
.q-check .ico { width: 14px; height: 14px; }
.q-text { flex: 1; min-width: 0; }
.q-text b { display: block; font: 600 14px var(--mono); letter-spacing: -.01em; }
.q-text small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 1px; }
.q-row.done .q-text b, .q-row.done .q-text small { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }

/* ---- Map ----------------------------------------------------------------------- */
#view[data-view="map"] { padding: 0; overflow: hidden; }
.map-wrap { position: absolute; inset: 0; overflow: hidden; touch-action: none; background: radial-gradient(90% 70% at 50% 45%, var(--surface-2), var(--bg) 70%); }
.map-wrap canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.map-wrap canvas:active { cursor: grabbing; }
.map-ui { position: absolute; left: 0; right: 0; top: 0; padding: calc(var(--safe-t) + 18px) 18px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; pointer-events: none; }
.map-ui > * { pointer-events: auto; }
.map-ui h1 { font-size: 34px; }
.map-ui .sub { font: 500 11.5px var(--mono); color: var(--muted); margin-top: 6px; }
.map-controls { position: absolute; right: 14px; bottom: calc(var(--dock) + 14px); display: grid; gap: 6px; padding: 5px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--line-2); box-shadow: var(--hi), var(--shadow); }
.map-legend { position: absolute; left: 18px; bottom: calc(var(--dock) + 18px); display: flex; flex-direction: column; gap: 6px; font: 500 11px var(--mono); color: var(--muted); pointer-events: none; }
.map-legend span { display: flex; align-items: center; gap: 8px; }
.map-legend i { width: 8px; height: 8px; border-radius: 50%; }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; pointer-events: none; }

.empty { text-align: center; padding: 44px 18px; color: var(--muted); }
.empty-mark { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-2); color: var(--accent); box-shadow: var(--hi), 0 0 30px var(--glow); }
.empty h3 { color: var(--ink); font-size: 21px; margin-bottom: 8px; }
.empty p { max-width: 330px; margin: 0 auto; }
.empty .btn { margin-top: 20px; }

/* ---- Settings ------------------------------------------------------------------ */
.set-group { margin-top: 24px; }
.set-group:first-child { margin-top: 4px; }
.set-group > .eyebrow { margin: 0 2px 9px; }
.set-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 2px 16px; box-shadow: var(--hi); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; }
.set-row > div { min-width: 0; }
.set-row small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.set-row select { width: auto; max-width: 52%; padding: 8px 12px; border-radius: 10px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.seg button { border: 0; background: none; border-radius: 8px; padding: 6px 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--hi), 0 1px 3px rgba(0, 0, 0, .1); }
.plan-pick { display: grid; gap: 6px; }
.plan-pick button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; box-shadow: var(--hi); }
.plan-pick button.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.plan-pick b { display: block; font-size: 15.5px; letter-spacing: -.02em; }
.plan-pick small { color: var(--muted); }
.ok { color: var(--sage); font-weight: 600; }
.privacy { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 16px 2px 0; }

@media (min-width: 720px) {
  .topbar h1, .map-ui h1 { font-size: 40px; }
  .scripture { font-size: 21px; }
  .lib-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* ---- Cursor-style details --------------------------------------------------------- */
/* Floating round icon buttons. */
.topbar-actions .icon-btn, .hub-top .icon-btn, .loop-top .icon-btn, .sheet-head .icon-btn, .reader-bar .icon-btn {
  width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--hi), 0 2px 10px -2px rgba(0, 0, 0, .1);
}
.topbar-actions { gap: 8px; margin-right: 0; }
.topbar-actions .icon-btn .ico, .hub-top .icon-btn .ico, .loop-top .icon-btn .ico, .sheet-head .icon-btn .ico, .reader-bar .icon-btn .ico { width: 18px; height: 18px; }
/* Two-tone headline: the line, then its quieter echo. */
.topbar h1 .dim { display: block; color: var(--muted); }
/* "Thinking…" style shimmer for quiet status text. */
.shimmer {
  background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 35%, var(--ink) 50%, var(--muted) 65%, var(--muted) 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer-text 2.4s linear infinite;
}
@keyframes shimmer-text { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* Quick capture: a floating composer, like an agent prompt bar. */
#view[data-view="journal"] { padding-bottom: calc(var(--dock) + 110px); }
.composer {
  position: fixed; left: 50%; bottom: calc(var(--dock) + 10px); z-index: 16; transform: translateX(-50%);
  width: min(calc(100% - 24px), 480px); display: flex; align-items: flex-end; gap: 6px; padding: 6px;
  border-radius: 22px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--hi), var(--shadow-lg);
  transition: box-shadow .2s, border-color .2s;
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-lg); }
.composer textarea {
  flex: 1; min-height: 0; max-height: 140px; border: 0 !important; box-shadow: none !important; background: none; padding: 8px 4px;
  font: 15.5px/1.4 var(--sans); letter-spacing: -.005em; resize: none;
}
.composer .c-btn { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); transition: transform .2s var(--spring), opacity .2s, background .2s; }
.composer .c-btn .ico { width: 18px; height: 18px; }
.composer .c-btn:active { transform: scale(.88); }
.composer .c-send { background: var(--ink); color: var(--bg); }
.composer .c-send:disabled { opacity: .25; }
.composer-suggest { position: absolute; left: -44px; right: -44px; bottom: calc(100% + 14px); }
.composer-suggest .suggest { margin: 0; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); }
/* A layer on its way out ignores taps, so a quick second tap lands on what is underneath. */
.layer.closing { pointer-events: none; }

/* ---- Roots segments ----------------------------------------------------------------- */
.seg-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin: -6px 0 22px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.seg-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 10px; background: var(--surface); box-shadow: var(--hi), 0 1px 3px rgba(0, 0, 0, .1); transform: translateX(calc(var(--seg, 0) * 100%)); transition: transform .45s var(--spring); }
.seg-tabs button { position: relative; z-index: 1; border: 0; background: none; padding: 9px; font-size: 14px; font-weight: 600; color: var(--muted); transition: color .2s; }
.seg-tabs button.on { color: var(--ink); }

/* ---- Thoughts (ACT) ----------------------------------------------------------------- */
.small { font-size: 13.5px; line-height: 1.5; }
.act-block { margin-top: 22px; }
.act-block > .eyebrow { margin-bottom: 10px; }
.word-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; margin-top: 20px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px 6px 10px; font: 500 12px var(--mono); color: var(--sky); box-shadow: var(--hi); }
.word-chip .ico { width: 15px; height: 15px; }

.scale { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 10px; box-shadow: var(--hi); }
.scale-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; font-weight: 550; }
.scale-val { font-size: 22px; font-weight: 600; color: var(--accent); min-width: 2ch; text-align: right; }
.scale input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; margin: 6px 0 0; }
.scale input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), var(--surface-3) var(--p, 50%)); }
.scale input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), var(--surface-3) var(--p, 50%)); }
.scale input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 2px 8px rgba(0, 0, 0, .2), 0 0 0 4px var(--accent-soft); }
.scale input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.scale-ends { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

/* Defusion: the same thought, held a little further away each time. */
.defuse { perspective: 700px; display: grid; gap: 12px; margin: 6px 0 4px; }
.defuse p { font-family: var(--serif); letter-spacing: 0; line-height: 1.45; animation: recede 1s var(--ease) both; transform-origin: 0 50%; }
.defuse .dim { color: var(--muted); }
.defuse-1 { font-size: 22px; color: var(--ink); }
.defuse-2 { font-size: 18.5px; color: var(--ink-2); animation-delay: .5s !important; }
.defuse-3 { font-size: 16px; color: var(--muted); animation-delay: 1s !important; }
@keyframes recede { from { opacity: 0; transform: translateZ(40px) translateY(8px); filter: blur(3px); } }

.stream { position: relative; height: 92px; margin-top: 12px; border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, var(--sky-soft), transparent 120%), var(--surface); border: 1px solid var(--line); }
.stream::before, .stream::after { content: ""; position: absolute; left: -50%; right: -50%; height: 1px; background: repeating-linear-gradient(90deg, transparent 0 18px, var(--sky) 18px 34px); opacity: .25; animation: current 6s linear infinite; }
.stream::before { top: 30%; }
.stream::after { top: 72%; animation-duration: 9s; }
@keyframes current { to { transform: translateX(34px); } }
.leaf { position: absolute; left: 16px; top: 50%; max-width: 70%; transform: translateY(-50%); padding: 8px 14px 8px 30px; border-radius: 4px 999px 999px 999px; background: var(--sage-soft); border: 1px solid color-mix(in srgb, var(--sage) 30%, transparent); color: var(--ink-2); font: italic 14px var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .25); }
.leaf::before { content: ""; position: absolute; left: 10px; top: 50%; width: 12px; height: 2px; background: var(--sage); border-radius: 1px; transform: rotate(-30deg); opacity: .7; }
.leaf.drift { animation: drift 5.5s cubic-bezier(.45, .05, .55, .95) both; }
@keyframes drift {
  0% { transform: translate(0, -50%) rotate(0); opacity: 1; }
  25% { transform: translate(25vw, -64%) rotate(5deg); }
  50% { transform: translate(50vw, -40%) rotate(-4deg); opacity: .85; }
  80% { transform: translate(80vw, -60%) rotate(6deg); opacity: 0; }
  81% { transform: translate(-60vw, -50%) rotate(0); opacity: 0; }
  100% { transform: translate(0, -50%) rotate(0); opacity: .55; }
}

.breath.small { width: 150px; height: 150px; margin: 22px auto 16px; }
.breath.small .core { width: 64px; height: 64px; }

.observer { position: relative; height: 150px; margin: 4px 0 14px; display: grid; place-items: center; }
.observer-ring { position: absolute; width: 130px; height: 130px; border-radius: 50%; border: 1px dashed var(--line-2); animation: orbit 24s linear infinite; }
.observer-ring + .observer-ring { width: 84px; height: 84px; animation-duration: 16s; animation-direction: reverse; }
.observer-ring::after { content: ""; position: absolute; top: -4px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--muted); opacity: .6; }
.observer-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 24px var(--glow), 0 0 0 6px var(--accent-soft); }
.observer em { position: absolute; bottom: 0; font: 500 10.5px var(--mono); font-style: normal; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
@keyframes orbit { to { transform: rotate(360deg); } }

.before-after { display: flex; align-items: flex-end; justify-content: center; gap: 22px; margin: 22px 0 6px; }
.before-after .arrow { font-size: 22px; color: var(--muted); margin-bottom: 26px; }
.meter { display: grid; justify-items: center; gap: 8px; }
.meter i { position: relative; width: 26px; height: 110px; border-radius: 13px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.meter i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--v) * 10%); border-radius: 13px; background: var(--muted); animation: fill-up 1.2s var(--ease) both; }
.meter.after i::after { background: linear-gradient(var(--accent), #ffcf8f); box-shadow: 0 0 14px var(--glow); animation-delay: .5s; }
.meter b { font-size: 18px; }
@keyframes fill-up { from { height: 0; } }
.leaf-done { width: 74px; height: 74px; margin: 0 auto 18px; color: var(--sage); animation: settle 1.6s var(--ease) both; }
.leaf-done .ico, .leaf-done svg { width: 100%; height: 100%; }
.leaf-done svg { fill: var(--sage-soft); stroke: var(--sage); stroke-width: 1.2; }
@keyframes settle { 0% { transform: translate(-30px, -60px) rotate(-30deg); opacity: 0; } 60% { transform: translate(6px, 4px) rotate(8deg); opacity: 1; } 100% { transform: none; } }

.act-hero { overflow: hidden; }
.act-hero::before { content: ""; position: absolute; right: -50px; top: -50px; width: 170px; height: 170px; background: radial-gradient(closest-side, var(--sage-soft), transparent); pointer-events: none; }
.act-hero .eyebrow { color: var(--sage); }
.act-hero h3 { font-size: 24px; margin: 8px 0 6px; }
.act-path { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; font-size: 11px; color: var(--ink-2); }
.act-path .sep { color: var(--muted); }
.todo { padding: 4px 16px; }
.todo-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.todo-row:first-child { border-top: 0; }
.todo-row input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }
.todo-row b { display: block; font-weight: 550; font-size: 15px; }
.todo-row small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.todo-row input:checked + span b { text-decoration: line-through; color: var(--muted); }
.chip.story { font-family: var(--serif); font-style: italic; }
.entry-head .kind-thought { color: var(--sage); }
.entry-head .delta { margin-left: auto; color: var(--muted); }
.entry-head .delta.down { color: var(--sage); }

.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.quick { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 12px 11px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--hi), var(--shadow); font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; text-align: left; transition: transform .25s var(--spring); }
.quick .ico { width: 20px; height: 20px; color: var(--ink-2); }
.quick:first-child .ico { color: var(--sage); }
.quick:active { transform: scale(.95); }

/* ---- Geist Pixel Line: used sparingly, for the few numbers and markers worth a second look ---- */
.pixel, .hero .eyebrow, .trace-turn, .up-next > .eyebrow, .ring em, .scale-val, .meter b, .plan-line, .loop-step > .eyebrow {
  font-family: var(--pixel); font-weight: 400; letter-spacing: .06em;
}
.hero .eyebrow, .up-next > .eyebrow, .loop-step > .eyebrow { font-size: 12px; }
.trace-turn { font-size: 12px; }
.ring em { font-size: 14px; }
.scale-val { font-size: 26px; }
.meter b { font-size: 22px; }
/* Toasts clear the quick-capture bar on the Journal. */
#app:has(.composer) ~ #toasts { bottom: calc(var(--dock) + 84px); }

/* ---- Streak fire: flames behind frosted glass ---------------------------------------- */
#fire { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.4s var(--ease); }
html[data-fire] #fire { opacity: 1; }
#fire.nogl { background: radial-gradient(120% 40% at 50% 105%, rgba(255, 120, 30, .75), rgba(255, 70, 10, .25) 55%, transparent 75%); }
html[data-fire="2"] #fire.nogl { background-size: 100% 180%; background-position: bottom; }
html[data-fire="3"] #fire.nogl, html[data-fire="4"] #fire.nogl { background: radial-gradient(130% 90% at 50% 110%, rgba(255, 150, 40, .85), rgba(255, 70, 10, .35) 55%, transparent 80%); }
.fire-glass {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.4s var(--ease);
  backdrop-filter: blur(9px) saturate(1.3); -webkit-backdrop-filter: blur(9px) saturate(1.3);
  background:
    linear-gradient(115deg, transparent 28%, rgba(255, 255, 255, .07) 36%, transparent 44%, transparent 58%, rgba(255, 255, 255, .045) 62%, transparent 68%),
    linear-gradient(180deg, transparent 55%, rgba(255, 255, 255, .03));
  box-shadow: inset 0 0 80px rgba(0, 0, 0, .25);
}
html[data-fire] .fire-glass { opacity: 1; }
#view { z-index: 1; }
/* Surfaces turn to glass too, so the fire glows through them. */
html[data-fire] :is(.card, .entry, .root-card, .lib-card, .quick, .q-row, .set-card, .linked-list button, .trace-row.filled, .search input, .action-list button, .plan-pick button) {
  background-color: color-mix(in srgb, var(--surface) 74%, transparent);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
html[data-fire="4"] #app::before { opacity: .95; }

.streak { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.streak-num { font-family: var(--pixel); font-size: 40px; line-height: 1; min-width: 1.4ch; color: var(--ink); }
.streak.lit .streak-num { color: var(--accent); text-shadow: 0 0 18px var(--glow); }
.streak b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.streak small { display: block; color: var(--muted); font-size: 12px; font-family: var(--mono); margin-top: 2px; }
.tier-pips { margin-left: auto; display: flex; gap: 5px; align-items: flex-end; }
.tier-pips i { width: 7px; border-radius: 3px; background: var(--surface-3); }
.tier-pips i:nth-child(1) { height: 10px; } .tier-pips i:nth-child(2) { height: 15px; } .tier-pips i:nth-child(3) { height: 21px; } .tier-pips i:nth-child(4) { height: 28px; }
.tier-pips i.on { background: linear-gradient(var(--accent), #ff7a2a); box-shadow: 0 0 8px var(--glow); }
.preview-row { display: flex; gap: 6px; }
.preview-row .btn { min-width: 44px; padding: 0 10px; font-family: var(--pixel); letter-spacing: .04em; }

/* Higher levels get a tinted pane, so text over open glass stays readable. */
:root { --fire-scrim: rgba(250, 248, 244, .34); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --fire-scrim: rgba(12, 10, 8, .34); } }
:root[data-theme="dark"] { --fire-scrim: rgba(12, 10, 8, .34); }
html[data-fire="3"] .fire-glass, html[data-fire="4"] .fire-glass { background-color: var(--fire-scrim); }
html[data-fire="4"] .fire-glass { box-shadow: inset 0 0 120px rgba(0, 0, 0, .35); }
html[data-fire] :is(.section > .eyebrow, .topbar .sub, .topbar h1 .dim, .rhythm-note) { text-shadow: 0 1px 10px var(--bg), 0 0 2px var(--bg); }

/* ---- Clean black: neutral surfaces; colour lives in the icons ------------------------ */
#app::before { display: none; }
.hero {
  color: #f5f5f5; background: linear-gradient(180deg, #161616, #090909);
  border: 1px solid rgba(255, 255, 255, .09); box-shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 30px 60px -24px rgba(0, 0, 0, .6);
}
.hero::after { background: radial-gradient(420px circle at var(--mx, 70%) var(--my, 0%), rgba(255, 255, 255, .05), transparent 45%); }
.hero .eyebrow { color: rgba(255, 255, 255, .5); }
.hero .hint { color: rgba(255, 255, 255, .62); }
.hero .flame-bg::before { background: radial-gradient(closest-side, rgba(255, 176, 32, .32), transparent); }
.hero .flame-bg svg { fill: #ffb020; filter: drop-shadow(0 0 12px rgba(255, 176, 32, .5)); }
.hero .btn.primary { background: #ffffff; border-color: #ffffff; color: #000000; box-shadow: 0 10px 26px -10px rgba(255, 255, 255, .3); }
.hero .btn { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .1); color: #f5f5f5; }
.hero .btn.ghost { background: transparent; border-color: transparent; color: rgba(255, 255, 255, .72); }
.hero.done { background: linear-gradient(180deg, #111a14, #090909); }
.plan-line { color: rgba(255, 255, 255, .45); }
.bar { background: rgba(255, 255, 255, .1); }
.bar > i { background: #ffffff; box-shadow: none; }
.toast button { color: #ffb020; }
.empty-mark { box-shadow: var(--hi); }

/* Each tab has its own colour. */
#tabs button[data-tab="today"] { --c: var(--accent); }
#tabs button[data-tab="word"] { --c: var(--sky); }
#tabs button[data-tab="roots"] { --c: var(--sage); }
#tabs button[data-tab="map"] { --c: var(--violet); }
#tabs button[data-tab="journal"] { --c: var(--rose); }
#tabs button svg, #tabs button.on[data-tab="today"] svg { color: var(--c); opacity: .62; filter: none; }
#tabs button.on svg, #tabs button.on[data-tab="today"] svg { opacity: 1; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c) 50%, transparent)); }
#tabs button.on { color: var(--ink); }

.quick:nth-child(1) .ico { color: var(--sage); }
.quick:nth-child(2) .ico { color: var(--rose); }
.quick:nth-child(3) .ico { color: var(--sky); }
.entry-head .kind-struggle { color: var(--violet); }
.action-list .ico { color: var(--sky); }
.cmd-row .ico { color: var(--sky); }
.topbar-actions .icon-btn:first-child .ico { color: var(--sky); }

/* ---- Scripture layout: one verse per row, number in the gutter, poetry keeps its lines ---- */
.scripture { font-size: 18px; line-height: 1.72; max-width: 33em; margin: 6px auto 0; padding: 0 10px 0 2px; }
.scripture .v {
  display: grid; grid-template-columns: 2.2em 1fr; column-gap: .55em; align-items: baseline;
  margin: 0 -8px; padding: 5px 10px 5px 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(var(--mark), var(--mark)) no-repeat 0 0 / 0% 100%; transition: background-size .45s var(--ease);
}
.scripture .v + .v { margin-top: 4px; }
.scripture .v .vn { font: 500 10.5px/1 var(--mono); color: var(--sky); text-align: right; letter-spacing: 0; user-select: none; transform: translateY(-.15em); }
.scripture .v .vt .l { display: block; }
.scripture .v .vt.poem .l + .l { padding-left: 1.3em; }
.scripture .v .vt.poem { padding-bottom: 2px; }
.scripture .v.marked, .scripture .v.flash { background-size: 100% 100%; }
.scripture .v.noted .vt { text-decoration: underline dotted var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.scripture .v.noted { text-decoration: none; }
.scripture .v sup { display: none; }
.scripture.reveal .w { display: inline; animation: word-in .7s var(--ease) both; animation-delay: calc(var(--w) * 12ms); }
#view[data-view="word"] .scripture { padding-top: 6px; }
.translation { text-align: center; }
@media (min-width: 720px) { .scripture { font-size: 19px; } }

/* ---- Six tabs, segmented controls of any width ------------------------------------------ */
:root { --teal: #0d9488; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --teal: #2dd4bf; } }
:root[data-theme="dark"] { --teal: #2dd4bf; }
#tabs { grid-template-columns: repeat(var(--tabs-n, 6), 1fr); width: min(calc(100% - 20px), 520px); padding: 5px; }
.tab-ind { left: 5px; top: 5px; bottom: 5px; width: calc((100% - 10px) / var(--tabs-n, 6)); }
#tabs button[hidden] { display: none; }
#tabs.off-menu .tab-ind { opacity: 0; }
#tabs button { font-size: 10px; letter-spacing: 0; }
#tabs svg { width: 22px; height: 22px; }
#tabs button[data-tab="hfc"] { --c: var(--teal); }
.seg-tabs { grid-template-columns: repeat(var(--n, 2), 1fr); }
.seg-ind { width: calc((100% - 8px) / var(--n, 2)); }
.seg-tabs button { padding: 9px 4px; font-size: 13.5px; }

/* ---- HFC ------------------------------------------------------------------------------- */
.hfc-card { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--hi), var(--shadow); transition: transform .25s var(--spring), border-color .2s; }
.hfc-card + .hfc-card { margin-top: 10px; }
.hfc-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.hfc-card:active { transform: scale(.985); }
#view.enter .hfc-card { animation: rise .6s var(--ease) both; animation-delay: calc(.12s + var(--i, 0) * 40ms); }
.hfc-card-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.hfc-card-head .spk { margin-left: auto; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-weight: 550; }
.kind { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; }
.kind.gospel { color: var(--teal); background: color-mix(in srgb, var(--teal) 13%, transparent); }
.kind.study { color: var(--violet); background: var(--violet-soft); }
.hfc-card h3 { font-size: 19px; margin: 10px 0 6px; letter-spacing: -.02em; }
.hfc-card p { color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.hfc-card .chips { margin-top: 12px; gap: 5px; align-items: center; }
.hfc-card .more { font-size: 11px; color: var(--muted); }

.hfc-msg .hub-head h1 { font-size: 34px; }
.hfc-msg .hub-top .btn { gap: 6px; }
.hfc-msg .hub-top .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.hfc-summary { font-family: var(--serif); font-size: 18.5px; line-height: 1.6; letter-spacing: 0; margin-top: 14px; color: var(--ink); }
.kp { list-style: none; counter-reset: kp; margin: 0; padding: 0; display: grid; gap: 8px; }
.kp li { counter-increment: kp; display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--hi); }
.kp li::before { content: counter(kp, decimal-leading-zero); font: 400 13px var(--pixel); color: var(--teal); padding-top: 2px; }
.kp b { display: block; font-size: 15.5px; letter-spacing: -.015em; }
.kp p { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; margin-top: 4px; }
.ts { font: 500 11.5px var(--mono); color: var(--sky); text-decoration: none; padding: 3px 7px; border-radius: 7px; background: var(--sky-soft); white-space: nowrap; }
.ref-list { display: grid; gap: 6px; }
.ref-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline; width: 100%; text-align: left; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--hi); transition: transform .2s var(--spring); }
.ref-row:active { transform: scale(.98); }
.ref-row b { font-size: 13.5px; color: var(--sky); white-space: nowrap; }
.ref-row span { font-size: 14px; color: var(--ink-2); line-height: 1.4; min-width: 0; }
.ref-row .muted { font-size: 11px; }
.badge { font-size: 11px; color: var(--teal); background: color-mix(in srgb, var(--teal) 13%, transparent); padding: 2px 6px; border-radius: 6px; }
.book-group { margin-top: 22px; }
.hfc-quote { margin: 0 0 10px; padding: 14px 16px 12px 18px; border-left: 2px solid var(--teal); background: var(--surface); border-radius: 0 14px 14px 0; }
.hfc-quote p { font-family: var(--serif); font-size: 18px; line-height: 1.5; letter-spacing: 0; }
.hfc-quote .ts { display: inline-block; margin-top: 8px; }
.reflect { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; font-size: 15.5px; line-height: 1.45; }
.theme-bars { display: grid; gap: 6px; }
.theme-bar { display: grid; grid-template-columns: 9.5em 1fr 2em; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--hi); transition: transform .2s var(--spring); }
.theme-bar:active { transform: scale(.98); }
.tb-name { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.tb-track i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.theme-bar .mono { text-align: right; color: var(--muted); font-size: 12px; }
.hfc-map { position: relative; height: calc(100dvh - var(--safe-t) - var(--dock) - 205px); min-height: 340px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--hi), var(--shadow); }
.hfc-map .map-wrap { position: absolute; inset: 0; }
.map-wrap.compact .map-ui { padding: 12px 12px 0; }
.map-wrap.compact .map-controls { bottom: 12px; right: 10px; }
.map-wrap.compact .map-legend { bottom: 14px; left: 14px; }
.tpl-picker { margin: -4px 0 14px; }
.tpl-picker .chips.scroll { padding-bottom: 2px; }
.tpl-sec > span { color: var(--sky); }
.tpl-sec textarea { min-height: 64px; }
.tpl-group { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; margin-top: 8px; }
.tpl-group > .mono { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tpl-group .chips.scroll { margin: 0; padding: 2px 0 4px; mask-image: none; }
.tpl-picker a { color: var(--sky); }

/* ---- Today: check-in, flow, review, capacity --------------------------------------------- */
:root { --red: #e5484d; --red-soft: rgba(229, 72, 77, .1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --red: #ff6369; --red-soft: rgba(255, 99, 105, .12); } }
:root[data-theme="dark"] { --red: #ff6369; --red-soft: rgba(255, 99, 105, .12); }
.rag-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--surface-3); display: inline-block; }
.rag-dot.red { background: var(--red); box-shadow: 0 0 10px color-mix(in srgb, var(--red) 55%, transparent); }
.rag-dot.amber { background: var(--accent); box-shadow: 0 0 10px var(--glow); }
.rag-dot.green { background: var(--sage); box-shadow: 0 0 10px color-mix(in srgb, var(--sage) 50%, transparent); }

.checkin h2 { font-size: 24px; margin: 8px 0 6px; }
.rag-pick { display: grid; gap: 8px; margin-top: 16px; }
.rag-btn { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; text-align: left; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface-2); transition: transform .25s var(--spring), border-color .2s, background .2s; }
.rag-btn:active { transform: scale(.97); }
.rag-btn b { font-size: 16px; letter-spacing: -.015em; }
.rag-btn small { grid-column: 2; color: var(--muted); font-size: 13px; }
.rag-btn.red:hover, .rag-btn.red.on { border-color: var(--red); background: var(--red-soft); }
.rag-btn.amber:hover, .rag-btn.amber.on { border-color: var(--accent); background: var(--accent-soft); }
.rag-btn.green:hover, .rag-btn.green.on { border-color: var(--sage); background: var(--sage-soft); }
.rag-pick.small { grid-template-columns: repeat(3, 1fr); margin-top: 0; gap: 6px; }
.rag-pick.small .rag-btn { grid-template-columns: auto 1fr; padding: 10px; column-gap: 8px; }
.rag-pick.small .rag-btn b { font-size: 13px; line-height: 1.2; }
.checkin.compact { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.checkin.compact > div { flex: 1; min-width: 0; }
.checkin.compact b { display: block; font-size: 15.5px; }
.checkin.compact small { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.checkin-more { margin-top: 16px; }
.checkin-more > .eyebrow { margin-bottom: 8px; }
.checkin-more input { margin-top: 12px; }
.dim-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14.5px; font-weight: 550; }
.dim-pick { display: flex; gap: 8px; }
.dim-pick button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; background: var(--surface-2); position: relative; transition: transform .2s var(--spring); }
.dim-pick button::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; opacity: .45; }
.dim-pick button.red::after { background: var(--red); } .dim-pick button.amber::after { background: var(--accent); } .dim-pick button.green::after { background: var(--sage); }
.dim-pick button.on { transform: scale(1.1); }
.dim-pick button.on::after { opacity: 1; inset: 5px; }
.dim-pick button.red.on { border-color: var(--red); } .dim-pick button.amber.on { border-color: var(--accent); } .dim-pick button.green.on { border-color: var(--sage); }

.flow { padding: 18px 16px 14px; overflow: hidden; }
.flow::before { content: ""; position: absolute; right: -70px; top: -70px; width: 200px; height: 200px; border-radius: 50%; pointer-events: none; opacity: .5; }
.flow.red::before { background: radial-gradient(closest-side, var(--red-soft), transparent); }
.flow.amber::before { background: radial-gradient(closest-side, var(--accent-soft), transparent); }
.flow.green::before { background: radial-gradient(closest-side, var(--sage-soft), transparent); }
.flow-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.flow.red .flow-head .eyebrow { color: var(--red); } .flow.amber .flow-head .eyebrow { color: var(--accent); } .flow.green .flow-head .eyebrow { color: var(--sage); }
.flow-lede { font-family: var(--serif); font-size: 17px; line-height: 1.45; margin-top: 6px; letter-spacing: 0; }
.flow-count { font-family: var(--pixel); font-size: 18px; color: var(--ink-2); }
.flow-bar { display: flex; gap: 4px; margin: 14px 0 6px; }
.flow-bar i { flex: 1; height: 3px; border-radius: 2px; background: var(--surface-3); transition: background .4s; }
.flow.red .flow-bar i.on { background: var(--red); } .flow.amber .flow-bar i.on { background: var(--accent); } .flow.green .flow-bar i.on { background: var(--sage); }
.steps { display: grid; margin-top: 4px; }
.step { display: grid; grid-template-columns: 34px 1fr 16px; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px 2px; border: 0; border-top: 1px solid var(--line); background: none; transition: opacity .2s; }
.step:first-child { border-top: 0; }
.step > .ico { width: 16px; height: 16px; color: var(--muted); }
.step-check { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.step-check .ico { width: 17px; height: 17px; }
.step.done .step-check { background: var(--c); color: var(--bg); }
.step-text b { display: block; font-size: 15.5px; letter-spacing: -.015em; }
.step-text small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.done .step-text b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.flow-done { font-family: var(--serif); font-size: 17px; text-align: center; padding: 10px 0 4px; color: var(--ink-2); }
.flow-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.flow-switch button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 4px 10px 4px 7px; font-size: 12.5px; font-weight: 550; }
.flow-switch .rag-dot { width: 8px; height: 8px; box-shadow: none; }

.review-card { display: flex; align-items: center; gap: 14px; }
.review-card > div { flex: 1; min-width: 0; }
.review-card b { display: block; font-size: 16px; }
.review-card small { display: block; font-size: 13px; margin-top: 2px; }

.capacity { padding: 16px; }
.cap-grid { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.cap-cell { aspect-ratio: 1; border-radius: 4px; border: 0; padding: 0; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.cap-cell.red { background: var(--red); } .cap-cell.amber { background: var(--accent); } .cap-cell.green { background: var(--sage); }
.cap-cell.today { outline: 1.5px solid var(--ink); outline-offset: 1.5px; }
#view.enter .cap-cell { animation: pop .45s var(--spring) both; }
.cap-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.cap-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cap-legend .rag-dot { width: 8px; height: 8px; box-shadow: none; }

.breath-left { text-align: center; color: var(--muted); font-size: 13px; }
.verse-preview.big { font-size: 20px; line-height: 1.6; }
.pray-lines { display: grid; gap: 8px; }
.pray-line { text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-family: var(--serif); font-size: 18px; letter-spacing: 0; transition: transform .2s var(--spring); }
.pray-line:active { transform: scale(.98); }
.pray-big { font-family: var(--serif); font-size: 26px; line-height: 1.4; text-align: center; padding: 30px 8px 6px; letter-spacing: 0; animation: rise .6s var(--ease); }

/* Review: a card that flips in 3D. */
.review-step { align-items: stretch; }
.flashcard { position: relative; margin-top: 18px; min-height: 300px; border: 0; padding: 0; background: none; perspective: 1200px; text-align: left; }
.fc-inner { position: relative; width: 100%; min-height: 300px; transform-style: preserve-3d; transition: transform .7s var(--ease); }
.flashcard.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; padding: 24px 22px; border-radius: 24px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--hi), var(--shadow-lg); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fc-face p { font-family: var(--serif); font-size: 21px; line-height: 1.5; letter-spacing: 0; }
.fc-front small { margin-top: auto; font-size: 12.5px; }
.fc-back { transform: rotateY(180deg); background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.fc-back .eyebrow { color: var(--violet); }
.grades { display: grid; grid-template-columns: 1fr 1.4fr 1fr; }
.grades .btn { min-height: 52px; }
.review-done { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--violet-soft); color: var(--violet); }
.review-done .ico, .review-done svg { width: 34px; height: 34px; }
.kp-side { display: grid; justify-items: end; gap: 8px; }
.kp-add { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--violet); font-weight: 700; line-height: 1; }

/* ---- Study ------------------------------------------------------------------------------- */
.word-top { padding: calc(var(--safe-t) + 12px) 0 6px; }
.word-top .seg-tabs { margin: 0; }
#view[data-view="word"] .reader-bar { padding-top: 8px; }
.ring .fill.study { stroke: var(--sky); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--sky) 50%, transparent)); }
.study-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; text-align: left; padding: 16px 18px; border: 1px solid var(--line); background: var(--surface); border-radius: 22px; box-shadow: var(--hi), var(--shadow); transition: transform .3s var(--spring), border-color .2s; }
.study-card + .study-card { margin-top: 10px; }
.study-card:active { transform: scale(.985); }
.study-card .eyebrow { color: var(--sky); }
.study-card h3 { font-size: 24px; margin: 6px 0 4px; }
.study-card small { display: block; font-size: 13.5px; }
#view.enter .study-card { animation: rise .6s var(--ease) both; animation-delay: calc(.1s + var(--i, 0) * 40ms); }
.study-intro h3 { font-size: 22px; margin: 8px 0 6px; }
.study-progress { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.study-progress b { display: block; font-size: 15.5px; }
.study-progress small { display: block; font-size: 13px; margin-top: 2px; }
.facts { display: grid; gap: 0; padding: 4px 16px; }
.fact { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.fact:first-child { border-top: 0; }
.fact > span { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--sky); padding-top: 3px; }
.fact p { font-size: 15px; line-height: 1.5; color: var(--ink); }
.facts label.field:first-child { margin-top: 8px; }
.facts label.field:last-child { margin-bottom: 12px; }
.outline { display: grid; gap: 6px; }
.outline-row { display: grid; grid-template-columns: 82px 1fr; gap: 12px; align-items: baseline; text-align: left; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--hi); transition: transform .2s var(--spring); }
.outline-row:active { transform: scale(.98); }
.outline-row .mono { font-size: 12.5px; color: var(--sky); }
.outline-row span:last-child { font-size: 15px; font-weight: 550; letter-spacing: -.01em; }
.study-prose { font-family: var(--serif); font-size: 17.5px; line-height: 1.6; letter-spacing: 0; }
.watch { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.chapter-list { display: grid; gap: 4px; }
.chapter-row { display: grid; grid-template-columns: 34px 1fr 22px; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: transform .2s var(--spring); }
.chapter-row:active { transform: scale(.98); }
.chapter-row .cn { font: 400 15px var(--pixel); color: var(--muted); text-align: center; }
.chapter-row .ct { font-size: 15px; letter-spacing: -.01em; }
.chapter-row .cs { display: grid; place-items: center; color: var(--sky); }
.chapter-row .cs .ico { width: 16px; height: 16px; }
.chapter-row .cs .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sky); opacity: .6; }
.chapter-row.done .cn { color: var(--sky); }
.chapter-row.done .ct { color: var(--muted); }
.study-text { padding-left: 0; }
.key-verse { margin-top: 14px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line-2); }
.key-verse p:not(.muted) { font-family: var(--serif); font-size: 17.5px; line-height: 1.55; letter-spacing: 0; margin-top: 6px; }
.key-verse sup { font: 600 10px var(--mono); color: var(--sky); margin-right: 4px; }
.key-verse .eyebrow { color: var(--accent); }
.study-part h3 { font-size: 19px; margin: 6px 0 8px; }
.study-part .prompts { margin: 0 0 12px; padding-left: 1.1em; display: grid; gap: 3px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.study-part.observe .eyebrow { color: var(--sky); }
.study-part.interpret .eyebrow { color: var(--violet); }
.study-part.apply .eyebrow { color: var(--sage); }
.study-part.prayer .eyebrow { color: var(--rose); }
.study-part.sum .eyebrow { color: var(--accent); }
.study-foot { margin-top: 24px; padding-bottom: 8px; }

/* ---- Geist as the reading face ----------------------------------------------------------- */
/* Geist sets larger than the old book serif, so reading sizes come down a touch and lines open up. */
.scripture { font-size: 17px; line-height: 1.78; letter-spacing: -.003em; font-weight: 400; }
.scripture .v .vn { transform: translateY(-.05em); }
@media (min-width: 720px) { .scripture { font-size: 18px; } }
textarea { font-size: 16.5px; line-height: 1.6; letter-spacing: -.003em; }
.verse-preview, .marked-quote, .prose, .hfc-summary, .study-prose, .carry, .remember q { letter-spacing: -.005em; }
.verse-preview { font-size: 17px; }
.verse-preview.big { font-size: 19px; }
.marked-quote, .prose, .hfc-quote p, .key-verse p:not(.muted) { font-size: 16.5px; }
.lede.prompt, .flow-lede, .fc-face p, .pray-big, .defuse p { letter-spacing: -.01em; }
.fc-face p { font-size: 20px; }
.pray-big { font-size: 24px; }

/* ---- Map v2: layers, peek card, full screen --------------------------------------------- */
.map-toggles { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 55%; }
.map-toggles .chip { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.map-title { display: flex; align-items: flex-start; gap: 8px; }
.map-title .icon-btn { margin: 2px 0 0 -6px; background: var(--surface); border: 1px solid var(--line); border-radius: 50%; width: 40px; height: 40px; }
.map-peek {
  position: absolute; left: 12px; right: 12px; bottom: calc(var(--dock) + 12px); z-index: 3; max-width: 520px; margin: 0 auto;
  padding: 14px 14px 12px; border-radius: 20px; border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: var(--hi), var(--shadow-lg); transform: translateY(14px); opacity: 0; pointer-events: none; transition: transform .35s var(--spring), opacity .25s;
}
.map-wrap.has-peek .map-peek { transform: none; opacity: 1; pointer-events: auto; }
.map-wrap.has-peek .map-legend { opacity: 0; }
.map-wrap.has-peek .map-controls { bottom: calc(var(--dock) + 200px); }
.peek-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; }
.peek-head b { display: block; font-size: 17px; letter-spacing: -.02em; line-height: 1.25; margin-top: 2px; }
.peek-head small { display: block; font-size: 12.5px; margin-top: 2px; }
.peek-head .icon-btn { width: 32px; height: 32px; margin: -4px -4px 0 0; }
.peek-head .icon-btn .ico { width: 16px; height: 16px; }
.peek-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; box-shadow: 0 0 10px currentColor; }
.peek-links { margin-top: 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.peek-links::-webkit-scrollbar { display: none; }
.peek-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.peek-actions .btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.map-wrap.compact .map-peek { bottom: 12px; }
.map-wrap.compact.has-peek .map-controls { bottom: 200px; }
.map-wrap.full .map-peek { bottom: calc(var(--safe-b) + 16px); }
.map-wrap.full .map-controls { bottom: calc(var(--safe-b) + 18px); }
.map-wrap.full.has-peek .map-controls { bottom: calc(var(--safe-b) + 210px); }
.map-wrap.full .map-legend { bottom: calc(var(--safe-b) + 22px); }
.map-stage { position: fixed; inset: 0; background: var(--bg); }
.map-stage .map-wrap { position: absolute; inset: 0; }
.map-controls .expand { color: var(--teal); }

/* ---- Titles wrap instead of running off the screen ---------------------------------------- */
textarea.title-input { min-height: 0 !important; height: auto; overflow: hidden; resize: none; font: 620 21px/1.3 var(--sans) !important; letter-spacing: -.02em !important; padding: 4px 0 12px !important; }
textarea.title-input::placeholder { font-weight: 500; }

/* ---- Review cards: fill the gap ------------------------------------------------------------- */
.cloze { line-height: 1.75; }
.cloze .gap { display: inline-block; height: 1.05em; vertical-align: -0.15em; border-bottom: 2px solid var(--violet); border-radius: 2px; background: var(--violet-soft); margin: 0 1px; }
.cloze mark { background: var(--violet-soft); color: var(--ink); font-weight: 650; padding: 0 3px; border-radius: 4px; box-shadow: inset 0 -2px 0 var(--violet); }
.fc-ref { display: block; font: 600 13px var(--mono); color: var(--sky); }
.fc-face .cloze { font-size: 19px; }
.fc-note { display: block; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.composer-card .seg-tabs { margin: 0 0 14px; }
.composer-card .seg-tabs button:disabled { opacity: .35; }
.word-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.word-pick button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 9px; padding: 6px 9px; font-size: 15px; transition: transform .15s var(--spring), background .15s; }
.word-pick button:active { transform: scale(.94); }
.word-pick button.on { background: var(--violet); border-color: var(--violet); color: #fff; }
.card-preview { padding: 16px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--hi); }
.card-preview .eyebrow { color: var(--sky); margin-bottom: 4px; }
.card-preview .cloze { font-size: 17px; }
.card-list { display: grid; gap: 6px; }
.card-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; padding: 12px 6px 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.card-row p { font-size: 15px; line-height: 1.5; }
.card-row small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.card-row .icon-btn { width: 34px; height: 34px; color: var(--muted); }
.review-card .btn.ghost { margin-right: -4px; }
.kp-add { display: grid; place-items: center; color: var(--violet); }
.kp-add .ico { width: 14px; height: 14px; }

/* Settings rows wrap: a wide control (Export / Import) drops under its label instead of pushing off-screen. */
.set-row { flex-wrap: wrap; }
.set-row > div:first-child { flex: 1 1 190px; }
.set-row > :last-child:not(:first-child) { margin-left: auto; }
.set-row .row { flex-wrap: wrap; justify-content: flex-end; }
.sheet-body { overflow-x: hidden; }

/* Section headings (BSB) */
.scripture .pericope { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px calc(2.2em + .55em); }
.scripture .pericope:first-child { margin-top: 4px; }

/* ---- Calm breathing: the light eases in and out; words fade, never flash ------------------- */
.breath.zen .ring, .breath.zen .core, .breath.zen::before, .breath.zen::after { animation: none; }
.breath.zen::before, .breath.zen::after { display: none; }
.breath.zen .ring { transform: scale(.6); opacity: .7; transition: transform var(--dur, 4s) cubic-bezier(.45, 0, .55, 1), opacity var(--dur, 4s) ease-in-out; }
.breath.zen .core { transform: scale(.8); transition: transform var(--dur, 4s) cubic-bezier(.45, 0, .55, 1), box-shadow var(--dur, 4s) ease-in-out; }
.breath.zen[data-phase="in"] .ring { transform: scale(1.02); opacity: 1; }
.breath.zen[data-phase="in"] .core { transform: scale(1.14); box-shadow: 0 0 80px var(--glow), 0 20px 40px -10px rgba(120, 50, 0, .45), inset -12px -16px 30px rgba(60, 20, 0, .3); }
.breath.zen .cue { transition: opacity .7s ease; letter-spacing: .18em; color: var(--muted); }
.breath.zen .cue.fade { opacity: 0; }
.breath-tools { display: flex; justify-content: center; margin-top: 46px; }
.sound-toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 7px 14px 7px 11px; font-size: 13px; font-weight: 550; }
.sound-toggle .ico { width: 17px; height: 17px; }
.breath-left { margin-top: 14px; }
@media (prefers-reduced-motion: reduce) {
  .breath.zen .ring, .breath.zen .core { transition: none; }
}

/* ---- Red-day care: prayer space and kind things --------------------------------------------- */
.pray-own { margin-top: 4px; min-height: 120px; }
.kind-group { margin-top: 18px; }
.kind-group:first-of-type { margin-top: 4px; }
.kind-group > .eyebrow { margin: 0 2px 8px; }
.kind-item { display: block; width: 100%; text-align: left; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--hi); transition: transform .2s var(--spring), border-color .2s; }
.kind-item + .kind-item { margin-top: 6px; }
.kind-item:active { transform: scale(.98); }
.kind-item b { display: block; font-size: 15.5px; letter-spacing: -.015em; }
.kind-item small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.45; margin-top: 3px; }
.kind-group:first-of-type .kind-item { border-color: color-mix(in srgb, var(--sage) 45%, transparent); }

/* ---- Cards v3: per-verse cards, phrases, scrolling faces, editing --------------------------- */
.fc-face { overflow-y: auto; overscroll-behavior: contain; }
.fc-face .cloze.long, .fc-face p.long { font-size: 16px; line-height: 1.6; }
.verse-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--hi); transition: opacity .2s; }
.verse-card + .verse-card { margin-top: 8px; }
.verse-card.off { opacity: .45; }
.vc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vc-check { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--sky); }
.vc-check input { width: 18px; height: 18px; accent-color: var(--violet); }
.vc-head .prompt-swap { padding: 4px 0; }
.vc-head .prompt-swap::before { content: none; }
.vc-preview { margin-top: 6px; cursor: pointer; }
.vc-preview .cloze { font-size: 15.5px; line-height: 1.65; }
.verse-card .word-pick { margin-bottom: 4px; }
.card-edit { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 0; color: inherit; }

/* ---- HFC message page v2 ---------------------------------------------------------------- */
.hfc-summary { font-size: 16.5px; line-height: 1.65; margin-top: 14px; }
.hfc-summary p + p { margin-top: .75em; }
.kp2 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.kp2-item { padding: 14px 16px 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--hi); }
.kp2-num { font: 400 13px var(--pixel); color: var(--teal); margin-bottom: 6px; }
.kp2-item b { display: block; font-size: 16px; line-height: 1.35; letter-spacing: -.015em; }
.kp2-item p { color: var(--ink-2); font-size: 15px; line-height: 1.55; margin-top: 6px; }
.kp2-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.kp2-act { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px 6px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); font: 550 13px var(--sans); text-decoration: none; }
.kp2-act:first-child { color: var(--sky); font-family: var(--mono); font-size: 12.5px; }
.kp2-act .ico { width: 15px; height: 15px; }
.kp2-act:first-child .ico svg { fill: currentColor; }
.sc-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.sc-row { padding: 13px 15px 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--hi); cursor: pointer; transition: transform .2s var(--spring); }
.sc-row:active { transform: scale(.99); }
.sc-top { display: flex; align-items: center; gap: 8px; }
.sc-top b { font-size: 13.5px; color: var(--sky); white-space: nowrap; }
.sc-key { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-verse { margin-top: 8px; font-size: 15.5px; line-height: 1.6; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.sc-verse sup { font: 600 9.5px var(--mono); color: var(--sky); margin-right: 3px; }
.sc-verse .skeleton { display: block; margin: 6px 0; }
.sc-note { margin-top: 8px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.sc-read { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; border: 0; background: none; padding: 2px 0; color: var(--sky); font: 550 13px var(--sans); }
.sc-read .ico { width: 14px; height: 14px; }
.hfc-foot { margin-top: 26px; align-items: center; }
.hfc-foot .btn { flex: 0 0 auto; }
.hfc-foot .btn.primary { flex: 0 0 auto; min-height: 46px; }

/* ---- HFC map: main themes, the eye, full screen, previews ------------------------------------ */
.map-full { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 2px; padding: 8px 13px 8px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--ink); font: 600 13px var(--sans); box-shadow: var(--hi); }
.map-full .ico { width: 15px; height: 15px; color: var(--teal); }
.map-eye { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--muted); box-shadow: var(--hi); transition: color .2s, border-color .2s; }
.map-eye .ico { width: 19px; height: 19px; }
.map-eye.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.map-toggles { align-items: center; }
.map-peek { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.map-wrap.has-peek .map-controls { bottom: calc(var(--dock) + 24px + var(--peek-h, 188px)); }
.map-wrap.compact.has-peek .map-controls { bottom: calc(24px + var(--peek-h, 188px)); }
.map-wrap.full.has-peek .map-controls { bottom: calc(var(--safe-b) + 28px + var(--peek-h, 188px)); }
.peek-preview { margin-top: 10px; display: grid; gap: 6px; }
.peek-msg { display: grid; gap: 1px; text-align: left; padding: 8px 11px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 60%, transparent); color: var(--ink); }
.peek-msg b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek-msg small { font-size: 12px; color: var(--muted); }
.peek-verse, .peek-sum { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.peek-verse sup { font: 600 9px var(--mono); color: var(--sky); margin-right: 2px; }
.peek-note { font-size: 13px; line-height: 1.45; color: var(--muted); }
.peek-title { font-size: 14px; }
.map-wrap.compact .peek-verse, .map-wrap.compact .peek-sum { -webkit-line-clamp: 2; }
.map-wrap.compact .peek-msg:nth-child(n+3) { display: none; }
.peek-more { font-size: 12px; color: var(--muted); padding: 0 4px; }
.peek-msg { padding: 7px 11px; }

/* ---- Capacity: a simple line over the last 30 days, then short blocks --------------------- */
.cap-grid { gap: 3px; }
.cap-cell { aspect-ratio: 2.4 / 1; border-radius: 3px; }
.cap-cell.future { background: none; box-shadow: inset 0 0 0 1px var(--line); opacity: .5; }
.cap-cell.today { outline-offset: 1px; }
.cap-chart { margin-bottom: 14px; }
.cap-line { display: block; width: 100%; height: 60px; overflow: visible; }
.cap-guide { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.cap-path { fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .75; vector-effect: non-scaling-stroke; }
.cap-pt { stroke-width: 6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.cap-pt.red { stroke: var(--red); } .cap-pt.amber { stroke: var(--accent); } .cap-pt.green { stroke: var(--sage); }
.cap-axis { display: flex; justify-content: space-between; margin-top: 6px; font: 500 10.5px var(--mono); color: var(--muted); }

/* ---- Roots: the Truth step's reading ------------------------------------------------------ */
.truth-read { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.truth-read > .eyebrow { margin: 0 2px 2px; }
.tv { padding: 12px 14px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--hi); cursor: pointer; }
.tv-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tv-head b { font-size: 13px; color: var(--sky); white-space: nowrap; }
.tv-head span { font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-text { margin-top: 6px; font-size: 15.5px; line-height: 1.6; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tv.open .tv-text { display: block; -webkit-line-clamp: unset; }
.tv-text sup { font: 600 9.5px var(--mono); color: var(--sky); margin-right: 3px; }
.tv-text .skeleton { display: block; margin: 6px 0; }
.tv-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.tv-more { font-size: 13px; font-weight: 550; color: var(--sky); }
.tv-more[hidden] { display: none; }
.tv-foot .btn { margin-left: auto; }
.tv-foot .btn:disabled { opacity: .55; }

/* ---- The mark as a watermark: faint, tucked into the top-right corner of Today ------------ */
:root { --bm-top: #8f8f8f; --bm-front: #0a0a0a; --bm-side: #454545; --bm-o: .07; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bm-top: #bdbdbd; --bm-front: #ffffff; --bm-side: #5e5e5e; --bm-o: .1; } }
:root[data-theme="dark"] { --bm-top: #bdbdbd; --bm-front: #ffffff; --bm-side: #5e5e5e; --bm-o: .1; }
/* Flush to the top edge, its right-hand fifth cropped by the screen edge; the crossbar falls below
   the greeting line, so the mark never touches it. Clipped in its own box so nothing scrolls sideways. */
.brandmark { --bm-w: 196px; position: absolute; top: 0; right: 0; z-index: -1; width: calc(var(--bm-w) * .8); height: calc(var(--bm-w) * 1.38); overflow: hidden; opacity: var(--bm-o); pointer-events: none; }
.brandmark svg { position: absolute; top: 0; left: 0; width: var(--bm-w); height: auto; }
.bm-top { fill: var(--bm-top); } .bm-front { fill: var(--bm-front); } .bm-side { fill: var(--bm-side); }
.bm-gap { fill: none; stroke: var(--accent); stroke-linejoin: round; }
/* The check-in card is glass, so the bottom of the watermark cross shows through it. */
.card.checkin { background: color-mix(in srgb, var(--surface) 50%, transparent); }

/* ---- The org slot: a ministry you follow sits apart from your own space ------------------- */
#tabs .org-slot::after { content: ""; position: absolute; inset: 3px 2px; border: 1.5px dotted color-mix(in srgb, var(--muted) 55%, transparent); border-radius: 13px; pointer-events: none; }
#tabs .org-slot[data-add] svg { color: var(--muted); opacity: .9; }
.topbar-actions { align-items: center; }
.topbar-actions .btn.small { margin-right: 6px; }
.btn.following { color: var(--teal); border-style: dotted; }
.org-list { display: grid; gap: 10px; }
.org-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border: 1.5px dotted var(--line-2); border-radius: 16px; }
.org-card b { display: block; font-size: 16px; letter-spacing: -.015em; }
.org-card small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.org-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); color: var(--teal); }
.org-icon .ico { width: 22px; height: 22px; }
.org-more { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* On wider screens the cross throws the balance off; the wordmark takes the corner instead. */
.brandword { display: none; }
.bm-word { fill: var(--bm-front); }
@media (min-width: 720px) {
  .brandmark { display: none; }
  /* Exactly on the top and right edges of the screen (the art is cropped to the letters), scaled with
     the space beside the 640px content column so it never reaches the greeting, and a little stronger
     than the cross. */
  .brandword { display: block; position: absolute; top: 0; right: 0; z-index: -1; width: calc(clamp(150px, 50vw - 362px, 620px) * 1.75); opacity: calc(var(--bm-o) * 1.4); pointer-events: none; }
  .brandword svg { display: block; width: 100%; height: auto; }
}
#tabs .org-slot span { white-space: nowrap; }

/* ---- Welcome: what Everknown is, on a first visit ----------------------------------------- */
.welcome-word { width: 210px; margin: 0 0 16px; }
.welcome-word svg { display: block; width: 100%; height: auto; }
.welcome-lede { font-size: 18px; line-height: 1.45; letter-spacing: -.01em; }
.welcome-private { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.welcome-list { list-style: none; margin: 22px 0; padding: 0; display: grid; gap: 16px; }
.welcome-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; }
.wi-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--c); }
.wi-icon svg, .wi-icon .ico { width: 22px; height: 22px; }
.wi-icon > svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.welcome-item b { display: block; font-size: 15.5px; letter-spacing: -.01em; }
.welcome-item p { color: var(--muted); font-size: 14px; line-height: 1.45; margin-top: 2px; }
.welcome-install { display: grid; gap: 10px; padding: 16px; border: 1.5px dotted var(--line-2); border-radius: 16px; }
.welcome-install h3 { font-size: 17px; letter-spacing: -.015em; }
.welcome-steps { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.welcome-installed { display: flex; align-items: center; gap: 8px; color: var(--sage); font-size: 14px; }

/* ---- Journal: focus, folders and filing ----------------------------------------------------- */
.focus-card { margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--hi); }
.focus-card > .eyebrow { margin: 0 2px 10px; }
.focus-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.focus-item { display: grid; gap: 4px; align-content: start; min-height: 66px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; color: var(--ink); }
.focus-item small { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--rose); }
.focus-item span { font-size: 14px; line-height: 1.35; font-weight: 550; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.focus-item.empty { border-style: dashed; background: none; }
.focus-item.empty span { color: var(--muted); font-weight: 500; }
.focus-last { display: grid; gap: 2px; width: 100%; margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 12px; background: none; text-align: left; color: var(--ink-2); font-size: 14px; }
.focus-last small { color: var(--muted); font-size: 12px; }
.journal-tabs { margin: 14px 0 16px; }
.vault-group { display: grid; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--hi); overflow: hidden; }
.vault-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 13px 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--ink); }
.vault-row:first-child { border-top: 0; }
.vault-row > .ico:last-child { width: 16px; height: 16px; color: var(--muted); }
.vault-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--rose); }
.vault-icon .ico { width: 18px; height: 18px; }
.vault-row.rough .vault-icon { color: var(--accent); }
.vault-text b { display: block; font-size: 15px; letter-spacing: -.01em; }
.vault-text small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 1px; }
.vault-count { font-size: 12.5px; color: var(--muted); }
.vault-eyebrow { display: flex; justify-content: space-between; align-items: center; margin: 22px 2px 10px; }
.vault-eyebrow button { border: 0; background: none; padding: 2px 0; color: var(--rose); font: 600 12.5px var(--sans); letter-spacing: 0; text-transform: none; }
.vault-empty { font-size: 13.5px; color: var(--muted); line-height: 1.5; padding: 4px 2px; }
.place-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.place-head b { font-size: 18px; letter-spacing: -.02em; }
.place-head .mono { color: var(--muted); font-size: 12.5px; }
.place-back { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; padding: 4px 6px 4px 0; color: var(--rose); font: 600 14px var(--sans); }
.place-back .ico { width: 18px; height: 18px; }
.vault-tip { margin-bottom: 12px; padding: 12px 14px; border: 1.5px dotted var(--line-2); border-radius: 14px; }
.vault-tip b { font-size: 14px; }
.vault-tip p { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-top: 3px; }
.rough-badge, .complete-badge { font: 600 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; }
.rough-badge { color: var(--accent); background: var(--accent-soft); }
.complete-badge { color: var(--sage); background: var(--sage-soft); }
.filing-line { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; }
.filing-line .mono { color: var(--ink-2); }
.status-toggle { margin-bottom: 0; }
.filing-hint { margin: 8px 2px 12px; }

/* ---- Today: your plan --------------------------------------------------------------------- */
.plan-card { margin-top: 10px; display: grid; gap: 12px; }
.plan-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.plan-name { display: block; font-size: 19px; letter-spacing: -.02em; margin-top: 4px; }
.plan-progress { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.plan-progress .mono { font-size: 12px; color: var(--ink-2); }
.plan-bar { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.plan-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.plan-today { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2); text-align: left; color: var(--ink); }
.plan-today small { display: block; font-size: 11.5px; color: var(--sky); }
.plan-today b { display: block; font-size: 16px; letter-spacing: -.015em; margin-top: 2px; }
.plan-today .btn { flex: none; pointer-events: none; }
.plan-today.done { justify-content: flex-start; border-style: dashed; background: none; }
.plan-today.done > .ico { width: 22px; height: 22px; color: var(--sage); flex: none; }
.plan-today.done small { color: var(--muted); }
.plan-note { font-size: 14px; }
.plan-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 2px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--ink); }
.plan-row > .ico { width: 18px; height: 18px; color: var(--muted); }
.plan-row > .ico:first-child { color: var(--accent); }
.plan-row small { display: block; font-size: 11.5px; color: var(--muted); }
.plan-row b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.plan-list { display: grid; gap: 8px; }
.plan-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; color: var(--ink); }
.plan-option.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.plan-option b { display: block; font-size: 15px; }
.plan-option small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.plan-option .mono { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.plan-option.on .mono { color: var(--accent); }
.plan-option > .ico { width: 16px; height: 16px; color: var(--muted); }
.menu-chips { padding: 0 0 14px; }
@keyframes install-flash { 0%, 100% { border-color: var(--line-2); } 30% { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); } }
.welcome-install.flash { animation: install-flash 1.4s var(--ease) 2; }

/* ---- Maps: colour-coded layer toggles top left, full screen top right ------------------------ */
.map-left { display: grid; gap: 12px; justify-items: start; min-width: 0; }
.map-toggles { justify-content: flex-start; max-width: none; flex-wrap: wrap; }
.layer-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--muted); font: 600 12.5px var(--sans); transition: color .2s, border-color .2s, background .2s; }
.layer-chip i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--c); background: transparent; transition: background .2s; }
.layer-chip.on { color: var(--ink); border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.layer-chip.on i { background: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); }
.map-expand { flex: none; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--surface) 72%, transparent); border: 1px solid var(--line-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--teal); }
.map-expand .ico { width: 18px; height: 18px; }

/* ---- Teaching: ministry on topics and passages ------------------------------------------- */
.teaching-block > .eyebrow, .teach-group > .eyebrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.teach-source { font: 600 10.5px var(--mono); letter-spacing: .06em; color: var(--violet); text-transform: none; }
.teach-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--hi); overflow: hidden; }
.teach-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--ink); }
.teach-row:first-child { border-top: 0; }
.teach-row > .ico:last-child { width: 16px; height: 16px; color: var(--muted); }
.teach-play { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--violet-soft); color: var(--violet); }
.teach-play .ico { width: 18px; height: 18px; }
.teach-play .ico svg { fill: currentColor; stroke: none; }
.teach-text b { display: block; font-size: 14.5px; line-height: 1.35; letter-spacing: -.01em; }
.teach-text small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.teach-group { margin-bottom: 16px; }
.teach-group > .eyebrow { margin: 0 2px 8px; }
.teach-title { font-size: 24px; line-height: 1.2; letter-spacing: -.025em; margin: 8px 0 10px; text-wrap: balance; }
.teach-summary { font-size: 16.5px; line-height: 1.6; color: var(--ink-2); }
.teach-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.teach-points li { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--hi); display: grid; gap: 6px; justify-items: start; }
.teach-points b { font-size: 16px; line-height: 1.35; letter-spacing: -.015em; }
.teach-quote { margin: 0; padding-left: 12px; border-left: 2px solid var(--violet); font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.teach-refs { display: grid; gap: 8px; }
.teach-ref { display: grid; gap: 4px; text-align: left; padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); }
.teach-ref-top { display: flex; align-items: center; gap: 8px; }
.teach-ref-top b { font-size: 13.5px; color: var(--sky); }
.teach-ref small { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.teach-credit { margin-top: 22px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.teach-credit a { color: var(--ink-2); }

/* ---- Journal v3: header, sidebar (a drawer on phones), compact note list ------------------- */
.journal-head { align-items: center; gap: 10px; }
.journal-head .side-btn { flex: none; margin-left: -8px; }
.journal-title { flex: 1; min-width: 0; }
.journal-title .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.journal-search { flex: 1; margin: 0; }
.note-list { display: grid; padding-bottom: 8px; }
.note-list .day-head { margin: 14px 4px 6px; }
.note-list .day-head:first-child, .note-list .vault-tip + .day-head { margin-top: 2px; }
.note-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 11px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; color: var(--ink); }
.note-row:active { background: var(--surface-2); }
.note-kind { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); margin-top: 1px; }
.note-kind .ico { width: 16px; height: 16px; }
.note-text { min-width: 0; display: grid; gap: 2px; }
.note-text b { font-size: 15px; line-height: 1.35; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-text small { font-size: 13.5px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.note-ref { color: var(--sky); font-size: 11.5px; }
.journal-side { display: grid; align-content: start; gap: 4px; }
.side-group { display: grid; gap: 1px; }
.side-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 0; border-radius: 10px; background: none; text-align: left; color: var(--ink-2); font: 550 14.5px var(--sans); }
.side-item.on { background: var(--surface-2); color: var(--ink); }
.side-icon { color: var(--rose); display: grid; }
.side-icon .ico { width: 17px; height: 17px; }
.side-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-count { font-size: 12px; color: var(--muted); }
.side-head { display: flex; justify-content: space-between; align-items: center; margin: 16px 10px 4px; font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.side-head button { display: grid; place-items: center; width: 26px; height: 26px; margin: -4px -6px -4px 0; border: 0; border-radius: 8px; background: none; color: var(--rose); }
.side-head button .ico { width: 16px; height: 16px; }
.side-empty { margin: 2px 10px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.side-focus { display: grid; gap: 2px; margin: 10px 0 0; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 12px; background: none; text-align: left; color: var(--ink-2); }
.side-focus small { font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--rose); }
.side-focus span { font-size: 13.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 6px; }
.side-tag { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--accent); font: 550 12.5px var(--sans); }
.side-tag.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.side-tag .mono { font-size: 10.5px; color: var(--muted); }
.focus-list { display: grid; gap: 8px; }
.focus-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; color: var(--ink); }
.focus-row small { grid-column: 1; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--rose); }
.focus-row span { grid-column: 1; font-size: 14.5px; line-height: 1.4; }
.focus-row .ico { grid-column: 2; grid-row: 1 / 3; width: 16px; height: 16px; color: var(--muted); }
/* The drawer (phones): slides in from the left over a dimmed page; back or a tap outside closes it. */
.layer.drawer .backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .36); opacity: 0; transition: opacity .3s; }
.layer.drawer.open .backdrop { opacity: 1; }
.layer.drawer .drawer-panel { position: absolute; left: 0; top: 0; bottom: 0; width: min(84vw, 320px); overflow-y: auto; overscroll-behavior: contain; padding: calc(var(--safe-t) + 20px) 12px calc(var(--safe-b) + 24px); background: var(--bg); border-right: 1px solid var(--line-2); box-shadow: var(--shadow-lg); transform: translateX(-102%); transition: transform .34s var(--ease); }
.layer.drawer.open .drawer-panel { transform: none; }
.layer.drawer.closing .drawer-panel { transform: translateX(-102%); }
.layer.drawer.closing .backdrop { opacity: 0; }
/* Wide screens: the sidebar stays open beside the notes, with room for both. */
@media (min-width: 900px) {
  #view[data-view="journal"] { padding-left: max(24px, calc(50% - 470px)); padding-right: max(24px, calc(50% - 470px)); }
  .journal.with-side { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start; }
  .journal-side { position: sticky; top: 14px; max-height: calc(100dvh - var(--dock) - 40px); overflow-y: auto; padding: 14px 0 20px; }
}
