/* What I Couldn’t Say — The Threshold skin (presentation reset).

   A refined, editorial, emotionally contained learning/workbook experience.
   Mature, architectural, calm, premium, private, grounded.

   Palette:
     Elderberry      #594B67  (primary — accent, links, CTAs)
     Rain Slate      #8EA1A4  (cool secondary — quiet structure)
     Worn Terra      #C29375  (warm secondary — care, repair)
     Bone Linen      #F6F0E7  (canvas — surfaces)
     Charcoal Umber  #2E2925  (ink — primary text)

   Typography:
     Display / logo / editorial : Newsreader (serif)
     UI / body                  : Manrope (sans)
*/

:root {
  /* Brand palette — The Threshold */
  --elderberry:        #594B67;
  --elderberry-deep:   #3F3548;
  --elderberry-soft:   #E4DFEA;
  --rain-slate:        #8EA1A4;
  --rain-slate-soft:   #DDE3E4;
  --worn-terra:        #C29375;
  --worn-terra-soft:   #EFDFD2;
  --bone-linen:        #F6F0E7;
  --bone-linen-warm:   #FBF7EF;
  --charcoal-umber:    #2E2925;

  /* Semantic mapping */
  --bg:             var(--bone-linen);
  --surface:        var(--bone-linen-warm);
  --surface-2:      #EFE7DA;
  --border:         #DCD2C2;
  --border-strong:  #C8BBA6;
  --rule:           #E5DCCC;
  --text:           var(--charcoal-umber);
  --text-muted:     #6E6660;
  --text-faint:     #A89F95;
  --accent:         var(--elderberry);
  --accent-hover:   var(--elderberry-deep);
  --accent-soft:    var(--elderberry-soft);
  --warm-accent:        var(--worn-terra);
  --warm-accent-soft:   var(--worn-terra-soft);
  --cool-accent:        var(--rain-slate);
  --cool-accent-soft:   var(--rain-slate-soft);
  --warn:    #8B5A2B;
  --error:   #8E3344;
  --success: #4A6F4F;

  /* Geometry — subtle, architectural */
  --radius:    8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --shadow:       0 1px 2px rgba(46, 41, 37, 0.05);
  --shadow-soft:  0 1px 3px rgba(46, 41, 37, 0.06),
                  0 10px 28px -18px rgba(89, 75, 103, 0.16);
  --reading-w:   720px;
  --wide-w:      960px;
  --gap:         1rem;
  --gap-lg:      2rem;
  --gap-xl:      3rem;

  /* Typography */
  --font-display:    "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-logo:       "Newsreader", "Source Serif 4", Georgia, serif;
  --font-body:       "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-supporting: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg:            #1A1714;
  --surface:       #211D19;
  --surface-2:     #28231F;
  --border:        #3A332C;
  --border-strong: #4D4439;
  --rule:          #2F2A24;
  --text:          #EDE5D6;
  --text-muted:    #A99F92;
  --text-faint:    #6E6557;
  --accent:        #B6A6CB;
  --accent-hover:  #D6CBE3;
  --accent-soft:   #36304A;
  --warm-accent:        #D6AC90;
  --warm-accent-soft:   #3A2C22;
  --cool-accent:        #A9BCC0;
  --cool-accent-soft:   #2A3437;
  --warn:    #C7905A;
  --error:   #D17890;
  --success: #8DB78D;
  --shadow:       0 1px 2px rgba(0, 0, 0, 0.32);
  --shadow-soft:  0 1px 3px rgba(0, 0, 0, 0.36),
                  0 14px 32px -18px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Headings */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: var(--text);
}
h1 { font-size: 1.95rem; font-weight: 500; letter-spacing: -0.018em; }
h2 { font-size: 1.45rem; font-weight: 500; }
h3 { font-size: 1.1rem; font-weight: 600; font-family: var(--font-body); letter-spacing: -0.003em; }
h4 { font-size: 0.98rem; font-weight: 600; font-family: var(--font-body); }
p  { margin: 0 0 1rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 1.75rem 0; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--accent);
  padding: 0.5rem 0.85rem; border: 1px solid var(--accent);
  border-radius: 6px; z-index: 100;
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ============================================================
   PAGE SHELL SYSTEM — the website-style layout
   ============================================================ */

/* Outermost <main> wrapper. Every page is centered by default — no page
   should ever hug the left edge of the viewport.

   .main-shell sits on <main>. It provides only horizontal centering and
   a generous outer max-width so unwrapped legacy templates still feel
   editorial, not dashboard-like. Vertical padding lives on the inner
   shells so explicit shells don't double-pad.                              */
