:root {
  --bg: #e0e0e0;
  --surface: #f2f2f2;
  --card: #ececef;
  --card-muted: #e4e4e7;
  --line: #c8c8c8;
  --line-strong: #868686;
  --text: #575756;
  --title: #111111;
  --accent: #3d3d3c;
  --accent-hover: #2e2e2d;
  --accent-muted: rgba(61, 61, 60, 0.14);
  --accent-on: #ffffff;
  --brand-lime: #c6dc30;
  --brand-lime-muted: rgba(198, 220, 48, 0.18);
  --sport-accent: #004c38;
  --sport-accent-muted: rgba(0, 76, 56, 0.18);
  --sport-accent-soft: rgba(0, 76, 56, 0.12);
  --tenis-accent: #004c38;
  --tenis-accent-mid: #1f6e58;
  --padel-accent: #0000a8;
  --padel-accent-mid: #3333c0;
  --neu-bg: #e0e5ec;
  --neu-surface: #e0e5ec;
  --neu-metric-bg: var(--neu-bg);
  --neu-metric-surface: var(--neu-surface);
  --neu-raise: 6px 6px 12px rgba(163, 177, 198, 0.6), -6px -6px 12px rgba(255, 255, 255, 0.9);
  --neu-raise-hover: 8px 8px 16px rgba(163, 177, 198, 0.7), -8px -8px 16px rgba(255, 255, 255, 0.95);
  --neu-inset: inset 4px 4px 9px rgba(163, 177, 198, 0.6), inset -4px -4px 9px rgba(255, 255, 255, 0.9);
  --neu-soft: 4px 4px 8px rgba(163, 177, 198, 0.45), -4px -4px 8px rgba(255, 255, 255, 0.8);
  --control-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  --nav-bar-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 0.18s var(--ease-out);
  --transition-med: 0.28s var(--ease-out);
  --form-section-gap: 18px;
  --section-title-gap: 10px;
  --app-content-width: 800px;
  --filter-label-gap: 10px;
  --field-stack-gap: 18px;
  --content-block-radius: var(--radius-lg);
  --page-bg-top: #e0e0e0;
  --page-bg-bottom: #e0e0e0;
  --page-glow: transparent;
  --page-glow-a: rgba(0, 110, 80, 0.12);
  --page-glow-b: rgba(30, 30, 190, 0.10);
  --notif-item-bg: #f5f5f5;
  --notif-unread-bg: #fff8e1;
  --notif-unread-border: rgba(255, 193, 7, 0.45);
  --notif-panel-title: #111111;
  --heat-cell-border: rgba(0, 0, 0, 0.1);
  --heat-empty-bg: #c5cad3;
  --select-pill-bg: #ffffff;
  --select-pill-border: var(--line);
  --content-block-bg: #ffffff;
  --content-block-shadow: var(--neu-raise);
  --content-block-shadow-soft: var(--neu-soft);
  --nav-bar-bg: #ffffff;
  --nav-bar-border: transparent;
  --nav-inactive: #8a8a8a;
  --nav-active-label: #111111;
  --nav-accent: #d7e121;
  --chrome-bg: #3d3d3d;
  --chrome-fg: #f4f4f4;
}

body.dark {
  --bg: #1f2022;
  --surface: #2b2d31;
  --card: #35373c;
  --card-muted: #2b2d31;
  --neu-bg: #2a2d33;
  --neu-surface: #2a2d33;
  --neu-metric-bg: var(--neu-bg);
  --neu-metric-surface: var(--neu-surface);
  --neu-raise: 6px 6px 12px rgba(0, 0, 0, 0.55), -6px -6px 12px rgba(255, 255, 255, 0.045);
  --neu-raise-hover: 8px 8px 16px rgba(0, 0, 0, 0.62), -8px -8px 16px rgba(255, 255, 255, 0.06);
  --neu-inset: inset 4px 4px 9px rgba(0, 0, 0, 0.55), inset -4px -4px 9px rgba(255, 255, 255, 0.045);
  --neu-soft: 4px 4px 8px rgba(0, 0, 0, 0.42), -4px -4px 8px rgba(255, 255, 255, 0.035);
  --control-shadow: none;
  --nav-bar-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.38);
  --line: #4f535a;
  --text: #e0e0df;
  --title: #f4f4f4;
  --accent: #e0e0df;
  --accent-hover: #ffffff;
  --accent-muted: rgba(224, 224, 223, 0.12);
  --accent-on: #1f2022;
  --shadow: rgba(0, 0, 0, 0.35);
  --chart-track: #3a3d42;
  --chart-loss: #5a5e66;
  --page-bg-top: #2a2d33;
  --page-bg-bottom: #2a2d33;
  --page-glow: transparent;
  --page-glow-a: rgba(28, 140, 110, 0.14);
  --page-glow-b: rgba(70, 70, 220, 0.14);
  --notif-item-bg: var(--card-muted);
  --notif-unread-bg: rgba(255, 193, 7, 0.16);
  --notif-unread-border: rgba(255, 193, 7, 0.38);
  --notif-panel-title: var(--title);
  --heat-cell-border: rgba(255, 255, 255, 0.12);
  --heat-empty-bg: #454850;
  --select-pill-bg: var(--card);
  --select-pill-border: var(--line);
  --content-block-bg: #35373c;
  --content-block-shadow: var(--neu-raise);
  --content-block-shadow-soft: var(--neu-soft);
  --nav-bar-bg: #2a2c30;
  --nav-bar-border: rgba(255, 255, 255, 0.12);
  --nav-inactive: #9a9a9a;
  --nav-active-label: #ffffff;
  --nav-accent: #d7e121;
  --chrome-bg: #1f2022;
  --chrome-fg: #f4f4f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Helvetica, Arial, sans-serif;
  color: var(--text);
  background-color: var(--page-bg-bottom);
  background-image:
    radial-gradient(ellipse 85% 60% at 100% -8%, var(--page-glow-a), transparent 60%),
    radial-gradient(ellipse 80% 55% at -5% 108%, var(--page-glow-b), transparent 60%),
    linear-gradient(180deg, var(--page-bg-top) 0%, var(--page-bg-bottom) 100%);
  background-attachment: fixed;
}

body:not(.dark) .form-block:not(.activity-panel-inner),
body:not(.dark) .form-block-soft:not(.activity-panel-inner),
body:not(.dark) .dash-widget,
body:not(.dark) .record-card,
body:not(.dark) .activity-panel,
body:not(.dark) .dash-empty,
body:not(.dark) .period-stat,
body:not(.dark) .period-activity-item,
body:not(.dark) .perception-mini,
body:not(.dark) .tm-row,
body:not(.dark) .journal-list li,
body:not(.dark) .bracket-match,
body:not(.dark) .widget-hero,
body:not(.dark) .chip-fieldset,
body:not(.dark) .sport-exp-block,
body:not(.dark) #editProfileForm.profile-card,
body:not(.dark) .profile-card .chip-fieldset,
body:not(.dark) .profile-card .sport-exp-block {
  border-color: transparent;
}

body:not(.dark) .form-block:not(.activity-panel-inner),
body:not(.dark) .form-block-soft:not(.activity-panel-inner),
body:not(.dark) .dash-widget,
body:not(.dark) .record-card,
body:not(.dark) .dash-empty,
body:not(.dark) .card:not(.profile-card) {
  box-shadow: var(--content-block-shadow);
}

body:not(.dark) .activity-panel,
body:not(.dark) .period-stat,
body:not(.dark) .period-activity-item,
body:not(.dark) .perception-mini,
body:not(.dark) .tm-row,
body:not(.dark) .journal-list li,
body:not(.dark) .bracket-match,
body:not(.dark) .chip-fieldset,
body:not(.dark) .sport-exp-block,
body:not(.dark) .profile-card .chip-fieldset,
body:not(.dark) .profile-card .sport-exp-block,
body:not(.dark) .form-subsection {
  box-shadow: var(--content-block-shadow-soft);
}

body:not(.dark) .form-block .form-subsection,
body:not(.dark) .form-block-soft .form-subsection {
  box-shadow: none;
  border: none;
}

body:not(.dark) .activity-panel.is-open {
  box-shadow: var(--content-block-shadow);
}

body[data-sport="tenis"] {
  --sport-accent: #004c38;
  --sport-accent-muted: rgba(0, 76, 56, 0.18);
  --sport-accent-soft: rgba(0, 76, 56, 0.12);
  --page-glow: rgba(0, 76, 56, 0.055);
  --pill-active-start: #1f6e58;
  --pill-active-end: #004c38;
  --chart-primary: #004c38;
  --chart-primary-mid: #1f6e58;
  --chart-primary-light: #5a998a;
  --chart-primary-soft: #a8ccc2;
  --chart-track: #E8E8E8;
  --chart-loss: #a8ccc2;
  --chart-loss-muted: #c8e0d9;
  --chart-heat-1: #9bc4b8;
  --chart-heat-2: #6aab96;
  --chart-heat-3: #1f6e58;
  --chart-heat-4: #004c38;
  --neu-metric-bg: var(--neu-bg);
  --neu-metric-surface: var(--neu-surface);
}

body[data-sport="padel"] {
  --sport-accent: #0000a8;
  --sport-accent-muted: rgba(0, 0, 168, 0.18);
  --sport-accent-soft: rgba(0, 0, 168, 0.12);
  --page-glow: rgba(0, 0, 168, 0.045);
  --pill-active-start: #4d4dcc;
  --pill-active-end: #0000a8;
  --chart-primary: #0000a8;
  --chart-primary-mid: #3333c0;
  --chart-primary-light: #7070d8;
  --chart-primary-soft: #bcbcec;
  --chart-track: #E0E0F4;
  --chart-loss: #bcbcec;
  --chart-loss-muted: #d6d6f2;
  --chart-heat-1: #b8b8e8;
  --chart-heat-2: #7070d0;
  --chart-heat-3: #3333c0;
  --chart-heat-4: #0000a8;
  --neu-metric-bg: var(--neu-bg);
  --neu-metric-surface: var(--neu-surface);
}

.hidden {
  display: none !important;
}

html.setric-restoring-session #authCard {
  display: none !important;
}

html.setric-restoring-session #appCard {
  display: block !important;
}

/* Loader: anillo de pelotitas con cola de opacidad (estilo activity indicator) */
.setric-loader {
  --loader-size: 40px;
  --loader-dot: 8px;
  --loader-color: #ffffff;
  position: relative;
  width: var(--loader-size);
  height: var(--loader-size);
  flex-shrink: 0;
}

.setric-loader span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--loader-dot);
  height: var(--loader-dot);
  margin: calc(var(--loader-dot) / -2) 0 0 calc(var(--loader-dot) / -2);
  border-radius: 50%;
  background: var(--loader-color);
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.35);
  animation: setric-loader-fade 0.8s linear infinite;
  transform: rotate(calc(var(--i) * 45deg)) translateY(calc(var(--loader-size) / -2 + var(--loader-dot) / 2));
  opacity: 0.15;
}

.setric-loader span:nth-child(1) { --i: 0; animation-delay: -0.7s; }
.setric-loader span:nth-child(2) { --i: 1; animation-delay: -0.6s; }
.setric-loader span:nth-child(3) { --i: 2; animation-delay: -0.5s; }
.setric-loader span:nth-child(4) { --i: 3; animation-delay: -0.4s; }
.setric-loader span:nth-child(5) { --i: 4; animation-delay: -0.3s; }
.setric-loader span:nth-child(6) { --i: 5; animation-delay: -0.2s; }
.setric-loader span:nth-child(7) { --i: 6; animation-delay: -0.1s; }
.setric-loader span:nth-child(8) { --i: 7; animation-delay: 0s; }

.setric-loader--sm {
  --loader-size: 28px;
  --loader-dot: 6px;
}

.setric-loader--lg {
  --loader-size: 56px;
  --loader-dot: 10px;
}

.setric-loader--on-light {
  --loader-color: #575756;
}

.setric-loader--on-light span {
  box-shadow: 0 0 2px rgba(87, 87, 86, 0.25);
}

.setric-loader--brand {
  --loader-color: #d7e121;
}

.setric-loader--inline {
  display: inline-block;
  vertical-align: middle;
}

@keyframes setric-loader-fade {
  0% { opacity: 1; }
  100% { opacity: 0.12; }
}

.setric-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(17, 17, 17, 0.48);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.setric-loader-overlay.hidden {
  display: none !important;
}

