/* ============ THEME ============ */
:root {
  --font-body: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-mono: 'Fragment Mono', 'SF Mono', Consolas, monospace;

  --bg: #0d0f14;
  --surface: #141720;
  --surface2: #1a1e2a;
  --surface-hover: #1f2435;
  --border: rgba(255, 255, 255, 0.06);
  --border-bright: rgba(255, 255, 255, 0.12);
  --text: #e8ecf4;
  --text-dim: #7a8499;
  --text-faint: #4a5168;

  /* Muscle group accent colors — each distinct, no violet/purple */
  --shoulders: #60a5fa;
  --shoulders-dim: rgba(96, 165, 250, 0.10);
  --quads: #fbbf24;
  --quads-dim: rgba(251, 191, 36, 0.10);
  --chest: #f87171;
  --chest-dim: rgba(248, 113, 113, 0.10);
  --back: #34d399;
  --back-dim: rgba(52, 211, 153, 0.10);
  --triceps: #2dd4bf;
  --triceps-dim: rgba(45, 212, 191, 0.10);
  --biceps: #fb923c;
  --biceps-dim: rgba(251, 146, 60, 0.10);
  --glutes: #a3e635;
  --glutes-dim: rgba(163, 230, 53, 0.10);

  --gold: #d4a73a;
  --gold-dim: rgba(212, 167, 58, 0.12);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8f6f0;
    --surface: #ffffff;
    --surface2: #f2f0ea;
    --surface-hover: #eceae3;
    --border: rgba(0, 0, 0, 0.07);
    --border-bright: rgba(0, 0, 0, 0.14);
    --text: #1a1c24;
    --text-dim: #606680;
    --text-faint: #9099b0;
    --shoulders-dim: rgba(37, 99, 235, 0.07);
    --quads-dim: rgba(180, 120, 0, 0.07);
    --chest-dim: rgba(200, 50, 50, 0.07);
    --back-dim: rgba(20, 160, 100, 0.07);
    --triceps-dim: rgba(14, 165, 150, 0.07);
    --biceps-dim: rgba(200, 90, 20, 0.07);
    --glutes-dim: rgba(100, 180, 20, 0.07);
  }
}

/* ============ RESET ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(96, 165, 250, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(52, 211, 153, 0.04) 0%, transparent 50%);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-wrap: break-word;
}

/* ============ ANIMATIONS ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeScale {
  from { opacity: 0; transform: scale(0.93); }
  to { opacity: 1; transform: scale(1); }
}
.anim {
  animation: fadeUp 0.4s ease-out both;
  animation-delay: calc(var(--i, 0) * 0.05s);
}
.anim-scale {
  animation: fadeScale 0.35s ease-out both;
  animation-delay: calc(var(--i, 0) * 0.06s);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  height: 48px;
}
.nav::-webkit-scrollbar { display: none; }

.nav__logo {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-right: 16px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav__sep {
  width: 1px;
  height: 20px;
  background: var(--border-bright);
  margin-right: 16px;
  flex-shrink: 0;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav__link:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-bright);
  color: var(--text);
}
.nav__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.nav__link.is-active {
  background: color-mix(in srgb, currentColor 14%, transparent);
  border-color: color-mix(in srgb, currentColor 40%, transparent);
  font-weight: 600;
}
.nav__link.is-active .nav__dot { opacity: 1; }
.nav__link[data-section="routines"] {
  color: #34d399;
  margin-left: auto;
}

.nav__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

/* ============ LAYOUT ============ */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

/* ============ HERO ============ */
.hero {
  margin-bottom: 52px;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--gold);
  margin-bottom: 14px;
}

.hero__title {
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
}

.hero__title em {
  font-style: normal;
  color: var(--gold);
}

.hero__sub {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 560px;
  margin-bottom: 32px;
}

/* ============ KPI ROW ============ */
.kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 0;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 22px;
  min-width: 110px;
}

.kpi-card__value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.kpi-card__label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

/* ============ MUSCLE SECTION ============ */
.section {
  margin-bottom: 40px;
  scroll-margin-top: 64px;
}

.section__header {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  padding: 8px 8px 8px 0;
  margin: 0 -8px 16px -8px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.section__header:hover { background: rgba(255,255,255,0.03); }
.section__header:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.section__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-color);
  flex-shrink: 0;
}

.section__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--accent-color);
}

.section__count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim) !important;
  padding: 3px 8px;
  border: 1px solid var(--border-bright);
  border-radius: 5px;
  white-space: nowrap;
}

