/* Workout AM — design tokens + components. Dark is the base; Light and Auto swap tokens. */
:root {
  --bg: #050608; --text: #F5F5F7; --sub: #A1A1A6; --muted: #8E8E93; --soft: #C7C7CC;
  --line: rgba(255,255,255,0.08); --glass: rgba(255,255,255,0.08); --hi: rgba(255,255,255,0.25);
  --accent: #0A64D8; --accent-text: #5EA2FF; --quicky: #FFD60A; --quicky-text: #FFD60A;
  --t-full: rgba(10,100,216,0.5); --t-quicky: rgba(255,214,10,0.5); --t-rest: rgba(48,209,88,0.5); --t-missed: rgba(209,41,31,0.5);
  --ring: rgba(255,255,255,0.32); --glow: rgba(10,100,216,0.30); --cal-fg: rgba(255,255,255,0.92);
  --margin: 24px; --safe-top: max(env(safe-area-inset-top), 20px); --safe-bottom: max(env(safe-area-inset-bottom), 20px);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F2F2F7; --text: #1C1C1E; --sub: #6E6E73; --muted: #6E6E73; --soft: #48484A;
  --line: rgba(0,0,0,0.10); --glass: rgba(255,255,255,0.72); --hi: rgba(255,255,255,0.9);
  --accent-text: #0A64D8; --quicky-text: #7A5C00; --ring: rgba(0,0,0,0.25); --glow: rgba(10,100,216,0.12); --cal-fg: #1C1C1E;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #F2F2F7; --text: #1C1C1E; --sub: #6E6E73; --muted: #6E6E73; --soft: #48484A;
    --line: rgba(0,0,0,0.10); --glass: rgba(255,255,255,0.72); --hi: rgba(255,255,255,0.9);
    --accent-text: #0A64D8; --quicky-text: #7A5C00; --ring: rgba(0,0,0,0.25); --glow: rgba(10,100,216,0.12); --cal-fg: #1C1C1E;
    color-scheme: light;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif; color: var(--text); -webkit-font-smoothing: antialiased; overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
button, a, input { font: inherit; color: inherit; }
button { appearance: none; border: 0; background: transparent; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
a { text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }

/* screen skeleton: one centered column, max 430 wide */
#app { position: fixed; inset: 0; max-width: 430px; margin: 0 auto; overflow: hidden; background: var(--bg); }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.glow { position: absolute; left: -80px; top: -240px; width: 550px; height: 520px; background: radial-gradient(closest-side, var(--glow), transparent); pointer-events: none; }
.glow.yellow { background: radial-gradient(closest-side, rgba(255,214,10,0.16), transparent); }
.top { position: relative; padding: calc(var(--safe-top) + 12px) 16px 0; display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.top.center { justify-content: center; flex-direction: column; gap: 14px; }
.scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pad { padding-left: var(--margin); padding-right: var(--margin); }
.bottom { position: relative; padding: 16px 20px var(--safe-bottom); display: flex; align-items: center; gap: 12px; }
.bottom.fade { position: absolute; left: 0; right: 0; bottom: 0; padding-top: 28px; background: linear-gradient(to top, var(--bg) 62%, transparent); }

/* type */
.title { margin: 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -0.02em; }
.title-sm { margin: 0; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.02em; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sub); }
.sub { font-size: 15px; color: var(--sub); }
.hero { font-size: 168px; line-height: 1; font-weight: 200; letter-spacing: -0.05em; }

/* glass controls */
.glass { background: var(--glass); box-shadow: inset 0 1px 1px var(--hi); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%); }
.circle { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.btn { height: 60px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; font-weight: 600; flex: 1; transition: opacity .2s ease, transform .15s ease; }
.btn:active, .circle:active, .bolt:active { transform: scale(0.97); }
.btn-primary { background: rgba(10,100,216,0.62); color: #fff; box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), 0 10px 30px rgba(10,100,216,0.35); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%); }
.btn-quicky { background: var(--quicky); color: #1C1C1E; font-weight: 700; box-shadow: 0 10px 30px rgba(255,214,10,0.3), inset 0 1px 1px rgba(255,255,255,0.5); }
.btn-text { height: 48px; color: var(--accent-text); font-size: 17px; display: flex; align-items: center; justify-content: center; }
.btn.busy { opacity: .55; pointer-events: none; }
.bolt { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }

/* dots */
.navdots { position: relative; display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); }
.dot { position: relative; display: block; width: 14px; height: 14px; border-radius: 50%; flex: none; overflow: hidden; }
.s-full { background: var(--t-full); box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), inset 0 -1px 2px rgba(0,0,0,0.25); }
.s-quicky { background: var(--t-quicky); box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), inset 0 -1px 2px rgba(0,0,0,0.25); }
.s-rest { background: var(--t-rest); box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), inset 0 -1px 2px rgba(0,0,0,0.25); }
.s-missed { background: var(--t-missed); box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), inset 0 -1px 2px rgba(0,0,0,0.25); }
.s-future, .s-none { border: 1.5px solid var(--ring); }
.s-today { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text); overflow: visible; }
.s-both { box-shadow: 0 0 10px rgba(94,162,255,0.65); }
.glitter { position: absolute; inset: 0; width: 100%; height: 100%; }
.badge-dot { position: absolute; right: -2px; top: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2.5px var(--bg), 0 0 10px rgba(94,162,255,0.8); }
.pill { padding: 3px 9px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; }