.setric-loader-overlay__text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}

@media (prefers-reduced-motion: reduce) {
  .setric-loader span {
    animation: none;
    opacity: 0.55;
  }
  .setric-loader span:nth-child(1),
  .setric-loader span:nth-child(3),
  .setric-loader span:nth-child(5),
  .setric-loader span:nth-child(7) {
    opacity: 1;
  }
}

.container {
  width: min(1200px, 95vw);
  margin: 0 auto;
  padding: 24px 0;
}

main.container:has(#appCard:not(.hidden)) {
  padding-top: 0;
}

main.container:has(#authCard:not(.hidden)):has(#appCard.hidden) {
  width: 100%;
  max-width: none;
  padding: 0;
  /* overflow-x:hidden en .container (mobile) rompe position:sticky del header */
  overflow-x: visible;
}

.card {
  border: none;
  border-radius: var(--content-block-radius);
  background: var(--content-block-bg);
  box-shadow: var(--neu-raise);
}

/* ── Landing (authCard) ── */
/* Landing siempre en claro (sin dark mode) */
body.dark:has(#authCard:not(.hidden)):has(#appCard.hidden) {
  --bg: #e8e8e8;
  --surface: #f2f2f2;
  --card: #ececef;
  --card-muted: #e4e4e7;
  --neu-bg: #e0e5ec;
  --neu-surface: #ececef;
  --line: #c8c8c8;
  --line-strong: #868686;
  --text: #575756;
  --title: #111111;
  --accent: #3d3d3c;
  --accent-hover: #2e2e2d;
  --accent-muted: rgba(61, 61, 60, 0.14);
  --accent-on: #ffffff;
  --page-bg-top: #e0e5ec;
  --page-bg-bottom: #e0e5ec;
  --page-glow-a: rgba(0, 110, 80, 0.12);
  --page-glow-b: rgba(30, 30, 190, 0.10);
  --content-block-bg: #ffffff;
  color: var(--text);
  background-color: var(--page-bg-bottom);
  background-image:
    radial-gradient(ellipse 85% 60% at 100% -8%, var(--page-glow-a), transparent 60%),
    radial-gradient(ellipse 80% 55% at -5% 108%, var(--page-glow-b), transparent 60%),
    linear-gradient(180deg, var(--page-bg-top) 0%, var(--page-bg-bottom) 100%);
  color-scheme: light;
}

.landing {
  --landing-setric: #d7e121;
  --landing-padel: #0000a8;
  --landing-tenis: #004c38;
  --landing-sky: #c5c5ff;
  --landing-setric-muted: rgba(215, 225, 33, 0.22);
  --landing-padel-muted: rgba(0, 0, 168, 0.12);
  --landing-tenis-muted: rgba(0, 76, 56, 0.14);
  --landing-sky-muted: rgba(197, 197, 255, 0.35);
  color: var(--title);
  background:
    radial-gradient(ellipse 80% 50% at 15% 0%, var(--page-glow-a), transparent 55%),
    radial-gradient(ellipse 70% 45% at 85% 8%, var(--page-glow-b), transparent 50%),
    linear-gradient(180deg, var(--page-bg-top), var(--page-bg-bottom));
}

.landing-hero__title,
.landing-section__title,
.landing-benefit__title,
.landing-cta-final__title {
  font-family: "Archivo", Helvetica, Arial, sans-serif;
}

.landing-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 6px 0;
  padding-top: max(6px, env(safe-area-inset-top, 0px));
  background: rgba(224, 229, 236, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(163, 177, 198, 0.35);
}

.landing-bar__inner,
.landing-hero__inner,
.landing-section__inner {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

.landing-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.landing-bar__logo.setric-logo {
  width: min(116px, 30vw);
  height: auto;
}

.landing-bar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.landing-btn-install {
  font-size: 0.9rem;
}

.landing-btn-install:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.btn.landing-cta-primary {
  background: var(--landing-sky);
  color: var(--landing-padel);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  box-shadow: var(--neu-raise);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.btn.landing-cta-primary--compact {
  padding: 9px 18px;
  font-size: 0.95rem;
}

.btn.landing-cta-primary--large {
  padding: 14px 28px;
  font-size: 1.05rem;
}

.landing-cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: var(--neu-surface);
  color: var(--title);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--neu-soft);
}

@media (hover: hover) {
  .btn.landing-cta-primary:hover {
    background: color-mix(in srgb, var(--landing-sky) 88%, var(--landing-padel));
    color: var(--landing-padel);
    transform: translateY(-1px);
    box-shadow: var(--neu-raise-hover);
  }

  .landing-cta-secondary:hover {
    box-shadow: var(--neu-raise);
  }
}

.landing-hero {
  padding: clamp(32px, 6vw, 72px) 0 clamp(40px, 7vw, 80px);
}

.landing-hero__inner {
  display: block;
}

.landing-hero__title {
  margin: 0 0 16px;
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.landing-hero__subtitle {
  margin: 0 0 28px;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.5;
  color: var(--text);
}

.landing-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.landing-hero__legal {
  margin: 16px 0 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--text);
  opacity: 0.82;
  white-space: nowrap;
}

.landing-hero__legal a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (hover: hover) {
  .landing-hero__legal a:hover {
    color: var(--title);
  }
}

.landing-card-placeholder,
.landing-screen-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--content-block-radius);
  background: var(--neu-surface);
  box-shadow: var(--neu-raise);
  border: 2px dashed rgba(163, 177, 198, 0.55);
  text-align: center;
}

.landing-card-placeholder--carousel {
  width: 100%;
  height: 100%;
}

.landing-card-placeholder--match {
  background:
    linear-gradient(160deg, var(--landing-tenis-muted), transparent 50%),
    var(--neu-surface);
}

.landing-card-placeholder--tournament {
  background:
    linear-gradient(160deg, var(--landing-padel-muted), transparent 50%),
    var(--neu-surface);
}

.landing-card-placeholder--stats {
  background:
    linear-gradient(160deg, var(--landing-setric-muted), transparent 50%),
    var(--neu-surface);
}

.landing-card-carousel {
  width: 100%;
  max-width: 320px;
  margin-inline: auto;
}

.landing-card-carousel__viewport {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: var(--content-block-radius);
  overflow: hidden;
  box-shadow: var(--neu-raise);
  background: var(--neu-surface);
}

.landing-card-carousel__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
  pointer-events: none;
}

.landing-card-carousel__slide.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.landing-card-carousel__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.landing-card-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.landing-card-carousel__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: rgba(163, 177, 198, 0.65);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.landing-card-carousel__dot.is-active {
  background: var(--landing-tenis);
  transform: scale(1.15);
}

.landing-card-placeholder--showcase {
  aspect-ratio: 4 / 5;
  width: min(100%, 360px);
  min-height: 280px;
  background:
    linear-gradient(160deg, var(--landing-setric-muted), transparent 50%),
    var(--neu-surface);
}

.landing-card-placeholder__label {
  font-family: "Rajdhani", Helvetica, Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--landing-tenis);
}

.landing-card-placeholder__hint {
  font-size: 0.9rem;
  color: var(--text);
  max-width: 18ch;
}

.landing-ticker {
  overflow: hidden;
  background: var(--landing-tenis);
  border-block: 2px solid rgba(0, 0, 0, 0.08);
}

@media (max-width: 899px) {
  .landing-ticker__track {
    padding: 10px 0;
  }

  .landing-ticker__track span,
  .landing-ticker__text {
    font-size: 0.95rem;
  }

  .landing-section.landing-benefits {
    padding-top: 28px;
  }
}

.landing-ticker__track {
  display: flex;
  width: max-content;
  padding: 12px 0;
  animation: landing-ticker 22s linear infinite;
  will-change: transform;
}

.landing-ticker__track span,
.landing-ticker__text {
  flex-shrink: 0;
  padding-right: 0;
  font-family: "Rajdhani", Helvetica, Arial, sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}

@keyframes landing-ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.landing-section {
  padding: clamp(48px, 8vw, 88px) 0;
  scroll-margin-top: 72px;
}

.landing-section__title {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
}

.landing-section__lede {
  margin: 0;
  max-width: 42ch;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
}

.landing-benefits__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.landing-benefit {
  padding: 18px;
  border-radius: var(--content-block-radius);
  background: var(--neu-surface);
  border: 1px solid var(--line);
  box-shadow: var(--neu-raise);
}

.landing-benefit__title {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--landing-padel);
  font-size: 1rem;
  font-weight: 700;
  color: var(--title);
}

.landing-benefit__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text);
}

.landing-how__layout,
.landing-showcase__layout,
.landing-pwa__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(24px, 5vw, 48px);
}

/* Alternar: carrusel a la izquierda, texto a la derecha (desktop) */
.landing-showcase__layout .landing-card-carousel {
  order: 1;
}

.landing-showcase__layout .landing-showcase__copy {
  order: 2;
}

.landing-how__layout {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  align-items: start;
}

.landing-how__visuals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 2vw, 20px);
  align-items: stretch;
  min-width: 0;
  padding: 4px;
  overflow: visible;
}

.landing-screen {
  margin: 0;
  min-width: 0;
  overflow: visible;
}

.landing-screen__img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.landing-screen-placeholder {
  aspect-ratio: 9 / 16;
  min-height: 200px;
  font-family: "Rajdhani", Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.landing-screen--phone {
  width: min(304px, 68vw);
  margin-inline: auto;
  justify-self: center;
}

.landing-vision {
  padding-block: clamp(40px, 6vw, 64px);
  background: var(--landing-tenis);
}

.landing-vision__quote {
  margin: 0;
  text-align: center;
  font-family: "Rajdhani", Helvetica, Arial, sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  color: #fff;
}

.landing-vision__break {
  display: none;
}

.landing-pwa {
  background: linear-gradient(180deg, transparent, var(--landing-sky-muted));
}

.landing-btn-install--large {
  margin-top: 20px;
}

.landing-ios-hint {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--landing-sky-muted);
  border: 1px solid rgba(0, 0, 168, 0.12);
  max-width: 42ch;
}

.landing-ios-hint__title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--title);
}

.landing-ios-hint__lede {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
}

.landing-ios-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.landing-ios-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.landing-ios-step__num {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--landing-padel, #0000a8);
  color: #fff;
  line-height: 1;
}

.landing-ios-step__body {
  min-width: 0;
  flex: 1;
}

.landing-ios-step__text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--title);
}

.landing-ios-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.25em;
  margin-left: 4px;
  color: var(--landing-padel, #0000a8);
}

.landing-cta-final {
  text-align: center;
}

.landing-cta-final__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.landing-cta-final__title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
}

.landing-social__inner {
  text-align: center;
}

.landing-social__inner .landing-section__lede {
  margin-inline: auto;
}

.landing-social__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.landing-social__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.landing-social__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.landing-footer {
  padding: clamp(40px, 8vw, 72px) 0 clamp(32px, 5vw, 48px);
  overflow: hidden;
}

.landing-footer__legal {
  text-align: center;
}

.landing-footer__legal p {
  margin: 0 0 6px;
  font-size: 0.82rem;
  color: var(--text);
}

.landing-footer__legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.landing-footer__legal-links a {
  color: var(--text);
  text-decoration: none;
}

@media (hover: hover) {
  .landing-footer__legal-links a:hover {
    color: var(--title);
    text-decoration: underline;
  }
}

/* ── Páginas legales ── */

.legal-page {
  min-height: 100vh;
  padding: clamp(24px, 5vw, 48px) 0 clamp(48px, 8vw, 72px);
}

.legal-page__inner {
  width: min(720px, 92vw);
  margin-inline: auto;
}

.legal-page__header {
  display: flex;
  justify-content: center;
  margin-bottom: clamp(16px, 3vw, 24px);
}

.legal-page__logo-link {
  display: inline-flex;
}

.legal-page__logo {
  width: min(116px, 30vw);
  height: auto;
}

.legal-page__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 clamp(20px, 4vw, 28px);
  font-size: 0.92rem;
  color: var(--text);
  text-decoration: none;
}

.legal-page__back-arrow {
  font-size: 1.1em;
  line-height: 1;
}

@media (hover: hover) {
  .legal-page__back:hover {
    color: var(--title);
    text-decoration: underline;
  }
}

.legal-doc h1 {
  margin: 0 0 8px;
  font-family: "Rajdhani", Helvetica, Arial, sans-serif;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
}

