@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/inter-cyrillic.woff2?v=20261118-21') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/inter-latin.woff2?v=20261118-21') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --background: #111413;
  --surface: #191d1b;
  --surface-raised: #202522;
  --line: #323933;
  --text: #f4f3ec;
  --muted: #b4bcb4;
  --accent: #d8f28b;
  --accent-dark: #1b2610;
  --accent-rgb: 216, 242, 139;
  --accent-button-start: #e8fda4;
  --accent-button-end: #c9e470;
  --accent-button-ink: #0e1509;
  --radius: 21px;
  --hero-min-height: 348px;
  --text-h1: clamp(44px, 7vw, 80px);
  --text-h2: clamp(24px, 2.6vw, 36px);
  --text-h3: 19px;
  --text-lg: 17px;
  --text-base: 15px;
  --text-sm: 13px;
  --text-xs: 11px;
  font-family: 'Inter', system-ui, sans-serif;
}
:root[data-theme="fire"] {
  --accent: #ffae93; --accent-dark: #331c14; --accent-rgb: 255, 174, 147;
  --accent-button-start: #ffd6be; --accent-button-end: #ff9b7b; --accent-button-ink: #29140c;
}
:root[data-theme="ice"] {
  --accent: #a4dcff; --accent-dark: #122638; --accent-rgb: 164, 220, 255;
  --accent-button-start: #d6f3ff; --accent-button-end: #91cdf4; --accent-button-ink: #102236;
}
:root[data-theme="gold"] {
  --accent: #f5db7e; --accent-dark: #302409; --accent-rgb: 245, 219, 126;
  --accent-button-start: #fff2b0; --accent-button-end: #edcb69; --accent-button-ink: #261e0a;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font-size: var(--text-base); line-height: 1.5; }
body::before {
  content: ''; position: fixed; inset: -3%; pointer-events: none; z-index: 1; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button[aria-current="page"] { color: var(--accent); }
button svg { flex: 0 0 auto; }
.shell { width: min(1120px, calc(100% - 72px)); margin-inline: auto; }
.header, .mobile-nav { background: #141816; }
.header { border-bottom: 1px solid rgba(255, 255, 255, .06); }
@supports (backdrop-filter: blur(24px)) or (-webkit-backdrop-filter: blur(24px)) {
  .header, .mobile-nav {
    background: rgba(17, 20, 19, .72);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
  }
}
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; background: transparent; border: 0; padding: 0; gap: 11px; font-size: 17px; font-weight: 800; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #29312c; color: var(--text); }
.header-streak {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-raised); color: var(--text); font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.header-streak[hidden] { display: none; }
.header-streak .icon { color: var(--accent); }
.header-streak:hover { background: #2a342b; }
.desktop-nav { display: flex; gap: 7px; }
.nav-button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; color: var(--muted); border: 0; background: transparent; border-radius: 9px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.nav-button:hover { background: #272e2a; }
.nav-button[aria-current="page"] { background: rgba(var(--accent-rgb), .1); color: var(--accent); }
.mobile-nav { display: none; }
main { padding-block: 35px 60px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--text-h1); font-weight: 700; letter-spacing: -.045em; line-height: 1.02; }
h2 { font-size: var(--text-h2); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
h3 { font-size: var(--text-h3); letter-spacing: -.025em; line-height: 1.2; }
.muted, .hint { color: var(--muted); }
.hint { font-size: var(--text-sm); }
.upper-label { font-size: var(--text-xs); line-height: 1.2; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hero {
  position: relative; display: flex; align-items: end; min-height: var(--hero-min-height);
  padding: 36px; overflow: hidden; isolation: isolate; border: 1px solid rgba(255, 255, 255, .07); border-radius: var(--radius);
  background: radial-gradient(120% 100% at 100% 80%, rgba(255, 180, 100, .12), transparent 50%),
    linear-gradient(180deg, #0d100f, #161b18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 24px 48px -24px rgba(0, 0, 0, .6);
}
.hero::before, .hero::after { position: absolute; inset: 0; content: ''; z-index: -1; }
.hero::before {
  width: 100%;
  height: 100%;
  background: url('gym-hero.jpg?v=20261118-21') right center / cover no-repeat;
  background-image: image-set(
    url('gym-hero.webp?v=20261118-21') type('image/webp'),
    url('gym-hero.jpg?v=20261118-21') type('image/jpeg')
  );
}
.hero::after {
  background: linear-gradient(90deg, #111413 0%, rgba(17, 20, 19, .85) 40%, transparent 75%),
    linear-gradient(0deg, #111413 0%, rgba(17, 20, 19, .8) 38%, rgba(17, 20, 19, .24) 68%, transparent 88%);
}
.hero-copy { max-width: 515px; }
.hero .upper-label { color: #d1d7cf; }
.hero h1, .hero p { text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.hero h1 { margin: 11px 0; }
.hero p { max-width: 340px; font-size: var(--text-lg); color: #e0e4d8; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(290px, 1fr); gap: 20px; margin-bottom: 20px; }
.section-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(290px, 1fr); gap: 18px; align-items: start; margin-top: 24px; }
.card {
  background: linear-gradient(180deg, #1c2220, #161a18);
  border: 1px solid rgba(255, 255, 255, .05); border-radius: var(--radius); padding: 23px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 2px rgba(0, 0, 0, .2), 0 12px 32px -12px rgba(0, 0, 0, .4);
}
.next-workout {
  display: flex; flex-direction: column; justify-content: center; gap: 15px;
  position: relative; isolation: isolate; min-inline-size: 0;
}
.next-workout h2 { margin-top: 6px; overflow-wrap: anywhere; }
.next-workout h2 + p { margin-top: 6px; }
.next-workout-actions { display: grid; gap: 8px; }
.next-workout-actions .text-button { justify-self: start; min-height: 44px; }
.next-workout :is(button, a):not(.plan-card-start) { position: relative; z-index: 2; align-self: start; }
.plan-card-start-label { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.plan-card-start::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }
.next-workout .plan-card-start:active:not(:disabled) { transform: none; }
.next-workout[data-native-plan] .next-workout-actions { display: contents; }
.next-workout[data-native-plan] .plan-card-start {
  position: absolute; inset: 0; z-index: 1; min-height: 0; padding: 0;
  border: 0; border-radius: inherit; background: transparent; box-shadow: none;
}
.next-workout[data-native-plan] .plan-card-start::after,
.next-workout[data-native-plan] .plan-card-start-label { display: none; }
@media (hover: hover) {
  .plan-card-start:hover::after, .next-workout[data-native-plan] .plan-card-start:hover {
    box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .32);
  }
}
.plan-catalogue {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; margin-top: 18px; text-align: left;
}
.plan-catalogue-copy { display: grid; flex: 1; gap: 4px; }
.plan-catalogue-copy strong { font-size: clamp(19px, 2.1vw, 27px); line-height: 1.18; letter-spacing: -.025em; }
.plan-catalogue-copy small { color: var(--muted); font-size: var(--text-sm); }
.plan-catalogue > .icon:first-child { color: var(--muted); }
.plan-catalogue > .icon:last-child { color: var(--accent); }
.plan-catalogue:hover { border-color: var(--line); }
.plan-catalogue + .section-grid > .card:only-child { grid-column: 1 / -1; }
.plan-preview { margin-top: 18px; }
.frequency { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.choice { padding: 11px 7px; min-height: 48px; background: #212722; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 800; }
.choice[aria-pressed="true"] { color: var(--text); border-color: #7e8c83; background: #303832; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 10px; padding: 11px 16px; font-size: 14px; font-weight: 800; text-align: center; }
.primary {
  color: var(--accent-button-ink); background: linear-gradient(180deg, var(--accent-button-start), var(--accent-button-end));
  border: 1px solid rgba(255, 255, 255, .35); font-weight: 700; letter-spacing: -.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(0, 0, 0, .15),
    0 1px 2px rgba(0, 0, 0, .2), 0 12px 32px -8px rgba(var(--accent-rgb), .45);
  transition: transform 100ms ease, box-shadow 150ms ease;
}
.primary:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 12px 40px -8px rgba(var(--accent-rgb), .55); }
.primary:active:not(:disabled) {
  transform: scale(.97);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .15), 0 4px 12px -4px rgba(var(--accent-rgb), .3);
}
.secondary { color: var(--text); background: var(--surface-raised); border: 1px solid var(--line); }
.secondary:hover:not(:disabled), .icon-button:hover { background: #2a342b; }
.wide { width: 100%; }
.text-button { display: inline-flex; align-items: center; gap: 6px; background: transparent; padding: 8px 0; border: 0; color: var(--text); font-size: var(--text-sm); font-weight: 800; }
.section-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.section-head h2 { color: var(--text); }
.section-head p, .page-heading p { margin-top: 6px; }
.rows { display: grid; gap: 8px; }
.exercise-row {
  width: 100%; min-height: 63px; display: flex; align-items: center; text-align: left; gap: 12px;
  border: 1px solid transparent; border-radius: 12px; padding: 9px 12px; background: #1c211e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
@media (hover: hover) {
  .exercise-row:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .4); }
}
.row-text { flex: 1; min-width: 0; display: grid; }
.row-text strong { font-size: 14px; }
.row-text small, .row-aside { color: var(--muted); font-size: 12px; }
.row-aside { text-align: right; }
.icon { display: inline-flex; vertical-align: middle; flex: 0 0 auto; }
.exercise-row .icon { color: var(--muted); }
.progress-track { height: 7px; overflow: hidden; background: #333a31; border-radius: 999px; }
.progress-track > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.week-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; margin-top: 17px; }
.week-chip { text-align: center; padding: 8px 0; border-radius: 8px; background: #222823; color: var(--muted); font-size: 11px; font-weight: 800; }
.week-chip.current { background: #2a2f28; color: var(--text); }
.week-chip.done { color: var(--text); }
.side-stack, .stack { display: grid; gap: 14px; }
.page-heading { margin-bottom: 23px; }
.page-heading h1 { margin-top: 5px; overflow-wrap: anywhere; }
.page-heading p { color: var(--muted); }
.page-heading .workout-focus { margin-top: 4px; font-size: var(--text-sm); max-width: 60ch; }
.workout-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); margin-top: 0; }
.workout-groups { display: grid; gap: 14px; }
.muscle-group { display: grid; gap: 6px; }
.muscle-group-head {
  padding: 4px 10px; font-size: var(--text-xs); font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); border-inline-start: 2px solid var(--accent);
}
.exercise-row[aria-pressed="true"] { border-color: #7e8c83; background: #303832; }
.active-exercise { min-width: 0; }
.active-exercise h2 { margin: 7px 0; }
.active-exercise .controls { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.entry-table { display: grid; gap: 7px; margin-top: 9px; }
.entry-row { display: grid; grid-template-columns: 52px minmax(52px,1fr) minmax(52px,1fr) minmax(48px,auto); align-items: center; gap: 8px; }
.entry-row.no-weight { grid-template-columns: 52px 1fr minmax(48px, auto); }
.entry-row.head { color: var(--muted); font-size: 12px; }
.entry-row .set-number { color: var(--muted); font-weight: 800; text-align: center; }
.entry-row input, .weight-form input { min-width: 0; width: 100%; min-height: 45px; border: 1px solid var(--line); background: #131713; border-radius: 8px; padding: 8px 9px; color: var(--text); }
.entry-row input {
  font-size: 20px; font-weight: 700; text-align: center;
  color: #fff; background: #111413; border-color: #2a332c;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.entry-row input::placeholder { color: var(--muted); opacity: 1; }
.entry-row input:focus {
  border-color: var(--accent); background: rgba(var(--accent-rgb), .04);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12);
  outline: none;
}
.entry-row input, .timer-label, .stat strong, .workout-summary strong, .pr-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.entry-row .icon-button { min-width: 45px; min-height: 45px; }
.icon-button { display: grid; place-items: center; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
.workout-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-top: 19px; }
.previous { margin-top: 10px; color: var(--text); font-size: var(--text-sm); }
.card-rule { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 15px 0; }
.summary-count { display: flex; gap: 10px; align-items: baseline; margin: 9px 0 14px; }
.summary-count strong { font-size: 34px; line-height: 1; letter-spacing: -.065em; color: var(--text); }
.weight-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 9px; margin-top: 12px; }
.weight-form label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.history { display: grid; gap: 8px; }
.history details { border: 1px solid var(--line); background: var(--surface-raised); border-radius: 10px; padding: 10px 11px; font-size: 13px; }
.history summary { cursor: pointer; }
.history details p { margin-top: 6px; color: var(--muted); }
.catalogue { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.empty { font-size: 14px; color: var(--muted); padding-block: 7px; }
.weight-values { margin-top: 12px; font-size: 13px; }
.weight-values p { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 7px 0; }
dialog { width: min(440px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow: auto; padding: 22px; color: var(--text); background: #1d231e; border: 1px solid #485343; border-radius: 18px; }
dialog::backdrop { background: #0b110ce0; }
.dialog-heading { display: flex; gap: 10px; justify-content: space-between; align-items: start; }
.dialog-heading .icon-button { width: 37px; height: 37px; flex: 0 0 auto; }
dialog p { margin-top: 9px; }
dialog ol { color: var(--muted); padding-left: 20px; margin-block: 12px 17px; }
dialog li + li { margin-top: 7px; }
dialog .primary { margin-top: 12px; }
.toast {
  z-index: 8; position: fixed; right: 20px; bottom: 22px; max-width: calc(100% - 40px);
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px; border: 1px solid #70824f; border-radius: 9px; background: #2a3523;
  color: var(--text); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 150ms;
}
.toast.visible { opacity: 1; }
.toast .save-confirmation-icon { display: inline-flex; color: var(--accent); flex: 0 0 auto; }

@media (max-width: 900px) {
  .header-inner { min-height: 61px; gap: 10px; }
  .desktop-nav { display: none; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; z-index: 5; inset: auto 0 0;
    gap: 3px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .3);
  }
  .nav-button { flex-direction: column; min-height: 48px; gap: 4px; font-size: 10px; padding: 6px 2px; }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (max-width: 760px) {
  :root { --hero-min-height: clamp(168px, 30vh, 223px); }
  .shell { width: calc(100% - 28px); }
  main { padding-top: 14px; }
  .plan-grid, .section-grid, .workout-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .plan-grid { gap: 16px; margin-bottom: 16px; }
  .section-grid { margin-top: 13px; }
  .workout-grid { margin-top: 0; }
  .hero { padding: 20px; }
  .hero::after {
    background: linear-gradient(90deg, #111413 0%, rgba(17, 20, 19, .78) 44%, rgba(17, 20, 19, .22) 84%, transparent),
      linear-gradient(0deg, #111413 0%, rgba(17, 20, 19, .9) 52%, rgba(17, 20, 19, .32) 88%, transparent 100%);
  }
  .hero h1 { max-width: 12ch; margin: 8px 0; }
  .hero p { font-size: var(--text-sm); max-width: 28ch; }
  .card { padding: 16px; }
  .next-workout { gap: 11px; }
  .plan-catalogue, .plan-preview { margin-top: 12px; }
  .section-head { margin-bottom: 12px; }
  .page-heading { padding: 7px 2px 0; margin-bottom: 14px; }
  .active-exercise { grid-row: 1; }
  .catalogue { grid-template-columns: minmax(0,1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .primary:active:not(:disabled), .exercise-row:hover { transform: none; }
}

.exercise-controls { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 8px; }
.subdued { color: var(--muted); }
.under-entries { align-items: center; justify-content: space-between; margin-top: 5px; }
.timer-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 12px; padding: 12px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 12px; }
.timer-title { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; color: var(--muted); }
.timer-title h2 { font-size: 20px; color: var(--text); }
.timer-ring { grid-column: 1 / -1; position: relative; width: 132px; height: 132px; margin: 0 auto; }
.timer-ring > svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-track, .timer-progress { fill: none; stroke-width: 6; }
.timer-track { stroke: rgba(255, 255, 255, .08); }
.timer-progress {
  stroke: var(--accent); stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), .4));
  transition: stroke-dashoffset 250ms linear;
}
.timer-label {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 26px; line-height: 1; font-weight: 700; letter-spacing: -.05em;
  text-shadow: 0 0 20px rgba(255, 255, 255, .1);
}
.timer-display.ready { color: var(--accent); text-shadow: 0 0 20px rgba(var(--accent-rgb), .4); }
.timer-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.timer-actions #timer-stop { background: rgba(var(--accent-rgb), .07); border-color: rgba(var(--accent-rgb), .35); }
.rest-setting { color: var(--muted); font-size: 12px; display: flex; gap: 8px; align-items: center; justify-content: flex-start; }
.rest-setting input, #progress-exercise { border: 1px solid var(--line); border-radius: 8px; background: #131713; color: var(--text); min-height: 40px; padding: 6px 8px; font: inherit; }
.rest-setting input { width: 62px; }
#progress-exercise { width: 100%; font-size: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.stat { display: grid; gap: 6px; }
.stat strong { font-size: clamp(22px,4vw,41px); line-height: 1; font-weight: 800; color: var(--text); letter-spacing: -.07em; }
.stat span { font-size: 12px; color: var(--muted); }
.history-bars { display: grid; gap: 13px; margin-top: 13px; }
.bar-label { display: flex; align-items: start; justify-content: space-between; gap: 9px; font-size: 12px; margin-bottom: 4px; }
.bar-label strong { flex: 0 0 auto; }
.technique-note { background: #283225; padding: 3px 13px 12px; border-radius: 10px; font-size: 14px; }
.technique-note strong { color: var(--text); }
@media (max-width: 760px) {
  .workout-grid > .side-stack { grid-row: 1; }
  .workout-actions { gap: 7px; }
  .workout-actions .primary, .workout-actions .secondary { padding-inline: 11px; }
  .stat { padding: 14px 9px; }
}
@media (max-width: 370px) {
  .timer-card { gap: 7px; padding: 8px; }
  .rest-setting { flex-wrap: wrap; }
}

.sync-status { min-height: 24px; padding-top: 8px; color: var(--muted); font-size: 12px; }
#sync-status[data-status="idle"], #sync-status[data-status="saved"], #sync-status:empty { display: none !important; }
.sync-status[data-status="error"], .sync-status[data-status="conflict"], .sync-status[data-status="offline"] { color: #f5cd8b; }
.sync-status .text-button { margin-left: 7px; padding-block: 2px; }
.level-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.level-options .choice { font-size: 12px; padding-inline: 4px; }
.level-description { min-height: 37px; }
.workout-summary { margin-bottom: 16px; display: grid; gap: 8px; }
.workout-progress-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 9px; }
.workout-phase { margin-block: 14px; }
.workout-phase-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.workout-phase-row .phase-technique { min-height: 44px; color: var(--muted); }
.workout-phase-row .exercise-row[aria-pressed="true"] .row-aside { color: var(--text); font-weight: 800; }
.workout-summary-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.workout-summary-top > div:first-child strong { font-size: 32px; color: var(--text); line-height: 1; letter-spacing: -.05em; }
.workout-estimate { display: flex; align-items: center; gap: 9px; }
.workout-estimate > .icon { color: var(--muted); }
.workout-estimate strong { font-size: 18px; }
.workout-grid.is-overview { grid-template-columns: minmax(0, 1fr); }
.exercise-thumb { display: grid; place-items: center; flex: 0 0 66px; height: 54px; overflow: hidden; border-radius: 8px; background: #29332b; }
.exercise-thumb img { display: block; width: 100%; height: 54px; object-fit: contain; }
.thumb-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); }
.exercise-thumb img[hidden], .thumb-fallback[hidden], .exercise-thumb img:not([hidden]) + .thumb-fallback { display: none; }
.exercise-row { min-height: 66px; }
.exercise-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 9px; }
.technique-button { padding-inline: 11px; min-height: 43px; font-size: 12px; }
.movement-preview { overflow: hidden; margin: 0; background: #101411; border: 1px solid var(--line); border-radius: 13px; }
.movement-preview video { display: block; width: 100%; height: min(370px, 52vh); object-fit: contain; }
.movement-preview iframe { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: min(370px, 52vh); border: 0; }
.movement-preview figcaption { padding: 6px 10px; color: var(--muted); background: var(--surface-raised); font-size: 11px; }
.movement-preview a { color: var(--muted); text-underline-offset: 2px; }
.movement-note { padding-block: 8px; }
.catalogue-filters { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 9px; margin-bottom: 12px; }
.catalogue-filters label { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: 12px; }
.catalogue-filters input, .catalogue-filters select { width: 100%; min-width: 0; min-height: 42px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #131713; color: var(--text); font-size: 14px; }
.results-count { margin-bottom: 7px; }
dialog .exercise-browser { margin-top: 13px; }
dialog .movement-preview { margin-top: 12px; }
dialog .preview-actions { margin-top: 10px; }
dialog h3 { margin-top: 17px; }
.entry-row .save-set { color: var(--accent-dark); background: var(--accent); }
.entry-row .save-set:hover { background: #e4f9a9; }
.set-plan { display: grid; gap: 4px; margin-top: 12px; }
.set-plan h3 { margin: 0; font-size: 16px; }
.set-plan p { margin: 0; }
.set-load-guide { margin-top: 4px; padding: 10px 12px; display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 10px; background: #202921; }
.set-load-guide strong { color: var(--text); font-size: 20px; line-height: 1.2; }
.set-load-guide .text-button { justify-self: start; margin-top: 3px; }
.recorded-sets { border-top: 1px solid var(--line); color: var(--muted); margin-top: 13px; padding-top: 9px; font-size: 13px; }
.recorded-sets summary { cursor: pointer; }
.recorded-sets ul { display: grid; gap: 6px; list-style: none; padding: 0; margin-block: 8px 0; }
.logged-set {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px;
  padding: 0 9px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}
.logged-set > span { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.logged-set .text-button { min-height: 40px; }

.app-skeleton { display: grid; gap: 24px; }
.skeleton-layout { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(290px, 1fr); gap: 18px; }
.skeleton-layout + .skeleton-layout { align-items: start; }
.skeleton-card, .skeleton-hero { display: grid; align-content: center; gap: 12px; padding: 23px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius); }
.skeleton-hero { min-height: var(--hero-min-height); align-content: end; padding: 36px; }
.skeleton-compact { min-height: 120px; }
.skeleton-short { min-height: 180px; }
.skeleton-tall { min-height: 260px; }
.skeleton-heading { width: min(62%, 320px); min-height: 26px; }
.skeleton-rows { display: grid; gap: 8px; }
.skeleton-bar, .skeleton-row { border-radius: 8px; background: #323a34; }
.skeleton-bar { min-height: 12px; }
.skeleton-bar.skeleton-heading { min-height: 26px; }
.skeleton-row { min-height: 54px; }
@media (prefers-reduced-motion: no-preference) {
  body::before { animation: grain 8s steps(10) infinite; }
  @keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-2%, -2%); }
  }
  .timer-display.running { animation: running-glow 1.6s ease-in-out infinite alternate; }
  .timer-display.ready { animation: pulse-glow 1s ease-in-out infinite alternate; }
  .toast .save-confirmation-icon { animation: pop 240ms cubic-bezier(.34, 1.56, .64, 1); }
  @keyframes running-glow {
    from { text-shadow: 0 0 20px rgba(255, 255, 255, .1); }
    to { text-shadow: 0 0 22px rgba(var(--accent-rgb), .28); }
  }
  @keyframes pulse-glow {
    from { opacity: .8; transform: scale(.98); }
    to { opacity: 1; transform: scale(1.02); }
  }
  @keyframes pop {
    0% { transform: scale(.4); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
  }
  .app-skeleton { animation: skeleton-in 140ms ease-out; }
  .skeleton-card, .skeleton-hero {
    background-image: linear-gradient(90deg, var(--surface-raised) 35%, #2b342b 50%, var(--surface-raised) 65%);
    background-size: 220% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
  }
  @keyframes skeleton-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes skeleton-shimmer { from { background-position: 100% 0; } to { background-position: -85% 0; } }
}

@media (max-width: 760px) {
  .workout-grid.is-detail .workout-list { display: none; }
  .workout-summary { margin-bottom: 12px; }
  .exercise-thumb { flex-basis: 60px; }
  .exercise-heading { gap: 8px; }
  .exercise-heading h2 { font-size: 22px; }
  .app-skeleton { gap: 13px; }
  .skeleton-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .skeleton-card, .skeleton-hero { padding: 20px; }
  .skeleton-short { min-height: 140px; }
  .skeleton-tall { min-height: 200px; }
}
@media (max-width: 370px) {
  .level-options .choice { font-size: 10px; }
  .exercise-thumb { flex-basis: 52px; }
}

.plan-picker-form, .plan-picker-result { display: grid; gap: 14px; margin-top: 16px; }
.plan-picker-question { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.plan-picker-question legend { margin-bottom: 6px; padding: 0; font-size: 14px; font-weight: 800; }
.plan-picker-options { display: grid; gap: 5px; }
.plan-picker-options-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plan-picker-options label { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); font-size: 13px; cursor: pointer; }
.plan-picker-options input { flex: none; margin: 0; accent-color: var(--text); }
.plan-picker-options label.is-selected { border-color: #7e8c83; background: #303832; }
.plan-picker-summary { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); }
.plan-picker-summary h3 { margin: 4px 0; }
.plan-picker-summary p, .plan-picker-result > p { margin: 0; }
.plan-picker-summary p { color: var(--muted); font-size: 13px; }

.streak-flame { font-size: 25px; font-weight: 800; color: var(--accent); }
.streak-week {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px;
  max-width: 405px; margin: 12px 0; padding: 0; list-style: none;
}
.streak-day {
  display: grid; place-items: center; min-height: 32px; aspect-ratio: 1; border-radius: 8px;
  background: var(--surface-raised); font-size: 12px; font-weight: 700; color: var(--muted);
}
.streak-day.done {
  background: linear-gradient(180deg, var(--accent-button-start), var(--accent-button-end)); color: var(--accent-dark);
  box-shadow: 0 4px 12px -4px rgba(var(--accent-rgb), .4);
}
.streak-day.frozen { border: 1px solid #54748b; background: #23343e; color: #b1def8; }
.streak-freezes { margin-top: 6px; }
.freeze-chip {
  display: inline-flex; align-items: center; gap: 4px; padding-inline-start: 7px;
  border-inline-start: 1px solid var(--line); color: #b1def8;
}
.game-strip {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface-raised); text-align: left; font-size: var(--text-sm); font-weight: 700;
}
.game-strip > span:not(.icon) { flex: 1; }
.game-strip > strong { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.profile-game-strip > strong { min-width: 0; text-align: end; white-space: normal; overflow-wrap: anywhere; }
.game-strip > .icon { color: var(--accent); }
.game-strip:hover { border-color: #617268; }
.section-grid + .wrapped-strip { margin-top: 14px; }
.quest-group + .quest-group { margin-top: 18px; }
.quest-group h3 { margin-bottom: 8px; }
.game-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.game-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 9px; min-height: 55px;
  border-radius: 10px; background: var(--surface-raised);
}
.game-row-copy { flex: 1; min-width: 0; font-size: 14px; }
.game-row-copy strong { overflow-wrap: anywhere; }
.game-row-copy .hint { font-size: 12px; }
.game-row-icon { font-size: 17px; }
.game-row-button { flex: 0 0 auto; min-height: 44px; padding: 7px 9px; font-size: 12px; }
.game-status { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.game-status .icon { color: var(--accent); }
.game-theme-reset { margin-top: 8px; min-height: 44px; }
.wrapped-stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  padding: 0; margin: 0 0 10px;
}
.wrapped-stats > div { padding: 10px; border-radius: 10px; background: var(--surface-raised); }
.wrapped-stats dt { color: var(--muted); font-size: 12px; }
.wrapped-stats dd { margin: 0; color: var(--accent); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#wrapped-share-status:empty { display: none; }
.challenge-card .secondary { justify-self: start; }
.challenge-choices { display: grid; gap: 9px; margin-top: 14px; }
.challenge-choice { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: var(--surface-raised); }
.challenge-choice h3, .challenge-choice p { margin: 0; }
.challenge-choice .secondary { justify-self: start; min-height: 40px; }
.pr-list { display: grid; gap: 8px; }
.pr-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--surface-raised); border-radius: 10px; font-size: 13px;
}
.pr-value { color: var(--accent); font-size: 16px; white-space: nowrap; }
.badges-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(87px, 1fr)); gap: 8px;
  padding: 0; margin: 0; list-style: none;
}
.badge {
  display: grid; place-items: center; gap: 6px; padding: 10px 6px; border: 1px solid transparent;
  border-radius: 10px; background: var(--surface-raised); text-align: center;
}
.badge.earned { background: rgba(var(--accent-rgb), .08); border-color: rgba(var(--accent-rgb), .28); }
.badge.locked .badge-icon { opacity: .45; filter: grayscale(1); }
.badge-icon { font-size: 24px; line-height: 1; }
.badge small { color: var(--muted); font-size: 11px; line-height: 1.25; }
.profile-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.profile-head h2 { overflow-wrap: anywhere; }
.profile-head .hint { margin-top: 4px; }
@media (max-width: 900px) {
  .profile-page { margin-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
.profile-page .setup { display: grid; gap: 12px; }
.profile-page .setup > .section-head { margin-bottom: 0; }
.profile-page p + .wide { margin-top: 10px; }
.profile-page a.secondary { text-decoration: none; }
.profile-avatar {
  display: grid; flex: 0 0 56px; place-items: center; width: 56px; height: 56px;
  border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-button-end));
  color: var(--accent-dark); font-size: 24px; font-weight: 800;
  box-shadow: 0 8px 24px -8px rgba(var(--accent-rgb), .4);
}
.profile-options { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.profile-setting {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 12px;
  min-height: 44px; color: var(--muted); font-size: var(--text-sm);
}
.profile-setting .secondary { min-height: 42px; }
.profile-setting input[type="number"] {
  width: 64px; min-height: 42px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: #131713; color: var(--text); font-variant-numeric: tabular-nums;
}
.profile-setting input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.program-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.program-chip {
  display: grid; align-content: start; gap: 4px; min-height: 52px; padding: 10px; background: var(--surface-raised);
  border: 1px solid var(--line); border-radius: 12px; text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.program-chip[aria-pressed="true"] { border-color: var(--accent); background: rgba(var(--accent-rgb), .06); }
.program-chip strong { font-size: 14px; }
.program-chip small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.weight-form + .hint { margin-top: 14px; }
.weight-chart { display: block; width: 100%; height: 80px; margin-block: 12px; overflow: visible; }
.weight-chart polyline {
  fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round;
  stroke-linecap: round; vector-effect: non-scaling-stroke;
}
.welcome-banner {
  display: grid; gap: 5px; padding: 12px 0 0; border-top: 1px solid var(--line);
}
.welcome-banner h3 { font-size: 15px; }
.empty-state { display: grid; justify-items: start; gap: 12px; }
.progress-empty-state { padding: clamp(22px, 5vw, 30px); }
.empty-state .hint { max-width: 54ch; }
.empty-state-icon {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 11px; background: var(--surface-raised); color: var(--accent);
}
.weight-history { color: var(--muted); font-size: var(--text-sm); }
.weight-history summary { padding-block: 9px; cursor: pointer; }
.weight-history .weight-values { margin-top: 2px; }
.export-text {
  display: block; width: 100%; min-height: 110px; max-height: 30vh; margin-top: 12px; padding: 9px;
  resize: vertical; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-raised); color: var(--text); font: 12px/1.4 monospace;
}
#diary-export-status:empty { display: none; }
.recovery-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-block: 12px; }
.recovery-choices .secondary { padding-inline: 6px; font-size: var(--text-sm); }
.recovery-hint {
  margin-block: 0 12px; padding: 8px 12px; border-inline-start: 2px solid var(--accent);
  color: var(--muted); font-size: var(--text-sm);
}
.recovery-track-card { margin-top: 12px; }
.recovery-track-card h2, .recovery-progress h2 { font-size: var(--text-h3); }
.quick-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quick-stat {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 12px;
}
.qs-icon { font-size: 19px; }
.qs-info { display: grid; gap: 2px; min-width: 0; }
.qs-info strong { font-size: 14px; }
.qs-info small { color: var(--muted); font-size: var(--text-xs); }
.qs-btn {
  display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--text); font-weight: 800;
}
.qs-btn:hover:not(:disabled) { border-color: var(--accent); }
.qs-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-dark); border-color: var(--accent); }
.sleep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 4px; margin-top: 12px; }
.recovery-summary { display: grid; gap: 8px; margin: 0; font-size: var(--text-sm); }
.recovery-summary > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.recovery-summary dt { color: var(--muted); }
.recovery-summary dd { margin: 0; font-weight: 700; }
@media (max-width: 760px) {
  .quick-stats { grid-template-columns: minmax(0, 1fr); }
}

.repeat-last-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px;
}
.repeat-last-card h2 { font-size: var(--text-h3); }
.repeat-last-card .hint { margin-top: 4px; }
.progressive-hint {
  margin: 8px 0 12px; padding: 10px 12px; border-radius: 10px; background: rgba(var(--accent-rgb), .06);
}
.progressive-hint strong { display: block; margin-bottom: 3px; color: var(--text); }
.rest-banner {
  position: sticky; top: 0; top: env(safe-area-inset-top, 0px); z-index: 4;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px;
  padding: 8px 12px; background: linear-gradient(180deg, #262e27, #191e1a);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .34);
}
.rest-banner[hidden] { display: none; }
.rest-banner strong {
  display: block; color: var(--accent); font-size: 28px; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1.1;
}
.rest-banner .secondary { min-height: 44px; }
@media (prefers-reduced-motion: no-preference) {
  .rest-banner:not([hidden]) { animation: rest-banner-in 170ms ease-out; }
  @keyframes rest-banner-in { from { opacity: 0; transform: translateY(-8px); } }
}

@media (prefers-reduced-motion: no-preference) {
  .confetti-layer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 9; }
  .confetti {
    position: absolute; top: -16px; width: 7px; height: 11px; border-radius: 2px;
    background: var(--accent); animation: confetti-fall 1.5s ease-in forwards;
  }
  .confetti:nth-child(3n + 2) { background: #ffa363; }
  .confetti:nth-child(3n + 3) { background: #f4f3ec; }
  @keyframes confetti-fall { to { transform: translateY(100vh) rotate(540deg); opacity: 0; } }
}
