/* ============================================================================
   Metaphi — shared stylesheet (static design prototype)
   Hillvine VISUAL system only (deep pine + cream + gold, Georgia body, Inter labels).
   Tokens are the §3-exact hex from the Site Build Brief. Both themes: prefers-color-scheme
   + a data-theme override. NO foreign accent colour — facts vs interpretation are carried
   by TYPE + LABEL and in-palette tones only.

   Revisions (2026-08-23):
   1. Boxes are for clickables only. Static content (confidence readout, summary counts,
      context notes, grouped chart facts, legend, readings, tiers) is de-boxed — grouped by
      hairline dividers, whitespace, eyebrows, and type hierarchy. Boxes/pills/bordered cards
      are reserved for things that navigate or expand.
   2. Tighter vertical rhythm, mobile-first — less padding, smaller gaps, compact summaries.
   3. Navigation moved to a thin top tab strip under the wordmark (was a bottom tab bar).
   ============================================================================ */

/* ---- Tokens: light "cream world" (default) ---- */
:root {
  --ground: #f5f1ea;
  --raised: #fbf8f1;
  --ink: #0a1210;
  --ink-strong: #062520;
  --muted: rgba(10, 18, 16, .66);
  --faint: rgba(10, 18, 16, .45);
  --gold: #997e51;          /* text-safe gold (labels on cream) */
  --gold-accent: #c4a67a;   /* rules, dots, pill fill */
  --sand: #e4d5b4;
  --line: rgba(10, 18, 16, .12);
  --line-2: rgba(10, 18, 16, .18);

  /* CTA (both themes): gold pill, pine text */
  --cta-bg: #c4a67a;
  --cta-fg: #062520;

  /* five-element accent dots (tiny dots in chart cells only) */
  --el-wood: #4f8a4f;
  --el-fire: #b5533f;
  --el-earth: #b0965d;
  --el-metal: #8a9489;
  --el-water: #3d68a0;

  --mist: radial-gradient(120% 62% at 50% -16%, rgba(196, 166, 122, .16), transparent 58%);
  --shadow: 0 26px 64px -34px rgba(6, 37, 32, .40);

  /* type */
  --serif: Georgia, "Noto Serif", "Times New Roman", serif;
  --sans: Inter, -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* rhythm */
  --app-max: 430px;
  --radius: 14px;
  --radius-sm: 10px;
  --dur: .18s;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #062520;
    --raised: #0b3d36;
    --ink: #f5f1ea;
    --ink-strong: #f5f1ea;
    --muted: rgba(245, 241, 234, .72);
    --faint: rgba(245, 241, 234, .5);
    --gold: #c4a67a;
    --gold-accent: #c4a67a;
    --sand: #e4d5b4;
    --line: rgba(245, 241, 234, .14);
    --line-2: rgba(245, 241, 234, .20);
    --el-wood: #6ea86e;
    --el-fire: #cf6a52;
    --el-earth: #c4a67a;
    --el-metal: #c9ced9;
    --el-water: #5a86c6;
    --mist: radial-gradient(120% 62% at 50% -16%, rgba(196, 166, 122, .12), transparent 58%);
    --shadow: 0 28px 70px -30px rgba(0, 0, 0, .7);
  }
}

