/* ==========================================================================
   IRONLOG — dark athletic design system, mobile first
   ========================================================================== */

:root {
  --bg:        #08090B;
  --bg-grad:   radial-gradient(120% 70% at 50% -10%, #14171D 0%, #08090B 62%);
  --elev:      #101319;
  --surface:   #14181F;
  --surface-2: #1B2029;
  --surface-3: #232935;
  --line:      #262C37;
  --line-soft: #1B2029;

  --txt:   #F2F5F8;
  --txt-2: #9AA3B2;
  --txt-3: #626C7C;

  --lime:      #CBFF3B;
  --lime-deep: #A6D919;
  --lime-glow: rgba(203, 255, 59, .16);
  --orange:    #FF7A18;
  --red:       #FF4D5E;
  --blue:      #4C9AFF;
  --violet:    #A78BFA;
  --green:     #34D399;

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --shadow:    0 8px 28px rgba(0,0,0,.45);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.6);

  --nav-h: 62px;
  --pad: 18px;
  --wrap: 620px;

  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);

  --ease: cubic-bezier(.32, .72, 0, 1);
  color-scheme: dark;
}

/* accent themes for program cards */
.a-lime   { --a: var(--lime);   --a-soft: rgba(203,255,59,.14); }
.a-orange { --a: var(--orange); --a-soft: rgba(255,122,24,.14); }
.a-blue   { --a: var(--blue);   --a-soft: rgba(76,154,255,.14); }
.a-violet { --a: var(--violet); --a-soft: rgba(167,139,250,.14); }
.a-green  { --a: var(--green);  --a-soft: rgba(52,211,153,.14); }
.a-red    { --a: var(--red);    --a-soft: rgba(255,77,94,.14); }

/* ------------------------------------------------------------------ reset */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--txt);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text",
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; touch-action: manipulation; }
a { color: var(--lime); text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 6px; }

::selection { background: var(--lime); color: #0B0D10; }

/* thin scrollbars on desktop */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

/* ------------------------------------------------------------------ shell */

#app { min-height: 100dvh; }

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-h) + var(--sab) + 26px);
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

/* ------------------------------------------------------------------ header */

.hdr {
  position: sticky; top: 0; z-index: 40;
  padding-top: var(--sat);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.hdr.stuck { border-bottom-color: var(--line-soft); }

.hdr-in {
  max-width: var(--wrap); margin: 0 auto;
  padding: 12px var(--pad);
  display: flex; align-items: center; gap: 12px; min-height: 56px;
}

.hdr-title { font-size: 19px; font-weight: 750; letter-spacing: -.02em; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-sub { font-size: 12px; font-weight: 500; color: var(--txt-3); letter-spacing: .01em; }

.icon-btn {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: grid; place-items: center;
  border-radius: 12px; color: var(--txt-2);
  background: var(--surface); border: 1px solid var(--line-soft);
  transition: background .15s, color .15s, transform .1s;
}
.icon-btn:active { transform: scale(.92); background: var(--surface-2); }
.icon-btn.ghost { background: transparent; border-color: transparent; }
.icon-btn.accent { color: var(--lime); }

/* ------------------------------------------------------------------ brand */

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(150deg, var(--lime), var(--lime-deep));
  display: grid; place-items: center; color: #0A0C0F;
  box-shadow: 0 4px 16px var(--lime-glow);
}
.brand-name {
  font-size: 17px; font-weight: 800; letter-spacing: -.03em;
}
.brand-name span { color: var(--lime); }

/* ------------------------------------------------------------------ nav */

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding-bottom: var(--sab);
  background: color-mix(in srgb, #0A0C10 86%, transparent);
  backdrop-filter: saturate(1.5) blur(22px);
  -webkit-backdrop-filter: saturate(1.5) blur(22px);
  border-top: 1px solid var(--line-soft);
}
.nav-in {
  max-width: var(--wrap); margin: 0 auto;
  height: var(--nav-h);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
}
.nav-btn {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--txt-3); font-size: 10px; font-weight: 650; letter-spacing: .02em;
  transition: color .18s;
  position: relative;
}
.nav-btn svg { width: 22px; height: 22px; transition: transform .25s var(--ease); }
.nav-btn.on { color: var(--lime); }
.nav-btn.on svg { transform: translateY(-1px) scale(1.06); }
.nav-btn:active svg { transform: scale(.88); }

