/* ==========================================================================
   GIAKOR — Web 2R-1 pulido visual fino
   CSS-first · ultra-dark · electric blue accents
   ========================================================================== */

:root {
  /* Apex Velocity tokens */
  --bg-base: #0a0a0a;
  --bg-background: #131313;
  --bg-surface: #1c1b1b;
  --bg-elevated: #201f1f;
  --bg-hover: #2a2a2a;
  --bg-container-high: #2a2a2a;
  --bg-container-highest: #353534;
  --border: rgba(137, 145, 158, 0.2);
  --border-subtle: rgba(63, 71, 83, 0.35);
  --border-stroke: #1f1f1f;
  --text-primary: #e5e2e1;
  --text-secondary: #bfc7d5;
  --text-muted: #89919e;
  --accent: #0099ff;
  --accent-hover: #33adff;
  --accent-light: #9fcaff;
  --accent-muted: rgba(0, 153, 255, 0.1);
  --accent-glow: 0 0 15px rgba(0, 153, 255, 0.3);
  --accent-glow-strong: 0 0 25px rgba(0, 153, 255, 0.5);
  --success: #4ade80;
  --warning: #fbbf24;
  --error: #ffb4ab;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  /* Layout shell */
  --sidebar-width: 304px;
  --topbar-h: 64px;
  --bottom-nav-h: 68px;
  --main-pad-x: clamp(2rem, 3.2vw, 4.5rem);
  --main-pad-y: clamp(1.75rem, 2.5vw, 3rem);
  --max-w: 1440px;
  --home-max-w: 1360px;
  --builder-max-w: 1320px;
  --catalog-max-w: 1440px;
  --status-max-w: 1320px;
  /* Escala tipográfica (base 16px) */
  --text-body: 1rem;
  --text-sm: 0.9375rem;
  --text-xs: 0.8125rem;
  --text-label: 0.75rem;
  --control-h: 2.75rem;
  --control-h-md: 2.625rem;
  /* Escala de separación preferida: 8 / 12 / 16 / 24 / 32 / 48 */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-12: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --transition: 150ms ease;
  --focus-ring: 0 0 0 2px var(--bg-background), 0 0 0 4px var(--accent);
}

/* Chips por grupo muscular */
.chip--pecho { --chip-color: #ff6b8a; }
.chip--espalda { --chip-color: #60a5fa; }
.chip--hombros { --chip-color: #a78bfa; }
.chip--piernas { --chip-color: #4ade80; }
.chip--brazos { --chip-color: #fbbf24; }
.chip--core { --chip-color: #f97316; }
.chip--cardio { --chip-color: #2dd4bf; }
.chip--default { --chip-color: var(--text-muted); }

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-background);
  overflow-x: hidden;
}

body.app-shell {
  display: grid;
  min-height: 100vh;
  overflow-x: hidden;
  grid-template-columns: 1fr;
  grid-template-rows: var(--topbar-h) 1fr auto;
  grid-template-areas:
    "topbar"
    "main"
    "footer";
}

@media (min-width: 769px) {
  body.app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas:
      "sidebar topbar"
      "sidebar main";
  }
}

/* Scrollbar técnico */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0e0e0e; }
::-webkit-scrollbar-thumb { background: var(--bg-container-highest); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #3f4753; }

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 300;
  padding: var(--space-sm) var(--space-md);
  background: var(--accent);
  color: #002f54;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-md);
}

/* ==========================================================================
   Sidebar (desktop)
   ========================================================================== */

.app-sidebar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 120;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  max-height: 100vh;
  background: #0b0b0b;
  border-right: 1px solid rgba(137, 145, 158, 0.22);
  overflow: hidden;
}

.app-sidebar__brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  min-height: 92px;
  gap: 0.85rem;
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.app-sidebar__brand-text {
  min-width: 0;
  flex: 1;
}

.app-sidebar__logo {
  display: block;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(0, 153, 255, 0.28);
  box-shadow: 0 0 12px rgba(0, 153, 255, 0.15);
}

.app-sidebar__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid rgba(0, 153, 255, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: var(--accent-glow);
}

.app-sidebar__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-align: left;
  line-height: 1.15;
}

.app-sidebar__tagline {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  line-height: 1.25;
}

.app-sidebar .site-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
  padding: var(--space-md) 0;
  overflow-y: auto;
}

.app-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-height: 48px;
  padding: var(--space-12) var(--space-md);
  margin: 0 var(--space-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.app-sidebar .nav-link:hover {
  color: var(--text-primary);
  background: rgba(53, 53, 52, 0.35);
}

.app-sidebar .nav-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  color: var(--text-primary);
}

.app-sidebar .nav-link.is-active {
  color: var(--accent-light);
  background: rgba(0, 153, 255, 0.08);
  border-left-color: var(--accent);
  font-weight: 700;
}

.nav-icon {
  font-size: 1.15rem;
  width: 1.35rem;
  text-align: center;
  opacity: 0.9;
  flex-shrink: 0;
}

.app-sidebar__footer {
  margin-top: auto;
  flex-shrink: 0;
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

@media (min-width: 769px) {
  .app-sidebar {
    display: flex;
    grid-area: sidebar;
  }
}

/* ==========================================================================
   Topbar
   ========================================================================== */

.app-topbar {
  grid-area: topbar;
  position: sticky;
  top: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-sm);
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  padding: 0 var(--space-md);
  background: rgba(12, 12, 12, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 153, 255, 0.16);
}

@media (min-width: 769px) {
  .app-topbar {
    padding-inline: var(--main-pad-x);
  }
}

.topbar-context-block {
  display: none;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
  min-height: 34px;
  padding: 0.2rem 0 0.2rem 0.875rem;
  border-left: 3px solid var(--accent);
}

@media (min-width: 769px) {
  .topbar-context-block {
    display: flex;
  }
}

.topbar-context__kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.35;
}

.topbar-context__sep {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(137, 145, 158, 0.55);
  line-height: 1;
}

.topbar-context {
  display: block;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-light);
  line-height: 1.35;
}

.topbar-mobile-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

@media (min-width: 769px) {
  .topbar-mobile-brand {
    display: none;
  }
}

.topbar-mobile-brand__logo {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 153, 255, 0.3);
}

.topbar-mobile-brand strong {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.topbar-spacer {
  display: none;
}

/* Nav toggle (mobile drawer fallback) */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-stroke);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

