/* Threshold: scores destination */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0C0B09;
  --bg-elev: #14120E;
  --bg-card-1: #171411;
  --bg-card-2: #0E0C0A;
  --cream: #ECE6DA;
  --cream-soft: #C9C0AF;
  --cream-mute: #908778;
  --cream-faint: #5D5648;
  --gold: #C8A876;
  --gold-deep: #A88A5C;
  --gold-light: #DCC08A;
  --gold-soft: rgba(200, 168, 118, 0.14);
  --gold-line: rgba(200, 168, 118, 0.22);
  --coral: #D27866;
  --coral-light: #E89E8C;
  --coral-soft: #F0B5A5;
  --serif: 'Fraunces', 'Iowan Old Style', 'Hoefler Text', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --container: 1180px;
  --pad-x: 48px;
}

html, body {
  background:
    radial-gradient(900px 700px at 80% -10%, rgba(220, 192, 138, 0.05), transparent 60%),
    radial-gradient(800px 600px at -10% 60%, rgba(120, 90, 60, 0.05), transparent 65%),
    var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.018) 0.5px, transparent 0.6px);
  background-size: 3px 3px;
  mix-blend-mode: screen;
  opacity: 0.4;
}
a { color: inherit; text-decoration: none; }

/* ---------- Top bar (shared style) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  background: linear-gradient(180deg, rgba(12,11,9,0.94), rgba(12,11,9,0.6));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid rgba(232,225,212,0.06);
}
.topbar__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--cream); }
.topbar__mark { width: 18px; height: 22px; display: block; }
.topbar__word {
  font-family: var(--serif); font-weight: 400; font-size: 20px;
  letter-spacing: -0.005em; font-variation-settings: "opsz" 60; line-height: 1;
}
.topbar__nav-group { display: flex; align-items: center; gap: 4px; }
.topbar__nav {
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--cream-mute); padding: 9px 14px; border-radius: 2px;
  transition: color 200ms ease;
}
.topbar__nav:hover { color: var(--gold-light); }
.topbar__nav--active { color: var(--gold-light); }

/* ---------- Weekly digest banner ---------- */
.digest {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  padding: 32px var(--pad-x) 32px;
  background:
    linear-gradient(180deg, rgba(200,168,118,0.08), rgba(200,168,118,0.02) 60%, transparent),
    var(--bg);
  border-bottom: 1px solid rgba(200,168,118,0.18);
}
.digest__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 0.85fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 880px) { .digest__inner { grid-template-columns: 1fr; gap: 28px; } }

.digest__eyebrow {
  font-family: var(--sans);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.digest__eyebrow span { color: var(--gold-light); letter-spacing: 0.16em; }

.digest__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--cream);
  font-variation-settings: "opsz" 96;
  margin-bottom: 16px;
}
.digest__headline {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  color: var(--cream-soft);
  font-variation-settings: "opsz" 36;
  margin-bottom: 22px;
  max-width: 52ch;
}
.digest__headline em { color: var(--gold-light); }

.digest__stats { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 22px; }
.digest__stat-label {
  font-family: var(--sans);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cream-faint);
  margin-bottom: 6px;
}
.digest__stat-value {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--cream);
  font-variation-settings: "opsz" 60;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.digest__stat-value em {
  font-style: italic;
  font-size: 14px;
  color: var(--gold);
  margin-left: 4px;
}
.digest__stat-delta {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--cream-mute);
  font-variant-numeric: tabular-nums;
}
.digest__stat-delta.up { color: var(--gold-light); }
.digest__stat-delta.down { color: var(--coral); }

.digest__prompt {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  color: var(--cream-soft);
  font-variation-settings: "opsz" 24;
  max-width: 50ch;
  margin-bottom: 20px;
}
.digest__prompt em { font-style: italic; color: var(--gold-light); display: block; margin-bottom: 4px; }

.digest__dismiss {
  background: transparent;
  border: 1px solid rgba(232,225,212,0.18);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  padding: 11px 22px;
  border-radius: 2px;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}
