/* ============================================================
   Lectio v3 — Screen Styles
   Section 1: Landing page
   ============================================================ */

/* ── SHARED LAYOUT ────────────────────────────────────────── */
body.study, body.today, body.library { min-height: 100vh; }
.app-root { display: flex; flex-direction: column; min-height: 100vh; }

/* ----------------------------------------------------------
   Landing wrapper
   ---------------------------------------------------------- */

.landing {
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

/* ----------------------------------------------------------
   Nav
   ---------------------------------------------------------- */

.landing-nav {
  display: flex;
  align-items: center;
  padding: 20px 64px;
  gap: 16px;
}

.landing-nav .nav-brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--ink);
}

.landing-nav .nav-links {
  display: flex;
  gap: 28px;
  margin-left: 40px;
  font-size: 13px;
  color: var(--ink-muted);
  list-style: none;
  margin-top: 0;
  margin-bottom: 0;
  padding: 0;
}

.landing-nav .nav-links li {
  cursor: pointer;
}
.landing-nav .nav-links a.nav-link { color: inherit; text-decoration: none; }
.landing-nav .nav-links a.nav-link:hover { color: var(--accent); }
.landing-footer .footer-link { color: var(--ink-faint); text-decoration: none; font-family: var(--font-mono); letter-spacing: 0.8px; }
.landing-footer .footer-link:hover { color: var(--accent); }
.focus-tab-label { cursor: default; }

.landing-nav .nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-nav .nav-signin {
  font-size: 13px;
  color: var(--ink-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-ui);
  padding: 0;
}

/* ----------------------------------------------------------
   Hero
   ---------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 60px 64px 48px;
}

.hero-copy .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero-copy .h-hero {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -1px;
  margin: 0 0 20px;
  color: var(--ink);
}

.hero-copy .h-hero em.accent {
  color: var(--accent);
  font-style: italic;
}

.hero-copy .lead {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0 0 28px;
  max-width: 520px;
}

.cta-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hero-copy .microcopy {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.8px;
}

/* ----------------------------------------------------------
   Hero visual / Palimpsest
   ---------------------------------------------------------- */

.hero-visual {
  position: relative;
  height: 520px;
  min-height: 520px;
}

.palimpsest {
  position: relative;
  width: 100%;
  height: 100%;
}

/* INPUT row */
.palimpsest .input-row {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.palimpsest .source-tag {
  flex-shrink: 0;
  width: 56px;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius);
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
}

.source-tag .vert {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-transform: uppercase;
  font-weight: 700;
}

.palimpsest .verse-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.verse-card .verse-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.verse-card .verse-ref {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.8px;
  color: var(--accent);
  text-transform: uppercase;
}

.verse-card .verse-rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.verse-card .verse-lang {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
}

.verse-card .verse-text {
  font-family: var(--font-hebrew);
  font-size: 26px;
  line-height: 1.4;
  color: var(--ink);
  text-align: right;
}

/* DECOMPOSE arrow */
.palimpsest .decompose-arrow {
  position: absolute;
  left: 27px;
  top: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 700;
}

/* Strata list */
.palimpsest .strata {
  position: absolute;
  left: 68px;
  top: 138px;
  right: 0;
  bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.palimpsest .stratum {
  display: grid;
  grid-template-columns: 40px 108px 1fr auto;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stratum .num {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--accent);
}

.stratum .label-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stratum .label-block .title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.stratum .label-block .hint {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-faint);
}

.stratum .body {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  border-left: 2px solid var(--line);
  padding-left: 12px;
  font-style: italic;
}

.stratum .body.greek {
  font-family: var(--font-greek);
  font-style: normal;
}

.stratum .pill {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: 1.2px;
}

/* Strata footer strip */
.palimpsest .strata-footer {
  position: absolute;
  left: 68px;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-lg);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.strata-footer .icons {
  display: flex;
  gap: 3px;
}

.strata-footer .icon-circle {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--accent);
  display: grid;
  place-items: center;
  color: var(--accent);
}

.strata-footer .more-label {
  font-weight: 700;
}

.strata-footer .dashed-rule {
  flex: 1;
  border-bottom: 1px dashed var(--accent);
  opacity: 0.4;
}

/* ----------------------------------------------------------
   Pillars
   ---------------------------------------------------------- */

.pillars {
  padding: 60px 64px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.pillar .icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.pillar h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 10px;
  color: var(--ink);
}

.pillar p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0;
}

/* ----------------------------------------------------------
   Testimonial
   ---------------------------------------------------------- */

.testimonial {
  padding: 72px 64px;
  text-align: center;
}

.testimonial .testimonial-inner {
  max-width: 780px;
  margin: 0 auto;
}

.testimonial blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 32px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--ink);
  margin: 20px 0 22px;
}

.testimonial .attribution {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ink-muted);
  text-transform: uppercase;
}

/* ----------------------------------------------------------
   CTA band
   ---------------------------------------------------------- */

.cta-band {
  padding: 60px 64px;
  border-top: 1px solid var(--line);
  background: var(--canvas-alt);
  text-align: center;
}

.cta-band h2 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--ink);
}

.cta-band p {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink-muted);
  margin: 0 0 24px;
}

/* ----------------------------------------------------------
   Footer
   ---------------------------------------------------------- */

.landing-footer {
  padding: 28px 64px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  letter-spacing: 0.8px;
}

.landing-footer .footer-copy {
  /* copyright text — no special rule needed */
}

.landing-footer .footer-links {
  margin-left: auto;
  display: flex;
  gap: 18px;
}

.landing-footer .footer-links span {
  cursor: pointer;
}

/* ----------------------------------------------------------
   Responsive — 860px breakpoint
   ---------------------------------------------------------- */

/* ── TODAY ──────────────────────────────────────────────────────── */

