/* Ordered Steps — visual design
 * Theme: "Dawn" — being led from night into morning light.
 */
:root {
  --night-1: #0d0d22;
  --night-2: #15153a;
  --night-3: #1d1d4d;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --gold: #e9b949;
  --gold-soft: #f3d27e;
  --gold-deep: #c8922a;
  --rose: #e8857a;
  --teal: #6fd6c4;
  --violet: #9a8cff;
  --cream: #f6f1e6;
  --ink: #ece9f7;
  --muted: #a7a4c4;
  --muted-2: #7d7aa0;
  --good: #74d99f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Pin text size — stop Chrome/Android auto "font boosting" from inflating text
 * (looks correct on desktop but renders oversized/zoomed-in on Android otherwise). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 50% -8%, rgba(233, 185, 73, 0.16), transparent 60%),
    radial-gradient(900px 500px at 12% 8%, rgba(154, 140, 255, 0.14), transparent 55%),
    linear-gradient(170deg, var(--night-2) 0%, var(--night-1) 55%, #08081a 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 560px; margin: 0 auto; padding: 0 18px calc(108px + env(safe-area-inset-bottom)); }

/* ---------- Typography & shared ---------- */
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.eyebrow { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.serif { font-family: var(--serif); }
.verse {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.45;
  color: var(--cream);
}
.verse-ref { font-family: var(--sans); font-style: normal; font-size: 12px; letter-spacing: 0.05em; color: var(--gold-soft); font-weight: 600; }
.muted { color: var(--muted); }
.center { text-align: center; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold-deep));
  color: #2a1d04; box-shadow: 0 10px 24px rgba(233, 185, 73, 0.28);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(233, 185, 73, 0.36); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: var(--panel-strong); color: var(--ink); border: 1px solid var(--border-strong);
  box-shadow: none; font-weight: 500;
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); box-shadow: none; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.app-header { padding: 26px 4px 14px; display: flex; align-items: flex-end; justify-content: space-between; }
.app-header .greeting { font-size: 13px; color: var(--muted); }
.app-header h1 { font-family: var(--serif); font-size: 30px; line-height: 1.05; margin-top: 2px; }
.app-header .date { font-size: 12px; color: var(--muted-2); margin-top: 4px; letter-spacing: 0.03em; }

/* ---------- Cards ---------- */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.card + .card { margin-top: 16px; }

/* ---------- Onboarding ---------- */
.onb { min-height: 100vh; display: flex; flex-direction: column; }
.onb-hero { padding: 64px 6px 18px; text-align: center; }
.crest {
  width: 76px; height: 76px; margin: 0 auto 22px; border-radius: 22px;
  display: grid; place-items: center; font-size: 38px;
  background: linear-gradient(150deg, rgba(243, 210, 126, 0.22), rgba(154, 140, 255, 0.14));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
}
.onb-hero h1 { font-family: var(--serif); font-size: 44px; line-height: 1; }
.onb-hero .sub { color: var(--muted); margin-top: 14px; font-size: 16px; line-height: 1.5; }
.anchor-verse { margin: 26px auto 0; max-width: 420px; }
.philosophy-grid { display: grid; gap: 12px; margin-top: 8px; }
.phil-row { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); }
.phil-row .src { font-weight: 700; color: var(--gold-soft); font-size: 13px; min-width: 88px; }
.phil-row .line { font-size: 13.5px; color: var(--muted); line-height: 1.45; }

.field-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.text-input {
  width: 100%; padding: 14px 16px; border-radius: var(--r-md); font-size: 16px;
  background: var(--panel-strong); border: 1px solid var(--border-strong); color: var(--ink);
}
.text-input:focus { outline: none; border-color: var(--gold); }

.progress-dots { display: flex; gap: 7px; justify-content: center; margin: 4px 0 20px; }
.progress-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); transition: all .3s; }
.progress-dots span.on { background: var(--gold); width: 22px; border-radius: 999px; }