.legal-doc__updated {
  margin: 0 0 28px;
  font-size: 0.92rem;
  color: var(--text);
}

.legal-doc h2 {
  margin: 32px 0 12px;
  font-family: "Rajdhani", Helvetica, Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.legal-doc p,
.legal-doc li {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

.legal-doc p {
  margin: 0 0 14px;
}

.legal-doc ul {
  margin: 0 0 14px;
  padding-left: 1.25rem;
}

.legal-doc li + li {
  margin-top: 6px;
}

.legal-doc a {
  color: var(--landing-tenis);
}

.legal-doc__notice {
  margin: 0 0 24px;
  padding: 14px 16px;
  border-radius: var(--content-block-radius);
  background: var(--landing-sky-muted);
  border: 1px solid rgba(163, 177, 198, 0.45);
  font-size: 0.95rem;
  line-height: 1.55;
}

.legal-doc__footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(163, 177, 198, 0.45);
  font-size: 0.92rem;
}

.legal-doc__footer-links a {
  color: var(--text);
  text-decoration: none;
}

@media (hover: hover) {
  .legal-doc__footer-links a:hover {
    color: var(--title);
    text-decoration: underline;
  }
}

@media (min-width: 641px) and (max-width: 980px) {
  .landing-benefits__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.setric-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

.setric-logo--dark {
  display: none;
}

/* Header/nav oscuros también en modo claro: usar logo de letras claras */
#appCard .setric-logo--light {
  display: none;
}

#appCard .setric-logo--dark {
  display: block;
}

body.dark .setric-logo--light {
  display: none;
}

body.dark .setric-logo--dark {
  display: block;
}

.brand-inline .setric-logo {
  width: min(148px, 38vw);
  height: auto;
}

/* Íconos SVG vía mask (heredan currentColor: nav activa, dark mode, etc.) */
.ui-icon {
  display: inline-block;
  flex-shrink: 0;
  width: 1.25em;
  height: 1.25em;
  background-color: currentColor;
  -webkit-mask: var(--ui-icon) center / contain no-repeat;
  mask: var(--ui-icon) center / contain no-repeat;
}

.ui-icon--lg {
  width: 40px;
  height: 40px;
}

.ui-icon--activity { --ui-icon: url("./assets/icons/activity.svg"); }
.ui-icon--metrics { --ui-icon: url("./assets/icons/metrics.svg"); }
.ui-icon--tournaments { --ui-icon: url("./assets/icons/tournaments.svg"); }
.ui-icon--records { --ui-icon: url("./assets/icons/records.svg"); }
.ui-icon--notif { --ui-icon: url("./assets/icons/notif.svg"); }
.ui-icon--edit { --ui-icon: url("./assets/icons/edit.svg"); }
.ui-icon--delete { --ui-icon: url("./assets/icons/delete.svg"); }
.ui-icon--share { --ui-icon: url("./assets/icons/share.svg"); }
.ui-icon--download { --ui-icon: url("./assets/icons/download.svg"); }

h1,
h2,
h3,
h4 {
  margin: 0 0 12px;
  color: var(--title);
}

.lead {
  font-size: 1.1rem;
  margin: 0 0 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: var(--filter-label-gap);
  margin-bottom: var(--field-stack-gap);
}

input,
select,
button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 40px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

/* Chevron alineado al inset del ícono de calendario (~12–16px del borde) */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%23575756' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
  padding-right: 36px;
}

select::-ms-expand {
  display: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  margin-right: 0;
  padding: 0;
  cursor: pointer;
}

@media (hover: hover) {
  input:not([readonly]):not(:disabled):hover,
  select:not(:disabled):hover,
  textarea:hover {
    border-color: var(--line-strong);
  }
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

body[data-sport] input:focus-visible,
body[data-sport] select:focus-visible,
body[data-sport] textarea:focus-visible {
  border-color: var(--sport-accent);
  box-shadow: 0 0 0 3px var(--sport-accent-muted);
}

input::placeholder {
  color: #9a9a9a;
}

button {
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid #1f73ff;
  outline-offset: 2px;
}

.btn {
  padding: 10px 20px;
  background: var(--neu-surface);
  color: var(--title);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  box-shadow: var(--neu-raise);
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.btn-primary {
  background: var(--accent);
  background-image: none;
  color: var(--accent-on);
  border-color: transparent;
  box-shadow: var(--neu-raise);
}

#matchForm .btn-primary[type="submit"],
#classForm .btn-primary[type="submit"],
#tournamentForm .btn-primary[type="submit"],
#tournamentMatchForm .btn-primary[type="submit"] {
  background: var(--sport-accent);
  background-image: none;
  color: #fff;
  border-color: transparent;
}

@media (hover: hover) {
  .btn:hover {
    background: var(--card-muted);
    transform: translateY(-1px);
    box-shadow: var(--neu-raise);
  }

  .btn-primary:hover {
    background: var(--accent-hover);
    background-image: none;
    box-shadow: var(--neu-raise);
  }

  #matchForm .btn-primary[type="submit"]:hover,
  #classForm .btn-primary[type="submit"]:hover,
  #tournamentForm .btn-primary[type="submit"]:hover,
  #tournamentMatchForm .btn-primary[type="submit"]:hover {
    background: color-mix(in srgb, var(--sport-accent) 88%, #000);
    background-image: none;
  }

  .btn:active,
  .btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--neu-inset);
  }
}

.full {
  width: 100%;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0 8px;
  padding-top: max(6px, env(safe-area-inset-top, 0px));
  margin-bottom: 8px;
  isolation: isolate;
  background: transparent;
  color: var(--chrome-fg);
}

/* Fondo a todo el viewport (como landing-bar), aunque el header viva dentro del container */
.app-header::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--chrome-bg);
  border-bottom: 1px solid var(--nav-bar-border);
  z-index: -1;
  pointer-events: none;
}

.brand-inline {
  display: flex;
  align-items: center;
  gap: 20px;
}

.app-logo-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.app-logo-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: var(--radius-sm);
}

.brand-inline img {
  width: min(148px, 38vw);
}

.brand-inline .setric-logo {
  width: min(148px, 38vw);
}

.brand-inline h2 {
  font-weight: 900;
  margin: 0;
}

.brand-inline h2.app-tagline {
  font-size: clamp(1.35rem, 1.9vw, 2rem);
  line-height: 1.15;
  white-space: nowrap;
  color: var(--chrome-fg);
}

.tagline-b {
  white-space: nowrap;
}

.tagline-space {
  white-space: pre;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.tabs {
  --nav-active-bg: transparent;
  background: var(--nav-bar-bg);
  padding: 8px 6px 10px;
  margin: 0 6px 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--nav-bar-border);
  border-radius: 22px;
  box-shadow: var(--nav-bar-shadow);
}

.tab-btn {
  border: 0;
  border-radius: 14px;
  min-height: 44px;
  color: var(--nav-inactive);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px 10px;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
  position: relative;
  transition: color var(--transition-fast), background var(--transition-fast);
}

@media (hover: hover) {
  .tab-btn:not(.active):hover {
    background: transparent;
    color: var(--nav-active-label);
    transform: none;
  }
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: inherit;
}

.nav-icon.ui-icon {
  width: 24px;
  height: 24px;
}

.nav-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-align: center;
  color: inherit;
}

.tab-btn.active {
  background: transparent;
  color: var(--nav-accent);
  font-weight: 700;
  box-shadow: none;
}

.tab-btn.active .nav-label {
  color: var(--nav-active-label);
  font-weight: 700;
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: var(--nav-accent);
  transform: translateX(-50%);
}

.tab-btn:focus-visible {
  outline: 3px solid #1f73ff;
  outline-offset: 2px;
}

.page-block {
  padding: 10px 6px 18px;
}

.activity-shell {
  width: 100%;
  background: transparent;
  border-radius: var(--content-block-radius);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-shell {
  width: 100%;
  background: transparent;
  border-radius: var(--content-block-radius);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-shell {
  width: 100%;
  background: transparent;
  border-radius: var(--content-block-radius);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 900px) {
  .activity-shell,
  .form-shell,
  .panel-shell {
    width: 100%;
    max-width: var(--app-content-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
  }

  #appCard > .app-nav.tabs {
    width: 100%;
    max-width: var(--app-content-width);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 16px;
  }

  .page-block {
    padding-left: 0;
    padding-right: 0;
  }

  #editProfileForm.profile-card,
  .profile-card {
    max-width: none;
    width: 100%;
  }

  #statsMatchWidgets.widget-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  #statsMatchWidgets .perf-widgets-row,
  #statsMatchWidgets .stats-dual-row {
    display: contents;
  }

  #statsMatchWidgets .widget-hero,
  #statsMatchWidgets .widget-games,
  #statsMatchWidgets .widget-full,
  #statsMatchWidgets .widget-perception,
  #statsMatchWidgets #widgetPartnersRivals,
  #statsMatchWidgets #matchPeriodListBlock {
    grid-column: 1 / -1;
  }

  #statsMatchWidgets #widgetShotsMatrix:not(.hidden),
  #statsMatchWidgets #widgetShotsMatrix:not(.hidden) + #widgetGlobalHeatmap {
    grid-column: 1 / -1;
  }

  #statsMatchWidgets.widget-group:has(.widget-shots.hidden) .widget-heatmap {
    grid-column: 1 / -1;
  }

  #statsMatchWidgets .widget-games.perf-widget {
    align-self: start;
  }

  #statsMatchWidgets .widget-games .perf-widget-viz {
    min-height: 0;
    flex: 0 0 auto;
    padding: 0;
  }

  #statsMatchWidgets .widget-games .games-index-wrap {
    gap: 10px;
  }

  #statsMatchWidgets .widget-games .perf-widget-caption {
    margin-top: 4px;
    margin-bottom: 0;
  }

  #statsMatchWidgets .widget-games .perf-widget-foot-empty {
    display: none;
    min-height: 0;
  }

  #statsMatchWidgets .widget-donut .perf-widget-viz,
  #statsMatchWidgets .widget-sets .perf-widget-viz {
    min-height: 200px;
  }

  #statsMatchWidgets .sets-chart-wrap {
    height: 200px;
  }

  #statsMatchWidgets .sets-chart-wrap canvas {
    height: 200px !important;
  }

  .form-actions {
    display: flex;
    justify-content: flex-start;
    padding-top: 4px;
  }

  #matchForm .btn-primary[type="submit"],
  #classForm .btn-primary[type="submit"],
  #tournamentForm .btn-primary[type="submit"],
  #tournamentMatchForm .btn-primary[type="submit"] {
    width: auto;
    min-width: 220px;
  }

  #editProfileForm.profile-card > .btn[type="submit"],
  #editProfileForm.profile-card > .profile-logout-btn {
    width: auto;
    min-width: 220px;
    align-self: flex-start;
  }
}

.form-block {
  background: var(--content-block-bg);
  border: 1px solid var(--line);
  border-radius: var(--content-block-radius);
  padding: 20px;
  margin-bottom: 0;
  box-shadow: var(--neu-raise);
  display: flex;
  flex-direction: column;
  gap: var(--form-section-gap);
}

.form-block:not(.activity-panel-inner):not(.profile-card) > .form-block-title:first-of-type,
.form-block.dash-filters > .form-block-title:first-child,
.form-block.panel-filters-block > .form-block-title:first-child,
.form-block.page-head-block > .form-block-title:first-child {
  border-bottom: 2px solid var(--sport-accent);
}

.form-block-soft {
  background: var(--content-block-bg);
  border: 1px solid var(--line);
  border-radius: var(--content-block-radius);
  box-shadow: var(--neu-soft);
  display: flex;
  flex-direction: column;
  gap: var(--form-section-gap);
}

.form-block-soft:not(.activity-panel-inner) > .form-block-title:first-of-type {
  border-bottom: 2px solid var(--sport-accent);
}

.form-block > *,
.form-block-soft > * {
  margin-top: 0;
  margin-bottom: 0;
}

.form-block label,
.form-block-soft label {
  margin-bottom: 0;
}

.form-block-title {
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--title);
}

.form-block > .form-block-title + *,
.form-block-soft > .form-block-title + *,
.form-subsection > .form-block-title + * {
  margin-top: calc(var(--section-title-gap) - var(--form-section-gap));
}

