:root {
  --bg: #0a0a0b;
  --bg-2: #111113;
  --card: rgba(255, 255, 255, 0.032);
  --card-hi: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.075);
  --line-hi: rgba(255, 255, 255, 0.14);
  --text: #f2eee6;
  --text-2: #b9b5ad;
  --muted: #7c7a75;
  --accent: #ff5a1f;
  --accent-soft: rgba(255, 90, 31, 0.14);
  --accent-glow: rgba(255, 90, 31, 0.35);
  --up: #c7f36b;
  --down: #ff8a6b;
  --ice: #9cc2ff;
  --ice-soft: rgba(156, 194, 255, 0.12);
  --radius: 22px;
  --radius-s: 14px;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Geist', ui-sans-serif, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);   /* the notch side when the phone is held sideways */
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.grain {
  position: fixed; inset: -50%; z-index: 0; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.ember {
  position: fixed; left: 50%; top: -38vh; width: 120vw; height: 70vh; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 90, 31, 0.22), rgba(255, 90, 31, 0.05) 55%, transparent 75%);
  filter: blur(20px); pointer-events: none; z-index: 0;
}

.app {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) calc(18px + var(--safe-r)) calc(120px + var(--safe-b)) calc(18px + var(--safe-l));
}

/* ---------- type ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.display {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(64px, 20vw, 104px); line-height: 0.86; letter-spacing: -0.02em; margin: 0;
}
.display .dot { color: var(--accent); font-style: normal; }
.h2 { font-family: var(--serif); font-size: 34px; line-height: 1; margin: 0; font-weight: 400; }
.h2 em { color: var(--accent); }
.h3 { font-size: 16px; font-weight: 560; margin: 0; letter-spacing: -0.01em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }

/* ---------- layout ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: #140700; font-family: var(--serif); font-style: italic; font-size: 20px;
  box-shadow: 0 0 24px var(--accent-glow);
}
.brand-name { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); white-space: nowrap;
}
.pill.accent { border-color: rgba(255, 90, 31, 0.4); color: var(--accent); background: var(--accent-soft); }
.pill.ice { border-color: rgba(156, 194, 255, 0.35); color: var(--ice); background: var(--ice-soft); }
.pill .led { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

.section { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }

.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; overflow: hidden;
}
.card.hi { background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)); }

/* ---------- hero ---------- */
.hero { position: relative; padding: 6px 0 8px; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.hero-tag { margin-top: 14px; color: var(--text-2); font-size: 15px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 26px; background: var(--line); border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); }
.stat { background: var(--bg); padding: 14px 14px 12px; }
.stat .v { font-family: var(--mono); font-size: 22px; letter-spacing: -0.02em; }
.stat .v small { font-size: 12px; color: var(--muted); margin-left: 2px; }
.stat .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

.cta {
  position: relative; width: 100%; margin-top: 22px; height: 64px; border-radius: 20px;
  background: var(--accent); color: #150700; display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 0 24px; font-weight: 620; font-size: 17px; letter-spacing: -0.01em;
  box-shadow: 0 10px 40px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cta:active { transform: scale(0.985); }
.cta .knob { width: 46px; height: 46px; border-radius: 15px; background: #150700; color: var(--accent); display: grid; place-items: center; }
.cta.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-hi); box-shadow: none; }
.cta.ghost .knob { background: var(--card-hi); color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px;
  border-radius: 13px; border: 1px solid var(--line-hi); background: var(--card); font-weight: 520; font-size: 14px;
  transition: background 0.15s;
}
.btn:active { background: var(--card-hi); }
.btn.primary { background: var(--accent); color: #150700; border-color: transparent; font-weight: 620; }
.btn.danger { color: var(--down); border-color: rgba(255, 138, 107, 0.3); }
.btn.block { width: 100%; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); }

/* ---------- week strip ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { text-align: center; padding: 10px 0 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); position: relative; }
.day .d { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.day .w { font-family: var(--serif); font-style: italic; font-size: 19px; margin-top: 4px; color: var(--text-2); }
.day.off .w { color: var(--muted); opacity: 0.55; }
.day.today { border-color: rgba(255, 90, 31, 0.55); }
.day.today .d { color: var(--accent); }
.day.done { background: var(--accent-soft); border-color: rgba(255, 90, 31, 0.35); }
.day.done .w { color: var(--text); }
.day.done::after { content: ''; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* ---------- workout list ---------- */
.wlist { display: grid; gap: 8px; }
.wrow {
  display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 14px; padding: 14px 14px 14px 16px;
  border-radius: 18px; border: 1px solid var(--line); background: var(--card); text-align: left; width: 100%;
  transition: border-color 0.2s, background 0.2s;
}
.wrow:active { background: var(--card-hi); }
.wrow .idx { font-family: var(--serif); font-style: italic; font-size: 34px; line-height: 1; color: var(--muted); }
.wrow.next { border-color: rgba(255, 90, 31, 0.4); }
.wrow.next .idx { color: var(--accent); }
.wrow .t { font-weight: 560; }
.wrow .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.wrow .chev { color: var(--muted); }

