/*
 * Axios: a warm, library-like study at night.
 * Deep teal and old gold, serif headings, small-caps gold labels.
 * Dark is the default; light and "match my device" are offered under You.
 */

:root, :root[data-theme="dark"] {
  --bg: #0d1618;
  --bg-glow: rgba(214, 167, 86, .07);
  --surface: #142124;
  --surface-2: #1a2b2f;
  --surface-3: #22363b;
  --ink: #f2e8d7;
  --ink-2: #d2c5b0;
  --muted: #9b998d;
  --rule: #263b40;
  --rule-strong: #34505a;
  --gold: #d9ab5c;
  --gold-soft: rgba(217, 171, 92, .14);
  --gold-line: rgba(217, 171, 92, .35);
  --accent: #d9ab5c;            /* links and focus accents */
  --accent-soft: rgba(217, 171, 92, .12);
  --accent-ink: #1b1407;
  --btn-1: #e6bb6c;
  --btn-2: #b98632;
  --btn-ink: #1b1407;
  --teal-1: #2a525b;
  --teal-2: #10272c;
  --danger: #f0a497;
  --danger-soft: #3a2420;
  --focus: #f2c879;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --dock-bg: rgba(13, 22, 24, .88);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4efe4;
  --bg-glow: rgba(31, 61, 69, .05);
  --surface: #fffdf8;
  --surface-2: #efe8da;
  --surface-3: #e6dccb;
  --ink: #1d2a2d;
  --ink-2: #3f4a4b;
  --muted: #676659;
  --rule: #ddd3c1;
  --rule-strong: #c9bca6;
  --gold: #8a5b1e;
  --gold-soft: rgba(138, 91, 30, .1);
  --gold-line: rgba(138, 91, 30, .35);
  --accent: #1f4f59;
  --accent-soft: #e0eae8;
  --accent-ink: #fbf3e4;
  --btn-1: #285d68;
  --btn-2: #1a3f47;
  --btn-ink: #fbf3e4;
  --teal-1: #2a525b;
  --teal-2: #142f35;
  --danger: #8f2d22;
  --danger-soft: #f5e3df;
  --focus: #1f5fa8;
  --shadow: 0 8px 24px rgba(40, 30, 10, .1);
  --dock-bg: rgba(244, 239, 228, .92);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg: #f4efe4; --bg-glow: rgba(31, 61, 69, .05); --surface: #fffdf8; --surface-2: #efe8da; --surface-3: #e6dccb;
    --ink: #1d2a2d; --ink-2: #3f4a4b; --muted: #676659; --rule: #ddd3c1; --rule-strong: #c9bca6;
    --gold: #8a5b1e; --gold-soft: rgba(138, 91, 30, .1); --gold-line: rgba(138, 91, 30, .35);
    --accent: #1f4f59; --accent-soft: #e0eae8; --accent-ink: #fbf3e4;
    --btn-1: #285d68; --btn-2: #1a3f47; --btn-ink: #fbf3e4;
    --danger: #8f2d22; --danger-soft: #f5e3df; --focus: #1f5fa8;
    --shadow: 0 8px 24px rgba(40, 30, 10, .1); --dock-bg: rgba(244, 239, 228, .92);
    color-scheme: light;
  }
}

:root {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 40rem;
  --radius: 16px;
  --radius-sm: 10px;
  --tabbar-h: 4.25rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(120% 60% at 50% -10%, var(--bg-glow), transparent 60%) no-repeat, var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }
main.wrap { padding-top: 1.25rem; padding-bottom: 5rem; min-height: 60vh; }
main:focus { outline: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 6vw, 2.5rem); margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; margin: 2rem 0 .6rem; }
h3 { font-size: 1.12rem; margin: 1.4rem 0 .4rem; }
h1:focus, h2:focus { outline: none; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
blockquote { margin: 1rem 0; padding: .2rem 0 .2rem 1rem; border-left: 2px solid var(--gold-line); color: var(--ink-2); font-family: var(--serif); font-style: italic; }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: .35rem; }
cite, em { font-style: italic; }
svg { display: block; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: absolute; left: -999px; top: .5rem; background: var(--surface); color: var(--ink); padding: .5rem 1rem; z-index: 50; }
.skip-link:focus { left: .5rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.muted { color: var(--muted); }
.small { font-size: .88rem; }
.eyebrow {
  font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 .35rem; display: block;
}
.eyebrow.gold, .gold { color: var(--gold); }
.lede { font-size: 1.1rem; color: var(--ink-2); max-width: var(--measure); }
.prose { max-width: var(--measure); font-family: var(--serif); font-size: 1.12rem; line-height: 1.7; }
.prose h2, .prose h3 { font-family: var(--serif); }
.note { border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 2rem; }

/* Section labels: gold small caps with a hairline, as in a printed book. */
.section-label {
  display: flex; align-items: center; gap: .75rem; margin: 2rem 0 .85rem;
  font-family: var(--sans); font-size: .74rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold);
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.6rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 2.1rem; height: 2.1rem; display: block; border-radius: 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-word { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; letter-spacing: .04em; }
.brand-tag { font-family: var(--sans); font-size: .58rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-top: .2rem; }
.site-nav { display: none; gap: .15rem; font-size: .92rem; align-items: center; }
.site-nav a { color: var(--ink-2); text-decoration: none; padding: .45rem .75rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .45rem; }
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--gold); background: var(--gold-soft); font-weight: 600; }