.today {
  flex: 1;
  overflow: auto;
}

.today-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 40px;
}

.today-inner > .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.today-title {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -0.6px;
  margin: 0 0 12px;
  line-height: 1.05;
  color: var(--ink);
}

.today-title em.accent {
  font-style: italic;
  color: var(--accent);
}

.today-sub {
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--ink-muted);
  margin: 0 0 36px;
  max-width: 600px;
  font-style: italic;
}

.readings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.reading-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.reading-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
  border-color: var(--line-strong);
}

.reading-card .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reading-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--accent);
  border-radius: 2px;
}

.not-yet {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.reading-citation {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.stages-preview {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.stages-preview .dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  color: var(--ink-muted);
  background: transparent;
  border: none;
}

.stages-preview .dot.done {
  color: var(--accent);
  background: var(--accent-soft);
}

.stages-preview .dot.locked {
  color: var(--ink-faint);
  background: transparent;
  border: 1px dashed var(--line);
}

.reading-cta {
  margin-top: auto;
}

.btn.size-sm {
  padding: 7px 14px;
  font-size: 12px;
}

/* Demo mode badge: single canonical definition lives in the DEMO BADGE section below. */

@media (max-width: 900px) {
  .readings-grid {
    grid-template-columns: 1fr;
  }

  .today-inner {
    padding: 28px 20px;
  }

  .today-title {
    font-size: 36px;
  }
}

/* ── END TODAY ───────────────────────────────────────────────────── */

/* ── STAGE GROUPS ────────────────────────────────────────────────── */

.stage-group {
  margin: 0 0 4px;
  padding: 0;
  border: none;
}

.stage-group-heading {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 24px 0 6px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

/* First group heading gets less top margin (already follows source pane) */
.stage-group:first-of-type .stage-group-heading {
  margin-top: 8px;
}

.stage-group-description {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-faint);
  margin: 0 0 4px;
  font-style: italic;
  line-height: 1.4;
}

/* Bibliography group label (idx 9 — rendered after the 3 groups) */
.stage-group[data-group="bibliography"] .stage-group-heading {
  color: var(--ink-muted);
}

/* Canonical-form (Transmitancja stage body) */
.canonical-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.canonical-layer {
  border-left: 2px solid var(--line-strong);
  padding-left: 14px;
}

.canonical-layer-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
  font-weight: 500;
}

.canonical-layer-body { font-size: 14px; line-height: 1.65; }

/* Transmittance numbered list — same style as bibliography */
.transmittance,
.bibliography {
  padding-left: 1.4em;
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.7;
}

.transmittance li,
.bibliography li {
  margin-bottom: 8px;
}

/* Inline [N] citation deep-links: superscript, accent-coloured, link to the
   bibliography anchor (#refN). Scroll-margin keeps the targeted entry clear of
   the sticky stage rail when the anchor is jumped to. */
.cite-ref {
  font-size: 0.72em;
  vertical-align: super;
  line-height: 0;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 0 1px;
}
.cite-ref:hover,
.cite-ref:focus-visible {
  text-decoration: underline;
}
.bibliography li:target {
  background: var(--surface-alt);
  scroll-margin-top: 80px;
  border-radius: var(--radius);
}

/* ── END STAGE GROUPS ────────────────────────────────────────────── */

/* ── STUDY ─────────────────────────────────────────── */
.reading-tabs { display: flex; align-items: center; border-bottom: 1px solid var(--line); padding: 0 24px; background: var(--canvas); }
.reading-tab { padding: 14px 22px; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.reading-tab.active { border-bottom-color: var(--accent); }
.reading-tab .tab-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px; color: var(--ink-faint); text-transform: uppercase; }
.reading-tab.active .tab-label { color: var(--accent); }
.reading-tab .tab-citation { font-family: var(--font-display); font-size: 15px; font-weight: 500; color: var(--ink-muted); }
.reading-tab.active .tab-citation { color: var(--ink); }
.reading-tabs-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
#focus-toggle.is-on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.tier-chipset {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
}
.tier-chipset .chipset-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-right: 6px;
}
.tier-chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-muted);
  border: 1px solid var(--line);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.tier-chip:hover { background: var(--surface-alt); }
.tier-chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.study-split { display: grid; grid-template-columns: 1fr 1fr; flex: 1; min-height: 0; }
.source-pane { overflow: auto; padding: 32px 40px 40px; }
.mono-label { color: var(--ink-faint); margin-bottom: 8px; } /* font props inherit from base.css canonical */

.hebrew-block { font-family: var(--font-hebrew); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px 28px; margin-bottom: 18px; color: var(--ink); }
.hebrew-block .verse { display: flex; gap: 12px; align-items: baseline; padding: 4px 0; }
.hebrew-block .verse sup { font-family: var(--font-ui); font-size: 10px; color: var(--accent); min-width: 14px; }
.hebrew-block .verse span { font-size: 16px; line-height: 1.9; word-break: break-word; overflow-wrap: break-word; }

.literal-block { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 28px; font-family: var(--font-body); font-size: 16px; line-height: 1.7; color: var(--ink); }
.literal-verse { margin: 0 0 12px; display: flex; gap: 12px; }
.literal-verse sup { font-family: var(--font-ui); font-size: 10px; color: var(--accent); min-width: 14px; }

.analysis-pane { overflow: auto; padding: 24px 28px 40px; border-left: 1px solid var(--line); }
.analysis-eyebrow { margin-bottom: 14px; letter-spacing: 1.8px; }

.stage-deck { position: relative; }
/* Spine sits on the num-pill axis. The pill center is offset +1px by .stage-row's
   1px transparent border (border-box), so the spine left is 33px, not 32px. */