.form-block.dash-filters > .form-block-title:first-child,
.form-block.panel-filters-block > .form-block-title:first-child,
.form-block.page-head-block > .form-block-title:first-child,
#tournamentForm > .form-block-title:first-child,
#tournamentDetailHeader > .form-block-title:first-child,
#editProfileForm > .form-block-title:first-child {
  font-size: 1.35rem;
}

.form-block .form-block-title:first-child,
.form-block > .form-block-title:first-of-type {
  margin-top: 0;
}

.form-block .muted.form-hint {
  margin-top: 0;
}

.t-pairs-inputs {
  display: flex;
  flex-direction: column;
  gap: var(--form-section-gap);
}

.t-pair-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-block .grid:last-child {
  margin-bottom: 0;
}

#matchForm,
#classForm {
  display: flex;
  flex-direction: column;
  gap: var(--form-section-gap);
}

#matchForm > *,
#classForm > * {
  margin: 0;
}

#matchDetailsSection {
  display: flex;
  flex-direction: column;
  gap: var(--form-section-gap);
}

#matchDetailsSection > * {
  margin: 0;
}

#doublesPlayersBlock,
#singlePlayersBlock {
  display: flex;
  flex-direction: column;
  gap: var(--form-section-gap);
}

#doublesPlayersBlock > *,
#singlePlayersBlock > * {
  margin: 0;
}

.class-mode-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.class-mode-row .filter-label {
  margin: 0;
}

.class-mode-row .segment-control {
  flex: 1;
  min-width: min(100%, 220px);
}

.form-subsection {
  display: flex;
  flex-direction: column;
  gap: var(--form-section-gap);
  border: 1px solid var(--line);
  border-radius: var(--content-block-radius);
  padding: 16px 20px;
  background: var(--content-block-bg);
  box-shadow: var(--neu-soft);
}

.form-block .form-subsection,
.form-block-soft .form-subsection {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  margin: 0;
}

.form-subsection > * {
  margin: 0;
}

.form-subsection .form-block-title {
  font-size: 1rem;
  border-bottom: none;
  padding-bottom: 0;
}

.players-block-head {
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.players-block-label {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--title);
}

.players-block-lede {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text);
}

.match-player-field__msg {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.35;
}

.match-player-field__msg--error {
  color: #a94442;
}

.match-player-field__msg--muted {
  color: #787878;
}

.field-error-msg {
  margin: 4px 0 0;
  font-size: 0.85rem;
  line-height: 1.35;
  font-weight: 400;
  color: #a94442;
}

.field-error-msg.hidden {
  display: none !important;
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: #a94442;
}

.story-share-actions-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.story-share-actions-primary .btn {
  width: 100%;
  justify-content: center;
}

.modal-story-subtitle {
  font-size: 0.95rem;
  color: var(--text);
  text-align: left;
  margin: 4px 0 16px;
  line-height: 1.45;
}

.match-view-meta {
  margin: 0 0 4px;
  font-size: 0.9rem;
}

.match-view-details {
  margin: 0 0 14px;
  font-size: 0.9rem;
}

#matchViewModal .match-view-details {
  margin-bottom: 16px;
}

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

.activity-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.activity-progress-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.activity-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  flex-shrink: 0;
}

.activity-progress-step.is-done {
  color: var(--text);
}

.activity-progress-step.is-done .activity-progress-dot {
  background: var(--sport-accent);
}

.activity-progress-line {
  flex: 1;
  height: 1px;
  background: var(--line);
  min-width: 12px;
}

.activity-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-panel {
  background: var(--content-block-bg);
  border-radius: var(--content-block-radius);
  box-shadow: var(--neu-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}

.activity-panel.is-open {
  box-shadow: var(--neu-raise);
}

.activity-panel.is-open .activity-panel-title {
  color: var(--title);
}

.activity-panel-toggle {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 16px 18px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-panel.is-open > .activity-panel-toggle {
  padding-bottom: 6px;
}

.activity-panel-main {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.activity-panel-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  opacity: 0.7;
}

.activity-panel.is-open .activity-panel-chevron {
  transform: rotate(45deg);
}

.activity-panel-title {
  font-size: 1rem;
  font-weight: 700;
}

.activity-panel-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sport-accent);
}

.activity-panel-summary {
  font-size: 0.82rem;
  line-height: 1.35;
  padding-left: 16px;
}

.activity-panel-summary:empty {
  display: none;
}

.activity-panel.is-open .activity-panel-summary:not(:empty) {
  display: none;
}

.activity-panel:not(.is-open) .activity-panel-summary:empty {
  display: none;
}

.activity-panel-sub {
  font-size: 0.82rem;
  padding-left: 16px;
}

.activity-panel.is-open .activity-panel-sub {
  display: none;
}

.activity-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(122, 122, 122, 0.15);
  color: var(--muted);
}

.activity-panel-body {
  display: none;
  padding: 0 18px 18px;
}

.activity-panel.is-open .activity-panel-body {
  display: block;
}

.form-block.activity-panel-inner,
.form-block-soft.activity-panel-inner {
  margin: 0;
  box-shadow: none;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.form-actions-sticky {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(to top, var(--page-bg-bottom) 70%, transparent);
  padding: 12px 0 4px;
  margin-top: 8px;
}

#tournamentMatchForm .activity-accordion {
  margin-bottom: 4px;
}

@media (min-width: 900px) {
  .form-actions-sticky {
    position: static;
    background: transparent;
    padding-top: 4px;
  }
}

.grid {
  display: grid;
  gap: var(--form-section-gap);
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.one {
  grid-template-columns: 1fr;
}

.results-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.match-eval-extra {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.match-eval-extra > label:last-child {
  grid-column: 1 / -1;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.switch-inline {
  flex-direction: row;
}

.switch input {
  width: 56px;
  height: 30px;
  min-height: 30px;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  padding: 0;
  border-radius: 999px;
  background: #8a8a8a;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  line-height: 0;
}

.switch input:checked {
  background: var(--accent);
}

.switch input::after {
  content: "";
  width: 24px;
  height: 24px;
  position: absolute;
  left: 2px;
  top: 50%;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  transition: transform 0.2s;
}

.switch input:checked::after {
  transform: translate(26px, -50%);
}

body.dark .switch input {
  background: #5a5e66;
}

body.dark .switch input:checked {
  background: var(--line-strong);
}

.muted {
  color: #787878;
  margin: 2px 0 14px;
}

.actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

canvas {
  max-width: 100%;
  height: auto;
}

/* --- Dashboard Estadísticas --- */
.dash-header {
  margin-bottom: 0;
}

.form-block.dash-filters,
.form-block.panel-filters-block,
.form-block.page-head-block {
  margin-bottom: 0;
}

.dash-filters {
  display: flex;
  flex-direction: column;
  gap: var(--form-section-gap);
  margin-top: 0;
}

.form-block.dash-filters > *,
.form-block.panel-filters-block > *,
.form-block.page-head-block > * {
  margin-top: 0;
  margin-bottom: 0;
}

.form-block.page-head-block .filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--filter-label-gap);
}

.form-block.page-head-block .sport-tabs {
  margin-bottom: 0;
}

.form-block.dash-filters label,
.form-block.panel-filters-block label {
  margin-bottom: 0;
}

.form-block.panel-filters-block .records-search {
  margin-bottom: 0;
}

.form-block.panel-filters-block .records-tabs {
  margin-bottom: 0;
}

#tabRecords .records-panel {
  margin-top: 0;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--filter-label-gap);
}

.filter-stack,
#statsMatchFilters,
#statsClassFilters {
  display: flex;
  flex-direction: column;
  gap: var(--form-section-gap);
}

.filter-stack > *,
#statsMatchFilters > *,
#statsClassFilters > * {
  margin: 0;
}

.filter-group > label {
  gap: var(--filter-label-gap);
  margin-bottom: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--title);
}

.filter-group.grid {
  display: grid;
  gap: var(--form-section-gap);
}

.filter-group.grid > label {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--title);
}

.sport-tabs,
.segment-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Mismo ancho de pills en Actividad, Registros, Métricas y Torneos */
.form-block.page-head-block .sport-tabs,
.form-block.panel-filters-block .sport-tabs,
.form-block.panel-filters-block .segment-control,
.form-block.dash-filters .sport-tabs,
.form-block.dash-filters .segment-control,
#tournamentForm > .filter-group .sport-tabs,
#tournamentForm > .filter-group .segment-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.form-block.page-head-block .sport-tab,
.form-block.panel-filters-block .sport-tab,
.form-block.panel-filters-block .segment-btn,
.form-block.dash-filters .sport-tab,
.form-block.dash-filters .segment-btn,
#tournamentForm > .filter-group .sport-tab,
#tournamentForm > .filter-group .segment-btn {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.form-block.dash-filters .stats-modality-tabs,
.form-block.panel-filters-block .records-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-block.dash-filters .stats-modality-tabs.stats-modality-tabs--single {
  grid-template-columns: 1fr;
}

.sport-tab,
.segment-btn,
.flow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  line-height: 1.2;
  text-align: center;
  min-height: 38px;
  border: 1.5px solid var(--select-pill-border);
  border-radius: var(--radius-pill);
  background: var(--select-pill-bg);
  color: var(--text);
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: none;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.btn-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.15em;
  height: 1.15em;
  line-height: 1;
  font-size: 1.05em;
}

.btn-label {
  line-height: 1.2;
}

@media (hover: hover) {
  .sport-tab:not(.active):hover,
  .segment-btn:not(.active):hover,
  .flow-btn:not(.active):hover {
    border-color: var(--line-strong);
    background: var(--card-muted);
  }
}

.sport-tab.active,
.segment-btn.active,
.flow-btn.active,
.dash-filters .segment-btn.active {
  background: var(--select-pill-bg);
  border-color: var(--sport-accent);
  color: var(--title);
  font-weight: 700;
  box-shadow: none;
}

.sport-tab[data-sport="tenis"].active {
  border-color: var(--tenis-accent);
}

.sport-tab[data-sport="padel"].active {
  border-color: var(--padel-accent);
}

#tenisExperienceBlock .segment-btn.active {
  border-color: var(--tenis-accent);
}

#padelExperienceBlock .segment-btn.active {
  border-color: var(--padel-accent);
}

.sport-tab:focus-visible,
.segment-btn:focus-visible,
.flow-btn:focus-visible {
  outline: 3px solid #1f73ff;
  outline-offset: 2px;
}

#statsAllyWrap.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

#statsWidgetsWrap,
#statsClassWidgets {
  display: contents;
}

#statsWidgetsWrap .dash-widget > h4,
#statsWidgetsWrap .widget-head h4,
#statsClassWidgets .dash-widget > h4,
#statsClassWidgets .widget-head h4 {
  color: var(--title);
  font-weight: 700;
  letter-spacing: 0.01em;
}

#statsWidgetsWrap .perf-widget-caption,
#statsClassWidgets .widget-caption {
  color: var(--chart-primary, var(--sport-accent));
  font-weight: 700;
}

.dash-widget {
  background: var(--content-block-bg);
  border: 1px solid var(--line);
  border-radius: var(--content-block-radius);
  box-shadow: var(--neu-raise);
  padding: 18px;
  color: var(--text);
  transition: box-shadow var(--transition-med);
}

.dash-widget > h4 {
  border-bottom: 2px solid var(--sport-accent);
  padding-bottom: 8px;
}

.widget-head {
  border-bottom: 2px solid var(--sport-accent);
  padding-bottom: 8px;
}

.widget-head h4 {
  border-bottom: none;
  padding-bottom: 0;
}

@media (hover: hover) {
  .dash-widget:hover {
    box-shadow: var(--neu-raise-hover, 12px 12px 28px rgba(0, 0, 0, 0.1), -10px -10px 26px rgba(255, 255, 255, 0.94));
  }

  /* Sin translateY: al subir 1px el cursor puede “salir” de la card y
     provocar un loop subir/bajar al pasar el mouse. */
  .record-card:hover,
  .record-card:focus-within {
    box-shadow: var(--neu-raise-hover, 12px 12px 28px rgba(0, 0, 0, 0.1), -10px -10px 26px rgba(255, 255, 255, 0.94));
  }
}

.widget-full {
  grid-column: 1 / -1;
}

.widget-span-2 {
  grid-column: span 2;
}

.widget-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.widget-head h4 {
  margin: 0;
  color: #111;
  font-size: 1rem;
}

.dash-widget > h4 {
  margin: 0 0 12px;
  color: #111;
  font-size: 1rem;
}

