/* CrimptFit web — sistema de color "Carbón & Lima" (DEVELOPMENT.md §2).
   Los valores por defecto son los tokens del tema; al arrancar, la app aplica el tema
   elegido por el usuario (ColorThemes) sobre estas mismas variables. */
:root {
    --bg: #15171A;          /* CarbonBg */
    --surface: #1E2125;     /* Surface */
    --accent: #C6F432;      /* LimeAccent */
    --accent-dark: #7CB518; /* LimeDark */
    --on-accent: #15171A;   /* OnAccent */
    --text: #F4F6F7;        /* TextPrimary */
    --muted: #8A9099;       /* TextMuted */
    --border: #23262B;      /* Border */
    --danger: #E2555A;      /* rojo peligro (mismo que la app MAUI) */
    --amber: #E8C33B;       /* fase "prepárate/suelta" del timer (HangTimer MAUI) */
    --blue: #4C9BE8;        /* fase "descanso" del timer (HangTimer MAUI) */
    --tabbar-h: 52px;
    /* Hueco bajo la barra: solo una parte de la zona segura de iOS (34 px), con los iconos arriba. */
    --tabbar-safe: max(2px, calc(env(safe-area-inset-bottom) * .35));
    color-scheme: dark;
}

@font-face { font-family: Barlow; font-weight: 400; src: url('../fonts/BarlowRegular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: Barlow; font-weight: 600; src: url('../fonts/BarlowSemiBold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: Barlow; font-weight: 700; src: url('../fonts/BarlowBold.ttf') format('truetype'); font-display: swap; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
/* iOS PWA instalada (standalone + status bar black-translucent): WebKit acorta el viewport en
   la altura de la zona segura superior y los `position: fixed; bottom: 0` quedan flotando con
   un hueco debajo. Alargar el html esa misma altura devuelve la barra al borde inferior real. */
@media (display-mode: standalone) {
    html { min-height: calc(100% + env(safe-area-inset-top)); }
}
body { font-family: Barlow, system-ui, sans-serif; font-size: 15px; overscroll-behavior: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* ---------- Estructura ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.content { flex: 1; padding-bottom: calc(var(--tabbar-h) + var(--tabbar-safe)); }
.page { max-width: 640px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.page-title { margin: 0; font-size: 24px; font-weight: 700; }
.greeting { display: flex; flex-direction: column; gap: 1px; }

/* ---------- Barra de pestañas ---------- */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    display: flex; justify-content: space-around;
    height: calc(var(--tabbar-h) + var(--tabbar-safe));
    padding-bottom: var(--tabbar-safe);
    background: var(--surface); border-top: 1px solid var(--border);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 7px; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
.tab.active { color: var(--accent); }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.card-lg { border-radius: 18px; gap: 10px; }
.card.nested { background: var(--bg); border-radius: 13px; padding: 13px; margin-top: 4px; }
.card.center { align-items: center; text-align: center; }
.card-title { margin: 0; font-size: 17px; font-weight: 700; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { align-items: center; text-align: center; gap: 4px; border-radius: 13px; font-size: 11px; font-weight: 600; }
.tile:active { border-color: var(--accent); }

/* ---------- Texto ---------- */
.label { font-size: 10px; font-weight: 700; letter-spacing: .04em; }
span.label.muted { font-size: 11px; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.small { font-size: 12px; }
.semibold { font-weight: 600; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }

/* ---------- Controles ---------- */
.btn-primary {
    width: 100%; margin-top: 6px; padding: 14px 28px; border: 0; border-radius: 14px;
    background: var(--accent); color: var(--on-accent); font-size: 16px; font-weight: 700; cursor: pointer;
}
.btn-primary:active { filter: brightness(.92); }
.progress { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }

/* Icono SVG de línea coloreado con currentColor (máscara). */
.icon {
    display: inline-block; width: var(--size, 22px); height: var(--size, 22px); flex: none;
    background-color: currentColor;
    -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}

/* ---------- Login ---------- */
.login {
    min-height: 100dvh; max-width: 420px; margin: 0 auto;
    padding: calc(48px + env(safe-area-inset-top)) 24px calc(32px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.login-brand { flex: 1; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.login-brand h1 { margin: 8px 0 0; font-size: 34px; font-weight: 700; }
.login-brand p { margin: 0; max-width: 280px; }
.login-logo { width: 72px; height: 72px; color: var(--accent); }
.login-actions { display: flex; flex-direction: column; gap: 14px; }
.login-error { margin: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--danger); color: var(--text); font-size: 13px; }
.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
    padding: 14px 20px; border-radius: 14px; border: 1px solid var(--border);
    background: var(--text); color: var(--bg); font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn-google:disabled { opacity: .7; }
.center-text { text-align: center; margin: 0; }
.login-info { margin: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--accent); color: var(--text); font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-form .btn-primary { margin-top: 4px; }
.field {
    width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font: inherit; font-size: 16px; outline: none;
}
.field::placeholder { color: var(--muted); }
.field:focus { border-color: var(--accent); }
.login-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.link { background: none; border: 0; padding: 4px 0; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.link.accent { color: var(--accent); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Perfil ---------- */
.account { gap: 12px; }
.account-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-text .card-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 48px; height: 48px; border-radius: 50%; flex: none; object-fit: cover; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; }
.btn-secondary {
    width: 100%; margin-top: 8px; padding: 12px 20px; border-radius: 14px; border: 1px solid var(--border);
    background: transparent; color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-secondary.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }

/* ---------- Bienvenida (pasos de perfil) ---------- */
.onboard {
    min-height: 100dvh; max-width: 480px; margin: 0 auto;
    padding: calc(14px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 18px;
}
.onboard-top { display: flex; flex-direction: column; gap: 10px; }
.onboard-top .link { min-width: 64px; text-align: left; }
.onboard-top .link:last-child { text-align: right; }
.onboard-top .link:disabled { opacity: .5; }
.onboard-body { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.onboard-title { margin: 8px 0 0; font-size: 28px; font-weight: 700; }
.onboard-desc { margin: -6px 0 6px; }
.onboard-bottom .btn-primary { margin-top: 0; }
.btn-primary:disabled { opacity: .6; }
.field-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
select.field { appearance: none; -webkit-appearance: none; padding-right: 38px; }
.select-wrap { position: relative; display: block; }
.select-wrap .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
input.field[type=number] { -moz-appearance: textfield; appearance: textfield; }
input.field[type=number]::-webkit-inner-spin-button, input.field[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.avatar-picker {
    position: relative; align-self: center; width: 112px; height: 112px; border-radius: 50%; cursor: pointer;
    border: 2px solid var(--accent); padding: 4px; margin-top: 6px;
}
.avatar-picker img, .avatar-initials {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--surface);
    display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; color: var(--muted);
}
.avatar-badge {
    position: absolute; right: -2px; bottom: -2px; width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center;
    border: 3px solid var(--bg);
}
.ape { flex-direction: row; align-items: center; justify-content: space-between; }
.ape-value { font-size: 20px; font-weight: 700; color: var(--accent); }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip {
    padding: 12px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer;
}
.chip.selected { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-card {
    display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; border: 2px solid;
    text-align: left; cursor: pointer;
}
.theme-surface { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; border: 1px solid; }
.theme-bar { height: 8px; width: 70%; border-radius: 4px; }
.theme-line { height: 5px; width: 45%; border-radius: 3px; opacity: .7; }
.theme-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Entrenar ---------- */
.full { min-height: 100dvh; }
.list { display: flex; flex-direction: column; gap: 10px; }
.session-row { flex-direction: row; align-items: center; gap: 12px; }
.session-row.today { border-color: var(--accent); }
.session-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.play-btn { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }
.grow { flex: 1; min-width: 0; }
.tiny { font-size: 11px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 40px; height: 40px; flex: none; border: 0; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }

.train { width: 100%; max-width: 640px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.train-head {
    position: sticky; top: 0; z-index: 5; background: var(--bg);
    padding: calc(10px + env(safe-area-inset-top)) 14px 12px; display: flex; flex-direction: column; gap: 10px;
}
.train-bar { gap: 6px; }
.train-title { margin: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-finish { border: 0; border-radius: 10px; padding: 9px 14px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 13px; cursor: pointer; }
.clock { display: flex; flex-direction: column; align-items: flex-end; }
.train-body { flex: 1; padding: 4px 14px calc(90px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }

.group-card {
    display: flex; flex-direction: column; gap: 14px; width: 100%; text-align: left; cursor: pointer;
    padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.group-card.active { border: 1.5px solid var(--accent); }
.group-card.done { background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.group-card.done .group-title { color: var(--accent); }
.group-text { display: flex; flex-direction: column; gap: 3px; }
.group-title { margin: 0; font-size: 21px; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stats > div { display: flex; flex-direction: column; gap: 2px; }
.stat { font-size: 16px; font-weight: 700; }

.ring { position: relative; width: var(--ring-size); height: var(--ring-size); flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring-track { fill: none; stroke: var(--border); stroke-width: 3.5; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset .3s; }
.ring-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

.exercise { display: flex; flex-direction: column; gap: 5px; padding-bottom: 8px; }
.exercise-name { margin: 0; font-size: 16px; font-weight: 700; color: var(--accent); }
.set-grid {
    display: grid; align-items: center; gap: 4px;
    grid-template-columns: 22px minmax(0, 1fr) repeat(var(--inputs, 2), 48px) 44px 36px;
}
.set-grid.head { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .03em; margin-top: 4px; }
.set-grid .c { text-align: center; }
.row-set { padding: 3px 0; border-radius: 9px; background: var(--surface); border: 1.5px solid transparent; }
.row-set.active { border-color: var(--accent); }
.row-set.done { background: color-mix(in srgb, var(--accent) 9%, var(--bg)); }
.cell {
    width: 100%; height: 36px; border-radius: 7px; border: 1px solid var(--border); background: var(--bg);
    color: var(--text); font: inherit; font-size: 14px; text-align: center; padding: 0; outline: none;
}
.cell:focus { border-color: var(--accent); }
.row-set.done .cell { background: transparent; border-color: transparent; }
button.cell.ce { color: var(--muted); cursor: pointer; }
button.cell.ce.set { color: var(--accent); font-weight: 700; }
.check {
    width: 30px; height: 30px; justify-self: center; border-radius: 50%; border: 1.8px solid var(--muted);
    background: transparent; color: var(--on-accent); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
}
.check.on { background: var(--accent); border-color: var(--accent); }
.btn-ghost { margin-top: 2px; padding: 9px; border-radius: 9px; border: 0; background: var(--surface); color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.btn-timer {
    display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 10px;
    border: 1px solid var(--accent-dark); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); color: var(--accent);
    font-weight: 600; font-size: 14px; cursor: pointer;
}

.rest-bar {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 6;
    width: min(612px, calc(100% - 28px)); display: flex; align-items: center; gap: 8px; padding: 10px 12px;
    border-radius: 12px; border: 1px solid var(--accent-dark); background: color-mix(in srgb, var(--accent) 12%, var(--bg));
}
.chip-btn { border: 0; border-radius: 9px; padding: 8px 12px; background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; }

.train-done {
    width: 100%; min-height: 100dvh; max-width: 420px; margin: 0 auto; padding: 24px; text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.done-badge { width: 88px; height: 88px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }

/* Hoja inferior */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .55); }
.sheet {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 21; width: min(640px, 100%);
    max-height: 80dvh; overflow-y: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    background: var(--surface); border-radius: 18px 18px 0 0; border-top: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 10px;
}
.sheet-title { margin: 0; font-size: 17px; font-weight: 700; }
.sheet-desc { margin: 0; }
.sheet-list { display: flex; flex-direction: column; }
.sheet-item {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 6px; border: 0; border-bottom: 1px solid var(--border);
    background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer;
}
.sheet-item.selected { color: var(--accent); }
.ce-value { width: 34px; font-weight: 700; color: var(--accent); }

/* Timer de suspensiones */
.hang {
    --phase: var(--accent);
    width: 100%; min-height: 100dvh; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column;
    padding: calc(10px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--phase) 8%, var(--bg)); transition: background .3s;
}
.hang.phase-prepare, .hang.phase-off { --phase: var(--amber); }
.hang.phase-rest { --phase: var(--blue); }
.hang-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.hang-phase { font-size: 22px; font-weight: 700; letter-spacing: .08em; color: var(--phase); }
.hang-ring { position: relative; width: min(300px, 78vw); aspect-ratio: 1; margin: 10px 0; }
.hang-ring svg { width: 100%; height: 100%; }
.hang-track { fill: none; stroke: color-mix(in srgb, var(--phase) 18%, var(--bg)); stroke-width: 10; }
.hang-fill { fill: none; stroke: var(--phase); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .3s; }
.hang-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--phase); }
.hang-big { font-size: 96px; font-weight: 700; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.pips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pip { width: 12px; height: 12px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 18%, var(--bg)); }
.pip.done { background: var(--accent-dark); }
.pip.now { background: var(--accent); }
.hang-actions { display: flex; flex-direction: column; gap: 10px; }
.hang-actions .btn-secondary { margin-top: 0; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* ---------- Perfil ---------- */
.sub-head { display: flex; align-items: center; gap: 4px; margin-left: -10px; }
.sub-title { margin: 0; font-size: 22px; font-weight: 700; }
.hero { align-items: center; text-align: center; gap: 6px; padding: 20px 14px 16px; }
.hero-avatar { width: 92px; height: 92px; border-radius: 50%; border: 2px solid var(--accent); padding: 3px; }
.hero-avatar img, .hero-avatar .avatar-initials { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hero-name { margin: 6px 0 0; font-size: 21px; font-weight: 700; }
.chips4 { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.chips4 > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; background: var(--bg); }
.chip-value { font-size: 17px; font-weight: 700; color: var(--accent); }
.menu { padding: 4px 14px; gap: 0; }
.menu-row {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--border);
    background: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer;
}
.menu-row:last-child { border-bottom: 0; }
.flip { transform: rotate(180deg); }
.about { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0; }
.danger-text { color: var(--danger); }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid4 .tile { padding: 12px 4px; }

.settings { padding: 4px 14px; gap: 0; }
.settings > .muted.tiny { padding: 10px 0 2px; }
.set-row {
    display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border);
    width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; color: var(--text); font: inherit; text-align: left;
}
.set-row:last-child { border-bottom: 0; }
button.set-row { cursor: pointer; }
.set-label { margin: 0; font-size: 15px; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--bg); color: var(--accent); font-size: 20px; cursor: pointer; }
.stepper span { min-width: 48px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.segmented { display: flex; padding: 3px; border-radius: 10px; background: var(--bg); }
.segmented button { border: 0; border-radius: 8px; padding: 7px 14px; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.segmented button.on { background: var(--accent); color: var(--on-accent); }
.toggle { width: 50px; height: 30px; flex: none; border-radius: 15px; border: 0; padding: 3px; background: var(--border); cursor: pointer; display: flex; transition: background .2s; }
.toggle .knob { width: 24px; height: 24px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.toggle.on { background: var(--accent); }
.toggle.on .knob { transform: translateX(20px); background: var(--on-accent); }
.sound-pick { display: flex; align-items: center; gap: 12px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; padding: 0; }
.sound-text { display: flex; flex-direction: column; gap: 1px; }
.radio { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1.8px solid var(--muted); }
.radio.on { border: 6px solid var(--accent); }
.hold-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; }
.hold-btn { position: relative; width: 104px; height: 104px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--danger) 12%, var(--bg)); color: var(--danger); display: flex; align-items: center; justify-content: center; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.hold-btn .ring { position: absolute; }
.hold-btn .ring-fill { stroke: var(--danger); transition: none; }
.hold-icon { position: relative; display: flex; }

/* ---------- Arranque y errores ---------- */
.splash { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: center; }
.splash-version { min-height: 1em; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.splash svg { width: 96px; height: 96px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

#blazor-error-ui {
    display: none; position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px); z-index: 1000;
    padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--danger); color: var(--text);
}
#blazor-error-ui .reload { color: var(--accent); font-weight: 700; margin-left: 8px; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; color: var(--muted); }

/* ---------- Planificar ---------- */
a.btn-primary, a.btn-secondary { display: block; text-align: center; text-decoration: none; }
.btn-icon { display: flex; align-items: center; justify-content: center; gap: 8px; }
a.btn-icon { display: flex; }
.btn-outline {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px; border-radius: 12px;
    border: 1px solid var(--border); background: transparent; color: var(--accent); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-outline.strong { border-color: var(--accent-dark); }
.btn-secondary.auto { width: auto; flex: none; }
.gap8 { gap: 8px; }
.row.gap8 > .btn-primary, .row.gap8 > .btn-secondary { margin-top: 0; }
.pre-line { white-space: pre-line; }
.block { display: block; }
.rot { transform: rotate(-90deg); }
.session-row > a.session-text { color: inherit; text-decoration: none; }
.ex-row { flex-direction: row; align-items: center; gap: 4px; padding: 8px 6px 8px 4px; }
.reorder { display: flex; flex-direction: column; }
.icon-btn.sm { width: 32px; height: 26px; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.ex-text {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 4px 2px; border: 0; background: none;
    color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.search:focus-within { border-color: var(--accent); }
.search-input { flex: 1; min-width: 0; padding: 12px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 16px; outline: none; }
.search-input::placeholder { color: var(--muted); }
.cat-scroll { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-scroll .chip-btn { flex: none; color: var(--muted); }
.chip-btn.on { background: var(--accent); color: var(--on-accent) !important; }
.pick-section { padding: 0; gap: 0; overflow: hidden; }
.pick-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; border: 0; background: none; cursor: pointer; font: inherit; }
.pick-row {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; border-top: 1px solid var(--border);
    background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.pick-row.on { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.pick-row .check { width: 26px; height: 26px; flex: none; }
.picker { padding-bottom: 0; }
.sticky-bottom { position: sticky; bottom: calc(var(--tabbar-h) + var(--tabbar-safe)); padding: 8px 0 12px; background: linear-gradient(transparent, var(--bg) 30%); }
.chain-dots { display: flex; justify-content: center; gap: 6px; }
.chain-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.chain-dots .dot.done { background: var(--accent-dark); }
.chain-dots .dot.now { background: var(--accent); width: 20px; border-radius: 4px; }
.chips3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chips3 .chip { padding: 10px 6px; font-size: 13px; }
.field-sm { width: 110px; padding: 8px 10px; text-align: center; font-size: 15px; }
.preview {
    padding: 12px; border-radius: 12px; border: 1px solid var(--accent-dark); text-align: center; font-weight: 700; font-size: 15px;
    color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}

/* ---------- Mesociclos ---------- */
.round-btn {
    width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--bg); color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
button.session-text { border: 0; background: none; color: var(--text); font: inherit; text-align: left; padding: 0; cursor: pointer; }
.wizard { width: 100%; max-width: 640px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(12px + env(safe-area-inset-top)) 16px calc(14px + env(safe-area-inset-bottom)); gap: 12px; }
.wizard-head { display: flex; flex-direction: column; gap: 10px; }
.segs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.segs span { height: 5px; border-radius: 3px; }
.wizard-body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.wizard-foot { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.wizard-foot .btn-secondary, .wizard-foot .btn-primary { margin-top: 0; }
.wrap { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 16px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.pill.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pill.accent { color: var(--accent); }
.pill.lg { padding: 9px 14px; font-size: 14px; border: 0; }
.pill.sm { padding: 5px 11px; font-size: 11px; margin-top: 4px; border: 0; }
.plain-card { flex-direction: row; align-items: center; width: 100%; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.badge { padding: 1px 8px; border-radius: 9px; font-size: 11px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg)); }
.list.tight { gap: 8px; }
.center-col { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 10px; text-align: center; }
.big-stepper { display: flex; align-items: center; justify-content: center; gap: 22px; }
.big-stepper button { width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--surface); color: var(--accent); font-size: 24px; cursor: pointer; }
.big-stepper span { min-width: 64px; text-align: center; font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.big-stepper.sm { justify-content: space-between; }
.big-stepper.sm button { border-radius: 12px; width: 48px; height: 48px; }
.big-stepper.sm span { font-size: 28px; }
.date-pill { align-self: center; display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.date-pill input, input.field[type=date] { color-scheme: dark; }
.date-pill input { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; font-size: 15px; outline: none; }
.sep { width: 100%; border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.planner { padding-bottom: 24px; }
.map { display: flex; flex-direction: column; gap: 3px; }
.map-row { display: grid; grid-template-columns: 26px repeat(7, 1fr); gap: 2px; align-items: center; }
.map-head { font-size: 9px; text-align: center; }
.map-week { height: 20px; border: 0; border-radius: 6px; font: inherit; font-size: 10px; font-weight: 600; cursor: pointer; padding: 0; }
.map-cell { position: relative; text-align: center; font-size: 10px; color: color-mix(in srgb, var(--muted) 60%, var(--bg)); padding: 3px 0 5px; }
.map-cell.on { color: var(--text); }
.map-cell.on::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 4px; height: 4px; margin-left: -2px; border-radius: 2px; background: var(--accent); }
.week-bar { flex-direction: row; align-items: center; gap: 2px; padding: 7px 8px; }
.test-banner { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--accent-dark); color: var(--accent); font-size: 12px; font-weight: 600; text-align: center; background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.day-row { flex-direction: row; align-items: center; gap: 4px; background: var(--bg); padding: 11px 12px; }
.day-link { display: flex; flex-direction: column; gap: 1px; color: inherit; text-decoration: none; }
.pager { display: flex; justify-content: center; gap: 6px; padding: 4px 0; }
.pager span { width: 6px; height: 6px; border-radius: 3px; background: var(--border); }
.pager span.on { width: 16px; background: var(--accent); }
.sheet-item:disabled { opacity: .35; cursor: default; }
.sheet-item.danger-text { color: var(--danger); }
.icon.accent { color: var(--accent); }

/* ---------- Suspensiones ---------- */
.overlay-full { position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow-y: auto; }
.week-row { gap: 10px; padding: 8px 0; }
.week-row.current .week-num { color: var(--accent); }
.week-accent { width: 4px; align-self: stretch; border-radius: 2px; }
.week-num { width: 52px; flex: none; }
.week-line { padding: 6px 0; }
.tag { padding: 3px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; }

/* ---------- Progreso ---------- */
.progress-head { background: var(--surface); padding: calc(16px + env(safe-area-inset-top)) 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.progress-head > * { width: 100%; max-width: 608px; margin-left: auto; margin-right: auto; }
.segmented.wide { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg); }
.segmented.wide button { padding: 9px 6px; }
.prog-row { flex-direction: row; align-items: center; gap: 10px; color: inherit; text-decoration: none; cursor: pointer; }
.accent-dark { color: var(--accent-dark); }
.plain-row { width: 100%; border: 0; background: none; color: var(--text); font: inherit; padding: 2px; cursor: pointer; text-align: left; }
.chev-dot { width: 24px; height: 24px; border-radius: 12px; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; }
.stat-strip { display: grid; grid-template-columns: 1fr 1fr 1fr; text-align: center; }
.stat-strip > div { display: flex; flex-direction: column; gap: 1px; align-items: center; }
.stat-strip > div + div { border-left: 1px solid var(--border); }
.big-num { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.gap4 { gap: 4px; }
.row.center { justify-content: center; }
.right-text { text-align: right; }
.filter-btn { position: relative; width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.filter-dot { position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 5px; background: var(--accent); }
.rock-grid { display: grid; grid-template-columns: 22px 1fr 54px 52px 30px; gap: 6px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--border); }
.rock-grid.head { background: var(--border); border-radius: 8px; padding: 8px 10px; border-bottom: 0; }
.rock-grid .c { text-align: center; justify-self: center; }
.sort { border: 0; background: none; font: inherit; font-size: 10px; font-weight: 700; padding: 0; cursor: pointer; white-space: nowrap; }
.ascent-text { min-width: 0; color: inherit; text-decoration: none; }
.grade { font-size: 17px; font-weight: 700; color: var(--accent); }
.goes { min-width: 34px; height: 30px; padding: 0 6px; border-radius: 8px; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.fab {
    position: fixed; right: max(20px, calc(50% - 300px)); bottom: calc(var(--tabbar-h) + var(--tabbar-safe) + 18px); z-index: 10;
    width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
    display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.chart-card { padding: 6px; }
.line-chart { width: 100%; height: auto; display: block; }
.spark { flex: none; display: block; }
.lc-grid { stroke: var(--border); stroke-width: 1; }
.lc-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-dot { fill: var(--accent); }
.lc-hit { fill: transparent; cursor: pointer; }
.lc-ring { fill: none; stroke: var(--accent); stroke-width: 2; }
.lc-text { fill: var(--muted); font-size: 10px; font-family: inherit; }
.lc-text.sm { font-size: 9px; }
.lc-last { fill: var(--accent); font-size: 12px; font-weight: 700; }
.lc-callout { fill: var(--accent); }
.lc-callout-text { fill: var(--on-accent); font-size: 10px; font-weight: 700; }
.pyramid { display: flex; flex-direction: column; }
.pyr-row { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; height: 20px; }
.pyr-grade { font-size: 10px; text-align: right; font-weight: 600; }
.pyr-bar-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pyr-bar { height: 8px; border-radius: 4px; flex: none; }
.pyr-count { font-size: 10px; font-weight: 600; }
.hist { display: flex; flex-direction: column; }
.hist-row { display: grid; gap: 6px; padding: 11px 10px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; white-space: nowrap; }
.hist-row.head { background: var(--border); border-radius: 8px; padding: 8px 10px; font-size: 11px; font-weight: 700; border-bottom: 0; }
.hist-row .c { text-align: center; }
.suggest { padding: 0 12px; gap: 0; }
.suggest .sheet-item:last-child { border-bottom: 0; }
.icon-chip { display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; }
.search-input.big { font-size: 20px; font-weight: 600; }

/* ---------- Avisos ---------- */
.toast {
    position: fixed; left: 50%; transform: translateX(-50%); top: calc(14px + env(safe-area-inset-top)); z-index: 40;
    display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--accent-dark); color: var(--text); font-size: 14px; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
