/* ============================================================
   Regulation. — design system
   ============================================================ */
:root {
  --bg: #0b0f16;
  --bg-2: #0f1420;
  --fg: #eef2f8;
  --muted: #8794a8;
  --muted-2: #b9c3d4;
  --card: #131824;
  --card-2: #1b2232;
  --card-3: #232c40;
  --line: #222a3c;
  --accent: #a0e7c9;

  /* state palette — each state gets a hue with a light/dark gradient pair */
  --green-1: #3fd6a8; --green-2: #157554; --green-glow: rgba(63,214,168,.35);
  --yellow-1: #f3b045; --yellow-2: #a45f14; --yellow-glow: rgba(243,176,69,.35);
  --red-1:   #ff7a59; --red-2:   #a3321a; --red-glow:   rgba(255,122,89,.35);
  --blue-1:  #6aa6e6; --blue-2:  #1d4c82; --blue-glow:  rgba(106,166,230,.35);

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-lg: 0 30px 60px -20px rgba(0,0,0,.55), 0 10px 25px -12px rgba(0,0,0,.45);
  --shadow-md: 0 10px 30px -12px rgba(0,0,0,.5);
  --touch: 56px;

  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: radial-gradient(120% 80% at 50% -20%, #1a2033 0%, #0b0f16 60%) no-repeat;
  background-attachment: fixed;
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* Aurora blobs — soft ambient glow behind everything */
.aurora {
  position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden;
}
.aurora::before, .aurora::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: .35;
  will-change: transform;
}
.aurora::before {
  width: 520px; height: 520px;
  background: radial-gradient(circle, var(--green-1), transparent 70%);
  top: -180px; left: -140px;
  animation: drift-a 22s var(--ease) infinite alternate;
}
.aurora::after {
  width: 620px; height: 620px;
  background: radial-gradient(circle, var(--blue-1), transparent 70%);
  bottom: -240px; right: -180px;
  animation: drift-b 26s var(--ease) infinite alternate;
}
@keyframes drift-a { to { transform: translate(60px, 60px) scale(1.1); } }
@keyframes drift-b { to { transform: translate(-60px, -40px) scale(1.05); } }

.screen {
  min-height: 100dvh;
  max-width: 640px;
  margin: 0 auto;
  padding: max(env(safe-area-inset-top), 18px) 18px calc(max(env(safe-area-inset-bottom), 18px) + 12px);
  display: flex; flex-direction: column; gap: 18px;
  position: relative;
}

/* -------- typography -------- */
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.page-title { font-size: 18px; font-weight: 600; }
.display { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; }

.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: 13px; }
.w-full { width: 100%; }

/* -------- header / brand -------- */
.home-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 2px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: 'Fraunces', Georgia, serif; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--green-1), var(--yellow-1), var(--red-1), var(--blue-1), var(--green-1));
  box-shadow: 0 0 16px 2px var(--green-glow);
}
.brand-word { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.brand-accent { color: var(--accent); }
.nav-links { display: inline-flex; gap: 14px; }
.nav-link {
  color: var(--muted-2); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 8px 10px; border-radius: 999px;
  transition: background .15s, color .15s;
}
.nav-link:hover { color: var(--fg); background: var(--card-2); }
.back-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--fg); background: rgba(255,255,255,.06); text-decoration: none;
  transition: background .15s ease;
}
.back-link:hover { background: rgba(255,255,255,.12); }

/* -------- hero -------- */
.hero { padding: 6px 2px 0; }
.hero-q {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 32px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em;
}
.hero-q em { font-style: italic; color: var(--accent); font-weight: 400; }
.hero-sub { color: var(--muted); margin: 8px 0 0; font-size: 15px; }

/* -------- state grid -------- */
.state-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  flex: 1; align-content: start;
}
.state-form { margin: 0; display: flex; }
.state-card {
  flex: 1;
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 220px; padding: 16px 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: #fff; text-align: left; font: inherit; cursor: pointer;
  background: var(--card);
  overflow: hidden;
  transition: transform .12s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.state-card::before {
  content: ""; position: absolute; inset: 0;
  background: var(--card-grad, linear-gradient(180deg, var(--card-2), var(--card)));
  opacity: .85; z-index: 0;
}
.state-card::after {
  content: ""; position: absolute; inset: -2px;
  border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset;
  z-index: 2;
}
.state-card > * { position: relative; z-index: 1; }
.state-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: transparent; }
.state-card:active { transform: scale(.98); }

