/* ============================================
   BiRun — Clay 3D Minimal
   Aesthetic: warm wellness, puffy claymorphism,
   soft pastels, premium & friendly
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Warm neutrals */
  --bg: #FAF6EF;
  --bg-warm: #F4EDE0;
  --surface: #FFFCF6;
  --surface-2: #FBF5EA;
  --ink: #2A2520;
  --ink-soft: #6B5F53;
  --ink-mute: #A89C8E;
  --line: #EDE4D3;

  /* Pastel clay accents */
  --coral: #F4A58C;
  --coral-deep: #E88468;
  --coral-soft: #FBD9CB;
  --sage: #A8C4A2;
  --sage-deep: #7FA678;
  --sage-soft: #D8E6D3;
  --butter: #F4D98A;
  --butter-deep: #E8BE58;
  --butter-soft: #FAEBC2;
  --sky: #B8D4DC;
  --lavender: #D4BEE0;

  /* Depth — claymorphism */
  --clay-sm:
    4px 4px 10px rgba(180, 155, 120, 0.18),
    -3px -3px 8px rgba(255, 255, 255, 0.95),
    inset 1px 1px 2px rgba(255, 255, 255, 0.9),
    inset -1px -1px 2px rgba(180, 155, 120, 0.08);

  --clay-md:
    10px 10px 24px rgba(180, 155, 120, 0.22),
    -6px -6px 18px rgba(255, 255, 255, 0.9),
    inset 2px 2px 4px rgba(255, 255, 255, 0.85),
    inset -2px -2px 4px rgba(180, 155, 120, 0.1);

  --clay-lg:
    16px 18px 40px rgba(180, 155, 120, 0.28),
    -10px -10px 30px rgba(255, 255, 255, 0.92),
    inset 2px 2px 6px rgba(255, 255, 255, 0.9),
    inset -3px -3px 6px rgba(180, 155, 120, 0.1);

  --clay-inset:
    inset 4px 4px 10px rgba(180, 155, 120, 0.18),
    inset -4px -4px 10px rgba(255, 255, 255, 0.9);

  --clay-pressed:
    inset 3px 3px 8px rgba(180, 155, 120, 0.25),
    inset -2px -2px 6px rgba(255, 255, 255, 0.9);

  /* Radii */
  --r-xs: 14px;
  --r-sm: 20px;

  --r-md: 28px;
  --r-lg: 36px;
  --r-xl: 48px;
  --r-pill: 999px;

  /* Typography */
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}

/* ============================================
   DARK MODE — variables override
   ============================================ */
[data-theme="dark"] {
  --bg:       #141210;
  --bg-warm:  #1C1916;
  --surface:  #201D1A;
  --surface-2:#252119;
  --ink:      #F0EBE3;
  --ink-soft: #A89C8E;
  --ink-mute: #6B5F53;
  --line:     #2E2922;

  --coral:      #E8845A;
  --coral-deep: #D96B40;
  --coral-soft: #3D2218;

  --sage:       #7DAE77;
  --sage-deep:  #5C9055;
  --sage-soft:  #1A2E18;

  --butter:     #D4A840;
  --butter-deep:#BA8A20;
  --butter-soft:#2E2308;

  --sky:        #5A8A96;
  --lavender:   #7A5E8C;

  --clay-sm:
    4px 4px 10px rgba(0, 0, 0, 0.5),
    -2px -2px 6px rgba(255, 255, 255, 0.04),
    inset 1px 1px 2px rgba(255, 255, 255, 0.06),
    inset -1px -1px 2px rgba(0, 0, 0, 0.3);

  --clay-md:
    10px 10px 24px rgba(0, 0, 0, 0.6),
    -4px -4px 14px rgba(255, 255, 255, 0.04),
    inset 2px 2px 4px rgba(255, 255, 255, 0.07),
    inset -2px -2px 4px rgba(0, 0, 0, 0.3);

  --clay-lg:
    16px 18px 40px rgba(0, 0, 0, 0.7),
    -6px -6px 22px rgba(255, 255, 255, 0.04),
    inset 2px 2px 6px rgba(255, 255, 255, 0.07),
    inset -3px -3px 6px rgba(0, 0, 0, 0.4);

  --clay-inset:
    inset 4px 4px 10px rgba(0, 0, 0, 0.45),
    inset -3px -3px 8px rgba(255, 255, 255, 0.04);

  --clay-pressed:
    inset 3px 3px 8px rgba(0, 0, 0, 0.5),
    inset -2px -2px 6px rgba(255, 255, 255, 0.04);
}

/* Body blobs — versión dark más tenues */
[data-theme="dark"] body::before {
  opacity: 0.12;
}
[data-theme="dark"] body::after {
  opacity: 0.1;
}

/* Gradientes que usan colores literales → override en dark */
[data-theme="dark"] .hero-card {
  background: linear-gradient(135deg, #201D1A 0%, #2A2218 100%);
}
[data-theme="dark"] .hero-card::before {
  background: radial-gradient(circle, rgba(232,132,90,0.12) 0%, transparent 70%);
}
[data-theme="dark"] .ai-card {
  background: linear-gradient(135deg, #1A2A1F 0%, #14231A 100%);
}
[data-theme="dark"] .ai-card::before {
  background: radial-gradient(circle, rgba(125,174,119,0.18), transparent 70%);
}
[data-theme="dark"] .ai-card .ai-tag {
  color: #A8C4A2;
}
[data-theme="dark"] .ai-card .ai-text {
  color: #E8EFE3;
}
[data-theme="dark"] .ai-card .ai-text strong {
  color: #A8C4A2;
}
[data-theme="dark"] .profile-hero {
  background: linear-gradient(135deg, #201D1A 0%, #2A2218 100%);
}
[data-theme="dark"] .profile-hero::before {
  background: radial-gradient(circle, rgba(232,132,90,0.12), transparent 70%);
}
[data-theme="dark"] .session-card.active {
  background: linear-gradient(135deg, #2A2218 0%, #231D14 100%);
}

/* Campos de input en dark */
[data-theme="dark"] .topbar-search input {
  color: var(--ink);
}
[data-theme="dark"] .topbar-search input::placeholder {
  color: var(--ink-mute);
}
[data-theme="dark"] .field-input {
  color: var(--ink);
  /* IMPORTANTE: background-color, NO background (shorthand resetearía
     background-image/repeat/position → el chevron del select se repetiría
     en mosaico generando un patrón de ondas) */
  background-color: var(--bg-warm);
}
[data-theme="dark"] .field-input::placeholder {
  color: var(--ink-mute);
}
/* Select chevron: en dark, mucho más visible */
[data-theme="dark"] select.field-input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' stroke='%23A89C8E' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
}
/* Conditional fields (dentro de los sheets) — en claro son blanco semitransparente,
   en dark queda horrible. Override a fondo oscuro coherente. */
[data-theme="dark"] .conditional-field {
  background: var(--bg-warm);
  border-color: var(--line, #2E2922);
}
[data-theme="dark"] .sheet-handle {
  background: var(--ink-mute);
  opacity: 0.4;
}
[data-theme="dark"] .sheet-header {
  border-bottom-color: var(--line, #2E2922);
}
/* Option buttons en dark — el fondo blanco roto */
[data-theme="dark"] .option-btn,
[data-theme="dark"] .toggle-opt {
  background: var(--bg-warm);
  color: var(--ink);
  border-color: var(--line, #2E2922);
}
[data-theme="dark"] .option-btn.selected,
[data-theme="dark"] .toggle-opt.active {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  color: white;
  border-color: transparent;
}
/* Share sheet en dark */
[data-theme="dark"] .share-bg-toggle {
  background: var(--bg-warm);
}
[data-theme="dark"] .share-bg-opt {
  color: var(--ink-soft);
}
[data-theme="dark"] .share-variant-label {
  color: var(--ink);
}
[data-theme="dark"] .modal-textarea {
  color: var(--ink);
}

/* Ajuste btn-start en dark */
[data-theme="dark"] .btn-start {
  background: linear-gradient(135deg, #2E2922 0%, #3A3530 100%);
  box-shadow:
    10px 12px 24px rgba(0,0,0,0.6),
    -4px -4px 14px rgba(255,255,255,0.04),
    inset 2px 2px 4px rgba(255,255,255,0.08);
}

/* Transición suave al cambiar tema:
   Solo activa mientras dura el switch (clase añadida por JS) */
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition:
    background-color 0.4s ease,
    background 0.4s ease,
    color 0.3s ease,
    box-shadow 0.4s ease !important;
}

/* Botón toggle — animación luna/sol */
.theme-toggle {
  position: relative;
  overflow: hidden;
}

.theme-toggle .icon-inner {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease;
}

html, body {
  min-height: 100%;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  /* overflow-x NO va aquí — rompería position:fixed en iOS/mobile */
}

#app {
  overflow-x: hidden; /* Aquí sí es seguro: no afecta a los fixed children */
}

/* Ambient background blobs */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
}

body::before {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, var(--coral-soft), transparent 70%);
  top: -200px;
  right: -100px;
  opacity: 0.55;
}

body::after {
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, var(--sage-soft), transparent 70%);
  bottom: -220px;
  left: -140px;
  opacity: 0.5;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* Headings */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
}

/* ============================================
   ONBOARDING — centered card, web-style
   ============================================ */
#onboarding {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-warm) 100%);
  overflow-y: auto;
}

/* Decorative floating shapes around onboarding */
.ob-deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.ob-deco.d1 {
  width: 140px; height: 140px;
  background: var(--coral-soft);
  top: 12%; left: 8%;
  box-shadow: var(--clay-md);
  animation: floaty 8s ease-in-out infinite;
}

.ob-deco.d2 {
  width: 90px; height: 90px;
  background: var(--sage-soft);
  top: 18%; right: 10%;
  box-shadow: var(--clay-md);
  animation: floaty 10s ease-in-out infinite 1s;
}

.ob-deco.d3 {
  width: 110px; height: 110px;
  background: var(--butter-soft);
  bottom: 14%; left: 12%;
  box-shadow: var(--clay-md);
  animation: floaty 9s ease-in-out infinite 2s;
}

.ob-deco.d4 {
  width: 70px; height: 70px;
  background: var(--lavender);
  opacity: 0.7;
  bottom: 22%; right: 9%;
  box-shadow: var(--clay-md);
  animation: floaty 11s ease-in-out infinite 0.5s;
}

.ob-deco.d5 {
  width: 50px; height: 50px;
  background: var(--sky);
  top: 50%; right: 18%;
  box-shadow: var(--clay-sm);
  animation: floaty 7s ease-in-out infinite 3s;
}

@keyframes floaty {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(12px, -18px) rotate(8deg); }
}