/* explicit theme overrides (win over the media query in both directions) */
:root[data-theme="light"] {
  --ground: #f5f1ea; --raised: #fbf8f1; --ink: #0a1210; --ink-strong: #062520;
  --muted: rgba(10, 18, 16, .66); --faint: rgba(10, 18, 16, .45);
  --gold: #997e51; --gold-accent: #c4a67a; --sand: #e4d5b4;
  --line: rgba(10, 18, 16, .12); --line-2: rgba(10, 18, 16, .18);
  --el-wood: #4f8a4f; --el-fire: #b5533f; --el-earth: #b0965d; --el-metal: #8a9489; --el-water: #3d68a0;
  --mist: radial-gradient(120% 62% at 50% -16%, rgba(196, 166, 122, .16), transparent 58%);
  --shadow: 0 26px 64px -34px rgba(6, 37, 32, .40);
}
:root[data-theme="dark"] {
  --ground: #062520; --raised: #0b3d36; --ink: #f5f1ea; --ink-strong: #f5f1ea;
  --muted: rgba(245, 241, 234, .72); --faint: rgba(245, 241, 234, .5);
  --gold: #c4a67a; --gold-accent: #c4a67a; --sand: #e4d5b4;
  --line: rgba(245, 241, 234, .14); --line-2: rgba(245, 241, 234, .20);
  --el-wood: #6ea86e; --el-fire: #cf6a52; --el-earth: #c4a67a; --el-metal: #c9ced9; --el-water: #5a86c6;
  --mist: radial-gradient(120% 62% at 50% -16%, rgba(196, 166, 122, .12), transparent 58%);
  --shadow: 0 28px 70px -30px rgba(0, 0, 0, .7);
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.58;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

/* headings: Georgia, weight 300, tight tracking */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.16;
  color: var(--ink-strong);
  margin: 0;
}

/* the signature emphasis — Georgia italic in gold */
em, .em { font-style: italic; color: var(--gold); }

/* ---- App shell: centred mobile column on ambient ground ---- */
.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 0;
}
.app {
  width: 100%;
  max-width: var(--app-max);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--mist), var(--ground);
  display: flex;
  flex-direction: column;
  position: relative;
}
/* subtle desktop device frame — tasteful, optional */
@media (min-width: 600px) {
  .stage { padding: 26px 16px; align-items: flex-start; }
  .app {
    min-height: calc(100vh - 52px);
    border: 1px solid var(--line-2);
    border-radius: 28px;
    box-shadow: var(--shadow);
    overflow: hidden;
  }
}

/* screen scroll region */
.screen {
  flex: 1;
  padding: 16px 16px 22px;
  overflow-y: auto;
}
.screen--nav { padding-bottom: 22px; }
.screen > * + * { margin-top: 15px; }

/* ---- Top bar + top tab nav (companion shell) ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 11px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.topbar.has-tabs { border-bottom: 0; padding-bottom: 6px; }
.wordmark {
  font-family: var(--serif);
  font-size: 21px; font-weight: 400; letter-spacing: .005em; color: var(--ink-strong);
  text-decoration: none;
}
.wordmark em { color: var(--gold); }
.topbar .step, .topbar .crumb {
  font-family: var(--sans);
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.iconbtn {
  background: none; border: 1px solid var(--line-2); color: var(--ink);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font-size: 15px; text-decoration: none;
  transition: border-color var(--dur), background var(--dur);
}
.iconbtn:hover { border-color: var(--gold-accent); }

/* top tab strip — the primary companion nav */
.navtabs {
  display: flex; gap: 2px; padding: 0 10px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.navtabs::-webkit-scrollbar { display: none; }
.navtabs a {
  font-family: var(--sans); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  padding: 11px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--dur), border-color var(--dur);
}
.navtabs a:hover { color: var(--ink); }
.navtabs a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold-accent); }

/* back link */
.backlink {
  font-family: var(--sans); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.backlink:hover { color: var(--ink); }

/* ---- Eyebrow (gold rule + Inter uppercase label) ---- */
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  margin: 0; font-family: var(--sans);
  font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); font-weight: 500;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--gold-accent); flex: 0 0 auto; }
.eyebrow.plain { color: var(--muted); }
.eyebrow.plain::before { background: var(--line-2); }

/* a VERIFIED fact label — in-palette, no foreign hue; carried by Inter type + label */
.verified-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-strong); font-weight: 600;
}
.verified-label::before {
  content: ""; width: 6px; height: 6px; border-radius: 2px;
  background: var(--ink-strong); flex: 0 0 auto;
}
.verified-label .sub { color: var(--faint); font-weight: 500; letter-spacing: .16em; }

/* micro-label (Inter uppercase) */
.micro {
  font-family: var(--sans); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint); font-weight: 500;
}