.state-green  { --card-grad: radial-gradient(140% 100% at 110% -30%, var(--green-1) 0%, var(--green-2) 55%, #0b2a1f 100%); }
.state-yellow { --card-grad: radial-gradient(140% 100% at 110% -30%, var(--yellow-1) 0%, var(--yellow-2) 55%, #2a1a06 100%); }
.state-red    { --card-grad: radial-gradient(140% 100% at 110% -30%, var(--red-1) 0%, var(--red-2) 55%, #2a0f08 100%); }
.state-blue   { --card-grad: radial-gradient(140% 100% at 110% -30%, var(--blue-1) 0%, var(--blue-2) 55%, #0b1e36 100%); }

.state-art {
  display: flex; justify-content: flex-start;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.35));
}
.state-copy { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
.state-tag {
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  opacity: .8;
}
.state-title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.state-def { font-size: 13px; opacity: .88; }
.state-chev {
  position: absolute; right: 14px; top: 14px;
  width: 18px; height: 18px; opacity: .6;
}

/* state background helpers used by action/insights/about */
.state-bg-green  { background: linear-gradient(135deg, var(--green-1), var(--green-2)); }
.state-bg-yellow { background: linear-gradient(135deg, var(--yellow-1), var(--yellow-2)); color: #1a1200; }
.state-bg-red    { background: linear-gradient(135deg, var(--red-1), var(--red-2)); }
.state-bg-blue   { background: linear-gradient(135deg, var(--blue-1), var(--blue-2)); }

.home-footer { margin-top: auto; padding-top: 12px; text-align: center; }

/* ============================================================
   Action screen
   ============================================================ */
.action-header {
  position: relative;
  display: grid; grid-template-columns: auto 1fr; gap: 14px;
  padding: 18px 18px 20px; border-radius: var(--radius-lg);
  color: #fff; overflow: hidden;
  box-shadow: var(--shadow-md);
}
.action-header::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 60% at 0% 0%, rgba(255,255,255,.18), transparent 60%);
  pointer-events: none;
}
.action-header .back-link {
  position: absolute; top: 14px; right: 14px;
  background: rgba(0,0,0,.25); color: #fff;
}
.action-header-art { display: flex; align-items: center; justify-content: center; }
.action-header-copy { display: flex; flex-direction: column; gap: 6px; }
.pill {
  display: inline-block;
  background: rgba(0,0,0,.25);
  color: inherit;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  width: fit-content;
}
.action-headline { font-family: 'Fraunces', Georgia, serif; font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.action-def { margin: 0; font-size: 15px; opacity: .95; font-style: italic; }
.learn-btn {
  margin-top: 4px; align-self: flex-start;
  background: rgba(0,0,0,.22); color: inherit;
  border: 0; border-radius: 999px; padding: 7px 12px;
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s;
}
.learn-btn:hover { background: rgba(0,0,0,.35); }

.action-section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 2px; }
.section-title { }
.section-hint { color: var(--muted); font-size: 12px; letter-spacing: .04em; }

.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px; min-height: 160px;
  color: var(--fg); text-align: left; font: inherit; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  overflow: hidden;
  transition: transform .12s var(--ease), border-color .2s, box-shadow .2s;
}
.action-card::after {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(120% 100% at 100% 0%, rgba(255,255,255,.08), transparent 60%);
  transition: opacity .2s;
  pointer-events: none;
}
.action-card:hover { transform: translateY(-2px); border-color: var(--card-3); box-shadow: var(--shadow-md); }
.action-card:hover::after { opacity: 1; }
.action-card:active { transform: scale(.98); }

.action-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tech-badge, .dur-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em;
}
.tech-badge {
  background: rgba(255,255,255,.06); color: var(--muted-2);
}
.action-card--green  .tech-badge { color: var(--green-1); background: rgba(63,214,168,.09); }
.action-card--yellow .tech-badge { color: var(--yellow-1); background: rgba(243,176,69,.09); }
.action-card--red    .tech-badge { color: var(--red-1); background: rgba(255,122,89,.09); }
.action-card--blue   .tech-badge { color: var(--blue-1); background: rgba(106,166,230,.1); }
.dur-badge { background: var(--card-2); color: var(--muted); }

.action-card-body { display: flex; flex-direction: column; gap: 4px; }
.action-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.action-desc {
  font-size: 13px; color: var(--muted-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.action-card-foot { display: flex; justify-content: flex-end; }
.cta-primary {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--accent);
  letter-spacing: .02em;
}

/* ============================================================
   Sheet (state detail + feedback)
   ============================================================ */
.sheet {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet[hidden] { display: none; }
.sheet-scrim {
  position: absolute; inset: 0;
  background: rgba(5,8,14,.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in .18s var(--ease);
}
.sheet-card {
  position: relative; width: 100%; max-width: 640px;
  background: var(--bg-2);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--line);
  padding: 12px 18px 24px;
  max-height: 88dvh; overflow: auto;
  animation: sheet-up .24s var(--ease);
  box-shadow: 0 -30px 60px -20px rgba(0,0,0,.6);
}
.sheet-card--small { padding: 14px 18px 22px; }
.sheet-grip {
  width: 44px; height: 4px; border-radius: 999px;
  background: var(--card-3); margin: 0 auto 12px;
}
.sheet-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius-md);
  color: #fff; margin-bottom: 14px;
}
.sheet-head .pill { background: rgba(0,0,0,.25); }
.sheet-title { font-family: 'Fraunces', Georgia, serif; font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; }
.sheet-head-art { filter: drop-shadow(0 6px 12px rgba(0,0,0,.3)); }
.sheet-body { display: flex; flex-direction: column; gap: 12px; }
.sheet-lede { font-size: 15px; color: var(--muted-2); margin: 0; }
.sheet-h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 8px; font-weight: 600; }
.check-list { margin: 0; padding: 0 0 0 18px; color: var(--muted-2); font-size: 14px; }
.check-list li { margin: 4px 0; }

@keyframes sheet-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* buttons */
.btn-primary {
  min-height: var(--touch); border: 0; border-radius: 14px;
  padding: 0 20px;
  background: linear-gradient(135deg, #ecf2fa, #c9d6ea);
  color: #0b0f16; font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .1s var(--ease), filter .15s;
  text-decoration: none;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: scale(.98); }
.btn-ghost {
  min-height: var(--touch); border: 1px solid var(--card-3); border-radius: 14px;
  padding: 0 20px; background: transparent; color: var(--fg);
  font: inherit; font-weight: 500; cursor: pointer;
}
.btn-ghost:hover { background: var(--card-2); }

/* feedback */
.feedback-q { margin: 4px 0 2px; text-align: center; font-size: 18px; font-weight: 600; }
.feedback-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.fb {
  min-height: var(--touch); border: 0; border-radius: 14px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; color: #fff;
  transition: transform .1s var(--ease), filter .15s;
}
.fb:hover { filter: brightness(1.08); }
.fb:active { transform: scale(.97); }
.fb-yes    { background: linear-gradient(135deg, var(--green-1), var(--green-2)); }
.fb-little { background: linear-gradient(135deg, #7e8aa3, #4a5368); }
.fb-no     { background: linear-gradient(135deg, var(--red-1), var(--red-2)); }

/* ============================================================
   Guide overlay
   ============================================================ */
.guide {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  display: flex; flex-direction: column;
  animation: fade-in .2s var(--ease);
}
.guide[hidden] { display: none; }
.guide-inner {
  max-width: 640px; width: 100%; margin: 0 auto;
  padding: max(env(safe-area-inset-top), 18px) 18px max(env(safe-area-inset-bottom), 18px);
  flex: 1; display: flex; flex-direction: column; gap: 14px;
}
.guide-top { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; }
.guide-close {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card-2); color: var(--fg); border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.guide-title { font-weight: 600; font-size: 15px; }
.guide-timer { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }

.guide-stage {
  position: relative;
  border-radius: var(--radius-lg);
  min-height: 320px;
  padding: 40px 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.guide-stage::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.12), transparent 60%);
  pointer-events: none;
}
.guide-step {
  margin: 0; text-align: center;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px; line-height: 1.25; font-weight: 500; letter-spacing: -.01em;
  min-height: 3em;
  transition: opacity .3s ease;
  max-width: 22ch;
  position: relative;
}
.guide-step.step-fade { opacity: 0; }

/* breathing orb: pulse scale synced to step cadence via JS-driven CSS var */
.breathe {
  position: relative;
  width: 180px; height: 180px;
  display: flex; align-items: center; justify-content: center;
}
.breathe-ring, .breathe-core {
  position: absolute; inset: 0; border-radius: 50%;
}
.breathe-ring {
  border: 2px solid rgba(255,255,255,.35);
  animation: breathe-ring 6s ease-in-out infinite;
}
.breathe-core {
  background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.9), rgba(255,255,255,.25) 60%, transparent 75%);
  animation: breathe-core 6s ease-in-out infinite;
  mix-blend-mode: overlay;
}
@keyframes breathe-ring {
  0%, 100% { transform: scale(.7); opacity: .8; }
  50%      { transform: scale(1.1); opacity: 1; }
}
@keyframes breathe-core {
  0%, 100% { transform: scale(.55); opacity: .5; }
  50%      { transform: scale(1);   opacity: .95; }
}

.guide-progress {
  width: 100%; height: 6px; border-radius: 999px;
  background: var(--card-2); overflow: hidden;
}
.guide-progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), #7cc5e6);
  transition: width .25s linear;
}
.guide-rationale {
  color: var(--muted-2); font-size: 13px; line-height: 1.5;
  margin: 0;
}
.guide-actions {
  margin-top: auto; display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
}