@media (min-width: 769px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text-primary);
  border-radius: 1px;
  transition: var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav drawer */
.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  z-index: 105;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-sm);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.mobile-nav-drawer.is-open {
  display: flex;
}

@media (min-width: 769px) {
  .mobile-nav-drawer {
    display: none !important;
  }
}

.mobile-nav-drawer .nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 4px solid transparent;
}

.mobile-nav-drawer .nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.mobile-nav-drawer .nav-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.mobile-nav-drawer .nav-link.is-active {
  color: var(--accent-light);
  background: var(--accent-muted);
  border-left-color: var(--accent);
}

/* ==========================================================================
   Bottom nav (mobile)
   ========================================================================== */

.app-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 110;
  align-items: stretch;
  justify-content: space-around;
  height: var(--bottom-nav-h);
  padding: 0 var(--space-xs);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 153, 255, 0.12);
}

@media (min-width: 769px) {
  .app-bottom-nav {
    display: none;
  }
}

.app-bottom-nav .nav-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-xs);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: color var(--transition), background var(--transition);
}

.app-bottom-nav .nav-link:hover {
  color: var(--text-primary);
  background: var(--accent-muted);
}

.app-bottom-nav .nav-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.app-bottom-nav .nav-link.is-active {
  color: var(--accent-light);
  font-weight: 700;
}

.app-bottom-nav .nav-icon {
  font-size: 1.15rem;
}

/* Brand mark (shared) */
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid rgba(0, 153, 255, 0.3);
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Main content
   ========================================================================== */

.app-main {
  grid-area: main;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: var(--main-pad-y) var(--space-md) calc(var(--bottom-nav-h) + var(--space-xl));
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

@media (min-width: 769px) {
  .app-main {
    padding: var(--main-pad-y) var(--main-pad-x) var(--space-2xl);
  }
}

.app-main::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: min(40vw, 420px);
  height: min(40vw, 420px);
  border-radius: 50%;
  background: rgba(0, 153, 255, 0.04);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  transform: translate(20%, -20%);
}

/* Utilidad interna — no aplicar al <main> global */
.main-content {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
}

.view {
  display: none;
  width: 100%;
  min-width: 0;
  animation: fadeIn 220ms ease;
}

.view--active {
  display: block;
}

/* Ancho por vista — centrado controlado (sin doble centrado en main) */
.view--builder {
  width: min(100%, var(--builder-max-w));
  margin-inline: auto;
}

#view-catalog {
  width: min(100%, var(--catalog-max-w));
  margin-inline: auto;
}

#view-status {
  width: min(100%, var(--status-max-w));
  margin-inline: auto;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Page headers
   ========================================================================== */

.page-header {
  margin-bottom: var(--space-xl);
}

.page-header--compact {
  margin-bottom: var(--space-md);
}

.page-header--compact h1,
#builder-title {
  font-size: clamp(2.5rem, 3.5vw, 3.75rem);
  margin-bottom: 0.5rem;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.page-header--compact .lead {
  font-size: 1rem;
  max-width: 66ch;
  line-height: 1.5;
  margin: 0;
}

.view--builder .page-header {
  max-width: 820px;
}

.page-header--compact .eyebrow {
  margin-bottom: 0.5rem;
}

.eyebrow {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
}

.page-header h1 {
  margin: 0 0 var(--space-md);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0;
  max-width: 62ch;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.lead strong {
  color: var(--text-primary);
}

.lead--center {
  text-align: center;
  margin: 0 auto var(--space-xl);
  max-width: 52ch;
}

/* ==========================================================================
   Home hero
   ========================================================================== */

.home-landing {
  width: min(100%, var(--home-max-w));
  margin-inline: auto;
}

#view-home {
  position: relative;
  width: 100%;
}

#view-home::before {
  content: "";
  position: absolute;
  top: -1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 920px);
  height: min(55vh, 480px);
  background: radial-gradient(ellipse at 50% 20%, rgba(0, 153, 255, 0.1), transparent 68%);
  pointer-events: none;
  z-index: -1;
}

.home-hero-panel {
  position: relative;
  max-width: 1180px;
  margin-inline: auto;
  margin-bottom: var(--space-xl);
  padding: clamp(2rem, 3vw, 3.5rem);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 153, 255, 0.16);
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(0, 153, 255, 0.1), transparent 65%),
    linear-gradient(165deg, rgba(28, 28, 28, 0.95) 0%, rgba(10, 10, 10, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.home-hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 153, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 153, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 85%);
  pointer-events: none;
}

.home-hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(2rem, 4vw, 4rem);
  padding: var(--space-md) 0;
}

@media (min-width: 960px) {
  .home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: var(--space-xl);
    align-items: center;
    text-align: left;
    padding: var(--space-lg) var(--space-md);
  }
}

.home-hero__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
}

@media (min-width: 960px) {
  .home-hero__copy {
    align-items: flex-start;
  }
}

.home-hero__stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding: var(--space-md);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 153, 255, 0.22);
  background: rgba(8, 8, 8, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 48px rgba(0, 153, 255, 0.12);
}

.home-hero__stage-glow {
  position: absolute;
  inset: 8% 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 153, 255, 0.28), transparent 68%);
  filter: blur(28px);
  pointer-events: none;
}

.home-hero__visual {
  width: 100%;
  max-width: 560px;
  margin-bottom: var(--space-lg);
}

.home-hero__image-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  border-radius: var(--radius-xl);
  transition: box-shadow var(--transition), transform var(--transition);
}

.home-hero__image-btn:hover,
.home-hero__image-btn:focus-visible {
  box-shadow: 0 0 40px rgba(0, 153, 255, 0.25);
  transform: translateY(-2px);
  outline: none;
}

.home-hero__brand-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: min(100%, 520px);
  max-height: min(58vh, 520px);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  filter: drop-shadow(0 16px 36px rgba(0, 0, 0, 0.5));
}

.giakor-hero__image {
  max-width: min(100%, 640px);
  max-height: min(62vh, 560px);
  object-fit: contain;
}

.giakor-wordmark {
  letter-spacing: 0.06em;
}

/* Web 2R-1-HF1 — hero brand hierarchy (scoped; not global h1/h2) */
.hero-brand-name {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 7vw, 5.5rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 0.98;
  text-shadow: 0 0 28px rgba(0, 153, 255, 0.22);
}

