/* ==========================================================================
   The Hero's Journey Process — "calm & premium" theme
   Brand palette from bryandaigle.com (navy + gold on soft paper)
   ========================================================================== */
:root {
  /* Navy from the Hero's Journey logo, teal-blue from the program diagrams,
     gold from bryandaigle.com, on a cool steel paper. */
  --ink: #0f2230;
  --ink-soft: #4a6b7c;
  --ink-faint: #86a0ad;
  --paper: #eff3f5;
  --card: #ffffff;
  --line: #dde6ea;
  --line-strong: #c5d3da;
  --accent: #1b3a4b;
  --accent-hover: #24506a;
  --accent-soft: #e4edf1;
  --accent-tint: #f1f5f7;
  --teal: #2f7ea3;
  --teal-soft: #dcecf3;
  --gold: #c9a13b;
  --gold-soft: #f6efdc;
  --gold-ink: #8a6d1d;
  --ok-bg: #e7f5ec;
  --ok-ink: #1d6b3c;
  --err-bg: #fdecec;
  --err-ink: #a33;
  --shadow: 0 1px 2px rgba(14, 30, 38, 0.04), 0 8px 24px -12px rgba(14, 30, 38, 0.12);
  --shadow-lg: 0 12px 40px -12px rgba(14, 30, 38, 0.25);
  --radius: 16px;
  --radius-sm: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nav-h: 3.4rem;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); background: var(--paper); color: var(--ink); line-height: 1.6; font-size: 16px; }
a { color: var(--accent); }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: 2rem; margin: 0 0 0.35rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
p { margin: 0 0 1rem; }
img { max-width: 100%; height: auto; }
.muted { color: var(--ink-soft); font-size: 0.92rem; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; }
.pre-line { white-space: pre-line; }
.eyebrow { letter-spacing: 0.12em; font-size: 0.72rem; text-transform: uppercase; font-weight: 700; color: var(--gold-ink); font-family: var(--sans); }