/* ============================================================
   Insights
   ============================================================ */
.insights-block { display: flex; flex-direction: column; gap: 12px; }
.empty-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 22px;
  display: flex; flex-direction: column; gap: 14px; align-items: flex-start;
}
.bar {
  display: flex; height: 44px;
  border-radius: 12px; overflow: hidden;
  background: var(--card-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.bar-seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 600; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.legend li { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.legend-art { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.legend-label { display: flex; flex-direction: column; line-height: 1.25; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.timeline-item {
  display: grid; grid-template-columns: 16px 60px 1fr; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: 10px; background: var(--card);
  border: 1px solid var(--line);
}
.time { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--muted-2); }
.timeline-label { color: var(--muted-2); font-size: 14px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: 0 0 12px; }

.top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.top-row {
  display: grid; grid-template-columns: 32px 24px 1fr auto auto; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.rank { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.top-tech { color: var(--muted-2); display: inline-flex; }
.top-title { font-weight: 500; }
.top-state { }
.top-score { color: var(--green-1); font-weight: 600; font-size: 13px; }

/* ============================================================
   About
   ============================================================ */
.about-lede { padding: 6px 2px; display: flex; flex-direction: column; gap: 10px; }
.about-block { display: flex; flex-direction: column; gap: 12px; }
.about-h3 { font-family: 'Fraunces', Georgia, serif; font-size: 20px; font-weight: 600; }
.about-list { margin: 0; padding: 0 0 0 18px; color: var(--muted-2); }
.about-list li { margin: 6px 0; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.about-card {
  border-radius: var(--radius-md); padding: 14px;
  color: #fff; display: flex; gap: 12px; align-items: center;
  box-shadow: var(--shadow-md);
}
.about-card-art { flex-shrink: 0; filter: drop-shadow(0 6px 12px rgba(0,0,0,.3)); }
.about-card-copy { display: flex; flex-direction: column; gap: 4px; }
.about-card-copy h4 { font-family: 'Fraunces', Georgia, serif; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.about-card-copy .pill { background: rgba(0,0,0,.25); }

.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tech-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 6px;
}
.tech-ic { color: var(--accent); }
.tech-card h4 { font-size: 15px; font-weight: 600; }
.tech-card p { margin: 0; color: var(--muted-2); }

/* ============================================================
   Toast (undo)
   ============================================================ */
#toast-root {
  position: fixed; inset: auto 0 0 0; display: flex; justify-content: center;
  padding: 18px; pointer-events: none; z-index: 60;
}
.toast {
  pointer-events: auto;
  background: var(--card); border: 1px solid var(--card-3);
  color: var(--fg);
  border-radius: 14px; padding: 10px 12px 10px 16px;
  display: inline-flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toast-up .24s var(--ease);
  max-width: 420px; width: 100%;
}
.toast.is-hiding { animation: toast-down .2s var(--ease) forwards; }
.toast-check { color: var(--green-1); display: inline-flex; }
.toast-msg { flex: 1; font-size: 14px; }
.toast-btn {
  border: 0; background: var(--card-3); color: var(--fg);
  border-radius: 10px; padding: 8px 12px; font: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer;
}
.toast-btn:hover { background: #303a55; }
@keyframes toast-up { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toast-down { to { transform: translateY(24px); opacity: 0; } }

/* ============================================================
   Auth (signup / login / forgot / reset / account)
   ============================================================ */
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-md);
}
.auth-title { font-family: 'Fraunces', Georgia, serif; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.auth-lede { color: var(--muted-2); margin: -6px 0 6px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
.field-hint  { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field input {
  min-height: 48px; padding: 0 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--fg); font: inherit;
  transition: border-color .15s, background .15s;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card-2);
}

.form-error {
  background: rgba(255,122,89,.12);
  border: 1px solid rgba(255,122,89,.3);
  color: #ffb9a5;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.auth-foot { text-align: center; color: var(--muted-2); font-size: 14px; margin: 8px 0 0; }
.auth-foot a { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-foot a:hover { text-decoration: underline; }
.dot-sep { color: var(--muted); margin: 0 8px; }

.account-head { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: conic-gradient(from 0deg, var(--green-1), var(--yellow-1), var(--red-1), var(--blue-1), var(--green-1));
  color: #0b0f16; font-weight: 700; font-size: 22px;
}
.account-name { margin: 0; font-weight: 600; font-size: 16px; }

.meta-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 2px; }
.meta-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; color: var(--muted-2);
}
.meta-list strong { color: var(--fg); font-weight: 600; }

.account-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.welcome-banner {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, rgba(63,214,168,.18), rgba(63,214,168,.06));
  border: 1px solid rgba(63,214,168,.35);
  border-radius: 14px;
  padding: 12px 14px; font-size: 14px; color: var(--fg);
  animation: sheet-up .3s var(--ease);
}
.welcome-icon { color: var(--green-1); display: inline-flex; }

.auth-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-link:hover { text-decoration: underline; }

/* Auth nav links surfaced in the home/about/insights header */
.nav-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #0b0f16;
  padding: 8px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.nav-cta:hover { filter: brightness(1.06); }

/* ============================================================
   Analytics — hero stats, tabs, heatmap, dow
   ============================================================ */
.hero-stats { display: flex; flex-direction: column; gap: 10px; }
.hero-stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 2px;
}
.hero-streak {
  background: linear-gradient(135deg, rgba(63,214,168,.16), rgba(106,166,230,.08));
  border-color: rgba(63,214,168,.35);
  padding: 22px;
}
.hero-streak .hero-n { color: #fff; }
.hero-n { font-family: 'Fraunces', Georgia, serif; font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.hero-l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.hero-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hero-mini .hero-stat { padding: 12px 14px; }
.hero-mini .hero-n { font-size: 22px; }

.tabs {
  display: inline-flex; gap: 2px;
  background: var(--card-2);
  border-radius: 999px; padding: 4px;
  align-self: flex-start;
}
.tab {
  color: var(--muted-2); text-decoration: none;
  padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--fg); }
.tab.is-active { color: #0b0f16; background: var(--accent); }

/* --- Time of day heatmap (six columns, vertical stack) --- */
.heatmap {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px;
}
.heatmap-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.heatmap-stack {
  width: 100%; height: 100px;
  display: flex; flex-direction: column;
  border-radius: 8px; overflow: hidden;
  background: var(--card-2);
}
.heatmap-seg { display: block; }
.heatmap-empty { flex: 1; opacity: .3; }
.heatmap-l { font-size: 11px; color: var(--muted-2); font-weight: 500; }
.heatmap-n { font-variant-numeric: tabular-nums; }

/* --- Day of week (7 columns, height-encoded bars) --- */
.dow-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px;
}
.dow-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dow-bars {
  width: 100%; height: 90px;
  display: flex; align-items: flex-end; gap: 2px;
  background: var(--card-2); border-radius: 6px; padding: 4px;
}
.dow-seg { flex: 1; min-height: 3px; border-radius: 3px; }
.dow-l { font-size: 11px; color: var(--muted-2); font-weight: 500; }

/* --- Technique effectiveness bars --- */
.tech-effect { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.tech-effect li {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.tech-effect-row { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; }
.tech-effect-ic { color: var(--accent); display: inline-flex; }
.tech-effect-l { font-weight: 500; font-size: 14px; }
.tech-effect-bar { height: 6px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.tech-effect-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), #7cc5e6);
  transition: width .4s var(--ease);
}

/* ============================================================
   Journal — redesigned
   ============================================================ */

/* ---- Featured prompt hero ---- */
.j-featured {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 22px 22px 24px;
  background:
    linear-gradient(135deg, rgba(63,214,168,.22) 0%, rgba(106,166,230,.12) 60%, transparent 100%),
    var(--card);
  border: 1px solid rgba(160,231,201,.25);
  box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
}
.j-featured::before {
  content: ""; position: absolute; inset: auto -40px -60px auto;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(63,214,168,.25), transparent 70%);
  pointer-events: none; filter: blur(20px);
}
.j-featured > * { position: relative; z-index: 1; }
.j-featured-kicker {
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}
.j-featured-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em;
  margin: 0;
}
.j-featured-body {
  margin: 0; color: var(--muted-2); font-size: 15px; line-height: 1.55;
}
.j-featured-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.j-featured-actions .btn-primary, .j-featured-actions .btn-ghost { min-height: 48px; padding: 0 18px; font-size: 14px; }

/* ---- 30-day writing calendar ---- */
.j-calendar {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 14px;
}
.j-cal-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--card-2);
  border: 1px solid transparent;
  transition: transform .1s var(--ease);
}
.j-cal-cell.has-entry { box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.j-cal-cell.is-today { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(160,231,201,.18); }
.j-cal-cell:hover { transform: scale(1.15); }

/* ---- Stats row on journal index ---- */
.j-stats .hero-stat { padding: 12px 14px; }
.j-stats .hero-n { font-size: 22px; }

/* ---- Prompt strip (legacy chip kept for compactness where needed) ---- */
.prompt-mini {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; text-decoration: none; color: var(--fg);
  font-size: 14px;
  transition: border-color .15s, background .15s;
}
.prompt-mini:hover { border-color: var(--card-3); background: var(--card-2); }
.prompt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- Prompt "epigraph" used at top of form and reader ---- */
.prompt-epigraph {
  display: grid; grid-template-columns: 4px 1fr; gap: 16px;
  background: linear-gradient(135deg, rgba(160,231,201,.09), rgba(106,166,230,.04));
  border: 1px solid rgba(160,231,201,.22);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.prompt-epigraph--reader { margin-top: 6px; }
.prompt-epigraph-bar {
  background: linear-gradient(180deg, var(--accent), #7cc5e6);
  border-radius: 4px;
}
.prompt-epigraph-kicker {
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}
.prompt-epigraph-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em;
  margin: 4px 0 6px;
}
.prompt-epigraph-body { margin: 0; color: var(--muted-2); font-size: 15px; line-height: 1.55; font-style: italic; }

/* ---- Writer (form) ---- */
.writer { display: flex; flex-direction: column; gap: 14px; }
.writer-title {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 14px;
}
.writer-title summary {
  list-style: none; cursor: pointer;
  padding: 12px 0;
  color: var(--muted-2); font-size: 14px; font-weight: 500;
  display: flex; justify-content: space-between; align-items: center;
}
.writer-title summary::-webkit-details-marker { display: none; }
.writer-title summary::after {
  content: ""; width: 10px; height: 10px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); margin-right: 4px;
  transition: transform .15s var(--ease);
}
.writer-title[open] summary::after { transform: rotate(-135deg); }
.writer-title input {
  width: 100%;
  background: transparent; border: 0; outline: 0;
  padding: 4px 0 14px;
  color: var(--fg); font: inherit; font-size: 16px;
}

.writer-pad {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px 40px;
  transition: border-color .15s, background .15s;
}
.writer-pad:focus-within { border-color: var(--accent); background: var(--card-2); }
.writer-body {
  width: 100%; min-height: 240px; max-height: 70dvh;
  background: transparent; border: 0; outline: 0; resize: none;
  color: var(--fg);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 19px; line-height: 1.6; letter-spacing: -.005em;
}
.writer-body::placeholder {
  color: var(--muted);
  font-style: italic;
}
.writer-count {
  position: absolute; right: 14px; bottom: 12px;
  font-size: 11px; font-weight: 500; color: var(--muted);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}

.writer-tools {
  display: flex; flex-direction: column; gap: 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 16px;
}
.writer-tool { display: flex; flex-direction: column; gap: 10px; }
.writer-tool-l {
  font-size: 12px; color: var(--muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em;
}

.state-chip-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.state-chip-lg {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--muted-2); font-size: 11px; font-weight: 600;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.state-chip-lg input { position: absolute; opacity: 0; pointer-events: none; }
.state-chip-lg .state-chip-art { opacity: .55; transition: opacity .15s; }
.state-chip-lg:has(input:checked), .state-chip-lg.is-on {
  border-color: var(--accent);
  background: var(--card-2);
  color: var(--fg);
  transform: translateY(-1px);
}
.state-chip-lg:has(input:checked) .state-chip-art, .state-chip-lg.is-on .state-chip-art { opacity: 1; }
.state-chip-lg.state-chip-none { color: var(--muted); }
.state-chip-lg.state-chip-none .state-chip-art { color: var(--muted); }

.mood-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.mood-face {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 8px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line);
  cursor: pointer;
  transition: all .15s var(--ease);
}
.mood-face input { position: absolute; opacity: 0; pointer-events: none; }
.mood-face svg { opacity: .55; transition: opacity .15s, transform .15s; }
.mood-face:has(input:checked), .mood-face.is-on {
  border-color: var(--accent); background: var(--card-2);
  transform: translateY(-1px);
}
.mood-face:has(input:checked) svg, .mood-face.is-on svg { opacity: 1; transform: scale(1.06); }

/* ---- Entry list card ---- */
.entry-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.entry-card {
  position: relative;
  display: grid; grid-template-columns: 4px 1fr; gap: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); overflow: hidden;
  text-decoration: none; color: inherit;
  transition: transform .12s var(--ease), border-color .2s, box-shadow .2s;
}
.entry-card:hover { transform: translateY(-1px); border-color: var(--card-3); box-shadow: var(--shadow-md); }
.entry-accent { background: var(--card-3); }
.entry-card--green  .entry-accent { background: linear-gradient(180deg, var(--green-1), var(--green-2)); }
.entry-card--yellow .entry-accent { background: linear-gradient(180deg, var(--yellow-1), var(--yellow-2)); }
.entry-card--red    .entry-accent { background: linear-gradient(180deg, var(--red-1), var(--red-2)); }
.entry-card--blue   .entry-accent { background: linear-gradient(180deg, var(--blue-1), var(--blue-2)); }
.entry-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.entry-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mood-glyph { display: inline-flex; align-items: center; }
.entry-title { font-family: 'Fraunces', Georgia, serif; font-size: 19px; font-weight: 600; margin: 2px 0; letter-spacing: -.01em; }
.entry-excerpt {
  color: var(--muted-2); font-size: 14px; margin: 0; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---- Reader (show) ---- */
.reader-header { margin-bottom: -4px; }
.reader { display: flex; flex-direction: column; gap: 14px; }
.reader-banner {
  position: relative;
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 18px 20px; border-radius: var(--radius-lg);
  color: #fff;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.reader-banner::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 60% at 0% 0%, rgba(255,255,255,.18), transparent 60%);
  pointer-events: none;
}
.reader-banner--neutral { background: linear-gradient(135deg, var(--card-2), var(--card)); color: var(--fg); border: 1px solid var(--line); box-shadow: none; }
.reader-banner-art { filter: drop-shadow(0 8px 16px rgba(0,0,0,.35)); }
.reader-banner-copy { display: flex; flex-direction: column; gap: 6px; }
.reader-banner-copy--lone { padding-left: 2px; }
.reader-banner-copy .pill { background: rgba(0,0,0,.28); width: fit-content; }
.reader-banner-date { font-size: 13px; opacity: .9; }
.reader-banner-mood { display: inline-flex; }

.reader-meta { padding: 0 2px; }
.reader-h {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 30px; line-height: 1.12; font-weight: 600; letter-spacing: -.02em;
  margin: 6px 0 0;
}
.reader-body {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px; line-height: 1.65; letter-spacing: -.005em;
  color: var(--fg);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px 24px;
}
.reader-footer {
  position: sticky; bottom: 12px;
  display: grid; grid-template-columns: 2fr 1fr; gap: 10px;
  background: linear-gradient(180deg, transparent, var(--bg) 40%);
  padding-top: 18px;
}
.reader-footer .btn-primary, .reader-footer .btn-ghost { min-height: 48px; }

.btn-ghost.danger { color: #ffb9a5; border-color: rgba(255,122,89,.35); }
.btn-ghost.danger:hover { background: rgba(255,122,89,.08); }

/* ---- Prompts library page ---- */
.prompt-library { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prompt-lib-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px 16px; text-decoration: none; color: inherit;
  transition: transform .12s var(--ease), border-color .2s;
  position: relative;
  overflow: hidden;
}
.prompt-lib-card:hover { transform: translateY(-1px); border-color: var(--card-3); }
.prompt-lib-card.has-state::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px;
}
.prompt-lib-card.state-accent-green::before  { background: var(--green-1); }
.prompt-lib-card.state-accent-yellow::before { background: var(--yellow-1); }
.prompt-lib-card.state-accent-red::before    { background: var(--red-1); }
.prompt-lib-card.state-accent-blue::before   { background: var(--blue-1); }
.prompt-lib-card .pill { width: fit-content; }
.prompt-lib-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin: 2px 0;
}
.prompt-lib-body {
  margin: 0; color: var(--muted-2); font-size: 13px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============================================================
   SOS (emergency) card on home
   ============================================================ */
.sos-card {
  display: grid; grid-template-columns: 40px 1fr 20px; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255,122,89,.10), rgba(255,122,89,.04));
  border: 1px solid rgba(255,122,89,.28);
  border-radius: var(--radius-md);
  color: var(--fg); text-decoration: none;
  transition: transform .12s var(--ease), border-color .2s;
}
.sos-card:hover { transform: translateY(-1px); border-color: rgba(255,122,89,.5); }
.sos-ic {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,122,89,.18); color: var(--red-1);
}
.sos-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sos-title { font-weight: 600; font-size: 15px; }
.sos-sub { color: var(--muted-2); font-size: 13px; }
.sos-chev { color: var(--muted); }

/* ============================================================
   Help (emergency) flow
   ============================================================ */
.help-header { margin-bottom: 4px; }
.help-step {
  display: none; flex-direction: column; gap: 14px;
  animation: fade-in .25s var(--ease);
  min-height: calc(100dvh - 200px);
}
.help-step.is-active { display: flex; }
.help-breath {
  align-self: center; margin: 18px 0 8px;
  color: #fff;
}
.help-h {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em;
  margin: 0; text-align: center;
}
.help-lede { color: var(--muted-2); text-align: center; margin: 0 auto; max-width: 42ch; font-size: 16px; }
.help-q {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em;
  margin: 8px 0 0;
}
.help-helper { color: var(--muted-2); font-size: 14px; margin: -4px 0 4px; }

.help-options { display: flex; flex-direction: column; gap: 10px; }
.help-opt {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 18px;
  color: var(--fg); text-align: left; font: inherit;
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer;
  transition: transform .1s var(--ease), border-color .15s, background .15s;
}
.help-opt:hover { border-color: var(--card-3); background: var(--card-2); }
.help-opt:active { transform: scale(.99); }
.help-opt-title { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.help-opt-sub { color: var(--muted); font-size: 13px; }

.help-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 18px; }
.help-actions--quiet { padding-top: 6px; }

/* Result screen */
.help-result-art { align-self: center; margin: 12px 0 8px; filter: drop-shadow(0 10px 20px rgba(0,0,0,.35)); }
.help-result-kicker { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; text-align: center; margin: 0; }
.help-result-state {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 32px; font-weight: 600; letter-spacing: -.02em;
  text-align: center; margin: 2px 0 0;
}
.help-result-def { color: var(--muted-2); font-size: 15px; text-align: center; margin: 4px auto 14px; max-width: 40ch; font-style: italic; }
.help-result-action {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
}
.help-result-action-title { font-family: 'Fraunces', Georgia, serif; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.help-result-action-desc { color: var(--muted-2); font-size: 14px; line-height: 1.5; }

.help-result-actions { gap: 12px; }
.help-result-actions .link-quiet { align-self: center; margin-top: 2px; }

/* ============================================================
   Landing page
   ============================================================ */
.landing-hero { display: flex; flex-direction: column; gap: 12px; padding: 8px 2px 4px; }
.landing-kicker {
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}
.landing-h {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 40px; line-height: 1.05; font-weight: 600; letter-spacing: -.025em;
  margin: 0;
}
.landing-sub { color: var(--muted-2); font-size: 16px; line-height: 1.55; margin: 0; max-width: 56ch; }
.landing-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.landing-cta .btn-primary { min-height: 52px; font-size: 15px; padding: 0 22px; }
.landing-cta-note { color: var(--muted); font-size: 13px; }

.landing-states { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.state-card--static { pointer-events: none; min-height: 200px; }

.landing-block { display: flex; flex-direction: column; gap: 12px; }
.landing-steps { margin: 0; padding-left: 18px; color: var(--muted-2); display: flex; flex-direction: column; gap: 10px; }
.landing-steps strong { color: var(--fg); font-weight: 600; }

.landing-price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* Price cards — used on landing, signup, and billing */
.price-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.price-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 16px; display: flex; flex-direction: column; gap: 6px; min-height: 140px;
  position: relative; overflow: hidden;
}
.price-card--hero { background: linear-gradient(135deg, rgba(63,214,168,.16), rgba(63,214,168,.05)); border-color: rgba(63,214,168,.3); }
.price-card--accent { background: linear-gradient(135deg, rgba(160,231,201,.18), rgba(106,166,230,.08)); border-color: rgba(160,231,201,.4); }
.price-tag { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.price-amount { font-family: 'Fraunces', Georgia, serif; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.price-unit { font-family: 'Inter', sans-serif; font-size: 14px; color: var(--muted-2); font-weight: 400; margin-left: 4px; }
.price-sub { color: var(--muted-2); font-size: 13px; line-height: 1.45; }
.price-card .btn-primary, .price-card .btn-ghost { margin-top: auto; }

.auth-kicker { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }

.auth-pricing { display: flex; flex-direction: column; gap: 12px; }

.check-email { align-items: center; text-align: center; padding: 36px 22px; }
.check-email-art { margin: 0 auto 10px; }

/* ============================================================
   Trial + Promo banners on home
   ============================================================ */
.promo-banner, .trial-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: inherit; text-decoration: none;
  transition: transform .12s var(--ease);
}
.promo-banner {
  background:
    linear-gradient(135deg, rgba(160,231,201,.2), rgba(106,166,230,.08)),
    var(--card);
  border: 1px solid rgba(160,231,201,.35);
}
.promo-banner:hover { transform: translateY(-1px); }
.promo-banner-kicker { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; display: block; }
.promo-banner-main { font-weight: 600; font-size: 16px; display: block; margin-top: 2px; }
.promo-banner-sub { color: var(--muted-2); font-size: 12px; display: block; margin-top: 2px; }

.trial-banner {
  background: var(--card); border: 1px solid var(--line);
}
.trial-banner:hover { transform: translateY(-1px); border-color: var(--card-3); }
.trial-banner-main { font-weight: 500; font-size: 14px; display: block; }
.trial-banner-sub { color: var(--accent); font-size: 13px; font-weight: 500; display: block; margin-top: 2px; }

/* ============================================================
   Billing page
   ============================================================ */
.billing-status {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.status-kicker { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.status-h { font-family: 'Fraunces', Georgia, serif; font-size: 24px; font-weight: 600; letter-spacing: -.01em; margin: 0; }

.billing-promo {
  position: relative;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(160,231,201,.22) 0%, rgba(106,166,230,.1) 60%, transparent 100%),
    var(--card);
  border: 1px solid rgba(160,231,201,.35);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; gap: 10px; overflow: hidden;
  box-shadow: var(--shadow-md);
}
.billing-promo::after {
  content: ""; position: absolute; inset: auto -40px -60px auto;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(63,214,168,.25), transparent 70%);
  pointer-events: none; filter: blur(20px);
}
.billing-promo > * { position: relative; z-index: 1; }
.promo-kicker { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.promo-h { font-family: 'Fraunces', Georgia, serif; font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.promo-sub { color: var(--muted-2); margin: 0; font-size: 14px; line-height: 1.5; }

.billing-plans { display: flex; flex-direction: column; gap: 12px; }
.plan-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.plan-head { display: flex; align-items: baseline; justify-content: space-between; }
.plan-tag { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.plan-amount { font-family: 'Fraunces', Georgia, serif; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.plan-unit { font-family: 'Inter', sans-serif; font-size: 13px; color: var(--muted-2); font-weight: 400; }

.billing-manage { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.billing-manage-h { font-family: 'Fraunces', Georgia, serif; font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin: 0; }

/* ============================================================
   Today strip on home (contextual chips)
   ============================================================ */
.today-strip { display: flex; flex-direction: column; gap: 8px; }
.today-chip {
  display: grid; grid-template-columns: 32px 1fr 16px; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--fg); text-decoration: none;
  transition: transform .12s var(--ease), border-color .2s, background .15s;
}
.today-chip:hover { transform: translateY(-1px); border-color: var(--card-3); background: var(--card-2); }
.today-chip-ic { font-size: 20px; display: inline-flex; justify-content: center; }
.today-chip-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.today-chip-title { font-weight: 600; font-size: 14px; }
.today-chip-sub { font-size: 12px; color: var(--muted-2); }
.today-chip--sleep { background: linear-gradient(135deg, rgba(106,166,230,.1), transparent 60%), var(--card); border-color: rgba(106,166,230,.22); }
.today-chip--meal  { background: linear-gradient(135deg, rgba(243,176,69,.12), transparent 60%), var(--card); border-color: rgba(243,176,69,.22); }

/* ============================================================
   Profile form
   ============================================================ */
.profile-lede { padding: 6px 2px; display: flex; flex-direction: column; gap: 8px; }
.privacy-note {
  background: linear-gradient(135deg, rgba(160,231,201,.08), rgba(106,166,230,.04));
  border: 1px solid rgba(160,231,201,.25);
  border-radius: var(--radius-md); padding: 14px 16px;
  color: var(--muted-2); font-size: 13px; line-height: 1.55;
}
.privacy-note strong { color: var(--fg); }

.profile-form { display: flex; flex-direction: column; gap: 22px; }
.p-section { display: flex; flex-direction: column; gap: 12px; }
.p-section-h {
  font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em;
  font-weight: 600; margin: 0;
}
.p-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; color: var(--muted-2); font-size: 14px; }
.field-check input { margin-top: 3px; }

.field select, .field textarea {
  min-height: 48px; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  color: var(--fg); font: inherit; font-size: 15px;
}
.field textarea { min-height: auto; resize: vertical; }
.field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--card-2); }

.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-chip {
  position: relative;
  display: flex; align-items: center; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  color: var(--muted-2); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all .15s var(--ease);
}
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip.is-on, .check-chip:has(input:checked) {
  background: var(--card-2); border-color: var(--accent); color: var(--fg);
}

.profile-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

.danger-card { border-color: rgba(255,122,89,.22); }
.card-h { font-family: 'Fraunces', Georgia, serif; font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 4px; }
.delete-form { display: flex; flex-direction: column; gap: 10px; margin: 0; }

/* ============================================================
   Today page — sleep bars, meals, ticks
   ============================================================ */
.today-block { display: flex; flex-direction: column; gap: 12px; }

.sleep-bars {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px;
}
.sleep-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sleep-bar-bg { width: 100%; height: 80px; background: var(--card-2); border-radius: 6px; position: relative; overflow: hidden; }
.sleep-bar { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 0 0 6px 6px; transition: height .4s var(--ease); }
.sleep-col-l { font-size: 11px; color: var(--muted); font-weight: 500; }
.sleep-col-n { font-variant-numeric: tabular-nums; font-size: 11px; }

.sleep-form, .meal-form { display: flex; flex-direction: column; gap: 12px; }
.sleep-form-row { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; align-items: end; }
.sleep-quality { gap: 4px; }
.sleep-quality .mood-face { padding: 4px; }

.meal-nudge {
  background: linear-gradient(135deg, rgba(243,176,69,.14), transparent);
  border: 1px solid rgba(243,176,69,.3);
  border-radius: var(--radius-md); padding: 12px 14px;
  color: var(--fg); font-size: 14px; line-height: 1.5;
}
.meal-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.meal-btn {
  min-height: 48px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; color: var(--fg); font: inherit; font-weight: 500; font-size: 14px;
  cursor: pointer; transition: all .15s var(--ease);
}
.meal-btn:hover { background: var(--card-2); border-color: var(--accent); transform: translateY(-1px); }
.meals-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.meals-list li { display: flex; gap: 12px; padding: 8px 10px; background: var(--bg-2); border-radius: 8px; font-size: 14px; }

.section-hint--warn { color: var(--yellow-1); font-weight: 600; }

.tick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tick {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; color: var(--muted-2); font-size: 13px; font-weight: 500;
  cursor: pointer; text-align: center;
  transition: all .15s var(--ease);
}
.tick input { position: absolute; opacity: 0; pointer-events: none; }
.tick-ic { font-size: 26px; opacity: .6; transition: opacity .15s; }
.tick.is-on {
  background: var(--card-2); border-color: var(--accent); color: var(--fg);
  transform: translateY(-1px);
}
.tick.is-on .tick-ic { opacity: 1; }
.tick-l { font-weight: 500; }

/* ============================================================
   Advisories on action screen (personalization hints)
   ============================================================ */
.advisory-stack { display: flex; flex-direction: column; gap: 8px; }
.advisory {
  display: flex; gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(243,176,69,.08), rgba(106,166,230,.04));
  border: 1px solid rgba(243,176,69,.28);
  border-radius: var(--radius-md);
  font-size: 13px; line-height: 1.55;
  color: var(--muted-2);
}
.advisory p { margin: 0; }
.advisory-ic { color: var(--yellow-1); font-weight: 700; flex-shrink: 0; }

/* ============================================================
   Dopamine library
   ============================================================ */
.dop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dop-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .12s var(--ease), border-color .2s;
}
.dop-card:hover { transform: translateY(-1px); border-color: var(--card-3); }
.dop-card--less { opacity: .8; }
.dop-card-top { display: flex; align-items: center; justify-content: space-between; }
.dop-ic { font-size: 22px; }
.dop-time {
  font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 600;
  color: var(--muted-2); background: var(--card-2); padding: 4px 8px; border-radius: 999px;
}
.dop-title { font-family: 'Fraunces', Georgia, serif; font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.dop-desc { font-size: 13px; color: var(--muted-2); line-height: 1.5; margin: 0; }
.dop-swap {
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  font-weight: 500;
}
.dop-swap strong { color: var(--red-1); text-transform: none; letter-spacing: normal; font-weight: 600; }
.dop-less { font-size: 11px; color: var(--muted); font-style: italic; }
.dop-do { min-height: 40px; padding: 0 14px; font-size: 13px; margin-top: 4px; }

/* ============================================================
   Responsive tweaks
   ============================================================ */
@media (max-width: 380px) {
  .state-card { min-height: 180px; }
  .state-title { font-size: 20px; }
  .action-row { grid-template-columns: 1fr; }
  .legend { grid-template-columns: 1fr; }
  .about-grid, .tech-grid { grid-template-columns: 1fr; }
  .prompt-library, .prompt-grid { grid-template-columns: 1fr; }
  .j-calendar { grid-template-columns: repeat(6, 1fr); }
  .j-featured-title { font-size: 22px; }
  .reader-h { font-size: 26px; }
  .reader-body { padding: 18px; font-size: 17px; }
  .landing-h { font-size: 32px; }
  .landing-states { grid-template-columns: 1fr; }
  .landing-price-grid, .price-row { grid-template-columns: 1fr; }
  .p-row, .sleep-form-row { grid-template-columns: 1fr; }
  .check-grid, .dop-grid { grid-template-columns: 1fr; }
  .meal-buttons { grid-template-columns: 1fr 1fr; }
  .tick-grid { grid-template-columns: 1fr; }
}

/* Reduce motion respects user pref */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