.main-shell {
  display: block;
  width: 100%;
}
.main-shell__inner {
  max-width: 960px;          /* utility/wide ceiling */
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
@media (min-width: 720px) {
  .main-shell__inner { padding: 3.25rem 2rem 5.5rem; }
}

/* When a template uses its own shell, the inner wrapper should not add
   extra side padding — let the explicit shell control width and padding. */
.main-shell__inner > .page-shell,
.main-shell__inner > .reading-shell,
.main-shell__inner > .wide-shell,
.main-shell__inner > .editorial-shell,
.main-shell__inner > .container {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Main column wrapper. Sets generous vertical breathing room. */
.page-shell {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4.5rem;
}
@media (min-width: 720px) {
  .page-shell { padding: 4rem 2rem 6rem; }
}

/* Reading column — primary text content lives here. */
.reading-shell {
  max-width: var(--reading-w);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4.5rem;
}
@media (min-width: 720px) {
  .reading-shell { padding: 4rem 1.5rem 6rem; }
}

/* Wide column — for indexes, longer reports, occasional 2-col layouts. */
.wide-shell {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4.5rem;
}
@media (min-width: 720px) {
  .wide-shell { padding: 4rem 2rem 6rem; }
}

/* Legacy compatibility — keep older .container working. */
.container {
  max-width: var(--reading-w);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.container-wide { max-width: var(--wide-w); }

/* Stacks — vertical rhythm without nested boxes. */
.stack > * + * { margin-top: var(--gap); }
.stack-lg > * + * { margin-top: var(--gap-lg); }
.stack-xl > * + * { margin-top: var(--gap-xl); }

.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: 0.92rem; }
.center { text-align: center; }

/* ============================================================
   PAGE ANATOMY — title, kicker, lede, sections
   ============================================================ */

.page-kicker {
  font-family: var(--font-supporting);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.65rem;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2.2rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.65rem;
  max-width: 22ch;
}
.page-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}
@media (min-width: 720px) {
  .page-title { font-size: 2.7rem; }
}

.page-lede {
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.6;
  max-width: 38rem;
  margin: 0 0 1.5rem;
}

.page-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* Section blocks — major content groupings stacked, no card walls. */
.section-block { margin-top: var(--gap-xl); }
.section-block:first-child { margin-top: 0; }
.section-block > h2,
.section-block > h3 { margin-bottom: 0.4rem; }
.section-block__lede {
  color: var(--text-muted);
  margin: 0 0 1rem;
  max-width: 38rem;
}

/* Quiet eyebrow above a section heading. */
.section-eyebrow,
.page-eyebrow {
  font-family: var(--font-supporting);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.55rem;
  display: block;
}
.page-eyebrow { color: var(--accent); }

/* Slim hairline divider between sections. */
.content-divider {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: var(--gap-lg) 0;
}
.content-divider--center {
  width: 80px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: saturate(110%);
}
.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.95rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-weight: 400;
  color: var(--text);
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-logo);
  font-size: 1.18rem;
  letter-spacing: 0.002em;
  line-height: 1;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-wordmark {
  font-family: var(--font-logo);
  font-style: normal;
  font-weight: 400;
}
.brand-wordmark em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.brand-tag { display: none; }
.brand-mark {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-mark:empty {
  width: 22px; height: 22px;
  border-radius: 2px; background: transparent;
  border: 1.4px solid var(--accent);
  border-bottom-width: 2.5px;
}

/* Desktop nav — minimal, only key destinations. */
.site-nav {
  display: none;
  align-items: center;
  gap: 0.4rem;
}
@media (min-width: 860px) {
  .site-nav { display: inline-flex; }
}
.site-nav a, .site-nav > details > summary {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.42rem 0.65rem;
  border-radius: 6px;
  letter-spacing: 0.005em;
  cursor: pointer;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.site-nav a.active { color: var(--accent); background: var(--accent-soft); }

/* "More" disclosure inside desktop nav. */
.site-nav__more { position: relative; }
.site-nav__more > summary {
  list-style: none;
  display: inline-block;
}
.site-nav__more > summary::-webkit-details-marker { display: none; }
.site-nav__more > summary::after {
  content: " ▾";
  font-size: 0.7em;
  color: var(--text-faint);
}
.site-nav__more-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.site-nav__more-panel a {
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.92rem;
}
.site-nav__more-panel a:hover { background: var(--surface-2); text-decoration: none; }

/* Mobile menu — single details element. */
.site-menu {
  position: relative;
}
@media (min-width: 860px) {
  .site-menu { display: none; }
}
.site-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu__bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}
.site-menu__bars span {
  display: block;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
}
.site-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.site-menu__panel a,
.site-menu__panel .theme-toggle {
  padding: 0.7rem 0.8rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.98rem;
  text-align: left;
  border: 0;
  background: transparent;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
  font-weight: 500;
  min-height: 44px;
}
.site-menu__panel a:hover { background: var(--surface-2); text-decoration: none; }

/* Theme toggle */
.theme-toggle {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted);
  font: inherit;
  font-family: var(--font-body);
  font-size: 0.78rem; padding: 0.32rem 0.65rem; border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  margin-left: 0.25rem;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }

/* Legacy header.site / nav.primary — kept so older templates still render
   if any reference these directly. */
header.site, nav.primary { display: none; }

/* ============================================================
   PRIMARY PANELS — single, meaningful container; no card walls
   ============================================================ */

/* The primary panel is for the page's main next-action moment.
   Soft tinted surface, no heavy shadow. Use sparingly — one per page. */
.primary-panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.5rem;
  margin-top: 1.25rem;
}
@media (min-width: 720px) {
  .primary-panel { padding: 1.85rem 2rem; }
}
.primary-panel__kicker {
  font-family: var(--font-supporting);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.primary-panel__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}