/* assessment slider rows */
.assess-row { padding: 16px 0; border-bottom: 1px solid var(--border); }
.assess-row:last-child { border-bottom: none; }
.assess-top { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.assess-top .icon { font-size: 22px; }
.assess-top .name { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.assess-q { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.slider-wrap { display: flex; align-items: center; gap: 12px; }
.slider-wrap .end { font-size: 11px; color: var(--muted-2); width: 64px; }
.slider-wrap .end.hi { text-align: right; }
input[type=range] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft)); outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 3px solid var(--gold); box-shadow: 0 3px 10px rgba(0,0,0,.4); cursor: pointer;
}
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); cursor: pointer; }
.score-badge { min-width: 30px; text-align: center; font-weight: 700; font-size: 16px; color: var(--gold-soft); }

/* situation chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--panel-strong); border: 1px solid var(--border-strong); color: var(--muted); transition: all .15s;
}
.chip.on { background: linear-gradient(135deg, rgba(243,210,126,.9), rgba(200,146,42,.9)); color: #2a1d04; border-color: transparent; font-weight: 600; }

/* ---------- Today / Steps ---------- */
.daily-verse { text-align: center; padding: 22px 18px; }
.daily-verse .verse { font-size: 20px; }
.daily-verse .verse-ref { display: block; margin-top: 10px; }

.steps-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 12px; }
.steps-head h2 { font-family: var(--serif); font-size: 24px; }
.steps-head .count { font-size: 13px; color: var(--muted); }

.step {
  position: relative; display: flex; gap: 14px; padding: 18px; align-items: flex-start;
  border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--panel);
  box-shadow: var(--shadow); transition: border-color .2s, background .2s, opacity .3s;
  overflow: hidden;
}
.step + .step { margin-top: 14px; }
.step::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, var(--gold)); opacity: .8; }
.step.done { opacity: 0.62; }
.step.done .step-title { text-decoration: line-through; text-decoration-color: var(--muted-2); }

.checkbox {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; margin-top: 2px;
  border: 2px solid var(--border-strong); display: grid; place-items: center;
  transition: all .2s; background: transparent;
}
.checkbox.on { background: linear-gradient(135deg, var(--good), #3fae74); border-color: transparent; }
.checkbox svg { width: 15px; height: 15px; opacity: 0; transform: scale(.4); transition: all .2s; }
.checkbox.on svg { opacity: 1; transform: scale(1); }

.step-body { flex: 1; min-width: 0; }
.step-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.tag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.tag.domain { background: var(--accent-soft, rgba(233,185,73,.16)); color: var(--accent, var(--gold-soft)); }
.tag.src { background: rgba(255,255,255,.06); color: var(--muted); }
.tag.mins { background: transparent; color: var(--muted-2); padding-left: 0; }
.step-title { font-size: 17px; font-weight: 600; line-height: 1.25; }
.step-action { font-size: 14px; color: var(--muted); line-height: 1.5; margin-top: 5px; }
.step-expand { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; display: none; }
.step.open .step-expand { display: block; animation: fade .3s ease; }
.step-why { font-size: 13px; color: var(--ink); line-height: 1.5; }
.step-why b { color: var(--gold-soft); font-weight: 600; }
.step-verse { margin-top: 11px; }
.step-verse .verse { font-size: 15px; }
.step-toggle { margin-top: 11px; font-size: 12px; color: var(--gold-soft); font-weight: 600; letter-spacing: .03em; }

.day-complete { text-align: center; padding: 28px 20px; margin-top: 18px; border: 1px solid var(--border-strong);
  background: linear-gradient(150deg, rgba(116,217,159,.12), rgba(233,185,73,.08)); border-radius: var(--r-lg); }
.day-complete .big { font-size: 40px; }
.day-complete h3 { font-family: var(--serif); font-size: 26px; margin: 8px 0 6px; }

/* ---------- Streak / momentum bar ---------- */
.momentum { display: flex; gap: 10px; margin-top: 16px; }
.momentum .stat { flex: 1; text-align: center; padding: 16px 8px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--border); }
.momentum .stat .num { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--gold-soft); line-height: 1; }
.momentum .stat .lbl { font-size: 11px; color: var(--muted); margin-top: 6px; letter-spacing: .04em; }
.flame { font-size: 26px; }

