@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

/* =========================================================
   RutinaSimple — Neumorfismo fitness
   Misma superficie + sombras duales + acentos de gym
   ========================================================= */

:root {
  color-scheme: dark;

  /* Superficie única (clave del soft UI) */
  --bg-base: #1A211D;
  --bg-color: #1A211D;
  --bg-elevated: #1A211D;
  --bg-card: #1A211D;
  --bg-card-hover: #1F2823;
  --bg-soft: #151B18;

  --text-main: #F0F7F3;
  --text-light: #8FA399;

  /* Acento lima (energía / progreso) */
  --accent: #8FEA5C;
  --accent-2: #5FD93A;
  --accent-3: #B8FF8A;
  --accent-gradient: linear-gradient(145deg, #A8F56E 0%, #5FD93A 100%);
  --accent-soft: rgba(143, 234, 92, 0.16);
  --accent-glow: rgba(143, 234, 92, 0.28);
  --accent-on: #122016;

  /* Energía secundaria */
  --energy: #FF8A5B;
  --energy-soft: rgba(255, 138, 91, 0.16);
  --mint: #5EEAD4;
  --mint-soft: rgba(94, 234, 212, 0.16);
  --sky: #7DD3FC;
  --sky-soft: rgba(125, 211, 252, 0.16);

  --success-color: #8FEA5C;
  --danger-color: #FF6B7A;

  --border: rgba(255, 255, 255, 0.05);
  --border-strong: rgba(255, 255, 255, 0.09);

  /* Neumorfismo oscuro: luz arriba-izq / sombra abajo-der */
  --neu-dark: rgba(0, 0, 0, 0.55);
  --neu-light: rgba(255, 255, 255, 0.055);
  --clay-dark: var(--neu-dark);
  --clay-light: var(--neu-light);
  --clay-inner-light: rgba(255, 255, 255, 0.05);
  --clay-inner-dark: rgba(0, 0, 0, 0.45);
  --clay-raised:
    8px 8px 16px var(--neu-dark),
    -6px -6px 14px var(--neu-light);
  --clay-raised-sm:
    5px 5px 10px var(--neu-dark),
    -4px -4px 10px var(--neu-light);
  --clay-pressed:
    inset 5px 5px 10px rgba(0, 0, 0, 0.5),
    inset -4px -4px 10px rgba(255, 255, 255, 0.04);
  --clay-float:
    12px 12px 24px var(--neu-dark),
    -8px -8px 18px var(--neu-light);
  --clay-accent:
    6px 10px 20px rgba(143, 234, 92, 0.28),
    -3px -3px 10px rgba(255, 255, 255, 0.05),
    inset 1px 1px 0 rgba(255, 255, 255, 0.22);

  --shadow: var(--clay-raised);
  --shadow-accent: var(--clay-accent);

  --glass: var(--bg-card);
  --glass-strong: var(--bg-elevated);
  --glass-border: var(--border);
  --glass-highlight: var(--clay-inner-light);
  --glass-shadow: var(--clay-raised);
  --inset-soft: var(--clay-pressed);
  --shadow-dark: #0E1210;
  --shadow-light: #26302B;

  --app-radius: 40px;
  --card-radius: 28px;
  --btn-radius: 22px;
  --chip-radius: 20px;
  --space-screen: 20px;
  --font: 'Nunito', system-ui, sans-serif;
  --font-display: 'Outfit', 'Nunito', sans-serif;
}

[data-theme="light"] {
  color-scheme: light;

  /* Soft UI clásico tintado gym */
  --bg-base: #E4EDE7;
  --bg-color: #E4EDE7;
  --bg-elevated: #E4EDE7;
  --bg-card: #E4EDE7;
  --bg-card-hover: #EEF5F0;
  --bg-soft: #D8E4DC;

  --text-main: #1A2E24;
  --text-light: #5A7266;

  --accent: #22A85A;
  --accent-2: #16A34A;
  --accent-3: #4ADE80;
  --accent-gradient: linear-gradient(145deg, #34D399 0%, #16A34A 100%);
  --accent-soft: rgba(34, 168, 90, 0.14);
  --accent-glow: rgba(34, 168, 90, 0.25);
  --accent-on: #FFFFFF;

  --energy: #FF6B4A;
  --energy-soft: rgba(255, 107, 74, 0.14);
  --mint: #14B8A6;
  --mint-soft: rgba(20, 184, 166, 0.14);
  --sky: #0EA5E9;
  --sky-soft: rgba(14, 165, 233, 0.14);

  --danger-color: #E11D48;
  --border: rgba(26, 46, 36, 0.06);
  --border-strong: rgba(26, 46, 36, 0.1);

  --neu-dark: rgba(45, 90, 65, 0.18);
  --neu-light: rgba(255, 255, 255, 0.9);
  --clay-dark: var(--neu-dark);
  --clay-light: var(--neu-light);
  --clay-inner-light: rgba(255, 255, 255, 0.85);
  --clay-inner-dark: rgba(45, 90, 65, 0.1);
  --clay-raised:
    9px 9px 18px var(--neu-dark),
    -9px -9px 18px var(--neu-light);
  --clay-raised-sm:
    5px 5px 12px var(--neu-dark),
    -5px -5px 12px var(--neu-light);
  --clay-pressed:
    inset 6px 6px 12px var(--neu-dark),
    inset -6px -6px 12px var(--neu-light);
  --clay-float:
    14px 14px 28px var(--neu-dark),
    -10px -10px 22px var(--neu-light);
  --clay-accent:
    8px 12px 22px rgba(34, 168, 90, 0.3),
    -4px -4px 12px rgba(255, 255, 255, 0.75),
    inset 1px 1px 0 rgba(255, 255, 255, 0.4);

  --shadow: var(--clay-raised);
  --shadow-accent: var(--clay-accent);
  --shadow-dark: #C5D6CB;
  --shadow-light: #FFFFFF;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  height: 100%;
  background-color: #1A211D;
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  background-color: #E4EDE7;
}

html, body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  overscroll-behavior: none;
}

body {
  margin: 0;
  background-color: inherit;
  color: var(--text-main);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* Franjas que Safari/iOS muestrea para teñir notch y barra URL */
#ios-chrome-top,
#ios-chrome-bottom {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  pointer-events: none;
  z-index: 2147483646;
  background-color: #1A211D;
}

#ios-chrome-top {
  top: 0;
  /* Solo la zona del notch / status bar (el contenido ya tiene padding) */
  height: max(24px, env(safe-area-inset-top, 0px));
}