.stage-deck-spine { position: absolute; left: 33px; top: 16px; bottom: 16px; width: 1px; background: var(--line); transform: translateX(-0.5px); }
.stage-rows { display: flex; flex-direction: column; gap: 2px; }
/* Library + stage rows are native <button>s (a11y: real focus + Enter/Space).
   Strip residual UA chrome; .item-row / .stage-row keep their card/grid styling. */
button.item-row,
button.stage-row { appearance: none; -webkit-appearance: none; color: inherit; text-align: left; width: 100%; }
button.item-row { background: none; border-top: 0; border-left: 0; border-right: 0; }
button.item-row:focus-visible,
button.stage-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stage-row { position: relative; display: grid; grid-template-columns: 32px 40px 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; border-radius: var(--radius); border: 1px solid transparent; background: transparent; transition: background 160ms ease; }
.stage-row:hover { background: var(--surface-alt); }
.stage-row.active { background: var(--surface); border-color: var(--accent); margin: 4px 0; }
.num-pill { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 999px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; background: var(--canvas-alt); color: var(--ink-muted); border: 1px solid var(--line); flex-shrink: 0; position: relative; z-index: 1; }
.stage-row.visited .num-pill { background: var(--accent-soft); color: var(--accent); }
.stage-row.active .num-pill { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.stage-row-icon { width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-faint); }
.stage-row.visited .stage-row-icon, .stage-row.active .stage-row-icon { color: var(--accent); }
.stage-row-label { font-family: var(--font-display); font-size: 17px; font-weight: 400; color: var(--ink-muted); letter-spacing: -0.1px; }
.stage-row.active .stage-row-label { color: var(--ink); font-weight: 500; }
.stage-row-meta { display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.8px; }
.stage-body { padding: 4px 16px 28px 88px; animation: stage-body-fade 200ms ease; }
@keyframes stage-body-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Groundedness credibility badge (Filologia stage) ─────────────────
   Surfaces the deterministic anti-hallucination ratio the pipeline already
   computes (ground_terms). CORPUS-level by nature — copy stays honest. */
.groundedness-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3px;
  color: var(--ink-muted);
  cursor: help;
}
.groundedness-badge .groundedness-badge-icon {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.groundedness-badge.is-full {
  border-color: color-mix(in srgb, var(--success) 45%, var(--line));
  color: var(--success);
}
.groundedness-badge.is-partial {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent);
}

.philology { font-family: var(--font-body); font-size: 16px; line-height: 1.7; color: var(--ink); max-width: 560px; }
.philology p.lead { margin: 0 0 14px; }
.philology .hebrew-inline { font-family: var(--font-hebrew); font-size: 20px; color: var(--accent); }
.philology .lex-note { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 14px 0; }
.philology .lex-note-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.2px; color: var(--accent); text-transform: uppercase; margin-bottom: 8px; }
.philology .lex-note-grid { display: grid; grid-template-columns: 80px 1fr; gap: 6px 18px; font-size: 14px; }
.philology .lex-note-grid .k { color: var(--ink-faint); }
.philology .lex-note-grid .v.greek { font-family: var(--font-greek); }
.philology .lex-note-grid .v.italic { font-style: italic; }
.philology .coda { margin: 0; color: var(--ink-muted); }
.philology .accent-strong { color: var(--accent); font-weight: 600; }

.stage-scaffold { font-family: var(--font-body); font-size: 15px; line-height: 1.65; color: var(--ink-muted); max-width: 520px; font-style: italic; }

/* Focus mode (inline variant) */
.app-root.focus-mode .study-split { display: none; }
.focus-pane { display: none; background: var(--surface-alt); flex: 1; flex-direction: column; overflow: hidden; }
.app-root.focus-mode .focus-pane { display: flex; }
.focus-rail { padding: 8px 24px; border-bottom: 1px solid var(--line); display: flex; gap: 6px; overflow-x: auto; }
.focus-rail button { width: 40px; height: 40px; border-radius: var(--radius); display: grid; place-items: center; background: transparent; border: 1px solid var(--line); cursor: pointer; flex-shrink: 0; color: var(--ink-muted); }
.focus-rail button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.focus-content { flex: 1; overflow: auto; display: grid; place-items: start center; padding: 48px 24px; }
.focus-content-inner { max-width: 820px; width: 100%; }
.focus-content-inner .eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.8px; color: var(--accent); text-transform: uppercase; margin-bottom: 8px; }
.focus-content-inner h1 { font-family: var(--font-display); font-size: 40px; font-weight: 400; letter-spacing: -0.4px; margin: 0 0 24px; color: var(--ink); }