.widget-meta {
  font-size: 0.85rem;
  color: #787878;
}

.widget-caption,
.widget-insight {
  margin: 10px 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.widget-insight {
  padding-top: 8px;
  border-top: 1px solid #e5e5e5;
}

.coach-insight {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--sport-accent-soft);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--title);
}

.coach-next-step {
  margin: 8px 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text);
  font-style: italic;
}

body.dark .coach-insight {
  background: color-mix(in srgb, var(--sport-accent) 14%, var(--neu-surface));
  color: var(--title);
}

.widget-hero {
  border: 1px solid var(--line);
}

.hero-players {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 12px;
}

.hero-score {
  margin-bottom: 12px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 14px;
  font-size: 0.92rem;
}

.donut-wrap {
  position: relative;
  width: 188px;
  height: 188px;
  max-width: 100%;
  margin: 0 auto;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--neu-surface);
  box-shadow: var(--neu-inset);
  padding: 10px;
}

.donut-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.donut-center {
  position: absolute;
  width: 54%;
  height: 54%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--neu-surface);
  box-shadow: var(--neu-soft);
  font-size: clamp(1.15rem, 2.8vw, 1.55rem);
  font-weight: 800;
  color: var(--chart-primary, var(--sport-accent));
  pointer-events: none;
  line-height: 1;
  text-align: center;
  padding: 0 8px;
}

.perf-widgets-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

.perf-widgets-row .dash-widget {
  min-width: 0;
  overflow: hidden;
}

.stats-dual-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.stats-dual-row:has(.widget-shots.hidden) {
  grid-template-columns: 1fr;
}

.stats-dual-row .dash-widget {
  min-width: 0;
}

.shots-badges-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

.shots-badges-grid .badge-row {
  margin-bottom: 0;
  align-content: start;
}

.widget-heatmap .heatmap-frame {
  max-width: 100%;
}

.widget-heatmap .heatmap-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.perf-widget {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.perf-widget > h4 {
  flex-shrink: 0;
}

.perf-widget-viz {
  flex: 1 1 auto;
  min-height: 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding: 4px 0;
  box-sizing: border-box;
}

.perf-widget-viz > .donut-wrap,
.perf-widget-viz > .sets-chart-wrap {
  align-self: center;
}

.perf-widget-caption {
  margin-top: 8px;
  text-align: center;
}

.perf-widget-foot {
  margin-top: auto;
  width: 100%;
  flex-shrink: 0;
  min-height: 3.25rem;
}

.perf-widget .games-index-side strong {
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
}

.perf-widget .games-index-delta {
  font-size: clamp(0.85rem, 2vw, 1.05rem);
}

.perf-widget .games-index-delta-label {
  font-size: 0.58rem;
  letter-spacing: 0.02em;
}

.perf-widget .games-index-center {
  min-width: 0;
  max-width: 4.25rem;
  padding: 0 2px;
}

.perf-widget-foot .coach-insight:first-child {
  margin-top: 0;
}

.perf-widget-foot-empty {
  min-height: 3.25rem;
  padding: 0;
}

.sets-chart-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 200px;
  margin: 0;
  background: var(--neu-surface);
  border-radius: 18px;
  box-shadow: var(--neu-inset);
  padding: 10px 8px 6px;
}

.sets-chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 200px !important;
  max-width: 100%;
}

.games-index-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}

.perf-widget-viz .games-index-duel {
  width: 100%;
  min-width: 0;
}

.perf-widget-viz .games-index-side {
  padding: 8px 4px;
  min-width: 0;
}

.perf-widget-viz .games-index-bar {
  height: 12px;
}

.games-index-duel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.games-index-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 16px;
  min-width: 0;
  box-sizing: border-box;
}

#statsWidgetsWrap .games-index-side,
#statsClassWidgets .games-index-side,
.games-index-side {
  box-shadow: none;
  border: 1px solid var(--line);
}

.games-index-win {
  background: color-mix(in srgb, var(--chart-primary, #004c38) 14%, var(--neu-metric-surface, #ececef));
}

.games-index-loss {
  background: color-mix(in srgb, var(--chart-primary-soft, #B2DFB2) 45%, var(--neu-metric-surface, #ececef));
}

.games-index-side strong {
  font-size: 2.1rem;
  line-height: 1;
  font-weight: 800;
}

.games-index-win strong {
  color: var(--chart-primary, #004c38);
}

.games-index-loss strong {
  color: var(--chart-primary-mid, #1f6e58);
}

.games-index-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #787878;
  font-weight: 700;
  text-align: center;
  max-width: 100%;
  line-height: 1.2;
}

.games-index-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  text-align: center;
}

.games-index-delta {
  font-size: 1.35rem;
  font-weight: 800;
  color: #575756;
  line-height: 1;
}

.games-index-delta.positive {
  color: var(--chart-primary, #004c38);
}

.games-index-delta.negative {
  color: var(--chart-primary-mid, #1f6e58);
}

.games-index-delta-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
}

.games-index-bar {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--chart-track, #ececec);
  box-shadow: var(--neu-inset);
}

.games-index-bar-won {
  height: 100%;
  background: var(--chart-primary, #004c38);
  transition: width 0.35s ease;
}

.games-index-bar-lost {
  height: 100%;
  background: var(--chart-primary-soft, #B2DFB2);
  transition: width 0.35s ease;
}

.kpi-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.kpi-block {
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  background: #f5f5f5;
}

.kpi-block strong {
  display: block;
  font-size: 2rem;
  color: #111;
  line-height: 1.1;
}

.kpi-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-win strong {
  color: #3d7a4a;
}

.kpi-loss strong {
  color: #8f4a4a;
}

.widget-heatmap {
  --heat-cell-size: 11px;
  --heat-gap: 3px;
}

.activity-heatmap {
  display: grid;
  grid-template-rows: repeat(7, var(--heat-cell-size));
  grid-auto-flow: column;
  grid-auto-columns: var(--heat-cell-size);
  gap: var(--heat-gap);
  width: max-content;
}

.heatmap-frame {
  display: flex;
  align-items: flex-start;
  margin-top: 10px;
  gap: 0;
  background: var(--neu-surface);
  border-radius: 16px;
  box-shadow: var(--neu-inset);
  padding: 10px 8px;
}

.widget-heatmap .heatmap-y-axis {
  background: transparent;
}

.heatmap-y-axis {
  flex-shrink: 0;
  width: 30px;
  display: grid;
  grid-template-rows: 18px repeat(7, var(--heat-cell-size, 11px));
  gap: var(--heat-gap, 3px);
  padding-right: 8px;
  font-size: 0.62rem;
  color: #9a9a9a;
  line-height: 1;
  position: sticky;
  left: 0;
  z-index: 2;
  background: transparent;
}

body.dark .heatmap-y-axis {
  background: transparent;
  color: #b0b0b0;
}

.heatmap-y-axis span {
  display: flex;
  align-items: center;
  min-height: var(--heat-cell-size, 11px);
}

.heatmap-y-spacer {
  height: 18px;
}

.heatmap-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 4px;
}

.heatmap-months {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--heat-cell-size, 11px);
  column-gap: var(--heat-gap, 3px);
  width: max-content;
  height: 18px;
  margin-bottom: var(--heat-gap, 3px);
  align-items: end;
}

.heatmap-month-label {
  font-size: 0.62rem;
  color: #787878;
  white-space: nowrap;
  line-height: 1;
}

.avatar-wrap {
  position: relative;
}

.onboarding-tooltip {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 30;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 12px 36px 12px 14px;
  min-width: 220px;
  color: #575756;
}

.onboarding-tooltip::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 24px;
  border: 8px solid transparent;
  border-bottom-color: #fff;
}

.onboarding-tooltip p {
  margin: 0;
  font-size: 0.92rem;
}


.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.42);
  color-scheme: light;
}

.onboarding-overlay.hidden {
  display: none;
}

body.onboarding-open {
  overflow: hidden;
}

.onboarding-card {
  --onb-text: #3d3d3c;
  --onb-title: #111111;
  --onb-dot: #c4c4c4;
  --onb-dot-active: #111111;
  position: relative;
  width: min(100%, 380px);
  min-height: min(72vh, 560px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  padding: 18px 20px 20px;
  border: 1px solid transparent;
  border-radius: var(--content-block-radius);
  color: var(--onb-text);
  background-color: #f6f5f1;
  background-image: url("./assets/onboarding/onboarding-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  touch-action: pan-y;
}

.onboarding-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  min-height: 44px;
}

.onboarding-logo {
  display: block;
  width: auto;
  height: 28px;
  object-fit: contain;
}

.onboarding-close {
  position: static;
  top: auto;
  right: auto;
  z-index: 1;
  color: var(--onb-title);
  flex-shrink: 0;
}

.onboarding-body {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 28px;
  text-align: left;
  min-height: 0;
}

.onboarding-step-text {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(1.975rem, 5.2vw, 2.375rem);
  line-height: 1.3;
  color: var(--onb-text);
  font-weight: 500;
  text-align: left;
}

.onboarding-step-text strong {
  color: var(--onb-title);
  font-weight: 700;
}

.onboarding-footer {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 8px;
  min-height: 44px;
}

.onboarding-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  min-height: 0;
  border-radius: 50%;
  border: 0;
  background: var(--onb-dot);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.onboarding-dot.active {
  background: var(--onb-dot-active);
  border-color: transparent;
  transform: scale(1.25);
}

.onboarding-dot:focus-visible {
  outline: 3px solid #1f73ff;
  outline-offset: 2px;
}

.onboarding-next {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  min-height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--onb-title);
  font-size: 1.85rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

@media (hover: hover) {
  .onboarding-next:hover {
    border-color: transparent;
    background: transparent;
    color: var(--onb-title);
    transform: translateY(-50%) translateX(2px);
  }

  .onboarding-dot:not(.active):hover {
    border-color: transparent;
    background: #9a9a9a;
  }
}

.onboarding-next:focus-visible {
  outline: 3px solid #1f73ff;
  outline-offset: 2px;
}

@media (min-width: 981px) {
  .onboarding-card {
    width: min(100%, 440px);
    min-height: min(68vh, 520px);
  }

  .onboarding-body {
    padding: 32px 36px;
  }

  .onboarding-step-text {
    max-width: 13ch;
    font-size: 2.475rem;
  }
}

.tooltip-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  color: #575756;
  min-height: auto;
  padding: 0 6px;
}

.notif-wrap {
  position: relative;
}

.notif-btn {
  position: relative;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--chrome-fg);
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notif-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  color: inherit;
}

.notif-icon.ui-icon {
  width: 32px;
  height: 32px;
}

.notif-btn:focus-visible {
  outline: 3px solid #1f73ff;
  outline-offset: 3px;
  border-radius: 8px;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #c62828;
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(320px, 90vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 40;
  padding: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.notif-panel-title {
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--notif-panel-title);
}

#notifList {
  list-style: none;
  margin: 0;
  padding: 0;
}

#notifList li {
  position: relative;
  padding: 10px 34px 10px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--notif-item-bg);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  border: 1px solid transparent;
}

#notifList li.notif-empty {
  padding: 14px 12px;
  cursor: default;
  color: #787878;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.4;
}

#notifList li.unread {
  background: var(--notif-unread-bg);
  border-color: var(--notif-unread-border);
}

.notif-item-text {
  display: block;
  line-height: 1.4;
}

.notif-item-dismiss {
  position: absolute;
  top: 2px;
  right: 2px;
  border: 0;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
  color: #777;
  cursor: pointer;
  min-width: 28px;
  min-height: 28px;
  border-radius: 6px;
  padding: 0;
}

.notif-item-dismiss:hover {
  color: #111;
  background: rgba(0, 0, 0, 0.06);
}

.notif-item-dismiss:focus-visible {
  outline: 2px solid #1f73ff;
  outline-offset: 1px;
}

.heat-cell {
  width: var(--heat-cell-size, 11px);
  height: var(--heat-cell-size, 11px);
  border-radius: 3px;
  min-width: 0;
  border: 1px solid var(--heat-cell-border);
  box-shadow: none;
}