#ios-chrome-bottom {
  bottom: 0;
  /* Solo la zona bajo la tab bar / home indicator */
  height: max(24px, env(safe-area-inset-bottom, 0px));
}

html[data-theme="light"] #ios-chrome-top,
html[data-theme="light"] #ios-chrome-bottom {
  background-color: #E4EDE7;
}

#root {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  background-color: inherit;
}

.seo-landing {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  color: var(--text-main);
}

.seo-landing h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.seo-landing h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 1.5rem 0 0.5rem;
}

.seo-landing p,
.seo-landing li {
  color: var(--text-light);
  line-height: 1.55;
  font-weight: 600;
}

.seo-landing ul {
  margin: 0.5rem 0 1rem;
  padding-left: 1.2rem;
}

/* ---------- App shell ---------- */
.app-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  overflow: hidden;
}

.edge-fade {
  display: none;
}

@media (min-width: 768px) {
  #ios-chrome-top,
  #ios-chrome-bottom { display: none; }

  .edge-fade { display: none; }

  body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #121714;
  }

  html[data-theme="light"] body {
    background: #D0DDD4;
  }

  #root {
    width: auto;
    height: auto;
    min-height: 0;
  }

  .app-container {
    position: relative;
    inset: auto;
    width: 420px;
    height: min(92vh, 900px);
    max-height: 900px;
    aspect-ratio: 390 / 844;
    border-radius: var(--app-radius);
    border: none;
    box-shadow: var(--clay-float);
  }
}

.content-area {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding:
    calc(env(safe-area-inset-top, 0px) + 18px)
    max(22px, env(safe-area-inset-right, 0px))
    calc(144px + env(safe-area-inset-bottom, 0px))
    max(22px, env(safe-area-inset-left, 0px));
  scrollbar-width: none;
}
.content-area::-webkit-scrollbar { display: none; }
.content-area.content-full {
  padding:
    calc(env(safe-area-inset-top, 0px) + 18px)
    max(22px, env(safe-area-inset-right, 0px))
    max(36px, calc(env(safe-area-inset-bottom, 0px) + 24px))
    max(22px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
}

.screen-panel {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  padding: 8px 0 20px;
  gap: var(--space-screen);
}

.screen-panel.is-centered {
  justify-content: center;
}

/* ---------- Superficies clay ---------- */
.neu-out,
.clay-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--clay-raised);
  position: relative;
}

.neu-out::before,
.clay-card::before {
  content: none;
}

.neu-in,
.clay-inset {
  background: var(--bg-elevated);
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--clay-pressed);
}

