/* GymTracker · app del cliente (PWA). Los 4 temas son los mismos que en la app MAUI. */
:root, [data-theme="Claro"] {
    --page: #F5F5F7; --card: #FFFFFF; --surface2: #ECECF0;
    --text: #111114; --text2: #6B6B72;
    --accent: #007AFF; --accent-text: #FFFFFF; --accent-soft: #E3EEFF;
    --border: #E0E0E6; --success: #1FA94B; --success-soft: #DDF5E4;
    --danger: #E5342A; --danger-soft: #FDE3E1; --gold: #C98A00; --gold-soft: #FFF2CC;
    color-scheme: light;
}
[data-theme="Oscuro"] {
    --page: #0E0E10; --card: #1C1C1E; --surface2: #2C2C2E;
    --text: #F2F2F7; --text2: #9A9AA2;
    --accent: #0A84FF; --accent-text: #FFFFFF; --accent-soft: #132B4D;
    --border: #38383C; --success: #30D158; --success-soft: #143A20;
    --danger: #FF453A; --danger-soft: #3D1714; --gold: #FFD60A; --gold-soft: #3D3410;
    color-scheme: dark;
}
[data-theme="Rosa"] {
    --page: #FFF4F8; --card: #FFFFFF; --surface2: #FCE4EE;
    --text: #3A1222; --text2: #8E5B6E;
    --accent: #E2246E; --accent-text: #FFFFFF; --accent-soft: #FDDDEA;
    --border: #F5CADB; --success: #1FA94B; --success-soft: #DDF5E4;
    --danger: #D7263D; --danger-soft: #FDE0E4; --gold: #C98A00; --gold-soft: #FFF2CC;
    color-scheme: light;
}
[data-theme="Azul"] {
    --page: #0A1A33; --card: #122847; --surface2: #1B3760;
    --text: #EAF2FF; --text2: #9CB3D6;
    --accent: #4FC3F7; --accent-text: #06213D; --accent-soft: #173F66;
    --border: #24466F; --success: #4ADE80; --success-soft: #123D2E;
    --danger: #FF6B6B; --danger-soft: #4A1E2A; --gold: #FFD54F; --gold-soft: #3E3616;
    color-scheme: dark;
}