/* ---------- Top navigation ---------- */
.topnav { display: flex; align-items: center; gap: 1rem; height: var(--nav-h); padding: 0 1.25rem; background: rgba(255,255,255,0.92); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 0.55rem; white-space: nowrap; }
.brand-ico { width: 32px; height: 32px; background: url('/content-images/hj-mark-128.png') center/contain no-repeat; flex: none; }
.topnav nav { display: flex; gap: 0.15rem; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav nav::-webkit-scrollbar { display: none; }
.topnav nav a { text-decoration: none; padding: 0.4rem 0.7rem; border-radius: 999px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.92rem; font-weight: 500; white-space: nowrap; }
.nav-ico { width: 17px; height: 17px; flex: none; }
.topnav nav a:hover { background: var(--accent-soft); color: var(--ink); }
.topnav nav a.active { background: var(--accent); color: #fff; }
.topnav .admin-link { color: var(--gold-ink); }
.topnav .admin-link.active { background: var(--accent); color: #fff; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }
.menu { position: relative; }
.menu summary { cursor: pointer; list-style: none; padding: 0.35rem 0.7rem; border-radius: 999px; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--accent-soft); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; flex: none; }
.menu-body { position: absolute; right: 0; top: 110%; min-width: 180px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.5rem; box-shadow: var(--shadow-lg); }
.menu-body .linklike { display: block; width: 100%; text-align: left; padding: 0.45rem 0.6rem; border-radius: 6px; }
.menu-body .linklike:hover { background: var(--accent-soft); text-decoration: none; }
.aa-btn { background: none; border: none; font: inherit; font-weight: 700; cursor: pointer; padding: 0.35rem 0.6rem; border-radius: 999px; color: var(--ink-soft); }
.aa-btn:hover { background: var(--accent-soft); color: var(--ink); }

/* Mobile bottom tab bar */
.tabbar { display: none; }
@media (max-width: 760px) {
  .topnav { padding: 0 0.9rem; }
  .topnav nav { display: none; }
  .brand span.brand-text { display: none; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: rgba(255,255,255,0.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 0.3rem 0.25rem calc(0.3rem + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; text-decoration: none; color: var(--ink-soft); font-size: 0.68rem; padding: 0.3rem 0; border-radius: 10px; }
  .tabbar a .nav-ico { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--accent); font-weight: 700; }
  body { padding-bottom: 4.2rem; }
}

/* ---------- Layout ---------- */
.container { max-width: 960px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0.25rem 0 1.25rem; }
.page-head h1 { margin: 0; }
.page-head .lead { margin: 0.2rem 0 0; color: var(--ink-soft); max-width: 60ch; }
.page-head-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.page-intro { background: var(--accent-soft); padding: 0.9rem 1.1rem; border-radius: var(--radius-sm); color: var(--ink-soft); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 2rem 0 0.75rem; }
.section-title h2 { margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 0.75rem 0; box-shadow: var(--shadow); }
.card-flat { box-shadow: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; }
.grid-2 > .card, .grid-3 > .card, .grid-4 > .card { margin: 0; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; } }

.big-num { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--teal)); border-radius: 999px; }
.bar-gold .bar-fill { background: linear-gradient(90deg, var(--gold), #e0be63); }
.progress-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.focus-value { font-size: 1.02rem; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.55rem 1rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--card); color: var(--ink); text-decoration: none; font: inherit; font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: background 0.15s, transform 0.08s; white-space: nowrap; }
.btn:hover { background: var(--accent-soft); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: #b8912f; }
.btn-danger { color: var(--err-ink); }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.85rem; }
.btn-lg { padding: 0.75rem 1.4rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.linklike { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.linklike:hover { text-decoration: underline; }

label { display: block; margin-top: 0.7rem; font-weight: 600; font-size: 0.9rem; }
label.check { font-weight: 400; display: flex; align-items: center; gap: 0.45rem; }
input[type=text], input[type=email], input[type=url], input[type=search], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; background: #fff; margin-top: 0.3rem; color: var(--ink);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; line-height: 1.55; }

.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); background: var(--accent-soft); }
.alert-ok { background: var(--ok-bg); color: var(--ok-ink); }
.alert-error { background: var(--err-bg); color: var(--err-ink); }
.alert-slim { padding: 0.45rem 0.8rem; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.4rem; }

/* ---------- Sign-in ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: url('/content-images/hero-mountains.jpg') center/cover no-repeat; position: relative; min-height: 220px; }
.auth-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,30,38,0.15), rgba(14,30,38,0.55)); }
.auth-hero blockquote { position: absolute; left: 2rem; right: 2rem; bottom: 2rem; z-index: 1; color: #fff; font-family: var(--serif); font-size: 1.3rem; margin: 0; text-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.auth-hero blockquote small { display: block; font-family: var(--sans); font-size: 0.85rem; opacity: 0.85; margin-top: 0.4rem; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand-mark { width: 120px; margin: 0 auto 1rem; display: block; }
.auth-card h1 { text-align: center; font-size: 1.6rem; }
.auth-card .btn { margin-top: 1.1rem; width: 100%; }
@media (max-width: 760px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { min-height: 200px; } .auth-hero blockquote { font-size: 1.05rem; } }

/* ---------- Toolbar, lists, entries ---------- */
.toolbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.toolbar h1 { margin: 0 auto 0 0; }
.inline-form { display: flex; gap: 0.4rem; align-items: center; }
.inline-form input, .inline-form select { margin-top: 0; width: auto; }

.entry-list, .stage-list { list-style: none; padding: 0; margin: 0; }
.entry { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 0.6rem 0; box-shadow: var(--shadow); }
.entry.highlighted { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow); }
.entry-head { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.35rem; }
.entry-head .muted { margin-left: auto; font-size: 0.82rem; }
.entry > p:last-of-type { margin-bottom: 0.25rem; }
.tag { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0.12rem 0.65rem; font-size: 0.78rem; font-weight: 600; }
.tag-gold { background: var(--gold-soft); color: var(--gold-ink); }
.tag-blue { background: var(--teal-soft); color: var(--teal); }
.tag-ok { background: var(--ok-bg); color: var(--ok-ink); }
.entry-edit summary { font-size: 0.82rem; cursor: pointer; }
.entry-edit form { margin: 0.4rem 0; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-soft); }
.empty .big { font-size: 2.2rem; margin-bottom: 0.4rem; }