/* ---------- Formularios (hundidos) ---------- */
.neu-input {
  width: 100%;
  padding: 16px 20px;
  margin-bottom: 16px;
  border: none;
  background: var(--bg-elevated);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 20px;
  outline: none;
  box-shadow: var(--clay-pressed);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.neu-input::placeholder { color: var(--text-light); font-weight: 600; }

.neu-input:focus {
  box-shadow:
    var(--clay-pressed),
    0 0 0 3px var(--accent-soft);
}

.neu-input.small {
  padding: 12px 14px;
  margin-bottom: 0;
  font-size: 0.92rem;
  border-radius: 16px;
}

select.neu-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238FA399' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

.flex-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.flex-row label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.flex-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- Rutinas / Ajustes ---------- */
.routines-screen,
.settings-screen,
.today-screen,
.auth-screen {
  gap: var(--space-screen);
}

.routines-screen .header,
.settings-screen .header,
.today-screen .header {
  margin-bottom: 0;
}

.config-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.routines-screen.is-empty {
  justify-content: center;
}

.routines-screen.is-empty .config-main {
  margin: 8px 0;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
}

.settings-row-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.settings-row-text strong {
  font-size: 1.02rem;
  font-weight: 800;
}

.settings-row-text span {
  font-size: 0.86rem;
  color: var(--text-light);
  font-weight: 600;
}

.sound-inline-error {
  display: block;
  margin-top: 4px;
  color: var(--danger-color);
  font-size: 0.8rem;
  font-weight: 700;
}

.install-block {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.install-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.install-ok {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-on);
  background: var(--accent-gradient);
  box-shadow: var(--clay-accent);
  flex-shrink: 0;
}

.install-guide {
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: var(--bg-elevated);
  box-shadow: var(--clay-pressed);
}

.install-guide-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 10px;
}

.install-guide-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
}

.install-guide-list li {
  margin-bottom: 6px;
}

.install-guide-list li:last-child {
  margin-bottom: 0;
}

.install-guide-list strong {
  color: var(--text-main);
  font-weight: 800;
}

.install-guide-list svg {
  display: inline-block;
  vertical-align: -3px;
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.install-guide-close {
  margin-top: 12px;
  border: none;
  background: transparent;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 0;
}

.install-hint {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.4;
  margin: 0;
}

.feedback-block {
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.feedback-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 18px 20px;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  font-family: var(--font);
  cursor: pointer;
}

.feedback-chevron {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--bg-card);
  box-shadow: var(--clay-raised-sm);
  transition: transform 0.18s ease;
}

.feedback-chevron.is-open {
  background: var(--accent-gradient);
  color: var(--accent-on);
  box-shadow: var(--clay-accent);
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 18px 18px;
  animation: authIn 0.2s ease;
}

.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.feedback-field > span {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-left: 4px;
}

.feedback-field .neu-input {
  margin-bottom: 0;
}

.feedback-textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.45;
}

.settings-screen .account-box {
  margin-top: 0;
}

.profile-card {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-btn {
  position: relative;
  width: 72px;
  height: 72px;
  min-width: 72px;
  border: none;
  padding: 0;
  border-radius: 24px;
  background: var(--bg-elevated);
  box-shadow: var(--clay-raised-sm);
  cursor: pointer;
  overflow: visible;
  color: var(--accent);
}

.avatar-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  display: block;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
}

.avatar-fallback svg {
  width: 28px;
  height: 28px;
}

.avatar-edit {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: var(--accent-on);
  box-shadow: var(--clay-raised-sm);
  font-size: 0.9rem;
  font-weight: 800;
}

.avatar-edit svg {
  width: 14px;
  height: 14px;
}

.profile-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profile-name-btn {
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
}

.profile-name-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.profile-name-btn strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.profile-edit-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.85;
}

.profile-edit-icon svg {
  width: 16px;
  height: 16px;
}

.profile-name-btn:active .profile-edit-icon {
  opacity: 1;
}

.profile-email {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-name-input {
  margin: 0;
  width: 100%;
  max-width: 100%;
  font-size: 1.02rem;
  font-weight: 800;
  padding: 10px 12px;
}

.profile-feedback {
  margin: 0;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent);
}

.profile-feedback.is-error {
  color: var(--danger-color);
}

.empty-routines-hint {
  color: var(--text-light);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  padding: 8px 4px 4px;
}

.config-exercise-card {
  position: relative;
  padding: 18px 16px 18px 22px;
  margin-bottom: 16px;
  border-radius: var(--card-radius);
  border-left: none;
}

.config-exercise-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 20px;
  bottom: 20px;
  width: 5px;
  border-radius: 999px;
  background: var(--accent-gradient);
  box-shadow: 0 0 12px var(--accent-glow);
}

