:root {
  color-scheme: dark light;
  --bg: #0f1115;
  --bg-2: #171a21;
  --bg-top: #11141b;
  --bg-bottom: #090b0f;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.11);
  --card-solid: #171a21;
  --card-border: rgba(255, 255, 255, 0.13);
  --text: #f8fafc;
  --muted: rgba(248, 250, 252, 0.68);
  --muted-strong: rgba(248, 250, 252, 0.84);
  --orange: #f97316;
  --orange-soft: rgba(249, 115, 22, 0.28);
  --green: #22c55e;
  --cyan: #22d3ee;
  --heart: #fb923c;
  --danger: #ef4444;
  --footer-link: #fdba74;
  --shadow: rgba(0, 0, 0, 0.28);
  --input-bg: rgba(255, 255, 255, 0.1);
  --input-border: rgba(255, 255, 255, 0.16);
}


html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #fff7ed;
  --bg-2: #ffffff;
  --bg-top: #fff7ed;
  --bg-bottom: #f8fafc;
  --card: rgba(255, 255, 255, 0.88);
  --card-strong: rgba(255, 255, 255, 0.96);
  --card-solid: #ffffff;
  --card-border: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.74);
  --muted-strong: rgba(15, 23, 42, 0.86);
  --orange: #c2410c;
  --orange-soft: rgba(234, 88, 12, 0.18);
  --green: #16a34a;
  --cyan: #0891b2;
  --heart: #f97316;
  --danger: #dc2626;
  --footer-link: #c2410c;
  --shadow: rgba(15, 23, 42, 0.12);
  --input-bg: rgba(255, 255, 255, 0.92);
  --input-border: rgba(15, 23, 42, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.28), transparent 28rem),
    radial-gradient(circle at bottom left, rgba(34, 197, 94, 0.16), transparent 24rem),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, system-ui, sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
}

.app-shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 9vw, 64px);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

h2 {
  margin: 6px 0 18px;
  font-size: clamp(38px, 11vw, 76px);
  letter-spacing: -0.06em;
  line-height: 0.9;
}

h3 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

p {
  line-height: 1.45;
}

.phoenix {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.24), rgba(255, 255, 255, 0.08));
  border: 1px solid var(--card-border);
  font-size: 42px;
  box-shadow: 0 18px 50px var(--shadow);
}

.card {
  margin: 14px 0;
  padding: 20px;
  border: 1px solid var(--card-border);
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: 0 24px 70px var(--shadow);
}

.main-card {
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(34, 197, 94, 0.08)),
    var(--card);
}

.label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 24px;
}

.segmented button {
  border: 0;
  border-radius: 18px;
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-weight: 700;
}

.segmented button:hover {
  background: rgba(249, 115, 22, 0.24);
}

.card button {
  border: 0;
  border-radius: 18px;
  padding: 13px 16px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--input-border);
  font-weight: 800;
}

.card button.danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.rings {
  width: 220px;
  height: 220px;
  display: block;
  margin: 14px auto;
  overflow: visible;
  transform: rotate(-90deg);
}

.track,
.fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}

.track.brain {
  stroke: rgba(34, 197, 94, 0.18);
}

.track.heart {
  stroke: rgba(251, 146, 60, 0.18);
}

.track.lungs {
  stroke: rgba(34, 211, 238, 0.18);
}

.fill.brain {
  stroke: var(--green);
}

.fill.heart {
  stroke: var(--heart);
}

.fill.lungs {
  stroke: var(--cyan);
}

.ring-label {
  transform: rotate(90deg);
  transform-origin: 60px 60px;
  fill: white;
  font-size: 18px;
  font-weight: 900;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
}

.legend span:nth-child(2)::before {
  background: var(--heart);
}

.legend span:nth-child(3)::before {
  background: var(--cyan);
}

@media (max-width: 520px) {
  .app-shell {
    padding: 18px;
  }

  .hero {
    align-items: flex-start;
  }

  .phoenix {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    font-size: 34px;
  }

  .card {
    border-radius: 24px;
    padding: 18px;
  }

  .rings {
    width: 190px;
    height: 190px;
  }
}
.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.milestone-grid,
.install-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.install-grid {
  grid-template-columns: 1fr;
}

