:root {
  --bg: #0c0b0a;
  --bg-2: #161311;
  --bg-3: #1e1a17;
  --line: rgba(243, 234, 223, 0.1);
  --ink: #f3eadf;
  --ink-dim: rgba(243, 234, 223, 0.62);
  --ink-faint: rgba(243, 234, 223, 0.38);
  --copper: #c45c32;
  --copper-2: #e07a4a;
  --copper-soft: rgba(196, 92, 50, 0.16);
  --good: #c9d4a8;
  --bad: #d17a6c;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --font-serif: "Fraunces", Georgia, serif;
  --font-sans: "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { max-width: 100%; }

.app {
  min-height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
}

.screen { display: none; min-height: 100dvh; padding: 28px 22px 40px; animation: rise 0.45s ease; }
.screen.active { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper-2);
  font-weight: 500;
}
h1, h2, .serif { font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.03em; }
h1 { font-size: 48px; line-height: 0.95; margin: 14px 0 12px; }
h2 { font-size: 30px; line-height: 1.05; margin: 8px 0 10px; }
.lede { color: var(--ink-dim); font-size: 16px; line-height: 1.5; }

.mark {
  width: 42px; height: 42px; border-radius: 14px;
  border: 1px solid var(--copper);
  display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 22px; color: var(--ink);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 54px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-weight: 560; letter-spacing: 0.01em;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn.ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
}
.btn.copper { background: var(--copper); color: #fff; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn-row { display: grid; gap: 10px; margin-top: 28px; }

.field { margin-top: 18px; }
.field label { display: block; font-size: 12px; color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px; outline: none;
}
.field textarea { min-height: 96px; resize: vertical; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.choice {
  text-align: left; padding: 14px 14px 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px;
}
.choice .emoji { font-size: 20px; display: block; margin-bottom: 8px; }
.choice .name { font-size: 14px; font-weight: 560; }
.choice.selected { border-color: var(--copper); background: var(--copper-soft); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); display: grid; place-items: center;
  color: var(--ink-dim);
}

.hero-card {
  background:
    radial-gradient(1200px 280px at 80% -40%, rgba(196,92,50,0.22), transparent 55%),
    var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px 22px 22px;
  box-shadow: var(--shadow);
}
.streak-num {
  font-family: var(--font-serif);
  font-size: 92px; line-height: 0.8; letter-spacing: -0.05em;
  margin: 8px 0 6px;
}
.streak-label { color: var(--ink-dim); font-size: 14px; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.action {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 14px; text-align: left; min-height: 92px;
}
.action strong { display: block; font-size: 15px; margin-bottom: 4px; }
.action span { color: var(--ink-faint); font-size: 12px; line-height: 1.35; }
.action.good { border-color: rgba(201,212,168,0.35); }
.action.urge { border-color: rgba(196,92,50,0.45); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stat {
  background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 12px 8px; text-align: center;
}
.stat b { display: block; font-family: var(--font-serif); font-size: 22px; font-weight: 500; }
.stat small { color: var(--ink-faint); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }

.cal { margin-top: 26px; }
.cal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 10px; color: var(--ink-faint); letter-spacing: 0.08em; }
.day {
  aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center;
  font-size: 11px; color: var(--ink-faint); background: transparent;
}
.day.held { background: var(--good); color: #1a1a12; }
.day.slipped { background: var(--bad); color: #2a1210; }
.day.today { outline: 1px solid var(--ink); }
.day.empty { visibility: hidden; }

.list { display: grid; gap: 8px; margin-top: 14px; }
.row {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 13px 14px; display: flex; justify-content: space-between; gap: 12px;
}
.row p { color: var(--ink-dim); font-size: 13px; line-height: 1.4; margin-top: 3px; }
.pill {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px; height: fit-content; white-space: nowrap;
}
.pill.held { background: rgba(201,212,168,0.15); color: var(--good); }
.pill.slipped { background: rgba(209,122,108,0.15); color: var(--bad); }
.pill.urge { background: var(--copper-soft); color: var(--copper-2); }

.overlay {
  position: fixed; inset: 0; background: rgba(8,7,6,0.72);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 20; padding: 16px;
}
.overlay.open { display: flex; }
.sheet {
  width: min(430px, 100%); background: #171411; border: 1px solid var(--line);
  border-radius: 28px 28px 22px 22px; padding: 22px 20px 20px;
  animation: rise 0.3s ease;
}

.timer-wrap { text-align: center; padding: 12px 0 8px; }
.timer {
  font-family: var(--font-serif); font-size: 80px; letter-spacing: -0.04em; line-height: 1;
}
.timer-bar { height: 4px; background: var(--bg-3); border-radius: 99px; overflow: hidden; margin: 16px 0 8px; }
.timer-bar > i { display: block; height: 100%; width: 0; background: var(--copper); }

.pay-card {
  background: linear-gradient(180deg, #241812, #15110f);
  border: 1px solid rgba(196,92,50,0.35);
  border-radius: 26px; padding: 24px 20px;
}
.price { font-family: var(--font-serif); font-size: 42px; margin: 8px 0 4px; }
.price small { font-size: 16px; color: var(--ink-dim); }
.checks { margin: 16px 0 8px; display: grid; gap: 8px; color: var(--ink-dim); font-size: 14px; }
.checks li { list-style: none; padding-left: 18px; position: relative; }
.checks li:before { content: "–"; position: absolute; left: 0; color: var(--copper-2); }

.note { font-size: 12px; color: var(--ink-faint); line-height: 1.45; margin-top: 10px; }
.link { color: var(--copper-2); text-decoration: underline; text-underline-offset: 3px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: 0.25s ease; z-index: 30;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.landing-art {
  height: 210px; border-radius: 28px; margin: 28px 0 24px;
  background:
    radial-gradient(circle at 70% 20%, rgba(224,122,74,0.28), transparent 42%),
    radial-gradient(circle at 20% 80%, rgba(201,212,168,0.12), transparent 40%),
    #14110f;
  border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.landing-art .big {
  font-family: var(--font-serif); font-size: 140px; color: rgba(243,234,223,0.08);
  position: absolute; right: -12px; bottom: -38px;
}

.settings-list { display: grid; gap: 8px; margin-top: 18px; }
.settings-list button, .settings-list .rowish {
  width: 100%; text-align: left; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center;
}
.danger { color: var(--bad) !important; }

.nudge {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 18px;
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.45;
}
.nudge button {
  margin-top: 10px;
  width: 100%;
  height: 40px;
  border-radius: 999px;
  background: var(--copper);
  color: #fff;
  font-weight: 560;
}
.nudge[hidden] { display: none !important; }

@media (min-width: 760px) {
  body { background: #070706; }
  .app {
    margin: 32px auto; border: 1px solid var(--line); border-radius: 36px;
    min-height: calc(100dvh - 64px); overflow: hidden; background: var(--bg);
  }
}