.digest__dismiss:hover { color: var(--gold-light); border-color: var(--gold); }

.digest__pulse {
  width: 100%;
  height: 80px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(232,225,212,0.05);
  border-radius: 4px;
  overflow: hidden;
}
.digest__pulse svg { display: block; width: 100%; height: 100%; }
.digest__pulse-label {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cream-faint);
  text-align: right;
}

/* ---------- Main layout ---------- */
.sx {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: 56px var(--pad-x) 96px;
  display: flex; flex-direction: column;
  gap: 28px;
}

/* ---------- Cards (shared) ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(23,20,17,0.85), rgba(14,12,10,0.85));
  border: 1px solid rgba(232,225,212,0.06);
  border-radius: 6px;
  padding: 32px 32px 28px;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,168,118,0.18), transparent);
}
.card--full { width: 100%; }
.card__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(232,225,212,0.05);
}
.card__label {
  font-family: var(--sans);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--cream-mute);
}
.card__meta {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--cream-faint);
  font-variation-settings: "opsz" 24;
}
.card__meta em { font-style: italic; }
.card__caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--cream-soft);
  font-variation-settings: "opsz" 24;
  max-width: 38ch;
  margin-bottom: 14px;
}

/* ---------- Hero row ---------- */
.sx-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}
@media (max-width: 980px) { .sx-hero { grid-template-columns: 1fr; } }

.card--hero { padding: 36px 36px 32px; }

.big-num {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(96px, 11vw, 156px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--cream);
  font-variation-settings: "opsz" 144;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}
.big-num em {
  font-style: italic;
  font-weight: 300;
  font-size: 0.22em;
  color: var(--cream-mute);
  margin-left: 6px;
  vertical-align: 0.5em;
  letter-spacing: 0;
}

.card--honesty .card__meta { color: var(--gold-light); }
.card--honesty .card__meta.down { color: var(--coral); }

/* Tone the score by health. Only a healthy score is rendered in champagne;
   a low score goes quiet, withholding celebration, never adding punishment.
   "Forming" (grace period) is smaller and italic: a state, not a verdict. */
.card--honesty-high .big-num { color: var(--gold-light); }
.card--honesty-mid  .big-num { color: var(--cream); }
.card--honesty-low  .big-num { color: var(--cream-mute); }
.card--honesty-forming .big-num {
  font-size: clamp(52px, 6vw, 84px);
  font-style: italic;
  color: var(--cream-mute);
}

/* sparkline beneath honesty number */
.spark { margin-top: 16px; }
.spark svg { display: block; width: 100%; height: 90px; }
.spark__axis {
  display: flex; justify-content: space-between;
  font-family: var(--sans);
  font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cream-faint);
  margin-top: 8px;
}

/* ---------- Today's Standard ring (Aura-style) ---------- */
.card--ring {
  display: flex;
  flex-direction: column;
}
.ring-wrap {
  position: relative;
  width: 100%;
  max-width: 260px;
  margin: 16px auto 4px;
  aspect-ratio: 1 / 1;
}
.ring { width: 100%; height: 100%; display: block; }
#ringFill {
  transition:
    stroke-dashoffset 1100ms cubic-bezier(0.16, 1, 0.3, 1),
    stroke 600ms ease;
}

