:root {
  color-scheme: dark;
  --bg: #0f1115;
  --bg-2: #171a21;
  --card: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.13);
  --text: #f8fafc;
  --muted: rgba(248, 250, 252, 0.68);
  --orange: #f97316;
  --green: #22c55e;
  --cyan: #22d3ee;
  --heart: #fb923c;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}
#app {
  min-height: 100vh;
}

.app-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 12px;
  color: rgba(248, 250, 252, 0.72);
  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 rgba(255, 255, 255, 0.13);
  font-size: 42px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.seo-fallback {
  width: min(920px, calc(100% - 32px));
  margin: 40px auto;
  padding: 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, system-ui, sans-serif;
  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: #fdba74;
}

.seo-fallback p,
.seo-fallback li {
  color: rgba(248, 250, 252, 0.82);
}

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, #11141b 0%, #090b0f 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 rgba(0, 0, 0, 0.28);
}

.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 rgba(0, 0, 0, 0.28);
}

.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: rgba(255, 255, 255, 0.12);
  color: var(--text);
  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: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.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: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.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 rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 13px 14px;
  background: rgba(0, 0, 0, 0.24);
  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: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.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: white;
  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: rgba(255, 255, 255, 0.10);
  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: white;
  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: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.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: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.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: rgba(255, 255, 255, 0.08);
  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: rgba(255, 255, 255, 0.06);
}

.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: rgba(255, 255, 255, 0.09);
}

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

.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;
  }
}