.avatar {
  display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  font-family: var(--serif); font-weight: 700; font-size: .95rem; color: var(--gold);
  background: var(--surface-2); border: 1px solid var(--gold-line);
}
.avatar-lg { width: 4rem; height: 4rem; font-size: 1.8rem; flex: none; }

.site-footer { border-top: 1px solid var(--rule); padding: 1.5rem 0 calc(var(--tabbar-h) + 2rem); font-size: .9rem; }
.footer-inner nav { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: .5rem; }
.footer-inner a { color: var(--ink-2); }

/* ---------- Bottom tab bar (phones and tablets) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--rule);
  padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .3rem 0;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 500;
}
.tabbar svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--gold); }
.tabbar a[aria-current="page"] svg { stroke-width: 2; }

@media (min-width: 900px) {
  .site-nav { display: flex; }
  .tabbar { display: none; }
  .site-footer { padding-bottom: 2rem; }
  main.wrap { padding-bottom: 4rem; }
  .wrap { max-width: 48rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font-family: var(--sans); font-size: .95rem; font-weight: 600; line-height: 1.2;
  padding: .7rem 1.15rem; min-height: 2.9rem;
  border-radius: 12px; border: 1px solid var(--rule-strong); background: var(--surface-2); color: var(--ink);
  cursor: pointer; text-decoration: none; transition: transform .08s ease, filter .15s ease, border-color .15s;
}
.btn:hover { border-color: var(--gold-line); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--btn-1), var(--btn-2)); border-color: transparent; color: var(--btn-ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { filter: brightness(1.06); border-color: transparent; }
.btn-quiet { background: transparent; }
.btn-link { background: transparent; border-color: transparent; color: var(--accent); text-decoration: underline; padding-left: .25rem; padding-right: .25rem; font-weight: 500; }
.btn-link:hover { border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--bg); }
.btn-large { font-size: 1.05rem; padding: .9rem 1.5rem; }
.btn-small { font-size: .85rem; padding: .4rem .75rem; min-height: 2.3rem; border-radius: 10px; }
.btn-block { width: 100%; min-height: 3.3rem; font-size: 1.05rem; border-radius: 14px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-ico { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.row-tight { margin: .4rem 0; gap: .35rem; }

.icon-btn {
  display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: color-mix(in srgb, var(--surface-2) 85%, transparent); border: 1px solid var(--rule-strong); color: var(--ink);
  cursor: pointer; flex: none; padding: 0;
}
.icon-btn svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-pressed="true"] { color: var(--gold); border-color: var(--gold-line); }
.icon-btn[aria-pressed="true"] svg { fill: var(--gold-soft); }
.icon-btn-spacer { width: 2.6rem; }

.chip {
  font-family: var(--sans); font-size: .85rem; font-weight: 500; padding: .4rem .85rem; min-height: 2.2rem;
  border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.chip:hover { border-color: var(--gold-line); color: var(--gold); }
.chip-ai { border-style: dashed; }
.pill {
  display: inline-flex; align-items: center; font-size: .85rem; padding: .35rem .85rem; border-radius: 999px;
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink-2); white-space: nowrap;
}
.chips-row { display: flex; gap: .45rem; flex-wrap: wrap; margin: .25rem 0 1rem; }
.chips-row.center { justify-content: center; }

/* ---------- Forms ---------- */
.input, textarea.answer {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: 12px; padding: .8rem .95rem;
}
.input { font-family: var(--sans); font-size: 1rem; flex: 1 1 14rem; min-height: 2.9rem; }
textarea.answer { font-family: var(--serif); font-size: 1.12rem; line-height: 1.6; resize: vertical; min-height: 7rem; margin-top: .5rem; }
.input:focus, textarea.answer:focus { border-color: var(--gold); outline: 3px solid var(--gold-soft); }
.input::placeholder, textarea.answer::placeholder, .search-input::placeholder { color: var(--muted); opacity: .85; }
.input.invalid { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: .9rem; margin: .4rem 0 0; }
.hint { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.kbd-hint { white-space: nowrap; }
@media (hover: none) { .kbd-hint { display: none; } }
.field { display: grid; gap: .3rem; font-size: .92rem; margin: .5rem 0; color: var(--ink-2); }
.field-label { font-size: .92rem; color: var(--ink-2); margin: 1rem 0 .4rem; }
.check { display: flex; gap: .5rem; align-items: center; }

/* Search: one box, a gold arrow */
.search {
  display: flex; align-items: center; gap: .5rem; padding: .35rem .35rem .35rem 1rem; margin: 1rem 0 1.25rem;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 16px;
}
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.search-icon svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; }
.search-input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.02rem; padding: .7rem 0; outline: none; }
.search-input::-webkit-search-cancel-button { filter: grayscale(1); }
.search-go {
  display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 12px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, var(--btn-1), var(--btn-2)); color: var(--btn-ink); flex: none;
}
.search-go svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Segmented control */
.segmented { display: flex; border: 1px solid var(--rule-strong); border-radius: 12px; padding: .25rem; margin: 0; background: var(--surface); gap: .2rem; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { flex: 1; text-align: center; padding: .55rem .5rem; border-radius: 9px; cursor: pointer; font-size: .9rem; font-weight: 500; color: var(--ink-2); }
.segmented input:checked + label { background: var(--gold-soft); color: var(--gold); font-weight: 600; box-shadow: inset 0 0 0 1px var(--gold-line); }
.segmented input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.mode-wrap { margin: .5rem 0 1.25rem; }
.mode-note { margin: .5rem 0 0; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 70%, var(--bg)));
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin: 1rem 0;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card h2 { margin-top: .2rem; }
.card.subtle { background: var(--surface-2); border-color: transparent; }
.cards { display: grid; gap: 1rem; margin: 1.5rem 0; }
.cards.three { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.cards .card { margin: 0; }
.card.current { border-left: 3px solid var(--gold); }
.danger-zone { border-color: var(--danger); background: var(--danger-soft); }

/* Feature card: thumbnail, gold eyebrow, serif title, a line of invitation */
.feature-card, .reading-card {
  position: relative; display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; margin: .75rem 0;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 70%, var(--bg)));
  border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); text-decoration: none;
  transition: border-color .15s, transform .1s;
}
.feature-card:hover, .reading-card:hover { border-color: var(--gold-line); }
.feature-card:active, .reading-card:active { transform: scale(.995); }
.feature-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.feature-body .eyebrow { margin: 0; font-size: .68rem; }
.feature-title { font-family: var(--serif); font-weight: 700; font-size: 1.12rem; line-height: 1.3; color: var(--ink); }
.feature-sub { font-size: .9rem; color: var(--muted); line-height: 1.45; }
.feature-card.compact .feature-title { font-size: 1.02rem; }
.chev svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.done-dot {
  position: absolute; top: .6rem; right: .6rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: var(--accent-ink); font-size: .75rem; font-weight: 700;
}
.reading-card.is-read .feature-title { color: var(--ink-2); }