@media (max-width: 900px) {
  .ob-deco { display: none; }
}

.ob-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--clay-lg);
  padding: 36px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: cardIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ob-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ob-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ob-brand-mark {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: var(--ink);
  box-shadow: var(--clay-sm);
  display: block;
  object-fit: contain;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* Wordmark completo "TASSEI.es" en la cabecera del onboarding/pretemporada */
.ob-brand-wordmark {
  height: 42px;
  width: auto;
  display: block;
  object-fit: contain;
}

.ob-logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.ob-logo span { color: var(--coral-deep); }

.btn-close {
  width: 44px; height: 44px;
  border: none;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--clay-sm);
  cursor: pointer;
  font-size: 16px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close:hover {
  color: var(--coral-deep);
  transform: scale(1.05);
}

.btn-close:active {
  box-shadow: var(--clay-pressed);
}

/* Progress */
.ob-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ob-progress-bar {
  flex: 1;
  height: 12px;
  background: var(--bg-warm);
  border-radius: var(--r-pill);
  box-shadow: var(--clay-inset);
  overflow: hidden;
  padding: 2px;
}

.ob-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--coral) 0%, var(--coral-deep) 100%);
  border-radius: var(--r-pill);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.6);
}

.ob-step-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Steps */
.ob-body {
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.ob-step {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.ob-step.active {
  display: flex;
  animation: stepIn 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.ob-step.animate-back {
  animation: stepBack 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes stepIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes stepBack {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

.ob-question {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
}

.ob-subtext {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
  background: var(--bg-warm);
  border-radius: var(--r-sm);
  padding: 14px 18px;
  box-shadow: var(--clay-inset);
}

/* Options */
.ob-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ob-options.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ob-options.grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

/* 4-column grid for cycling long rides */
.ob-options.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 520px) {
  .ob-options.grid-6 { grid-template-columns: repeat(3, 1fr); }
  .ob-options.grid-4 { grid-template-columns: repeat(4, 1fr); }
  /* grid-3 con texto largo (p.ej. recencia / esfuerzo del step 8) desborda
     en móviles estrechos. Pasamos a 1 columna para evitar zoom involuntario. */
  .ob-options.grid-3 { grid-template-columns: 1fr; }
  /* Y el botón en sí no debe forzar ancho mínimo */
  .ob-options .option-btn { min-width: 0; }
  /* Los conditional-fields (sub-bloques del step 8) deben respetar el ancho */
  .conditional-field { max-width: 100%; overflow-x: hidden; }
}

/* Sub-options (step1 Ambos sub-question) */
.sub-options {
  margin-top: 4px;
}

.sub-btn {
  opacity: 0.9;
}

/* Field sub-label */
.field-sublabel {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

/* Two-column field layout */
.field-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .field-two-col { grid-template-columns: 1fr; }
}

/* Field hint text */
.field-hint {
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 600;
  margin-top: 2px;
}

/* Strava connect box */
.strava-connect-box {
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 20px;
  text-align: center;
  box-shadow: var(--clay-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.strava-connect-icon {
  font-size: 2rem;
}

.strava-connect-text {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  font-weight: 600;
}

.btn-strava-ob {
  background: #FC4C02;
  color: #fff;
  border: none;
  border-radius: var(--r-xs);
  padding: 12px 24px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(252, 76, 2, 0.35);
}

.btn-strava-ob:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(252, 76, 2, 0.45);
}

/* RPE scale (sensaciones) */
.rpe-scale {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rpe-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-xs);
  background: var(--surface);
  box-shadow: var(--clay-sm);
}

.rpe-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  min-width: 28px;
  color: var(--ink);
}

.rpe-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.rpe-1 { border-left: 3px solid var(--sage-deep); }
.rpe-2 { border-left: 3px solid var(--sage); }
.rpe-3 { border-left: 3px solid var(--butter-deep); }
.rpe-4 { border-left: 3px solid var(--coral); }
.rpe-5 { border-left: 3px solid var(--coral-deep); }

/* Textarea input */
.field-textarea {
  resize: vertical;
  min-height: 72px;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px 14px;
}

.option-btn {
  border: none;
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 16px 20px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--clay-sm);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  line-height: 1.3;
  position: relative;
}

.option-btn .emoji {
  font-size: 26px;
  flex-shrink: 0;
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-warm);
  border-radius: 16px;
  box-shadow: var(--clay-sm);
  transition: all 0.3s;
}

.option-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--clay-md);
}

.option-btn:hover .emoji {
  transform: rotate(-6deg) scale(1.05);
}

.option-btn.selected {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  color: white;
  box-shadow:
    10px 10px 22px rgba(232, 132, 104, 0.35),
    -4px -4px 14px rgba(255,255,255,0.9),
    inset 2px 2px 4px rgba(255,255,255,0.4);
}

.option-btn.selected .emoji {
  background: rgba(255,255,255,0.25);
  box-shadow: inset 2px 2px 4px rgba(255,255,255,0.5);
}

.option-btn.grid-btn {
  padding: 22px 14px;
  flex-direction: column;
  text-align: center;
  gap: 10px;
}

.option-btn.grid-btn .emoji {
  width: 56px; height: 56px;
  font-size: 30px;
}

.option-btn.grid-btn .label {
  font-size: 13px;
  font-weight: 700;
}

.option-btn.day-btn {
  padding: 18px 0;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-display);
}

.option-btn.day-btn .day-num {
  font-size: 24px;
  font-weight: 700;
}