/* Chevron — pushed to far right, made larger for discoverability */
.section__chevron {
  margin-left: auto;
  font-size: 18px;
  color: var(--text-dim);
  transition: transform 0.2s ease;
  display: inline-block;
  padding: 0 4px;
}
.section.is-collapsed .section__chevron { transform: rotate(-90deg); }
.section.is-collapsed .section__divider,
.section.is-collapsed .exercise-grid,
.section.is-collapsed .atier-section,
.section.is-collapsed .routines-grid { display: none !important; }

.section__divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 16px;
}

/* ============ EXERCISE GRID ============ */
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-color);
  border-radius: 8px;
  padding: 14px 18px;
  transition: background 0.15s ease, transform 0.15s ease;
  animation: fadeUp 0.4s ease-out both;
  animation-delay: calc(var(--i, 0) * 0.04s);
}

.exercise-card:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.exercise-card__name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
}

.exercise-card__why {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  font-family: var(--font-mono);
}

.exercise-card__why strong {
  color: var(--accent-color);
  font-weight: 600;
}

.exercise-card__gif {
  margin: 10px -18px -14px -18px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  background: var(--bg);
  line-height: 0;
}
.exercise-card__gif img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.92;
  transition: opacity 0.2s ease;
}
.exercise-card__gif img:hover { opacity: 1; }

.exercise-card__demo {
  display: inline-block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-color);
  opacity: 0.7;
  text-decoration: none;
}
.exercise-card__demo:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ============ TIER BADGE ============ */
.stier-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(212, 167, 58, 0.2);
  float: right;
  margin-top: 2px;
}

.splus-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(212, 167, 58, 0.35) 0%, rgba(255, 200, 80, 0.2) 100%);
  color: #ffd060;
  border: 1px solid rgba(255, 200, 80, 0.45);
  float: right;
  margin-top: 2px;
  box-shadow: 0 0 8px rgba(255, 200, 80, 0.15);
}

.atier-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(180, 180, 200, 0.12);
  color: #a8a8c0;
  border: 1px solid rgba(180, 180, 200, 0.2);
  float: right;
  margin-top: 2px;
}

/* ============ A-TIER SECTION ============ */
.atier-section {
  margin-top: 20px;
}

.atier-section__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.atier-section__line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.atier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.atier-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-left: 2px solid rgba(168, 168, 192, 0.4);
  border-radius: 6px;
  padding: 10px 14px;
  transition: background 0.15s ease;
}

.atier-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.atier-card__name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-dim);
}

.atier-card__demo {
  display: inline-block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-color);
  opacity: 0.7;
  text-decoration: none;
}
.atier-card__demo:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ============ TIER FILTER ============ */
.tier-filter {
  display: flex;
  gap: 8px;
  padding: 16px 24px 0;
  flex-wrap: wrap;
}

.tier-filter__btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
}

.tier-filter__btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.tier-filter__btn.active {
  background: var(--gold);
  color: #1a1200;
  border-color: var(--gold);
}

.tier-filter__btn.active.a-tier {
  background: rgba(168,168,192,0.5);
  color: var(--text);
  border-color: rgba(168,168,192,0.5);
}

[data-tier-hidden] { display: none !important; }

/* ============ ROUTINES ============ */
.routines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 0 24px 40px;
}

.routine-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.15s ease;
}

.routine-card:hover {
  background: rgba(255,255,255,0.06);
}

.routine-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.routine-card__emoji {
  font-size: 24px;
  line-height: 1;
}

.routine-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.routine-card__tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(var(--accent-rgb, 100,210,160), 0.15);
  color: var(--accent-color);
  border: 1px solid rgba(var(--accent-rgb, 100,210,160), 0.25);
}

.routine-card__desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

/* "Copy to Hevy" button — emerald green, WCAG-AA contrast */
.routine-card__btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  padding: 10px 16px !important;
  border-radius: 6px;
  background: #34d399 !important;
  color: #06291d !important;
  border: 1px solid #34d399 !important;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
  box-shadow: 0 2px 6px rgba(52, 211, 153, 0.18);
}
.routine-card__btn:hover {
  background: #6ee7b7 !important;
  border-color: #6ee7b7 !important;
  opacity: 1 !important;
  box-shadow: 0 3px 10px rgba(110, 231, 183, 0.28);
  transform: translateY(-1px);
}
.routine-card__btn:focus-visible {
  outline: 3px solid #ffd060;
  outline-offset: 3px;
}