/* ---------- Art tiles (deep teal with gold line emblems) ---------- */
.art {
  display: grid; place-items: center; position: relative; overflow: hidden; color: #e3b866;
  background:
    radial-gradient(90% 70% at 75% 15%, rgba(232, 184, 96, .28), transparent 60%),
    radial-gradient(70% 60% at 10% 100%, rgba(0, 0, 0, .45), transparent 70%),
    linear-gradient(160deg, var(--teal-1), var(--teal-2));
}
.art::before {
  /* a faint Greek-key band along the bottom edge */
  content: ""; position: absolute; inset: auto 0 0 0; height: 10px; opacity: .22;
  background-image: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 10px), linear-gradient(currentColor, currentColor);
  background-size: 100% 6px, 100% 1px; background-repeat: no-repeat; background-position: 0 0, 0 100%;
}
.art .emblem { width: 58%; height: 58%; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }
.art-thumb { width: 4.4rem; height: 4.4rem; border-radius: 12px; flex: none; }
.art-dot { width: 1.9rem; height: 1.9rem; border-radius: 50%; flex: none; }
.art-dot::before { display: none; }
.art-dot .emblem { width: 72%; height: 72%; stroke-width: 2.6; }
.art-fill { position: absolute; inset: 0; }
.art-fill .emblem { width: 46%; height: 46%; position: absolute; right: 8%; top: 10%; opacity: .9; }
.art-banner { position: absolute; inset: 0; }
.art-banner .emblem { width: 9rem; height: 9rem; position: absolute; right: 6%; top: 1.5rem; opacity: .85; }

/* ---------- Today ---------- */
.greet { margin: .75rem 0 0; }
.greet h1 { font-size: clamp(2rem, 7vw, 2.6rem); margin-bottom: .2rem; }
.greet-sub { color: var(--muted); font-size: 1.08rem; margin: 0; }