@media (max-width: 900px) {
  .study-split { grid-template-columns: 1fr; }
  .analysis-pane { border-left: none; border-top: 1px solid var(--line); }
  .tier-chipset { padding: 8px 14px; overflow-x: auto; }
  .tier-chipset .chipset-label { display: none; }
  .reading-tabs { overflow-x: auto; }
}
/* ── END STUDY ───────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .landing-nav {
    padding: 16px 24px;
  }

  .landing-nav .nav-links {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 40px 24px;
    gap: 32px;
  }

  .hero-copy .h-hero {
    font-size: 40px;
  }

  .hero-visual {
    display: none;
  }

  .pillars {
    padding: 40px 24px;
  }

  .pillars-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .testimonial {
    padding: 48px 24px;
  }

  .testimonial blockquote {
    font-size: 22px;
  }

  .cta-band {
    padding: 48px 24px;
  }

  .landing-footer {
    padding: 24px;
    flex-wrap: wrap;
  }

  .landing-footer .footer-links {
    margin-left: 0;
    flex-wrap: wrap;
  }
}

/* ── CALENDAR POPOVER ──────────────────────────────── */
.cal-popover { position: fixed; width: 320px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-popover); padding: 14px; font-family: var(--font-ui); z-index: 100; animation: cal-pop-in 160ms ease; }
@keyframes cal-pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.cal-caret { position: fixed; width: 14px; height: 8px; background: var(--surface); clip-path: polygon(50% 0, 100% 100%, 0 100%); filter: drop-shadow(0 -1px 0 var(--line-strong)); z-index: 101; pointer-events: none; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 4px; }
.cal-header button { width: 24px; height: 24px; display: grid; place-items: center; background: transparent; border: none; color: var(--ink-muted); cursor: pointer; border-radius: var(--radius); }
.cal-header button:hover { background: var(--surface-alt); }
.cal-month { font-family: var(--font-display); font-size: 16px; font-weight: 500; color: var(--ink); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.cal-weekday { text-align: center; font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); letter-spacing: 1px; }
.cal-weekday.sun { color: var(--accent); }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day { aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: var(--radius); cursor: pointer; background: transparent; border: 1px solid transparent; color: var(--ink); font-family: var(--font-display); font-size: 14px; }
.cal-day.empty { cursor: default; color: transparent; }
.cal-day.sun { color: var(--accent); }
.cal-day.today { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cal-day.today:not(.selected) { background: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--ink); font-weight: 500; }
.cal-day.today .cal-dots i { background: var(--accent-ink); }
.cal-day.today:not(.selected) .cal-dots i { background: var(--ink-muted); }
.cal-day.selected { background: var(--accent); color: var(--accent-ink); font-weight: 600; outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-day:hover:not(.empty):not(.today):not(.selected) { background: var(--surface-alt); }
.cal-dots { display: flex; gap: 2px; }
.cal-dots i { width: 3px; height: 3px; border-radius: 999px; background: var(--accent-soft); display: block; }
.cal-dots i.filled { background: var(--accent); }
.cal-dots.missed i { background: var(--line); }
.cal-footer { display: flex; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.cal-footer .btn { flex: 1; justify-content: center; padding: 6px 12px; font-size: 12px; }
.cal-footer .btn.has-icon { flex: 0 1 auto; }
.cal-footer .cal-goto-input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}
.cal-footer .cal-goto-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* ── ONBOARDING ────────────────────────────────────── */
.onboarding-shell { min-height: 100vh; display: flex; flex-direction: column; }
.onb-topbar { padding: 22px 48px; display: flex; align-items: center; gap: 10px; }

/* Task 3: brand-stack — "Uczony w Piśmie" + indented "lectio" below */
.brand-stack { display: flex; flex-direction: column; line-height: 1.15; }
.brand-stack .brand-name { font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--ink); }
.brand-stack .brand-sub { font-family: var(--font-display); font-size: 11px; font-weight: 400; color: var(--ink-faint); margin-left: 50%; letter-spacing: 0.5px; }

.onb-step-label { margin-left: auto; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; color: var(--ink-faint); text-transform: uppercase; }
.onb-progress { height: 2px; background: var(--line); margin: 0 48px; }
.onb-progress-fill { height: 100%; background: var(--accent); transition: width 260ms ease; }
.onb-content { flex: 1; display: grid; place-items: center; padding: 20px 48px; }
.onb-inner { width: 100%; max-width: 640px; }
.onb-inner h1 { font-family: var(--font-display); font-size: 40px; font-weight: 400; letter-spacing: -0.4px; margin: 0 0 8px; line-height: 1.1; color: var(--ink); }
.onb-inner .sub { font-family: var(--font-body); font-size: 16px; color: var(--ink-muted); margin: 0 0 32px; font-style: italic; }
.onb-options { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.onb-option { display: grid; grid-template-columns: 22px 44px 1fr; gap: 16px; align-items: center; padding: 18px 22px; background: var(--canvas); cursor: pointer; border: none; text-align: left; color: var(--ink); font: inherit; }
.onb-option.selected { background: var(--surface); }

/* Task 5: radio = circle (default for single_select); checkbox = square */
.onb-option .radio { width: 16px; height: 16px; border-radius: 999px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex-shrink: 0; }
.onb-option.selected .radio { border-color: var(--accent); }
.onb-option .radio i { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); display: block; opacity: 0; }
.onb-option.selected .radio i { opacity: 1; }

/* Checkbox variant — square indicator with checkmark */
.onb-option[role="checkbox"] .radio { border-radius: var(--radius, 4px); }
.onb-option[role="checkbox"] .radio i { border-radius: 1px; width: 8px; height: 8px; }
.onb-option[role="checkbox"][aria-checked="true"] .radio { background: var(--accent); border-color: var(--accent); }
.onb-option[role="checkbox"][aria-checked="true"] .radio i {
  opacity: 1;
  background: transparent;
  width: 5px;
  height: 8px;
  border-right: 1.5px solid var(--accent-ink);
  border-bottom: 1.5px solid var(--accent-ink);
  transform: rotate(45deg) translate(-1px, -1px);
  border-radius: 0;
}

/* Task 2: icon-box — Lucide stroke icons, stonowane */
.onb-option .icon-box { width: 40px; height: 40px; border-radius: var(--radius); background: var(--surface-alt); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-muted); }
.onb-option .icon-box svg { stroke: var(--ink-muted); stroke-width: 1.5; }
.onb-option.selected .icon-box { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.onb-option.selected .icon-box svg { stroke: var(--accent); }

/* Task 1: flag icon-box for language step */
.onb-option .icon-box--flag { flex-direction: column; gap: 2px; }
.onb-option .icon-box.icon-box--flag { display: flex; align-items: center; justify-content: center; }
.onb-option .flag-emoji { font-size: 18px; line-height: 1; }
.onb-option .flag-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 1px; color: var(--ink-faint); text-transform: uppercase; line-height: 1; }
.onb-option.selected .flag-label { color: var(--accent); }