/* Quick-add chips (Log) */
.chips { display: flex; gap: 0.45rem; flex-wrap: wrap; margin: 0.25rem 0 1rem; }
.chip { border: 1px solid var(--line-strong); background: var(--card); border-radius: 999px; padding: 0.4rem 0.85rem; font: inherit; font-size: 0.9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink); }
.chip:hover { background: var(--accent-soft); }
.chip .pts { color: var(--gold-ink); font-weight: 700; font-size: 0.78rem; }
.chip-on { background: var(--gold-soft); border-color: var(--gold); }

.modal { border: none; border-radius: var(--radius); padding: 1.5rem; max-width: 560px; width: 92%; box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(14, 30, 38, 0.5); backdrop-filter: blur(2px); }
.modal h2 { margin-top: 0; }
.modal-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.table th, .table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); background: var(--accent-tint); }
.table tr.inactive { opacity: 0.55; }

.faq { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.8rem 1.1rem; margin: 0.5rem 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq-answer { margin-top: 0.5rem; color: var(--ink-soft); }

/* ---------- Feedback (floating) ---------- */
.fab-feedback { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 15; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.6rem 1rem; border-radius: 999px; background: var(--accent); color: #fff; border: none; font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; box-shadow: var(--shadow-lg); }
.fab-feedback svg { width: 18px; height: 18px; }
.fab-feedback:hover { background: var(--accent-hover); }
@media (max-width: 760px) { .fab-feedback { bottom: 4.6rem; padding: 0.65rem; } .fab-feedback span { display: none; } }

/* ---------- Add to Home Screen hint ---------- */
.a2hs { display: flex; align-items: center; gap: 0.75rem; background: var(--card); border: 1px solid var(--gold); border-radius: var(--radius); padding: 0.75rem 0.9rem; margin: 0 0 1rem; box-shadow: var(--shadow); }
.a2hs img { border-radius: 8px; flex: none; }
.a2hs-text { flex: 1; font-size: 0.85rem; line-height: 1.35; color: var(--ink-soft); display: flex; flex-direction: column; gap: 0.1rem; }
.a2hs-text strong { color: var(--ink); }
.a2hs-close { background: none; border: none; font-size: 1.4rem; line-height: 1; color: var(--ink-faint); cursor: pointer; padding: 0.2rem 0.4rem; }

/* ---------- Compass ---------- */
.hero-card { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--accent); color: #fff; padding: 1.5rem 1.6rem; margin: 0 0 1rem; box-shadow: var(--shadow-lg); display: grid; grid-template-columns: 1fr auto; gap: 1.25rem; align-items: center; }
.hero-card::before { content: ""; position: absolute; inset: 0; background: url('/content-images/hero-mountains.jpg') 70% 40%/cover no-repeat; opacity: 0.85; }
.hero-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, #1b3a4b 0%, rgba(27,58,75,0.96) 38%, rgba(27,58,75,0.55) 70%, rgba(27,58,75,0.25) 100%); }
.hero-card .hero-mark { position: absolute; right: -30px; bottom: -40px; width: 260px; height: 260px; background: url('/content-images/hj-mark-white.png') center/contain no-repeat; opacity: 0.08; z-index: 1; pointer-events: none; }
.hero-card > * { position: relative; z-index: 1; }
.hero-card .eyebrow { color: var(--gold); }
.hero-card h1 { color: #fff; margin: 0.15rem 0 0.35rem; font-size: 1.75rem; }
.hero-card p { color: rgba(255,255,255,0.8); margin: 0 0 0.9rem; max-width: 52ch; }
.hero-card .btn-primary { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 700; }
.hero-card .btn-primary:hover { background: #dcb452; }
.hero-card .btn-ghost { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); color: #fff; }
.ring { width: 132px; height: 132px; }
.ring circle { fill: none; stroke-width: 10; stroke-linecap: round; }
.ring .ring-bg { stroke: rgba(255,255,255,0.18); }
.ring .ring-fg { stroke: var(--gold); transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 0.6s; }
.ring text { fill: #fff; font-family: var(--serif); font-weight: 600; }
.ring .ring-num { font-size: 26px; }
.ring .ring-lbl { font-size: 10px; font-family: var(--sans); fill: rgba(255,255,255,0.75); letter-spacing: 0.08em; }
@media (max-width: 640px) { .hero-card { grid-template-columns: 1fr; } .ring { width: 110px; height: 110px; } }

.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin: 0 0 0.5rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.15rem; }
.stat .stat-label { font-size: 0.78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat .big-num { font-size: 1.7rem; }
.stat .stat-sub { font-size: 0.8rem; color: var(--ink-faint); }
.stat-gold { border-color: var(--gold); background: linear-gradient(180deg, #fffdf6, #fff); }
.stat .flame { font-size: 1.4rem; }
@media (max-width: 760px) { .stat-tiles { grid-template-columns: 1fr 1fr; } }

.points-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.points-chip { display: inline-flex; align-items: baseline; gap: 0.4rem; background: var(--accent-tint); border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.8rem; font-size: 0.88rem; }
.points-chip strong { font-family: var(--serif); font-size: 1.05rem; }

.focus-card { display: flex; flex-direction: column; gap: 0.35rem; }
.focus-card .eyebrow { color: var(--ink-soft); }
.focus-card .focus-value { font-family: var(--serif); font-size: 1.08rem; }
.focus-card .btn-sm { align-self: flex-start; margin-top: 0.3rem; }

/* ---------- Stage cards ---------- */
.stage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) { .stage-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .stage-grid { grid-template-columns: 1fr; } }
.stage-card { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform 0.15s, box-shadow 0.15s; }
a.stage-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stage-card .cover { aspect-ratio: 16 / 9; background: var(--accent) center/cover no-repeat; position: relative; }
.stage-card .cover.no-img { background: linear-gradient(135deg, var(--accent), var(--teal)); }
.stage-card .cover .num { position: absolute; left: 0.8rem; top: 0.7rem; background: rgba(255,255,255,0.92); color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 0.85rem; padding: 0.15rem 0.6rem; border-radius: 999px; }
.stage-card .cover .status { position: absolute; right: 0.7rem; top: 0.7rem; font-size: 0.72rem; font-weight: 700; padding: 0.18rem 0.6rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; }
.status-current { background: var(--gold); color: var(--ink); }
.status-done { background: var(--ok-bg); color: var(--ok-ink); }
.status-locked { background: rgba(255,255,255,0.9); color: var(--ink-soft); }
.stage-card .body { padding: 0.85rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.stage-card h3 { margin: 0; font-size: 1.05rem; }
.stage-card .sub { color: var(--ink-soft); font-size: 0.9rem; margin: 0; }
.stage-card .meta { margin-top: auto; padding-top: 0.6rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; color: var(--ink-faint); }
.stage-card .bar { height: 5px; margin-top: 0.5rem; }
.stage-card.locked { opacity: 0.72; }
.stage-card.locked .cover { filter: grayscale(0.6); }

/* ---------- Stage reader ---------- */
.stage-hero { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--accent); color: #fff; padding: 1.4rem 1.5rem; margin-bottom: 1rem; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow-lg); }
.stage-hero .bg { position: absolute; inset: 0; background: center/cover no-repeat; opacity: 0.6; }
.stage-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,30,38,0.45), rgba(14,30,38,0.92)); }
.stage-hero > * { position: relative; z-index: 1; }
.stage-hero .eyebrow { color: var(--gold); }
.stage-hero h1 { color: #fff; margin: 0.15rem 0 0.2rem; font-size: 1.7rem; }
.stage-hero .sub { color: rgba(255,255,255,0.8); margin: 0; }
.stage-head-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.8rem; }
.stage-hero .btn { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); color: #fff; }
.stage-hero .btn:hover { background: rgba(255,255,255,0.22); }
.reader-bar { display: flex; align-items: center; gap: 0.9rem; margin: 0 0 0.9rem; }
.reader-bar .bar { flex: 1; height: 6px; }
.reader-bar .muted { white-space: nowrap; font-size: 0.85rem; }
.section-toc { margin: 0 0 1rem; }
.section-toc summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.section-toc ol { margin: 0.5rem 0 0.2rem; padding-left: 1.4rem; columns: 2; column-gap: 2rem; }
@media (max-width: 640px) { .section-toc ol { columns: 1; } }
.section-toc li { break-inside: avoid; margin: 0.15rem 0; }
.section-toc a { text-decoration: none; }
.section-toc a:hover { text-decoration: underline; }
.section-toc a.visited { color: var(--ink-soft); }
.section-toc a.visited::after { content: " ✓"; color: var(--ok-ink); }
.section-toc a.current { font-weight: 700; }
.section-nav { display: flex; justify-content: space-between; align-items: stretch; gap: 0.5rem; margin: 1.25rem 0; }
.section-nav .btn { white-space: normal; text-align: center; line-height: 1.25; max-width: 48%; flex: 0 1 auto; }
.section-nav .btn:only-child { max-width: 100%; }
@media (max-width: 640px) { .section-nav .btn { font-size: 0.88rem; padding: 0.55rem 0.8rem; } }
@media (max-width: 760px) {
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { white-space: nowrap; }
  .stage-hero .sub { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .stage-hero { min-height: 0; }
}
.page-head-actions .btn, .stage-head-actions .btn { white-space: normal; }
.toolbar .btn { white-space: normal; }
.autosave-note { font-size: 0.82rem; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 0.35rem; }
.autosave-note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok-ink); }

.stage-content { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem 2.25rem; box-shadow: var(--shadow); font-size: 1.04rem; }
.stage-content > :first-child { margin-top: 0; }
.stage-content h2 { font-size: 1.6rem; margin: 0 0 1rem; padding-bottom: 0.6rem; border-bottom: 2px solid var(--gold); display: inline-block; }
.stage-content h3 { font-size: 1.2rem; margin: 1.6rem 0 0.5rem; }
.stage-content p { margin: 0 0 1rem; }
.stage-content ul, .stage-content ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.stage-content li { margin: 0.3rem 0; }
.stage-content blockquote { border-left: 3px solid var(--gold); margin: 1.25rem 0; padding: 0.25rem 0 0.25rem 1.1rem; color: var(--ink-soft); font-family: var(--serif); font-size: 1.12rem; font-style: italic; }
.stage-content blockquote p { margin: 0; }
.stage-content hr { border: none; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.stage-content a { text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 640px) { .stage-content { padding: 1.25rem 1.1rem; font-size: 1rem; } }

/* Figures */
.figure { margin: 1.4rem auto; text-align: center; max-width: 620px; }
.figure img { border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.figure-wide { max-width: 100%; }
.figure-small { max-width: 300px; }
.figure figcaption { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.5rem; font-style: italic; }

/* Worksheet fields */
.qfield { background: var(--accent-tint); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 0.9rem 1rem; margin: 1.1rem 0; }
.qfield label { display: block; font-weight: 600; margin: 0 0 0.45rem; font-size: 0.98rem; }
.qfield textarea { background: #fff; }
.save-state { font-size: 0.78rem; color: var(--ok-ink); }

/* Callouts */
.callout { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem 0.6rem; margin: 1.25rem 0; background: var(--card); box-shadow: var(--shadow); }
.callout-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; color: var(--ink-soft); }
.callout-title svg { width: 18px; height: 18px; flex: none; }
.callout-body > :last-child { margin-bottom: 0.4rem; }
.callout-body p { margin-bottom: 0.7rem; }
.callout-key { background: var(--accent); color: #fff; border-color: var(--accent); }
.callout-key .callout-title { color: var(--gold); }
.callout-key .callout-body { font-family: var(--serif); font-size: 1.15rem; line-height: 1.45; }
.callout-key a { color: #fff; }
.callout-exercise { background: var(--accent-tint); border-left: 4px solid var(--accent); }
.callout-exercise .callout-title { color: var(--accent); }
.callout-reflect { background: #f7f3ea; border-left: 4px solid var(--gold); }
.callout-reflect .callout-title { color: var(--gold-ink); }
.callout-practice { background: var(--ok-bg); border-left: 4px solid var(--ok-ink); }
.callout-practice .callout-title { color: var(--ok-ink); }
.callout-note, .callout-tip { background: var(--accent-tint); }
.callout-tip .callout-title { color: var(--gold-ink); }
.callout-warning { background: #fff4ea; border-left: 4px solid #d9822b; }
.callout-warning .callout-title { color: #a85e14; }
.callout-summary { background: var(--accent-tint); border-style: dashed; }
.callout-science { background: var(--teal-soft); border-left: 4px solid var(--teal); }
.callout-science .callout-title { color: var(--teal); }
.callout-science .callout-body { font-size: 0.95rem; color: var(--ink-soft); }
.callout-story { background: #fbf8f2; border-left: 4px solid var(--gold); }
.callout-story .callout-body { font-family: var(--serif); font-size: 1.05rem; }
.callout-belief { background: linear-gradient(135deg, #fff9e8, #fff); border-color: var(--gold); text-align: center; padding: 1.1rem 1.25rem; }
.callout-belief .callout-title { justify-content: center; color: var(--gold-ink); }
.callout-belief .callout-body { font-family: var(--serif); font-size: 1.25rem; font-style: italic; color: var(--accent); }
.callout-steps { padding-bottom: 0.9rem; }
.callout-steps .callout-title { color: var(--accent); }
ol.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
ol.steps li { counter-increment: step; position: relative; padding-left: 2.6rem; margin: 0.7rem 0; }
ol.steps li::before { content: counter(step); position: absolute; left: 0; top: 0.05rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; }
.pullquote { text-align: center; font-family: var(--serif); font-size: 1.35rem; font-style: italic; color: var(--accent); margin: 1.75rem auto; max-width: 40ch; padding: 0 1rem; }
.pullquote p { margin: 0 0 0.35rem; }
.pullquote p:last-child:not(:first-child) { font-size: 0.85rem; font-style: normal; color: var(--ink-soft); font-family: var(--sans); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin: 1rem 0; }
.cols > .callout { margin: 0; }
@media (max-width: 640px) { .cols { grid-template-columns: 1fr; } }
ul.checklist { list-style: none; padding: 0; margin: 0.4rem 0 0.8rem; }
ul.checklist li { margin: 0; }
.checkitem { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.5rem 0.6rem; margin: 0.15rem 0; border-radius: 8px; font-weight: 400; cursor: pointer; }
.checkitem:hover { background: rgba(14,30,38,0.04); }
.checkitem input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; flex: none; }
.checkitem:has(input:checked) span { text-decoration: line-through; color: var(--ink-faint); }
.table-wrap { overflow-x: auto; margin: 1.1rem 0; }
.ctable { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: var(--card); }
.ctable th { text-align: left; background: var(--accent); color: #fff; padding: 0.55rem 0.75rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.ctable td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.ctable tr:nth-child(even) td { background: var(--accent-tint); }

/* ---------- Assessments ---------- */
fieldset.aq { border: 1px solid var(--line); margin: 0.75rem 0; min-width: 0; }
.aq legend { padding: 0; float: left; width: 100%; }
.aq legend + * { clear: both; }
.aq .aq-prompt { display: block; font-weight: 600; font-size: 1rem; margin: 0 0 0.6rem; }
label.aq-prompt { margin-top: 0; }
.aq-num { color: var(--ink-soft); font-weight: 500; margin-right: 0.15rem; }
.aq-hint { font-weight: 400; font-size: 0.85rem; }
.aq.missing { border-color: var(--err-ink); box-shadow: 0 0 0 2px var(--err-bg); }
.assess-section { margin: 1.75rem 0 0.5rem; }
.scale-wrap { width: fit-content; max-width: 100%; }
.scale { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.scale-opt { position: relative; display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; margin: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; font-weight: 600; font-size: 0.95rem; cursor: pointer; user-select: none; }
.scale-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.scale-opt:hover { background: var(--accent-soft); }
.scale-opt:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.scale-opt:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.scale-labels { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.35rem; font-size: 0.85rem; }
.opts { display: flex; gap: 0.4rem; }
.opts-list { flex-direction: column; }
.opts-row { flex-wrap: wrap; }
.opt { display: flex; align-items: center; gap: 0.6rem; margin: 0; padding: 0.55rem 0.85rem; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; font-weight: 400; font-size: 0.95rem; cursor: pointer; }
.opts-row .opt { min-width: 6rem; justify-content: center; }
.opt input { margin: 0; flex: none; width: 1.05rem; height: 1.05rem; }
.opt:hover { background: var(--accent-soft); }
.opt:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.opt:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.assess-progress { position: sticky; top: var(--nav-h); z-index: 5; display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; margin-bottom: 0.5rem; background: var(--paper); font-size: 0.85rem; }
.assess-progress-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.assess-progress-fill { height: 100%; background: var(--accent); transition: width 0.2s; }
.assess-submit { margin: 1.25rem 0 2rem; }
.assess-submit .alert { margin-bottom: 0.75rem; }
@media (max-width: 520px) { .scale-opt { width: 2.2rem; height: 2.2rem; } }
.score-row { display: grid; grid-template-columns: 10rem 1fr 3rem; gap: 0.75rem; align-items: center; margin: 0.5rem 0; }
.score-num { text-align: right; font-weight: 700; }
.derived-metrics { border-color: var(--gold); }
.derived-row { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; margin: 0.4rem 0; }
.derived-name { font-weight: 500; min-width: 12rem; }
.derived-value strong { font-family: var(--serif); font-size: 1.6rem; }
.derived-band { font-style: italic; color: var(--gold-ink); }
.admin-nav { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }

/* ---------- Radar chart ---------- */
.radar-wrap { max-width: 560px; margin: 0 auto; }
.radar { width: 100%; height: auto; display: block; }
.radar-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.radar-spoke { stroke: var(--line); stroke-width: 1; }
.radar-area { stroke-width: 2.5; stroke-linejoin: round; }
.radar-area.r-now { fill: rgba(27,58,75,0.28); stroke: var(--accent); }
.radar-area.r-prev { fill: rgba(201,161,59,0.18); stroke: var(--gold); stroke-dasharray: 6 4; }
.radar-area.r-first { fill: rgba(47,126,163,0.10); stroke: var(--teal); stroke-dasharray: 2 4; }
.radar-dot.r-now { fill: var(--accent); } .radar-dot.r-prev { fill: var(--gold); } .radar-dot.r-first { fill: var(--teal); }
.radar-label { font-size: 12px; fill: var(--ink); font-weight: 600; }
.radar-tick { font-size: 10px; fill: var(--ink-faint); }
.radar-legend { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 0.4rem; font-size: 0.85rem; color: var(--ink-soft); }
.radar-key i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 0.4rem; vertical-align: middle; }
.radar-key.r-now i { background: var(--accent); } .radar-key.r-prev i { background: var(--gold); } .radar-key.r-first i { background: var(--teal); }

/* ---------- Circle ---------- */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 0.7rem; font-weight: 700; line-height: 1; }
.badge-dot { position: absolute; top: 2px; right: 22%; min-width: 9px; width: 9px; height: 9px; padding: 0; }
.tabbar a { position: relative; }
.circle-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; align-items: start; }
@media (max-width: 860px) { .circle-layout { grid-template-columns: 1fr; } .circle-side { order: -1; } .circle-side .card { margin: 0 0 0.75rem; } }
.compose textarea { margin-top: 0; }
.compose-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }
.compose-actions label.check { margin: 0; font-size: 0.88rem; }
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 0.75rem 0; box-shadow: var(--shadow); }
.post.pinned { border-color: var(--gold); }
.post.kind-prompt { background: linear-gradient(180deg, #fffaf0, #fff); }
.post-head { display: flex; align-items: flex-start; gap: 0.6rem; }
.post-meta { flex: 1; min-width: 0; font-size: 0.9rem; line-height: 1.4; }
.post-meta time { display: block; font-size: 0.78rem; }
.post-menu { position: relative; }
.post-menu summary { list-style: none; cursor: pointer; padding: 0 0.4rem; font-size: 1.2rem; color: var(--ink-faint); }
.post-menu summary::-webkit-details-marker { display: none; }
.post-menu .menu-body { right: 0; top: 100%; z-index: 3; }
.post-body { margin: 0.6rem 0 0.5rem; font-size: 1.02rem; }
.kind-prompt .post-body { font-family: var(--serif); font-size: 1.12rem; }
.post-actions { display: flex; gap: 0.75rem; align-items: center; }
.replies { margin-top: 0.6rem; border-top: 1px dashed var(--line); padding-top: 0.5rem; }
.reply { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.35rem 0; font-size: 0.92rem; }
.reply > div { flex: 1; min-width: 0; }
.reply p { margin: 0.1rem 0 0; }
.avatar-sm { width: 22px; height: 22px; font-size: 0.65rem; margin-top: 0.15rem; }
.leader-row { display: grid; grid-template-columns: 1.6rem 1fr auto auto; gap: 0.5rem; align-items: center; padding: 0.35rem 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.leader-row:last-of-type { border-bottom: none; }
.leader-row.me { font-weight: 600; }
.leader-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Streak / charts / leaderboard / comments ---------- */
.streak-card { display: flex; align-items: center; gap: 1rem; border-color: var(--gold); }
.streak-flame { font-size: 2.2rem; }
.streak-flame.dim { filter: grayscale(0.8); opacity: 0.5; }
.streak-card .jb-link { margin-left: auto; white-space: nowrap; }
.activity-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-top: 1rem; max-width: 360px; }
.activity-col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; }
.activity-day { width: 14px; height: 14px; border-radius: 3px; background: var(--accent-soft); display: block; }
.activity-day.on { background: var(--accent); }
.activity-day.today { outline: 2px solid var(--gold); outline-offset: 1px; }
.activity-day.future { background: transparent; border: 1px dashed var(--line); }
.table tr.leader-me td { background: var(--gold-soft); font-weight: 600; }
.comments { margin-top: 0.6rem; border-top: 1px dashed var(--line); padding-top: 0.5rem; }
.comment { background: var(--accent-tint); border-radius: 10px; padding: 0.5rem 0.75rem; margin: 0.35rem 0; }
.comment.coach { border-left: 3px solid var(--gold); }
.comment p { margin: 0.2rem 0 0; }
.comment-author { font-weight: 600; font-size: 0.85rem; color: var(--accent); margin-right: 0.5rem; }
.comment .muted { font-size: 0.78rem; }
.comment-form { display: flex; gap: 0.4rem; margin-top: 0.4rem; }
.comment-form input { margin-top: 0; }

/* ---------- Celebration banner ---------- */
.celebrate { display: flex; align-items: center; gap: 0.9rem; background: linear-gradient(135deg, #fff9e8, #fff); border: 2px solid var(--gold); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1rem; animation: celebrate-pop 0.5s ease-out; box-shadow: 0 4px 18px rgba(201, 161, 59, 0.25); }
.celebrate .confetti { font-size: 2rem; animation: confetti-bounce 1.1s ease-in-out 3; display: inline-block; }
@keyframes celebrate-pop { 0% { transform: scale(0.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes confetti-bounce { 0%, 100% { transform: translateY(0) rotate(0deg); } 30% { transform: translateY(-10px) rotate(-12deg); } 60% { transform: translateY(-4px) rotate(10deg); } }

/* ---------- Journey Book ---------- */
.jb-toolbar { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0.8rem 0 1.2rem; }
.journey-book { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 2.5rem; }
.jb-cover { text-align: center; padding: 2.5rem 1rem; border-bottom: 2px solid var(--gold); margin-bottom: 1.5rem; }
.jb-cover .jb-name { font-size: 2rem; margin: 0.3rem 0; }
.jb-cover .jb-dates { color: var(--ink-soft); }
.jb-stage h2, .jb-section h2 { border-bottom: 1px solid var(--line); padding-bottom: 0.3rem; }
.jb-qa { margin: 0.9rem 0; }
.jb-prompt { font-weight: 600; color: var(--ink-soft); margin: 0 0 0.2rem; }
.jb-answer { margin: 0; }

/* ---------- Meditations ---------- */
.media-card { display: flex; gap: 1rem; align-items: flex-start; }
.media-card .media-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.media-card .media-ico svg { width: 22px; height: 22px; }
.media-card audio { width: 100%; margin-top: 0.4rem; }

/* ---------- Reading preferences (Aa) ---------- */
html.pref-large { font-size: 112.5%; }
html.pref-spacing body { letter-spacing: 0.03em; word-spacing: 0.16em; line-height: 1.9; }
html.pref-spacing .stage-content { max-width: 62ch; margin-inline: auto; }
html.pref-spacing .stage-content p { margin-bottom: 1.2em; }
html.pref-comfort { --paper: #faf6ec; --card: #fffdf7; --accent-tint: #f7f3e9; }

@media print {
  .topnav, .tabbar, .fab-feedback, .feedback-box, .jb-toolbar, .no-print, .btn, .section-toc, .reader-bar { display: none !important; }
  body { background: #fff; }
  .container { max-width: 100%; padding: 0; }
  .card, .stage-content, .callout { box-shadow: none; }
  .journey-book { border: none; padding: 0; font-family: Georgia, "Times New Roman", serif; font-size: 12pt; line-height: 1.6; }
  .jb-stage, .jb-section { page-break-before: always; }
  .jb-cover { page-break-after: always; border-bottom: none; padding-top: 30vh; }
}