.heat-cell[data-level="0"] {
  background: var(--heat-empty-bg, var(--chart-track, #ececec));
}

.heat-cell[data-future="true"] {
  background: transparent;
  border-color: transparent;
  opacity: 0.3;
  box-shadow: none;
}

.heat-cell[data-level="1"] {
  background: var(--chart-heat-1, #b8d4c8);
}

.heat-cell[data-level="2"] {
  background: var(--chart-heat-2, #8fc2b5);
}

.heat-cell[data-level="3"] {
  background: var(--chart-heat-3, #1f6e58);
}

.heat-cell[data-level="4"] {
  background: var(--chart-heat-4, #004c38);
}

.perception-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perception-list li {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.88rem;
}

.perception-bar {
  height: 10px;
  background: #ececec;
  border-radius: 999px;
  overflow: hidden;
}

.perception-fill {
  height: 100%;
  width: 0;
  background: var(--chart-primary, var(--sport-accent));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.perception-val {
  font-weight: 700;
  min-width: 2.5rem;
  text-align: right;
}

.perception-charts-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.perception-mini {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  background: var(--content-block-bg);
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: var(--neu-soft);
}

.perception-mini-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--title);
  line-height: 1.2;
}

.perception-sparkline {
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%;
  border-radius: 12px;
}

.widget-perception {
  min-width: 0;
}

.period-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.period-stat {
  padding: 12px;
  border-radius: 14px;
  background: var(--content-block-bg);
  box-shadow: var(--neu-soft);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.period-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
  opacity: 0.85;
}

.period-stat strong {
  font-size: 1rem;
  color: var(--title);
  line-height: 1.25;
  word-break: break-word;
}

.period-list-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--title);
}

.period-list-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0 0 10px;
  font: inherit;
  color: var(--title);
  cursor: pointer;
  text-align: left;
}

.period-list-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted, #888);
  border-bottom: 2px solid var(--muted, #888);
  transform: rotate(-45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.period-activity-block.is-collapsed .period-list-chevron {
  transform: rotate(45deg);
}

.period-activity-block.is-collapsed .period-list-body {
  display: none;
}

.period-list-summary {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 400;
}

.period-activity-block .period-list-title {
  margin: 0;
  padding-top: 0;
}

.period-summary-block .coach-insight {
  color: var(--chart-primary, var(--sport-accent));
}

.period-summary-block .coach-next-step {
  font-style: italic;
}

.period-summary-block > .btn-primary {
  margin-top: 14px;
}

#matchHeroDetail > .btn-primary,
#classHeroDetail > .btn-primary {
  margin-top: 14px;
}

.hero-comment {
  margin: 10px 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}

.heatmap-quarter-note {
  margin: 8px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.widget-heatmap > h4 {
  margin: 0 0 12px;
}

.period-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.period-activity-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--content-block-bg);
  box-shadow: var(--neu-soft);
  padding: 10px 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  display: grid;
  gap: 6px;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.period-activity-item:hover,
.period-activity-item:focus-visible {
  border-color: var(--line-strong);
  outline: none;
  box-shadow: var(--neu-raise);
}

.period-activity-item[data-sport="tenis"] .record-result.win {
  color: var(--tenis-accent);
}

.period-activity-item[data-sport="padel"] .record-result.win {
  color: var(--padel-accent);
}

.period-activity-item .record-card-sport {
  color: var(--title);
}

.period-activity-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.35;
}

.period-activity-score {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--title);
  line-height: 1.3;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.badge-label {
  font-weight: 700;
  font-size: 0.9rem;
}

.shot-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.badge-good .shot-badge {
  background: var(--sport-accent-soft);
  color: var(--sport-accent);
  border: 1px solid color-mix(in srgb, var(--sport-accent) 35%, transparent);
}

.badge-alert .shot-badge {
  background: #fde8e8;
  color: #7a2e2e;
  border: 1px solid #e8a0a0;
}

.dash-empty {
  text-align: center;
  padding: 48px 24px;
  border-radius: var(--content-block-radius);
  background: var(--content-block-bg);
  border: 1px solid var(--line);
  box-shadow: var(--neu-raise);
}

.dash-empty-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text);
  opacity: 0.35;
  margin-bottom: 16px;
}

.dash-empty-illustration .ui-icon {
  display: block;
}

.dash-empty #statsEmptyText {
  margin: 0;
  font-weight: 700;
  color: var(--title);
  font-size: 1.05rem;
  line-height: 1.35;
}

.dash-empty .coach-next-step {
  margin: 10px 0 0;
  max-width: 34ch;
  margin-left: auto;
  margin-right: auto;
}

.dash-empty #statsEmptyCta {
  margin-top: 28px;
}

.dash-extra-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.list {
  padding-left: 22px;
}

.list li {
  margin-bottom: 8px;
}

.self-end {
  align-self: end;
}

.bracket-wrap {
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 12px;
}

.bracket-rounds {
  display: flex;
  gap: 16px;
  min-width: min-content;
  padding: 4px 8px 12px;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 220px;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.bracket-round h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.bracket-match {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--content-block-bg);
  box-shadow: var(--neu-soft);
  font-size: 0.9rem;
}

#statsMatchesMulti {
  min-height: 120px;
}

.score-grid-wrap {
  margin: 12px 0 18px;
}

.score-grid-wrap h4 {
  margin: 0 0 var(--section-title-gap);
}

.score-grid {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.score-grid th,
.score-grid td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: center;
}

.score-grid th {
  background: rgba(122, 122, 122, 0.15);
  font-weight: 700;
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  background: #7a7a7a;
  color: #fff;
  font-weight: 700;
  font-size: 1.6rem;
}

textarea {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

.btn-small {
  margin-top: 6px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.rating-field {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  margin: 0;
  background: var(--card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

@media (hover: hover) {
  .rating-field:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
  }
}

.rating-field legend {
  font-size: 0.9rem;
  padding: 0 4px;
}

.ball-rating {
  display: flex;
  gap: 2px;
}

.star-btn {
  width: auto;
  height: auto;
  min-height: 0;
  padding: 2px 3px;
  line-height: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  color: #c8c8c8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.star-btn .ball-icon {
  width: 1.7rem;
  height: 1.7rem;
  display: block;
}

@media (hover: hover) {
  .star-btn:not(.active):hover {
    color: #a8a8a8;
    transform: scale(1.12);
  }

  .star-btn.active:hover {
    transform: scale(1.05);
  }
}

.star-btn.active {
  color: #d7e121;
}

body.dark .star-btn {
  color: #6a6a6a;
}

body.dark .star-btn.active {
  color: #d7e121;
}

#tmLocation[readonly] {
  opacity: 0.85;
  background: rgba(122, 122, 122, 0.12);
}

.avatar-btn {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}

.avatar-btn:focus-visible {
  outline: 3px solid #1f73ff;
  outline-offset: 3px;
}

.tabs-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tabs-scroll .tab-btn {
  white-space: nowrap;
  min-width: max-content;
}

.flow-picker {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.flow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  min-width: 140px;
  min-height: 38px;
  line-height: 1.2;
  border: 1.5px solid var(--select-pill-border);
  border-radius: var(--radius-pill);
  background: var(--select-pill-bg);
  color: var(--text);
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.records-search {
  display: block;
  margin-bottom: 16px;
}

.records-search input {
  width: 100%;
  margin-top: 6px;
}

.records-tabs {
  margin-bottom: 18px;
}

.records-panel {
  margin-top: 4px;
}

.records-subtitle {
  margin: 18px 0 10px;
  font-size: 0.95rem;
  color: #787878;
}

.records-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.records-empty {
  color: #787878;
  font-size: 0.92rem;
  margin: 8px 0 0;
}

.records-more {
  margin-top: 14px;
  width: 100%;
}

.record-card {
  background: var(--content-block-bg);
  border: 1px solid var(--line);
  border-radius: var(--content-block-radius);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  box-shadow: var(--neu-raise);
  transition: box-shadow var(--transition-med);
}

.record-card[data-sport="tenis"] .record-result.win {
  color: var(--tenis-accent);
}

.record-card[data-sport="padel"] .record-result.win {
  color: var(--padel-accent);
}

.record-card-sport {
  font-weight: 700;
  color: var(--title);
}

.record-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.record-card-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.record-card-date {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--title);
  line-height: 1.25;
  min-width: 0;
}

.record-card-brief {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}

.record-card-sep {
  color: #787878;
  font-weight: 400;
}

.record-win-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: none;
}

.record-card[data-result="win"] .record-win-dot,
.period-activity-item[data-result="win"] .record-win-dot {
  display: inline-block;
}

.record-card[data-sport="tenis"][data-result="win"] .record-win-dot,
.period-activity-item[data-sport="tenis"][data-result="win"] .record-win-dot {
  background: var(--tenis-accent);
}

.record-card[data-sport="padel"][data-result="win"] .record-win-dot,
.period-activity-item[data-sport="padel"][data-result="win"] .record-win-dot {
  background: var(--padel-accent);
}

.record-card-head-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

.period-activity-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.record-card-meta {
  margin: 0;
  font-size: 0.85rem;
  color: #787878;
}

.record-card-score {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.record-status {
  display: inline-block;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f2f2f2;
  color: #575756;
}

.record-status.pending {
  background: #fff4d6;
  color: #8a6a00;
}

.record-status.disputed {
  background: #fde8e8;
  color: #8f4a4a;
}

.record-status.owner-dispute {
  background: #fde8e8;
  color: #8f4a4a;
}

.record-status.dismissed {
  background: #ececec;
  color: #5c5c5c;
}

.record-dispute-block {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.record-feedback-block {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

.record-feedback-label {
  display: block;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--title);
}

.record-feedback-block textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  box-sizing: border-box;
  pointer-events: auto;
  touch-action: manipulation;
}

.record-feedback-block .btn-small {
  align-self: flex-start;
}

.record-dispute-comment {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
}

.record-card-highlight {
  outline: 2px solid #1f73ff;
  outline-offset: 2px;
  animation: record-highlight-pulse 1.2s ease-in-out 2;
}

@keyframes record-highlight-pulse {
  0%, 100% { outline-color: #1f73ff; }
  50% { outline-color: #7eb4ff; }
}

.record-result {
  font-size: 0.82rem;
  font-weight: 700;
}

.record-result.loss {
  color: var(--title);
}

.record-feedback-tag {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #3d7a4a;
}

.record-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.record-icon-btn {
  border: 0;
  background: transparent;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  cursor: pointer;
  color: var(--title);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.record-icon-btn .ui-icon {
  width: 20px;
  height: 20px;
}

.record-icon-btn:hover {
  opacity: 0.72;
}

.record-icon-btn:focus-visible {
  outline: 2px solid #1f73ff;
  outline-offset: 2px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

.modal-card {
  background: var(--content-block-bg);
  border: 1px solid transparent;
  border-radius: var(--content-block-radius);
  padding: 22px;
  width: min(100%, 420px);
  box-shadow: none;
}

.modal-wide {
  width: min(100%, 520px);
}

/* Modal tipo bottom sheet en mobile (confirmar partido, etc.) */
.modal-sheet {
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}

.modal-sheet > .modal-sheet-card {
  min-height: 0;
  flex-shrink: 1;
}

.modal-sheet-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  max-height: min(
    90dvh,
    calc(100dvh - env(safe-area-inset-top, 0px) - 12px)
  );
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  margin: 0;
  padding: 0;
}

.modal-sheet-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 8px;
  background: var(--neu-surface);
  border-bottom: 1px solid var(--line);
}

.modal-sheet-header h4 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.modal-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-sheet-footer {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--neu-surface);
  box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.06);
}

.modal-sheet .modal-story-header {
  position: static;
  margin: 0;
  background: transparent;
  border-bottom: none;
}

#matchViewDismiss {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

#matchViewDismiss:focus,
#matchViewDismiss:focus-visible {
  outline: none;
  box-shadow: none;
}

#matchViewModal .score-grid {
  margin: 0;
}

#matchViewPerceptionSection {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
  padding-top: 4px;
}

#matchViewPerceptionSection h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

#matchViewPerceptionSection .form-hint {
  margin: 0;
  line-height: 1.45;
}

#matchViewPerceptionSection .grid.two {
  gap: 12px;
}

#matchViewPerceptionSection .grid.two label {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#matchViewModal .modal-actions .btn {
  min-height: 44px;
}