.ex-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ex-name-input {
  flex: 1;
  min-width: 0;
  margin-bottom: 0 !important;
  font-weight: 800;
}

.ex-desc-input {
  margin-bottom: 16px !important;
  min-height: 64px;
  resize: vertical;
  line-height: 1.4;
}

.ex-remove-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  border: none;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--danger-color);
  background: var(--bg-elevated);
  box-shadow: var(--clay-raised-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ex-remove-btn:active {
  transform: scale(0.94);
  box-shadow: var(--clay-pressed);
}

.ex-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.ex-metric {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.ex-metric-label {
  display: block;
  height: 1.1em;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-metric .neu-input.small {
  width: 100%;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 12px 6px;
  border-radius: 16px;
  margin-bottom: 0;
}

.ex-metric-unit {
  display: block;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-light);
  margin-top: -2px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

textarea.neu-input {
  font-family: var(--font);
  font-weight: 600;
}

.field-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.field-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.4;
  margin: 10px 2px 18px;
}

.field-hint svg { flex-shrink: 0; margin-top: 1px; color: var(--accent); }

.type-toggle {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 20px;
  background: var(--bg-elevated);
  box-shadow: var(--clay-pressed);
  border: none;
}

.type-toggle button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 8px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: var(--text-light);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
}

.type-toggle button.active {
  color: var(--accent-on);
  background: var(--accent-gradient);
  box-shadow: var(--clay-accent);
}

.type-toggle button.active.is-time-mode {
  background: linear-gradient(145deg, #FF9B74, #FF6B4A);
  box-shadow:
    8px 12px 22px rgba(255, 107, 74, 0.3),
    -3px -3px 10px rgba(255, 255, 255, 0.06),
    inset 2px 2px 5px rgba(255, 255, 255, 0.3),
    inset -2px -3px 8px rgba(0, 0, 0, 0.15);
}

/* ---------- Picker ---------- */
.picker-sheet {
  margin-bottom: 20px;
  padding: 18px;
  border-radius: var(--card-radius);
  background: var(--bg-card);
  border: none;
  box-shadow: var(--clay-raised);
}

.picker-sheet::before { content: none; }

.picker-sheet h3 {
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.picker-sheet .picker-sub {
  font-size: 0.84rem;
  color: var(--text-light);
  margin-bottom: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.picker-chip {
  padding: 16px 12px;
  border: none;
  border-radius: var(--chip-radius);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--clay-raised-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.picker-chip:active {
  transform: scale(0.96);
  box-shadow: var(--clay-pressed);
  color: var(--accent);
}

.picker-list {
  display: flex;
  flex-direction: column;
  max-height: min(50vh, 360px);
  overflow-y: auto;
  border-radius: 22px;
  background: var(--bg-elevated);
  border: none;
  box-shadow: var(--clay-pressed);
  -webkit-overflow-scrolling: touch;
}

.picker-item {
  width: 100%;
  text-align: left;
  padding: 15px 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-main);
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.picker-item:last-child { border-bottom: none; }
.picker-item:active { background: var(--accent-soft); }

.picker-item-text { min-width: 0; flex: 1; }

.picker-item strong {
  display: block;
  font-size: 0.96rem;
  font-weight: 800;
  margin-bottom: 3px;
}

.picker-item span {
  font-size: 0.76rem;
  color: var(--text-light);
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.picker-item-meta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 14px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 2px solid transparent;
  line-height: 1;
}

.picker-item-meta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.picker-item-meta.is-reps {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(143, 234, 92, 0.45);
}

html[data-theme="light"] .picker-item-meta.is-reps {
  border-color: rgba(34, 168, 90, 0.4);
}

.picker-item-meta.is-time {
  color: var(--energy);
  background: var(--energy-soft);
  border-color: rgba(255, 138, 91, 0.5);
}

html[data-theme="light"] .picker-item-meta.is-time {
  border-color: rgba(255, 107, 74, 0.45);
}

.picker-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.picker-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 10px;
  padding: 0;
}

/* ---------- Header ---------- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-top: 4px;
}

.header-titles h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 8vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.05;
}

.header-titles h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-titles p {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.icon { width: 22px; height: 22px; display: block; }
.icon-sm { width: 18px; height: 18px; display: block; }

.theme-toggle {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 18px;
  border: none;
  background: var(--bg-card);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--accent);
  box-shadow: var(--clay-raised-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.theme-toggle::before { content: none; }
.theme-toggle:active {
  transform: scale(0.94);
  box-shadow: var(--clay-pressed);
}

/* ---------- Hoy / métricas neumórficas ---------- */
.today-greeting {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.today-screen {
  gap: var(--space-screen);
}

.neu-today-card {
  width: 100%;
  padding: 22px 20px 20px;
  border-radius: var(--card-radius);
  background: var(--bg-card);
  box-shadow: var(--clay-raised);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.neu-today-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.neu-metric-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.neu-metric-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-on);
  box-shadow: var(--clay-raised-sm);
}

.neu-metric-icon.lime { background: var(--accent-gradient); }
.neu-metric-icon.energy { background: linear-gradient(145deg, #FF9B74, #FF6B4A); }
.neu-metric-icon.mint { background: linear-gradient(145deg, #5EEAD4, #14B8A6); }

.neu-metric-icon svg {
  width: 22px;
  height: 22px;
}

.neu-metric-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.neu-metric-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.neu-metric-head span {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.neu-metric-head strong {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

.neu-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  box-shadow: var(--clay-pressed);
  overflow: hidden;
}

.neu-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-gradient);
  box-shadow: 0 0 10px var(--accent-glow);
  transition: width 0.35s ease;
  min-width: 0;
}

.neu-progress-fill.is-energy {
  background: linear-gradient(145deg, #FF9B74, #FF6B4A);
  box-shadow: 0 0 10px rgba(255, 138, 91, 0.35);
}

.neu-progress-fill.is-mint {
  background: linear-gradient(145deg, #5EEAD4, #14B8A6);
  box-shadow: 0 0 10px rgba(94, 234, 212, 0.35);
}

/* Compat: stats antiguas → mismo lenguaje visual */
.clay-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.clay-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 12px;
  border-radius: 24px;
  background: var(--bg-card);
  box-shadow: var(--clay-raised-sm);
  text-align: center;
}

.clay-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-on);
  box-shadow: var(--clay-raised-sm);
}

.clay-stat-icon.mint { background: linear-gradient(145deg, #5EEAD4, #14B8A6); }
.clay-stat-icon.energy { background: linear-gradient(145deg, #FF9B74, #FF6B4A); }
.clay-stat-icon.sky { background: linear-gradient(145deg, #7DD3FC, #38BDF8); }
.clay-stat-icon.lime { background: var(--accent-gradient); }

.clay-stat strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.clay-stat span {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.today-section-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 4px 2px 0;
}

/* ---------- Tarjetas ---------- */
.workout-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.workout-card {
  padding: 20px 22px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.workout-card:active {
  transform: scale(0.985);
  box-shadow: var(--clay-pressed);
}

.workout-card h3 {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.workout-card p {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
}

.routine-card-top {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 14px;
  align-items: center;
  gap: 10px;
}

.routine-card-bottom {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.routine-card-actions {
  display: flex;
  gap: 10px;
}

.routine-thumb {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: var(--clay-raised-sm);
}

.day-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent);
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: var(--clay-raised-sm);
}

.play-icon {
  min-width: 58px;
  height: 58px;
  border-radius: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--accent-on);
  background: var(--bg-card);
  box-shadow: var(--clay-raised-sm);
}

.hero-card {
  position: relative;
  background: var(--accent-gradient);
  color: var(--accent-on);
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--clay-accent);
  overflow: hidden;
  padding: 26px 24px;
  min-height: 140px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-card::before {
  content: '';
  position: absolute;
  right: -15%;
  top: -35%;
  width: 55%;
  height: 140%;
  background: radial-gradient(circle, rgba(255,255,255,0.28), transparent 68%);
  pointer-events: none;
}

.hero-card:active {
  transform: scale(0.985);
  box-shadow: var(--clay-pressed);
}

.hero-card.is-done {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--clay-raised);
  cursor: default;
}

.hero-card.is-done::before {
  background: radial-gradient(circle, rgba(143, 234, 92, 0.12), transparent 68%);
}

html[data-theme="light"] .hero-card.is-done::before {
  background: radial-gradient(circle, rgba(34, 168, 90, 0.1), transparent 68%);
}

.hero-card.is-done:active {
  transform: none;
  box-shadow: var(--clay-raised);
}

.hero-card.is-done h3,
.hero-card.is-done p {
  color: var(--text-main);
}

.hero-card.is-done .hero-card-label {
  color: var(--accent);
  opacity: 1;
}

.hero-card.is-done .play-icon {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: var(--clay-raised-sm);
}

.hero-card.is-done .hero-cta {
  background: var(--accent-soft);
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
}

.hero-actions .btn-secondary {
  width: auto;
}

.done-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}

.alt-routine.is-done .routine-thumb {
  background: var(--accent);
  color: var(--accent-on);
}

.hero-card-body {
  position: relative;
  min-width: 0;
  flex: 1;
}

.hero-card-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.75;
  margin-bottom: 8px;
}

.hero-card h3,
.hero-card p {
  color: var(--accent-on);
  position: relative;
}
.hero-card h3 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 6.5vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.hero-card p {
  opacity: 0.8;
  font-weight: 700;
  font-size: 0.9rem;
}

.hero-card .play-icon {
  position: relative;
  background: rgba(18, 32, 22, 0.18);
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.25),
    inset -2px -2px 6px rgba(0, 0, 0, 0.15);
  color: var(--accent-on);
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 22px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(18, 32, 22, 0.16);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.alt-routine {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 22px;
  background: var(--bg-card);
  box-shadow: var(--clay-raised-sm);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  color: var(--text-main);
}

.alt-routine:active {
  transform: scale(0.985);
  box-shadow: var(--clay-pressed);
}

.alt-routine.active-alt {
  box-shadow: var(--clay-raised-sm), 0 0 0 2px var(--accent);
}

.alt-routine strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.alt-routine span {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 600;
}

/* ---------- Tracker ---------- */
/* 3 zonas fijas: meta | acción (GO) | pie */
.active-tracker {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  min-height: 100%;
  flex: 1;
  box-sizing: border-box;
}

.tracker-head {
  grid-row: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 0 8px 4px;
}

.tracker-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.3;
}

.tracker-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6.5vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.15;
  max-width: 16ch;
}

.tracker-set {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.3;
  opacity: 0.9;
}

.tracker-stage {
  grid-row: 2;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 20px 0;
}

.tracker-stage-rest {
  gap: 0;
}

.help-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--clay-raised-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}
.help-btn::before { content: none; }
.help-btn:active {
  transform: scale(0.97);
  box-shadow: var(--clay-pressed);
}

.help-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(10, 14, 12, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.help-sheet {
  width: 100%;
  padding: 26px;
  border-radius: 32px;
  background: var(--bg-card);
  border: none;
  box-shadow: var(--clay-float);
  animation: sheetUp 0.22s ease;
}
.help-sheet::before { content: none; }

@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.help-sheet-label {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

.help-sheet h3 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.help-sheet p {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.5;
  margin: 0 0 22px;
}

.giant-wrap {
  position: relative;
  width: min(270px, 60vw, 42vh);
  height: min(270px, 60vw, 42vh);
  max-width: 300px;
  max-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.giant-ring { position: absolute; inset: 0; transform: rotate(-90deg); pointer-events: none; }
.giant-ring circle { fill: none; stroke-linecap: round; }
.giant-ring .track { stroke: rgba(255, 255, 255, 0.08); }
html[data-theme="light"] .giant-ring .track { stroke: rgba(26, 46, 36, 0.1); }
.giant-ring .progress {
  stroke: url(#accentGrad);
  filter: drop-shadow(0 0 6px var(--accent-glow));
  transition: stroke-dashoffset 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.giant-btn {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  border: none;
  background: var(--bg-card);
  box-shadow: var(--clay-float);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
  outline: none;
}
.giant-btn:active {
  transform: scale(0.96);
  box-shadow: var(--clay-pressed);
}

.rep-count {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 14vw, 5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
  -webkit-text-fill-color: unset;
  background: none;
}

.rep-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-top: 8px;
}

.tracker-footer {
  grid-row: 3;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 4px 0;
}

.tracker-footer .btn-secondary,
.tracker-footer .btn-primary {
  width: 100%;
  max-width: 320px;
}

.sets-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: 12px;
}

.sets-container[aria-hidden="true"] {
  visibility: hidden;
}

.set-dot {
  width: 36px;
  height: 12px;
  border-radius: 999px;
  transition: all 0.35s ease;
  background: var(--bg-elevated);
  box-shadow: var(--clay-pressed);
  border: none;
}
.set-dot.active {
  background: var(--accent-gradient);
  box-shadow: var(--clay-accent);
}

/* ---------- Botones ---------- */
.btn-primary, .btn-secondary, .btn-danger {
  padding: 17px 0;
  width: 100%;
  border: none;
  border-radius: var(--btn-radius);
  font-size: 1.02rem;
  font-weight: 800;
  font-family: var(--font);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.15s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--accent-on);
  box-shadow: var(--clay-accent);
}
.btn-primary:active {
  transform: scale(0.98);
  box-shadow: var(--clay-pressed);
}

.btn-secondary {
  color: var(--text-main);
  background: var(--bg-card);
  border: none;
  box-shadow: var(--clay-raised-sm);
}
.btn-secondary:active {
  transform: scale(0.98);
  box-shadow: var(--clay-pressed);
}

.btn-danger {
  color: var(--danger-color);
  background: var(--bg-card);
  border: none;
  box-shadow: var(--clay-raised-sm);
}
.btn-danger:active {
  transform: scale(0.98);
  box-shadow: var(--clay-pressed);
}

.btn-compact,
.btn-primary.btn-compact,
.btn-secondary.btn-compact,
.btn-danger.btn-compact {
  width: auto;
  min-width: 0;
  padding: 14px 26px;
  font-size: 0.95rem;
  border-radius: 18px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.btn-cta,
.btn-primary.btn-cta {
  width: auto;
  min-width: 0;
  padding: 12px 20px;
  font-size: 0.9rem;
  border-radius: 16px;
  white-space: nowrap;
  align-self: center;
}

/* ---------- Timer ---------- */
.timer-wrap {
  position: relative;
  width: min(240px, 55vw, 38vh);
  height: min(240px, 55vw, 38vh);
  max-width: 260px;
  max-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.timer-ring { position: absolute; inset: 0; transform: rotate(-90deg); pointer-events: none; }
.timer-ring circle { fill: none; stroke-linecap: round; }
.timer-ring .track { stroke: rgba(255, 255, 255, 0.08); }
html[data-theme="light"] .timer-ring .track { stroke: rgba(26, 46, 36, 0.1); }
.timer-ring .progress {
  stroke: url(#accentGrad);
  filter: drop-shadow(0 0 6px var(--accent-glow));
  transition: stroke-dashoffset 1s linear;
}

.timer-core {
  position: absolute;
  width: 76%;
  height: 76%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: none;
  box-shadow: var(--clay-float);
}

.time-left {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 12vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

/* ---------- Tab bar (dock clay) ---------- */
.bottom-tab-bar {
  position: absolute;
  /* Extra gap sobre safe-area: en Safari la barra URL no cuenta como inset */
  bottom: calc(env(safe-area-inset-bottom, 0px) + 48px);
  left: 18px;
  right: 18px;
  height: 72px;
  background: var(--bg-card);
  border: none;
  border-radius: 28px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px;
  z-index: 120;
  /* Relieve solo arriba/lados: sin sombra inferior (evita el corte con el navegador) */
  box-shadow:
    -7px -7px 16px var(--neu-light),
    7px -5px 14px var(--neu-dark),
    -8px 0 14px var(--neu-dark),
    8px 0 14px var(--neu-dark);
}
.bottom-tab-bar::before { content: none; }

@media (min-width: 768px) {
  .bottom-tab-bar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 360px;
    bottom: 28px;
  }
  .bottom-tab-bar.tabs-3 { max-width: 380px; }
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-light);
  flex: 1;
  height: 100%;
  border-radius: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.tab-item p {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tab-item.active {
  color: var(--accent-on);
  background: var(--accent-gradient);
  box-shadow: var(--clay-accent);
}

.tab-item:not(.active):active {
  box-shadow: var(--clay-pressed);
  background: var(--bg-soft);
}

/* ---------- Auth ---------- */
.auth-screen {
  gap: var(--space-screen);
  width: 100%;
  justify-content: center;
}

.auth-brand {
  text-align: center;
  margin-bottom: 2px;
  flex-shrink: 0;
}

.auth-logo-wrap {
  width: 92px;
  height: 92px;
  margin: 0 auto 16px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: none;
  box-shadow: var(--clay-float);
}
.auth-logo-wrap::before { content: none; }

.app-logo { display: block; flex-shrink: 0; }
.app-logo svg { width: 100%; height: 100%; display: block; }
.app-logo-ring { stroke: var(--accent); opacity: 0.28; fill: none; }
.app-logo-arc { stroke: var(--accent); fill: none; }
.app-logo-mark { stroke: var(--accent); fill: none; }

.auth-brand h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  color: var(--text-main);
  line-height: 1;
}

.auth-brand h1 span {
  color: var(--accent);
  -webkit-text-fill-color: unset;
  background: none;
}

.auth-brand p {
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.4;
  padding: 0 10px;
}

.auth-mode-toggle {
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 20px;
  background: var(--bg-elevated);
  border: none;
  box-shadow: var(--clay-pressed);
  flex-shrink: 0;
}

.auth-mode-toggle button {
  flex: 1;
  border: none;
  border-radius: 16px;
  padding: 13px 6px;
  background: transparent;
  color: var(--text-light);
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
}

.auth-mode-toggle button.active {
  color: var(--accent-on);
  background: var(--accent-gradient);
  box-shadow: var(--clay-accent);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 4px 0 0;
  animation: authIn 0.22s ease;
  flex-shrink: 0;
}

@keyframes authIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.auth-field > span {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-left: 4px;
}

.auth-input {
  width: 100%;
  border: none;
  outline: none;
  background: var(--bg-elevated);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  padding: 16px 18px;
  border-radius: 20px;
  box-shadow: var(--clay-pressed);
  transition: box-shadow 0.2s ease;
}

.auth-input::placeholder {
  color: var(--text-light);
  font-weight: 600;
}

.auth-input:focus {
  box-shadow:
    var(--clay-pressed),
    0 0 0 3px var(--accent-soft);
}

.auth-password-wrap { position: relative; }
.auth-password-wrap .auth-input { padding-right: 78px; }

.auth-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 6px 2px;
  cursor: pointer;
}
.auth-eye:active { opacity: 0.7; }

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--danger-color);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.auth-error svg { flex-shrink: 0; margin-top: 1px; }

.auth-submit { margin-top: 2px; }
.auth-submit:disabled { opacity: 0.7; cursor: wait; }

.auth-footnote {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.4;
  margin: 2px 0 0;
}

.auth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-light);
  font-weight: 700;
  min-height: 100%;
}

.account-box {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.account-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--accent);
}

.account-info div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.account-info strong {
  color: var(--text-main);
  font-size: 0.96rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-info span {
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Empty ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 8px;
  width: 100%;
}

.empty-state .emoji {
  font-size: 3rem;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 32px;
  background: var(--bg-card);
  border: none;
  box-shadow: var(--clay-float);
  margin-bottom: 14px;
  color: var(--accent);
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.empty-state p,
.empty-state-msg {
  font-weight: 600;
  max-width: 280px;
  color: var(--text-light);
  line-height: 1.45;
}

.empty-state-cta {
  margin-top: 22px;
}

.empty-state-cta-secondary {
  margin-top: 12px;
}

/* ---------- Móvil ---------- */
@media (max-width: 767px) {
  .content-area {
    padding:
      calc(env(safe-area-inset-top, 0px) + 16px)
      max(18px, env(safe-area-inset-right, 0px))
      calc(144px + env(safe-area-inset-bottom, 0px))
      max(18px, env(safe-area-inset-left, 0px));
  }

  .content-area.content-full {
    padding:
      calc(env(safe-area-inset-top, 0px) + 10px)
      max(18px, env(safe-area-inset-right, 0px))
      max(56px, calc(env(safe-area-inset-bottom, 0px) + 40px))
      max(18px, env(safe-area-inset-left, 0px));
  }

  .ex-metrics {
    gap: 8px;
  }

  .ex-metric .neu-input.small {
    font-size: 16px;
    padding: 12px 4px;
  }

  .screen-panel {
    min-height: calc(100% - 8px);
    padding: 10px 0 18px;
  }

  .header { margin-bottom: 4px; padding-top: 0; }

  .neu-input,
  .auth-input {
    font-size: 16px;
  }

  .neu-input.small { font-size: 16px; }

  .btn-primary, .btn-secondary, .btn-danger {
    padding: 17px 0;
    border-radius: var(--btn-radius);
  }

  .btn-compact,
  .btn-primary.btn-compact,
  .btn-secondary.btn-compact,
  .btn-danger.btn-compact {
    padding: 13px 22px;
  }

  .btn-cta,
  .btn-primary.btn-cta {
    width: auto;
    min-width: 0;
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .workout-card,
  .account-box,
  .config-exercise-card,
  .auth-form,
  .hero-card {
    width: 100%;
  }

  .account-box {
    flex-direction: column;
    align-items: stretch;
  }

  .account-box .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .bottom-tab-bar {
    left: 16px;
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 48px);
  }

  .form-actions {
    margin-top: 8px;
    padding-bottom: 8px;
  }

  .active-tracker {
    min-height: 100%;
  }

  .tracker-stage {
    gap: 24px;
    padding: 16px 0 12px;
  }

  .giant-wrap {
    width: min(280px, 72vw, 38vh);
    height: min(280px, 72vw, 38vh);
  }

  .tracker-footer {
    gap: 14px;
    padding-top: 4px;
  }

  .timer-wrap {
    width: min(230px, 62vw, 34vh);
    height: min(230px, 62vw, 34vh);
  }

  .clay-stats {
    gap: 10px;
  }

  .clay-stat-icon {
    width: 44px;
    height: 44px;
  }

  .neu-today-card {
    padding: 20px 18px 18px;
    gap: 16px;
  }

  .neu-metric-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 14px;
  }

  .neu-metric-icon svg {
    width: 20px;
    height: 20px;
  }
}