.onb-option .title { font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--ink); }
.onb-option .blurb { font-family: var(--font-body); font-size: 14px; color: var(--ink-muted); line-height: 1.5; }
.onb-nav { display: flex; justify-content: space-between; margin-top: 28px; }
.onb-nav .btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ── PRICING ───────────────────────────────────────── */
.pricing-shell { min-height: 100vh; }
.pricing-inner { padding: 48px 64px; max-width: 1180px; margin: 0 auto; }
.pricing-top { display: flex; align-items: center; margin-bottom: 48px; }
.pricing-top .brand-name { font-family: var(--font-display); font-size: 20px; font-weight: 500; margin-left: 10px; color: var(--ink); }
.pricing-top .label-right { margin-left: auto; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; color: var(--ink-muted); text-transform: uppercase; }
.pricing-hero { text-align: center; margin-bottom: 44px; }
.pricing-hero .eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; color: var(--accent); text-transform: uppercase; margin-bottom: 14px; }
.pricing-hero h1 { font-family: var(--font-display); font-size: 54px; font-weight: 500; letter-spacing: -0.6px; margin: 0 0 12px; color: var(--ink); }
.pricing-hero h1 em.accent { color: var(--accent); font-style: italic; }
.pricing-hero .lead { font-family: var(--font-body); font-size: 17px; color: var(--ink-muted); max-width: 580px; margin: 0 auto 14px; }
.pricing-pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.4px; color: var(--ink-muted); background: var(--surface-alt); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; }
.pricing-pill .accent { color: var(--accent); font-weight: 700; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 1040px; margin: 0 auto; }
.tier { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px 28px; position: relative; }
/* Highlighted card has a 2px border (vs 1px); border-box would push its content
   down 1px and misalign the row of card headers — compensate with padding-top. */
.tier.highlighted { background: var(--surface); border: 2px solid var(--accent); padding-top: 31px; box-shadow: 0 12px 32px rgba(0,0,0,0.08); }
.tier .recommended { position: absolute; top: -11px; left: 24px; background: var(--accent); color: var(--accent-ink); font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.tier .tier-name { font-family: var(--font-mono); font-size: 10px; font-weight: 400; letter-spacing: 2px; color: var(--ink-faint); text-transform: uppercase; margin-bottom: 12px; }
.tier.highlighted .tier-name { color: var(--accent); }
.tier .tier-price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 24px; }
.tier .tier-price { font-family: var(--font-display); font-size: 48px; font-weight: 500; letter-spacing: -0.6px; color: var(--ink); }
.tier .tier-sub { font-family: var(--font-ui); font-size: 13px; color: var(--ink-muted); }
.tier .tier-cta { width: 100%; justify-content: center; margin-bottom: 22px; }
.tier .tier-cancel { text-align: center; font-family: var(--font-ui); font-size: 12px; color: var(--ink-muted); margin: -12px 0 20px; }
.tier .tier-feats { border-top: 1px solid var(--line); padding-top: 18px; }
.tier .feat { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-family: var(--font-body); font-size: 14px; color: var(--ink); line-height: 1.5; }
.tier .feat svg { flex-shrink: 0; margin-top: 3px; }
.credits-box { max-width: 1040px; margin: 40px auto 0; padding: 24px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.credits-box .icon-box { width: 48px; height: 48px; border-radius: var(--radius-lg); background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); }
.credits-box .title { font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.credits-box .body { font-family: var(--font-body); font-size: 14px; color: var(--ink-muted); }

@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-hero h1 { font-size: 40px; }
  .pricing-inner { padding: 32px 24px; }
  .credits-box { grid-template-columns: 1fr; text-align: center; }
  .onb-topbar { padding: 22px 24px; }
  .onb-progress { margin: 0 24px; }
  .onb-content { padding: 20px 24px; }
  .onb-inner h1 { font-size: 32px; }
}

/* ── LIBRARY ───────────────────────────────────────── */
.library { flex: 1; overflow: auto; }
.library-grid { max-width: 1200px; margin: 0 auto; padding: 32px 48px 20px; display: grid; grid-template-columns: 220px 1fr; gap: 40px; }
.profile-side { position: sticky; top: 20px; align-self: flex-start; }
.profile-avatar { width: 80px; height: 80px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--font-display); font-size: 32px; font-weight: 500; border: 1px solid var(--line); margin-bottom: 14px; }
.profile-name { font-family: var(--font-display); font-size: 20px; font-weight: 500; color: var(--ink); margin-bottom: 2px; }
.profile-email { font-family: var(--font-body); font-size: 13px; color: var(--ink-muted); margin-bottom: 18px; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 14px; }
.plan-card .eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px; color: var(--ink-faint); text-transform: uppercase; margin-bottom: 8px; }
.plan-card .tier-name { font-family: var(--font-display); font-size: 22px; font-weight: 500; color: var(--ink); margin-bottom: 2px; }
.plan-card .sub { font-family: var(--font-body); font-size: 13px; color: var(--ink-muted); margin-bottom: 12px; }
.plan-card .credits-row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); margin-bottom: 6px; }
.plan-card .credits-row strong { color: var(--ink); }
.plan-card .bar { height: 6px; background: var(--canvas-alt); border-radius: 999px; overflow: hidden; }
.plan-card .bar i { display: block; height: 100%; background: var(--accent); }
.profile-nav { display: flex; flex-direction: column; gap: 2px; }
.profile-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius); color: var(--ink-muted); font-size: 13px; cursor: pointer; text-decoration: none; }
.profile-nav a:hover { background: var(--surface-alt); }
.profile-nav a.active { background: var(--accent-soft); color: var(--accent); }
.profile-nav a.is-disabled { opacity: 0.5; cursor: not-allowed; }

