:root {
  color-scheme: dark;
  --bg: #07090d;
  --bg-2: #0c1017;
  --surface: rgba(18, 23, 32, .84);
  --surface-solid: #121720;
  --surface-2: #171e2a;
  --card: #101620;
  --text: #f6f8fb;
  --muted: #9aa6b6;
  --faint: #667386;
  --line: rgba(255, 255, 255, .105);
  --line-strong: rgba(207, 255, 84, .38);
  --primary: #ccff33;
  --primary-2: #8dff73;
  --primary-text: #071007;
  --accent: #78dbff;
  --danger: #ff5f70;
  --shadow: 0 24px 80px rgba(0, 0, 0, .38);
  --glow: 0 0 0 1px rgba(204, 255, 51, .16), 0 22px 70px rgba(204, 255, 51, .08);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --container: 1180px;
  --header-h: 74px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7f2;
  --bg-2: #eaf0e5;
  --surface: rgba(255, 255, 255, .86);
  --surface-solid: #ffffff;
  --surface-2: #f3f7ef;
  --card: #ffffff;
  --text: #111827;
  --muted: #5f6c7d;
  --faint: #8a96a6;
  --line: rgba(17, 24, 39, .11);
  --line-strong: rgba(15, 117, 28, .28);
  --primary: #101820;
  --primary-2: #1b4332;
  --primary-text: #ffffff;
  --accent: #00a3ff;
  --shadow: 0 24px 70px rgba(21, 34, 20, .12);
  --glow: 0 0 0 1px rgba(16, 24, 32, .08), 0 18px 52px rgba(16, 24, 32, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 4%, color-mix(in srgb, var(--primary) 24%, transparent), transparent 22rem),
    radial-gradient(circle at 82% 0%, rgba(120, 219, 255, .18), transparent 20rem),
    linear-gradient(145deg, var(--bg), var(--bg-2) 58%, var(--bg));
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 80%);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

.skip-link,
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link:focus {
  width: auto;
  height: auto;
  clip: auto;
  z-index: 1000;
  top: 1rem;
  inset-inline-start: 1rem;
  padding: .75rem 1rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-text);
  font-weight: 950;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: max(.7rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 2.1rem) .7rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(22px) saturate(140%);
}
.app-header[data-elevated="true"] {
  border-bottom-color: var(--line);
  box-shadow: 0 12px 40px rgba(0,0,0,.16);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand-mark {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--primary-text);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-weight: 1000;
  font-size: 1.25rem;
  box-shadow: 0 12px 32px color-mix(in srgb, var(--primary) 23%, transparent);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 13px;
}
.brand strong {
  display: block;
  font-size: 1.08rem;
  letter-spacing: -.03em;
}
.brand small {
  display: block;
  margin-top: .08rem;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 850;
  text-transform: lowercase;
}
.top-actions {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
}

main {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 5.4rem;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, .65fr);
  gap: 1rem;
  align-items: stretch;
  min-height: 520px;
}
.hero-copy,
.hero-panel,
.controls,
.catalog,
.exercise-modal,
.sheet-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(145%);
}
.hero-copy {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 4vw, 3rem);
}
.hero-copy::before {
  content: "FIT PRO";
  position: absolute;
  inset-inline-start: -1.2rem;
  top: clamp(.7rem, 5vw, 2rem);
  color: rgba(255,255,255,.04);
  font-size: clamp(4rem, 16vw, 12rem);
  font-weight: 1000;
  letter-spacing: -.09em;
  line-height: .8;
  pointer-events: none;
  direction: ltr;
}
.hero-copy::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(to top, color-mix(in srgb, var(--primary) 11%, transparent), transparent);
  pointer-events: none;
}
.hero-copy > * { position: relative; z-index: 1; }
.eyebrow {
  margin: 0 0 .5rem;
  color: var(--primary);
  font-size: .76rem;
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: uppercase;
  direction: ltr;
  text-align: inherit;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 850px;
  margin-bottom: .8rem;
  font-size: clamp(2.9rem, 8.7vw, 6.8rem);
  line-height: .88;
  letter-spacing: -.075em;
}
.hero-text {
  max-width: 58ch;
  margin-bottom: 1.2rem;
  color: var(--muted);
  line-height: 1.9;
  font-size: 1.03rem;
}
.search-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
  width: min(780px, 100%);
  padding: .5rem;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  box-shadow: var(--glow);
}
.search-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 1.4rem;
  line-height: 1;
}
.search-shell input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: .9rem .35rem;
  background: transparent;
  color: var(--text);
}
.search-shell input::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.search-shell:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent), var(--glow); }
.quick-chips,
.chips,
.meta-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.quick-chips { margin-top: .85rem; }
.quick-chips button,
.chip,
.signature-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
  color: var(--text);
  padding: .55rem .82rem;
  font-size: .8rem;
  font-weight: 950;
}
.quick-chips button { color: var(--muted); }
.quick-chips button:hover { color: var(--text); border-color: var(--line-strong); }