/* ---- Pills / buttons (CLICKABLE only) ---- */
.pill {
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cta-fg); background: var(--cta-bg);
  border: 0; border-radius: 999px; padding: 14px 22px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  text-decoration: none; transition: transform var(--dur), opacity var(--dur), box-shadow var(--dur);
}
.pill .arw { transition: transform var(--dur); }
.pill:hover { opacity: .93; }
.pill:hover .arw { transform: translateX(3px); }
.pill:active { transform: translateY(1px); }
.pill--block { width: 100%; }

.pill-ghost {
  font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); background: none; border: 1px solid var(--line-2);
  border-radius: 999px; padding: 12px 20px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: border-color var(--dur), color var(--dur);
}
.pill-ghost:hover { border-color: var(--gold-accent); color: var(--ink-strong); }
.pill-ghost--block { width: 100%; }

/* ---- Card — reserved for CLICKABLE / message surfaces only ---- */
.card {
  background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 15px;
}

/* ---- Prose ---- */
.lead { font-size: 17px; line-height: 1.5; color: var(--ink); margin: 0; }
.prose p { margin: 0 0 12px; color: var(--ink); }
.prose p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* thesis (the hook headline) */
.thesis {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: 21px; line-height: 1.48; letter-spacing: .002em; text-wrap: balance; color: var(--ink-strong);
}
.thesis em { color: var(--gold); }

/* ---- Confidence: DE-BOXED readout (gold ring on neutral track, sage-free) + why ---- */
.confidence {
  display: flex; gap: 13px; align-items: center; padding: 2px 0;
}
.ring {
  --pct: 75; flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--gold-accent) calc(var(--pct) * 1%), var(--line-2) 0);
}
.ring::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--ground); }
.ring b {
  position: relative; z-index: 1; font-family: var(--sans);
  font-size: 13px; font-weight: 700; color: var(--ink-strong); font-variant-numeric: tabular-nums;
}
.ring--raised::after { background: var(--raised); } /* when the ring sits on a raised surface */
.conf-txt { font-size: 14px; line-height: 1.5; color: var(--muted); }
.conf-txt b { color: var(--ink); font-weight: 700; }
details.why-wrap { margin-top: 4px; }
details.why-wrap > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
}
details.why-wrap > summary::-webkit-details-marker { display: none; }
details.why-wrap > summary::after { content: "+"; color: var(--faint); }
details.why-wrap[open] > summary::after { content: "\2212"; }
details.why-wrap .why-body {
  margin-top: 9px; font-size: 14px; line-height: 1.55; color: var(--muted);
  border-left: 2px solid var(--gold-accent); padding-left: 12px;
}

/* ---- Chart facts strip — DE-BOXED: borderless columns, hairline separators ---- */
.pillars {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  margin-top: 12px; /* room for the Day Master tag to sit above */
}
.pillar {
  padding: 8px 6px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center; position: relative;
}
.pillar + .pillar { border-left: 1px solid var(--line); }
.pillar .pos {
  font-family: var(--sans); font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); font-weight: 600;
}
.pillar .glyph { font-family: var(--serif); font-size: 15px; color: var(--faint); line-height: 1; opacity: .7; }
.pillar .en { font-size: 12px; line-height: 1.3; color: var(--ink); }
.pillar .dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 2px; }
.pillar.dm .pos { color: var(--gold); }
.pillar.dm::before {
  content: "Day Master"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  font-family: var(--sans); font-size: 7.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
  color: var(--cta-fg); background: var(--gold-accent); padding: 2px 7px; border-radius: 10px; white-space: nowrap;
}
.d-wood { background: var(--el-wood); } .d-fire { background: var(--el-fire); }
.d-earth { background: var(--el-earth); } .d-metal { background: var(--el-metal); } .d-water { background: var(--el-water); }
.microcaption { margin: 0; font-size: 12.5px; color: var(--faint); line-height: 1.5; }