.library-main { }
.library-header { display: flex; align-items: center; margin-bottom: 22px; }
.library-header .eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; color: var(--accent); text-transform: uppercase; margin-bottom: 6px; }
.library-header h1 { font-family: var(--font-display); font-size: 36px; font-weight: 500; letter-spacing: -0.4px; margin: 0; color: var(--ink); }
.library-header .actions { margin-left: auto; display: flex; gap: 8px; }
.filter-chips { display: flex; gap: 6px; margin-bottom: 18px; font-family: var(--font-ui); font-size: 13px; }
.filter-chip { padding: 6px 14px; border-radius: 999px; background: var(--surface); color: var(--ink-muted); border: 1px solid var(--line); cursor: pointer; font: inherit; }
.filter-chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.filter-chip.warn { color: var(--danger); }
.item-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.day-header { padding: 10px 22px; background: var(--surface-alt); border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px; color: var(--ink-muted); text-transform: uppercase; }
.item-row { padding: 16px 22px; display: grid; grid-template-columns: auto 100px 1fr auto auto; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); cursor: pointer; transition: background 120ms ease; }
.item-row:last-child { border-bottom: none; }
.item-row:hover { background: var(--surface-alt); }
.item-row .status-dot { width: 10px; height: 10px; border-radius: 999px; }
.item-row .status-dot.done { background: var(--success); }
.item-row .status-dot.partial { background: var(--accent); }
.item-row .status-dot.error { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 13%, transparent); }
.item-row .reading-kind { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px; color: var(--ink-muted); text-transform: uppercase; }
.item-row .item-title { font-family: var(--font-display); font-size: 17px; font-weight: 500; color: var(--ink); }
.item-row .item-err { font-family: var(--font-body); font-size: 13px; color: var(--danger); margin-top: 2px; }
.item-row .progress { display: flex; gap: 2px; align-items: center; font-family: var(--font-mono); font-size: 10px; color: var(--ink-muted); }
.item-row .progress .bar { width: 80px; height: 4px; background: var(--canvas-alt); border-radius: 999px; overflow: hidden; }
.item-row .progress .bar i { display: block; height: 100%; background: var(--success); }
.item-row .progress.partial .bar i { background: var(--accent); }
.item-row .progress.error .bar i { background: var(--danger); }
.item-row .progress .label { min-width: 32px; text-align: right; }
.item-row .chev { color: var(--ink-faint); display: grid; place-items: center; }

.empty-state { padding: 80px 40px; text-align: center; }
.empty-state h2 { font-family: var(--font-display); font-size: 28px; font-weight: 500; margin: 0 0 16px; color: var(--ink); }

@media (max-width: 900px) {
  .library-grid { grid-template-columns: 1fr; padding: 24px 20px; gap: 24px; }
  .profile-side { position: static; }
  .item-row { grid-template-columns: auto 1fr auto; gap: 10px; }
  .item-row .reading-kind { display: none; }
  .item-row .progress .bar { width: 48px; }
}

/* ── GENERATING MODAL ─────────────────────────────── */
.gen-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 1000; animation: gen-fade 200ms ease; }
@keyframes gen-fade { from { opacity: 0; } to { opacity: 1; } }
.gen-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 720px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: 0 30px 80px rgba(0,0,0,0.4); z-index: 1001; font-family: var(--font-ui); overflow: hidden; animation: gen-pop 240ms ease-out; }
@keyframes gen-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(0.98); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.gen-header { padding: 22px 28px 16px; border-bottom: 1px solid var(--line); }
.gen-header .head-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gen-spinner { width: 22px; height: 22px; border: 2px solid var(--accent); border-top-color: transparent; border-radius: 999px; animation: lectio-spin 1s linear infinite; flex-shrink: 0; }
@keyframes lectio-spin { to { transform: rotate(360deg); } }
.gen-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px; color: var(--accent); text-transform: uppercase; }
.gen-remaining { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); letter-spacing: 1px; }
.gen-title { font-family: var(--font-display); font-size: 24px; font-weight: 500; color: var(--ink); letter-spacing: -0.2px; }
.gen-subline { font-family: var(--font-body); font-size: 14px; color: var(--ink-muted); margin-top: 2px; }
.gen-body { padding: 14px 20px; max-height: 320px; overflow-y: auto; }
.gen-stage { display: grid; grid-template-columns: 28px 28px 1fr auto; gap: 12px; align-items: center; padding: 9px 8px; border-radius: var(--radius); background: transparent; }
.gen-stage.active { background: var(--accent-soft); }
.gen-stage .pill { width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; background: var(--canvas-alt); color: var(--ink-faint); font-family: var(--font-mono); font-size: 10px; font-weight: 600; border: 1px solid var(--line); }
.gen-stage.done .pill { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.gen-stage.active .pill { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.gen-stage.error .pill { background: var(--danger); color: var(--accent-ink); border-color: var(--danger); }
.gen-stage .ico { display: grid; place-items: center; color: var(--ink-faint); }
.gen-stage.done .ico, .gen-stage.active .ico { color: var(--accent); }
.gen-stage .label { font-family: var(--font-display); font-size: 15px; color: var(--ink-faint); font-weight: 400; }
.gen-stage.done .label, .gen-stage.active .label { color: var(--ink); }
.gen-stage.active .label { font-weight: 500; }
.gen-stage .status { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.8px; color: var(--ink-faint); }
.gen-stage.active .status { color: var(--accent); }
.gen-footer { padding: 16px 28px; border-top: 1px solid var(--line); background: var(--surface-alt); display: flex; align-items: center; gap: 16px; }
.gen-footer .cost-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.2px; color: var(--ink-muted); text-transform: uppercase; }
.gen-footer .cost { font-family: var(--font-display); font-size: 16px; color: var(--ink); }
.gen-footer .cost .accent-strong { color: var(--accent); font-weight: 600; }
.gen-footer .cost .rem { font-size: 13px; color: var(--ink-muted); margin-left: 8px; }
.gen-footer .btn-ghost { margin-left: auto; }
.gen-error-notice { padding: 10px 28px; background: var(--danger); color: var(--accent-ink); font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; }

/* ── FOCUS STANDALONE ──────────────────────────────── */
.focus-pane.focus-standalone { display: flex; }
.focus-exit-btn { margin-left: auto; }

/* ── MOBILE STUDY (≤480) ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .appbar { padding: 8px 12px; gap: 8px; font-size: 12px; }
  .appbar-brand { font-size: 15px; }
  .appbar-tabs { display: none; }
  .date-chip { margin-left: 0; margin-right: 0; padding: 4px 8px; font-size: 12px; }
  .user-chip .username, .credits-pill .credits-label { display: none; }
  .credits-pill { padding: 4px 8px; }

  body.study { padding-bottom: 56px; }
  .reading-tabs { padding: 0 12px; overflow-x: auto; }
  .reading-tab { padding: 10px 14px; flex-shrink: 0; }
  .reading-tabs-actions { display: none; }
  .study-split { grid-template-columns: 1fr; }
  .source-pane { padding: 18px 14px; }
  .hebrew-block { padding: 12px 14px; }
  .hebrew-block .verse span { font-size: 15px; }
  .analysis-pane { padding: 16px 14px 32px; border-left: none; border-top: 1px solid var(--line); }
  .stage-body { padding: 4px 8px 20px 56px; }
  .analysis-missing-banner { flex-direction: column; align-items: stretch; }

  /* Mobile bottom dock */
  .mobile-dock { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 20; }
  .mobile-dock a { flex: 1; text-align: center; padding: 10px 0; color: var(--ink-muted); font-family: var(--font-ui); font-size: 10px; text-decoration: none; }
  .mobile-dock a.active { color: var(--accent); }
  .mobile-dock a .ico { display: grid; place-items: center; margin-bottom: 2px; }
}
@media (min-width: 601px) {
  .mobile-dock { display: none; }
}

