/*
 * TrickTic Timer demo: styles.
 * Inside the phone, 1 CSS px is 1 dp of the app at its 412 x 824 dp phone
 * layout, and colours, radii and type sizes are the app's own (TimerTheme.kt,
 * WorkoutDesign.kt). Outside the phone is the site: canvas #04070d.
 */

:root {
  /* Site palette (outside the phone). */
  --site-canvas: #04070d;
  --site-ink: #edf2f7;
  --site-muted: #c2cbd6;
  --site-brand: #75d3ff;

  /* The app's dark "Aperture" palette. */
  --bg: #06080b;
  --surface: #10151b;
  --raised: #19212a;
  --high: #222c36;
  --line: #2b3742;
  --line-soft: #1e2730;
  --emerald: #2ee6a6;
  --emerald-deep: #0e4a38;
  --on-emerald: #03231a;
  --amber: #f2c879;
  --on-amber: #2a1d05;
  --alarm: #ff6b6b;
  --on-alarm: #2a0a0a;
  --sky: #5fb3f0;
  --record: #b69cff;
  --ink: #eef4f2;
  --muted: #8693a1;
  /* The app's faint is #5c6976; text in the demo uses a lighter one to hold AA contrast. */
  --faint: #5c6976;
  --faint-text: #7d8a97;

  --font: Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-condensed: "Roboto Condensed", "Arial Narrow", "Helvetica Neue Condensed", Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

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

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--site-canvas);
  color-scheme: dark;
}

body {
  font-family: var(--font);
  color: var(--site-ink);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- Stage (the box the demo is shown in) ---------- */

.stage { position: fixed; inset: 0; overflow: hidden; }

.glow {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--pw, 400px) * 2.6); height: calc(var(--ph, 800px) * 1.15);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(117, 211, 255, 0.13), rgba(117, 211, 255, 0.045) 55%, rgba(117, 211, 255, 0) 100%);
  pointer-events: none;
}

.phone {
  position: absolute; left: 50%; top: 50%;
  width: 436px; height: 848px; padding: 12px;
  border-radius: 48px;
  background: #0a0e13;
  box-shadow: 0 0 0 1px #27313b, inset 0 0 0 2px #05070a, 0 30px 70px -24px rgba(0, 0, 0, 0.85);
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  transform-origin: 50% 50%;
  visibility: hidden;
}
.stage.is-laid .phone { visibility: visible; }

.caption {
  position: absolute; top: 50%;
  right: calc(50% + var(--pw, 400px) / 2 + var(--cgap, 40px));
  width: var(--cw, 260px);
  transform: translateY(-50%);
  display: none;
}
.stage.has-caption .caption { display: block; }
.caption__eyebrow { margin: 0 0 10px; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--site-brand); }
.caption__title { margin: 0 0 10px; font-size: clamp(20px, 2.3vw, 28px); line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; color: var(--site-ink); }
.caption__text { margin: 0; font-size: clamp(14px, 1.3vw, 16px); line-height: 1.5; color: var(--site-muted); }
.caption__note { margin: 14px 0 0; font-size: 13px; line-height: 1.4; color: var(--site-muted); opacity: 0.85; }

/* ---------- The app screen ---------- */

.screen {
  position: relative; width: 412px; height: 824px; overflow: hidden;
  border-radius: 36px;
  background: var(--bg); color: var(--ink);
  font: 400 14px/24px var(--font);
  letter-spacing: 0.5px;
  user-select: none; -webkit-user-select: none;
}
.screen [hidden] { display: none !important; }

:where(.screen) button {
  font: inherit; letter-spacing: inherit; color: inherit; text-align: inherit;
  background: none; border: 0; margin: 0; padding: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
:where(.screen) button:disabled { cursor: default; }
:where(.screen) input, :where(.screen) textarea { font: inherit; letter-spacing: inherit; color: var(--ink); user-select: text; -webkit-user-select: text; }
.screen :focus { outline: none; }
.screen :focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; }
:where(.screen) :where(h1, h2, h3, p, ul) { margin: 0; padding: 0; font: inherit; letter-spacing: inherit; }
:where(.screen) ul { list-style: none; }
.ic { display: block; flex: none; }