@media (max-width: 639px) {
  #matchViewModal .modal-sheet-footer {
    flex-direction: column;
    gap: 8px;
  }

  #matchViewModal .modal-sheet-footer .btn {
    width: 100%;
    flex: 1 1 auto;
  }

  #matchViewPerceptionSection .grid.two {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #matchViewPerceptionSection {
    margin-top: 22px;
    gap: 18px;
  }

  #matchViewPerceptionSection .rating-field {
    padding: 10px 12px;
  }

  #matchViewPerceptionSection .rating-field legend {
    font-size: 0.82rem;
    margin-bottom: 4px;
  }

  #matchViewPerceptionSection h4 {
    font-size: 0.95rem;
  }

  #matchViewPerceptionSection .form-hint {
    font-size: 0.78rem;
  }

  #matchViewModal .match-view-meta,
  #matchViewModal .match-view-details {
    font-size: 0.84rem;
  }
}

@media (min-width: 640px) {
  .modal-sheet {
    align-items: center;
    padding: 20px;
  }

  .modal-sheet-card {
    width: min(100%, 520px);
    max-height: min(92vh, 760px);
    border-radius: var(--content-block-radius);
    margin: 0;
  }

  .modal-sheet-header {
    padding: 18px 22px 10px;
  }

  .modal-sheet-body {
    padding: 0 22px 18px;
  }

  .modal-sheet-footer {
    padding: 14px 22px 18px;
  }
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.modal-close-btn {
  margin-top: 12px;
  width: 100%;
}

#editProfileForm.profile-card,
.profile-card {
  display: flex;
  flex-direction: column;
  gap: var(--form-section-gap);
  width: 100%;
  border: 1px solid var(--line);
}

#editProfileForm.profile-card > .form-block-title:first-child {
  border-bottom: 1px solid var(--line);
}

.profile-card .chip-fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 0;
  background: var(--content-block-bg);
  box-shadow: var(--neu-soft);
}

.profile-card .sport-exp-block {
  border: 1px solid var(--line);
}

.profile-card > label,
.profile-card > fieldset,
.profile-card > .sport-exp-block,
.profile-card > .switch,
.profile-card > div:not(.profile-avatar-row) {
  margin-bottom: 0;
}

.profile-logout-btn {
  margin-top: 14px;
}

#editProfileForm.profile-card > .btn[type="submit"],
#editProfileForm.profile-card > .profile-logout-btn {
  width: auto;
  min-width: 220px;
  align-self: flex-start;
}

@media (max-width: 899px) {
  #editProfileForm.profile-card > .btn[type="submit"],
  #editProfileForm.profile-card > .profile-logout-btn {
    width: 100%;
    min-width: 0;
    align-self: stretch;
  }
}

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

.profile-avatar-visual {
  flex-shrink: 0;
}

.profile-avatar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.profile-avatar-upload-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
  width: auto;
  max-width: 100%;
}

.profile-avatar-upload-btn input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.sport-tabs .sport-tab.hidden {
  display: none;
}

.stats-block-label {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  opacity: 0.85;
}

.story-preview-canvas {
  display: block;
  height: min(52vh, 500px);
  width: auto;
  aspect-ratio: 9 / 16;
  max-width: min(100%, 300px);
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.story-preview-wrap {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.story-share-actions {
  flex-wrap: wrap;
  justify-content: center;
}

.modal-story {
  align-items: flex-end;
  padding: 0;
}

.modal-story-card {
  width: min(100%, 420px);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  margin: 0;
}

.modal-story-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: transparent;
  padding-bottom: 0;
  margin-bottom: 0;
}

.modal-story-header h4 {
  margin: 0;
  font-size: calc(1.125rem + 2px);
  line-height: 1.25;
}

.modal-story-header .modal-icon-close {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

.modal-story-hint {
  font-size: 0.9rem;
  margin: 0 0 8px;
}

.modal-icon-close {
  border: 0;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
}

.modal-icon-close:focus-visible {
  outline: 3px solid #1f73ff;
  outline-offset: 2px;
}

.match-view-perception-readonly .ball-rating {
  pointer-events: none;
  opacity: 0.92;
}

.match-view-perception-readonly select:disabled {
  opacity: 0.85;
  cursor: default;
}

.chip-custom-label {
  margin: 0 !important;
}

@media (min-width: 640px) {
  .modal-story {
    align-items: center;
    padding: 20px;
  }

  .modal-story-card {
    border-radius: 14px;
    max-height: min(92vh, 760px);
  }

  .story-preview-canvas {
    height: min(56vh, 540px);
    max-width: min(100%, 320px);
  }
}

.match-player-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.match-player-field label {
  margin: 0;
}

.match-player-field__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.match-player-field__input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.match-player-field__input-wrap input {
  width: 100%;
}

.match-player-field__row input {
  flex: 1;
  min-width: 0;
}

.match-player-suggestions {
  position: absolute;
  z-index: 12;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--neu-surface);
  box-shadow: var(--neu-raise);
  max-height: 180px;
  overflow-y: auto;
}

.match-player-suggestions__item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--title);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.match-player-suggestions__item:hover,
.match-player-suggestions__item:focus-visible {
  background: var(--landing-sky-muted);
  outline: none;
}

.match-player-suggestions__match {
  font-weight: 700;
  color: var(--landing-padel);
}

.match-player-hint {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--landing-padel);
  background: var(--neu-surface);
  box-shadow: var(--neu-soft);
}

.match-player-hint__avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.match-player-hint__initial {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--landing-padel);
}

.partners-rivals-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.partners-rivals-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card-muted);
}

.partners-rivals-list strong {
  font-size: 0.82rem;
  color: var(--title);
}

.partners-rivals-group {
  padding: 4px 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
}

.partners-rivals-group:first-child {
  padding-top: 0;
}

.fitness-chips {
  margin-top: 0;
}

.chip-fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 0;
  background: var(--content-block-bg);
  box-shadow: var(--shadow-md);
}

.chip-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  flex-direction: row !important;
  margin: 0 !important;
}

.chip input {
  width: auto;
  min-height: auto;
}

.chip span {
  padding: 8px 16px;
  border: 1.5px solid var(--select-pill-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  background: var(--select-pill-bg);
  box-shadow: none;
  font-weight: 500;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

@media (hover: hover) {
  .chip input:not(:checked) + span:hover {
    border-color: var(--line-strong);
    background: var(--card-muted);
  }
}

.chip input:checked + span {
  background: var(--select-pill-bg);
  border-color: var(--sport-accent);
  color: var(--title);
  font-weight: 700;
  box-shadow: none;
}

.chip input[value="tenis"]:checked + span {
  border-color: var(--tenis-accent);
}

.chip input[value="padel"]:checked + span {
  border-color: var(--padel-accent);
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sport-exp-block {
  display: flex;
  flex-direction: column;
  gap: var(--form-section-gap);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 0;
  background: var(--content-block-bg);
  box-shadow: var(--neu-soft);
}

.sport-exp-block > * {
  margin: 0;
}

.sport-exp-block > h4 {
  margin: 0 0 calc(var(--section-title-gap) - var(--form-section-gap));
}

.coach-feedback-block {
  margin-top: 12px;
  padding: 14px;
  border-radius: 10px;
  background: var(--sport-accent-soft);
  font-style: italic;
}

.focus-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.focus-tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--neu-surface);
  box-shadow: var(--neu-soft);
  font-size: 0.88rem;
}

.focus-tag strong {
  color: #111;
}

.journal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.journal-list li {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--content-block-bg);
  box-shadow: var(--neu-soft);
  font-size: 0.9rem;
}

.widget-group {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.widget-group.hidden {
  display: none !important;
}

.standings-table td,
.standings-table th {
  font-size: 0.88rem;
}

#coachFeedbackList .feedback-item {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.snackbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #3f7c4f;
  color: #fff;
  border-radius: 10px;
  padding: 12px 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in;
}

.snackbar.show {
  opacity: 1;
}

.snackbar.is-error {
  background: #a94442;
}

.detail-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  box-shadow: none;
  font-size: 1.6rem;
  line-height: 1;
  padding: 6px 8px;
  min-height: 44px;
  min-width: 44px;
  color: var(--title);
  margin: 0 0 12px;
  cursor: pointer;
}

.detail-back-btn:focus-visible {
  outline: 3px solid #1f73ff;
  outline-offset: 2px;
  border-radius: 8px;
}

.tournament-flyer-action {
  margin-bottom: 16px;
}

.tournament-flyer-action .btn {
  width: 100%;
}

.tournament-finished-wrap {
  margin-top: 4px;
}

.detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.tournament-detail-head {
  margin-bottom: 16px;
}

.tournament-detail-head h4 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  border: 0;
  padding: 0;
}

.tournament-detail-head .muted {
  margin: 0;
}

.tournament-bracket-block .bracket-scroll-hint {
  margin: 0;
  font-size: 0.78rem;
  text-align: center;
  color: #787878;
}

.tournament-matches-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

#tournamentDetailSection .form-block {
  margin-bottom: 16px;
}

#tournamentMatchForm {
  display: flex;
  flex-direction: column;
  gap: var(--form-section-gap);
}

#tournamentMatchForm > * {
  margin: 0;
}

#tournamentMatchForm label {
  margin-bottom: 0;
}

.form-locked-msg {
  color: #8f4a4a;
  font-size: 0.9rem;
  margin: 10px 0;
}

.full-width {
  display: block;
  width: 100%;
}

.full-width input,
.full-width textarea {
  width: 100%;
  margin-top: 6px;
}

.dispute-item,
.feedback-item {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-muted);
}

.dispute-item p {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.dispute-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tm-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--content-block-bg);
  box-shadow: var(--neu-soft);
  margin-bottom: 8px;
}

.tm-row.disputed {
  border-color: #c97878;
  background: rgba(169, 68, 66, 0.08);
}

.tm-row-meta {
  font-size: 0.88rem;
  color: #787878;
}

body.dark .tm-row-meta,
body.dark .records-subtitle,
body.dark .record-card-meta {
  color: #a8a8a8;
}

/* Onboarding siempre en claro, aunque la app esté en dark */
body.dark .onboarding-overlay {
  color-scheme: light;
}

body.dark .onboarding-tooltip {
  background: #fff;
  color: #575756;
  border-color: #e4e4e4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body.dark .onboarding-card {
  --onb-text: #3d3d3c;
  --onb-title: #111111;
  --onb-dot: #c4c4c4;
  --onb-dot-active: #111111;
  background-color: #f6f5f1;
  background-image: url("./assets/onboarding/onboarding-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--onb-text);
  border-color: transparent;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

body.dark .onboarding-close,
body.dark .onboarding-next {
  color: var(--onb-title);
  background: transparent;
}

body.dark .onboarding-step-text {
  color: var(--onb-text);
}

body.dark .onboarding-step-text strong {
  color: var(--onb-title);
}

body.dark .onboarding-dot {
  background: var(--onb-dot);
  border-color: transparent;
}

body.dark .onboarding-dot.active {
  background: var(--onb-dot-active);
  border-color: transparent;
}
body.dark .notif-panel {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}

body.dark #notifList li.notif-empty {
  background: transparent;
  border-color: transparent;
  color: #9a9a9a;
}

body.dark .notif-item-dismiss {
  color: var(--text);
}

body.dark .notif-item-dismiss:hover {
  color: var(--title);
  background: rgba(255, 255, 255, 0.08);
}

body.dark .journal-list li,
body.dark .focus-tag,
body.dark .heat-cell[data-level="0"] {
  background: var(--heat-empty-bg, var(--card-muted));
}

body.dark .activity-shell,
body.dark .form-shell,
body.dark .panel-shell {
  background: transparent;
}

body.dark[data-sport="tenis"] {
  --page-glow: transparent;
  --heat-empty-bg: #3a4038;
  --chart-heat-1: #2f5a4c;
  --chart-heat-2: #3d7864;
  --chart-heat-3: #52a888;
  --chart-heat-4: #7fd4b0;
}

body.dark[data-sport="padel"] {
  --page-glow: transparent;
  --heat-empty-bg: #3a3a48;
  --chart-heat-1: #3a3a58;
  --chart-heat-2: #5050a0;
  --chart-heat-3: #6868d0;
  --chart-heat-4: #9090f0;
}

body.dark .activity-panel {
  background: var(--content-block-bg);
  border-color: transparent;
  box-shadow: var(--content-block-shadow-soft);
}

body.dark .activity-panel.is-open .activity-panel-title {
  color: var(--title);
}

body.dark .activity-panel-inner,
body.dark .form-block.activity-panel-inner,
body.dark .form-block-soft.activity-panel-inner {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}

body.dark .activity-pill {
  background: rgba(255, 255, 255, 0.08);
}

body.dark .form-block:not(.activity-panel-inner),
body.dark .dash-widget,
body.dark .record-card,
body.dark .dash-empty {
  box-shadow: var(--content-block-shadow);
  background: var(--content-block-bg);
  border-color: transparent;
}

body.dark .modal-card {
  box-shadow: none;
  background: var(--content-block-bg);
  border-color: transparent;
}

body.dark .dash-widget > h4,
body.dark .widget-head h4,
body.dark .form-block:not(.activity-panel-inner):not(.profile-card) > .form-block-title:first-of-type,
body.dark .form-block.dash-filters > .form-block-title:first-child,
body.dark .form-block.panel-filters-block > .form-block-title:first-child,
body.dark .form-block.page-head-block > .form-block-title:first-child {
  border-bottom-color: var(--sport-accent);
}

body.dark #editProfileForm.profile-card {
  border-color: transparent;
  box-shadow: var(--content-block-shadow);
}