/* Overshoot state: gold becomes coral, inner numerals shift, sub text emphasizes the breach */
.card--ring.is-over .ring-num em { color: var(--coral, #E89E8C); }
.card--ring.is-over .ring-num { color: var(--coral-soft, #F0B5A5); }
.card--ring.is-over .ring-sub { color: var(--coral-soft, #F0B5A5); }
.card--ring.is-over .ring-sub em { color: var(--coral, #E89E8C); font-style: normal; }
.card--ring.is-over #todayLeft {
  color: var(--coral, #E89E8C);
  font-style: normal;
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ring-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}
.ring-num {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--cream);
  font-variation-settings: "opsz" 144;
  display: inline-flex; align-items: baseline; gap: 3px;
}
.ring-num em {
  font-style: italic;
  font-size: 18px;
  color: var(--gold);
  margin-left: 3px;
}
.ring-sub {
  margin-top: 8px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--cream-mute);
  font-variation-settings: "opsz" 24;
}
.ring-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center;
  margin-top: 18px;
}
.ring-tag {
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--cream-mute);
  padding: 6px 12px;
  border: 1px solid rgba(232,225,212,0.12);
  border-radius: 999px;
  letter-spacing: 0.04em;
}

/* ---------- Insights strip ---------- */
.sx-insights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 880px) { .sx-insights { grid-template-columns: repeat(2, 1fr); } }

.micro {
  background: linear-gradient(180deg, rgba(23,20,17,0.7), rgba(14,12,10,0.7));
  border: 1px solid rgba(232,225,212,0.06);
  border-radius: 4px;
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}
.micro::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,168,118,0.15), transparent);
}
.micro__label {
  font-family: var(--sans);
  font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--cream-faint);
  margin-bottom: 8px;
}
.micro__value {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 34px;
  line-height: 1;
  color: var(--cream);
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.025em;
  display: inline-flex; align-items: baseline;
}
.micro__value em {
  font-style: italic;
  font-size: 13px;
  color: var(--gold);
  margin-left: 3px;
}
.micro__value--small {
  font-size: 22px;
  font-variation-settings: "opsz" 60;
  display: block;
  letter-spacing: -0.01em;
}
.micro__sub {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--cream-mute);
  letter-spacing: 0.02em;
}
.micro__dots {
  margin-top: 10px;
  display: flex; gap: 5px;
}
.micro__dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(232,225,212,0.1);
}
.micro__dots span.held { background: var(--gold); }
/* Today is marked with a ring only; the fill has to be earned. A day already
   past the standard shows a quiet coral hint, never celebratory gold. */
.micro__dots span.today { box-shadow: 0 0 0 1px var(--gold-light); }
.micro__dots span.today:not(.held) { background: rgba(210, 120, 102, 0.45); }

/* ---------- Charts ---------- */
.chart-wrap { width: 100%; }
.chart {
  display: block; width: 100%; height: 200px;
}
.chart-axis {
  display: flex; justify-content: space-between;
  font-family: var(--sans);
  font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cream-faint);
  margin-top: 8px;
}

/* ---------- Split: heatmap + bars ---------- */
.sx-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
}
@media (max-width: 980px) { .sx-split { grid-template-columns: 1fr; } }

/* Heatmap */
.heatmap-wrap { display: flex; flex-direction: column; gap: 12px; }
.heatmap-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-family: var(--sans);
  font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cream-faint);
  text-align: center;
}
.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.heatmap-cell {
  --i: 0;
  aspect-ratio: 1 / 1;
  border-radius: 3px;
  background: rgba(232,225,212,0.045);
  position: relative;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.heatmap-cell::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 3px;
  background: var(--gold);
  opacity: calc(var(--i) * 0.95);
}
.heatmap-cell:hover { transform: scale(1.08); box-shadow: 0 0 0 1px var(--gold-light); }
.heatmap-cell.today { box-shadow: 0 0 0 1px var(--gold-light); }
/* A day that crossed the standard reads coral at a glance; held days stay gold. */
.heatmap-cell.over::after { background: var(--coral); }
.heatmap-legend {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--sans);
  font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cream-faint);
}
.heatmap-scale { display: flex; gap: 4px; }
.heatmap-scale .heatmap-cell { width: 14px; height: 14px; aspect-ratio: auto; }

/* Bars */
.bars { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.bar { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 14px; }
.bar__name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 16px;
  color: var(--cream);
  font-variation-settings: "opsz" 24;
}
.bar__track {
  height: 6px;
  background: rgba(232,225,212,0.07);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-light), var(--gold-deep));
  border-radius: 6px;
  width: 0%;
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
}
.bar__val {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--cream-mute);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Honesty by tag ---------- */
.tagbars {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 8px 0 0;
  padding: 0;
}