.mini-card {
  padding: 14px;
  border-radius: 20px;
  background: var(--card-strong);
  border: 1px solid var(--card-border);
}

.mini-card strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 18px;
}

.mini-card span,
.health-row span,
.health-row small,
.install-grid p {
  color: var(--muted);
  font-size: 13px;
}

.health-detail-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.health-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: var(--card-strong);
  border: 1px solid var(--card-border);
}

.health-row strong,
.health-row span,
.health-row small {
  display: block;
}

.progress-column {
  text-align: right;
}

.progress-column em {
  display: block;
  font-style: normal;
  font-weight: 900;
  margin-bottom: 5px;
}

.bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--green));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.form-grid label {
  display: grid;
  gap: 7px;
}

.form-grid label span,
.switch-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input[type="date"],
input[type="number"],
input[type="text"] {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 16px;
  padding: 13px 14px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  outline: none;
}

input:focus {
  border-color: rgba(249, 115, 22, 0.8);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 14px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.26);
  font-weight: 800;
  font-size: 13px;
}

.toggle-list {
  display: grid;
  gap: 10px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-radius: 18px;
  background: var(--card-strong);
  border: 1px solid var(--card-border);
}

.switch-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--orange);
}

.segmented button.selected {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.8), rgba(34, 197, 94, 0.45));
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(249, 115, 22, 0.2);
}

@media (max-width: 560px) {
  .form-grid,
  .milestone-grid {
    grid-template-columns: 1fr;
  }

  .health-row {
    grid-template-columns: 1fr;
  }

  .progress-column {
    text-align: left;
  }
}

.full-width-label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.full-width-label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

select {
  width: 100%;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  outline: none;
}

select:focus {
  border-color: rgba(249, 115, 22, 0.65);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.craving-card {
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 12%, rgba(34, 197, 94, 0.20), transparent 12rem),
    radial-gradient(circle at 8% 95%, rgba(249, 115, 22, 0.20), transparent 14rem),
    var(--card);
}

.craving-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.breathing-orb {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle, rgba(34, 197, 94, 0.38), rgba(249, 115, 22, 0.10));
  box-shadow: 0 22px 60px rgba(34, 197, 94, 0.14);
}

.breathing-orb.active {
  animation: breathe 14s ease-in-out infinite;
}

.breathing-orb span {
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

@keyframes breathe {
  0% { transform: scale(0.78); }
  28% { transform: scale(1.08); }
  57% { transform: scale(1.08); }
  100% { transform: scale(0.78); }
}

.breathing-stage {
  display: grid;
  gap: 8px;
  margin: 18px 0 4px;
  padding: 14px;
  border-radius: 20px;
  background: var(--card-strong);
  border: 1px solid var(--card-border);
}

.breathing-stage strong {
  font-size: 22px;
}

.breathing-stage span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.breathing-progress i {
  background: linear-gradient(90deg, var(--green), var(--orange));
}

.card button.success {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.craving-log {
  margin-top: 16px;
}

.craving-log h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.session-list {
  display: grid;
  gap: 8px;
}

.session-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--card-strong);
  border: 1px solid var(--card-border);
}

.session-pill span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 560px) {
  .craving-header {
    grid-template-columns: 1fr;
  }

  .breathing-orb {
    width: 96px;
    height: 96px;
    justify-self: center;
  }
}

/* Craving Mode v2 */
.motivation-card textarea,
.why-textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--text);
  background: var(--card-strong);
  outline: none;
  font: inherit;
  line-height: 1.45;
}

.why-textarea:focus {
  border-color: rgba(249, 115, 22, 0.75);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}

.why-reminder {
  display: grid;
  gap: 6px;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid rgba(249, 115, 22, 0.26);
  border-radius: 20px;
  background: rgba(249, 115, 22, 0.10);
}

.why-reminder span {
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.why-reminder strong {
  font-size: 15px;
  line-height: 1.35;
}

.intensity-box {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border-radius: 22px;
  background: var(--card-strong);
}

.intensity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.intensity-picker {
  display: grid;
  gap: 8px;
}

.intensity-picker > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

.intensity-buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.intensity-buttons button {
  min-width: 0;
  padding: 9px 0;
  border-radius: 12px;
  background: var(--input-bg);
}

.intensity-buttons button.selected {
  background: var(--orange);
  color: #111827;
}

.intensity-buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.craving-stats {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.20);
}