.tabs, .page { position: absolute; inset: 0; display: flex; flex-direction: column; }
.page { background: var(--bg); }

.scroll { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.scroll::-webkit-scrollbar, .hscroll::-webkit-scrollbar { display: none; }
.hscroll { display: flex; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; cursor: grab; }
.hscroll.is-dragging { cursor: grabbing; }
.hscroll > * { flex: none; }

.content { flex: 1; min-height: 0; padding: 2px 16px 24px; }

/*
 * Text helpers. Text the app styles explicitly (overlines, titles, numbers, clocks) has the
 * font's own line height; everything else sits on Material's 24 dp body line with 0.5 tracking.
 */
.cut { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.overline { line-height: 1.172; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.num { line-height: 1.172; font-weight: 900; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.clock { line-height: 1.172; font-family: var(--font-condensed); font-weight: 700; letter-spacing: -2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.squeeze .clock { display: inline-block; transform: scaleX(0.84); }
.muted { color: var(--muted); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }

/* ---------- Bottom navigation (Material 3 NavigationBar) ---------- */

.nav { flex: none; display: flex; height: 81px; border-top: 1px solid var(--line); background: var(--surface); }
.nav__item { flex: 1; display: flex; flex-direction: column; align-items: center; padding-top: 12px; gap: 4px; color: var(--muted); }
.nav__pill { display: flex; align-items: center; justify-content: center; width: 64px; height: 32px; border-radius: 16px; transition: background-color 0.15s; }
.nav__label { font-size: 12px; line-height: 16px; font-weight: 500; }
.nav__item[aria-current="page"] { color: var(--ink); }
.nav__item[aria-current="page"] .nav__pill { background: rgba(46, 230, 166, 0.16); color: var(--emerald); }
.nav__item[aria-current="page"] .nav__label { font-weight: 700; }
.screen .nav__item:focus-visible { outline-offset: -6px; border-radius: 16px; }

/* ---------- Shared pieces ---------- */

.header { display: flex; align-items: center; padding-top: 6px; }
.header__title { line-height: 1.172; font-size: 30px; font-weight: 900; letter-spacing: -0.8px; }
.header__actions { display: flex; align-items: center; gap: 8px; }

.cbtn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid transparent; color: var(--ink); }
.screen .cbtn.tonal { background: var(--raised); border-color: var(--line); }
.cbtn.s40 { width: 40px; height: 40px; }
.cbtn.s36 { width: 36px; height: 36px; }
.cbtn.s56 { width: 56px; height: 56px; }
.cbtn.s64 { width: 64px; height: 64px; }
.cbtn.txt { font-size: 14px; font-weight: 800; }
.screen .cbtn:disabled { color: var(--faint); }

.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 6px 20px; border-radius: 999px; border: 1px solid transparent; font-size: 15px; font-weight: 800; white-space: nowrap; min-width: 0; transition: transform 0.1s; }
.screen .pill { border: 1px solid transparent; }
.pill:active { transform: scale(0.97); }
.pill > span { overflow: hidden; text-overflow: ellipsis; }
.pill.lg { min-height: 64px; font-size: 19px; }
.pill.sm { min-height: 36px; font-size: 13px; padding: 6px 12px; }
.screen .pill.primary { background: var(--emerald); color: var(--on-emerald); }
.screen .pill.amber { background: var(--amber); color: var(--on-amber); }
.screen .pill.alarm { background: var(--alarm); color: var(--on-alarm); }
.screen .pill.tonal { background: var(--raised); border-color: var(--line); color: var(--ink); }
.screen .pill.ghost { border-color: var(--line); color: var(--ink); }
.screen .pill.text { color: var(--emerald); padding: 6px 10px; }
.screen .pill.danger { color: var(--alarm); }
.screen .pill:disabled { color: var(--faint-text); }
.screen .pill.primary:disabled { background: rgba(46, 230, 166, 0.35); color: var(--on-emerald); }
.pill.block { display: flex; width: 100%; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; }

.section { display: flex; align-items: center; padding: 22px 0 10px; }
.section .overline { flex: 1; }
.section__action { color: var(--emerald); font-size: 13px; font-weight: 700; padding: 4px 6px; border-radius: 8px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 7px; font-size: 11px; font-weight: 800; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }

.stat { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 12px 14px; }
.stat__value { font-size: 22px; }
.stat.big .stat__value { font-size: 30px; }
.stat__label { display: flex; align-items: center; gap: 5px; padding-top: 6px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }

.glyph { display: flex; align-items: center; justify-content: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }

.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.screen .chip { border: 1px solid var(--line); }
.screen .chip[aria-pressed="true"] { --c: var(--emerald); color: var(--cc, var(--emerald)); border-color: var(--cc, var(--emerald)); background: color-mix(in srgb, var(--cc, var(--emerald)) 16%, transparent); }

.seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); }
.seg__opt { flex: 1; min-height: 34px; padding: 0 10px; border-radius: 999px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.screen .seg__opt { text-align: center; }
.seg__opt[aria-pressed="true"] { background: var(--surface); color: var(--ink); }

.hair { height: 1px; background: var(--line-soft); }

/* Workout fingerprint: one tick per set, grouped by exercise. */
.fp { display: flex; gap: 6px; height: 18px; }
.fp__g { display: flex; gap: 2px; min-width: 0; }
.fp__t { flex: 1; border-radius: 3px; background: var(--c); }
.fp__t.p { background: color-mix(in srgb, var(--c) 28%, transparent); }
.fp__t.s { background: rgba(134, 147, 161, 0.16); }
.fp__t.c { box-shadow: 0 0 0 1.25px var(--bg), 0 0 0 2.75px var(--c); }
.fp.fp--mini { height: 9px; gap: 4px; }
.fp.fp--mini .fp__t { border-radius: 3px; }

/* Rings and dials */
.dial { position: relative; display: flex; align-items: center; justify-content: center; flex: none; }
.dial > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dial__arc { transition: stroke-dashoffset 0.25s linear; }
.dial__in { position: relative; display: flex; flex-direction: column; align-items: center; }
.tick { stroke: var(--line); stroke-linecap: round; }
.tick.lit { stroke: var(--c); opacity: 0.9; }

/* ---------- Train ---------- */

.hero { margin-top: 8px; padding: 18px; border-radius: 26px; border: 1px solid var(--line);
  background: radial-gradient(circle closest-corner at 50% 50%, rgba(46, 230, 166, 0.16), rgba(46, 230, 166, 0.05) 60%, rgba(46, 230, 166, 0) 100%), var(--surface); }
.hero__name { font-size: 38px; line-height: 40px; font-weight: 900; letter-spacing: -1.3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-bottom: 2px; }
.hero__line { display: flex; padding: 3px 0; font-size: 14px; }
.hero__line span:last-child { line-height: 1.172; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0; white-space: nowrap; padding-left: 12px; }

.resume { margin-top: 8px; padding: 16px; border-radius: 26px; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: radial-gradient(circle closest-corner at 50% 50%, color-mix(in srgb, var(--c) 16%, transparent), color-mix(in srgb, var(--c) 5%, transparent) 60%, transparent 100%), var(--surface); }

.week { display: flex; justify-content: space-between; }
.week__day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--faint-text); }
.week__dot { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); }
.week__day.done { color: var(--muted); }
.week__day.done .week__dot { background: var(--emerald); border-color: var(--emerald); color: var(--on-emerald); }
.week__day.today { color: var(--ink); }
.week__day.today:not(.done) .week__dot { border: 2px solid var(--emerald); color: var(--emerald); }