.start-card h2, .continue-card h2 { font-size: 1.3rem; margin: 0 0 .3rem; }
.continue-top { display: flex; gap: 1rem; align-items: center; margin-bottom: .8rem; }
.continue-top .eyebrow { margin-bottom: .15rem; }
.continue-q { font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--ink-2); margin: .2rem 0 1rem; }
.meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--btn-2), var(--btn-1)); }
.meter.thin { height: 4px; margin-top: .55rem; }
.meter-caption { font-size: .82rem; color: var(--muted); margin: .4rem 0 1rem; }

.lookback { border-color: var(--gold-line); }
.lookback-q { font-size: .92rem; color: var(--muted); margin: 0 0 .5rem; }
.lookback-a { font-size: 1.12rem; color: var(--ink); margin: .5rem 0 1rem; }
.lookback-ask { font-family: var(--serif); font-size: 1.05rem; margin-bottom: .4rem; }

.tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.tool {
  position: relative; display: flex; align-items: flex-end; aspect-ratio: 16 / 10; padding: .8rem .9rem; overflow: hidden;
  border-radius: var(--radius); text-decoration: none; color: #f6ead3; box-shadow: var(--shadow);
  border: 1px solid rgba(217, 171, 92, .18);
}
.tool::after { content: ""; position: absolute; inset: 40% 0 0 0; background: linear-gradient(180deg, transparent, rgba(5, 12, 14, .78)); }
.tool-name { position: relative; z-index: 1; font-family: var(--serif); font-weight: 700; font-size: 1.12rem; line-height: 1.2; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.tool-name::after { content: ""; display: block; width: 2rem; height: 2px; margin-top: .35rem; background: #d9ab5c; border-radius: 2px; }
.tool:hover { border-color: rgba(217, 171, 92, .5); }
@media (min-width: 640px) { .tool-grid { grid-template-columns: repeat(4, 1fr); } }

.recent-row { display: flex; gap: .55rem; overflow-x: auto; padding-bottom: .4rem; margin: 0 -1.25rem; padding-left: 1.25rem; padding-right: 1.25rem; scrollbar-width: none; }
.recent-row::-webkit-scrollbar { display: none; }
.recent {
  display: inline-flex; align-items: center; gap: .55rem; white-space: nowrap; flex: none;
  padding: .35rem 1rem .35rem .35rem; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--surface);
  color: var(--ink); text-decoration: none; font-size: .92rem;
}
.recent:hover { border-color: var(--gold-line); }

.week-strip { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; padding: 0; margin: 0 0 .6rem; }
.week-strip li { display: flex; flex-direction: column; align-items: center; gap: .35rem; margin: 0; }
.wk-day { font-size: .75rem; color: var(--muted); font-weight: 600; }
.wk-dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid var(--rule-strong); background: var(--surface); }
.week-strip li.on .wk-dot { background: radial-gradient(circle at 35% 30%, var(--btn-1), var(--btn-2)); border-color: transparent; box-shadow: 0 0 12px var(--gold-soft); }
.week-strip li.today .wk-day { color: var(--gold); }
.week-strip li.today .wk-dot { border-color: var(--gold); }
.week-strip li.future .wk-dot { opacity: .45; }
.privacy-line { margin-top: 2rem; font-size: .85rem; color: var(--muted); text-align: center; }

/* Top line on focused screens: back, title, action */
.topline { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .25rem 0 1rem; }
.topline-title { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; text-align: center; flex: 1; }

/* The question of the day */
.daily-head { margin: .5rem 0 1rem; }
.daily-q { font-size: clamp(1.6rem, 5.5vw, 2.1rem); line-height: 1.25; }
.callout {
  position: relative; margin: 1.25rem 0; padding: 1.1rem 1.2rem 1.1rem 1.3rem; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 60%, var(--bg)));
  border: 1px solid var(--rule); border-left: 3px solid var(--gold);
}
.callout-title { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; font-size: 1.15rem; }
.spark svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; transform: rotate(45deg); }
.callout p { margin: 0 0 .4rem; color: var(--ink-2); font-size: 1.02rem; }
.callout-src { font-size: .82rem !important; color: var(--muted) !important; font-style: italic; }
.echo-card { margin: 1rem 0; padding: .9rem 1.1rem; border-radius: var(--radius); border: 1px dashed var(--gold-line); }
.echo-card blockquote { margin: .4rem 0 .6rem; }
.answer-card { position: relative; padding-right: 3.6rem; }
.answer-text { font-family: var(--serif); font-size: 1.15rem; white-space: pre-wrap; margin: 0; }
.answer-card .line-edit { position: absolute; top: 1rem; right: 1rem; }
.carry p:last-child { margin: 0; }