/* element legend (dot key) */
.el-key { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.el-key span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.el-key i { width: 7px; height: 7px; border-radius: 50%; }

/* ---- Time-anchored proof list ---- */
.anchors { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.anchors li {
  display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: baseline;
  font-size: 14px; line-height: 1.5; color: var(--ink); padding: 11px 0;
}
.anchors li + li { border-top: 1px solid var(--line); }
.anchors .when {
  font-family: var(--sans); font-size: 10.5px; color: var(--gold); font-variant-numeric: tabular-nums;
  letter-spacing: .04em; text-align: right; font-weight: 600; text-transform: uppercase;
}

/* ---- Legend (fact vs interpretation) — DE-BOXED, hairline top only ---- */
.legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  border-top: 1px solid var(--line); padding-top: 14px;
}
.legend > span { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.legend .sw-gold { width: 10px; height: 10px; border-radius: 3px; background: var(--gold-accent); flex: 0 0 auto; }
.legend .lab {
  font-family: var(--sans); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-strong); font-weight: 600; border: 1px solid var(--line-2); border-radius: 5px; padding: 2px 6px;
}
.legend .honest { flex-basis: 100%; color: var(--faint); font-size: 12px; line-height: 1.55; }

/* ---- Soft wall (conversion) — DE-BOXED, hairline top, the buttons carry the chrome ---- */
.wall {
  border-top: 1px solid var(--line); padding-top: 16px;
  display: flex; flex-direction: column; gap: 13px;
}
.wall-lead { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.wall-lead b { color: var(--ink); font-weight: 700; }

/* ---- Forms ---- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label {
  font-family: var(--sans); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.input, .select {
  font-family: var(--serif); font-size: 16px; color: var(--ink);
  background: var(--raised); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 12px 14px; width: 100%; transition: border-color var(--dur);
}
.input:focus, .select:focus { outline: none; border-color: var(--gold-accent); }
.input::placeholder { color: var(--faint); }
.input:disabled { opacity: .5; cursor: not-allowed; }
.field-hint { font-size: 12.5px; color: var(--faint); line-height: 1.45; }
.checkrow { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.checkrow input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--gold-accent); flex: 0 0 auto; }

/* social auth buttons (clickable — mocked) */
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  font-family: var(--sans); font-size: 12px; letter-spacing: .06em; font-weight: 500;
  color: var(--ink); background: var(--raised); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 13px 18px; cursor: pointer; text-decoration: none;
  transition: border-color var(--dur);
}
.social-btn:hover { border-color: var(--gold-accent); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.divider span { font-family: var(--sans); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }

/* ---- Chat (feed / workspace) ---- */
.chat { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 92%; }
.msg .who {
  font-family: var(--sans); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); font-weight: 500; margin-bottom: 5px; display: block;
}
.msg .bubble {
  border-radius: 14px; padding: 13px 15px; font-size: 15px; line-height: 1.55;
}
.msg-bot .bubble { background: var(--raised); border: 1px solid var(--line); border-top-left-radius: 5px; color: var(--ink); }
.msg-user { margin-left: auto; }
.msg-user .who { text-align: right; }
.msg-user .bubble { background: var(--sand); border: 1px solid var(--gold-accent); border-top-right-radius: 5px; color: #0a1210; }

/* the daily/weekly update — a distinguished message (chat message surface) */
.msg-update { max-width: 100%; }
.update-card {
  background: var(--raised); border: 1px solid var(--gold-accent); border-radius: var(--radius);
  padding: 15px; position: relative;
}
.update-card .u-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px;
}
.update-card .u-title {
  font-family: var(--sans); font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; display: inline-flex; align-items: center; gap: 8px;
}
.update-card .u-title::before { content: ""; width: 18px; height: 1px; background: var(--gold-accent); }
.update-card .u-date { font-family: var(--sans); font-size: 10px; letter-spacing: .06em; color: var(--faint); }
.update-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.update-list li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 14px; line-height: 1.5; }
.update-list .tag { font-size: 13px; line-height: 1.4; color: var(--faint); }
.tag-opp { color: var(--gold); } /* opportunity marker — gold, matching the dashboard */

/* system / fold-in note */
.fold-note {
  text-align: center; font-family: var(--sans); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); position: relative; padding: 4px 0;
}
.fold-note span { background: var(--ground); padding: 0 12px; position: relative; z-index: 1; }
.fold-note::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--line); }