.option-btn.day-btn .day-label {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Conditional fields */
.conditional-field {
  display: none;
  flex-direction: column;
  gap: 22px;                                 /* más aire entre field-groups */
  margin-top: 18px;                          /* separa del bloque de opciones de arriba */
  padding: 22px 22px;
  background: rgba(255,255,255,0.45);        /* fondo neutro, no peach */
  border: 1.5px solid rgba(234,228,218,0.7); /* borde sutil en lugar de sombra hundida */
  border-radius: var(--r-sm);
  box-shadow: none;
}

.conditional-field.visible {
  display: flex;
  animation: stepIn 0.3s ease;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;                                  /* más aire entre label e input */
}

.field-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-input {
  border: none;
  background: var(--surface);
  border-radius: var(--r-xs);
  padding: 14px 18px;
  font-size: 16px;             /* 16px mínimo evita zoom auto en iOS Safari */
  font-weight: 600;
  color: var(--ink);
  outline: none;
  box-shadow: var(--clay-pressed);
  transition: all 0.2s;
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;    /* select y inputs: aspecto consistente */
  appearance: none;
}

/* Select: chevron custom + padding derecho */
select.field-input {
  padding-right: 42px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' stroke='%236B6460' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.field-input:focus {
  box-shadow:
    inset 3px 3px 8px rgba(180, 155, 120, 0.22),
    inset -2px -2px 6px rgba(255,255,255,0.9),
    0 0 0 3px var(--coral-soft);
}

.field-input::placeholder { color: var(--ink-mute); }

.ob-support {
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  font-style: italic;
}

/* Info box — nota informativa dentro de pasos */
.ob-info-box {
  background: rgba(255,255,255,0.55);
  border: 1.5px solid rgba(255,255,255,0.7);
  border-radius: 14px;
  padding: 14px 16px;
}
.ob-info-text {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
  font-weight: 500;
}

/* Consent checkbox — step 9c y similares */
.ob-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(167, 139, 204, 0.08);
  border: 1.5px solid rgba(167, 139, 204, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.ob-consent-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: #A78BCC;
  cursor: pointer;
}
.ob-consent-label span {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.55;
  font-weight: 500;
}

/* Final screen */
.ob-final {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
  padding: 30px 16px;
}

.ob-final-badge {
  width: 110px; height: 110px;
  border-radius: 38px;
  background: linear-gradient(135deg, var(--butter) 0%, var(--butter-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  box-shadow: var(--clay-lg);
  animation: bounceIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounceIn {
  0% { transform: scale(0) rotate(-12deg); opacity: 0; }
  60% { transform: scale(1.12) rotate(3deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.ob-final-title {
  font-size: 32px;
  max-width: 420px;
}

.ob-final-sub {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 360px;
}

.loading-dots {
  display: flex;
  gap: 10px;
  padding-top: 8px;
}

.loading-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: var(--clay-sm);
  animation: dotBounce 1.4s infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; background: var(--butter-deep); }
.loading-dot:nth-child(3) { animation-delay: 0.4s; background: var(--sage-deep); }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.5; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Onboarding footer */
.ob-footer {
  display: flex;
  gap: 12px;
  padding-top: 8px;
}

.btn-prev {
  padding: 16px 26px;
  border: none;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--clay-sm);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-prev:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--clay-md);
  color: var(--ink);
}

.btn-prev:active:not(:disabled) {
  box-shadow: var(--clay-pressed);
  transform: translateY(0);
}

.btn-prev:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-next {
  flex: 1;
  padding: 16px 26px;
  border: none;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  color: white;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    8px 10px 22px rgba(232, 132, 104, 0.4),
    -4px -4px 14px rgba(255,255,255,0.9),
    inset 2px 2px 4px rgba(255,255,255,0.35);
  transition: all 0.25s;
  letter-spacing: 0.02em;
}

.btn-next:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow:
    12px 14px 28px rgba(232, 132, 104, 0.45),
    -4px -4px 14px rgba(255,255,255,0.9),
    inset 2px 2px 4px rgba(255,255,255,0.4);
}

.btn-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: saturate(0.6);
  box-shadow: none;
  transform: none;
}

.btn-next:active {
  transform: translateY(0);
  box-shadow:
    inset 4px 4px 10px rgba(180, 100, 70, 0.3),
    inset -2px -2px 6px rgba(255,255,255,0.3);
}

/* ============================================
   MAIN APP — web responsive dashboard
   ============================================ */
#main-app {
  display: none;
  min-height: 100vh;
  padding: 28px 32px 140px;
}

#main-app.visible {
  display: block;
  animation: fadeUp 0.6s ease;
}

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

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
}

/* Top bar */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  margin-bottom: 26px;
  background: var(--surface);
  border-radius: var(--r-pill);
  box-shadow: var(--clay-md);
}

.app-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-topbar-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.app-topbar-logo span { color: var(--coral-deep); }

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  box-shadow: var(--clay-sm);
  display: block;
  object-fit: contain;
  background: var(--ink);
}

/* Wordmark completo "TASSEI.es" — sustituye cuadro + texto en el topbar */
.brand-wordmark {
  height: 34px;
  width: auto;
  max-width: 160px;      /* tope de seguridad: nunca desborda el topbar */
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.topbar-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  padding: 11px 18px 11px 44px;
  border: none;
  border-radius: var(--r-pill);
  background: var(--bg-warm);
  box-shadow: var(--clay-pressed);
  font-size: 14px;
  font-weight: 600;
  outline: none;
}

.topbar-search input::placeholder { color: var(--ink-mute); }

.topbar-search .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-mute);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topbar-icon-btn {
  width: 42px; height: 42px;
  border: none;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--clay-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  color: var(--ink-soft);
}

.topbar-icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--clay-md);
  color: var(--coral-deep);
}

.topbar-icon-btn .dot {
  position: absolute;
  top: 8px; right: 9px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--coral-deep);
  border: 2px solid var(--surface);
}

.topbar-avatar {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  box-shadow: var(--clay-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.topbar-avatar:hover {
  transform: translateY(-2px);
  box-shadow: var(--clay-md);
}

/* Pages */
.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeUp 0.5s ease;
}

/* Page header */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.greet-sub {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}

.greet-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 4px;
}

.greet-title .wave {
  display: inline-block;
  animation: wave 2.4s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
  60% { transform: rotate(0); }
}

.greet-date-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--surface);
  border-radius: var(--r-pill);
  box-shadow: var(--clay-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.greet-date-pill .dot-yellow {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--butter-deep);
  box-shadow: 0 0 0 3px var(--butter-soft);
}

/* ============================================
   INICIO — Dashboard grid
   ============================================ */
.inicio-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 980px) {
  .inicio-grid { grid-template-columns: 1fr; }
}

.inicio-left,
.inicio-right {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Status row */
.status-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

@media (max-width: 540px) {
  /* Status pills en grid asimétrico de 3 cuadrados:
     ┌─────────────┬─────────────┐
     │  ESTADO     │             │
     ├─────────────┤   CARGA     │
     │ RECUPERAC.  │  SEMANAL    │
     └─────────────┴─────────────┘ */
  .status-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
  }
  .status-pill {
    padding: 12px 14px;
    gap: 8px;
  }
  .status-pill:nth-child(1) { grid-column: 1; grid-row: 1; }
  .status-pill:nth-child(2) { grid-column: 1; grid-row: 2; }
  .status-pill:nth-child(3) {
    grid-column: 2;
    grid-row: 1 / span 2;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 16px 14px;
  }
  .status-pill:nth-child(3) .status-pill-row {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .status-pill:nth-child(3) .status-blob {
    width: 50px; height: 50px;
    font-size: 22px;
  }
  .status-pill:nth-child(3) .status-pill-value { font-size: 22px; }

  .status-pill-label {
    font-size: 10px;
    letter-spacing: 0.05em;
  }
  .status-pill-row { gap: 12px; }
  .status-blob {
    width: 38px; height: 38px;
    border-radius: 12px;
    font-size: 18px;
  }
  .status-pill-value { font-size: 17px; }
  .status-pill-sub { font-size: 11px; }

  /* Reorder en móvil: greeting → status pills → resto del dashboard */
  #page-inicio {
    display: flex;
    flex-direction: column;
  }
  #page-inicio .page-head   { order: 1; }
  #page-inicio .status-row  { order: 2; margin-top: 4px; margin-bottom: 18px !important; }
  #page-inicio .inicio-grid { order: 3; margin-bottom: 0; }
}