/* ---------- session ---------- */
.s-head { position: sticky; top: 0; z-index: 5; margin: 0 -18px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 18px 12px; background: linear-gradient(var(--bg) 70%, transparent); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.s-clock { font-family: var(--mono); font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.s-clock .led { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.s-title { margin: 8px 0 4px; }
.progress-rail { height: 3px; border-radius: 3px; background: var(--line); margin: 18px 0 8px; overflow: hidden; }
.progress-rail i { display: block; height: 100%; background: var(--accent); box-shadow: 0 0 12px var(--accent); transition: width 0.4s var(--ease); }

.ex { margin-top: 14px; padding: 0; }
.ex.complete { border-color: rgba(199, 243, 107, 0.22); }
.ex-top { padding: 18px 18px 0; display: flex; gap: 14px; align-items: flex-start; }
.ex-n { font-family: var(--mono); font-size: 11px; color: var(--muted); padding-top: 4px; min-width: 20px; }
.ex.complete .ex-n { color: var(--up); }
.ex-name { font-size: 17px; font-weight: 580; line-height: 1.25; letter-spacing: -0.01em; }
.ex-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.ex-meta b { color: var(--text-2); font-weight: 500; }
.ex-actions { margin-left: auto; display: flex; gap: 6px; }

.coach {
  margin: 14px 18px 0; padding: 12px 14px; border-radius: 14px; font-size: 13px; line-height: 1.45;
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
}
.coach .ico { margin-top: 1px; }
.coach.up { background: rgba(199, 243, 107, 0.08); color: #e5ffbd; }
.coach.up .ico { color: var(--up); }
.coach.down { background: rgba(255, 138, 107, 0.09); color: #ffd6c8; }
.coach.down .ico { color: var(--down); }
.coach.hold, .coach.new { background: var(--card-hi); color: var(--text-2); }
.coach.hold .ico, .coach.new .ico { color: var(--accent); }
.coach.deload { background: var(--ice-soft); color: #dce9ff; }
.coach.deload .ico { color: var(--ice); }
.coach.plateau { background: rgba(255, 90, 31, 0.1); color: #ffd9c9; }
.coach b { color: var(--text); font-weight: 600; }

.sets { padding: 12px 10px 10px; }
.set-head, .set { display: grid; grid-template-columns: 34px 1fr 1fr 1fr 48px; gap: 8px; align-items: center; }
.set-head { padding: 0 8px 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.set { padding: 5px 8px; border-radius: 14px; transition: background 0.25s; }
.set.done { background: rgba(199, 243, 107, 0.06); }
.set .sn { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; color: var(--text-2); background: var(--card-hi); }
.set.done .sn { background: var(--up); color: #111; }
.set .prev { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field {
  width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35);
  text-align: center; font-family: var(--mono); font-size: 17px; outline: none; transition: border-color 0.15s, background 0.15s;
  -moz-appearance: textfield; appearance: textfield;
}
.field::-webkit-outer-spin-button, .field::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field::placeholder { color: rgba(242, 238, 230, 0.22); }
.field:focus { border-color: var(--accent); background: rgba(255, 90, 31, 0.06); }
.set.done .field { border-color: transparent; background: transparent; color: var(--text); }
.check {
  width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--line-hi); display: grid; place-items: center; color: var(--muted);
  transition: all 0.2s var(--ease);
}
.check:active { transform: scale(0.92); }
.set.done .check { background: var(--up); color: #111; border-color: transparent; box-shadow: 0 0 18px rgba(199, 243, 107, 0.3); }
.set-foot { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 4px; }
.link { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px; }
.link:active { color: var(--text); }

.details { border-top: 1px solid var(--line); margin-top: 6px; }
.details summary { list-style: none; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-2); cursor: pointer; }
.details summary::-webkit-details-marker { display: none; }
.details[open] summary .chev { transform: rotate(90deg); }
.details .chev { transition: transform 0.2s; }
.details .body { padding: 0 18px 16px; font-size: 13.5px; color: var(--text-2); display: grid; gap: 12px; }
.note-area {
  width: 100%; min-height: 64px; resize: vertical; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3);
  padding: 10px 12px; font-size: 13.5px; outline: none;
}
.note-area:focus { border-color: var(--accent); }

/* ---------- rest timer ---------- */
.rest {
  position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translateX(-50%); z-index: 30;
  width: min(524px, calc(100% - 28px)); display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 14px;
  padding: 10px 10px 10px 12px; border-radius: 22px; background: rgba(22, 22, 24, 0.86); backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); border: 1px solid var(--line-hi); box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.8);
  animation: rise 0.35s var(--ease);
}
.rest.over { border-color: rgba(199, 243, 107, 0.45); }
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } }
.rest .ring { position: relative; width: 56px; height: 56px; }
.rest .ring > svg { transform: rotate(-90deg); }
.rest .ring .ico { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); }
.rest.over .ring .ico { color: var(--up); }
.rest .t { font-family: var(--mono); font-size: 28px; letter-spacing: -0.03em; line-height: 1; }
.rest .l { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.rest .ctrls { display: flex; gap: 6px; }
.rest .ctrls button { height: 40px; min-width: 44px; padding: 0 10px; border-radius: 12px; background: var(--card-hi); font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.rest .ctrls .go { background: var(--accent); color: #150700; font-weight: 600; }

/* ---------- tabs ---------- */
.tabs {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px; border-radius: 24px;
  width: min(360px, calc(100% - 28px)); background: rgba(18, 18, 20, 0.78); backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); border: 1px solid var(--line-hi); box-shadow: 0 16px 50px -12px rgba(0, 0, 0, 0.9);
}
.tabs a { display: grid; place-items: center; gap: 3px; height: 54px; border-radius: 18px; color: var(--muted); font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; transition: color 0.2s, background 0.2s; }
.tabs a.on { color: var(--text); background: var(--card-hi); }
.tabs a.on svg { color: var(--accent); }

/* ---------- sheets / modal ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 51; width: min(560px, 100%);
  background: #141416; border: 1px solid var(--line-hi); border-bottom: 0; border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(24px + var(--safe-b)); animation: slide 0.35s var(--ease); max-height: 88dvh; overflow: auto;
}
@keyframes slide { from { transform: translate(-50%, 100%); } }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-hi); margin: 0 auto 18px; }
.opt { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); margin-top: 8px; }
.opt.on { border-color: rgba(255, 90, 31, 0.5); background: var(--accent-soft); }
.opt .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.opt.on .k { color: var(--accent); }

.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 14px); transform: translate(-50%, -24px); opacity: 0; z-index: 90;
  padding: 10px 16px; border-radius: 14px; background: #1b1b1e; border: 1px solid var(--line-hi); font-size: 13.5px;
  transition: transform 0.35s var(--ease), opacity 0.25s; pointer-events: none; max-width: calc(100% - 28px);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- lists / history ---------- */
.hist { display: grid; gap: 8px; }
.hrow { display: grid; grid-template-columns: 58px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); }
.hrow .date { text-align: center; line-height: 1; }
.hrow .date .dd { font-family: var(--serif); font-size: 32px; }
.hrow .date .mm { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.hrow .t { font-weight: 560; }
.hrow .s { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.month { margin: 22px 4px 10px; }

.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kv > div { padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.kv .v { font-family: var(--mono); font-size: 20px; }
.kv .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td:last-child { text-align: right; font-family: var(--mono); color: var(--text-2); }
.table tr:last-child td { border-bottom: 0; }
.pr { color: var(--up); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; margin-left: 6px; }

/* ---------- progress ---------- */
.prow { display: grid; grid-template-columns: 1fr 96px auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); width: 100%; text-align: left; }
.prow .t { font-weight: 540; font-size: 14.5px; line-height: 1.25; }
.prow .s { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 3px; }
.prow .delta { font-family: var(--mono); font-size: 12px; }
.delta.pos { color: var(--up); }
.delta.neg { color: var(--down); }
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 13px; background: var(--card); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 12px; border-radius: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.seg button.on { background: var(--card-hi); color: var(--text); }

/* ---------- settings ---------- */
.srow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow .t { font-weight: 520; }
.srow .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.input { height: 40px; border-radius: 11px; border: 1px solid var(--line-hi); background: rgba(0, 0, 0, 0.35); padding: 0 12px; font-family: var(--mono); outline: none; width: 150px; }
.input:focus { border-color: var(--accent); }
.switch { position: relative; width: 50px; height: 30px; border-radius: 30px; background: var(--card-hi); border: 1px solid var(--line-hi); transition: background 0.2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text-2); transition: transform 0.25s var(--ease), background 0.2s; }
.switch.on { background: var(--accent); border-color: transparent; }
.switch.on::after { transform: translateX(20px); background: #150700; }

/* ---------- circuit ---------- */
.circuit { text-align: center; padding-top: 10px; }
.big-ring { position: relative; width: min(300px, 78vw); aspect-ratio: 1; margin: 26px auto 22px; }
.big-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.big-ring .c { position: absolute; inset: 0; display: grid; place-content: center; }
.big-ring .tt { font-family: var(--mono); font-size: 64px; letter-spacing: -0.04em; line-height: 1; }
.big-ring .ll { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.circuit .move { font-family: var(--serif); font-style: italic; font-size: 40px; line-height: 1; }
.circuit .next { margin-top: 10px; color: var(--muted); font-size: 13.5px; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 22px; }
.dots i { width: 22px; height: 4px; border-radius: 4px; background: var(--line-hi); }
.dots i.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dots i.cur { background: var(--text); }

/* ---------- login ---------- */
.login { min-height: 82dvh; display: flex; flex-direction: column; justify-content: center; }
.login .display { font-size: clamp(76px, 24vw, 132px); }
.pin { display: flex; gap: 10px; margin: 36px 0 18px; }
.pin input { flex: 1; min-width: 0; height: 64px; font-size: 26px; letter-spacing: 0.3em; text-align: center; border-radius: 18px; border: 1px solid var(--line-hi); background: rgba(0, 0, 0, 0.4); outline: none; font-family: var(--mono); }
.pin input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.err { color: var(--down); font-size: 13px; min-height: 20px; }

/* ---------- motion ---------- */
.rise > * { animation: up 0.6s var(--ease) both; }
.rise > *:nth-child(2) { animation-delay: 0.05s; }
.rise > *:nth-child(3) { animation-delay: 0.1s; }
.rise > *:nth-child(4) { animation-delay: 0.15s; }
.rise > *:nth-child(5) { animation-delay: 0.2s; }
.rise > *:nth-child(6) { animation-delay: 0.25s; }
.rise > *:nth-child(n+7) { animation-delay: 0.3s; }
@keyframes up { from { opacity: 0; transform: translateY(14px); } }
.pop { animation: pop 0.35s var(--ease); }
@keyframes pop { 40% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.empty { text-align: center; padding: 48px 10px; color: var(--muted); }
.empty .h2 { color: var(--text); margin-bottom: 8px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt20 { margin-top: 20px; }
.boost { display: grid; gap: 10px; }
.boost div b { color: var(--text); font-weight: 560; display: block; font-size: 13.5px; }
.rest > div:nth-child(2) { min-width: 0; }
.rest .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body:has(#tabs[hidden]) .rest { bottom: calc(16px + var(--safe-b)); }

/* ---------- how-to: video + PDF ---------- */
.howto { display: flex; gap: 8px; flex-wrap: wrap; }
.howto.in-card { padding: 12px 18px 0 52px; }
.howto.center { justify-content: center; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px 0 11px; border-radius: 999px;
  border: 1px solid var(--line-hi); background: rgba(255, 255, 255, 0.04); font-size: 12.5px; font-weight: 520; color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.chip:active { background: var(--card-hi); }
.chip svg { color: var(--accent); }
.video-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pdf-body { border-radius: 14px; overflow: hidden; background: #fff; min-height: 220px; display: grid; place-items: center; }
.pdf-canvas { display: block; width: 100%; height: auto; }
.pdf-loading { color: #666; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.pdf-missing { background: var(--bg-2); width: 100%; height: 100%; padding: 22px; text-align: left; align-self: stretch; }
.pdf-body:has(.pdf-missing) { background: var(--bg-2); border: 1px solid var(--line); }

/* ---------- dumbbell rack ---------- */
.rack { display: flex; flex-wrap: wrap; gap: 8px; }
.rack-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 6px 0 14px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid rgba(255, 90, 31, 0.35); font-size: 15px; color: var(--text);
}
.rack-chip small { font-size: 10px; color: var(--muted); margin-left: 2px; text-transform: uppercase; letter-spacing: 0.08em; }
.rack-chip button { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); margin-left: 4px; }
.rack-chip button:active { background: rgba(255, 255, 255, 0.08); color: var(--text); }

/* ---------- music ---------- */
.music-btn { position: relative; }
.music-btn i { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); display: none; animation: pulse 1.6s infinite; }
.music-btn.live { color: var(--accent); border-color: rgba(255, 90, 31, 0.45); }
.music-btn.live i { display: block; }
/* The dock stays mounted (so audio keeps playing) and slides off-screen when minimised. */
.music-dock {
  position: fixed; z-index: 40; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 10px); width: min(524px, calc(100% - 28px));
  /* Collapsed: fully above the screen (incl. Dynamic Island safe area), invisible and untappable.
     visibility keeps the iframe loaded, so music keeps playing. */
  transform: translate(-50%, calc(-100% - 30px - env(safe-area-inset-top, 0px))); visibility: hidden; opacity: 0; pointer-events: none;
  transition: transform 0.4s var(--ease), opacity 0.25s, visibility 0s linear 0.4s;
  padding: 12px; border-radius: 22px; background: rgba(20, 20, 22, 0.92); border: 1px solid var(--line-hi);
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.9);
}
.music-dock.open { transform: translate(-50%, 0); visibility: visible; opacity: 1; pointer-events: auto; transition: transform 0.4s var(--ease), opacity 0.2s, visibility 0s; }
.md-open-app { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 9px; background: #1ed760; color: #06140a; font-size: 12px; font-weight: 620; }
.md-head { display: flex; align-items: center; gap: 8px; padding: 0 2px 10px; }
.md-btn { height: 30px; padding: 0 10px; border-radius: 9px; background: var(--card-hi); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--text-2); }
.md-btn.icon { width: 30px; padding: 0; display: grid; place-items: center; }
.md-lists { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.md-lists::-webkit-scrollbar { display: none; }
.md-lists .chip { flex: none; }
.chip.on { border-color: rgba(255, 90, 31, 0.6); background: var(--accent-soft); }
.md-frame:empty { display: none; }
.md-frame { margin-top: 10px; border-radius: 14px; overflow: hidden; }
.md-frame iframe { display: block; width: 100%; border: 0; }
.md-frame.youtube iframe { aspect-ratio: 16 / 9; height: auto; }

/* ---------- rest editing ---------- */
.rest-tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding: 2px 8px 2px 6px; margin: -2px 0; border-radius: 8px; border: 1px dashed var(--line-hi); }
.rest-tag b { color: var(--text-2); font-weight: 500; }
.rest-tag.custom { border-style: solid; border-color: rgba(255, 90, 31, 0.45); color: var(--accent); }
.rest-tag.custom b { color: var(--accent); }
.rest-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rest-opt { height: 58px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); display: grid; place-content: center; gap: 2px; font-size: 16px; }
.rest-opt small { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rest-opt.on { border-color: rgba(255, 90, 31, 0.6); background: var(--accent-soft); color: var(--accent); }
.rest-opt.on small { color: var(--accent); }

/* ---------- one-sided sets (Left / Right) ---------- */
.set-head.uni, .set.uni { grid-template-columns: 28px minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 0.85fr) minmax(0, 0.85fr) 44px; gap: 6px; }
.set.uni .check { width: 44px; }
.set.uni .field { font-size: 16px; }
.field.side { border-style: dashed; }
.set.done .field.side { border-style: solid; }
.md-head .eyebrow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- yoga flow (separate from training; calm sage accent) ---------- */
:root { --sage: #93dbc3; --sage-soft: rgba(147, 219, 195, 0.13); --sage-glow: rgba(147, 219, 195, 0.3); }
body.yoga { --accent: var(--sage); --accent-soft: var(--sage-soft); --accent-glow: var(--sage-glow); }
body.yoga .ember { background: radial-gradient(closest-side, rgba(147, 219, 195, 0.17), rgba(147, 219, 195, 0.04) 55%, transparent 75%); }
body.yoga .cta, body.yoga .btn.primary { color: #06140f; }
body.yoga .cta .knob { background: #06140f; }
body.yoga .pill.accent { border-color: rgba(147, 219, 195, 0.4); }
body.yoga .music-btn.live { border-color: rgba(147, 219, 195, 0.45); }
.h2 em.sage { color: var(--sage); }
.wrow.yoga .idx { color: var(--sage); }

.cta > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; line-height: 1.25; }
.cta small { display: block; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.68; }

/* full sequence */
.ycaution ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 7px; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.ylist { display: grid; gap: 8px; }
.yrow { border-radius: 18px; border: 1px solid var(--line); background: var(--card); overflow: hidden; }
.yrow.here { border-color: rgba(147, 219, 195, 0.45); }
.yrow summary { list-style: none; display: grid; grid-template-columns: 30px 1fr auto; gap: 14px; align-items: center; padding: 14px 14px 14px 16px; cursor: pointer; }
.yrow summary::-webkit-details-marker { display: none; }
.yrow .yn { font-family: var(--serif); font-style: italic; font-size: 27px; line-height: 1; color: var(--muted); text-align: center; }
.yrow[open] .yn, .yrow.here .yn { color: var(--accent); }
.yrow .yt { min-width: 0; }
.yrow .yt b { display: block; font-weight: 560; font-size: 15px; line-height: 1.25; }
.yrow .yt i { display: block; font-style: normal; color: var(--text-2); font-size: 13px; margin-top: 1px; }
.yrow .yt small { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 5px; }
.yrow .chev { color: var(--muted); transition: transform 0.2s; }
.yrow[open] .chev { transform: rotate(90deg); }
.ybody { padding: 0 16px 16px; }
.ybody .coach { margin: 0 0 12px; }
.ycredit { font-size: 11.5px; line-height: 1.5; margin: 26px 4px 0; }

/* step reader */
.ystep { padding: 22px 0 150px; }
.yname { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(40px, 11.5vw, 58px); line-height: 0.98; letter-spacing: -0.01em; margin: 10px 0 0; overflow-wrap: anywhere; }
.yen { margin-top: 10px; color: var(--text-2); font-size: 16.5px; }
.ydose { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ydose .pill { font-size: 12px; padding: 8px 13px; color: var(--accent); background: var(--accent-soft); border-color: rgba(147, 219, 195, 0.32); white-space: normal; }
.ystep .coach { margin: 18px 0 0; }

.ytimer { margin-top: 20px; border-radius: 24px; border: 1px solid var(--line-hi); background: var(--card); transition: border-color 0.25s, background 0.25s; overflow: hidden; }
.yt-main {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 16px; align-items: center; padding: 12px 16px 12px 12px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
}
.yt-main:active { background: var(--card-hi); }
.ytimer.run, .ytimer.prep { border-color: rgba(147, 219, 195, 0.55); background: var(--accent-soft); }
.ytimer.done { border-color: rgba(199, 243, 107, 0.45); }
.ytimer .ring { position: relative; width: 76px; height: 76px; }
.ytimer .ring > svg { transform: rotate(-90deg); }
.ytimer .ring .ico { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); }
.ytimer.done .ring .ico { color: var(--up); }
.ytimer .t { font-family: var(--mono); font-size: 36px; letter-spacing: -0.03em; line-height: 1; }
.ytimer.prep .t { color: var(--accent); animation: ytick 0.5s var(--ease); }
@keyframes ytick { 0% { transform: scale(1.25); opacity: 0.5; } }
.ytimer .l { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 7px; line-height: 1.4; }
.ytimer .ybtn { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding: 10px 12px; border-radius: 12px; background: var(--card-hi); white-space: nowrap; }
.ytimer.run .ybtn, .ytimer.prep .ybtn { background: rgba(0, 0, 0, 0.28); }
.yt-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 14px 14px; }
.yt-opts .chip { min-height: 36px; font-family: var(--mono); font-size: 12.5px; padding: 0 12px; }
.yt-opts .chip.on { border-color: rgba(147, 219, 195, 0.5); background: var(--accent-soft); color: var(--accent); }
.yt-opts .yt-adj { width: 40px; padding: 0; justify-content: center; }
.yt-opts .yt-adj svg { color: var(--text-2); }
.yt-note { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.own-timer { margin-top: 18px; }

/* a prayer, laid out like its card */
.verse { margin: 26px 0 0; padding: 18px 20px 20px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 4px 20px 20px 4px; }
.v-gift { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); line-height: 1.5; margin-bottom: 14px; }
.v-cols { display: grid; gap: 22px; }
.v-title { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--accent); margin-bottom: 8px; line-height: 1.2; }
.verse p { margin: 0 0 7px; font-family: var(--serif); font-size: 21px; line-height: 1.38; }
.verse [lang='hi'] .v-title { font-family: 'Tiro Devanagari Hindi', var(--serif); font-style: normal; font-size: 21px; line-height: 1.5; }
.verse [lang='hi'] p { font-family: 'Tiro Devanagari Hindi', var(--serif); font-size: 19px; line-height: 1.7; margin-bottom: 4px; }
.ybody .verse { margin: 12px 0 0; padding: 14px 16px; }
.ybody .verse p { font-size: 17px; }
.ybody .verse [lang='hi'] p { font-size: 16px; }
@media (min-width: 640px) { .v-cols { grid-template-columns: 1fr 1fr; gap: 26px; } }

.ycues { list-style: none; counter-reset: cue; margin: 26px 0 0; padding: 0; display: grid; gap: 17px; }
.ycues li { counter-increment: cue; display: grid; grid-template-columns: 28px 1fr; gap: 14px; font-size: 17.5px; line-height: 1.5; }
.ycues li::before {
  content: counter(cue); width: 28px; height: 28px; margin-top: -1px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--accent); background: var(--accent-soft);
}
.ybody .ycues { margin-top: 2px; gap: 11px; }
.ybody .ycues li { font-size: 14.5px; grid-template-columns: 22px 1fr; gap: 11px; color: var(--text-2); }
.ybody .ycues li::before { width: 22px; height: 22px; font-size: 10.5px; border-radius: 8px; margin-top: 0; }
.ynocue { margin-top: 24px; font-size: 15px; line-height: 1.5; }

.ynav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); z-index: 20;
  width: min(524px, calc(100% - 28px)); display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: center;
}
.ynav::before { content: ''; position: absolute; inset: -34px -14px calc(-14px - var(--safe-b)); z-index: -1; pointer-events: none; background: linear-gradient(transparent, var(--bg) 42%); }
.ynav .icon-btn { width: 58px; height: 64px; border-radius: 20px; background: #161618; border-color: var(--line-hi); color: var(--text); }
.ynav .icon-btn[disabled] { opacity: 0.35; }
.ynav .cta { margin: 0; }
.section-head { gap: 12px; }

/* ---------- sound previews (Setup) ---------- */
.sfx-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 14px; }

/* ---------- post-workout award ---------- */
.medal-wrap { position: relative; width: 230px; height: 230px; margin: 18px auto 0; display: grid; place-items: center; }
.medal-rays {
  position: absolute; inset: -46px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 90, 31, 0.2) 0deg 4deg, transparent 4deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 28%, transparent 68%); mask: radial-gradient(circle, #000 28%, transparent 68%);
  animation: spin 46s linear infinite, fade 1.4s 0.2s var(--ease) both;
}
.medal { position: relative; width: 210px; height: 210px; border-radius: 50%; animation: medal-in 1.05s var(--ease) both; }
.medal::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, #1c0c04 0 60%, #7a2a08 61%, #1a0a03 64%, #120803 100%);
  box-shadow: 0 0 70px -8px var(--accent-glow), inset 0 0 0 1.5px rgba(255, 178, 122, 0.4);
}
.medal-ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 28s linear infinite; }
.medal-ring text { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; fill: rgba(255, 200, 160, 0.78); }
.medal-core {
  position: absolute; inset: 38px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; align-content: center; gap: 3px; color: #1a0800;
  background: radial-gradient(circle at 34% 28%, #ffd8b4 0%, #ff8e52 26%, #ff5a1f 55%, #9c3006 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -12px 26px rgba(80, 20, 0, 0.55), 0 10px 34px -8px rgba(255, 90, 31, 0.7);
}
.medal-core::after {
  content: ''; position: absolute; inset: -30%;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.6) 50%, transparent 58%);
  animation: shine 3.6s 1.1s ease-in-out infinite;
}
.medal-n { font-family: var(--serif); font-style: italic; font-size: 66px; line-height: 0.82; }
.medal-k { font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.72; }
.rw-title { text-align: center; margin-top: 20px; animation: up 0.7s 0.45s var(--ease) both; }
.rw-sub { text-align: center; margin-top: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); animation: up 0.7s 0.55s var(--ease) both; }
.kv.k4 { grid-template-columns: repeat(4, 1fr); animation: up 0.7s 0.65s var(--ease) both; }
.kv.k4 > div { padding: 12px 10px; }
.kv.k4 .v { font-size: 18px; }