.craving-stats span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 560px) {
  .intensity-grid {
    grid-template-columns: 1fr;
  }
}


#app {
  min-height: 100vh;
}

.app-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
}

.app-loading-logo {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.24), rgba(255, 255, 255, 0.08));
  border: 1px solid var(--card-border);
  font-size: 42px;
  box-shadow: 0 18px 50px var(--shadow);
}

.site-footer {
  width: min(720px, 100%);
  margin: 28px auto 0;
  padding: 24px 24px 36px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.site-footer p {
  margin: 0 0 10px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 16px;
}

.site-footer a,
.site-footer button {
  color: var(--footer-link);
  text-decoration: none;
  font-weight: 800;
}

.site-footer a:hover,
.site-footer button:hover {
  text-decoration: underline;
}

.footer-theme-modes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.12);
}

.footer-theme-modes button {
  padding: 6px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--footer-link);
  font-size: 12px;
  line-height: 1;
}

.footer-theme-modes button.selected {
  background: var(--orange);
  color: #ffffff;
  text-decoration: none;
}

.footer-theme-modes button:hover {
  text-decoration: none;
}

.privacy-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: var(--card-solid);
  box-shadow: 0 24px 70px var(--shadow);
}

.privacy-banner[hidden] {
  display: none;
}

.privacy-banner strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.privacy-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.privacy-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.privacy-banner button {
  border: 0;
  border-radius: 999px;
  padding: 11px 14px;
  background: linear-gradient(135deg, var(--orange), var(--green));
  color: #111827;
  font-weight: 900;
}

.privacy-banner button.secondary {
  background: rgba(127, 127, 127, 0.16);
  color: var(--text);
}

.seo-fallback {
  width: min(920px, calc(100% - 32px));
  margin: 40px auto;
  padding: 28px;
  border-radius: 28px;
  background: var(--card);
  color: var(--text);
  line-height: 1.5;
}

.seo-fallback h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.seo-fallback h2 {
  margin: 28px 0 10px;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.seo-fallback a {
  color: var(--footer-link);
}

.seo-fallback p,
.seo-fallback li {
  color: var(--muted);
}

@media (max-width: 640px) {
  .privacy-banner {
    grid-template-columns: 1fr;
  }

  .privacy-banner-actions {
    justify-content: stretch;
  }

  .privacy-banner button {
    flex: 1 1 160px;
  }
}


input,
select,
textarea {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--input-border);
}

/* Next phase: onboarding + local backup/restore */
.onboarding-card h2 {
  margin-top: 8px;
  margin-bottom: 12px;
}

.onboarding-steps {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}

.onboarding-step {
  padding: 16px;
  border: 1px solid var(--card-border);
  border-radius: 22px;
  background: var(--card-strong);
}

.onboarding-step > strong {
  display: block;
  margin-bottom: 12px;
}

.goal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.goal-grid button {
  min-height: 54px;
}

.goal-grid button.selected {
  background: var(--orange);
  color: #ffffff;
  border-color: transparent;
}

.backup-card strong {
  display: block;
  margin-bottom: 4px;
}

.backup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}

.backup-textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  border-radius: 18px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--input-border);
}

.status-message {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(34, 197, 94, 0.14);
  color: var(--muted-strong);
}

@media (max-width: 720px) {
  .goal-grid,
  .backup-grid {
    grid-template-columns: 1fr;
  }
}

/* Phase 3: interactive recovery timeline and craving insights */
.weekly-summary-card,
.health-timeline-card,
.craving-insights-card {
  position: relative;
  overflow: hidden;
}

.weekly-summary-card::before,
.health-timeline-card::before,
.craving-insights-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right, var(--orange-soft), transparent 22rem);
  opacity: 0.7;
}