.hero-panel {
  display: grid;
  grid-template-rows: 1.08fr auto auto;
  gap: .85rem;
  border-radius: var(--radius-xl);
  padding: 1rem;
}
.coach-card {
  position: relative;
  overflow: hidden;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 28px;
  padding: 1.2rem;
  background:
    linear-gradient(135deg, rgba(204,255,51,.24), rgba(120,219,255,.08)),
    linear-gradient(180deg, var(--surface-2), var(--card));
  border: 1px solid var(--line-strong);
}
.coach-card::before {
  content: "ANAS";
  position: absolute;
  top: .75rem;
  inset-inline-end: .75rem;
  color: rgba(255,255,255,.075);
  font-size: clamp(3.4rem, 8vw, 5.4rem);
  line-height: .82;
  font-weight: 1000;
  letter-spacing: -.08em;
  direction: ltr;
}
.coach-label {
  width: fit-content;
  margin-bottom: .65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .62rem;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 1000;
  text-transform: uppercase;
  direction: ltr;
}
.coach-card strong {
  margin-bottom: .4rem;
  font-size: clamp(1.55rem, 4vw, 2.4rem);
  line-height: 1;
  letter-spacing: -.06em;
}
.coach-card p {
  margin-bottom: .75rem;
  color: var(--muted);
  line-height: 1.7;
}
.coach-card em {
  color: var(--primary);
  font-size: .82rem;
  font-style: normal;
  font-weight: 1000;
  text-transform: lowercase;
}
.metric-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: .65rem;
}
.metric-card {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 24px;
  padding: .95rem;
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  border: 1px solid var(--line);
}
.metric-card.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: var(--primary-text);
  border-color: transparent;
}
.metric-card span {
  font-size: clamp(1.55rem, 4.5vw, 3rem);
  font-weight: 1000;
  letter-spacing: -.07em;
  direction: ltr;
}
.metric-card p {
  margin: 0;
  color: inherit;
  opacity: .76;
  font-weight: 950;
}

.controls,
.catalog {
  border-radius: var(--radius-xl);
  padding: clamp(.9rem, 2.4vw, 1.2rem);
  margin-top: 1rem;
}
.controls-title,
.section-heading,
.sheet-header,
.modal-actions,
.sheet-actions,
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}
.controls-title h2,
.section-heading h2,
.sheet-header h2 {
  margin: 0;
  letter-spacing: -.045em;
  line-height: 1.15;
}
.control-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
  margin-top: .9rem;
}
label span {
  display: block;
  margin-bottom: .4rem;
  color: var(--muted);
  font-size: .77rem;
  font-weight: 950;
}
select,
.plan-grid input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: 0;
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  color: var(--text);
  padding: .84rem .85rem;
}
select:focus,
.plan-grid input:focus { border-color: var(--line-strong); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 13%, transparent); }
.section-heading { margin-bottom: 1rem; align-items: flex-start; }
#resultStatus { margin: .35rem 0 0; color: var(--muted); line-height: 1.6; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
}
.exercise-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 372px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-solid) 86%, transparent), var(--card));
  box-shadow: 0 18px 50px rgba(0,0,0,.16);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.exercise-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(204,255,51,.16), transparent 38%, rgba(120,219,255,.1));
  opacity: 0;
  transition: opacity .2s ease;
}
.exercise-card:hover,
.exercise-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 28px 76px rgba(0,0,0,.25);
  outline: 0;
}
.exercise-card:hover::after,
.exercise-card:focus-visible::after { opacity: 1; }
.card-media {
  position: relative;
  aspect-ratio: 1 / .82;
  overflow: hidden;
  background:
    radial-gradient(circle at 55% 28%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 45%),
    var(--surface-2);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
  filter: saturate(1.05) contrast(1.02);
}
.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7,9,13,.78), transparent 42%);
}
.exercise-id {
  position: absolute;
  z-index: 2;
  top: .78rem;
  inset-inline-start: .78rem;
  min-width: 3.3rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: .42rem .6rem;
  background: rgba(7,9,13,.58);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 1000;
  direction: ltr;
  backdrop-filter: blur(14px);
}
.trainer-signature {
  position: absolute;
  z-index: 2;
  inset-inline: .78rem;
  bottom: .78rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  margin: 0;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  padding: .46rem .6rem;
  background: rgba(7,9,13,.58);
  color: #fff;
  font-size: .72rem;
  font-weight: 950;
  text-transform: lowercase;
  direction: ltr;
  backdrop-filter: blur(16px);
}
.trainer-signature span {
  color: var(--primary);
  font-size: .64rem;
  text-transform: uppercase;
}
.card-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}
.card-body h3 {
  margin: 0 0 .7rem;
  min-height: 2.7em;
  color: var(--text);
  font-size: 1.04rem;
  line-height: 1.35;
  letter-spacing: -.025em;
}
.chips { gap: .36rem; }
.chip {
  padding: .4rem .62rem;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1;
}
.signature-pill { color: var(--primary); }
.card-actions { margin-top: auto; padding-top: .9rem; }