/* chat composer (interactive) */
.composer {
  display: flex; gap: 9px; align-items: flex-end;
  padding: 11px 14px calc(11px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--ground);
}
.composer .grow {
  flex: 1; background: var(--raised); border: 1px solid var(--line-2); border-radius: 20px;
  padding: 11px 15px; font-family: var(--serif); font-size: 15px; color: var(--ink); resize: none; min-height: 44px;
}
.composer .grow:focus { outline: none; border-color: var(--gold-accent); }
.composer .send {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--cta-bg); color: var(--cta-fg); font-size: 17px; display: grid; place-items: center;
}

/* ---- Chips (charts included in a workspace — clickable) ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--raised); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 6px 13px 6px 7px; font-size: 13px; color: var(--ink); text-decoration: none;
}
.chip .av {
  width: 22px; height: 22px; border-radius: 50%; background: var(--sand); flex: 0 0 auto;
  display: grid; place-items: center; font-family: var(--sans); font-size: 10px; font-weight: 600; color: #062520;
}
.chip-add {
  border-style: dashed; color: var(--muted); cursor: pointer; padding: 6px 14px;
  font-family: var(--sans); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
}
.chip-add:hover { border-color: var(--gold-accent); color: var(--ink); }

/* ---- Context note — DE-BOXED (eyebrow + text + tag, no card) ---- */
.note { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.note p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ---- Dashboard ---- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

/* compact inline summary (replaces the big hero-number cards) */
.summary-line {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px;
  font-size: 15px; color: var(--muted);
}
.summary-line .item { display: inline-flex; align-items: baseline; gap: 7px; }
.summary-line .n { font-family: var(--serif); font-weight: 300; font-size: 24px; color: var(--ink-strong); letter-spacing: -0.02em; }
.summary-line .n.opp { color: var(--gold); }

/* signals — DE-BOXED, hairline-separated list */
.dash-grid { display: flex; flex-direction: column; }
.signal {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 14px 0;
}
.signal + .signal { border-top: 1px solid var(--line); }
.signal .badge {
  font-family: var(--sans); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap; align-self: start; margin-top: 3px;
}
.badge-opp { color: var(--cta-fg); background: var(--gold-accent); }
.badge-caution { color: var(--muted); background: transparent; border: 1px solid var(--line-2); }
.signal .s-body h3 { font-size: 16px; font-weight: 400; margin-bottom: 4px; color: var(--ink-strong); }
.signal .s-body p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.signal .s-meta {
  font-family: var(--sans); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); margin-top: 7px; display: flex; gap: 12px; flex-wrap: wrap;
}
/* per-workspace snapshots (clickable — navigate) */
.snapshot-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.snapshot-row::-webkit-scrollbar { display: none; }
.snap {
  flex: 0 0 auto; width: 150px; background: var(--raised); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 13px; text-decoration: none;
  transition: border-color var(--dur);
}
.snap:hover { border-color: var(--gold-accent); }
.snap .snap-name { font-size: 15px; color: var(--ink-strong); margin-bottom: 5px; }
.snap .snap-line { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* ---- Library / network rows (clickable — open a detail view) ---- */
.rows { display: flex; flex-direction: column; gap: 9px; }
.person {
  display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 15px; text-decoration: none; color: inherit; transition: border-color var(--dur);
}
.person:hover { border-color: var(--gold-accent); }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--sand); flex: 0 0 auto;
  display: grid; place-items: center; font-family: var(--sans); font-weight: 600; font-size: 15px; color: #062520;
}
.person .p-name { font-size: 16.5px; color: var(--ink-strong); }
.person .p-rel { font-family: var(--sans); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }
.person .p-arrow { color: var(--faint); font-size: 18px; }

/* free-tier nudge — DE-BOXED (hairline framed, the button is the clickable) */
.nudge {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 18px 4px; text-align: center; display: flex; flex-direction: column; gap: 11px; align-items: center;
}