/* ============ TOOLBAR (search + collapse all) ============ */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 24px 0;
  margin-bottom: 4px;
}
.search {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
}
.search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  font-size: 14px;
}
.search__input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 9px 36px 9px 36px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search__input::placeholder { color: var(--text-dim); }
.search__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 167, 58, 0.18);
}
.search__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  display: none;
}
.search__clear:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.search.has-value .search__clear { display: block; }

.toolbar__group { display: flex; gap: 8px; align-items: center; }

.ghost-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-bright);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ghost-btn:hover { background: var(--surface-hover); border-color: var(--text-dim); }
.ghost-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.toolbar__status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
  min-height: 14px;
}
.toolbar__status[data-active="true"] { color: var(--gold); }

/* No-results message */
.no-results {
  display: none;
  padding: 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}
body.is-searching .no-results.is-visible { display: block; }

/* When searching, hide whole sections that have no matches */
.section[data-empty="true"] { display: none; }

/* Highlight matched text in search */
mark.search-hit {
  background: rgba(212, 167, 58, 0.35);
  color: var(--text);
  padding: 0 2px;
  border-radius: 2px;
}

/* ============ ROUTINES SECTION HEADER ============ */
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 8px 0;
  margin: 0 -8px 16px -8px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.section-header:hover { background: rgba(255,255,255,0.03); }
.section-header__accent {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #34d399;
  flex-shrink: 0;
}
.section-header__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #34d399;
}
.section-header__subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}
#routines.is-collapsed .routines-grid { display: none !important; }
#routines .section__chevron {
  margin-left: auto;
  font-size: 18px;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}
#routines.is-collapsed .section__chevron { transform: rotate(-90deg); }

/* ============ FOOTER ============ */
.footer-note {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim) !important;
  line-height: 1.7;
}

.footer-note a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-bright);
}

/* ============ BACK TO TOP ============ */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold);
  color: #000;
  border: none;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Skip-to-content link for keyboard users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: #000;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  border-radius: 0 0 6px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .page { padding: 28px 16px 60px; }
  .nav { padding: 0 16px; }
  .hero__title { font-size: 36px; }
  .exercise-grid { grid-template-columns: 1fr; }
  .toolbar { padding: 12px 16px 0; }
  .nav__link[data-section="routines"] { margin-left: 0; }
  .back-to-top { right: 12px; bottom: 12px; }
}

/* ============ EXERCISE PICKER (add to routine) ============ */
.exercise-card,
.atier-card { position: relative; }

.ex-pick {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border-bright);
  background: var(--surface2);
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.ex-pick:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
  transform: scale(1.12);
}
.ex-pick.is-picked {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1200;
  transform: scale(1.08);
}

/* Tint selected card */
.exercise-card.is-picked,
.atier-card.is-picked {
  background: color-mix(in srgb, var(--gold) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--gold) 30%, var(--border));
}

/* ============ FLOATING ROUTINE PANEL ============ */
.routine-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: min(680px, 100vw);
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
  z-index: 80;
  transition: transform 0.28s cubic-bezier(0.34, 1.26, 0.64, 1);
  padding: 14px 16px 10px;
  max-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.routine-panel:not([hidden]) { display: flex; }
.routine-panel.is-open { transform: translateX(-50%) translateY(0); }

.routine-panel__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.routine-panel__count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gold);
}

.routine-panel__actions { display: flex; gap: 8px; }

.routine-panel__btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.routine-panel__btn--export {
  background: var(--gold);
  color: #1a1200;
  border-color: var(--gold);
}
.routine-panel__btn--export:hover { background: #e8bc46; }
.routine-panel__btn--clear {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border-bright);
}
.routine-panel__btn--clear:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.routine-panel__scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-bright) transparent;
}
.routine-panel__scroll::-webkit-scrollbar { height: 4px; }
.routine-panel__scroll::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

.routine-panel__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  cursor: pointer;
}
.routine-panel__item img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-bright);
  background: var(--bg);
}
.routine-panel__item span {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  text-align: center;
  max-width: 72px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ ROUTINE EXPAND ============ */
.routine-expand-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 0;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
  width: 100%;
  text-align: left;
}
.routine-expand-btn:hover { color: var(--text-dim); }
.routine-expand-btn .expand-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}
.routine-expand-btn.is-open .expand-arrow { transform: rotate(90deg); }

.routine-exercises {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.routine-exercises.is-open { display: grid; }

.routine-exercise-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.routine-exercise-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.routine-exercise-item span {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  line-height: 1.3;
}

@media (max-width: 768px) {
  .routine-panel { width: 100vw; border-radius: 12px 12px 0 0; }
}