.primary-btn,
.secondary-btn,
.ghost-btn,
.pill-btn,
.icon-btn,
.text-btn,
.close-btn,
.remove-plan {
  border: 0;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  min-height: 46px;
  border-radius: 999px;
  padding: .78rem 1.1rem;
  color: var(--primary-text);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-weight: 1000;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--primary) 18%, transparent);
}
.primary-btn.compact { min-height: 44px; padding-inline: .95rem; }
.primary-btn b,
.pill-btn b {
  min-width: 1.35rem;
  height: 1.35rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  font-size: .72rem;
}
.secondary-btn,
.ghost-btn,
.pill-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  color: var(--text);
  padding: .74rem .95rem;
  font-weight: 950;
}
.ghost-btn:hover,
.secondary-btn:hover,
.pill-btn:hover,
.icon-btn:hover { border-color: var(--line-strong); }
.ghost-btn.active,
.pill-btn.active,
.fav-button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--primary) 92%, var(--surface-solid));
  color: var(--primary-text);
  border-color: transparent;
}
.icon-btn { width: 44px; padding: 0; font-size: 1.05rem; }
.text-btn {
  background: transparent;
  color: var(--muted);
  padding: .58rem .2rem;
  font-weight: 950;
}
.text-btn.danger { color: var(--danger); }
.wide { width: 100%; }
.load-more-wrap { display: grid; place-items: center; padding: 1.15rem 0 .25rem; }

.exercise-modal {
  width: min(980px, calc(100% - 1rem));
  max-height: min(92svh, 860px);
  padding: 0;
  border-radius: 34px;
  color: var(--text);
  overflow: hidden;
}
.exercise-modal::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }
.close-btn {
  position: absolute;
  z-index: 4;
  top: .82rem;
  inset-inline-end: .82rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(12,16,23,.75);
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  font-size: 1.55rem;
  line-height: 1;
  backdrop-filter: blur(16px);
}
.modal-media-wrap {
  position: relative;
  background:
    radial-gradient(circle at center, color-mix(in srgb, var(--primary) 18%, transparent), transparent 42%),
    var(--surface-2);
}
.modal-media-wrap img {
  width: 100%;
  max-height: 48svh;
  object-fit: contain;
  margin: 0 auto;
}
.modal-watermark {
  position: absolute;
  inset-inline: 1rem;
  bottom: 1rem;
  width: fit-content;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  padding: .52rem .8rem;
  background: rgba(7,9,13,.62);
  color: var(--primary);
  font-size: .8rem;
  font-weight: 1000;
  text-transform: lowercase;
  direction: ltr;
  backdrop-filter: blur(16px);
}
.modal-content { padding: clamp(1rem, 3vw, 1.5rem); }
.modal-content h2 {
  margin-bottom: .65rem;
  font-size: clamp(1.45rem, 4vw, 2.45rem);
  letter-spacing: -.05em;
}
.meta-list { margin-bottom: 1rem; }
.steps {
  padding-inline-start: 1.35rem;
  color: var(--muted);
  line-height: 1.85;
}
.steps li { margin-bottom: .45rem; }
.modal-actions { justify-content: flex-start; flex-wrap: wrap; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  visibility: hidden;
}
.sheet[aria-hidden="false"] { pointer-events: auto; visibility: visible; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.62);
  opacity: 0;
  transition: opacity .2s ease;
}
.sheet[aria-hidden="false"] .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: absolute;
  inset-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  max-width: 780px;
  margin-inline: auto;
  max-height: min(84svh, 730px);
  overflow: auto;
  border-radius: 34px;
  padding: 1rem;
  transform: translateY(112%);
  transition: transform .25s ease;
}
.sheet[aria-hidden="false"] .sheet-panel { transform: translateY(0); }
.sheet-header {
  position: relative;
  padding-inline-end: 3.2rem;
  margin-bottom: .85rem;
}
.sheet-header .close-btn { top: 0; inset-inline-end: 0; }
.plan-list { display: grid; gap: .7rem; }
.plan-item {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: .95rem;
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
}
.plan-item h3 { margin-bottom: .45rem; }
.plan-item .trainer-line {
  margin: .35rem 0 .55rem;
  color: var(--primary);
  font-size: .75rem;
  font-weight: 1000;
  text-transform: lowercase;
  direction: ltr;
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
  align-items: end;
  margin-top: .8rem;
}
.remove-plan {
  min-height: 44px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--danger) 13%, transparent);
  color: var(--danger);
  font-weight: 950;
}
.sheet-actions { margin-top: 1rem; }