/* Sticky action dock: icon actions over one strong button */
.action-dock { margin: 1rem 0; display: grid; gap: .25rem; }
.dock {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 15;
  margin: 1.5rem -1.25rem 0; padding: .4rem 1.25rem .9rem;
  background: linear-gradient(180deg, transparent, var(--dock-bg) 22%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
@media (min-width: 900px) { .dock { bottom: 0; } }
.dock-icons { display: flex; justify-content: space-around; margin-bottom: .4rem; }
.dock-btn {
  display: flex; flex-direction: column; align-items: center; gap: .15rem; background: none; border: 0; cursor: pointer;
  color: var(--ink-2); font: inherit; font-size: .8rem; padding: .35rem .9rem; border-radius: 10px;
}
.dock-btn svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dock-btn:hover { background: var(--surface-2); }
.dock-btn[aria-pressed="true"] svg { fill: var(--gold-soft); stroke-width: 2; }
.dock-btn[aria-pressed="true"] { color: var(--gold); }

/* ---------- Study path ---------- */
.path { list-style: none; padding: 0; margin: 0; position: relative; }
.path::before { content: ""; position: absolute; left: 1.05rem; top: 1rem; bottom: 1rem; width: 1px; background: linear-gradient(var(--gold-line), var(--rule)); }
.path-item { position: relative; padding-left: 3rem; margin: 0 0 .85rem; }
.path-node {
  position: absolute; left: 0; top: 1.4rem; width: 2.15rem; height: 2.15rem; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: .95rem; background: var(--bg); border: 1px solid var(--rule-strong); color: var(--muted);
}
.status-in-progress .path-node, .is-next .path-node { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.status-complete .path-node { background: var(--gold); color: var(--accent-ink); border-color: var(--gold); }
.path-card {
  position: relative; display: block; overflow: hidden; border-radius: var(--radius); text-decoration: none; color: var(--ink);
  border: 1px solid var(--rule); min-height: 7.5rem; background: var(--surface);
}
.path-card .art-fill { left: auto; width: 34%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%); mask-image: linear-gradient(90deg, transparent, #000 45%); }
.path-card .art-fill .emblem { width: 62%; height: 62%; right: 14%; top: 18%; }
.path-card:hover { border-color: var(--gold-line); }
.path-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.1rem; max-width: 76%; }
.path-text .eyebrow { margin: 0; font-size: .66rem; }
.path-title { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; line-height: 1.25; }
.path-q { font-size: .9rem; color: var(--muted); line-height: 1.4; }
.path-reason { margin: .4rem 0 0 .2rem; }
.status-complete .path-title { color: var(--ink-2); }

.topic-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.topic { display: grid; gap: .3rem; padding: 1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); }
.topic:hover { border-color: var(--gold-line); }
.topic-q { font-family: var(--serif); font-size: 1.05rem; line-height: 1.4; }
.topic-reading { background: var(--surface-2); }

.rec-list { list-style: none; padding: 0; }
.rec-list li { margin-bottom: .8rem; }
.rec-list p { margin: .1rem 0 0; }
.plain { list-style: none; padding: 0; }
.plain li { padding: .55rem 0; border-bottom: 1px solid var(--rule); margin: 0; }

/* ---------- Module ---------- */
.module-hero, .reading-hero {
  position: relative; overflow: hidden; margin: -1.25rem -1.25rem 1.25rem; padding: 1rem 1.25rem 1.25rem;
  min-height: 12rem; display: flex; flex-direction: column; justify-content: flex-end;
}
.module-hero::after, .reading-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 12, 14, .05) 0%, rgba(5, 12, 14, .35) 45%, var(--bg) 100%); }
.module-hero-text, .reading-hero-text { position: relative; z-index: 1; }
.module-hero h1 { margin: 0 0 .3rem; }
.module-hero .eyebrow { margin-bottom: .25rem; }
.hero-controls { position: absolute; z-index: 2; top: 1rem; left: 1.25rem; right: 1.25rem; display: flex; justify-content: space-between; }
.reading-hero { min-height: 17rem; }
.reading-hero h1 { margin-bottom: .5rem; }
.hero-quote { font-family: var(--serif); font-style: italic; font-size: 1.18rem; line-height: 1.5; color: var(--ink-2); margin: 0; }
/* In light mode the hero stays a dark teal panel so its gold and cream text keep their contrast. */
:root[data-theme="light"] .module-hero, :root[data-theme="light"] .reading-hero { border-radius: 0 0 var(--radius) var(--radius); }
:root[data-theme="light"] .module-hero::after, :root[data-theme="light"] .reading-hero::after { background: linear-gradient(180deg, rgba(8, 24, 28, .05) 0%, rgba(8, 24, 28, .55) 50%, rgba(10, 30, 34, .96) 100%); }
:root[data-theme="light"] .module-hero h1, :root[data-theme="light"] .reading-hero h1 { color: #f6ead3; }
:root[data-theme="light"] .module-hero .eyebrow, :root[data-theme="light"] .reading-hero .eyebrow { color: #e3b866; }
:root[data-theme="light"] .hero-quote { color: #e6dbc6; }
:root[data-theme="light"] .module-hero .meter { background: rgba(255, 255, 255, .18); }
:root[data-theme="light"] .module-hero .meter span { background: linear-gradient(90deg, #b98632, #e6bb6c); }
@media (min-width: 900px) {
  .module-hero, .reading-hero { margin: 0 0 1.25rem; border-radius: var(--radius); }
}

.stepper { margin: 0 -1.25rem 1.5rem; padding: 0 1.25rem; overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper ol { list-style: none; display: flex; gap: .35rem; padding: 0; margin: 0; font-size: .82rem; white-space: nowrap; }
.stepper li { margin: 0; }
.stepper a { display: block; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--muted); text-decoration: none; }
.stepper li.done a { color: var(--gold); border-color: var(--gold-line); }
.stepper li.done a::before { content: "✓ "; }
.stepper li.current a { color: var(--accent-ink); background: var(--gold); border-color: var(--gold); font-weight: 600; }

.step-nav { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.central-q { font-family: var(--serif); font-size: 1.3rem; font-style: italic; color: var(--ink); border-left: 2px solid var(--gold); padding-left: 1rem; max-width: var(--measure); }

/* ---------- Question block ---------- */
.question-block { max-width: 44rem; }
.question-block .prompt { font-size: clamp(1.45rem, 4.5vw, 1.8rem); margin: 0 0 .8rem; font-weight: 700; line-height: 1.3; }
.context { color: var(--ink-2); }
.scenario { background: var(--surface-2); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0; font-family: var(--serif); }
.scenario p:last-child { margin-bottom: 0; }
.hypothetical { margin: .5rem 0; }
.echo { border-left: 2px solid var(--gold); padding: .2rem 0 .2rem 1rem; margin: 1rem 0; }
.echo blockquote { border: none; padding: 0; margin: .3rem 0; }
.hypothetical.on p { background: var(--gold-soft); padding: .8rem 1rem; border-radius: 10px; margin-top: .5rem; }

.thread { display: grid; gap: .75rem; margin: 1rem 0; }
.turn { padding: .95rem 1.15rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--rule); }
.turn p:last-child { margin-bottom: 0; }
.turn > p:not(.turn-label) { font-family: var(--serif); font-size: 1.06rem; }
.turn-label { font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 .35rem !important; }
.turn-user { background: var(--surface-2); border-color: transparent; }
.turn-user .turn-label { color: var(--muted); }
.turn-main { margin-top: 1rem; }
.turn-followup { border-left: 3px solid var(--gold); }
.turn-followup > p:nth-child(2) { font-size: 1.15rem; }
.turn-ack, .turn-close, .turn-revision { background: transparent; border-style: dashed; color: var(--ink-2); }
.turn-aid { border-left: 3px solid var(--gold-line); }
.reply { margin: .5rem 0 1rem; }
.aids { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 1rem 0; padding: .9rem 0; border-top: 1px solid var(--rule); }
.aids-label { font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: .2rem; }
.question-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.optional-reading { margin-top: 2rem; padding: 1rem; border: 1px dashed var(--rule-strong); border-radius: var(--radius); }

/* Anonymous sharing */
.share-box { margin: .25rem 0 .5rem; }
.share-ask { background: var(--surface-2); border-radius: var(--radius); padding: .9rem 1.1rem; font-size: .96rem; }
.share-ask p { margin-bottom: .5rem; }

/* AI tutor (look only; behaviour lives in tutor.js and api/ai.php) */
.tutor {
  margin: 1.25rem 0; padding: 1.1rem 1.2rem; border-radius: var(--radius);
  border: 1px solid var(--gold-line);
  background: radial-gradient(120% 80% at 100% 0%, var(--gold-soft), transparent 60%), var(--surface);
}
.tutor-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.tutor h3 { margin: 0 0 .4rem; font-size: 1.12rem; }
.tutor h3::before { content: "✦ "; color: var(--gold); }
.tutor .thread { margin: .75rem 0; }
.turn-tutor { background: var(--surface-2); border-left: 3px solid var(--gold); }
.tutor-text { white-space: pre-wrap; }
.tutor-save { margin-top: .2rem; padding-left: 0; }
.tutor .aids { border-top: none; padding-top: 0; margin-top: .25rem; }
.tutor textarea.answer { min-height: 5rem; }

/* Badges */
.badge { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .04em; padding: .15rem .6rem; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--muted); vertical-align: middle; }
.badge-established { color: var(--gold); border-color: var(--gold-line); }
.badge-contested { color: var(--ink-2); border-color: var(--rule-strong); border-style: dashed; }
.badge-suggestion { border-style: dashed; }

/* Perspectives */
.perspectives { display: grid; gap: .9rem; margin: 1rem 0; }
.perspective { border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.2rem; background: var(--surface); }
.perspective header { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .3rem; }
.perspective h3 { margin: 0; }
.perspective > p { font-family: var(--serif); }
.perspective p:last-child { margin-bottom: 0; }
.objection { font-size: .98rem; color: var(--ink-2); }
.examples { max-width: var(--measure); }
.example { background: var(--surface-2); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0; font-family: var(--serif); }
.example h3 { margin-top: 0; }
.example p:last-child { margin-bottom: 0; }

/* ---------- Library ---------- */
.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.tabs { display: flex; gap: .25rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; font-size: .95rem; margin-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.tabs::-webkit-scrollbar { display: none; }
.toolbar .tabs { margin-bottom: 0; border-bottom: none; }
.tab {
  padding: .6rem .85rem; color: var(--muted); text-decoration: none; border: 0; border-bottom: 2px solid transparent; background: none;
  font: inherit; cursor: pointer; white-space: nowrap; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); font-weight: 600; }
.tabs-under { margin-top: .5rem; }
.reading-cards { list-style: none; padding: 0; margin: 0; }
.reading-cards li { margin: 0; }
.reading { max-width: var(--measure); }
.reading.inline { border-top: 1px solid var(--rule); padding-top: 1rem; }
.reflect-q { font-family: var(--serif); font-size: 1.2rem; }
.pathway-note { font-size: .9rem; background: var(--gold-soft); padding: .7rem 1rem; border-radius: 10px; }
.sources { margin-top: 1.5rem; padding-top: .5rem; font-size: .95rem; }
.sources ul { list-style: none; padding: 0; }
.sources li { margin-bottom: .6rem; }
.src-type { font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; padding: .12rem .45rem; border-radius: 4px; background: var(--surface-2); color: var(--gold); }
.verify { color: var(--gold); }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: .75rem 0; border-top: 1px solid var(--rule); margin-bottom: 0; }

/* Search results */
.result-list { list-style: none; padding: 0; margin: 0; }
.result-list li { margin: 0; }
.result { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem 0; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.result > span:last-child { display: flex; flex-direction: column; gap: .15rem; }
.result-title { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.result-sub { font-size: .9rem; color: var(--muted); }
.result:hover .result-title { color: var(--gold); }

/* Glossary term buttons */
button.term { font: inherit; color: inherit; background: none; border: none; padding: 0; border-bottom: 1px dotted var(--gold); cursor: help; }
button.term:hover { color: var(--gold); }
.glossary dt { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; margin-top: 1.4rem; }
.glossary dd { margin: .25rem 0 0; max-width: var(--measure); }

/* ---------- Philosophy of value: an editable document ---------- */
.edit-hint { display: flex; align-items: center; justify-content: center; gap: .45rem; color: var(--muted); font-size: .92rem; margin: 0 0 1rem; }
.edit-hint svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.doc {
  border: 1px solid var(--rule); border-radius: 20px; padding: .6rem 1.25rem 1rem;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 60%, var(--bg)));
}
.doc-section { border-top: 1px solid var(--rule); padding-top: .4rem; margin-top: .6rem; }
.doc-h { font-family: var(--sans); font-size: .74rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--gold); margin: .9rem 0 .2rem; }
.doc-line { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem 0; border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); }
.doc-line:last-child { border-bottom: 0; }
.doc-text { flex: 1; cursor: text; min-width: 0; }
.doc-text p { margin: 0; font-family: var(--serif); font-size: 1.08rem; line-height: 1.55; }
.doc-title .doc-text .eyebrow { font-family: var(--sans); }
.doc-title-text { font-size: clamp(1.5rem, 5vw, 1.9rem) !important; font-weight: 700; line-height: 1.2 !important; }
.doc-note .doc-text p { font-family: var(--sans); font-size: .88rem; color: var(--muted); }
.doc-sub { font-family: var(--sans) !important; font-size: .82rem !important; color: var(--muted); margin-top: .3rem !important; }
.line-edit {
  flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; cursor: pointer;
  background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold); padding: 0;
}
.line-edit svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.doc-line.editing { display: block; }
.line-input { min-height: 4.5rem !important; }
.add-line { background: none; border: 0; color: var(--gold); font: inherit; font-size: .9rem; padding: .6rem 0; cursor: pointer; }
.add-line:hover { text-decoration: underline; }
.callout-lite { font-size: .9rem; color: var(--ink-2); background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 12px; padding: .6rem .9rem; margin: 0 0 1rem; }
.more summary { font-weight: 600; }
details { margin: .5rem 0; }
details summary { cursor: pointer; font-size: .95rem; color: var(--accent); }