.status-pill {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: var(--clay-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-pill-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}

.status-pill-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-blob {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--clay-sm);
  flex-shrink: 0;
}

.status-blob.coral { background: linear-gradient(135deg, var(--coral-soft) 0%, var(--coral) 100%); }
.status-blob.sage { background: linear-gradient(135deg, var(--sage-soft) 0%, var(--sage) 100%); }
.status-blob.butter { background: linear-gradient(135deg, var(--butter-soft) 0%, var(--butter) 100%); }

.status-pill-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.status-pill-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-up { color: var(--sage-deep); }
.trend-down { color: var(--coral-deep); }

/* Main training card (hero) */
.hero-card {
  background: linear-gradient(135deg, #FDF4E9 0%, #FAE8D3 100%);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--clay-lg);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,165,140,0.4) 0%, transparent 70%);
  top: -100px; right: -80px;
  pointer-events: none;
}

.hero-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
  gap: 12px;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: var(--clay-sm);
  background: var(--surface);
}

.type-badge.calidad { background: linear-gradient(135deg, var(--coral-soft), var(--coral)); color: #6b2f1a; }
.type-badge.suave { background: linear-gradient(135deg, #C8E3F0, var(--sky)); color: #2a4a55; }
.type-badge.largo { background: linear-gradient(135deg, var(--sage-soft), var(--sage)); color: #2d4a2a; }
.type-badge.fuerza { background: linear-gradient(135deg, #EDDAF3, var(--lavender)); color: #4a2a5a; }
.type-badge.descanso { background: var(--bg-warm); color: var(--ink-mute); }

.hero-meta-pill {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--clay-sm);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-card-name {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.hero-card-goal {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 480px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

/* Hero card — estado bloqueado (strava_pending) */
.hero-card-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 40px 32px;
}
.hero-locked-icon {
  font-size: 44px;
  line-height: 1;
  opacity: 0.8;
}
.hero-locked-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}
.hero-locked-desc {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 320px;
  margin: 0;
}
.hero-locked-escape {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero-locked-escape:hover { color: var(--ink-soft); }

.hero-meta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.meta-card {
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 14px 18px;
  box-shadow: var(--clay-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 140px;
}

.meta-card-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: var(--clay-sm);
  flex-shrink: 0;
}

.meta-card-icon.coral { background: var(--coral-soft); }
.meta-card-icon.sage { background: var(--sage-soft); }
.meta-card-icon.butter { background: var(--butter-soft); }

.meta-card-text { display: flex; flex-direction: column; gap: 2px; }

.meta-card-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}

.meta-card-value {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Intensity */
.intensity-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--r-sm);
  box-shadow: var(--clay-sm);
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.intensity-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}

.intensity-dots {
  display: flex;
  gap: 8px;
  flex: 1;
}

.intensity-dot {
  flex: 1;
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--bg-warm);
  box-shadow: var(--clay-inset);
}

.intensity-dot.filled {
  background: linear-gradient(90deg, var(--coral) 0%, var(--coral-deep) 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255,255,255,0.5),
    0 2px 6px rgba(232, 132, 104, 0.3);
}

.intensity-text {
  font-size: 13px;
  font-weight: 800;
  color: var(--coral-deep);
  white-space: nowrap;
}

/* Key block */
.hero-key {
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 18px 20px;
  box-shadow: var(--clay-sm);
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.hero-key-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-bottom: 6px;
}

.hero-key-text {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
  font-weight: 500;
}

.btn-start {
  width: 100%;
  padding: 20px;
  border: none;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--ink) 0%, #3a3530 100%);
  color: white;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow:
    10px 12px 24px rgba(42,37,32,0.3),
    -4px -4px 14px rgba(255,255,255,0.7),
    inset 2px 2px 4px rgba(255,255,255,0.15);
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.btn-start:hover {
  transform: translateY(-3px);
  box-shadow:
    14px 16px 32px rgba(42,37,32,0.38),
    -4px -4px 14px rgba(255,255,255,0.7),
    inset 2px 2px 4px rgba(255,255,255,0.2);
}

.btn-start:active {
  transform: translateY(0);
  box-shadow:
    inset 4px 4px 10px rgba(0,0,0,0.4),
    inset -2px -2px 6px rgba(255,255,255,0.08);
}

.btn-start-arrow {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-weight: 900;
  font-size: 14px;
}

/* AI card */
.ai-card {
  background: linear-gradient(135deg, #F0F6EC 0%, #E3EEDC 100%);
  border-radius: var(--r-md);
  padding: 22px;
  box-shadow: var(--clay-md);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.ai-card::before {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,196,162,0.4), transparent 70%);
  bottom: -100px; right: -80px;
  pointer-events: none;
}

.ai-avatar {
  width: 52px; height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  box-shadow: var(--clay-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.ai-body { flex: 1; position: relative; z-index: 1; }

.ai-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--sage-deep);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.ai-text {
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.55;
  font-weight: 500;
}

.ai-text strong { color: var(--sage-deep); font-weight: 800; }

/* Right column widgets */
.widget {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 22px;
  box-shadow: var(--clay-md);
}

.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.widget-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.widget-link {
  font-size: 12px;
  font-weight: 800;
  color: var(--coral-deep);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--coral-soft);
  text-decoration: none;
  transition: all 0.2s;
}

.widget-link:hover { transform: translateY(-1px); box-shadow: var(--clay-sm); }

/* Week mini-strip */
.week-mini {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.week-mini-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 2px;
  border-radius: 16px;
  background: var(--bg-warm);
  box-shadow: var(--clay-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.week-mini-day:hover { transform: translateY(-2px); }

.week-mini-day.today {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  color: white;
  box-shadow:
    6px 8px 16px rgba(232,132,104,0.35),
    -2px -2px 8px rgba(255,255,255,0.8),
    inset 2px 2px 3px rgba(255,255,255,0.3);
}

.week-mini-day.done { background: linear-gradient(135deg, var(--sage-soft), var(--sage)); }

.week-mini-day .wd-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.week-mini-day .wd-num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.week-mini-day .wd-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

/* Streak / habits widget */
.streak-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.streak-badge {
  width: 64px; height: 64px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--butter) 0%, var(--butter-deep) 100%);
  box-shadow: var(--clay-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.streak-text { flex: 1; }

.streak-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.streak-num span { color: var(--butter-deep); }

.streak-sub {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}

.habits-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.habit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--bg-warm);
  box-shadow: var(--clay-sm);
}

.habit-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--clay-pressed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: transparent;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.habit-check.done {
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  color: white;
  box-shadow:
    3px 3px 6px rgba(127,166,120,0.4),
    inset 1px 1px 2px rgba(255,255,255,0.4);
}

.habit-label {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
}

.habit-label.done {
  text-decoration: line-through;
  color: var(--ink-mute);
}

.habit-emoji { font-size: 18px; }

/* Botón eliminar hábito (✕) — visible al hover en escritorio, siempre tenue en móvil */
.habit-delete {
  border: none;
  background: transparent;
  color: var(--ink-mute);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  opacity: 0.45;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.habit-row:hover .habit-delete { opacity: 1; }
.habit-delete:hover {
  background: rgba(232, 100, 100, 0.12);
  color: #c44;
  opacity: 1;
}

/* Botón "+ Añadir hábito" */
.habits-add-btn {
  margin-top: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 2px dashed var(--ink-mute);
  border-radius: 16px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.habits-add-btn:hover {
  border-color: var(--coral);
  color: var(--coral-deep);
  background: rgba(232,132,104,0.06);
}

/* Animación "todos completos" — pulse en el badge 🔥 */
@keyframes habit-celebrate {
  0%   { transform: scale(1) rotate(0); }
  20%  { transform: scale(1.25) rotate(-8deg); }
  40%  { transform: scale(1.1) rotate(6deg); }
  60%  { transform: scale(1.18) rotate(-4deg); }
  80%  { transform: scale(1.05) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}
.streak-badge.celebrate {
  animation: habit-celebrate 0.9s cubic-bezier(.34,1.56,.64,1);
}
.streak-wrap.all-done .streak-badge {
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  box-shadow:
    4px 5px 14px rgba(127,166,120,0.4),
    inset 1px 1px 2px rgba(255,255,255,0.4);
}

/* ── Bottom sheet "Nuevo hábito" ───────────────────── */
.habit-sheet {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.habit-sheet[hidden] { display: none; }
.habit-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
}
.habit-sheet-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 24px rgba(0,0,0,0.18);
  animation: sheet-up 0.22s cubic-bezier(.2,.8,.2,1);
}
@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.habit-sheet-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}
.habit-sheet-sub {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 13px;
}
.habit-sheet-fields {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.habit-emoji-input {
  width: 58px;
  text-align: center;
  font-size: 24px;
  padding: 12px 8px;
  border: 2px solid transparent;
  border-radius: 14px;
  background-color: var(--bg-warm);
  outline: none;
}
.habit-emoji-input:focus { border-color: var(--coral); }
.habit-label-input {
  flex: 1;
  padding: 14px 14px;
  font-size: 15px;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: 14px;
  background-color: var(--bg-warm);
  outline: none;
  color: inherit;
}
.habit-label-input:focus { border-color: var(--coral); }

.habit-emoji-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.habit-emoji-picker button {
  font-size: 20px;
  padding: 8px 0;
  border: none;
  border-radius: 12px;
  background-color: var(--bg-warm);
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
}
.habit-emoji-picker button:hover {
  transform: scale(1.12);
  background-color: rgba(232,132,104,0.12);
}

.habit-sheet-actions {
  display: flex;
  gap: 10px;
}
.habit-sheet-actions .btn-primary,
.habit-sheet-actions .btn-secondary {
  flex: 1;
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 14px;
  border: none;
  cursor: pointer;
}
.habit-sheet-actions .btn-secondary {
  background-color: var(--bg-warm);
  color: var(--ink-soft);
}
.habit-sheet-actions .btn-primary {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  color: white;
  box-shadow: 4px 5px 14px rgba(232,132,104,0.32);
}

/* ============================================
   CALENDARIO
   ============================================ */
.cal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.cal-nav-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 6px;
  box-shadow: var(--clay-sm);
}

.cal-nav-btn {
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--bg-warm);
  box-shadow: var(--clay-sm);
  cursor: pointer;
  font-size: 15px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.cal-nav-btn:hover { transform: scale(1.06); color: var(--coral-deep); }

.cal-nav-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  padding: 0 10px;
}

.cal-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
}

@media (max-width: 920px) {
  .cal-grid { grid-template-columns: 1fr; }
}

/* Week strip big */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.week-day {
  padding: 16px 6px;
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--clay-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.week-day:hover { transform: translateY(-3px); box-shadow: var(--clay-md); }

.week-day .wd-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
}

.week-day .wd-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.week-day .wd-badge {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: white;
  font-weight: 800;
}

.week-day.done { background: linear-gradient(135deg, var(--sage-soft), var(--sage)); }
.week-day.done .wd-label { color: #2d4a2a; }
.week-day.done .wd-badge { background: var(--sage-deep); }

.week-day.today {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  color: white;
  box-shadow:
    10px 12px 24px rgba(232,132,104,0.4),
    -4px -4px 14px rgba(255,255,255,0.8),
    inset 2px 2px 4px rgba(255,255,255,0.3);
}

.week-day.today .wd-label { color: rgba(255,255,255,0.85); }
.week-day.today .wd-badge { background: rgba(255,255,255,0.3); }

.week-day.rest { background: var(--bg-warm); opacity: 0.75; }

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 18px 22px;
  box-shadow: var(--clay-sm);
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  /* No "transition: all" — transicionar transform rompe el hit-testing del drag & drop */
  transition: box-shadow 0.25s, background 0.25s, opacity 0.25s;
}

.session-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--clay-md);
}

.session-card.active {
  background: linear-gradient(135deg, #FDF4E9 0%, #FAE8D3 100%);
  box-shadow:
    12px 14px 28px rgba(244,165,140,0.3),
    -4px -4px 14px rgba(255,255,255,0.9);
}

.session-date {
  width: 68px;
  text-align: center;
  padding: 12px 0;
  background: var(--bg-warm);
  border-radius: 18px;
  box-shadow: var(--clay-sm);
  flex-shrink: 0;
}

.session-card.active .session-date {
  background: var(--surface);
}

.session-date-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
}

.session-date-num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  margin-top: 2px;
}