/* ── TWEAKS PANEL ─────────────────────────────────────── */
.appbar-tweaks { width: 28px; height: 28px; border: 1px solid var(--line); background: var(--surface-alt); border-radius: var(--radius); display: grid; place-items: center; color: var(--ink-muted); cursor: pointer; padding: 0; }
.appbar-tweaks:hover { background: var(--surface); color: var(--ink); }
.tweaks-popover { position: fixed; width: 260px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-popover); padding: 16px; font-family: var(--font-ui); z-index: 200; animation: cal-pop-in 160ms ease; }
.tweaks-popover .eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.8px; color: var(--ink-faint); text-transform: uppercase; margin-bottom: 10px; }
.tweak-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--canvas); cursor: pointer; text-align: left; font: inherit; color: inherit; }
.tweak-option:hover { background: var(--surface-alt); }
.tweak-option.selected { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tweak-option .ico { width: 24px; height: 24px; display: grid; place-items: center; flex-shrink: 0; color: var(--accent); }
.tweak-option .text { flex: 1; }
.tweak-option .t-title { font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--ink); }
.tweak-option.selected .t-title { color: var(--accent); }
.tweak-option .t-sub { font-family: var(--font-body); font-size: 12px; color: var(--ink-muted); }
.tweak-option .check { width: 16px; display: grid; place-items: center; color: var(--accent); opacity: 0; }
.tweak-option.selected .check { opacity: 1; }
.tweaks-popover .foot { display: flex; justify-content: flex-end; margin-top: 6px; }

/* ── DEMO BADGE ───────────────────────────────────────── */
.demo-badge { position: fixed; bottom: 12px; right: 12px; padding: 6px 10px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--ink-faint); text-transform: uppercase; z-index: 50; pointer-events: none; }
@media (max-width: 600px) { .demo-badge { bottom: 64px; } }

/* ── AUTH MODAL ─────────────────────────────────────── */
.auth-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 2000; animation: gen-fade 160ms ease; }
.auth-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 420px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-popover); z-index: 2001; overflow: hidden; font-family: var(--font-ui); animation: gen-pop 220ms ease-out; }
.auth-head { padding: 20px 24px 10px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.auth-head h2 { font-family: var(--font-display); font-size: 24px; font-weight: 500; color: var(--ink); margin: 0; flex: 1; }
.auth-close { background: transparent; border: 1px solid var(--line); border-radius: var(--radius); width: 28px; height: 28px; display: grid; place-items: center; color: var(--ink-muted); cursor: pointer; }
.auth-close:hover { background: var(--surface-alt); color: var(--ink); }
.auth-body { padding: 18px 24px 24px; }
.auth-sub { font-family: var(--font-body); font-size: 14px; color: var(--ink-muted); margin: 0 0 14px; line-height: 1.5; }
.auth-input-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px; color: var(--ink-faint); text-transform: uppercase; margin-bottom: 6px; display: block; }
.auth-input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--canvas); color: var(--ink); font-family: var(--font-ui); font-size: 14px; box-sizing: border-box; }
.auth-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.auth-actions { display: flex; gap: 10px; margin-top: 14px; }
.auth-actions .btn { flex: 1; justify-content: center; }
.auth-confirm { padding: 14px 0; text-align: center; font-family: var(--font-body); font-size: 15px; color: var(--ink); line-height: 1.5; }
.auth-confirm strong { color: var(--accent); }
.auth-toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 10px 16px; font-family: var(--font-ui); font-size: 13px; color: var(--ink); box-shadow: var(--shadow-popover); z-index: 3000; animation: gen-fade 200ms ease; }
.auth-toast.err { border-color: var(--danger); color: var(--danger); }
.auth-toast.ok { border-color: var(--success); color: var(--success); }
.auth-toast.warn { border-color: var(--accent); color: var(--accent); }