.tagbar {
  display: grid;
  grid-template-columns: 90px 1fr 64px 110px;
  align-items: center;
  column-gap: 18px;
}

.tagbar__name {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream);
}

.tagbar__track {
  height: 6px;
  background: rgba(232, 225, 212, 0.07);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.tagbar__fill {
  height: 100%;
  border-radius: 6px;
  width: 0%;
  transition: width 1000ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Tone-driven fill colors. Low honesty bleeds coral, high holds gold-light. */
.tagbar--is-strong .tagbar__fill { background: linear-gradient(90deg, var(--gold-light), #E5D2A8); }
.tagbar--is-good   .tagbar__fill { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.tagbar--is-mid    .tagbar__fill { background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.tagbar--is-low    .tagbar__fill { background: linear-gradient(90deg, var(--coral), var(--coral-light)); }
.tagbar--is-untyped .tagbar__fill { background: rgba(232, 225, 212, 0.12); }

.tagbar__pct {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--cream);
  text-align: right;
  font-variant-numeric: lining-nums tabular-nums;
  font-variation-settings: "opsz" 48;
}

.tagbar--is-low .tagbar__pct { color: var(--coral-light); }
.tagbar--is-strong .tagbar__pct { color: var(--gold-light); }

.tagbar__count {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 13px;
  color: var(--cream-mute);
  text-align: right;
  font-variation-settings: "opsz" 24;
}

.tagbars__empty {
  margin: 0;
  padding: 4px 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  color: var(--cream-mute);
}

@media (max-width: 720px) {
  .tagbar {
    grid-template-columns: 70px 1fr 50px;
    column-gap: 12px;
  }
  .tagbar__count {
    grid-column: 2 / -1;
    text-align: left;
    margin-top: 4px;
  }
  .tagbar__pct { font-size: 22px; }
}

/* ---------- Sessions list ---------- */
.sess { list-style: none; display: flex; flex-direction: column; }
.sess li {
  display: grid;
  grid-template-columns: 14px 1fr auto auto auto;
  align-items: baseline;
  column-gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(232,225,212,0.05);
}
.sess li:last-child { border-bottom: none; }
.sess__flag {
  width: 7px; height: 7px; border-radius: 50%;
  align-self: center;
  background: rgba(232,225,212,0.18);
}
.sess__flag.yes { background: var(--gold); box-shadow: 0 0 0 3px rgba(200,168,118,0.13); }
.sess__flag.partial { background: rgba(200,168,118,0.5); }
.sess__flag.no { background: var(--coral); }
.sess__intent {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 15px;
  color: var(--cream);
  font-variation-settings: "opsz" 24;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sess__domain {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--cream-mute);
}
.sess__when {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--cream-mute);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.sess__dur {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--cream-faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* Quiet empty-state line, shared by the trend, heatmap, sites, and sessions
   cards. First run should read as waiting, not broken. */
.card__empty {
  margin: 0;
  padding: 4px 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  color: var(--cream-mute);
}

/* ---------- Foot ---------- */
.sx-foot {
  margin-top: 24px;
  text-align: center;
  padding: 32px 0 0;
}
.sx-foot__rule { width: 320px; margin: 0 auto 16px; }
.sx-foot__rule svg { display: block; width: 100%; height: 14px; }
.sx-foot__line {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--cream-faint);
  font-variation-settings: "opsz" 24;
}

/* ---------- Carry it with you (share card CTA) ---------- */
.sx-card-cta {
  margin-top: 22px;
  padding: 46px 40px 48px;
  text-align: center;
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  background:
    radial-gradient(120% 140% at 50% -20%, rgba(200, 168, 118, 0.07), transparent 60%),
    linear-gradient(180deg, var(--bg-card-1), var(--bg-card-2));
}
.sx-card-cta__eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.sx-card-cta__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 30px;
  line-height: 1.12;
  color: var(--cream);
  margin: 0 0 12px;
  font-variation-settings: "opsz" 40;
}
.sx-card-cta__title em { font-style: italic; color: var(--gold-light); }
.sx-card-cta__sub {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  color: var(--cream-soft);
  max-width: 460px;
  margin: 0 auto 26px;
}
.sx-card-cta__sub em { font-style: italic; color: var(--gold-light); }
.sx-card-cta__btn {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #14120E;
  background: var(--gold-light);
  border: 1px solid var(--gold-light);
  border-radius: 2px;
  padding: 14px 30px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.sx-card-cta__btn:hover { background: var(--gold); border-color: var(--gold); }
.sx-card-cta__btn:active { transform: translateY(1px); }

/* ---------- Honesty card modal ---------- */
/* Centering uses flex-start plus margin:auto on the dialog, not align-items:
   center. A centered flex child taller than the container overflows equally
   top and bottom, and the top half can't be scrolled to; margin auto centers
   when there's room and lets short viewports scroll from the very top. */
.cardm {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 220ms ease;
}
.cardm[hidden] { display: none; }
.cardm.is-open { opacity: 1; }
.cardm__backdrop {
  /* Fixed, not absolute: the veil must cover the viewport even after the
     dialog scrolls past the container's own padding box. */
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 6, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cardm__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  max-width: 460px;
  margin: auto;
  transform: translateY(10px) scale(0.985);
  transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cardm.is-open .cardm__dialog { transform: none; }
.cardm__frame {
  line-height: 0;
  border: 1px solid var(--gold-line);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.cardm__canvas {
  display: block;
  width: min(440px, 84vw);
  height: auto;
}
.cardm__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.cardm__btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 2px;
  padding: 12px 22px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.cardm__btn--gold { background: var(--gold-light); border-color: var(--gold-light); color: #14120E; }
.cardm__btn--gold:hover { background: var(--gold); border-color: var(--gold); }
.cardm__btn--ghost { background: transparent; border-color: var(--gold-line); color: var(--cream-soft); }
.cardm__btn--ghost:hover { border-color: var(--gold); color: var(--gold-light); }
.cardm__btn--quiet { background: transparent; color: var(--cream-mute); }
.cardm__btn--quiet:hover { color: var(--cream); }
.cardm__btn.is-flashed { color: var(--gold-light); }
.cardm__note {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 12.5px;
  color: var(--cream-faint);
  text-align: center;
  margin: 0;
}

/* Keyboard focus: a quiet champagne ring, shown only for keyboard users. */
.sx-card-cta__btn:focus-visible,
.cardm__btn:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}
.cardm__btn:focus { outline: none; } /* mouse clicks stay ringless; focus-visible re-adds it for keys */

/* ---------- Pre-hydration skeleton ---------- */
/* The numerals ship blank in the HTML, and the composed lines around them
   (units, "of 30 · remaining", the micro subtitles) stay hidden until real
   data lands, so no invented number ever flashes before the user's own.
   visibility keeps the layout steady while the values arrive. */
body:not(.is-hydrated) .big-num em,
body:not(.is-hydrated) .ring-num em,
body:not(.is-hydrated) .ring-sub,
body:not(.is-hydrated) .card--ring .card__meta,
body:not(.is-hydrated) .micro__sub {
  visibility: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  :root { --pad-x: 24px; }
  .topbar { padding: 14px 22px; }
  .topbar__nav { padding: 7px 8px; font-size: 10px; letter-spacing: 0.18em; }
  .card { padding: 24px 22px 20px; }
  .digest { padding: 24px var(--pad-x); }
  .digest__stats { gap: 18px; }
  .sx-card-cta { padding: 36px 24px 38px; }
  .sx-card-cta__title { font-size: 25px; }
}

/* ---------- Reduced motion ----------
   The ring draw-in, sparkline stroke, and bar grows are transition-driven from
   JS-set final values, so killing transitions snaps straight to the real
   numbers. No opacity reveals here, so nothing needs pinning. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Keyboard focus: a consistent champagne ring; mouse focus stays clean. */
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
input:focus-visible, textarea:focus-visible { outline: none; }