/* ---------- Journal ---------- */
.entry { padding: 1rem 0 1.25rem; border-bottom: 1px solid var(--rule); max-width: 44rem; }
.entry h3 { margin-top: 0; }
.entry.resolved h3 { color: var(--muted); }
.meta { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: .4rem; }
.entry-text { white-space: pre-wrap; font-family: var(--serif); font-size: 1.08rem; }
.daily-entry h3 { font-size: 1.02rem; color: var(--ink-2); }
.followup-entry, .version { border-left: 2px solid var(--rule-strong); padding-left: .8rem; margin: .6rem 0; }
.said { border-left: 2px solid var(--gold); padding-left: .8rem; margin-bottom: 1rem; }
.summary-preview .md h2 { margin-top: 0; }
.md ul { padding-left: 1.1rem; }

/* ---------- You ---------- */
.you-head { display: flex; gap: 1rem; align-items: center; margin: .75rem 0 .5rem; }
.you-head h1 { margin: 0; }
.you-head p { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .6rem; margin: 0 0 2rem; }
.stat { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: .8rem 1rem; }
.stat dt { font-size: .78rem; color: var(--muted); }
.stat dd { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 1.5rem; color: var(--gold); }
.link-list { display: grid; margin: 2rem 0 0; border-top: 1px solid var(--rule); }
.link-list a { padding: .85rem 0; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; display: flex; justify-content: space-between; }
.link-list a::after { content: "›"; color: var(--gold); font-size: 1.3rem; line-height: 1; }