/* ---------- Path / Life wheel ---------- */
.wheel-wrap { display: grid; place-items: center; padding: 8px 0 4px; }
.wheel-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 14px; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend-row .dot { width: 9px; height: 9px; border-radius: 50%; }
.legend-row .lname { flex: 1; color: var(--ink); }
.legend-row .lscore { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-row .bar { height: 5px; border-radius: 999px; background: var(--border); flex: 0 0 64px; overflow: hidden; }
.legend-row .bar > i { display: block; height: 100%; border-radius: 999px; }

.history-list { margin-top: 6px; }
.history-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.history-row:last-child { border-bottom: none; }
.history-row .hdate { font-size: 13px; color: var(--muted); width: 92px; }
.history-row .pips { display: flex; gap: 5px; }
.history-row .pip { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.history-row .pip.on { background: var(--good); }

/* ---------- Reflect ---------- */
.reflect-area {
  width: 100%; min-height: 150px; resize: vertical; padding: 16px; font-size: 15px; line-height: 1.55;
  border-radius: var(--r-md); background: var(--panel-strong); border: 1px solid var(--border-strong);
  color: var(--ink); font-family: var(--sans);
}
.reflect-area:focus { outline: none; border-color: var(--gold); }
.prompt-pill { display: inline-block; font-size: 13px; color: var(--muted); background: var(--panel); border: 1px solid var(--border);
  padding: 8px 13px; border-radius: 999px; margin: 0 6px 8px 0; }

/* ---------- Library ---------- */
.dom-accordion .dom-head { display: flex; align-items: center; gap: 12px; padding: 16px 4px; cursor: pointer; border-bottom: 1px solid var(--border); }
.dom-accordion .dom-head .icon { font-size: 24px; }
.dom-accordion .dom-head .name { font-family: var(--serif); font-size: 21px; flex: 1; }
.dom-accordion .dom-head .chev { color: var(--muted); transition: transform .2s; }
.dom-accordion .dom-head.open .chev { transform: rotate(90deg); }
.dom-detail { display: none; padding: 6px 4px 18px; }
.dom-detail.open { display: block; animation: fade .3s; }
.dom-detail .design { font-size: 14px; color: var(--ink); line-height: 1.55; margin-bottom: 12px; }
.insight-row { display: flex; gap: 10px; padding: 8px 0; font-size: 13px; }
.insight-row .who { color: var(--gold-soft); font-weight: 600; min-width: 78px; }
.insight-row .what { color: var(--muted); line-height: 1.45; }

/* ---------- Bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; gap: 4px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(8,8,20,.96), rgba(8,8,20,.78)); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.nav-btn { flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border-radius: 14px; color: var(--muted-2); transition: color .15s; }
.nav-btn .ic { font-size: 20px; }
.nav-btn .lb { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; }
.nav-btn.on { color: var(--gold-soft); }
.nav-btn.on .ic { filter: drop-shadow(0 0 10px rgba(233,185,73,.5)); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px);
  background: rgba(20,20,46,.96); border: 1px solid var(--border-strong); color: var(--ink);
  padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 60; max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Utility ---------- */
.section-title { font-family: var(--serif); font-size: 22px; margin: 24px 4px 12px; }
.spacer { height: 18px; }
.fade-up { animation: fadeUp .5s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.pop { animation: pop .4s ease; }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch .track::before { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + .track { background: linear-gradient(135deg, var(--gold-soft), var(--gold-deep)); }
.switch input:checked + .track::before { transform: translateX(20px); }

@media (min-width: 600px) {
  .onb-hero h1 { font-size: 52px; }
}
