/* Yonacare Scalp Massage — the store's palette: Yonacare green, cream, gold accent; Cormorant headings, Montserrat text. */
:root {
  --white: #ffffff;
  --ink: #1b1d1a;
  --ink-soft: #5b625c;
  --green: #2d5a3d;
  --green-deep: #1f4029;
  --cream: #f5ede0;
  --gold: #c4a35a;
  --line: #e5e0d6;

  --f-head: "Cormorant", Georgia, "Times New Roman", serif;
  --f-body: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font: 400 15px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body.staged, body.gated { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
img { max-width: 100%; }
svg { vertical-align: middle; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 12px;
  font: 600 15px/1.2 var(--f-body); text-align: center;
  background: var(--green); color: var(--white);
  transition: transform .15s ease, filter .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-wide { width: 100%; }
.btn-outline { background: transparent; color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.today .btn, .stage-green .btn { background: var(--cream); color: var(--green-deep); }
.link-btn {
  appearance: none; border: 0; background: none; padding: 10px 0 0; cursor: pointer;
  font: 600 14px/1.3 var(--f-body); color: var(--green); text-decoration: underline; text-underline-offset: 3px;
}
.today .link-btn { color: var(--cream); }

/* ---------- Home ---------- */
.home {
  max-width: 560px; margin: 0 auto;
  padding-left: var(--gutter-l); padding-right: var(--gutter-r); padding-block: 4px 32px;
  display: flex; flex-direction: column; gap: 16px;
}
.home-head { display: flex; flex-direction: column; align-items: flex-start; }
.logo { display: block; width: 150px; height: auto; margin: -14px 0 -18px -16px; }
.kicker { margin: 0; font: 600 11px/1 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.greet { margin: 6px 0 0; font: 700 36px/1.05 var(--f-head); letter-spacing: -0.01em; text-wrap: balance; }

.today { background: var(--green); color: var(--white); border-radius: 20px; padding: 22px 20px; }
.today h2 { margin: 0 0 6px; font: 700 28px/1.1 var(--f-head); }
.today p { margin: 0 0 18px; color: rgba(255,255,255,.85); font-size: 14px; }
.today-todo { display: flex; flex-direction: column; align-items: stretch; }
.today-todo .link-btn { align-self: center; }
.today-done { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
.today-done p { margin: 0; }
.today-done .link-btn { grid-column: 1 / -1; justify-self: start; padding-top: 14px; }
.done-badge {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 48px; height: 48px; border-radius: 50%; background: var(--gold); color: var(--green-deep);
}
.done-badge svg { width: 26px; height: 26px; }

.card { background: var(--cream); border-radius: 20px; padding: 20px; }
.card-title { margin: 0 0 6px; font: 700 26px/1.1 var(--f-head); color: var(--green-deep); }
.card-sub { margin: 0 0 16px; font-size: 14px; color: var(--ink-soft); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; text-align: center; }
.stat { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.stat-icon { color: var(--gold); line-height: 0; height: 22px; }
.stat-icon svg { width: 22px; height: 22px; }
.stat-num { font: 700 36px/1 var(--f-head); color: var(--green-deep); }
.stat-lbl { font-size: 12px; color: var(--ink-soft); }
.stat:not(.stat-streak) { justify-content: flex-end; }
.stats .link-btn { grid-column: 1 / -1; justify-self: center; }

.week { grid-column: 1 / -1; list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week li { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-soft); font-weight: 600; }
.week .dot {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--white);
}
.week .dot svg { width: 18px; height: 18px; }
.week li.on .dot { background: var(--green); box-shadow: none; }
.week li.is-today { color: var(--green-deep); }
.week li.is-today .dot { box-shadow: inset 0 0 0 2px var(--gold); }
.week li.is-today.on .dot { box-shadow: 0 0 0 2px var(--gold); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 16px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot {
  position: relative; z-index: 1; margin-top: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--white); box-shadow: inset 0 0 0 2px var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--white);
}
.timeline .tl-dot svg { width: 13px; height: 13px; }
.timeline li.reached .tl-dot { background: var(--green); box-shadow: none; }
.timeline li.reached::before { background: var(--green); }
.timeline li.now .tl-dot { background: var(--gold); box-shadow: none; }
.timeline b { display: block; font: 700 20px/1.15 var(--f-head); color: var(--green-deep); }
.timeline span { font-size: 14px; color: var(--ink-soft); }
.timeline li.now span { color: var(--ink); }

.learn-img { aspect-ratio: 16 / 10; max-width: 100%; border-radius: 14px; margin-bottom: 16px; overflow: hidden; background: var(--white); }
.learn-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.learn .btn { width: 100%; }

.home-foot { text-align: center; padding: 8px 0 env(safe-area-inset-bottom, 0); font-size: 13px; color: var(--ink-soft); }
.aud-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.seg.seg-sm button { min-height: 36px; padding: 0 16px; font-size: 13px; flex: 0 0 auto; }
.home-foot a { color: var(--green); font-weight: 600; }
.acct { margin: 10px 0 0; overflow-wrap: anywhere; }
.acct-out { border: 0; background: none; padding: 0; color: var(--green); text-decoration: underline; cursor: pointer; font-size: 13px; }

/* ---------- Picture placeholder (until the real step photos exist) ---------- */
.ph {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--cream); color: var(--green); text-align: center; padding: 12px;
}
.ph b { font: 700 40px/1 var(--f-head); }
.ph span { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.stage-green .ph { background: rgba(255,255,255,.1); color: var(--cream); }

/* ---------- Full-screen stages ---------- */
.stage {
  position: fixed; inset: 0; z-index: 20; overflow: hidden;
  display: flex; flex-direction: column;
}
.stage-green { background: var(--green); color: var(--white); }
.stage-light { background: var(--white); color: var(--ink); }
.stage-inner {
  flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 560px; margin: 0 auto;
  padding: env(safe-area-inset-top, 0) var(--gutter-r) max(16px, env(safe-area-inset-bottom, 0)) var(--gutter-l);
}
.stage-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding-block: 8px; flex-shrink: 0; }
.stage-title { margin: 0; text-align: center; font: 600 13px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; }
.icon-btn {
  appearance: none; border: 0; background: none; cursor: pointer; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: inherit;
}
.icon-btn svg { width: 24px; height: 24px; }
.stage-bottom { flex-shrink: 0; padding-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* Guided massage */
.s-mid { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; text-align: center; overflow-y: auto; }
.s-img {
  width: 100%; max-width: 420px; aspect-ratio: 1 / 1; max-height: 44vh; flex-shrink: 0;
  border-radius: 20px; overflow: hidden; background: rgba(255,255,255,.08); margin: 4px auto 16px;
}
.s-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.s-step { margin: 0; font: 600 12px/1 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.s-title { margin: 8px 0 8px; font: 700 34px/1.05 var(--f-head); }
.s-text { margin: 0; max-width: 34ch; font-size: 15.5px; color: rgba(255,255,255,.9); transition: opacity .25s ease; }
.s-count { display: flex; align-items: baseline; justify-content: space-between; font-variant-numeric: tabular-nums; }
#sCount { font: 700 40px/1 var(--f-head); }
.s-total { font-size: 13px; color: rgba(255,255,255,.75); }
.bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); margin: 10px 0 14px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 3px; }
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.controls .skip { justify-self: start; margin-left: 22px; }
.play {
  appearance: none; border: 0; cursor: pointer; width: 68px; height: 68px; border-radius: 50%;
  background: var(--cream); color: var(--green-deep); display: inline-flex; align-items: center; justify-content: center;
}
.play svg { width: 28px; height: 28px; }
.s-done-line { margin: 0; text-align: center; font-size: 15px; color: rgba(255,255,255,.9); }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 0; appearance: none; border: 0; cursor: pointer; min-height: 44px; padding: 0 10px; border-radius: 10px;
  font: 600 14px/1 var(--f-body); background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line);
}
.seg button[aria-checked="true"] { background: var(--green); color: var(--white); box-shadow: none; }
.seg-dark button { background: rgba(255,255,255,.1); color: var(--white); box-shadow: none; }
.seg-dark button[aria-checked="true"] { background: var(--cream); color: var(--green-deep); }

/* Tutorial */
.t-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.t-title { margin: 6px 0 8px; font: 700 34px/1.05 var(--f-head); color: var(--green-deep); }
.t-intro { margin: 0 0 18px; color: var(--ink-soft); }
.t-basics { list-style: none; margin: 0 0 26px; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: var(--cream); border-radius: 16px; }
.t-basics li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.t-basics .tick { width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: var(--white); display: flex; align-items: center; justify-content: center; }
.t-basics .tick svg { width: 14px; height: 14px; }
.t-basics b { display: block; font-size: 14.5px; }
.t-basics span { font-size: 13.5px; color: var(--ink-soft); }
.t-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 26px; }
.t-step-img { aspect-ratio: 1 / 1; max-width: 100%; border-radius: 16px; overflow: hidden; margin-bottom: 12px; }
.t-step-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.t-step-n { font: 600 12px/1 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.t-step h3 { margin: 6px 0 6px; font: 700 26px/1.1 var(--f-head); color: var(--green-deep); }
.t-step p { margin: 0; color: var(--ink); font-size: 15px; }

/* Calendar */
.h-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.cal-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; color: var(--green-deep); }
.cal-month { margin: 0; text-align: center; font: 700 26px/1 var(--f-head); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 10px; text-align: center; }
.cal .dow { font-size: 11px; font-weight: 600; color: var(--ink-soft); padding-bottom: 4px; }
.cal .d {
  width: 100%; max-width: 40px; margin: 0 auto; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  font-size: 14px; font-variant-numeric: tabular-nums;
}
.cal .d.on { background: var(--green); color: var(--white); font-weight: 600; }
.cal .d.is-today { box-shadow: inset 0 0 0 2px var(--gold); }
.cal .d.on.is-today { box-shadow: 0 0 0 2px var(--gold); }
.cal .d.future { color: #c5c9c3; }
.cal-sum { margin: 14px 0 0; text-align: center; font-size: 14px; color: var(--ink-soft); }
.h-sub { margin: 24px 0 8px; font: 700 22px/1 var(--f-head); color: var(--green-deep); }
.h-list { list-style: none; margin: 0 0 16px; padding: 0; }
.h-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.h-list .h-none { color: var(--ink-soft); justify-content: flex-start; }
.h-del { appearance: none; border: 0; background: none; color: var(--ink-soft); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 6px 0 6px 10px; }

/* ---------- Sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(15, 25, 18, .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet-panel {
  width: 100%; max-width: 560px; background: var(--white); border-radius: 22px 22px 0 0;
  padding: 22px var(--gutter-r) max(20px, env(safe-area-inset-bottom, 0)) var(--gutter-l);
  display: flex; flex-direction: column; gap: 18px; color: var(--ink);
}
.sheet-panel h2 { margin: 0; font: 700 28px/1 var(--f-head); color: var(--green-deep); }
.set { display: flex; flex-direction: column; gap: 8px; }
.set-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
.set-label { font-size: 14px; font-weight: 600; }
.date-in { min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--white); }
.sheet-msg { margin: -6px 0 0; min-height: 0; font-size: 13px; color: #9b2c2c; }
.sheet-msg:empty { display: none; }
.row-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.switch {
  appearance: none; border: 0; cursor: pointer; flex-shrink: 0; position: relative;
  width: 52px; height: 32px; border-radius: 16px; background: var(--line); transition: background .2s ease;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s ease; }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* ---------- Sign in ---------- */
.gate { position: fixed; inset: 0; z-index: 50; background: var(--white); overflow-y: auto; }
.gate-inner {
  max-width: 440px; margin: 0 auto; min-height: 100%;
  padding: max(10px, env(safe-area-inset-top, 0)) var(--gutter-r) max(24px, env(safe-area-inset-bottom, 0)) var(--gutter-l);
  display: flex; flex-direction: column;
}
.gate-inner .logo { margin: -10px 0 -10px -16px; }
.gate-card { background: var(--green); color: var(--white); border-radius: 20px; padding: 24px 20px; }
.gate-title { margin: 0 0 8px; font: 700 30px/1.05 var(--f-head); }
.gate-text { margin: 0 0 18px; color: rgba(255,255,255,.88); font-size: 14.5px; }
.gate-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.gate-input {
  width: 100%; min-height: 52px; border: 0; border-radius: 12px; padding: 0 14px; margin-bottom: 12px;
  background: var(--white); color: var(--ink); font-size: 16px;
}
.gate-code { font-size: 24px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.gate-card .btn { background: var(--cream); color: var(--green-deep); }
.gate-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.gate-link { appearance: none; border: 0; background: none; padding: 6px 0; color: var(--cream); text-decoration: underline; cursor: pointer; font-size: 13.5px; }
.gate-link:disabled { opacity: .6; text-decoration: none; cursor: default; }
.gate-msg { margin: 12px 0 0; font-size: 14px; color: var(--cream); }
.gate-msg:empty { display: none; }
.gate-msg a { color: var(--white); font-weight: 600; }
.gate-foot { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--ink-soft); }
.gate-foot a { color: var(--green); font-weight: 600; }

@media (min-height: 760px) { .s-img { max-height: 48vh; } }