.session-info { flex: 1; }

.session-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.session-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.session-duration {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 700;
}

.session-status {
  width: 44px; height: 44px;
  border-radius: 16px;
  background: var(--bg-warm);
  box-shadow: var(--clay-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.session-status.done {
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  color: white;
}

/* Botón "Compartir" en sesiones completadas — al lado del check verde */
.session-share-btn {
  width: 44px; height: 44px;
  border-radius: 16px;
  background: var(--ink);
  color: white;
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 8px;
  box-shadow: var(--clay-sm);
  transition: transform .15s, opacity .15s;
}
.session-share-btn:hover { transform: translateY(-2px); }
@media (max-width: 540px) {
  .session-share-btn { width: 40px; height: 40px; font-size: 16px; }
}

.session-status.play {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  color: white;
}

.session-card.rest { opacity: 0.7; }

/* Sport icon in session meta */
.session-sport-icon {
  font-size: 15px;
  line-height: 1;
}


/* ── Botón Modificar Horario ───────────────────────────────── */
.btn-edit-schedule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1.5px solid var(--coral);
  color: var(--coral-deep);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--clay-sm);
  transition: background 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}
.btn-edit-schedule:hover {
  background: var(--coral-soft);
  box-shadow: var(--clay-md);
}

/* ── Schedule Editor Sheet ─────────────────────────────────── */
.schedule-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(60,40,20,0.38);
  z-index: 300;
  backdrop-filter: blur(2px);
}
.schedule-overlay.active { display: block; }

.schedule-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -8px 40px rgba(60,40,20,0.18);
  z-index: 301;
  padding: 28px 24px 40px;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0.32s;
  max-height: 80vh;
  overflow-y: auto;
}
.schedule-sheet.active {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              visibility 0s linear 0s;
}

@media (min-width: 600px) {
  .schedule-sheet {
    max-width: 480px;
    left: 50%; right: auto;
    transform: translateX(-50%) translateY(100%);
    bottom: 40px;
    border-radius: 28px;
  }
  .schedule-sheet.active {
    transform: translateX(-50%) translateY(0);
  }
}

.schedule-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.schedule-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.schedule-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-warm);
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
}
.schedule-subtitle {
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 22px;
}

.sch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-warm);
  border-radius: 16px;
  margin-bottom: 10px;
}
.sch-session-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.sch-sport-icon { font-size: 22px; flex-shrink: 0; }
.sch-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sch-meta {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 1px;
}

.sch-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface);
  border: 1.5px solid var(--coral);
  color: var(--coral-deep);
  border-radius: 12px;
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23C75C3A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 120px;
}
.sch-select:focus { outline: none; border-color: var(--coral-deep); }

.schedule-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.btn-schedule-cancel {
  flex: 1;
  padding: 13px;
  background: var(--bg-warm);
  border: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.btn-schedule-save {
  flex: 2;
  padding: 13px;
  background: var(--coral);
  border: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(232,133,90,0.35);
  transition: background 0.18s;
}
.btn-schedule-save:hover { background: var(--coral-deep); }

/* Week goals */
.week-goals {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 540px) {
  .week-goals {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }
}

.goal-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 18px;
  box-shadow: var(--clay-sm);
  text-align: center;
}

@media (max-width: 540px) {
  .goal-card {
    padding: 12px 8px;
    border-radius: 14px;
  }
  .goal-emoji {
    width: 32px; height: 32px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 6px;
  }
  .goal-value { font-size: 20px; }
  .goal-value small { font-size: 11px; }
  .goal-label { font-size: 10px; margin-top: 4px; }
}

.goal-emoji {
  width: 42px; height: 42px;
  border-radius: 14px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--clay-sm);
}

.goal-emoji.c1 { background: var(--coral-soft); }
.goal-emoji.c2 { background: var(--sage-soft); }
.goal-emoji.c3 { background: var(--butter-soft); }

.goal-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.goal-value small {
  font-size: 14px;
  color: var(--ink-mute);
  font-weight: 700;
}

.goal-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-top: 6px;
}

/* ============================================
   PROGRESO
   ============================================ */