.hero-tagline {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1.1;
  max-width: 18ch;
  overflow-wrap: normal;
  hyphens: none;
}

@media (max-width: 480px) {
  .hero-brand-name {
    font-size: clamp(2.5rem, 10.5vw, 3rem);
    letter-spacing: 0.03em;
  }

  .hero-tagline {
    font-size: clamp(1.75rem, 8vw, 2.125rem);
    max-width: none;
    line-height: 1.12;
  }
}

.home-hero__tagline {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.home-hero__note {
  margin: 0 0 var(--space-md);
  max-width: 42ch;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.js-lightbox-image {
  cursor: zoom-in;
}

.home-hero__logo-wrap {
  margin-bottom: var(--space-lg);
}

.home-hero__logo {
  display: block;
  width: clamp(120px, 20vw, 180px);
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  box-shadow: 0 0 30px rgba(0, 153, 255, 0.2);
}

.home-hero__monogram-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: var(--space-lg);
}

.home-hero__ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 153, 255, 0.2);
  border-radius: 50%;
  animation: spinSlow 12s linear infinite;
}

.home-hero__ring--inner {
  inset: 8px;
  border-color: rgba(137, 145, 158, 0.25);
  animation-direction: reverse;
  animation-duration: 18s;
}

@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

.home-hero__monogram {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: radial-gradient(circle at 30% 30%, rgba(0, 153, 255, 0.15), #0a0a0a 70%);
  border: 1px solid rgba(0, 153, 255, 0.35);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(0, 153, 255, 0.2);
}

.home-hero__subtitle {
  margin: 0 0 var(--space-lg);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 38ch;
  line-height: 1.6;
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  justify-content: center;
  width: 100%;
}

@media (min-width: 960px) {
  .home-hero__actions {
    justify-content: flex-start;
    max-width: 420px;
  }
}

.home-module-grid {
  margin-top: 0;
  max-width: 1180px;
  margin-inline: auto;
}

.home-landing .lead--center {
  margin-bottom: var(--space-lg);
}

/* Module cards (home) */
.card-grid {
  display: grid;
  gap: var(--space-md);
  width: 100%;
  min-width: 0;
}

.card-grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.card-grid--catalog {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  position: relative;
  min-width: 0;
  padding: var(--space-lg);
  background: #0a0a0a;
  border: 1px solid var(--border-stroke);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: rgba(0, 153, 255, 0.06);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  transition: background var(--transition);
}

.card:hover {
  border-color: rgba(0, 153, 255, 0.35);
  box-shadow: 0 0 20px rgba(0, 153, 255, 0.1);
}

.card:hover::before {
  background: rgba(0, 153, 255, 0.12);
}

.card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-sm);
  font-size: 1.4rem;
  color: var(--accent);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.card h2 {
  position: relative;
  margin: 0 0 var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.card p {
  position: relative;
  margin: 0 0 var(--space-md);
  font-size: var(--text-body);
  color: var(--text-secondary);
  line-height: 1.5;
}

.card--wide {
  grid-column: 1 / -1;
}

.card-tag {
  display: inline-block;
  margin-top: var(--space-sm);
  padding: 0.25rem 0.7rem;
  font-size: var(--text-label);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-container-highest);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* Info banner */
.info-banner {
  max-width: 1180px;
  margin-inline: auto;
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: #0a0a0a;
  border: 1px solid var(--border-stroke);
  border-radius: var(--radius-xl);
}

.info-banner h2 {
  margin: 0 0 var(--space-md);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.check-list,
.muted-list,
.file-list {
  margin: 0;
  padding-left: 1.25rem;
}

.check-list li,
.muted-list li,
.file-list li {
  margin-bottom: var(--space-xs);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.check-list li::marker {
  color: var(--accent);
}

.muted-list li {
  color: var(--text-muted);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 44px;
  min-width: 44px;
  padding: var(--space-12) var(--space-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.btn--primary {
  color: #002f54;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--accent-glow-strong);
}

.btn--secondary {
  color: var(--text-primary);
  background: var(--bg-container-high);
  border-color: var(--border);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn--ghost {
  color: var(--text-secondary);
  background: transparent;
  border-color: var(--border-stroke);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(53, 53, 52, 0.4);
  border-color: var(--text-muted);
}

.btn--sm {
  min-height: 36px;
  padding: var(--space-sm) var(--space-12);
  font-size: 0.75rem;
}

.btn--lg {
  min-height: 48px;
  padding: var(--space-md) var(--space-lg);
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
}

.btn--danger {
  color: var(--error);
  background: rgba(255, 180, 171, 0.08);
  border-color: rgba(255, 180, 171, 0.25);
}

.btn--danger:hover:not(:disabled) {
  color: #fff;
  background: #93000a;
  border-color: #93000a;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ==========================================================================
   Chips
   ========================================================================== */

.chip {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--chip-color, var(--text-muted));
  background: color-mix(in srgb, var(--chip-color, var(--text-muted)) 10%, #0a0a0a);
  border: 1px solid color-mix(in srgb, var(--chip-color, var(--text-muted)) 28%, transparent);
  border-radius: var(--radius-sm);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

/* ==========================================================================
   Catalog
   ========================================================================== */

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: #0a0a0a;
  border: 1px solid var(--border-stroke);
  border-radius: var(--radius-lg);
  width: 100%;
  min-width: 0;
}

.filter-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.select-input,
.field-input,
.field-select,
.field-textarea {
  min-width: 0;
  min-height: 44px;
  padding: 0.72rem 0.85rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  background: #0a0a0a;
  border: 1px solid var(--border-stroke);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.select-input {
  min-width: 180px;
  cursor: pointer;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  max-width: 100%;
}

.select-input:focus,
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 153, 255, 0.35);
}

.catalog-count {
  margin: 0 0 0 auto;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.catalog-custom-panel-host {
  margin-bottom: var(--space-lg);
  width: 100%;
  min-width: 0;
}

.custom-exercise-panel {
  padding: var(--space-md) var(--space-lg);
  background: #0a0a0a;
  border: 1px solid rgba(0, 153, 255, 0.22);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 12px rgba(0, 153, 255, 0.08);
}

.custom-exercise-panel__header h2 {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.custom-exercise-panel__header p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.custom-exercise-form-error {
  margin: var(--space-md) 0 0;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
  color: var(--error);
  background: rgba(147, 0, 10, 0.2);
  border: 1px solid rgba(255, 180, 171, 0.25);
  border-radius: var(--radius-sm);
}

.custom-exercise-panel__grid {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

@media (min-width: 640px) {
  .custom-exercise-panel__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.custom-exercise-panel__field--full {
  grid-column: 1 / -1;
}

.custom-exercise-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.option-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

.option-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.option-chip__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.option-chip__label {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.option-chip__input:focus-visible + .option-chip__label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.option-chip__input:checked + .option-chip__label {
  color: var(--accent-light);
  background: var(--accent-muted);
  border-color: rgba(0, 153, 255, 0.45);
  box-shadow: var(--accent-glow);
}

.option-chip:hover .option-chip__label {
  border-color: rgba(0, 153, 255, 0.3);
  color: var(--text-primary);
}

.target-zone-preview {
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.target-zone-preview--empty {
  border-style: dashed;
  opacity: 0.85;
}

.target-zone-preview__label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.target-zone-preview__body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

.target-zone-preview__value {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 500;
}

.target-zone-preview__placeholder {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.custom-exercise-preview {
  padding: var(--space-md) var(--space-lg);
  background: rgba(0, 153, 255, 0.06);
  border: 1px solid rgba(0, 153, 255, 0.2);
  border-radius: var(--radius-md);
}

.custom-exercise-preview__title {
  margin: 0 0 var(--space-sm);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-light);
}

.custom-exercise-preview__list {
  margin: 0;
  display: grid;
  gap: var(--space-xs);
}

.custom-exercise-preview__list div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: var(--space-sm);
  font-size: var(--text-sm);
}

.custom-exercise-preview__list dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.custom-exercise-preview__list dd {
  margin: 0;
  color: var(--text-primary);
}

.field-hint {
  margin: var(--space-xs) 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Exercise cards */
#view-builder,
#view-catalog,
#view-status {
  overflow-x: hidden;
}

.routine-exercises,
.performed-sets__list {
  width: 100%;
  min-width: 0;
}

.exercise-card {
  min-width: 0;
  overflow-wrap: anywhere;
}

.exercise-card:hover {
  border-color: rgba(0, 153, 255, 0.4);
  box-shadow: 0 0 20px rgba(0, 153, 255, 0.12);
}

.exercise-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.exercise-card .exercise-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.exercise-card .exercise-zone {
  margin: 0 0 var(--space-md);
  font-size: var(--text-body);
  color: var(--text-secondary);
}

.exercise-card .variant-list {
  margin: var(--space-sm) 0 0;
  padding: 0;
  list-style: none;
}

.exercise-card .variant-list li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: 2px 0;
}

.exercise-card .variant-list li::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ==========================================================================
   Builder
   ========================================================================== */

.view--builder .field-input,
.view--builder .field-select {
  min-height: 42px;
  font-size: 0.9375rem;
  padding: 0.65rem 0.8rem;
}

.view--builder .field-textarea {
  min-height: 52px;
  max-height: 84px;
  font-size: 0.9375rem;
  padding: 0.65rem 0.8rem;
}

.view--builder .routine-switcher__select {
  max-width: 100%;
}

#active-routine-select {
  min-height: 42px;
  font-size: 0.9375rem;
}

.builder-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  min-height: 72px;
  margin-bottom: var(--space-md);
  padding: 1rem 1.25rem;
  background: var(--bg-container-high);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: sticky;
  top: calc(var(--topbar-h) + 2px);
  z-index: 10;
}

.builder-toolbar .btn {
  min-height: 42px;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
}

.builder-layout {
  display: grid;
  gap: 1rem;
  width: 100%;
  min-width: 0;
}

/* Routine switcher */
.routine-switcher {
  padding: 1.25rem 1.35rem;
  background: var(--bg-container-high);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.routine-switcher__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
}

.routine-switcher .btn {
  min-height: 42px;
  padding-inline: 1.15rem;
}

.routine-switcher__select {
  flex: 1;
  min-width: min(100%, 200px);
}

.routine-switcher__count {
  margin: 0.35rem 0 0;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

/* Create routine panel */
.create-routine-panel {
  padding: var(--space-md);
  background: #0a0a0a;
  border: 1px solid rgba(0, 153, 255, 0.22);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 12px rgba(0, 153, 255, 0.08);
}

.create-routine-panel__header h2 {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.create-routine-panel__header p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.create-routine-form-error {
  margin: var(--space-md) 0 0;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
  color: var(--error);
  background: rgba(147, 0, 10, 0.2);
  border: 1px solid rgba(255, 180, 171, 0.25);
  border-radius: var(--radius-sm);
}

.create-routine-panel__grid {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

@media (min-width: 640px) {
  .create-routine-panel__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.create-routine-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* Routine header */
.routine-header {
  padding: 1.25rem 1.35rem;
  background: var(--bg-container-high);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.routine-header h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.routine-header > p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.routine-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.routine-meta span strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.routine-exercises {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* Persistence indicator */
.persistence-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 38px;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.persistence-indicator::before {
  content: "●";
  font-size: 0.7rem;
}

.persistence-indicator--demo {
  color: var(--text-secondary);
  background: var(--bg-elevated);
}

.persistence-indicator--demo::before {
  color: var(--text-muted);
}

.persistence-indicator--local {
  color: var(--accent-light);
  background: var(--accent-muted);
  border-color: rgba(0, 153, 255, 0.3);
}

.persistence-indicator--local::before {
  color: var(--accent);
}

.persistence-indicator--saved {
  color: var(--success);
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.25);
}

.persistence-indicator--saved::before {
  color: var(--success);
}

/* Exercise cards in builder */
.routine-exercise {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  background: var(--bg-container-high);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition);
}

.routine-exercise--editable {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 769px) {
  .routine-exercise--editable {
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
}

.routine-exercise:hover {
  border-color: rgba(0, 153, 255, 0.3);
}

.routine-exercise__order {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid rgba(0, 153, 255, 0.3);
  border-radius: var(--radius-sm);
}

.routine-exercise > .routine-exercise__order {
  margin: var(--space-md);
  align-self: start;
}

@media (min-width: 769px) {
  .routine-exercise > .routine-exercise__order {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    width: 100%;
    height: 36px;
    min-height: 36px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(19, 19, 19, 0.5);
    padding: 0;
  }
}

.routine-exercise__body {
  padding: var(--space-md);
  min-width: 0;
}

@media (min-width: 769px) {
  .routine-exercise__body {
    grid-column: 2;
    grid-row: 1 / -1;
    padding: 1.1rem 1.2rem;
  }
}

.routine-exercise__header {
  margin-bottom: 0.65rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.routine-exercise__body h3,
.routine-exercise__title,
.routine-exercise h2,
.routine-exercise h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.15;
}

.routine-exercise__details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: 0.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.routine-exercise__form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

@media (min-width: 640px) {
  .view--builder .routine-exercise__form {
    grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1.2fr) minmax(120px, 0.75fr) minmax(140px, 0.85fr);
  }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.field-group--wide {
  grid-column: 1 / -1;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field-input--error {
  border-color: var(--error);
}

.field-error {
  font-size: var(--text-xs);
  color: var(--error);
}

.field-textarea {
  resize: vertical;
  min-height: 58px;
  max-height: 92px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Performed sets */
.performed-sets {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-subtle);
  max-width: 100%;
}

.performed-sets__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.performed-sets__header h4,
.performed-sets__title,
.performed-sets h4 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.performed-sets__list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.performed-sets__empty {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-style: italic;
}

.performed-set-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0.5rem 0.7rem;
  background: #0a0a0a;
  border: 1px solid var(--border-stroke);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}

.performed-set-card:hover {
  border-color: var(--border);
}

.performed-set-card--editing {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-surface);
  border-color: rgba(0, 153, 255, 0.35);
  box-shadow: 0 0 10px rgba(0, 153, 255, 0.18);
}

.performed-set-card--draft {
  border-style: dashed;
}

.performed-set-card__editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
}

.performed-set-segments {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  width: 100%;
}

.performed-set-segments__title {
  font-size: var(--text-label);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.performed-set-segments__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.performed-set-segment {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-xs);
  padding: var(--space-xs);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.performed-set-segment__label {
  flex: 1 1 100%;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.performed-set-segment__fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  flex: 1;
}

.performed-set-segments__add {
  align-self: flex-start;
}

.performed-set-card__field--note {
  width: 100%;
}

.performed-set-card__field--note .field-input--compact {
  width: 100%;
  min-width: 0;
}

.performed-set-card--editing .performed-set-card__actions {
  margin-left: 0;
  width: 100%;
  justify-content: flex-end;
}

/* Editor compacto — series efectuadas (Web 2M-2D) */
.performed-set-editor {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  padding: 0.15rem 0;
}

.performed-set-editor__top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.performed-set-editor__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.performed-set-editor__method {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 9rem;
  max-width: 14rem;
  flex: 1 1 9rem;
}

.performed-set-editor__method-label,
.performed-set-editor__note-label,
.performed-set-editor__segment-field-label {
  font-size: var(--text-label);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.performed-set-editor__method .field-select--compact {
  min-width: 0;
  width: 100%;
}

.performed-set-editor__segments {
  margin-top: 0.15rem;
}

.performed-set-editor__segments-title {
  font-size: var(--text-label);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.performed-set-editor__segments-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.performed-set-editor__segment-row {
  display: grid;
  grid-template-columns: auto 1fr 1fr auto;
  align-items: end;
  gap: 0.4rem 0.5rem;
}

.performed-set-editor__segment-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  padding-bottom: 0.45rem;
  align-self: end;
}

.performed-set-editor__segment-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.performed-set-editor__segment-remove {
  align-self: end;
  margin-bottom: 0.1rem;
  font-size: 0.6875rem;
  padding: 0.35rem 0.5rem;
  opacity: 0.85;
}

.performed-set-editor__add-segment {
  margin-top: 0.35rem;
  align-self: flex-start;
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
}

.performed-set-editor__note {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 0.15rem;
  width: 100%;
}

.performed-set-editor__note .field-input--compact {
  width: 100%;
  min-width: 0;
}

.performed-set-editor__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.25rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-subtle);
}

/* Web 2M-2E — Performed sets polish */
.performed-set-card--read {
  align-items: flex-start;
}

.performed-set-card--read .performed-set-card__main--read {
  flex: 1;
  min-width: 0;
}

.performed-set-card--read .performed-set-card__actions {
  flex-shrink: 0;
  margin-left: auto;
  margin-top: 0.05rem;
  padding-top: 0.1rem;
  align-self: flex-start;
}

/* Web 2M-2F — Auditoría post-cierre series efectuadas */
.performed-set-card--read {
  gap: 0.5rem;
}

.performed-set-card__main-row--multi {
  justify-content: flex-start;
}

.performed-set-card__main-row--multi .performed-set-card__title {
  flex: 0 1 auto;
}

.performed-set-card--read .performed-set-card__summary {
  max-width: calc(100% - 9.5rem);
}

@media (max-width: 640px) {
  .performed-set-card--read .performed-set-card__summary {
    max-width: 100%;
  }

  .performed-set-card--read .performed-set-card__actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

.performed-set-card__segments {
  line-height: 1.45;
}

.performed-set-card__note--after-segments {
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--border-subtle);
}

.performed-set-editor__segments {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
}

.performed-set-editor__note {
  margin-top: 0.35rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border-subtle);
}

.performed-set-editor__actions .btn {
  min-width: 5.5rem;
}

.performed-sets__list {
  gap: 0.4rem;
}

@media (max-width: 520px) {
  .performed-set-editor__segment-row {
    grid-template-columns: 1fr 1fr;
  }

  .performed-set-editor__segment-label {
    grid-column: 1 / -1;
    padding-bottom: 0;
  }

  .performed-set-editor__segment-remove {
    grid-column: 1 / -1;
    justify-self: start;
    margin-bottom: 0;
  }

  .performed-set-editor__method {
    max-width: none;
    flex: 1 1 100%;
  }
}

.performed-set-card__main--read {
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
}

.performed-set-card__main-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  width: 100%;
}

.performed-set-card__title {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.performed-set-card__method-badge,
.performed-set-method-badge {
  display: inline-block;
  flex-shrink: 0;
  padding: 0.15rem 0.45rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0, 153, 255, 0.08);
  border: 1px solid rgba(0, 153, 255, 0.35);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.performed-set-card__summary {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
}

.performed-set-card__main-row--single {
  justify-content: flex-start;
}

.performed-set-card__main-row--single .performed-set-card__title {
  flex: 0 1 auto;
}

.performed-set-card--read .performed-set-card__badge--method,
.performed-set-card--read .performed-set-method-badge {
  flex-shrink: 0;
}

.performed-set-card__segments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  width: 100%;
}

.performed-set-card__segment {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.performed-set-card__segment-separator {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.55;
  user-select: none;
}

.performed-set-card__note {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted);
  opacity: 0.88;
}

.performed-set-card__label {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.performed-set-card__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.performed-set-card__badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.performed-set-card__badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--warning);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.performed-set-card__badge--method {
  color: var(--accent);
  border-color: rgba(0, 153, 255, 0.35);
  background: rgba(0, 153, 255, 0.08);
}

.performed-set-card__field--method {
  min-width: 9.5rem;
  flex: 1 1 9.5rem;
}

.performed-set-card__field--method .field-select--compact {
  min-width: 100%;
}

.performed-sets__method-hint,
.performed-sets__schema-mismatch {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.performed-sets__method-hint {
  color: var(--text-muted);
}

.performed-sets__schema-mismatch {
  color: var(--warning);
}

.performed-set-card__serie {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.performed-set-card__fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  flex: 1;
}

.performed-set-card__field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 4.5rem;
}

.performed-set-card__field-label {
  font-size: var(--text-label);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.performed-set-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-left: auto;
}

.field-input--compact {
  min-height: 2.25rem;
  padding: 0.45rem 0.55rem;
  font-size: var(--text-sm);
  min-width: 4.5rem;
}

.routine-exercise__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  grid-column: 1 / -1;
  padding: 0.6rem;
  border-top: 1px solid var(--border-subtle);
}

.view--builder .performed-set-card .btn,
.performed-set-card__actions .btn {
  min-height: 34px;
  padding: 0.45rem 0.7rem;
  font-size: 0.75rem;
}

.view--builder .performed-sets .btn--primary,
.view--builder .performed-sets .btn--ghost {
  min-height: 36px;
  font-size: 0.8125rem;
  padding: 0.5rem 0.85rem;
}

/* Target blocks — planificación compacta (Web 2P-1A) */
.target-blocks--compact {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.target-blocks--compact h4 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.target-blocks__plan-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  margin: 0.25rem 0 0.5rem;
}

.target-blocks__plan-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-primary);
  background: rgba(0, 153, 255, 0.07);
  border: 1px solid rgba(0, 153, 255, 0.22);
  border-radius: 999px;
  white-space: nowrap;
}

.target-blocks__plan-chips--empty .target-blocks__plan-chip {
  opacity: 0.65;
}

/* Web 2P-1E / 2P-1E-HF1 — Resumen visual profesional de bloques objetivo planificado */
.target-block-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  margin: 0.35rem 0 0.65rem;
}

.target-block-summary-list--empty .target-block-summary-card--empty {
  opacity: 0.65;
}

.target-block-summary-card {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 8.75rem;
  max-width: 100%;
  padding: 0.45rem 0.62rem;
  border: 1px solid rgba(0, 153, 255, 0.2);
  border-radius: var(--radius-md, 8px);
  background: rgba(0, 153, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.target-block-summary-card--method {
  border-color: rgba(0, 153, 255, 0.32);
  background: rgba(0, 153, 255, 0.09);
}

.target-block-summary-card__block {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--accent, #0099ff);
  letter-spacing: 0.02em;
}

.target-block-summary-card__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.28rem 0.35rem;
  line-height: 1.35;
}

.target-block-summary-card__row--reps {
  align-items: center;
}

.target-block-summary-card__label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.target-block-summary-card__value {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.target-block-summary-card__method {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.38rem;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--accent, #0099ff);
  background: rgba(0, 153, 255, 0.12);
  border: 1px solid rgba(0, 153, 255, 0.24);
  border-radius: 999px;
  white-space: nowrap;
}

.target-block-summary-card--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .target-block-summary-card {
    min-width: calc(50% - 0.35rem);
    flex: 1 1 calc(50% - 0.35rem);
  }

  .target-block-summary-card__row {
    white-space: normal;
  }

  .target-block-summary-card__value,
  .target-block-summary-card__method {
    white-space: normal;
  }
}

.target-blocks__summary {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-word;
}

.target-blocks__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Web 2N-0 — Resumen derivado objetivo vs ejecución */
.exercise-execution-summary {
  margin-top: 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  background: rgba(255, 255, 255, 0.02);
}

.exercise-execution-summary__title {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.exercise-execution-summary__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
}

.exercise-execution-summary__chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-primary);
  background: rgba(0, 153, 255, 0.06);
  border: 1px solid rgba(0, 153, 255, 0.16);
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.exercise-execution-summary__chip--muted {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-subtle);
}

.exercise-execution-summary__chip--status {
  font-weight: 600;
}

.exercise-execution-summary__chip--status-pending,
.exercise-execution-summary__chip--status-partial {
  color: #f5c26b;
  background: rgba(245, 194, 107, 0.1);
  border-color: rgba(245, 194, 107, 0.35);
}

.exercise-execution-summary__chip--status-complete {
  color: #7ddea8;
  background: rgba(125, 222, 168, 0.1);
  border-color: rgba(125, 222, 168, 0.35);
}

.exercise-execution-summary__chip--status-exceeded {
  color: #8ec5ff;
  background: rgba(142, 197, 255, 0.1);
  border-color: rgba(142, 197, 255, 0.35);
}

.exercise-execution-summary__chip--status-no-objective,
.exercise-execution-summary__chip--status-no-objective-with-execution {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-subtle);
}

@media (max-width: 640px) {
  .exercise-execution-summary__chip {
    white-space: normal;
  }
}

/* Web 2N-1 — Resumen global de rutina objetivo vs ejecución */
.routine-execution-summary {
  margin: 0.75rem 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(0, 153, 255, 0.22);
  border-radius: var(--radius-md, 8px);
  background: rgba(0, 153, 255, 0.04);
}

.routine-execution-summary__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.routine-execution-summary__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.45rem;
}

.routine-summary-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin-left: auto;
}

.routine-summary-copy-button {
  min-height: 30px !important;
  padding: 0.2rem 0.65rem !important;
  font-size: 0.75rem !important;
}

.routine-summary-copy-feedback {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.routine-summary-copy-feedback--ok {
  color: #4ade80;
}

.routine-summary-copy-feedback--error {
  color: #fb923c;
}

.routine-execution-summary__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
}

.routine-execution-summary__chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-primary);
  background: rgba(0, 153, 255, 0.08);
  border: 1px solid rgba(0, 153, 255, 0.2);
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.routine-execution-summary__chip--strong {
  font-weight: 600;
  color: var(--accent, #0099ff);
  background: rgba(0, 153, 255, 0.12);
  border-color: rgba(0, 153, 255, 0.28);
}

.routine-execution-summary__chip--muted {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-subtle);
}