:root {
    --radius: 16px;
    --tabbar: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    background: var(--page);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Utilidades ---------- */
.muted { color: var(--text2); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.bold { font-weight: 600; }
.center { text-align: center; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pre { white-space: pre-line; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; white-space: pre; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.space { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.up { color: var(--success); }
.down { color: var(--danger); }
.same { color: var(--text2); }
.pr { color: var(--gold); }

/* ---------- Arranque ---------- */
.splash { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #0E1420; color: #F5F6F2; }
.splash-name { font-weight: 700; font-size: 22px; letter-spacing: -.01em; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid rgba(127, 127, 127, .25); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 24px auto; }
.splash .spinner { border-top-color: #C6F432; margin: 8px 0 0; }
@keyframes spin { to { transform: rotate(360deg); } }

#blazor-error-ui { display: none; position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); background: var(--danger); color: #fff; padding: 12px 16px; border-radius: 12px; z-index: 1000; }
#blazor-error-ui .reload { color: #fff; font-weight: 700; margin-left: 8px; }

/* ---------- Estructura ---------- */
.app { min-height: 100vh; padding-bottom: calc(var(--tabbar) + var(--safe-bottom)); }
.page { max-width: 720px; margin: 0 auto; padding: calc(10px + var(--safe-top)) 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.page-header { display: flex; align-items: center; gap: 8px; padding: 6px 0 2px; position: sticky; top: 0; z-index: 5; background: var(--page); }
.page-header h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.page-header .subtitle { color: var(--text2); font-size: .9rem; }
.section-title { font-size: 1.05rem; font-weight: 700; margin-top: 6px; }

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(var(--tabbar) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text2); font-size: 11px; font-weight: 600; }
.tab.active { color: var(--accent); }

.active-bar {
    position: fixed; left: 10px; right: 10px; z-index: 19;
    bottom: calc(var(--tabbar) + var(--safe-bottom) + 8px);
    max-width: 700px; margin: 0 auto;
    display: flex; align-items: center; gap: 10px;
    background: var(--accent); color: var(--accent-text);
    border-radius: 16px; padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.active-bar b { display: block; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; flex-shrink: 0; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--border); }
.card.flush { padding: 0; overflow: hidden; }
.card-title { font-weight: 700; font-size: 1.02rem; }
.card-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: inherit; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.card-row:last-child { border-bottom: 0; }
.card-row:active { background: var(--surface2); }
.tap { cursor: pointer; }
.tap:active { transform: scale(.99); }
.empty { text-align: center; color: var(--text2); padding: 28px 16px; }
.empty .icon { margin: 0 auto 8px; display: block; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px; text-align: center; }
.kpi b { display: block; font-size: 1.3rem; }
.kpi span { font-size: .75rem; color: var(--text2); }
.banner { border-radius: 14px; padding: 12px 14px; }
.banner.info { background: var(--accent-soft); }
.banner.gold { background: var(--gold-soft); }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner.success { background: var(--success-soft); }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 46px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent;
    font-weight: 600; cursor: pointer; background: var(--surface2); color: var(--text);
    text-decoration: none; user-select: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn.small { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: .9rem; }
.btn.wide { width: 100%; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; color: var(--accent); cursor: pointer; flex-shrink: 0; }
.icon-btn:active { background: var(--surface2); }
.icon-btn.filled { background: var(--accent-soft); }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 6px 0; }

/* ---------- Formularios ---------- */
label.field { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; color: var(--text2); font-weight: 500; }
.input, label.field input, label.field select, label.field textarea {
    width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--card); color: var(--text);
}
textarea.input, label.field textarea { min-height: 80px; resize: vertical; }
.input:focus, label.field input:focus, label.field select:focus, label.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
label.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex-shrink: 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.switch { appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--surface2); position: relative; cursor: pointer; border: 1px solid var(--border); flex-shrink: 0; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch:checked { background: var(--success); }
.switch:checked::after { transform: translateX(20px); }
.search { position: relative; }
.search .icon { position: absolute; left: 12px; top: 12px; color: var(--text2); }
.search input { padding-left: 40px; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex-shrink: 0; border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 999px; padding: 7px 13px; font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface2); color: var(--text2); white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.pill.success { background: var(--success-soft); color: var(--success); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface2); border-radius: 12px; padding: 3px; gap: 3px; }
.segmented button { border: 0; background: transparent; border-radius: 9px; padding: 8px 6px; font-weight: 600; font-size: .9rem; color: var(--text2); cursor: pointer; }
.segmented button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- Diálogos ---------- */
.dialog-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
.dialog { width: 100%; max-width: 380px; max-height: 86vh; overflow-y: auto; background: var(--card); color: var(--text); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); animation: pop .18s; }
.dialog.sheet { align-self: flex-end; max-width: 520px; border-radius: 20px; margin-bottom: var(--safe-bottom); }
.dialog-title { font-size: 1.12rem; font-weight: 700; text-align: center; }
.dialog-message { color: var(--text2); text-align: center; white-space: pre-line; }
.dialog-message.mono { text-align: left; font-family: ui-monospace, Menlo, Consolas, monospace; white-space: pre; font-size: .9rem; }
.dialog form { display: flex; flex-direction: column; gap: 12px; }
.dialog-buttons { display: flex; gap: 10px; }
.dialog-buttons .btn { flex: 1; }
.sheet-options { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.sheet-option { border: 0; border-bottom: 1px solid var(--border); background: var(--card); padding: 14px; font-weight: 600; color: var(--accent); cursor: pointer; }
.sheet-option:last-child { border-bottom: 0; }
.sheet-option:active { background: var(--surface2); }
.sheet-option.danger { color: var(--danger); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + var(--safe-bottom) + 76px); z-index: 110; background: #111114; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); max-width: calc(100% - 32px); text-align: center; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.95); opacity: 0; } }
.modal-page { position: fixed; inset: 0; z-index: 60; background: var(--page); overflow-y: auto; animation: slideup .2s; }
.modal-page .page { padding-bottom: calc(24px + var(--safe-bottom)); }
@keyframes slideup { from { transform: translateY(30px); opacity: 0; } }

/* ---------- Acceso ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(24px + var(--safe-top)) 18px calc(24px + var(--safe-bottom)); gap: 18px; background: #0E1420; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #F5F6F2; font-weight: 800; font-size: 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); color: var(--text); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 1.4rem; }

/* ---------- Entrenar ---------- */
.big-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.big-action { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); color: var(--text); text-align: left; cursor: pointer; }
.big-action .icon { color: var(--accent); }
.big-action.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.big-action.primary .icon { color: var(--accent-text); }
.routine-card { border-left: 4px solid var(--accent); }

/* Entreno en curso */
.workout-top { position: sticky; top: 0; z-index: 6; background: var(--page); padding: calc(8px + var(--safe-top)) 0 8px; display: flex; flex-direction: column; gap: 8px; }
.workout-name { font-size: 1.3rem; font-weight: 800; border: 0; background: transparent; padding: 0; width: 100%; color: var(--text); }
.workout-name:focus { outline: none; border-bottom: 2px solid var(--accent); }
.timer-big { font-variant-numeric: tabular-nums; font-weight: 700; }
.rest-bar { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 10px 12px; }
.rest-time { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 84px; }
.rest-progress { height: 4px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.rest-progress i { display: block; height: 100%; background: var(--accent); transition: width 1s linear; }
.ex-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ex-head { display: flex; align-items: flex-start; gap: 8px; }
.ex-name { font-weight: 700; font-size: 1.05rem; color: var(--accent); }
.set-grid { display: grid; grid-template-columns: 38px minmax(56px, 1.1fr) minmax(64px, 1fr) minmax(52px, .9fr) minmax(44px, .7fr) 46px; gap: 6px; align-items: center; }
.set-grid.head { font-size: .72rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .02em; }
.set-grid.head span { text-align: center; }
.set-grid input { width: 100%; min-height: 40px; text-align: center; border: 0; background: var(--surface2); border-radius: 10px; padding: 6px 2px; font-weight: 600; }
.set-grid input:focus { outline: 2px solid var(--accent); }
.set-grid.done input { background: var(--success-soft); }
.set-grid.done.pr input { background: var(--gold-soft); }
.set-num { min-height: 40px; border-radius: 10px; border: 0; background: var(--surface2); font-weight: 800; cursor: pointer; }
.set-num.warm { background: var(--gold-soft); color: var(--gold); }
.prev { font-size: .78rem; color: var(--text2); text-align: center; line-height: 1.1; }
.prev b { display: block; font-size: .72rem; }
.done-btn { min-height: 40px; border-radius: 10px; border: 0; background: var(--surface2); color: var(--text2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.done-btn.on { background: var(--success); color: #fff; }
.done-btn.on.pr { background: var(--gold); }
.ex-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ex-actions .btn { flex: 1; }
.trend { font-size: .82rem; font-weight: 600; }

/* Editor de plantillas */
.tpl-set { display: grid; grid-template-columns: 38px repeat(4, minmax(0, 1fr)) 34px; gap: 6px; align-items: center; }
.tpl-set input { width: 100%; min-height: 40px; text-align: center; border: 0; background: var(--surface2); border-radius: 10px; padding: 6px 2px; font-weight: 600; }
.tpl-rest { display: flex; align-items: center; gap: 8px; margin-left: 44px; color: var(--text2); font-size: .8rem; }
.tpl-rest::before { content: ""; flex: 0 0 2px; height: 18px; background: var(--border); border-radius: 2px; }

/* Biblioteca */
.ex-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; background: var(--card); width: 100%; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: inherit; }
.ex-item:last-child { border-bottom: 0; }
.ex-item.picked { background: var(--accent-soft); }
.ex-avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.picker-footer { position: sticky; bottom: 0; padding: 10px 0 calc(10px + var(--safe-bottom)); background: var(--page); }

/* Historial */
.hist-sets { width: 100%; border-collapse: collapse; font-size: .9rem; }
.hist-sets td { padding: 6px 4px; border-bottom: 1px solid var(--border); }
.hist-sets tr:last-child td { border-bottom: 0; }

/* Dieta */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.portions { border-collapse: collapse; width: 100%; font-size: .85rem; }
.portions th, .portions td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.portions th:first-child, .portions td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
.portions td.filled { background: var(--accent-soft); font-weight: 700; }
.portions tr.total td { font-weight: 800; background: var(--surface2); }
.meal-block { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.meal-block:first-child { border-top: 0; padding-top: 0; }
.food-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.food-row:last-child { border-bottom: 0; }

/* CrossFit */
.wod-timer { text-align: center; padding: 24px 12px; border-radius: 22px; background: var(--card); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.wod-timer.rest { background: var(--success-soft); }
.wod-timer.prep { background: var(--gold-soft); }
.wod-time { font-size: clamp(56px, 18vw, 96px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.02em; }
.round-counter { display: flex; align-items: center; justify-content: center; gap: 16px; }
.round-counter b { font-size: 1.6rem; min-width: 60px; }
.round-btn { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-text); font-size: 1.6rem; font-weight: 800; cursor: pointer; }
.round-btn.minus { background: var(--surface2); color: var(--text); }

/* Perfil */
.profile-head { display: flex; align-items: center; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 800; flex-shrink: 0; object-fit: cover; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fact { background: var(--surface2); border-radius: 12px; padding: 10px; }
.fact span { display: block; font-size: .75rem; color: var(--text2); }
.fact b { font-size: 1rem; }
.themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.theme-btn { border: 2px solid var(--border); border-radius: 14px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font-size: .8rem; font-weight: 600; }
.theme-btn.on { border-color: var(--accent); }
.theme-dot { width: 28px; height: 28px; border-radius: 50%; border: 3px solid; }
.appt { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.appt:last-child { border-bottom: 0; }
.appt-day { min-width: 76px; }
.appt-day b { display: block; color: var(--accent); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--success); }
.sync-dot.off { background: var(--text2); }
.sync-dot.err { background: var(--danger); }

/* Gráfica */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--text2); font-size: 11px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .dot { fill: var(--card); stroke: var(--accent); stroke-width: 2; }

@media (min-width: 760px) {
    .page { padding-top: 24px; }
}
.icon.spin { animation: spin 1s linear infinite; }

/* ===== Aviso de mensajes en la pestaña Perfil ===== */
.tab-icon { position: relative; display: inline-flex; }
.tab-dot { position: absolute; top: -2px; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--card); }

/* ===== Revisiones ===== */
.stars { color: var(--gold); margin-left: 6px; letter-spacing: 1px; font-size: .9rem; }
.measures { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.measure { background: var(--surface2); border-radius: 10px; padding: 6px 9px; display: flex; flex-direction: column; font-size: .8rem; color: var(--text2); }
.measure b { color: var(--text); font-size: 1rem; }
.measure small { font-size: .72rem; }

/* ===== Mensajes ===== */
.chat { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.chat-day { align-self: center; font-size: .72rem; font-weight: 600; color: var(--text2); background: var(--surface2); border-radius: 999px; padding: 3px 10px; margin: 8px 0 2px; text-transform: capitalize; }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: 16px; font-size: .95rem; line-height: 1.35; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 5px; }
.bubble.theirs { align-self: flex-start; background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble-time { font-size: .68rem; opacity: .7; text-align: right; margin-top: 2px; }
.composer { position: sticky; bottom: calc(var(--tabbar) + var(--safe-bottom) + 8px); display: flex; gap: 8px; align-items: flex-end; background: var(--page); padding: 6px 0; }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; background: var(--card); }
.composer textarea:focus { outline: none; border-color: var(--accent); }
.composer .btn { min-width: 48px; min-height: 44px; padding: 0 12px; }

/* ===== Fotos de las revisiones ===== */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.photo { position: relative; aspect-ratio: 3 / 4; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--surface2); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-pose { position: absolute; left: 4px; bottom: 4px; font-size: .68rem; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .55); border-radius: 6px; padding: 1px 6px; }
.upload-btn { align-self: flex-start; cursor: pointer; }
.upload-btn input[type=file] { display: none; }
.upload-btn.disabled { opacity: .6; pointer-events: none; }
.viewer { position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; padding: 12px 12px calc(76px + var(--safe-bottom)); }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.viewer-bar { position: absolute; left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); display: flex; align-items: center; gap: 8px; color: #fff; }
.spinner.small { width: 20px; height: 20px; border-width: 2px; margin: 0; }