.progreso-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 880px) {
  .progreso-grid { grid-template-columns: 1fr; }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* desktop: 3 columnas al 33% */
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 700px) {
  /* En móvil: distancia + tiempo en fila 1, sesiones full-width abajo */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid .stat-card:nth-child(3) { grid-column: 1 / -1; }
}

.stat-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--clay-md);
  position: relative;
  overflow: hidden;
}

.stat-card-emoji {
  position: absolute;
  bottom: -10px; right: -10px;
  width: 90px; height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 18px;
  font-size: 28px;
  opacity: 0.7;
}

/* Usamos las variantes medias (no las --*-soft que se evaporan con la
   opacity:0.7 del padre). Lavender ya usa la versión media original. */
.stat-card-emoji.coral { background: radial-gradient(circle, var(--coral), transparent 70%); }
.stat-card-emoji.sage { background: radial-gradient(circle, var(--sage), transparent 70%); }
.stat-card-emoji.butter { background: radial-gradient(circle, var(--butter), transparent 70%); }
.stat-card-emoji.lav { background: radial-gradient(circle, var(--lavender), transparent 70%); }

.stat-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-value small {
  font-size: 16px;
  color: var(--ink-mute);
  font-weight: 700;
}

.stat-trend {
  font-size: 11px;
  font-weight: 800;
  color: var(--sage-deep);
  margin-top: 4px;
}

/* Chart */
.chart-container {
  height: 160px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 20px 10px 0;
}

.chart-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  height: 100%;
}

.chart-bar-wrapper {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: 36px;
  border-radius: 16px 16px 10px 10px;
  background: linear-gradient(180deg, var(--bg-warm) 0%, #E4D9C4 100%);
  box-shadow:
    inset 2px 2px 4px rgba(255,255,255,0.6),
    inset -2px -2px 4px rgba(180,155,120,0.15),
    4px 6px 12px rgba(180,155,120,0.18);
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.chart-bar.current {
  background: linear-gradient(180deg, var(--coral) 0%, var(--coral-deep) 100%);
  box-shadow:
    inset 2px 2px 4px rgba(255,255,255,0.4),
    4px 6px 14px rgba(232,132,104,0.35);
}

.chart-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-mute);
  text-transform: uppercase;
}

/* Consistency */
.consistency-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 6px;
  background: var(--bg-warm);
  border-radius: var(--r-sm);
  box-shadow: var(--clay-inset);
}

.consistency-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--clay-sm);
}

.consistency-cell.done {
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255,255,255,0.4),
    3px 3px 6px rgba(127,166,120,0.3);
}

.consistency-cell.today {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255,255,255,0.4),
    3px 3px 8px rgba(232,132,104,0.4);
}

.consistency-cell.rest { opacity: 0.5; }

.legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
}

.legend-dot {
  width: 12px; height: 12px;
  border-radius: 4px;
  box-shadow: var(--clay-sm);
}

/* Battery */
.battery-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.battery-visual {
  flex: 1;
  height: 36px;
  background: var(--bg-warm);
  border-radius: var(--r-pill);
  box-shadow: var(--clay-inset);
  padding: 4px;
  overflow: hidden;
}

.battery-fill {
  height: 100%;
  background: linear-gradient(90deg, #60A5FA 0%, #3B82F6 100%);
  border-radius: var(--r-pill);
  box-shadow:
    inset 1px 1px 2px rgba(255,255,255,0.5),
    0 2px 4px rgba(59,130,246,0.25);
  transition: width 1s ease;
}

.battery-pct {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sage-deep);
  min-width: 60px;
  text-align: right;
}

/* PRs */
.pr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pr-item {
  background: var(--bg-warm);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--clay-sm);
}

.pr-distance {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-bottom: 4px;
}

.pr-time {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pr-time .pr-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: var(--r-pill);
  background: var(--butter-soft);
  color: var(--butter-deep);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 4px;
  vertical-align: middle;
}

/* Completion */
.completion-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.completion-bar-outer {
  flex: 1;
  height: 20px;
  background: var(--bg-warm);
  border-radius: var(--r-pill);
  box-shadow: var(--clay-inset);
  padding: 3px;
  overflow: hidden;
}

.completion-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--coral) 0%, var(--coral-deep) 100%);
  border-radius: var(--r-pill);
  box-shadow: inset 1px 1px 2px rgba(255,255,255,0.4);
}

.completion-pct {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--coral-deep);
  min-width: 58px;
  text-align: right;
}

/* ============================================
   PERFIL
   ============================================ */
.perfil-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 880px) {
  .perfil-grid { grid-template-columns: 1fr; }
}

.profile-hero {
  background: linear-gradient(135deg, #FDF4E9 0%, #FAE8D3 100%);
  border-radius: var(--r-lg);
  padding: 30px 26px;
  box-shadow: var(--clay-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,165,140,0.5), transparent 70%);
  top: -120px; left: -80px;
}

.profile-avatar-xl {
  width: 100px; height: 100px;
  margin: 0 auto 16px;
  border-radius: 32px;
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  color: white;
  box-shadow: var(--clay-lg);
  position: relative;
  z-index: 1;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.profile-sport {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 700;
  margin-top: 4px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.profile-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  position: relative;
  z-index: 1;
}

.phs-item {
  background: var(--surface);
  border-radius: 18px;
  padding: 12px 6px;
  box-shadow: var(--clay-sm);
}

.phs-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--coral-deep);
}

.phs-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-top: 2px;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-section {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 10px 14px;
  box-shadow: var(--clay-md);
}

.profile-section-title {
  padding: 12px 10px 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 18px;
  transition: all 0.2s;
  cursor: pointer;
}

.profile-row:hover { background: var(--bg-warm); }

.profile-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.profile-row-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--clay-sm);
  flex-shrink: 0;
}

.profile-row-icon.c1 { background: var(--coral-soft); }
.profile-row-icon.c2 { background: var(--sage-soft); }
.profile-row-icon.c3 { background: var(--butter-soft); }
.profile-row-icon.c4 { background: var(--lavender); }
.profile-row-icon.c5 { background: var(--sky); }

.profile-row-text { display: flex; flex-direction: column; gap: 2px; }

.profile-row-label {
  font-size: 14px;
  font-weight: 700;
}

.profile-row-sub {
  font-size: 12px;
  color: var(--ink-mute);
  font-weight: 600;
}

.profile-row-right {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Toggle */
.profile-toggle {
  display: flex;
  background: var(--bg-warm);
  border-radius: var(--r-pill);
  padding: 4px;
  box-shadow: var(--clay-pressed);
}

.toggle-opt {
  padding: 7px 14px;
  border: none;
  border-radius: var(--r-pill);
  background: none;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-opt.active {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  color: white;
  box-shadow:
    3px 4px 8px rgba(232,132,104,0.35),
    inset 1px 1px 2px rgba(255,255,255,0.3);
}

/* Switch */
.switch {
  width: 48px; height: 28px;
  border-radius: var(--r-pill);
  background: var(--bg-warm);
  box-shadow: var(--clay-pressed);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--clay-sm);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.switch.on { background: linear-gradient(90deg, var(--sage) 0%, var(--sage-deep) 100%); }
.switch.on::after { left: 23px; background: white; }

/* Strava button */
.strava-btn {
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #FC6B2A 0%, #FC4C02 100%);
  color: white;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    10px 12px 24px rgba(252,76,2,0.3),
    -4px -4px 14px rgba(255,255,255,0.8),
    inset 2px 2px 4px rgba(255,255,255,0.2);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.strava-btn:hover { transform: translateY(-3px); }

/* ============================================
   FLOATING BOTTOM NAV
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  /* Centrado seguro: left+right en lugar de left:50%+transform
     — evita recorte en móviles con overflow-x */
  left: 0;
  right: 0;
  margin: 0 auto;
  width: fit-content;
  max-width: calc(100vw - 32px);
  display: flex;
  gap: 6px;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--r-pill);
  box-shadow: var(--clay-lg);
  z-index: 9999;
}

.nav-item {
  border: none;
  background: none;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--ink-soft);
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--clay-sm);
  transition: all 0.2s;
}

.nav-item .nav-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--ink);
}