.routine-execution-summary__chip--status {
  font-weight: 600;
}

.routine-execution-summary__chip--status-no-exercises,
.routine-execution-summary__chip--status-no-objective,
.routine-execution-summary__chip--status-no-objective-with-execution {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-subtle);
}

.routine-execution-summary__chip--status-pending,
.routine-execution-summary__chip--status-in-progress {
  color: #f5c842;
  background: rgba(245, 200, 66, 0.1);
  border-color: rgba(245, 200, 66, 0.28);
}

.routine-execution-summary__chip--status-complete {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.28);
}

.routine-execution-summary__chip--status-exceeded {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.1);
  border-color: rgba(251, 146, 60, 0.28);
}

@media (max-width: 640px) {
  .routine-execution-summary__chip {
    white-space: normal;
  }
}

/* Web 2N-3 — Filtros rápidos por estado de ejecución */
.builder-exercise-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
  margin: 0.55rem 0 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  background: rgba(255, 255, 255, 0.02);
}

.builder-exercise-filters__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.builder-exercise-filters__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
  flex: 1 1 auto;
}

.builder-exercise-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-primary);
  background: rgba(0, 153, 255, 0.06);
  border: 1px solid rgba(0, 153, 255, 0.16);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.builder-exercise-filter-chip:hover {
  background: rgba(0, 153, 255, 0.1);
  border-color: rgba(0, 153, 255, 0.28);
}