.primary-panel__body { color: var(--text-muted); margin: 0 0 1.1rem; max-width: 50ch; }
.primary-panel__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Quiet panel — used for supporting content that isn't the next action. */
.quiet-panel {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
}
.quiet-panel__kicker {
  font-family: var(--font-supporting);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

/* Legacy .card — restyled to be quieter and lighter so existing templates
   still feel correct. Kept for backward compatibility only. */
.card {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  box-shadow: none;
}
.card + .card { margin-top: var(--gap); }
.card h2, .card h3 { margin-top: 0; }
.card-soft { background: var(--surface); border-color: transparent; }
.card-warm { background: var(--warm-accent-soft); border-color: transparent; }

/* ============================================================
   PROSE — for long-form reading
   ============================================================ */

.prose {
  font-size: 1.04rem;
  line-height: 1.72;
  color: var(--text);
}
.prose p { margin: 0 0 1.1rem; max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 1.1rem 1.25rem; padding: 0; }
.prose li { margin-bottom: 0.4rem; }
.prose strong { font-weight: 600; }

/* Editorial paragraph for branded voice moments. */
.editorial {
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.5;
  font-weight: 400;
  color: var(--text);
  max-width: 36rem;
  letter-spacing: -0.005em;
}
.editorial em { font-style: italic; color: var(--accent); }

/* ============================================================
   LISTS — chapter list, quiet list, item list
   ============================================================ */

/* Chapter list — used by Secure Path index and similar editorial lists. */
.chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.chapter-list > li {
  border-bottom: 1px solid var(--rule);
}
.chapter-list__link {
  display: block;
  padding: 1.25rem 0.25rem;
  color: var(--text);
}
.chapter-list__link:hover { background: var(--surface); text-decoration: none; }
.chapter-list__num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-faint);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin-right: 0.6rem;
  font-variant-numeric: tabular-nums;
}
.chapter-list__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  display: inline;
}
.chapter-list__summary {
  color: var(--text-muted);
  margin: 0.35rem 0 0;
  font-size: 0.96rem;
  max-width: 60ch;
}
.chapter-list__status {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
}
.chapter-list > li.is-current .chapter-list__title { color: var(--accent); }
.chapter-list > li.is-current .chapter-list__status { color: var(--accent); }
.chapter-list > li.is-completed .chapter-list__title { color: var(--text-muted); }
.chapter-list > li.is-completed .chapter-list__num { color: var(--text-faint); }
.chapter-list > li.is-completed .chapter-list__status::before {
  content: "✓ "; color: var(--success);
}

/* Quiet list — index of practices, journal entries, drafts. */
.quiet-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.quiet-list > li {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0.25rem;
}
.quiet-list__title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: -0.003em;
  margin: 0;
}
.quiet-list__meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.25rem;
}
.quiet-list__summary {
  color: var(--text-muted);
  margin: 0.45rem 0 0;
  font-size: 0.97rem;
  max-width: 62ch;
}

/* Legacy item list, item — kept for compatibility, restyled lighter. */
.item-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.item-list > li + li { margin-top: 0; }
.item {
  display: block;
  padding: 1rem 0.25rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
}
.item h3 { margin: 0 0 0.3rem; font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; }
.item .meta { color: var(--text-muted); font-size: 0.85rem; }

/* ============================================================
   PILLS / MARKERS / PRIVACY STRIP
   ============================================================ */

.badge {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
}
.badge-private {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
[data-theme="dark"] .badge-private { color: var(--accent-hover); }
.badge-shared {
  background: var(--warm-accent-soft);
  color: #8B5A3D;
  border-color: transparent;
}
[data-theme="dark"] .badge-shared { color: #E5C5AE; }
.badge-warn { background: rgba(199, 144, 90, 0.18); color: var(--warn); border-color: transparent; }

.marker-private,
.marker-shared {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.marker-private::before,
.marker-shared::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 1px;
  background: var(--accent);
  flex-shrink: 0;
}
.marker-shared::before { background: var(--warm-accent); }

/* Privacy strip — a subtle reassurance bar that sits inside reading flow. */
.privacy-strip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
  color: var(--text);
  font-size: 0.95rem;
  margin: 1.5rem 0;
}
.privacy-strip strong { font-weight: 600; }
.privacy-strip--shared {
  border-left-color: var(--warm-accent);
  background: var(--warm-accent-soft);
}

/* ============================================================
   FORMS — calm, generous, literal labels
   ============================================================ */

label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
  letter-spacing: 0.005em;
}
input[type="text"], input[type="email"], input[type="password"],
textarea, select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-family: var(--font-body);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
textarea {
  min-height: 10rem;
  resize: vertical;
  line-height: 1.65;
  font-family: var(--font-body);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: var(--bone-linen-warm);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  background: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(182, 166, 203, 0.18);
}

.form-field + .form-field { margin-top: 1.25rem; }
.form-error { color: var(--error); font-size: 0.88rem; margin-top: 0.3rem; }
.help { color: var(--text-muted); font-size: 0.88rem; margin-top: 0.3rem; }

.checkbox, .check { display: flex; gap: 0.6rem; align-items: flex-start; }
.checkbox input, .check input { margin-top: 0.3rem; }
.checkbox label, .check label { margin: 0; font-weight: 400; }

/* Worksheet form — labelled sections inside a calm flow. */
.worksheet-form { display: flex; flex-direction: column; gap: 1.6rem; }
.worksheet-form .form-field { margin: 0; }
.worksheet-form label { font-size: 0.95rem; }
.worksheet-form .help { margin-top: 0.4rem; line-height: 1.5; }

/* Radios for assessment — quieter borders. */
.radio-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.85rem 0; }
.radio-list label {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.75rem 0.9rem; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; background: var(--surface);
  font-weight: 400;
  transition: background 140ms ease, border-color 140ms ease;
}
.radio-list label:hover { background: var(--surface-2); }
.radio-list input[type="radio"]:checked + span { font-weight: 600; }
.radio-list label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ============================================================
   BUTTONS — one dominant primary, one quiet secondary
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.75rem 1.3rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.005em;
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--bone-linen);
  min-height: 44px;
  transition: background 140ms ease, color 140ms ease,
              border-color 140ms ease, box-shadow 140ms ease;
}
.btn:hover {
  background: var(--accent-hover);
  color: var(--bone-linen);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--bone-linen); }
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  background: transparent; color: var(--accent); border-color: var(--accent);
  box-shadow: none;
}
.btn-quiet {
  background: transparent; color: var(--accent);
  border: 1px solid transparent;
  padding: 0.6rem 0.85rem;
}
.btn-quiet:hover { background: transparent; color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; box-shadow: none; }
.btn-warm {
  background: var(--warm-accent); color: var(--charcoal-umber);
  border: 1px solid transparent;
}
.btn-warm:hover { background: #B0825F; color: var(--charcoal-umber); }
.btn-danger {
  background: transparent; color: var(--error);
  border: 1px solid var(--border);
}
.btn-danger:hover { background: rgba(142, 51, 68, 0.06); color: var(--error); border-color: var(--error); box-shadow: none; }
.btn-block { display: flex; width: 100%; }

/* Inline actions row — pair a primary and a quiet secondary, no card. */
.inline-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.25rem;
}