body.dark .profile-card .chip-fieldset,
body.dark .profile-card .sport-exp-block {
  border-color: transparent;
  box-shadow: var(--content-block-shadow-soft);
}

body.dark #editProfileForm.profile-card > .form-block-title:first-child {
  border-bottom: 1px solid var(--line);
}

body.dark .card:not(.profile-card) {
  box-shadow: var(--content-block-shadow);
  background: var(--content-block-bg);
  border-color: transparent;
}

body.dark .perception-mini,
body.dark .period-stat,
body.dark .focus-tag {
  box-shadow: var(--content-block-shadow-soft);
  background: var(--content-block-bg);
  border-color: transparent;
}

body.dark .tm-row,
body.dark .period-activity-item,
body.dark .journal-list li,
body.dark .bracket-match {
  box-shadow: var(--content-block-shadow-soft);
  background: var(--content-block-bg);
  border-color: transparent;
}

body.dark .form-block-soft:not(.activity-panel-inner) {
  border-color: transparent;
  box-shadow: var(--content-block-shadow-soft);
}

body.dark .form-block .form-subsection,
body.dark .form-block-soft .form-subsection {
  border: none;
  box-shadow: none;
  background: transparent;
}

body.dark .sport-tab,
body.dark .segment-btn,
body.dark .flow-btn,
body.dark .chip span {
  background: var(--select-pill-bg);
  border-color: var(--select-pill-border);
  box-shadow: none;
}

body.dark .tabs {
  background: var(--nav-bar-bg);
  border-color: transparent;
  box-shadow: var(--nav-bar-shadow);
}

body.dark .tab-btn {
  background: transparent;
  box-shadow: none;
  color: var(--nav-inactive);
}

body.dark .tab-btn.active {
  background: transparent;
  box-shadow: none;
  color: var(--nav-accent);
}

body.dark .tab-btn.active .nav-label {
  color: var(--nav-active-label);
}

body.dark .segment-btn.active,
body.dark .flow-btn.active,
body.dark .sport-tab.active,
body.dark .dash-filters .segment-btn.active,
body.dark .chip input:checked + span {
  background: var(--select-pill-bg);
  border-color: var(--sport-accent);
  color: var(--title);
  box-shadow: none;
}

body.dark .sport-tab[data-sport="tenis"].active {
  border-color: var(--tenis-accent);
}

body.dark .sport-tab[data-sport="padel"].active {
  border-color: var(--padel-accent);
}

body.dark #tenisExperienceBlock .segment-btn.active {
  border-color: var(--tenis-accent);
}

body.dark #padelExperienceBlock .segment-btn.active {
  border-color: var(--padel-accent);
}

body.dark .chip input[value="tenis"]:checked + span {
  border-color: var(--tenis-accent);
}

body.dark .chip input[value="padel"]:checked + span {
  border-color: var(--padel-accent);
}

body.dark .btn-primary {
  box-shadow: var(--neu-raise);
}

body.dark .donut-wrap,
body.dark .sets-chart-wrap,
body.dark .heatmap-frame {
  box-shadow: var(--neu-inset);
  border: 1px solid var(--line);
}

body.dark .donut-center {
  box-shadow: none;
  border: 1px solid var(--line);
}

body.dark .games-index-side {
  box-shadow: none;
  border: 1px solid var(--line);
}

body.dark .games-index-win {
  background: color-mix(in srgb, var(--chart-primary, #004c38) 24%, var(--neu-metric-surface, #35373c));
}

body.dark .games-index-loss {
  background: color-mix(in srgb, var(--chart-primary-soft, #B2DFB2) 12%, var(--neu-metric-surface, #35373c));
}

body.dark .games-index-label,
body.dark .games-index-delta-label {
  color: #a8a8a8;
}

body.dark .games-index-delta {
  color: var(--text);
}

body.dark .widget-insight {
  border-top-color: var(--line);
}

body.dark .hero-players,
body.dark .dash-widget > h4,
body.dark .widget-head h4 {
  color: var(--title);
}

body.dark .form-block-title {
  border-bottom-color: var(--line);
}


body.dark input,
body.dark select,
body.dark textarea {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

body.dark select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%23e0e0df' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
}

body.dark .score-grid th,
body.dark .score-grid td {
  border-color: var(--line);
}

@media (max-width: 980px) {
  .container {
    width: 100%;
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
    overflow-x: hidden;
  }

  .landing-vision__break {
    display: inline;
  }

  main.container:has(#appCard:not(.hidden)) {
    padding-top: 0;
    /* overflow-x:hidden en .container rompe position:sticky del header */
    overflow-x: visible;
  }

  #appCard {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .app-header {
    margin-bottom: 8px;
    padding-top: max(6px, env(safe-area-inset-top, 0px));
    padding-bottom: 8px;
  }

  .landing-hero__inner,
  .landing-how__layout,
  .landing-showcase__layout,
  .landing-pwa__layout {
    grid-template-columns: 1fr;
  }

  /* En mobile: título primero, carrusel debajo */
  .landing-showcase__layout .landing-showcase__copy {
    order: 1;
  }

  .landing-showcase__layout .landing-card-carousel {
    order: 2;
  }

  .landing-benefits__grid {
    grid-template-columns: 1fr;
  }

  .brand-inline h2.app-tagline {
    display: none;
  }

  .brand-inline .setric-logo {
    width: min(132px, 36vw);
  }

  .three,
  .four,
  .two,
  .results-grid,
  .match-eval-extra {
    grid-template-columns: 1fr;
  }

  .app-header {
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
  }

  .brand-inline {
    flex: 1;
    min-width: 0;
    gap: 0;
  }

  .header-actions {
    flex-wrap: nowrap;
    width: auto;
    flex-shrink: 0;
    gap: 8px;
  }

  .notif-panel {
    position: fixed;
    right: max(12px, env(safe-area-inset-right, 0px));
    left: auto;
    top: calc(56px + env(safe-area-inset-top, 0px));
    width: min(320px, calc(100vw - 24px));
    max-height: min(360px, calc(100vh - 80px));
  }

  .app-nav.tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--nav-bar-bg);
    border: 0;
    border-top: 1px solid var(--nav-bar-border);
    border-radius: 0;
    box-shadow: none;
  }

  /* Mobile: nav inferior del mismo color que el header */
  body:not(.dark) .app-nav.tabs {
    --nav-bar-bg: #3d3d3d;
    --nav-bar-border: rgba(255, 255, 255, 0.12);
    --nav-inactive: #9a9a9a;
    --nav-active-label: #ffffff;
    background: var(--nav-bar-bg);
    border-top-color: var(--nav-bar-border);
  }

  .app-nav .tab-btn {
    min-height: 54px;
    padding: 6px 4px 12px;
    border-radius: 14px;
  }

  .app-nav .tab-btn.active,
  body.dark .app-nav .tab-btn.active {
    background: transparent;
    color: var(--nav-accent);
    font-weight: 700;
    box-shadow: none;
  }

  .app-nav .tab-btn.active .nav-label {
    color: var(--nav-active-label);
  }

  .app-nav .tab-btn.active .nav-icon {
    color: var(--nav-accent);
  }

  .app-nav .nav-icon {
    width: 26px;
    height: 26px;
  }

  .app-nav .tab-btn[data-tab="tabActivity"] .nav-icon {
    width: 26px;
    height: 26px;
  }

  .app-nav .nav-label {
    font-size: 0.68rem;
  }

  .avatar {
    width: 48px;
    height: 48px;
  }

  .page-block {
    padding: 6px 0 12px;
  }

  #tabStats {
    overflow-x: hidden;
    max-width: 100%;
  }

  .dash-header {
    margin-bottom: 0;
  }

  .dash-header h3,
  .form-block.dash-filters .form-block-title,
  .form-block.panel-filters-block .form-block-title,
  .form-block.page-head-block .form-block-title,
  #tournamentForm > .form-block-title:first-child,
  #tournamentDetailHeader > .form-block-title:first-child {
    font-size: 1.35rem;
  }

  .dash-filters {
    gap: var(--form-section-gap);
    max-width: 100%;
  }

  .dash-filters .segment-control,
  .dash-filters .sport-tabs,
  .form-block.page-head-block .sport-tabs,
  .form-block.panel-filters-block .sport-tabs,
  .form-block.panel-filters-block .segment-control,
  #tournamentForm > .filter-group .sport-tabs,
  #tournamentForm > .filter-group .segment-control {
    gap: 6px;
  }

  .dash-filters input,
  .dash-filters select {
    max-width: 100%;
    box-sizing: border-box;
  }

  .widget-group {
    grid-template-columns: 1fr;
    min-width: 0;
    max-width: 100%;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    min-width: 0;
    max-width: 100%;
    gap: 12px;
  }

  .perf-widgets-row {
    grid-template-columns: 1fr;
  }

  .stats-dual-row {
    grid-template-columns: 1fr;
  }

  .perf-widget-viz {
    min-height: auto;
  }

  .perf-widget-foot-empty {
    display: none;
  }

  .sets-chart-wrap {
    height: auto;
  }

  .sets-chart-wrap canvas {
    height: auto !important;
  }

  .dash-widget {
    padding: 14px 12px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .widget-span-2 {
    grid-column: span 1;
  }

  .widget-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .widget-head h4 {
    align-self: stretch;
  }

  .hero-players {
    font-size: 0.9rem;
    word-break: break-word;
  }

  .hero-score,
  .score-grid-wrap {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .score-grid {
    width: 100%;
    font-size: 0.85rem;
  }

  .donut-wrap {
    width: min(188px, 72vw);
    height: min(188px, 72vw);
  }

  .donut-center {
    font-size: 1.35rem;
  }

  .badge-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .bracket-round {
    min-width: min(84vw, 260px);
  }

  .bracket-wrap {
    margin-inline: -4px;
  }

  .detail-toolbar .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 132px;
    justify-content: center;
  }

  .widget-heatmap {
    --heat-cell-size: 9px;
    max-width: 100%;
  }

  .heatmap-frame {
    max-width: 100%;
  }

  .segment-control,
  .sport-tabs {
    gap: 6px;
  }

  .segment-btn,
  .sport-tab {
    font-size: 0.78rem;
    padding: 8px 10px;
  }

  .stats-block-label {
    font-size: 0.72rem;
    word-break: break-word;
  }

  .partners-rivals-list li {
    font-size: 0.88rem;
  }

  #statsWidgetsWrap canvas {
    display: block;
    max-width: 100%;
    height: auto;
  }

  .snackbar {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 24px);
    text-align: center;
  }
}

@media (min-width: 981px) {
  main.container:has(#appCard:not(.hidden)) {
    padding-top: 0;
  }

  .app-header {
    margin-bottom: 12px;
    padding: 8px 0 10px;
  }

  .brand-inline h2.app-tagline {
    display: none;
  }

  .brand-inline .setric-logo {
    width: auto;
    height: 28px;
  }

  .app-header .avatar {
    width: 40px;
    height: 40px;
  }

  .app-header .avatar-placeholder {
    font-size: 0.95rem;
  }

  .tabs {
    max-width: var(--app-content-width);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 16px;
    padding: 6px;
    gap: 6px;
  }

  .app-nav .tab-btn {
    flex-direction: row;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
  }

  .app-nav .tab-btn.active::after {
    display: none;
  }

  .app-nav .nav-label {
    font-size: 0.92rem;
  }

  .app-nav .nav-icon {
    display: none;
  }

  .tabs-scroll {
    overflow-x: visible;
  }
}