.nav-item:hover .nav-icon {
  transform: translateY(-2px) rotate(-4deg);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  color: white;
  box-shadow:
    6px 8px 16px rgba(232,132,104,0.35),
    inset 1px 1px 2px rgba(255,255,255,0.3);
  padding: 10px 22px 10px 14px;
}

.nav-item.active .nav-icon {
  background: rgba(255,255,255,0.25);
  box-shadow: inset 1px 1px 2px rgba(255,255,255,0.4);
}

.nav-item.active .nav-label {
  max-width: 120px;
  opacity: 1;
  margin-left: 2px;
}

@media (max-width: 540px) {
  /* Nav inferior — 6 items en 2 filas × 3 columnas con layout HORIZONTAL
     (icono a la izquierda, label a la derecha). Igual que escritorio pero apilado. */
  .bottom-nav {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    padding: 8px;
    max-width: calc(100vw - 14px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: 6px;
    border-radius: 22px;
  }
  .nav-item {
    flex: initial;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 14px;
    min-width: 0;
  }
  .nav-item .nav-icon {
    width: 26px; height: 26px; font-size: 14px;
    box-shadow: none;
    background: transparent;
    flex-shrink: 0;
  }
  .nav-item .nav-label {
    display: block;
    max-width: none;
    font-size: 11px;
    margin-left: 0;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    flex: 1;
  }
  .nav-item.active {
    padding: 8px 10px;
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
    color: white;
    box-shadow: 4px 5px 14px rgba(232,132,104,0.32);
  }
  .nav-item.active .nav-icon { background: transparent; }
  .nav-item.active .nav-label { color: white; }

  /* Topbar — plana edge-to-edge en móvil (sin esquinas redondas, sin sombra) */
  .app-topbar {
    padding: 10px 14px;
    margin-left: -14px;
    margin-right: -14px;
    margin-top: 0;
    margin-bottom: 18px;
    border-radius: 0;
    box-shadow: none;
    gap: 10px;
  }
  .app-topbar-logo { font-size: 17px; }
  .brand-mark {
    width: 30px !important; height: 30px !important;
    font-size: 15px !important;
    border-radius: 10px !important;
  }
  .topbar-actions { gap: 6px; }
  .topbar-icon-btn {
    width: 34px; height: 34px;
    font-size: 15px;
  }
  .topbar-avatar {
    width: 34px; height: 34px;
    font-size: 14px;
  }
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42,37,32,0.35);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open { display: flex; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--clay-lg);
  width: 100%;
  max-width: 480px;
  padding: 32px;
  animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.modal-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.modal-section { margin-bottom: 22px; }

.modal-section-label {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--ink);
}

.feel-scale {
  display: flex;
  gap: 10px;
}

.feel-btn {
  flex: 1;
  aspect-ratio: 1;
  border: none;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--clay-sm);
  font-size: 26px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.feel-btn:hover {
  transform: translateY(-3px) rotate(-4deg);
  box-shadow: var(--clay-md);
}

.feel-btn.selected {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  box-shadow:
    8px 10px 18px rgba(232,132,104,0.4),
    inset 1px 1px 2px rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

.modal-options {
  display: flex;
  gap: 10px;
}

.modal-opt {
  flex: 1;
  padding: 12px 10px;
  border: none;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--clay-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s;
  color: var(--ink-soft);
}

.modal-opt:hover {
  transform: translateY(-2px);
  box-shadow: var(--clay-md);
}

.modal-opt.selected {
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  color: white;
  box-shadow:
    6px 8px 16px rgba(127,166,120,0.35),
    inset 1px 1px 2px rgba(255,255,255,0.3);
}

.modal-textarea {
  width: 100%;
  border: none;
  border-radius: 18px;
  background: var(--bg-warm);
  box-shadow: var(--clay-pressed);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  resize: none;
  outline: none;
  font-family: inherit;
}

.modal-textarea:focus {
  box-shadow:
    var(--clay-pressed),
    0 0 0 3px var(--coral-soft);
}

.btn-complete {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  color: white;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow:
    10px 12px 24px rgba(232,132,104,0.4),
    inset 2px 2px 4px rgba(255,255,255,0.3);
  transition: all 0.2s;
}

.btn-complete:hover { transform: translateY(-3px); }

/* ============================================
   BOTTOM SHEET — genérico (ZonasRecalculadas, etc.)
   ============================================ */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.sheet-overlay.visible {
  opacity: 1;
  visibility: visible;
}
.bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface, #FFFCF7);
  border-radius: 24px 24px 0 0;
  z-index: 201;
  padding: 0 20px calc(32px + env(safe-area-inset-bottom, 0px));
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.32,0.72,0,1), visibility 0s 0.32s;
}
.bottom-sheet.open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.32,0.72,0,1);
}
.sheet-handle {
  width: 40px; height: 4px;
  background: var(--border, #EAE4DA);
  border-radius: 99px;
  margin: 14px auto 0;
}
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 12px;
  border-bottom: 1.5px solid var(--border, #EAE4DA);
  margin-bottom: 18px;
}
.sheet-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}
.sheet-close {
  background: none; border: none;
  font-size: 1rem; cursor: pointer;
  color: var(--ink-mute);
  padding: 4px 6px;
  border-radius: 8px;
}
.sheet-close:hover { background: var(--surface2, #F5EEE6); }
.sheet-sub {
  font-size: 14px; color: var(--ink-soft);
  font-weight: 600; margin-bottom: 14px;
}
.sheet-back {
  background: none; border: none;
  font-family: inherit;
  font-size: 13px; font-weight: 700;
  color: var(--ink-mute); cursor: pointer;
  padding: 0; margin-bottom: 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sheet-back:hover { color: var(--ink-soft); }

/* ============================================
   SHARE SHEET — bottom sheet de compartir imágenes
   ============================================ */
.share-sheet { padding-bottom: 28px; }

/* Toggle "Con fondo / Transparente" */
.share-bg-toggle {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg-warm); border-radius: 99px;
  margin: 8px 0 4px;
}
.share-bg-opt {
  flex: 1; padding: 10px 14px;
  border-radius: 99px; border: none;
  background: transparent; color: var(--ink-soft);
  font-family: inherit; font-weight: 700; font-size: 13px;
  cursor: pointer; transition: all 0.18s;
}
.share-bg-opt.active {
  background: var(--coral);
  color: white;
  box-shadow: 2px 3px 8px rgba(232,132,104,0.3);
}

/* Carrusel horizontal con scroll-snap + peek lateral
   (deja ver un trozo de las slides vecinas para que se entienda que hay más) */
.share-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  margin: 12px -20px 12px;
  padding: 12px 36px 18px;
  gap: 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.share-carousel::-webkit-scrollbar { display: none; }
.share-slide {
  flex: 0 0 auto;
  scroll-snap-align: center;
  display: flex; justify-content: center; align-items: center;
  opacity: 0.4;
  transition: opacity 0.3s, transform 0.3s;
  transform: scale(0.92);
}
.share-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

/* Indicadores (puntitos) */
.share-dots {
  display: flex; justify-content: center; gap: 8px;
  margin-bottom: 6px;
}
.share-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-mute);
  opacity: 0.4;
  cursor: pointer;
  transition: all 0.2s;
}
.share-dot.active {
  background: var(--coral);
  opacity: 1;
  width: 24px; border-radius: 99px;
}

.share-variant-label {
  text-align: center;
  font-size: 12px; font-weight: 800;
  color: var(--ink);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 14px;
  opacity: 0.85;
}

.share-actions {
  display: flex; gap: 10px; padding-top: 6px;
}

/* ============================================
   SKELETONS — placeholders animados durante la carga
   ============================================ */
.skeleton {
  background: linear-gradient(90deg,
    rgba(180,155,120,0.08) 0%,
    rgba(180,155,120,0.18) 50%,
    rgba(180,155,120,0.08) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
  color: transparent !important;
  user-select: none;
  pointer-events: none;
}
.skeleton-line { height: 14px; min-width: 40px; display: inline-block; }
.skeleton-line.lg { height: 20px; }
.skeleton-line.xl { height: 28px; }

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
}

/* ============================================
   UTILITIES
   ============================================ */
.stack { display: flex; flex-direction: column; gap: 22px; }
.hidden { display: none !important; }