/* Older option lists (sharing preference) */
.modes { border: 1px solid var(--rule); border-radius: var(--radius); padding: .8rem 1rem 1rem; margin: 0 0 1rem; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.modes legend { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); padding: 0 .3rem; }
.mode { display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; align-items: start; padding: .6rem .7rem; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.mode:has(input:checked) { background: var(--gold-soft); border-color: var(--gold-line); }
.mode input { margin-top: .35rem; accent-color: var(--gold); }
.mode-name { font-weight: 600; }
.mode-desc { grid-column: 2; font-size: .9rem; color: var(--muted); line-height: 1.45; }

.page-head { margin: .75rem 0 1.25rem; }
.page-head .eyebrow { color: var(--gold); }
.reflection { max-width: var(--measure); }
.hero { padding: 2rem 0 1rem; }

/* ---------- Banner, toast, dialogs ---------- */
.banner { background: var(--danger-soft); border: 1px solid var(--danger); border-radius: var(--radius); padding: .8rem 1rem; margin-top: 1rem; font-size: .95rem; }
.banner p { margin: 0 0 .3rem; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 1rem + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); font-size: .9rem; font-weight: 500; padding: .75rem 1.15rem; border-radius: 12px;
  max-width: calc(100vw - 2rem); transition: opacity .2s, transform .2s; box-shadow: var(--shadow);
}
@media (min-width: 900px) { .toast { bottom: 1.5rem; } }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.dialog { border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); max-width: min(32rem, calc(100vw - 2rem)); padding: 1.3rem 1.4rem; box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(4, 9, 10, .6); }
.dialog h2 { margin-top: 0; }