/* ============================================================
   FLASHES, PROGRESS
   ============================================================ */

.flashes { margin: 0 0 1rem; padding: 0; list-style: none; }
.flash {
  padding: 0.75rem 0.95rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 0.95rem; margin-bottom: 0.5rem;
}
.flash-success { background: rgba(74, 111, 79, 0.10); border-color: rgba(74, 111, 79, 0.32); }
.flash-error   { background: rgba(142, 51, 68, 0.10); border-color: rgba(142, 51, 68, 0.32); }
.flash-info    { background: var(--surface); }

/* Progress — linear, subtle. No celebratory styling. */
.progress {
  height: 4px; background: var(--rule); border-radius: 999px; overflow: hidden;
}
.progress > span { display: block; height: 100%; background: var(--accent); }

.progress-summary {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.progress-summary__count {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 500;
}

/* ============================================================
   THRESHOLD DETAILS — dividers, kept for compatibility
   ============================================================ */

.horizon-divider {
  display: block; width: 100%; max-width: 220px;
  height: 12px; margin: 1.5rem 0;
  color: var(--cool-accent); opacity: 0.9;
}
.horizon-divider svg { width: 100%; height: 100%; display: block; }
.horizon-divider.center { margin-left: auto; margin-right: auto; }

.horizon-rule {
  border: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--rule) 18%, var(--rule) 82%, transparent);
  margin: 2rem 0;
}

/* ============================================================
   PAGE HEADER (legacy) — kept compatible with existing templates
   ============================================================ */

.page-header { padding: 1.4rem 0 0.6rem; }
.page-header h1 { font-size: 1.95rem; font-weight: 500; }
.page-header .lead {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 36rem;
  margin-top: 0.25rem;
}

/* Hero (legacy) — kept for marketing/home pages only. */
.hero { padding: 2.6rem 0 1.4rem; position: relative; }
.hero h1 {
  font-family: var(--font-display);
  font-size: 2.3rem; font-weight: 400;
  line-height: 1.12; letter-spacing: -0.018em;
  max-width: 22ch;
}
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 400; }
.hero p.lead {
  color: var(--text-muted);
  font-size: 1.08rem; max-width: 38rem; line-height: 1.65;
}

/* Steps grid (legacy — home page only). */
.steps {
  display: grid; gap: 1.25rem; grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}
.step {
  background: transparent;
  border: 0;
  border-left: 2px solid var(--accent);
  padding: 0.4rem 0 0.4rem 1.1rem;
  position: relative;
}
.step::before { content: none; }
.step .step-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--accent);
  display: block;
  margin-bottom: 0.4rem;
  line-height: 1;
}
.step h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}
.step p { color: var(--text-muted); margin: 0; font-size: 0.96rem; }

/* ============================================================
   PAUSE NOTE — gentle advisory; quieter than before
   ============================================================ */

.pause-note {
  border-left: 3px solid var(--warm-accent);
  background: transparent;
  padding: 0.85rem 1.1rem;
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-family: var(--font-body);
  margin-top: var(--gap-lg);
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding: 2rem 1.25rem 2.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: transparent;
}
.site-footer__inner {
  padding-top: 0;
  padding-bottom: 0;
  text-align: center;
}
.site-footer__line {
  margin: 0.75rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer .footer-mark,
.footer-mark {
  margin: 0 auto 0.4rem;
  color: var(--cool-accent);
  width: 80px; height: 10px;
  display: block;
}

/* Legacy footer.site — hidden, the new .site-footer is used. */
footer.site { display: none; }

/* ============================================================
   GRID HELPERS — used sparingly
   ============================================================ */

.two-col {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .two-col { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

/* Old grid-cards / grid-2 / grid-3 — kept compatible, simpler defaults. */
.grid-cards { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid-cards { grid-template-columns: 1fr 1fr; }
}
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ============================================================
   EDITORIAL SHELL — Phase 7A workbook spine

   A slightly more spacious reading column for the workbook-style
   pages (Home, My Path, Attachment Map results, practices,
   journal, repair). Quieter than .wide-shell, more breathing room
   than .reading-shell. Literary, not corporate.
   ============================================================ */

.editorial-shell {
  max-width: var(--reading-w);
  margin: 0 auto;
  padding: 2.75rem 1.25rem 5rem;
}
@media (min-width: 720px) {
  .editorial-shell { padding: 4.5rem 1.75rem 6.5rem; }
}

/* Field-guide modifier — slightly more vertical rhythm between
   chapters/sections. Used on My Path. */
.field-guide-page > * + * { margin-top: var(--gap-lg); }
.field-guide-page > header + * { margin-top: var(--gap-lg); }
.field-guide-page section + section { margin-top: var(--gap-xl); }

/* Page cover — the first block on a workbook page. Quiet kicker +
   serif title + lede, no card walls. */
.page-cover {
  margin-bottom: var(--gap-lg);
}
.page-cover .page-title { margin-bottom: 0.8rem; }

/* Next-step cover — Home's grounding headline block. Sits on the
   raw page surface, slightly tighter than a field-guide cover. */
.next-step-cover {
  margin-bottom: var(--gap-lg);
}
.next-step-cover .page-title { margin-bottom: 0.65rem; max-width: 24ch; }
.next-step-cover .page-lede { margin-bottom: 0; }

/* ============================================================
   CHAPTER PATH — grouped chapters on My Path
   ============================================================ */

.chapter-path > * + * { margin-top: var(--gap-lg); }

.chapter-row {
  padding-top: 0.25rem;
}
.chapter-row + .chapter-row {
  margin-top: var(--gap-xl);
  border-top: 1px solid var(--rule);
  padding-top: var(--gap-lg);
}
.chapter-row__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 0 0 0.4rem;
}
@media (min-width: 720px) {
  .chapter-row__title { font-size: 1.5rem; }
}
.chapter-row__intro {
  color: var(--text-muted);
  margin: 0 0 0.9rem;
  max-width: 58ch;
  font-size: 0.98rem;
  line-height: 1.55;
}

/* ============================================================
   PORTRAIT SECTION — used on the Attachment Map result and
   in field-guide profile blocks. Reads like an editorial spread,
   not a card grid.
   ============================================================ */

.portrait-section {
  /* No box, no card. Just rhythm. */
}
.portrait-section + .portrait-section { margin-top: var(--gap-xl); }

.portrait-section__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.7rem;
  max-width: 28ch;
}
.portrait-section__title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}
@media (min-width: 720px) {
  .portrait-section__title { font-size: 1.75rem; }
}