/* home */
.ex { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 12px; border-radius: 16px; }
.ex .name { flex: 1; font-size: 17px; }
.ex.done .name { color: var(--muted); text-decoration: line-through; }
.ex.done .val { color: var(--muted); }
.ex.next .name { color: var(--soft); }
.ex .val { font-size: 15px; color: var(--muted); text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.miss { font-size: 12px; color: var(--quicky-text); }
.check { flex: none; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.check.on { background: var(--t-full); box-shadow: inset 0 1px 1px rgba(255,255,255,0.35); }
.check.off { border: 1.5px solid var(--ring); }
.current { margin: 14px 0 18px; padding: 0 12px; display: flex; flex-direction: column; gap: 18px; }
.current .eyebrow { color: var(--accent-text); letter-spacing: .08em; font-size: 12px; font-weight: 700; }
.current .cname { font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -0.02em; }
.goal { align-self: flex-start; min-height: 44px; margin: -8px 0 -8px -8px; padding: 0 8px; border-radius: 12px; color: var(--sub); font-size: 15px; display: flex; align-items: center; gap: 6px; }
.goal .adj { color: var(--quicky-text); }
.goal svg { transition: transform .25s ease; }
.goal[aria-expanded="true"] svg { transform: rotate(180deg); }
.steppers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stepper { display: flex; flex-direction: column; gap: 8px; }
.stepper .lab { font-size: 12px; font-weight: 600; color: var(--sub); text-align: center; }
.stepper .row { display: flex; align-items: center; justify-content: space-between; }
.stepper .v { font-size: 30px; font-weight: 300; }
.tracker { height: 60px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 36px; color: #fff; background: rgba(10,100,216,0.62); box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), 0 8px 24px rgba(10,100,216,0.35); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%); }
.tracker span { font-size: 22px; line-height: 1; text-decoration-thickness: 2px; }
.tracker .gone { color: rgba(255,255,255,0.45); text-decoration: line-through; }
.tracker .now { font-size: 36px; font-weight: 700; }
.tracker:active { transform: scale(0.98); }

/* completion */
.drift { position: absolute; inset: 0; pointer-events: none; }
.drift .d { position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; overflow: hidden; will-change: transform; }
.streak { position: absolute; left: 40px; right: 40px; top: 28%; display: flex; flex-direction: column; align-items: center; text-shadow: 0 2px 24px rgba(0,0,0,0.6); }
:root[data-theme="light"] .streak { text-shadow: none; }

/* quicky */
.rounds { position: absolute; left: 76px; right: 76px; top: calc(var(--safe-top) + 12px); height: 44px; display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 22px; line-height: 1; pointer-events: none; }
.rounds .gone { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.rounds .now { color: var(--quicky-text); font-size: 34px; font-weight: 700; }
.rounds .later { color: var(--soft); }
.qlist { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0 var(--margin); }
.qrow { flex: none; display: flex; align-items: center; justify-content: space-between; height: 60px; border-bottom: 1px solid var(--line); font-size: 20px; font-weight: 500; transition: height .25s ease; }
.qrow .amt { color: var(--quicky-text); }
.qrow.done span { color: var(--muted); text-decoration: line-through; }
.qrow.later span:first-child { color: var(--soft); }
.qrow.now { height: 92px; font-size: 30px; font-weight: 700; }
.qfill { flex: 1; min-height: 40px; }
.timer { position: absolute; right: 20px; height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--quicky-text); background: rgba(255,214,10,0.22); box-shadow: inset 0 1px 1px rgba(255,255,255,0.3); font-size: 17px; font-weight: 600; }
.flash { position: absolute; inset: 0; z-index: 10; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 42%, rgba(255,255,240,0.95), rgba(255,214,10,0.55) 45%, transparent 80%); animation: flash .7s ease-out forwards; }
.flash-bolt { position: absolute; inset: 0; z-index: 11; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.flash-bolt svg { opacity: 0; animation: bolt .7s ease-out forwards; }
@keyframes flash { 0% { opacity: 0 } 6% { opacity: 1 } 14% { opacity: .25 } 22% { opacity: .9 } 100% { opacity: 0 } }
@keyframes bolt { 0% { opacity: 0; transform: scale(.6) } 8% { opacity: 1; transform: scale(1.15) } 30% { opacity: .9; transform: scale(1) } 100% { opacity: 0; transform: scale(1.4) } }

/* dashboard */
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 6px; justify-items: center; transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .32s ease; }
.cd { position: relative; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 500; color: var(--cal-fg); overflow: hidden; }
.cd span { position: relative; }
.cd.s-full { background: rgba(10,100,216,0.38); } .cd.s-quicky { background: rgba(255,214,10,0.38); } .cd.s-rest { background: rgba(48,209,88,0.38); } .cd.s-missed { background: rgba(209,41,31,0.38); }
.cd.s-future, .cd.s-none { color: var(--muted); border-color: var(--line); }
.cd.s-today { border: 2.5px solid var(--text); box-shadow: 0 0 10px rgba(255,255,255,0.25); overflow: hidden; }
.cd.s-both { color: #fff; }
.toast { position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%); padding: 10px 20px; border-radius: 999px; font-size: 20px; font-weight: 600; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
.toast.on { opacity: 1; }
.stat .k { font-size: 13px; font-weight: 600; color: var(--sub); }
.stat .big { font-size: 52px; line-height: 58px; font-weight: 200; letter-spacing: -0.03em; }
.stat .big small { font-size: 17px; font-weight: 500; color: var(--sub); }
.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.counts .k { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--sub); }
.counts .k i { width: 8px; height: 8px; border-radius: 50%; }
.counts .v { font-size: 34px; font-weight: 300; }
.egg { position: absolute; inset: 0; z-index: 20; pointer-events: none; overflow: hidden; }
.egg span { position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; }

/* lists + settings */
.list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.lrow { min-height: 60px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); font-size: 17px; width: 100%; }
.lrow .grow { flex: 1; }
.lrow .meta { font-size: 15px; color: var(--sub); }
.lrow.danger { color: #FF453A; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 999px; }
.seg button { height: 44px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--sub); display: flex; align-items: center; justify-content: center; gap: 6px; transition: background .25s ease, color .25s ease; }
.seg button[aria-checked="true"] { color: var(--text); background: rgba(255,255,255,0.18); box-shadow: inset 0 1px 1px rgba(255,255,255,0.3); }
:root[data-theme="light"] .seg button[aria-checked="true"] { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
@media (prefers-color-scheme: light) { :root[data-theme="auto"] .seg button[aria-checked="true"] { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.12); } }
.weeks { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.weeks span { height: 8px; border-radius: 4px; background: var(--line); }
.weeks span.on { background: var(--accent); }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 22px; }
.steps li { display: flex; gap: 14px; font-size: 17px; line-height: 24px; }
.steps .n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--t-full); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }

/* login */
.field { height: 60px; width: 100%; padding: 0 20px; border: 0; border-radius: 18px; background: var(--glass); box-shadow: inset 0 1px 1px var(--hi); color: var(--text); font-size: 22px; outline: none; user-select: text; -webkit-user-select: text; }
.field.shake { animation: shake .35s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-8px) } 40%, 80% { transform: translateX(8px) } }

/* states */
.center-state { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 0 32px; text-align: center; }
.err-dot { width: 64px; height: 64px; border-radius: 50%; background: var(--t-missed); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 1px 1px rgba(255,255,255,0.35); }

@media (prefers-reduced-motion: reduce) {
  .flash, .flash-bolt svg { animation-duration: .01s; }
  .cal, .qrow, .btn { transition: none; }
}

/* light mode: solid accent so white text keeps 4.5:1 */
:root[data-theme="light"] .btn-primary, :root[data-theme="light"] .tracker { background: #0A64D8; }
@media (prefers-color-scheme: light) { :root[data-theme="auto"] .btn-primary, :root[data-theme="auto"] .tracker { background: #0A64D8; } }

.red-dot { position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: #FF3B30; box-shadow: 0 0 0 2px var(--bg); }
.field::placeholder { color: var(--muted); opacity: 1; }