.routine { display: flex; align-items: center; gap: 12px; min-height: 72px; margin-bottom: 8px; padding: 12px 10px 12px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.routine__name { font-size: 17px; font-weight: 700; }
.routine__meta { padding-top: 4px; font-size: 12px; color: var(--muted); }
.playbtn { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--emerald); color: var(--on-emerald); }
.playbtn.s52 { width: 52px; height: 52px; }
.screen .playbtn:disabled { background: var(--raised); color: var(--faint); }

/* ---------- Progress ---------- */

.cal__nav { display: flex; align-items: center; }
.cal__title { flex: 1; text-align: center; font-size: 18px; font-weight: 800; }
.cal__dow { display: flex; padding-top: 10px; }
.cal__dow span { flex: 1; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.cal__row { display: flex; padding-top: 6px; }
.cal__cell { position: relative; flex: 1; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.cal__day { display: flex; align-items: center; justify-content: center; width: 80%; height: 80%; border-radius: 50%; font-size: 14px; font-weight: 500; }
.cal__day.off { color: var(--faint-text); }
.cal__day.on { background: var(--c); color: var(--bg); font-weight: 900; }
.cal__day.today { border: 2px solid var(--emerald); font-weight: 900; }
.cal__star { position: absolute; top: 0; right: 0; color: var(--record); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; padding-top: 10px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }

.total { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; }
.total__value { font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.total__label { display: flex; padding-top: 4px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.total__label b { font-weight: 700; color: var(--emerald); padding-left: 5px; }

.year { display: flex; align-items: flex-end; gap: 6px; height: 126px; margin-top: 14px; }
.year__col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; line-height: 16px; color: var(--muted); }
.year__col b { font-size: 10px; font-weight: 700; }
.year__bar { width: 100%; border-radius: 5px; background: var(--line-soft); margin-bottom: 4px; }

.rtile { width: 170px; background: var(--surface); border: 1px solid rgba(182, 156, 255, 0.45); border-radius: 20px; padding: 16px; display: block; }
.screen .rtile { border: 1px solid rgba(182, 156, 255, 0.45); }
.rrow { display: flex; align-items: center; width: 100%; padding: 10px 4px; border-radius: 14px; }

.session { display: flex; align-items: flex-start; padding: 12px 0; }
.session__date { width: 52px; flex: none; text-align: center; }
.session__day { font-size: 22px; font-weight: 900; }
.session__name { font-size: 18px; font-weight: 800; }

/* ---------- Exercises ---------- */

.search { display: flex; align-items: center; margin-top: 14px; padding: 13px 16px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); }
.search:focus-within { border-color: var(--emerald); }
.search input { flex: 1; min-width: 0; margin-left: 10px; padding: 0; border: 0; background: none; font-size: 17px; line-height: 24px; caret-color: var(--emerald); }
.screen .search input:focus-visible { outline: none; }
.search input::placeholder, .field::placeholder { color: var(--faint-text); opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }

.exrow { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 4px; border-radius: 14px; }
.exrow__name { font-size: 18px; font-weight: 800; }
.exrow__best { text-align: right; flex: none; }
.screen .exrow__best { text-align: right; }
.fab { position: absolute; right: 16px; bottom: 93px; }

.hist { display: flex; align-items: center; padding: 12px 0; }
.hist__date { width: 96px; flex: none; color: var(--muted); }
.hist__sets { flex: 1; text-align: right; font-size: 15px; font-weight: 500; }

/* ---------- Timers ---------- */

.msg { margin-top: 12px; padding: 12px; border-radius: 12px; background: rgba(46, 230, 166, 0.1); color: var(--emerald); font-weight: 500; }
.tgrid { display: flex; flex-wrap: wrap; gap: 12px; }
.tcard { width: calc(50% - 6px); display: flex; flex-direction: column; align-items: center; border-radius: 24px; }
.tcard.ringing, .trow.ringing { border-color: rgba(255, 107, 107, 0.6); animation: ring-pulse 1.3s ease-in-out infinite; }
.tcard__label { max-width: 100%; padding-top: 10px; font-size: 17px; font-weight: 800; text-align: center; }
.tcard__sub { font-size: 13px; color: var(--muted); white-space: nowrap; }
.ringing .tcard__sub { color: var(--alarm); }
.tcard__ctl { display: flex; gap: 8px; padding-top: 10px; }
.trow { width: 100%; display: flex; align-items: center; gap: 14px; border-radius: 24px; }
@keyframes ring-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); } 50% { box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.22); } }