/* ---- Placeholder marker (visible, so nothing fake ships silently) ---- */
.ph-tag {
  font-family: var(--sans); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); border: 1px dashed var(--line-2); border-radius: 5px; padding: 2px 6px; display: inline-block;
}

/* ---- Settings — DE-BOXED groups (hairline-divided rows; controls carry the chrome) ---- */
.settings-group { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.set-row .s-label { font-size: 15.5px; color: var(--ink); }
.set-row .s-desc { font-size: 12.5px; color: var(--faint); margin-top: 3px; line-height: 1.4; }

/* segmented control (tone — interactive) */
.segmented {
  display: inline-flex; background: var(--raised); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 3px; gap: 2px;
}
.segmented button {
  font-family: var(--sans); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500;
  border: 0; background: none; color: var(--muted); padding: 8px 13px; border-radius: 999px; cursor: pointer;
  transition: background var(--dur), color var(--dur);
}
.segmented button[aria-pressed="true"] { background: var(--gold-accent); color: var(--cta-fg); font-weight: 600; }

/* toggle switch (interactive) */
.switch { position: relative; width: 46px; height: 27px; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; transition: background var(--dur);
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%;
  background: var(--raised); transition: transform var(--dur); box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.switch input:checked + .track { background: var(--gold-accent); }
.switch input:checked + .track::after { transform: translateX(19px); }

/* ---- Paywall tiers — DE-BOXED, hairline-separated plan blocks ---- */
.tiers { display: flex; flex-direction: column; }
.tier { padding: 18px 0; position: relative; }
.tier + .tier { border-top: 1px solid var(--line); }
.tier .t-eyebrow {
  font-family: var(--sans); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600;
  color: var(--gold); margin-bottom: 8px; display: flex; align-items: center; gap: 9px;
}
.tier .t-eyebrow .rec { color: var(--cta-fg); background: var(--gold-accent); padding: 2px 8px; border-radius: 999px; letter-spacing: .12em; }
.tier .t-price { font-family: var(--serif); font-weight: 300; font-size: 32px; color: var(--ink-strong); letter-spacing: -0.02em; }
.tier .t-price .per { font-size: 13px; color: var(--faint); font-family: var(--sans); letter-spacing: .04em; }
.tier ul { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.tier li { display: grid; grid-template-columns: 18px 1fr; gap: 9px; font-size: 14px; line-height: 1.4; color: var(--ink); }
.tier li .ck { color: var(--gold); }
.tier li.off { color: var(--faint); }
.tier li.off .ck { color: var(--faint); }

/* ---- Reading (My Chart / Profile) — DE-BOXED, hairline-divided parts ---- */
.reading .part { padding: 15px 0; border-bottom: 1px solid var(--line); }
.reading .part:first-child { padding-top: 4px; }
.reading .part:last-child { border-bottom: 0; }
.reading h3 {
  font-size: 13px; font-family: var(--sans); font-weight: 600; letter-spacing: .04em;
  color: var(--gold); margin-bottom: 9px; text-transform: none;
}
.reading p { font-size: 15.5px; line-height: 1.6; color: var(--ink); margin: 0 0 11px; }
.reading p:last-child { margin-bottom: 0; }
.reading strong { font-weight: 700; color: var(--ink-strong); }

/* sources footer (readings) */
.sources {
  font-size: 12px; line-height: 1.65; color: var(--faint); border-top: 1px solid var(--line); padding-top: 13px;
}
.sources .src-label {
  font-family: var(--sans); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; display: block; margin-bottom: 6px;
}

/* ---- Landing (full-width responsive marketing) ---- */
.landing { background: var(--mist), var(--ground); }
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1120px; margin: 0 auto; padding: 22px 24px;
}
.landing-nav .links { display: flex; gap: 22px; align-items: center; }
.landing-nav .links a {
  font-family: var(--sans); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; font-weight: 500;
}
.landing-nav .links a:hover { color: var(--ink); }
.hero {
  max-width: 1120px; margin: 0 auto; padding: 36px 24px 56px;
  display: grid; grid-template-columns: 1fr; gap: 36px; align-items: center;
}
.hero h1 { font-size: clamp(38px, 9vw, 76px); line-height: 1.05; letter-spacing: -0.03em; }
.hero h1 em { color: var(--gold); }
.hero .sub { font-size: clamp(16px, 2.4vw, 21px); color: var(--muted); line-height: 1.5; max-width: 34ch; margin: 20px 0 0; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; align-items: center; }
.hero-visual { display: flex; justify-content: center; }
/* the hero preview is an illustrative product shot — a legitimate framed visual */
.hero-card {
  width: 100%; max-width: 380px; background: var(--raised); border: 1px solid var(--line-2);
  border-radius: 20px; padding: 20px; box-shadow: var(--shadow);
}
/* value props — DE-BOXED, hairline-separated blocks */
.value-row {
  max-width: 1120px; margin: 0 auto; padding: 8px 24px 64px;
  display: grid; grid-template-columns: 1fr; gap: 0;
}
.value { padding: 20px 0; border-top: 1px solid var(--line); }
.value h3 { font-size: 21px; margin-bottom: 7px; }
.value h3 em { color: var(--gold); }
.value p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.landing-foot {
  border-top: 1px solid var(--line); max-width: 1120px; margin: 0 auto; padding: 24px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  font-family: var(--sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
}
@media (min-width: 800px) {
  .hero { grid-template-columns: 1.1fr .9fr; padding: 60px 24px 84px; gap: 52px; }
  .value-row { grid-template-columns: repeat(3, 1fr); gap: 0 36px; }
  .value { border-top: 0; border-left: 1px solid var(--line); padding: 8px 0 8px 28px; }
  .value:first-child { border-left: 0; padding-left: 0; }
}
/* narrow: collapse the landing nav to wordmark + Sign in so text links don't wrap into the wordmark */
@media (max-width: 560px) {
  .landing-nav { padding: 18px 20px; }
  .landing-nav .links { gap: 12px; }
  .landing-nav .links a:not(.pill-ghost) { display: none; }
}

/* ---- Index (prototype menu — clickable items) ---- */
.index-wrap { max-width: 760px; margin: 0 auto; padding: 36px 22px 56px; }
.index-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 22px; }
@media (min-width: 620px) { .index-grid { grid-template-columns: 1fr 1fr; } }
.index-item {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center;
  background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px;
  text-decoration: none; color: inherit; transition: border-color var(--dur), transform var(--dur);
}
.index-item:hover { border-color: var(--gold-accent); transform: translateY(-1px); }
.index-item .num {
  font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--gold);
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-2);
  display: grid; place-items: center; flex: 0 0 auto;
}
.index-item .t { display: block; font-size: 17px; color: var(--ink-strong); }
.index-item .d { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.group-label {
  font-family: var(--sans); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin: 26px 0 2px; grid-column: 1 / -1;
}

/* ---- Utilities ---- */
.stack-sm > * + * { margin-top: 9px; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 20px; }
.row { display: flex; gap: 12px; align-items: center; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.center { text-align: center; }
.hr { height: 1px; background: var(--line); border: 0; margin: 2px 0; }
.section { border-top: 1px solid var(--line); padding-top: 15px; }

/* the "reading…" loading state (simulated swap) */
.loading-read { display: flex; flex-direction: column; align-items: center; gap: 15px; padding: 40px 20px; text-align: center; }
.loading-read .spin {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold-accent);
  animation: spin 0.9s linear infinite;
}
.loading-read .lr-text { font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
[hidden] { display: none !important; }

/* ---- Focus + motion ---- */
:where(a, button, input, textarea, select, summary, .switch):focus-visible {
  outline: 2px solid var(--gold-accent); outline-offset: 2px; border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .rise > * { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
  .rise > *:nth-child(2) { animation-delay: .05s; }
  .rise > *:nth-child(3) { animation-delay: .1s; }
  .rise > *:nth-child(4) { animation-delay: .15s; }
  .rise > *:nth-child(5) { animation-delay: .2s; }
  .rise > *:nth-child(6) { animation-delay: .25s; }
  @keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
}