.nav-fab { position: relative; }
.nav-fab .fab {
  width: 52px; height: 52px; border-radius: 18px;
  background: linear-gradient(150deg, var(--lime), var(--lime-deep));
  color: #0A0C0F; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(203,255,59,.30), 0 2px 6px rgba(0,0,0,.4);
  transform: translateY(-12px);
  transition: transform .18s var(--ease), box-shadow .18s;
}
.nav-fab .fab svg { width: 26px; height: 26px; }
.nav-fab:active .fab { transform: translateY(-12px) scale(.9); }
.nav-fab.live .fab {
  background: linear-gradient(150deg, var(--orange), #E4560A);
  box-shadow: 0 6px 20px rgba(255,122,24,.35), 0 2px 6px rgba(0,0,0,.4);
  animation: livePulse 2.2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(255,122,24,.30), 0 2px 6px rgba(0,0,0,.4); }
  50%      { box-shadow: 0 6px 30px rgba(255,122,24,.62), 0 2px 6px rgba(0,0,0,.4); }
}

/* ------------------------------------------------------------------ view */

.view { animation: viewIn .32s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.section { margin-top: 26px; }
.section-hd {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px;
}
.section-hd h2 {
  font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase;
  color: var(--txt-3); flex: 1;
}
.section-hd .link { font-size: 13px; font-weight: 600; color: var(--lime); }

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 18px;
}
.card.tight { padding: 14px; }
.card.flush { padding: 0; overflow: hidden; }

.press { transition: transform .12s var(--ease), background .15s; }
.press:active { transform: scale(.978); }

.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--txt-2); }
.dim { color: var(--txt-3); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ------------------------------------------------------------------ hero */

.hero { padding: 8px 0 4px; }
.hero-greet { font-size: 13px; font-weight: 600; color: var(--txt-3); letter-spacing: .02em; }
.hero-title {
  font-size: clamp(30px, 9vw, 40px); font-weight: 800; letter-spacing: -.035em;
  line-height: 1.05; margin-top: 4px;
}
.hero-title em { font-style: normal; color: var(--lime); }

/* streak chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 99px;
  font-size: 12px; font-weight: 700; letter-spacing: .01em;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--txt-2);
}
.chip svg { width: 14px; height: 14px; }
.chip.fire { background: rgba(255,122,24,.12); border-color: rgba(255,122,24,.3); color: var(--orange); }
.chip.lime { background: var(--lime-glow); border-color: rgba(203,255,59,.28); color: var(--lime); }
.chip.sm { padding: 4px 9px; font-size: 11px; }

/* ------------------------------------------------------------------ stats */

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-grid.three { grid-template-columns: repeat(3, 1fr); }
.stat {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 14px;
}
.stat-k { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--txt-3); }
.stat-v { font-size: 26px; font-weight: 800; letter-spacing: -.04em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-v small { font-size: 13px; font-weight: 650; color: var(--txt-3); margin-left: 3px; letter-spacing: 0; }
.stat.hi { background: linear-gradient(160deg, rgba(203,255,59,.10), transparent 70%); border-color: rgba(203,255,59,.22); }
.stat.hi .stat-v { color: var(--lime); }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px; border-radius: 16px;
  font-size: 16px; font-weight: 700; letter-spacing: -.01em;
  background: var(--surface-2); color: var(--txt);
  border: 1px solid var(--line);
  transition: transform .12s var(--ease), filter .15s, background .15s, opacity .15s;
  width: 100%;
}
.btn:active { transform: scale(.975); }
.btn svg { width: 19px; height: 19px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.btn.primary {
  background: linear-gradient(150deg, var(--lime), var(--lime-deep));
  color: #0A0C0F; border-color: transparent;
  box-shadow: 0 6px 22px rgba(203,255,59,.22);
}
.btn.primary:active { filter: brightness(.94); }
.btn.danger  { background: rgba(255,77,94,.12); color: var(--red); border-color: rgba(255,77,94,.28); }
.btn.warm    { background: linear-gradient(150deg, var(--orange), #E4560A); color: #fff; border-color: transparent;
               box-shadow: 0 6px 22px rgba(255,122,24,.25); }
.btn.ghost   { background: transparent; border-color: var(--line); }
.btn.sm      { height: 42px; font-size: 14px; padding: 0 16px; border-radius: 13px; }
.btn.auto    { width: auto; }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ------------------------------------------------------------------ forms */

.field { display: grid; gap: 7px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--txt-3); }
.input {
  width: 100%; height: 54px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; font-size: 16px; font-weight: 600;
  transition: border-color .18s, background .18s;
}
.input:focus { outline: none; border-color: var(--lime); background: var(--surface-2); }
.input::placeholder { color: var(--txt-3); font-weight: 500; }
textarea.input { height: auto; min-height: 96px; padding: 14px 16px; line-height: 1.5; resize: vertical; }
select.input { appearance: none; background-image:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239AA3B2' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 42px; }

.hint { font-size: 12.5px; color: var(--txt-3); line-height: 1.5; }

.alert {
  padding: 12px 14px; border-radius: 13px; font-size: 14px; font-weight: 600; line-height: 1.45;
  background: rgba(255,77,94,.11); border: 1px solid rgba(255,77,94,.28); color: #FF8A96;
  animation: shake .35s;
}
.alert.ok { background: rgba(52,211,153,.11); border-color: rgba(52,211,153,.28); color: var(--green); animation: none; }
@keyframes shake {
  0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); }
}