.quick { display: block; padding: 12px 16px; border-radius: 16px; background: var(--raised); border: 1px solid var(--line); }
.screen .quick { border: 1px solid var(--line); }
.quick__time { font-size: 20px; }
.quick__label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.preset { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.preset__icon { display: flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--raised); color: var(--sky); }

/* ---------- Live workout ---------- */

.player { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 0 16px;
  background: radial-gradient(circle 593px at 50% -6%, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 7%, transparent) 55%, transparent 100%), var(--bg); }
.player.breathe::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle 593px at 50% -6%, rgba(255, 107, 107, 0.2), transparent 70%); animation: breathe 0.65s ease-in-out infinite alternate; }
@keyframes breathe { from { opacity: 0.1; } to { opacity: 1; } }
.player > * { position: relative; }
.phead { display: flex; align-items: center; padding-top: 6px; }
.phead__mid { flex: 1; min-width: 0; text-align: center; }
.phead__name { font-size: 19px; font-weight: 800; }
.phead__sub { line-height: 1.172; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.pfocus { flex: 1; min-height: 0; padding-top: 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.pctl { display: flex; flex-direction: column; gap: 10px; padding: 8px 0 12px; }
.ex-title { padding-top: 6px; font-size: 32px; line-height: 36px; font-weight: 900; letter-spacing: -0.8px; }
.hint { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }

.stepper { flex: 1; min-width: 0; display: flex; align-items: center; padding: 8px; border-radius: 22px; background: var(--raised); border: 1px solid var(--line); }
.stepper__btn { display: flex; align-items: center; justify-content: center; flex: none; width: 52px; height: 52px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.screen .stepper__btn { border: 1px solid var(--line); background: var(--surface); }
.stepper.compact .stepper__btn { width: 40px; height: 40px; }
.stepper__mid { flex: 1; min-width: 0; text-align: center; }
.stepper__val { font-size: 38px; }
.stepper.compact .stepper__val { font-size: 26px; }
.stepper__unit { font-size: 10px; }

.setrow { display: flex; align-items: center; min-height: 52px; padding: 0 16px; border-radius: 16px; border: 1px solid transparent; }
.setrow + .setrow { margin-top: 4px; }
.setrow__n { width: 30px; font-weight: 700; color: var(--muted); }
.setrow__v { flex: 1; font-size: 17px; font-weight: 500; color: var(--faint-text); }
.setrow.done .setrow__v { color: var(--ink); }
.setrow.cur { background: rgba(46, 230, 166, 0.08); border-color: rgba(46, 230, 166, 0.6); }
.setrow.cur .setrow__v { color: var(--ink); font-weight: 800; }
.setrow__meta { font-size: 13px; color: var(--muted); padding-right: 10px; }
.setrow .ic { color: var(--faint); }
.setrow.done .ic, .setrow.cur .ic { color: var(--emerald); }

.upnext { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; border: 1px solid var(--line); }
.nextcard { border-radius: 22px; border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.logged { display: flex; align-items: center; padding: 4px 4px 4px 14px; border-radius: 16px; background: var(--raised); }

/* ---------- Summary ---------- */

.sumtop { display: flex; align-items: center; padding: 6px 12px; }
.sumlist { flex: 1; min-height: 0; padding: 0 20px 16px; }
.sumlist > * + * { margin-top: 10px; }
.sumbar { display: flex; gap: 10px; padding: 12px 20px; }
.burst { display: block; margin: 0 auto; overflow: visible; }
.burst .ray { animation: ray 0.52s cubic-bezier(0.4, 0, 0.2, 1) both; }
.burst .disc { transform-origin: 75px 75px; animation: pop 0.52s cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes ray { from { stroke-dashoffset: 18; opacity: 0; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes pop { from { transform: scale(0.7); } to { transform: scale(1); } }
.sum-title { padding-top: 6px; font-size: 36px; line-height: 40px; font-weight: 900; letter-spacing: -1.3px; text-align: center; }
.reccard { display: flex; align-items: center; gap: 14px; border-radius: 20px; border-color: rgba(182, 156, 255, 0.5); background: color-mix(in srgb, var(--record) 8%, var(--surface)); }
.feel { display: flex; gap: 8px; }
.feel__opt { flex: 1; min-width: 0; padding: 12px 0; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.screen .feel__opt { text-align: center; border: 1px solid var(--line); }
.feel__opt b { display: block; font-size: 20px; font-weight: 900; }
.feel__opt span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.screen .feel__opt[aria-pressed="true"] { background: rgba(242, 200, 121, 0.14); border-color: var(--amber); color: var(--amber); }
.feel__opt[aria-pressed="true"] span { color: var(--amber); }
.field { display: block; width: 100%; padding: 14px 16px; border-radius: 16px; background: var(--raised); border: 1px solid var(--line); font-size: 16px; line-height: 24px; resize: none; caret-color: var(--emerald); }
.screen .field:focus-visible { outline: none; border-color: var(--emerald); }
.result { border-radius: 20px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.result__head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 20px; }
.screen .result__head:focus-visible { outline-offset: -4px; }
.result__sets { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 14px; }
.setchip { padding: 8px 14px; border-radius: 12px; background: var(--raised); font-size: 14px; font-weight: 800; }
.setchip.rec { background: rgba(182, 156, 255, 0.18); color: var(--record); }

/* ---------- Exercise page ---------- */

.pagetop { display: flex; align-items: center; padding: 6px 12px; }
.pagelist { flex: 1; min-height: 0; padding: 0 20px 24px; }
.pagelist > * + * { margin-top: 10px; }
.page-title { padding-top: 8px; font-size: 34px; line-height: 1.172; font-weight: 900; letter-spacing: -0.8px; }
.chart { display: block; width: 100%; height: 134px; margin-top: 6px; overflow: visible; }
.notecard { display: flex; align-items: center; gap: 12px; border-radius: 18px; font-size: 15px; }

/* ---------- Sheets and menus ---------- */

.layer { position: absolute; inset: 0; pointer-events: none; }
.layer > * { pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); animation: fade 0.18s ease-out both; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92%; display: flex; flex-direction: column; border-radius: 28px 28px 0 0; background: var(--surface); animation: sheet-up 0.22s cubic-bezier(0.2, 0, 0, 1) both; }
.sheet__handle { flex: none; width: 32px; height: 4px; margin: 14px auto 18px; border-radius: 2px; background: var(--muted); opacity: 0.5; }
.sheet__body { padding: 0 20px 28px; }
.sheet__body > * + * { margin-top: 12px; }
.sheet__title { font-size: 26px; line-height: 32px; font-weight: 900; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.mini { flex: 1; min-width: 0; padding: 8px 10px 10px; border-radius: 16px; background: var(--raised); border: 1px solid var(--line); }
.mini__row { display: flex; align-items: center; justify-content: space-between; padding-top: 2px; }
.mini__btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.screen .mini__btn { border: 1px solid var(--line); background: var(--surface); }
.mini__val { font-size: 24px; }

.option { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border-radius: 20px; background: var(--raised); border: 1px solid var(--line); }
.screen .option { border: 1px solid var(--line); background: var(--raised); }
.screen .option.hl { background: rgba(46, 230, 166, 0.08); border-color: var(--emerald); }
.option__icon { display: flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; border-radius: 14px; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.option__title { font-size: 17px; font-weight: 800; }
.option__sub { font-size: 13px; color: var(--muted); }

.sharecard { padding: 20px; border-radius: 22px; border: 1px solid var(--line);
  background: radial-gradient(circle 320px at 50% -10%, rgba(46, 230, 166, 0.3), rgba(46, 230, 166, 0.06) 55%, transparent 100%), var(--bg); }

.menu-scrim { position: absolute; inset: 0; }
.menu { position: absolute; min-width: 190px; padding: 8px 0; border-radius: 12px; background: var(--high); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); animation: fade 0.12s ease-out both; }
.menu button { display: block; width: 100%; padding: 12px 16px; font-size: 15px; white-space: nowrap; }
.menu button.on { font-weight: 700; }
.menu button.danger { color: var(--alarm); }
.screen .menu button:focus-visible { outline-offset: -3px; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .screen .cbtn, .screen .pill, .screen .chip, .screen .playbtn { border: 1px solid ButtonText; }
}