.builder-exercise-filter-chip--active {
  color: var(--accent, #0099ff);
  font-weight: 600;
  background: rgba(0, 153, 255, 0.14);
  border-color: rgba(0, 153, 255, 0.38);
  box-shadow: 0 0 0 1px rgba(0, 153, 255, 0.12);
}

.builder-exercise-filter-empty {
  margin: 0.5rem 0 0;
  padding: 0.75rem 0.85rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 640px) {
  .builder-exercise-filters {
    flex-direction: column;
    align-items: flex-start;
  }

  .builder-exercise-filter-chip {
    white-space: normal;
  }

  .builder-filter-copy-actions {
    width: 100%;
  }
}

.builder-filter-copy-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.builder-filter-copy-button {
  white-space: nowrap;
  font-size: 0.75rem;
  padding: 0.22rem 0.55rem;
  line-height: 1.35;
}

.builder-filter-copy-feedback {
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.builder-filter-copy-feedback--ok {
  color: var(--success, #3dd68c);
}

.builder-filter-copy-feedback--error {
  color: var(--danger, #ff5c5c);
}

.target-blocks-editor {
  margin-top: 0.55rem;
  padding: 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(19, 19, 19, 0.4);
}

.target-blocks-editor__head {
  display: none;
}

.target-blocks-editor__rows {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.target-block-row {
  display: grid;
  grid-template-columns: 2.5rem repeat(3, minmax(0, 1fr));
  gap: 0.35rem 0.45rem;
  align-items: center;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: rgba(12, 12, 12, 0.55);
}

.target-block-row__cell--label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

.target-block-row__cell--actions {
  display: inline-flex;
  gap: 0.15rem;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.target-block-row__order-btn {
  min-height: 28px !important;
  min-width: 28px;
  padding: 0.15rem 0.3rem !important;
  font-size: 0.75rem !important;
}

.target-block-row__cell[data-label]::before {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary);
  content: attr(data-label);
}

.target-blocks-editor__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-subtle);
}

.target-blocks-editor__save-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
}

.field-select--compact {
  min-height: 34px;
  font-size: 0.8125rem;
}

.target-block-row .field-input--compact {
  min-height: 34px;
  font-size: 0.8125rem;
}

@media (min-width: 768px) {
  .target-blocks-editor__head {
    display: grid;
    grid-template-columns: 2.5rem 4.5rem minmax(4.5rem, 1fr) 5rem minmax(5.5rem, 1fr) minmax(5.5rem, 1fr) 6.5rem;
    gap: 0.45rem;
    padding: 0 0.5rem 0.35rem;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary);
  }

  .target-block-row {
    grid-template-columns: 2.5rem 4.5rem minmax(4.5rem, 1fr) 5rem minmax(5.5rem, 1fr) minmax(5.5rem, 1fr) 6.5rem;
    padding: 0.35rem 0.5rem;
    border: none;
    border-radius: 0;
    background: transparent;
    border-bottom: 1px solid var(--border-subtle);
  }

  .target-block-row:last-child {
    border-bottom: none;
  }

  .target-block-row__cell--actions {
    grid-column: auto;
    justify-content: flex-start;
  }

  .target-block-row__cell[data-label]::before {
    display: none;
  }
}

.routine-exercise__form--notes {
  margin-top: 0.65rem;
}

@media (min-width: 769px) {
  .routine-exercise__actions {
    grid-column: 1;
    grid-row: 2;
    flex-direction: column;
    align-items: stretch;
    padding: 0.55rem 0.5rem;
    border-top: 1px solid var(--border-subtle);
    border-left: none;
    background: rgba(19, 19, 19, 0.35);
    justify-content: flex-start;
    gap: 0.4rem;
  }

  .routine-exercise__actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 34px;
    padding: 0.45rem 0.55rem;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    line-height: 1.2;
  }

  .site-footer {
    display: none;
  }
}

.builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* Add exercise panel */
.add-exercise-panel {
  padding: var(--space-lg);
  background: #0a0a0a;
  border: 1px solid rgba(0, 153, 255, 0.25);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.add-exercise-panel__header h2 {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.add-exercise-panel__header p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.add-exercise-form-error {
  margin: var(--space-md) 0 0;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
  color: var(--error);
  background: rgba(147, 0, 10, 0.2);
  border: 1px solid rgba(255, 180, 171, 0.25);
  border-radius: var(--radius-sm);
}

.add-exercise-panel__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

@media (min-width: 769px) {
  .add-exercise-panel__grid {
    grid-template-columns: 1fr minmax(220px, 280px);
    align-items: start;
  }
}

.add-exercise-panel__form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
}

.add-exercise-preview {
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.add-exercise-preview--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
}

.add-exercise-preview--empty p {
  margin: 0;
}

.add-exercise-preview__title {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.add-exercise-preview__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.add-exercise-preview__zone {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.add-exercise-preview__details {
  margin: 0;
  font-size: 0.8rem;
}

.add-exercise-preview__details div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.add-exercise-preview__details div:last-child {
  border-bottom: none;
}

.add-exercise-preview__details dt {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--text-label);
  letter-spacing: 0.05em;
}

.add-exercise-preview__details dd {
  margin: 0;
  text-align: right;
  color: var(--text-secondary);
}

.add-exercise-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Status grid
   ========================================================================== */

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
  width: 100%;
  min-width: 0;
}

.status-grid .card {
  background: #0a0a0a;
}

.status-grid .card h2 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.125rem;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-md);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-light);
  background: var(--accent-muted);
  border: 1px solid rgba(0, 153, 255, 0.25);
  border-radius: 999px;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.meta-list {
  margin: 0;
}