.portrait-section__grid {
  display: grid;
  gap: 1.25rem 2rem;
  grid-template-columns: 1fr;
  margin-top: 1rem;
}
.portrait-section__grid > div .section-eyebrow {
  margin-bottom: 0.3rem;
}
.portrait-section__grid > div p,
.portrait-section__grid > div ul {
  margin: 0;
}
@media (min-width: 720px) {
  .portrait-section__grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2.5rem;
  }
}

/* ============================================================
   PERSONALIZATION NOTE — quiet aside that explains why this
   page/lesson/practice is being shown to *this* user.
   ============================================================ */

.personalization-note {
  border-left: 3px solid var(--cool-accent);
  background: var(--cool-accent-soft);
  padding: 0.95rem 1.1rem;
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
  color: var(--text);
}
.personalization-note__kicker {
  font-family: var(--font-supporting);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.personalization-note__body {
  margin: 0;
  color: var(--text);
  font-size: 0.97rem;
  line-height: 1.55;
  max-width: 60ch;
}
.personalization-note--inline {
  background: transparent;
  border-left-width: 2px;
  padding: 0.5rem 0.9rem;
  margin: 0.75rem 0;
}
.personalization-note--inline .personalization-note__body {
  font-size: 0.94rem;
  color: var(--text-muted);
}

/* ============================================================
   GRIEF-ORIGIN NOTE — careful, anchored, italic-leaning.
   Used to surface "this may have begun in 1990" reflections
   in a quiet, non-deterministic way.
   ============================================================ */

.grief-origin-note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 1.1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  color: var(--text);
}
.grief-origin-note .section-eyebrow {
  color: var(--accent);
}
.grief-origin-note .prose,
.grief-origin-note p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 62ch;
  color: var(--text);
}
.grief-origin-note .prose + .prose,
.grief-origin-note p + p {
  margin-top: 0.7rem;
}
.grief-origin-note em { font-style: italic; }

/* ============================================================
   PRIVATE-ROOM NOTE — replaces the loud feel of .privacy-strip
   on workbook pages. Quieter, more like a footnote.
   ============================================================ */

.private-room-note {
  display: flex;
  gap: 0.7rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-top: var(--gap-lg);
}
.private-room-note strong {
  color: var(--text);
  font-weight: 600;
}
.private-room-note a {
  color: var(--accent);
}

/* ============================================================
   PULL-QUOTE — display-serif emphasis for ledes and inner lines.
   ============================================================ */

.pull-quote {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 1.18rem;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--text);
  max-width: 38rem;
  margin: 0.25rem 0 1.25rem;
}
@media (min-width: 720px) {
  .pull-quote { font-size: 1.3rem; }
}

/* ============================================================
   QUIET PROGRESS — single muted line, no bars or percentages.
   ============================================================ */

.quiet-progress {
  color: var(--text-muted);
  font-size: 0.93rem;
  font-style: italic;
  margin: 0.5rem 0 1rem;
  line-height: 1.5;
}
.quiet-progress a {
  font-style: normal;
  color: var(--accent);
}

/* ============================================================
   QUIET-LIST — prompts modifier for journal page.
   ============================================================ */

.quiet-list--prompts > li {
  padding: 0.85rem 0.25rem;
}
.quiet-list--prompts .quiet-list__link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius-sm);
  transition: background-color 120ms ease;
}
.quiet-list--prompts .quiet-list__link:hover {
  background: var(--surface);
  text-decoration: none;
}
.quiet-list--prompts .quiet-list__title {
  color: var(--accent);
  font-size: 1.05rem;
}
.quiet-list--prompts .quiet-list__summary {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

/* ============================================================
   TABLET+ TYPE TWEAKS, PRINT, MOTION
   ============================================================ */

@media (min-width: 720px) {
  body { font-size: 17px; }
  .hero { padding: 3.4rem 0 1.6rem; }
  .hero h1 { font-size: 2.95rem; }
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.6rem; }
}