.weekly-summary-card > *,
.health-timeline-card > *,
.craving-insights-card > * {
  position: relative;
  z-index: 1;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.insight-tile {
  min-height: 92px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: var(--card-strong);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.insight-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-tile strong {
  color: var(--text);
  font-size: clamp(18px, 4vw, 26px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.timeline-list {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 13px;
  width: 2px;
  background: linear-gradient(180deg, var(--green), rgba(127, 127, 127, 0.18));
  opacity: 0.5;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
}

.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid var(--card-border);
  background: var(--bg-2);
  box-shadow: 0 0 0 6px var(--card);
  z-index: 1;
}

.timeline-item.unlocked .timeline-dot {
  border-color: transparent;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.16), 0 0 24px rgba(34, 197, 94, 0.32);
}

.timeline-content {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: var(--card-strong);
}

.timeline-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.timeline-heading strong {
  color: var(--text);
  font-size: 16px;
}

.timeline-heading span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.14);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.timeline-item.unlocked .timeline-heading span {
  background: rgba(34, 197, 94, 0.16);
  color: var(--green);
}

.timeline-content p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.timeline-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.timeline-progress-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 680px) {
  .insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .timeline-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Phase: relapse-safe progress history */
.history-card .history-grid {
  margin-top: 16px;
}

.relapse-list-wrap {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--card-border);
  border-radius: 22px;
  background: rgba(127, 127, 127, 0.08);
}

.relapse-list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.relapse-list {
  display: grid;
  gap: 10px;
}

.relapse-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 18px;
  background: var(--card-strong);
  border: 1px solid var(--card-border);
}

.relapse-item > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.relapse-item strong {
  color: var(--text);
}

.relapse-item span,
.relapse-item p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}

.setback-card textarea {
  width: 100%;
  resize: vertical;
}


html[data-theme="light"] .card button.success {
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
}

html[data-theme="light"] .card button.danger {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}

html[data-theme="light"] .status-pill,
html[data-theme="light"] .craving-stats,
html[data-theme="light"] .status-message {
  color: #14532d;
}

html[data-theme="light"] .ring-label {
  fill: #0f172a;
}

html[data-theme="light"] .breathing-orb span {
  color: #ffffff;
}

html[data-theme="light"] .timeline-dot {
  background: #ffffff;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: rgba(15, 23, 42, 0.48);
}

/* iOS notification guidance + day-mode contrast fixes */
.notification-card .notification-help {
  display: grid;
  gap: 6px;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: var(--card-strong);
  color: var(--muted-strong);
}

.notification-card .notification-help strong {
  color: var(--text);
  font-weight: 900;
}

.notification-card .notification-help span {
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.45;
}

.notification-card .notification-help.warning,
.status-pill.warning {
  border-color: rgba(249, 115, 22, 0.42);
  background: rgba(249, 115, 22, 0.12);
}

button:disabled,
.card button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: grayscale(0.25);
}

.notification-status {
  margin-top: 12px;
}

html[data-theme="light"] .notification-card .notification-help,
html[data-theme="light"] .relapse-list-wrap,
html[data-theme="light"] .mini-card,
html[data-theme="light"] .insight-card,
html[data-theme="light"] .timeline-item,
html[data-theme="light"] .session-pill,
html[data-theme="light"] .backup-textarea {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .notification-card .notification-help.warning,
html[data-theme="light"] .status-pill.warning {
  background: rgba(234, 88, 12, 0.12);
  border-color: rgba(234, 88, 12, 0.34);
  color: #7c2d12;
}

html[data-theme="light"] .notification-card .notification-help strong,
html[data-theme="light"] .mini-card strong,
html[data-theme="light"] .insight-card strong,
html[data-theme="light"] .timeline-item strong,
html[data-theme="light"] .relapse-item strong,
html[data-theme="light"] .session-pill strong,
html[data-theme="light"] label span,
html[data-theme="light"] .switch-row span,
html[data-theme="light"] .full-width-label span,
html[data-theme="light"] .form-grid label span {
  color: #0f172a;
}

html[data-theme="light"] .notification-card .notification-help span,
html[data-theme="light"] .mini-card span,
html[data-theme="light"] .insight-card span,
html[data-theme="light"] .timeline-item span,
html[data-theme="light"] .relapse-item span,
html[data-theme="light"] .relapse-item p,
html[data-theme="light"] .session-pill span,
html[data-theme="light"] .muted,
html[data-theme="light"] .small,
html[data-theme="light"] .label {
  color: rgba(15, 23, 42, 0.76);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.18);
}