@media (max-width: 560px) {
  .shell {
    padding-left: 14px;
    padding-right: 14px;
    padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px));
  }
  .app-topbar {
    padding: 10px 14px;
    margin-left: -14px;
    margin-right: -14px;
    border-radius: var(--r-pill) var(--r-pill) 0 0;
  }
  .topbar-search { display: none; }
  .ob-card { padding: 24px 22px 28px; }
  .ob-options.grid-3 { grid-template-columns: 1fr; }
  .ob-options.grid-2 { grid-template-columns: 1fr; }
  .hero-card { padding: 22px; }

  /* Hero card bloqueado — padding reducido y título más compacto */
  .hero-card-locked { padding: 28px 22px; }
  .hero-locked-title { font-size: 1.1rem; }
  .hero-locked-icon { font-size: 38px; }

  /* Step 10 — datos físicos: apilar verticalmente para no apretar */
  #step10 > .conditional-field {
    flex-direction: column !important;
    gap: 14px;
  }
  #step10 .field-group { width: 100%; }

  /* Resultado reciente del step 8 — dos columnas → una */
  .field-two-col { grid-template-columns: 1fr !important; }

  /* Info box: padding más compacto */
  .ob-info-box { padding: 12px 14px; }
  .ob-info-text { font-size: 12.5px; line-height: 1.5; }

  /* Checkbox consentimiento: legibilidad en móvil */
  .ob-consent-label { padding: 11px 12px; }
  .ob-consent-label span { font-size: 11.5px; }

  /* Selects: chevron más cercano al borde para no comerse texto */
  select.field-input { padding-right: 38px; background-position: right 12px center; }

  /* Bottom sheet: ocupar más altura útil + padding más compacto */
  .bottom-sheet { max-height: 88vh; padding: 0 14px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .bottom-sheet .conditional-field { padding: 16px 14px; gap: 18px; }
  .bottom-sheet .field-input { padding: 12px 14px; }
  .bottom-sheet select.field-input { padding-right: 36px; background-position: right 10px center; }
}

/* ============================================
   ONBOARDING MODE — ocultar topbar + nav inferior mientras dura el onboarding
   (evita que el usuario navegue a entrenos/eventos sin haber completado perfil)
   ============================================ */
body.onboarding-mode .app-topbar,
body.onboarding-mode .bottom-nav {
  display: none !important;
}

/* ──────────────────────────────────────────────
   STRAVA BRANDING — "Powered by STRAVA"
   Cumple Brand Guidelines:
   - STRAVA wordmark en ALL CAPS y color #FC4C02 (Strava Orange)
   - Link a strava.com en cada instancia
   - Mostrado allí donde renderizamos datos provenientes de Strava
   ============================================ */
.powered-by-strava {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  color: var(--ink-mute);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 0;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.powered-by-strava:hover { opacity: 0.75; }
.powered-by-strava .strava-mark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #FC4C02;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.powered-by-strava .strava-chevron {
  width: 11px; height: 11px;
  flex-shrink: 0;
}

/* Wrapper centrado bajo widgets */
.strava-attribution-row {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}

/* ═══════════════════════════════════════════════════════════════
   NOTIFICACIONES — panel de la campana (theme-aware)
   ═══════════════════════════════════════════════════════════════ */
.notif-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1000;
  opacity: 0; transition: opacity .2s;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 70px 16px 16px;
}
.notif-overlay.open { opacity: 1; }
.notif-panel {
  width: 100%; max-width: 420px;
  max-height: 75vh; overflow-y: auto;
  background: var(--surface, #fff);
  border-radius: 18px;
  box-shadow: var(--clay-md, 0 20px 50px rgba(0,0,0,0.25));
  border: 1px solid var(--line, rgba(0,0,0,0.06));
  transform: translateY(-8px); transition: transform .2s;
}
.notif-overlay.open .notif-panel { transform: translateY(0); }
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line, rgba(0,0,0,0.06));
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
  color: var(--ink); position: sticky; top: 0; background: var(--surface, #fff);
}
.notif-panel-close {
  background: none; border: none; cursor: pointer;
  font-size: 15px; font-weight: 800; color: var(--ink-mute);
}
.notif-list { padding: 8px; }
.notif-empty { text-align: center; padding: 36px 20px; color: var(--ink-mute); font-size: 14px; }
.notif-item {
  padding: 14px 14px; border-radius: 12px; margin-bottom: 4px;
  transition: background .15s;
}
.notif-item.unread { background: var(--coral-soft, #fdeee8); }
.notif-item-title { font-weight: 800; font-size: 14px; color: var(--ink); margin-bottom: 3px; }
.notif-item-body  { font-size: 13px; color: var(--ink-soft); line-height: 1.45; white-space: pre-wrap; }
.notif-item-time  { font-size: 11px; color: var(--ink-mute); font-weight: 600; margin-top: 6px; }

/* Onboarding bloqueante — el usuario no puede cerrar el modal sin terminar */
body.onboarding-mode .btn-close { display: none !important; }

/* Botón "?" informativo del onboarding */
.ob-info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--ink-mute, #b0a89a); color: white;
  font-size: 13px; font-weight: 800;
  border: none; cursor: pointer;
  vertical-align: middle; margin-left: 6px;
  line-height: 1;
}
.ob-info-btn:hover { filter: brightness(1.1); }

/* Mini modal informativo (zonas, etc.) */
.ob-info-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.ob-info-modal {
  background: var(--surface, #fff); color: var(--ink);
  border-radius: 18px; max-width: 460px; width: 100%;
  padding: 24px 22px; box-shadow: var(--clay-md);
  max-height: 80vh; overflow-y: auto;
}
.ob-info-modal h3 { font-family: var(--font-display); font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.ob-info-modal p  { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 10px; }
.ob-info-modal ul { font-size: 13px; color: var(--ink-soft); padding-left: 20px; margin-bottom: 10px; }
.ob-info-modal ul li { margin-bottom: 4px; }
.ob-info-modal-close {
  margin-top: 10px; padding: 10px 18px; border: none;
  background: var(--coral); color: white; font-weight: 800;
  border-radius: 999px; cursor: pointer; font-family: inherit;
}

/* Modal "¿Cómo fue el entreno?" — versión compacta para móvil */
@media (max-width: 520px) {
  .modal-content { padding: 22px 18px 18px !important; max-width: 95vw; }
  .modal-title   { font-size: 20px; margin-bottom: 4px; }
  .modal-sub     { font-size: 12px; margin-bottom: 14px; }
  .modal-section { margin-bottom: 14px; }
  .modal-section-label { font-size: 12px; margin-bottom: 8px; }
  .feel-scale    { gap: 6px; }
  .feel-btn      { font-size: 20px; border-radius: 14px; }
  .modal-options { gap: 6px; }
  .modal-opt     { padding: 10px 6px; font-size: 12px; border-radius: 12px; }
  .modal-textarea { padding: 10px 14px; font-size: 13px; min-height: 70px; }
  .btn-complete  { padding: 14px; font-size: 14px; }
}

/* ── Navbar inferior: solo iconos en UNA línea (sin labels) ──── */
.nav-item .nav-label { display: none !important; }
.nav-item { padding: 10px 12px !important; gap: 0 !important; }
.nav-item.active { padding: 10px 14px !important; }

@media (max-width: 540px) {
  /* Forzar UNA línea con 6 items */
  .bottom-nav {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 2px !important;
    justify-content: space-around;
    padding: 6px !important;
  }
  .nav-item { padding: 8px 10px !important; flex: 1; justify-content: center; }
  .nav-item .nav-icon {
    width: 30px !important; height: 30px !important; font-size: 16px !important;
    background: var(--bg-warm) !important;
    box-shadow: var(--clay-sm) !important;
  }
  .nav-item.active .nav-icon { background: rgba(255,255,255,0.25) !important; }
}

/* Hero tips: "Cómo hacerlo" + "Si notas fatiga" en la card del entreno */
.hero-tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 20px;
}
.hero-tip--inline {
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--clay-sm);
}
.hero-tip-line {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
  font-weight: 600;
}
.hero-tip-line strong {
  color: var(--ink);
  font-weight: 800;
}
.hero-tip-emoji {
  margin-right: 6px;
}