@media print {
  .site-header, .site-footer, .site-nav, .site-menu, .theme-toggle {
    display: none;
  }
  body { background: #fff; color: #000; }
}

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

/* ============================================================
   PHASE 7A2 HOTFIX — visible editorial reinforcement

   The previous build looked nearly identical to the dashboard era because
   too many templates rendered without an explicit shell wrapper. The
   .main-shell on <main> (above) now centers every page. The rules below
   strengthen the editorial feel so the redesign is unmistakably present.
   ============================================================ */

/* Subtle paper texture on the canvas — barely visible warm tone variation
   so the surface reads as Bone Linen paper, not a corporate gray. */
body {
  background:
    radial-gradient(circle at 12% 8%, rgba(194, 147, 117, 0.045), transparent 55%),
    radial-gradient(circle at 88% 92%, rgba(89, 75, 103, 0.04), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 8%, rgba(214, 172, 144, 0.05), transparent 55%),
    radial-gradient(circle at 88% 92%, rgba(182, 166, 203, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* Stronger editorial headings — heavier display weight on hero titles
   so the Newsreader serif voice reads as intentional, not accidental. */
.page-title {
  font-weight: 500;
  letter-spacing: -0.022em;
}
.page-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

/* Tighter, more confident kickers across all pages. */
.page-kicker,
.section-eyebrow,
.page-eyebrow,
.primary-panel__kicker,
.quiet-panel__kicker {
  font-family: var(--font-supporting);
  font-feature-settings: "ss01";
  font-weight: 600;
}

/* The legacy .hero used by main/home.html — push it into the editorial
   register so the public landing page matches the rest of the workbook. */
.hero { padding-top: 1.5rem; padding-bottom: 1.25rem; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.022em;
}
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 400; }
.hero p.lead {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.62;
}

/* Legacy .container — when it is the page wrapper, make sure it still
   centers narrow within the .main-shell. (Already centered via margin auto;
   this just confirms width semantics.) */
.container,
.container-wide { margin-left: auto; margin-right: auto; }

/* Every long-form page should default to a comfortable reading measure.
   Where templates set their own widths, those still win. */
.main-shell__inner > section,
.main-shell__inner > article,
.main-shell__inner > header,
.main-shell__inner > div:not([class*="shell"]):not(.editorial-shell):not(.reading-shell):not(.wide-shell):not(.page-shell):not(.container) {
  /* No-op selector group — kept as a structural marker, no styles. */
}

/* Auth pages (register, login) often have no shell — give them a narrow,
   centered card-like reading column inside main-shell. */
.auth-shell {
  max-width: 460px;
  margin: 1rem auto 2rem;
}

/* Account pages reading column. */
.account-shell {
  max-width: 720px;
  margin: 0 auto;
}

/* ============================================================
   COVERS — Home, My Path, Attachment Map portrait, Journal,
   Family Repair, Practices: stronger editorial cover treatments
   so the redesign reads on first glance.
   ============================================================ */

/* A subtle hairline under the page-cover for editorial signal. */
.page-cover,
.next-step-cover {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}

/* The next-step-cover on Home is the user's first impression. Give it a
   touch more vertical air and a left rule that nods to the legacy steps. */
.next-step-cover .page-title {
  font-size: 2.35rem;
  line-height: 1.1;
}
@media (min-width: 720px) {
  .next-step-cover .page-title { font-size: 2.95rem; }
}

/* My Path field-guide rows — slightly stronger chapter signposting. */
.chapter-row__title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

/* Attachment Map portrait — quiet eyebrows feel more like a profile page. */
.portrait-section__title { letter-spacing: -0.014em; }

/* ============================================================
   LESSON CHAPTER — secure path lesson pages read like a chapter,
   not a dashboard panel.
   ============================================================ */
.lesson-chapter .page-title,
.reading-shell .page-title {
  font-size: 2.05rem;
  line-height: 1.12;
}
@media (min-width: 720px) {
  .lesson-chapter .page-title,
  .reading-shell .page-title { font-size: 2.55rem; }
}
.reading-shell .prose p {
  font-size: 1.06rem;
  line-height: 1.74;
}

/* Drop-cap utility — opt-in on the first prose paragraph for lessons. */
.prose--lead p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: normal;
  float: left;
  font-size: 3.1rem;
  line-height: 0.9;
  padding: 0.45rem 0.55rem 0 0;
  color: var(--accent);
}

/* ============================================================
   JOURNAL — protected writing room treatment
   ============================================================ */
.reading-shell .quiet-list--prompts {
  border-top: 1px solid var(--rule);
}

/* ============================================================
   PRIMARY PANEL — make it feel like a quiet inset, not a card.
   ============================================================ */
.primary-panel {
  background: var(--surface);
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: none;
  padding: 1.35rem 1.6rem;
}
@media (min-width: 720px) {
  .primary-panel { padding: 1.7rem 2rem 1.85rem; }
}

/* Quiet panel (used for collapsible filters etc.) — give it the same paper
   feel without a heavy box. */
.quiet-panel {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 1rem 0;
}

/* Legacy .card — push further toward "section block on paper", not a card. */
.card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  padding: 1.5rem 0 0;
  box-shadow: none;
}
.card + .card { margin-top: 1.75rem; }
.card-soft {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
}
.card-warm {
  background: var(--warm-accent-soft);
  border: 0;
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
}

/* ============================================================
   GRIDS — disable dashboard-grid feel on the home/index pages.
   Existing .grid-cards / .grid-2 / .grid-3 still work where used,
   but they now feel like editorial columns instead of card walls.
   ============================================================ */
.grid-cards,
.grid-2,
.grid-3 {
  gap: 2rem;
}

/* ============================================================
   MOBILE — guarantee centered viewport padding, never left-pinned.
   ============================================================ */
@media (max-width: 559px) {
  .main-shell__inner {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
  .page-title { font-size: 1.8rem; }
  .next-step-cover .page-title { font-size: 1.95rem; }
  .hero h1 { font-size: 1.95rem; }
  .editorial-shell,
  .reading-shell,
  .wide-shell,
  .page-shell,
  .container {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ============================================================
   SITE HEADER — keep the chrome edge-to-edge but center its content.
   The header lives outside .main-shell so it owns its own width.
   ============================================================ */
.site-header__inner {
  max-width: 1100px;
}

/* ============================================================
   PHASE 7A2 — visible signal: a tiny editorial mark under the
   page-title on covers. Confirms the new visual language is live.
   ============================================================ */
.page-cover .page-title + .page-lede,
.next-step-cover .page-title + .page-lede {
  position: relative;
  padding-top: 0.9rem;
}
.page-cover .page-title + .page-lede::before,
.next-step-cover .page-title + .page-lede::before {
  content: "";
  display: block;
  width: 36px;
  height: 2px;
  background: var(--worn-terra);
  margin-bottom: 0.85rem;
  border-radius: 1px;
}


/* ============================================================
   PHASE 7A.3 — Editorial visual enrichment
   Reusable visual components: editorial pull-quote, idea card,
   model diagram, practice step blocks, prompt card grid,
   chapter glyphs, path graphic, abstract figure scenes.
   No new dependencies; line-based inline SVGs only.
   ============================================================ */

/* ---------- 1. Editorial pull-quote ---------- */
.editorial-quote {
  position: relative;
  margin: 2rem 0;
  padding: 1.4rem 1.6rem 1.4rem 1.8rem;
  background: var(--bone-linen-warm);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  max-width: 64ch;
}
[data-theme="dark"] .editorial-quote {
  background: var(--surface);
}
.editorial-quote__rule {
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 3px;
  background: var(--worn-terra);
  border-radius: 2px;
}
.editorial-quote__mark {
  display: inline-block;
  width: 28px;
  height: 28px;
  color: var(--worn-terra);
  margin-bottom: 0.3rem;
}
.editorial-quote__mark svg { width: 100%; height: 100%; display: block; }
.editorial-quote__text {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.4;
  font-style: italic;
  color: var(--text);
  font-weight: 500;
}
.editorial-quote__open,
.editorial-quote__close {
  color: var(--worn-terra);
  font-style: normal;
  font-weight: 600;
  padding: 0 0.05rem;
}
.editorial-quote__attr {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  font-family: var(--font-supporting);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
@media (max-width: 640px) {
  .editorial-quote { padding: 1.1rem 1.1rem 1.1rem 1.3rem; }
  .editorial-quote__text { font-size: 1.2rem; }
}

/* ---------- 2. Figure scenes (small abstract illustrations) ---------- */
.figure-scene,
.idea-illustration {
  display: inline-block;
  width: 100%;
  max-width: 160px;
  height: auto;
  color: var(--elderberry);
  opacity: 0.85;
}
.figure-scene svg,
.idea-illustration svg { width: 100%; height: auto; display: block; }
[data-theme="dark"] .figure-scene,
[data-theme="dark"] .idea-illustration { color: var(--accent); }

.figure-scene--wide { max-width: 220px; }
.figure-scene--inline { max-width: 110px; }
.figure-scene--terra { color: var(--worn-terra); }
.figure-scene--slate { color: var(--rain-slate); }

/* A wrapper that places a figure on the side of a lesson framing aside. */
.framing-figure {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin: 1.4rem 0 1.1rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border-left: 3px solid var(--rain-slate);
  border-radius: var(--radius);
}
.framing-figure__art {
  flex: 0 0 120px;
  color: var(--rain-slate);
}
.framing-figure__art svg { width: 100%; height: auto; display: block; }
.framing-figure__body { flex: 1 1 auto; min-width: 0; }
.framing-figure__body p { margin: 0.3rem 0; }
@media (max-width: 640px) {
  .framing-figure { flex-direction: column; gap: 0.6rem; }
  .framing-figure__art { flex: 0 0 auto; max-width: 130px; }
}

/* ---------- 3. Idea card ---------- */
.idea-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0;
}
.idea-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem 1.15rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.idea-card__illustration {
  width: 100%;
  max-width: 140px;
  color: var(--worn-terra);
  margin-bottom: 0.3rem;
}
[data-theme="dark"] .idea-card__illustration { color: var(--warm-accent); }
.idea-card__illustration svg { width: 100%; height: auto; display: block; }
.idea-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.idea-card__body {
  margin: 0;
  font-size: 0.96rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ---------- 4. Model diagram ---------- */
.model-diagram {
  margin: 1.5rem 0 1.2rem;
  padding: 1.1rem 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.model-diagram__row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.6rem;
}
.diagram-step {
  flex: 1 1 130px;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  background: var(--bone-linen-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
[data-theme="dark"] .diagram-step { background: var(--surface-2); }
.diagram-step__num {
  font-family: var(--font-supporting);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--worn-terra);
  font-weight: 600;
}
.diagram-step__label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.diagram-step__sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.diagram-arrow {
  flex: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rain-slate);
  opacity: 0.8;
}
.diagram-arrow svg { width: 24px; height: auto; }
.diagram-arrow--return { flex: 0 0 32px; opacity: 0.5; }

.model-diagram__caption {
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Cycle: arrange row but allow the return arrow to wrap. */
.model-diagram__row--cycle .diagram-arrow--return {
  flex: 1 1 100%;
  justify-content: flex-end;
  padding-right: 0.5rem;
  margin-top: -0.2rem;
}

/* Vertical variant — stack steps with arrows between. */
.model-diagram--vertical { padding: 1rem 1.1rem 1.1rem; }
.model-diagram__col {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.diagram-step--vertical {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.85rem;
}
.diagram-step--vertical .diagram-step__num { padding-top: 0.15rem; }
.diagram-step__body { display: flex; flex-direction: column; gap: 0.15rem; flex: 1 1 auto; }
.diagram-arrow--vertical { padding-left: 1.1rem; color: var(--rain-slate); opacity: 0.7; }
.diagram-arrow--vertical svg { width: 12px; }

/* On narrow viewports, horizontal diagrams should stack. */
@media (max-width: 720px) {
  .model-diagram__row { flex-direction: column; align-items: stretch; }
  .diagram-step { flex: 1 1 auto; }
  .diagram-arrow {
    flex: 0 0 22px;
    transform: rotate(90deg);
    align-self: center;
  }
  .diagram-arrow--return { display: none; }
  .model-diagram--cycle .model-diagram__caption::before {
    content: "↺ ";
    color: var(--worn-terra);
    margin-right: 0.2rem;
  }
}

/* ---------- 5. Practice step blocks ---------- */
.practice-steps-visual {
  list-style: none;
  margin: 1.2rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  counter-reset: step;
}
.step-block {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: start;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--elderberry);
  border-radius: var(--radius);
}
.step-block--notice  { border-left-color: var(--rain-slate); }
.step-block--reflect { border-left-color: var(--worn-terra); }
.step-block__marker {
  font-family: var(--font-supporting);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  padding-top: 0.2rem;
  border-right: 1px solid var(--rule);
  padding-right: 0.85rem;
  align-self: stretch;
}
.step-block--notice  .step-block__marker { color: var(--rain-slate); }
.step-block--reflect .step-block__marker { color: var(--worn-terra); }
.step-block__text {
  margin: 0;
  line-height: 1.6;
  font-size: 1rem;
  color: var(--text);
}
@media (max-width: 640px) {
  .step-block { grid-template-columns: 1fr; gap: 0.35rem; }
  .step-block__marker { border-right: none; padding-right: 0; padding-bottom: 0.2rem; }
}

/* ---------- 6. Prompt card grid ---------- */
.prompt-card-grid {
  list-style: none;
  margin: 1.2rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}
.prompt-card-grid > li { margin: 0; }
.prompt-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  height: 100%;
  padding: 1rem 1.1rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.prompt-card:hover,
.prompt-card:focus-visible {
  border-color: var(--worn-terra);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}
.prompt-card__eyebrow {
  font-family: var(--font-supporting);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--worn-terra);
  font-weight: 600;
}
.prompt-card__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.prompt-card__body {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.prompt-card__cta {
  margin-top: auto;
  padding-top: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- 7. Chapter glyph (used in lists) ---------- */
.chapter-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  color: var(--worn-terra);
  opacity: 0.85;
}
.chapter-glyph svg { width: 100%; height: 100%; display: block; }
[data-theme="dark"] .chapter-glyph { color: var(--warm-accent); }

.chapter-row {
  position: relative;
}
.chapter-row__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.2rem;
}

/* ---------- 8. Path graphic (home) ---------- */
.path-graphic {
  margin: 1.4rem 0 1.6rem;
  padding: 1.1rem 1rem 1.2rem;
  background: var(--bone-linen-warm);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
[data-theme="dark"] .path-graphic { background: var(--surface); }
.path-graphic__svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--worn-terra);
  max-height: 80px;
}
.path-graphic__labels {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  text-align: center;
}
.path-graphic__labels li {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  font-family: var(--font-supporting);
  font-size: 0.85rem;
  color: var(--text);
}
.path-graphic__labels span {
  font-weight: 600;
  letter-spacing: 0.01em;
}
.path-graphic__labels em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.path-graphic__labels li.is-active span { color: var(--accent); }
.path-graphic__labels li.is-active em { color: var(--accent-hover); }
@media (max-width: 640px) {
  .path-graphic__labels {
    grid-template-columns: repeat(2, 1fr);
    text-align: left;
  }
  .path-graphic__svg { display: none; }
}

/* ---------- 9. Portrait visual block (attachment map results) ---------- */
.portrait-visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin: 1.1rem 0 0.5rem;
}
.portrait-visual {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.95rem 1rem 1rem;
  background: var(--bone-linen-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
[data-theme="dark"] .portrait-visual { background: var(--surface); }
.portrait-visual__art {
  width: 100%;
  max-width: 120px;
  color: var(--elderberry);
}
.portrait-visual__art svg { width: 100%; height: auto; display: block; }
[data-theme="dark"] .portrait-visual__art { color: var(--accent); }
.portrait-visual__eyebrow {
  font-family: var(--font-supporting);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--worn-terra);
  font-weight: 600;
}
.portrait-visual__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.portrait-visual__sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Different art tints per portrait kind, for quiet variety. */
.portrait-visual--pattern  .portrait-visual__art { color: var(--elderberry); }
.portrait-visual--wound    .portrait-visual__art { color: var(--worn-terra); }
.portrait-visual--nervous  .portrait-visual__art { color: var(--rain-slate); }
.portrait-visual--role     .portrait-visual__art { color: var(--elderberry); }
.portrait-visual--growth   .portrait-visual__art { color: var(--worn-terra); }
[data-theme="dark"] .portrait-visual--pattern  .portrait-visual__art,
[data-theme="dark"] .portrait-visual--role     .portrait-visual__art { color: var(--accent); }
[data-theme="dark"] .portrait-visual--wound    .portrait-visual__art,
[data-theme="dark"] .portrait-visual--growth   .portrait-visual__art { color: var(--warm-accent); }
[data-theme="dark"] .portrait-visual--nervous  .portrait-visual__art { color: var(--cool-accent); }

/* ---------- 10. Category marker for practices index ---------- */
.category-marker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.2rem;
  color: var(--text-muted);
}
.category-marker .chapter-glyph { width: 22px; height: 22px; flex: 0 0 22px; color: var(--rain-slate); opacity: 0.85; }

/* ---------- 11. Small "boundary diagram" used on privacy/safety ---------- */
.boundary-diagram {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.2rem;
  align-items: center;
  margin: 1.1rem 0;
  padding: 1rem 1.1rem;
  background: var(--bone-linen-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
[data-theme="dark"] .boundary-diagram { background: var(--surface); }
.boundary-diagram__art { color: var(--elderberry); }
[data-theme="dark"] .boundary-diagram__art { color: var(--accent); }
.boundary-diagram__art svg { width: 100%; height: auto; display: block; }
.boundary-diagram__body p { margin: 0.2rem 0; }
@media (max-width: 640px) {
  .boundary-diagram { grid-template-columns: 1fr; gap: 0.5rem; }
  .boundary-diagram__art { max-width: 140px; }
}