/* PIN pad ---------------------------------------------------------------- */

.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 6px 0 4px; }
.pin-dot {
  width: 15px; height: 15px; border-radius: 50%;
  background: transparent; border: 2px solid var(--line);
  transition: all .18s var(--ease);
}
.pin-dot.on { background: var(--lime); border-color: var(--lime); transform: scale(1.12);
  box-shadow: 0 0 14px var(--lime-glow); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 6px; }
.key {
  height: 62px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line-soft);
  font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums;
  display: grid; place-items: center;
  transition: transform .1s var(--ease), background .12s;
}
.key:active { transform: scale(.92); background: var(--surface-3); }
.key.util { font-size: 15px; font-weight: 700; color: var(--txt-2); background: transparent; border-color: transparent; }
.key.util svg { width: 24px; height: 24px; }

/* recovery key display --------------------------------------------------- */

.reckey {
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px;
  padding: 16px; border-radius: var(--r);
  background: linear-gradient(155deg, rgba(203,255,59,.09), transparent 75%);
  border: 1px dashed rgba(203,255,59,.35);
}
.reckey-word {
  background: var(--surface-2); border-radius: 11px; padding: 11px 8px;
  text-align: center; font-size: 15px; font-weight: 800; letter-spacing: .06em;
  color: var(--lime); font-variant-numeric: tabular-nums;
}
.reckey-word b { display: block; font-size: 9px; color: var(--txt-3); letter-spacing: .1em; font-weight: 700; margin-bottom: 2px; }

/* ------------------------------------------------------------------ list rows */

.rows { display: grid; gap: 8px; }
.rw {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line-soft);
  text-align: left; width: 100%;
}
.rw-ic {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--txt-2);
}
.rw-ic svg { width: 19px; height: 19px; }
.rw-t { font-size: 15px; font-weight: 680; letter-spacing: -.01em; }
.rw-s { font-size: 12.5px; color: var(--txt-3); margin-top: 1px; }
.rw-chev { color: var(--txt-3); flex: 0 0 auto; }
.rw-chev svg { width: 18px; height: 18px; }