.toast {
  position: fixed;
  z-index: 100;
  inset-inline: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: fit-content;
  max-width: calc(100% - 2rem);
  margin-inline: auto;
  padding: .85rem 1.05rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: 950;
  transform: translateY(140%);
  opacity: 0;
  transition: .2s ease;
  backdrop-filter: blur(20px);
}
.toast.show { transform: translateY(0); opacity: 1; }
.empty-state,
.skeleton {
  min-height: 210px;
  border-radius: 28px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}
.empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
}
.empty-state h3 { color: var(--text); margin-bottom: .35rem; }
.skeleton {
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-panel { grid-template-rows: auto; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .control-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 660px) {
  :root { --header-h: 64px; }
  body { background: var(--bg); }
  main { width: min(100% - .9rem, var(--container)); padding: .55rem 0 6.2rem; }
  .app-header { padding-inline: .75rem; }
  .brand-mark { width: 44px; height: 44px; border-radius: 16px; }
  .brand small { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions {
    position: fixed;
    z-index: 70;
    inset-inline: .7rem;
    bottom: max(.72rem, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 48px 1fr 1fr;
    gap: .4rem;
    padding: .45rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
    box-shadow: 0 18px 56px rgba(0,0,0,.36);
    backdrop-filter: blur(22px);
  }
  .top-actions .icon-btn,
  .top-actions .pill-btn,
  .top-actions .primary-btn { width: 100%; min-height: 48px; }
  .hero { gap: .8rem; }
  .hero-copy,
  .hero-panel,
  .controls,
  .catalog { border-radius: 28px; box-shadow: none; }
  .hero-copy { min-height: 520px; padding: 1.15rem; }
  .hero-copy::before { top: 1rem; font-size: 5.8rem; }
  h1 { font-size: clamp(3.05rem, 16vw, 5.2rem); }
  .hero-text { margin-bottom: 1rem; font-size: .96rem; }
  .search-shell { grid-template-columns: auto 1fr; border-radius: 24px; }
  .search-shell .primary-btn { grid-column: 1 / -1; width: 100%; }
  .quick-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .15rem;
    scrollbar-width: none;
  }
  .quick-chips::-webkit-scrollbar { display: none; }
  .quick-chips button { flex: 0 0 auto; }
  .hero-panel { padding: .75rem; }
  .coach-card { min-height: 190px; }
  .metric-grid { grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
  .metric-card { min-height: 88px; padding: .7rem; border-radius: 20px; }
  .metric-card span { font-size: 1.5rem; }
  .metric-card p { font-size: .78rem; }
  .control-row { grid-template-columns: 1fr; gap: .6rem; }
  .controls-title,
  .section-heading { align-items: flex-start; }
  .grid { grid-template-columns: 1fr; gap: .78rem; }
  .exercise-card { min-height: 0; border-radius: 28px; }
  .card-media { aspect-ratio: 1 / .64; }
  .card-body { padding: .92rem; }
  .card-body h3 { min-height: auto; font-size: 1.05rem; }
  .card-actions .primary-btn { min-height: 42px; padding-inline: .8rem; font-size: .88rem; }
  .fav-button { width: 42px; min-height: 42px; padding: 0; }
  .chips .chip:nth-child(3) { display: none; }
  .exercise-modal {
    width: 100%;
    max-height: 93svh;
    margin: auto 0 0;
    border-radius: 28px 28px 0 0;
  }
  .modal-media-wrap img { max-height: 38svh; }
  .modal-actions > * { flex: 1 1 140px; }
  .sheet-panel { inset-inline: .55rem; bottom: .55rem; max-height: 86svh; border-radius: 28px; }
  .plan-grid { grid-template-columns: repeat(3, 1fr); }
  .remove-plan { grid-column: 1 / -1; }
  .toast { bottom: calc(5.8rem + env(safe-area-inset-bottom)); }
}

@media (max-width: 390px) {
  .brand-copy strong { font-size: .96rem; }
  .brand small { max-width: 125px; }
  h1 { font-size: 2.78rem; }
  .metric-card p { font-size: .7rem; }
}

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