.rw-sec { margin-top: 26px; scroll-margin-top: 20px; animation: up 0.6s var(--ease) both; }
.rw-sec.no-anim { animation: none; }
.rw-in { animation: up 0.6s var(--ease) both; animation-delay: var(--d, 0s); }
.rw-card { padding: 22px 20px 20px; }
.rw-eb { margin-bottom: 12px; }
.rw-hard .rw-eb { color: var(--accent); }
.rw-good .rw-eb { color: var(--up); }
.rw-lines p { margin: 0 0 12px; font-size: 17px; line-height: 1.55; color: var(--text-2); animation: up 0.7s var(--ease) both; animation-delay: var(--d, 0s); }
.rw-lines p:last-child { margin-bottom: 0; }
.rw-lines b { color: var(--text); font-weight: 620; }
.rw-lines u, .rw-after u { color: var(--text); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.rw-good .rw-lines u { text-decoration-color: var(--up); }
.rw-stamp {
  position: absolute; right: 14px; bottom: 14px; padding: 6px 10px; border: 2px solid var(--up); border-radius: 10px;
  color: var(--up); background: rgba(10, 10, 11, 0.85); font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; transform: rotate(-11deg); opacity: 0; pointer-events: none;
}
.rw-card.stamped { border-color: rgba(199, 243, 107, 0.35); padding-bottom: 58px; transition: padding 0.3s var(--ease), border-color 0.3s; }
.rw-card.stamped .rw-stamp { opacity: 1; animation: stamp 0.42s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
@keyframes stamp { from { transform: rotate(-11deg) scale(2.6); opacity: 0; } }

.feel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feel {
  text-align: left; padding: 16px 14px; border-radius: 18px; border: 1px solid var(--line-hi); background: var(--card);
  display: grid; gap: 8px; align-content: start; transition: transform 0.15s, border-color 0.2s, opacity 0.25s, background 0.2s;
}
.feel:active { transform: scale(0.97); }
.feel .ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.feel.good .ico { background: rgba(199, 243, 107, 0.12); color: var(--up); }
.feel .t { font-weight: 600; font-size: 15px; line-height: 1.25; }
.feel .s { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.feel-grid.picked .feel:not(.on) { opacity: 0.42; }
.feel.hard.on { border-color: var(--accent); background: var(--accent-soft); }
.feel.good.on { border-color: var(--up); background: rgba(199, 243, 107, 0.08); }

.rw-say { margin-top: 18px; border-color: rgba(255, 90, 31, 0.45); color: var(--accent); font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.rw-good .rw-say { border-color: rgba(199, 243, 107, 0.45); color: var(--up); }
.rw-read.said .rw-say, .rw-read:not(.said) .rw-slam, .rw-read:not(.said) .rw-after { display: none; }
.rw-slam { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; margin-top: 16px; }
.rw-slam span {
  font-family: var(--serif); font-style: italic; font-size: clamp(46px, 14.5vw, 66px); line-height: 1.02;
  color: var(--accent); text-shadow: 0 0 34px var(--accent-glow);
  animation: slam 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both; animation-delay: var(--d, 0s);
}
.rw-good .rw-slam span { color: var(--up); text-shadow: 0 0 34px rgba(199, 243, 107, 0.35); }
@keyframes slam { from { opacity: 0; transform: scale(2.3) translateY(-8px); filter: blur(6px); } }
.rw-after { margin: 14px 0 0; font-size: 19px; animation: up 0.6s var(--ease) both; animation-delay: var(--d, 0s); }
.rw-ask { margin-top: 12px; }
.rw-link {
  display: block; margin: 14px auto 0; padding: 10px 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-2); animation: up 0.6s 0.5s var(--ease) both;
}
.rw-claim.claimed { background: var(--up); color: #0c1400; box-shadow: 0 10px 40px -8px rgba(199, 243, 107, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.rw-claim.claimed .knob { background: #0c1400; color: var(--up); }
.rw-claim .knob { animation: pop 0.6s 0.3s var(--ease) both; }
.rw-fix { margin: 14px 0 4px; border-color: rgba(255, 90, 31, 0.3); background: var(--accent-soft); font-size: 14.5px; }

.confetti { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; left: 0; top: 0; border-radius: 2px; will-change: transform; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes medal-in { 0% { transform: scale(0.3) rotate(-35deg); opacity: 0; } 60% { transform: scale(1.07) rotate(4deg); opacity: 1; } 100% { transform: none; } }
@keyframes shine { 0%, 50% { transform: translateX(-110%); } 80%, 100% { transform: translateX(110%); } }

/* ---------- "New version available" bar ---------- */
.update-bar {
  position: fixed; z-index: 95; left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 10px);
  max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 9px 6px 9px 14px; border-radius: 16px; background: #1b1b1e; border: 1px solid rgba(255, 90, 31, 0.38);
  box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.9), 0 0 28px -10px var(--accent-glow);
  animation: ub-in 0.45s var(--ease) both;
}
.update-bar .ub-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); animation: ub-pulse 1.6s ease-in-out infinite; }
.update-bar .ub-txt { flex: 1; min-width: 0; display: grid; gap: 1px; line-height: 1.25; }
.update-bar .ub-txt b { font-size: 13.5px; font-weight: 600; }
.update-bar .ub-txt span { font-size: 12px; color: var(--muted); }
.update-bar .ub-go { flex: none; padding: 9px 15px; border-radius: 11px; border: 0; background: var(--accent); color: #150700; font: 620 13.5px var(--sans); }
.update-bar .ub-go:disabled { opacity: 0.7; }
.update-bar .ub-x { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font: 400 21px var(--sans); line-height: 1; }
@keyframes ub-in { from { transform: translateY(-18px); opacity: 0; } }
@keyframes ub-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .update-bar, .update-bar .ub-dot { animation: none; } }

/* ---------- no accidental zoom ---------- */
/* A quick double tap (e.g. on a timer) must never zoom the page. Pinch still works. */
html, body, * { touch-action: manipulation; }

/* ---------- yoga in the Log ---------- */
.pill.sage { border-color: rgba(147, 219, 195, 0.4); color: var(--sage); background: var(--sage-soft); }
.hrow.yoga { border-color: rgba(147, 219, 195, 0.22); }
.hrow.yoga .date .dd { color: var(--sage); }
.yd-links { gap: 10px; }
.yd-links .btn { flex: 1; }

/* ---------- phone held sideways ---------- */
@media (orientation: landscape) and (max-height: 540px) {
  .app { max-width: 880px; padding-top: calc(env(safe-area-inset-top, 0px) + 10px); padding-bottom: calc(84px + var(--safe-b)); }
  .display { font-size: clamp(48px, 15vh, 76px); }
  .topbar { margin-bottom: 12px; }
  .hero-stats { margin-top: 16px; }
  .section { margin-top: 24px; }
  .tabs { bottom: calc(8px + var(--safe-b)); padding: 4px; width: min(420px, calc(100% - 28px)); }
  .tabs a { height: 40px; grid-auto-flow: column; gap: 8px; }
  .rest { bottom: calc(62px + var(--safe-b)); }
  body:has(#tabs[hidden]) .rest { bottom: calc(10px + var(--safe-b)); }
  .sheet { max-height: 94dvh; }
  .s-head { margin: 0; padding: calc(env(safe-area-inset-top, 0px) + 6px) 0 6px; }

  /* yoga step: title + timer on the left, the steps to read on the right */
  .ystep { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 0 36px; align-items: start; padding: 12px 0 96px; }
  .yname { font-size: clamp(30px, 10vh, 46px); }
  .ydose { margin-top: 12px; }
  .ys-b > :first-child { margin-top: 4px; }
  .ytimer { margin-top: 14px; }
  .ycues { gap: 12px; }
  .ycues li { font-size: 16.5px; }
  .verse { margin-top: 4px; }
  .v-cols { grid-template-columns: 1fr 1fr; gap: 22px; }
  .verse p { font-size: 18px; }
  .verse [lang='hi'] p { font-size: 16.5px; }
  .ystep:has(.verse) { grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr); gap: 0 28px; }
  /* Prev/Next sit under the right-hand column, so they never cover the timer. */
  .ynav { bottom: calc(8px + var(--safe-b)); left: auto; right: calc(16px + var(--safe-r)); transform: none; width: min(440px, 52vw); grid-template-columns: 52px 1fr; }
  .ynav .icon-btn { width: 52px; height: 52px; border-radius: 16px; }
  .ynav .cta { min-height: 52px; border-radius: 17px; padding: 5px 6px 5px 20px; }
  .ynav .cta .knob { width: 42px; height: 42px; border-radius: 13px; }
  .ynav::before { inset: -22px -14px calc(-8px - var(--safe-b)); }
}

/* ---------- shared start screen (boot.js): asks for a passcode, then opens that person's app ---------- */
body.gate .ember { background: radial-gradient(closest-side, rgba(255, 140, 110, 0.2), rgba(255, 111, 142, 0.05) 55%, transparent 75%); }
.gate-card { min-height: 84dvh; display: flex; flex-direction: column; justify-content: center; max-width: 380px; margin: 0 auto; }
.gate-mark { display: flex; gap: 6px; margin-bottom: 30px; }
.gate-mark span { width: 12px; height: 12px; border-radius: 50%; background: #ff8a5c; box-shadow: 0 0 18px rgba(255, 138, 92, 0.55); }
.gate-mark span:nth-child(2) { background: #ff6f8e; box-shadow: 0 0 18px rgba(255, 111, 142, 0.5); }
.gate-mark span:nth-child(3) { background: #92dcbb; box-shadow: 0 0 18px rgba(146, 220, 187, 0.45); }
.gate-card h1 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(54px, 16vw, 76px); line-height: 0.92; margin: 0; letter-spacing: -0.02em; }
.gate-card h1 span { color: #ff8a5c; font-style: normal; }
.gate-card p { color: var(--text-2); margin: 14px 0 26px; }
.gate-card input { width: 100%; height: 64px; font-size: 26px; letter-spacing: 0.3em; text-align: center; border-radius: 18px; border: 1px solid var(--line-hi); background: rgba(0, 0, 0, 0.4); outline: none; font-family: var(--mono); }
.gate-card input:focus { border-color: #ff8a5c; box-shadow: 0 0 0 4px rgba(255, 138, 92, 0.14); }
.gate-err { color: var(--down); font-size: 13px; min-height: 22px; margin-top: 8px; }
.gate-card button { width: 100%; height: 60px; border-radius: 18px; margin-top: 6px; font-weight: 620; font-size: 17px; color: #1d0a0c; background: linear-gradient(120deg, #ffc27a, #ff8f7e 50%, #ff6f8e); box-shadow: 0 12px 40px -12px rgba(255, 111, 142, 0.45); }
.gate-card button:disabled { opacity: 0.7; }