/* muscle colours */
.m-chest    { background: rgba(255,77,94,.14);   color: #FF7A86; }
.m-back     { background: rgba(76,154,255,.14);  color: #7FB6FF; }
.m-legs     { background: rgba(167,139,250,.14); color: #BCA6FF; }
.m-shoulders{ background: rgba(255,122,24,.14);  color: #FFA05C; }
.m-arms     { background: rgba(52,211,153,.14);  color: #5FE0B4; }
.m-core     { background: rgba(203,255,59,.14);  color: var(--lime); }
.m-cardio   { background: rgba(236,72,153,.14);  color: #F472B6; }
.m-fullbody { background: rgba(148,163,184,.14); color: #C3CCD9; }

/* ------------------------------------------------------------------ program cards */

.prog {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 18px;
  background: var(--surface); border: 1px solid var(--line-soft);
  text-align: left; width: 100%; display: block;
}
.prog::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(90% 120% at 100% 0%, var(--a-soft), transparent 62%);
  pointer-events: none;
}
.prog-top { display: flex; align-items: center; gap: 10px; position: relative; }
.prog-bar { width: 4px; height: 34px; border-radius: 99px; background: var(--a); flex: 0 0 4px; }
.prog-name { font-size: 18px; font-weight: 780; letter-spacing: -.025em; }
.prog-sub { font-size: 12.5px; color: var(--txt-3); margin-top: 1px; }
.prog-meta { display: flex; gap: 7px; margin-top: 14px; flex-wrap: wrap; position: relative; }
.prog-desc { font-size: 13.5px; color: var(--txt-2); line-height: 1.55; margin-top: 12px; position: relative; }
.prog.active-prog { border-color: var(--a); }

.badge {
  font-size: 10.5px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 8px;
  background: var(--surface-2); color: var(--txt-2); border: 1px solid var(--line);
}
.badge.a { background: var(--a-soft); color: var(--a); border-color: color-mix(in srgb, var(--a) 30%, transparent); }

/* ------------------------------------------------------------------ workout logger */

.ex-block {
  border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--line-soft); overflow: hidden;
}
.ex-hd { display: flex; align-items: center; gap: 12px; padding: 15px 16px 13px; }
.ex-name { font-size: 16px; font-weight: 730; letter-spacing: -.02em; }
.ex-note { font-size: 12px; color: var(--txt-3); margin-top: 2px; }

.set-head, .set-row {
  display: grid; grid-template-columns: 34px 1fr 1fr 46px;
  gap: 8px; align-items: center; padding: 0 16px;
}
.set-head {
  font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase;
  color: var(--txt-3); padding-bottom: 7px;
}
.set-head span:nth-child(2), .set-head span:nth-child(3) { text-align: center; }
.set-head span:last-child { text-align: center; }

.set-row { padding-top: 5px; padding-bottom: 5px; }
.set-row.done .set-in { background: rgba(203,255,59,.07); border-color: rgba(203,255,59,.22); }
.set-n {
  height: 44px; display: grid; place-items: center; border-radius: 11px;
  background: var(--surface-2); font-size: 14px; font-weight: 750; color: var(--txt-2);
  font-variant-numeric: tabular-nums;
}
.set-n.warm { background: rgba(255,122,24,.13); color: var(--orange); font-size: 12px; }
.set-in {
  height: 44px; width: 100%; text-align: center;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 11px;
  font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: border-color .15s, background .15s;
}
.set-in:focus { outline: none; border-color: var(--lime); background: var(--surface-3); }
.set-in::placeholder { color: var(--txt-3); font-weight: 500; font-size: 15px; }
.set-in::-webkit-outer-spin-button, .set-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.set-in[type=number] { -moz-appearance: textfield; }

.set-check {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--txt-3);
  transition: all .16s var(--ease);
}
.set-check svg { width: 20px; height: 20px; }
.set-check.on {
  background: linear-gradient(150deg, var(--lime), var(--lime-deep)); color: #0A0C0F;
  border-color: transparent; transform: scale(1.02);
  box-shadow: 0 3px 12px var(--lime-glow);
}
.set-check:active { transform: scale(.9); }

.ex-actions { display: flex; gap: 8px; padding: 12px 16px 15px; }
.mini {
  flex: 1; height: 38px; border-radius: 11px; font-size: 13px; font-weight: 680;
  background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--txt-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .1s var(--ease);
}
.mini:active { transform: scale(.95); }
.mini svg { width: 15px; height: 15px; }
.mini.danger { color: var(--red); }

/* live workout banner ---------------------------------------------------- */

.live-bar {
  position: fixed; left: 0; right: 0; z-index: 45;
  bottom: calc(var(--nav-h) + var(--sab));
  padding: 0 var(--pad) 10px;
  pointer-events: none;
}
.live-bar-in {
  max-width: var(--wrap); margin: 0 auto; pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 16px;
  background: linear-gradient(120deg, #2A1B08, #1A1206);
  border: 1px solid rgba(255,122,24,.35);
  box-shadow: var(--shadow);
}
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); flex: 0 0 9px;
  animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ------------------------------------------------------------------ rest timer */

.rest {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in srgb, #05060880 60%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: grid; place-items: center; padding: var(--pad);
  animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.rest-card {
  width: 100%; max-width: 380px; text-align: center;
  background: var(--elev); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 28px 22px calc(22px + var(--sab));
  box-shadow: var(--shadow-lg);
  animation: popIn .3s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: scale(.92) translateY(14px); } to { opacity: 1; transform: none; } }

.ring-wrap { position: relative; width: 210px; height: 210px; margin: 6px auto 18px; }
.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; }
.ring .track { stroke: var(--surface-2); }
.ring .fill { stroke: var(--lime); transition: stroke-dashoffset .95s linear, stroke .3s; }
.ring.warn .fill { stroke: var(--orange); }
.ring-mid {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 2px;
}
.ring-time { font-size: 52px; font-weight: 800; letter-spacing: -.05em; font-variant-numeric: tabular-nums; line-height: 1; }
.ring-lbl { font-size: 11px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; color: var(--txt-3); }

.rest-adj { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }

/* interval timer --------------------------------------------------------- */

.big-time {
  font-size: clamp(64px, 22vw, 96px); font-weight: 800; letter-spacing: -.06em;
  font-variant-numeric: tabular-nums; line-height: 1; text-align: center;
}
.phase-pill {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 auto;
  padding: 8px 18px; border-radius: 99px; font-size: 13px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase;
}
.phase-work { background: rgba(255,77,94,.16); color: var(--red); border: 1px solid rgba(255,77,94,.35); }
.phase-rest { background: rgba(52,211,153,.14); color: var(--green); border: 1px solid rgba(52,211,153,.32); }
.phase-idle { background: var(--surface-2); color: var(--txt-2); border: 1px solid var(--line); }
.timer-stage {
  border-radius: var(--r-xl); padding: 30px 20px;
  background: var(--surface); border: 1px solid var(--line-soft);
  display: grid; gap: 16px; justify-items: center;
  transition: background .4s, border-color .4s;
}
.timer-stage.work { background: linear-gradient(165deg, rgba(255,77,94,.13), var(--surface) 65%); border-color: rgba(255,77,94,.3); }
.timer-stage.rest { background: linear-gradient(165deg, rgba(52,211,153,.12), var(--surface) 65%); border-color: rgba(52,211,153,.28); }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--line-soft); display: grid; place-items: center; color: var(--txt-2);
  font-size: 22px; font-weight: 700;
}
.stepper button:active { transform: scale(.9); }
.stepper .val { min-width: 72px; text-align: center; font-size: 22px; font-weight: 780;
  font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ charts */

.chart { width: 100%; height: 160px; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .bar { fill: var(--surface-3); transition: fill .2s; }
.chart .bar.hi { fill: url(#limeGrad); }
.chart .lbl { fill: var(--txt-3); font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.chart .dot { fill: var(--lime); }
.chart .line { fill: none; stroke: var(--lime); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: url(#areaGrad); }

.split-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.split-bar i { display: block; height: 100%; }
.split-key { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px; }
.split-key span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--txt-2); font-weight: 600; }
.split-key i { width: 9px; height: 9px; border-radius: 3px; }

/* ------------------------------------------------------------------ sheet */

.sheet-bg {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(4,5,7,.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .18s;
}
.sheet {
  width: 100%; max-width: var(--wrap);
  max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--elev); border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding-bottom: var(--sab);
  animation: sheetUp .34s var(--ease);
  box-shadow: var(--shadow-lg);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grab { width: 40px; height: 4px; border-radius: 99px; background: var(--surface-3); margin: 10px auto 4px; flex: 0 0 auto; }
.sheet-hd { padding: 8px var(--pad) 12px; display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.sheet-hd h3 { font-size: 18px; font-weight: 780; letter-spacing: -.025em; flex: 1; }
.sheet-body { overflow-y: auto; padding: 0 var(--pad) 22px; }

/* toast ------------------------------------------------------------------ */

.toasts {
  position: fixed; left: 0; right: 0; z-index: 100;
  top: calc(var(--sat) + 68px);
  display: grid; gap: 8px; justify-items: center; pointer-events: none; padding: 0 var(--pad);
}
.toast {
  max-width: 440px; width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 15px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 14px; font-weight: 650; box-shadow: var(--shadow);
  animation: toastIn .3s var(--ease);
}
/* The tint is layered over an opaque base so page content never shows through. */
.toast.win { background: linear-gradient(120deg, rgba(203,255,59,.16), transparent) var(--surface-2);
             border-color: rgba(203,255,59,.35); color: #E6FF9B; }
.toast.err { background: linear-gradient(120deg, rgba(255,77,94,.16), transparent) var(--surface-2);
             border-color: rgba(255,77,94,.35); color: #FFB3BA; }
.toast.out { animation: toastOut .25s var(--ease) forwards; }
.toast svg { width: 18px; height: 18px; flex: 0 0 18px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px) scale(.97); } }

/* ------------------------------------------------------------------ misc */

.empty {
  text-align: center; padding: 46px 20px;
  display: grid; gap: 8px; justify-items: center;
}
.empty-ic {
  width: 62px; height: 62px; border-radius: 20px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-soft); color: var(--txt-3); margin-bottom: 4px;
}
.empty-ic svg { width: 27px; height: 27px; }
.empty h3 { font-size: 17px; font-weight: 730; letter-spacing: -.02em; }
.empty p { font-size: 14px; color: var(--txt-3); max-width: 300px; line-height: 1.55; }

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 300% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r);
}
@keyframes shimmer { to { background-position: -300% 0; } }

.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }

.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--txt-3); pointer-events: none; }
.search-wrap .input { padding-left: 44px; }

.pill-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px var(--pad) 2px;
  margin: 0 calc(var(--pad) * -1); scrollbar-width: none;
}
.pill-scroll::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 99px;
  font-size: 13px; font-weight: 680; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line-soft); color: var(--txt-2);
  transition: all .16s;
}
.pill.on { background: var(--lime); color: #0A0C0F; border-color: transparent; }
.pill:active { transform: scale(.94); }

.prose { font-size: 14.5px; line-height: 1.65; color: var(--txt-2); }
.prose strong { color: var(--txt); font-weight: 680; }

/* ------------------------------------------------------------------ auth screen */

.auth {
  min-height: 100dvh; display: grid; grid-template-rows: 1fr auto;
  padding: calc(var(--sat) + 20px) var(--pad) calc(var(--sab) + 20px);
}
.auth-in { width: 100%; max-width: 400px; margin: 0 auto; align-self: center; }
.auth-logo {
  width: 60px; height: 60px; border-radius: 19px; margin: 0 auto 20px;
  background: linear-gradient(150deg, var(--lime), var(--lime-deep));
  display: grid; place-items: center; color: #0A0C0F;
  box-shadow: 0 10px 32px rgba(203,255,59,.24);
}
.auth-logo svg { width: 30px; height: 30px; }
.auth h1 { font-size: 30px; font-weight: 800; letter-spacing: -.04em; text-align: center; line-height: 1.12; }
.auth .sub { text-align: center; color: var(--txt-3); font-size: 14.5px; margin-top: 8px; line-height: 1.5; }
.auth-foot { text-align: center; font-size: 14px; color: var(--txt-3); }
.auth-foot button { color: var(--lime); font-weight: 700; }

/* ------------------------------------------------------------------ desktop */

@media (min-width: 720px) {
  :root { --pad: 24px; --nav-h: 66px; }
  .nav { border-radius: 0; }
  .hero-title { font-size: 38px; }
  .stat-grid { gap: 12px; }
}

@media (min-width: 1000px) {
  body::before {
    content: ''; position: fixed; inset: 0; pointer-events: none;
    background: radial-gradient(60% 50% at 50% 0%, rgba(203,255,59,.045), transparent 70%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; }
}