@media (max-width: 600px) {
  .wrap { padding: 0 1rem; }
  .card { padding: 1.05rem 1.1rem; }
  .module-hero, .reading-hero, .dock, .stepper, .recent-row { margin-left: -1rem; margin-right: -1rem; }
  .module-hero, .reading-hero, .stepper, .recent-row { padding-left: 1rem; padding-right: 1rem; }
  .dock { padding-left: 1rem; padding-right: 1rem; }
  .hero-controls { left: 1rem; right: 1rem; }
  .step-nav .btn-link { order: 3; width: 100%; }
  .question-foot { flex-direction: column-reverse; align-items: stretch; }
  .question-foot .btn-primary { width: 100%; }
  .art-banner .emblem { width: 7rem; height: 7rem; }
  .brand-tag { font-size: .52rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] .module-hero::after, :root[data-theme="system"] .reading-hero::after { background: linear-gradient(180deg, rgba(8, 24, 28, .05) 0%, rgba(8, 24, 28, .55) 50%, rgba(10, 30, 34, .96) 100%); }
  :root[data-theme="system"] .module-hero h1, :root[data-theme="system"] .reading-hero h1 { color: #f6ead3; }
  :root[data-theme="system"] .module-hero .eyebrow, :root[data-theme="system"] .reading-hero .eyebrow { color: #e3b866; }
  :root[data-theme="system"] .hero-quote { color: #e6dbc6; }
}

@media print {
  .site-header, .site-footer, .tabbar, .aids, .row, .step-nav, .stepper, .question-foot, .dock, .topline, .edit-hint, .chips-row, .line-edit, .add-line, details, .tutor { display: none !important; }
  :root, body { background: #fff !important; color: #000 !important; }
  .doc { border: 0; background: none; padding: 0; }
  .doc-text p, .doc-h { color: #000 !important; }
}