/* ── USER DROPDOWN ───────────────────────────────────── */
.user-dropdown { position: fixed; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-popover); padding: 8px; font-family: var(--font-ui); z-index: 1500; min-width: 160px; animation: gen-fade 160ms ease; }
.user-dropdown button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border: none; background: transparent; border-radius: var(--radius); color: var(--ink); font-family: var(--font-ui); font-size: 14px; cursor: pointer; text-align: left; }
.user-dropdown button:hover { background: var(--surface-alt); }
.user-dropdown button.danger { color: var(--danger); }

/* ── SCHEMA ADAPTER CONTENT (real analysis) ───────────── */
.stage-body-real { font-family: var(--font-body); font-size: 15px; line-height: 1.7; color: var(--ink); max-width: 680px; }
.stage-body-real p { margin: 0 0 12px; }
.stage-body-real p:last-child { margin-bottom: 0; }
.stage-body-real strong { color: var(--ink); font-weight: 600; }
.stage-body-real em { font-style: italic; }
.stage-body-real code { font-family: var(--font-mono); font-size: 13px; background: var(--surface-alt); padding: 1px 5px; border-radius: var(--radius); color: var(--accent); }
.stage-body-real ul { margin: 0 0 12px; padding-left: 22px; }
.stage-body-real li { margin: 0 0 6px; }
.stage-body-real h3.stage-section-title { font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--ink); margin: 18px 0 8px; letter-spacing: -0.1px; }
.stage-body-real h3.stage-section-title:first-child { margin-top: 0; }
.stage-body-real hr.stage-divider { border: none; border-top: 1px dashed var(--line); margin: 18px 0; }
.stage-body-real .source-verse { font-family: var(--font-hebrew); font-size: 20px; line-height: 1.8; color: var(--ink); background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.stage-body-real .source-verse[lang="grc"] { font-family: var(--font-greek); font-size: 18px; }
.stage-body-real ol.bibliography {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  padding-left: 24px;
  margin: 0;
}
.stage-body-real ol.bibliography li {
  padding: 6px 0;
  scroll-margin-top: 80px;  /* so anchor jumps don't hide under the AppBar */
}
.stage-body-real ol.bibliography li:target {
  background: var(--accent-soft);
  border-radius: var(--radius);
}

/* Greek block (source pane, when reading is Greek) */
.analysis-missing-banner {
  display: flex; align-items: center; gap: 16px;
  margin: 0 24px 12px; padding: 10px 16px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-family: var(--font-ui); font-size: 13px; color: var(--accent);
}
.analysis-missing-banner .msg { flex: 1; }
.analysis-missing-banner .actions { display: flex; gap: 8px; }
.source-empty, .literal-empty {
  font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  color: var(--ink-faint); font-style: italic; margin: 0; padding: 4px 0;
}

/* Base-only hybrid CTA (gated 10-layer section) */
.base-only-cta {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 20px 24px; background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: var(--radius-lg); max-width: 480px;
}
.base-only-cta-heading {
  font-family: var(--font-display); font-size: 18px; font-weight: 500;
  color: var(--ink); margin: 0; letter-spacing: -0.1px;
}
.base-only-cta-desc {
  font-family: var(--font-body); font-size: 14px; line-height: 1.6;
  color: var(--ink-muted); margin: 0;
}

.greek-block { font-family: var(--font-greek); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px 28px; margin-bottom: 18px; color: var(--ink); }
.greek-block .verse { display: flex; gap: 12px; align-items: baseline; padding: 4px 0; }
.greek-block .verse sup { font-family: var(--font-ui); font-size: 10px; color: var(--accent); min-width: 14px; }

/* Interlinear verse sections */
.stage-body-real .interlinear-prefix {
  margin-bottom: 12px;
  color: var(--ink-muted);
  font-style: italic;
}
.stage-body-real section.interlinear-verse {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.stage-body-real section.interlinear-verse:first-of-type {
  border-top: none;
}
.stage-body-real section.interlinear-verse .verse-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  padding-top: 2px;
}
.stage-body-real section.interlinear-verse .verse-body p {
  margin: 0 0 8px;
}
.stage-body-real h2.stage-section-title,
.stage-body-real h3.stage-section-title {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 22px 0 8px;
  color: var(--ink);
}
.stage-body-real blockquote {
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 14px;
  margin: 14px 0;
  font-style: italic;
  color: var(--ink-muted);
}
.stage-body-real table {
  border-collapse: collapse;
  font-size: 13px;
  margin: 10px 0;
  width: 100%;
}
.stage-body-real th, .stage-body-real td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
}
.stage-body-real th {
  background: var(--surface-alt);
  font-weight: 500;
  font-family: var(--font-ui);
}
.stage-body-real .hebrew-inline,
.stage-body-real [lang="he"] {
  font-family: var(--font-hebrew);
  font-size: 1.1em;
}
.stage-body-real .greek-inline,
.stage-body-real [lang="grc"] {
  font-family: var(--font-greek);
}

/* ── Brand subtitle ("by Lectio") ───────────────────────────────────── */
.brand-subtitle {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--ink-faint);
  font-weight: 400;
  vertical-align: middle;
}

/* ── Onboarding persona card (shown after submit when persona_name returned) */
.onb-persona-card {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin: 0 0 20px;
  animation: gen-fade 240ms ease;
}
.onb-persona-card .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}
.onb-persona-card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin: 6px 0 4px;
  color: var(--ink);
}
.onb-persona-card p {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0;
}
.greek-block .verse span { font-size: 16px; line-height: 1.9; word-break: break-word; overflow-wrap: break-word; }