.meta-list div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-body);
}

.meta-list div:last-child {
  border-bottom: none;
}

.meta-list dt {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.meta-list dd {
  margin: 0;
  text-align: right;
  color: var(--text-secondary);
  word-break: break-word;
}

.file-list code {
  color: var(--accent-light);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.error-text {
  color: var(--error);
  font-size: 0.9rem;
}

.builder-error {
  padding: var(--space-lg);
  background: #0a0a0a;
  border: 1px solid rgba(255, 180, 171, 0.3);
  border-radius: var(--radius-lg);
}

.builder-error__hint {
  margin: var(--space-md) 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.empty-state {
  grid-column: 1 / -1;
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-muted);
  background: #0a0a0a;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* Footer */
.site-footer {
  grid-area: footer;
  margin: 0;
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: #0e0e0e;
}

.site-footer p {
  margin: 0;
}

.site-footer__brand {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.site-footer__meta {
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Lightbox (imágenes ampliables)
   ========================================================================== */

body.lightbox-open {
  overflow: hidden;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lightbox__figure {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(96vw, 900px);
  max-height: 90vh;
}

.lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.lightbox__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-primary);
  background: rgba(19, 19, 19, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  background: var(--bg-hover);
  border-color: rgba(0, 153, 255, 0.4);
  outline: none;
}

/* ==========================================================================
   Responsive tweaks
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --topbar-h: 60px;
  }

  .app-main {
    padding-inline: 1rem;
  }

  .view--builder,
  #view-catalog,
  #view-status,
  .home-landing {
    width: 100%;
    max-width: none;
  }

  .routine-exercise,
  .routine-exercise--editable {
    grid-template-columns: 1fr;
  }

  .routine-exercise__form,
  .view--builder .routine-exercise__form {
    grid-template-columns: 1fr;
  }

  .routine-switcher__row {
    grid-template-columns: 1fr;
  }

  .catalog-count {
    margin-left: 0;
    width: 100%;
  }

  .home-hero__actions .btn {
    width: 100%;
  }

  .card-grid--3 {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------------------- */
/* Cuenta GIAKOR — WEB-SYNC-3A                                                */
/* -------------------------------------------------------------------------- */

.account-shell {
  max-width: 640px;
}

.account-shell__live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.account-shell__panel {
  display: grid;
  gap: 0.75rem;
}

.account-shell__heading {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.account-shell__copy {
  margin: 0;
  color: var(--text-secondary, rgba(255, 255, 255, 0.72));
  line-height: 1.5;
}

.account-shell__meta {
  margin: 0;
  font-size: 0.925rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  line-height: 1.45;
}

.account-shell__identity {
  margin-top: 0.5rem;
}

.account-shell[data-account-status="error"] .account-shell__heading {
  color: var(--danger, #ff6b6b);
}

.account-shell[data-account-status="signed_in"] .account-shell__heading {
  color: var(--accent, #3b82f6);
}

.account-shell[data-account-status="configuration_missing"] .account-shell__heading {
  color: var(--text-secondary, rgba(255, 255, 255, 0.8));
}

.account-shell__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* -------------------------------------------------------------------------- */
/* Auth pages — WEB-SYNC-3B                                                   */
/* -------------------------------------------------------------------------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg, #070b14);
  color: var(--text, #f3f6ff);
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.auth-brand img {
  border-radius: 8px;
}

.auth-topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.auth-topnav a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.925rem;
}

.auth-topnav a:hover,
.auth-topnav a:focus-visible {
  color: #fff;
}

.auth-main {
  width: min(720px, calc(100% - 2rem));
  margin: 1.5rem auto 2.5rem;
  flex: 1;
}

.auth-card {
  display: grid;
  gap: 1rem;
}

.auth-live {
  min-height: 1.25rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.78);
}

.auth-live[data-auth-status-kind="error"] {
  color: #ff8f8f;
}

.auth-live[data-auth-status-kind="success"] {
  color: #7dd3a7;
}

.auth-live[data-auth-status-kind="pending"] {
  color: #9ec1ff;
}

.auth-form {
  display: grid;
  gap: 0.95rem;
}

.auth-form .field {
  display: grid;
  gap: 0.4rem;
}

.auth-form label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.78);
}

.auth-form input {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  padding: 0.65rem 0.8rem;
}

.auth-form input:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.auth-form[aria-busy="true"] {
  opacity: 0.72;
}

.auth-actions,
.auth-pending {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.auth-links {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
}

.auth-links a {
  color: #9ec1ff;
}

.auth-code {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

.auth-panel h2 {
  margin: 0 0 0.35rem;
}

@media (max-width: 720px) {
  .app-bottom-nav .nav-link span:not(.nav-icon) {
    font-size: 0.7rem;
  }

  .auth-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
