/* =====================================================================
   CAR-TKD Elite · Estilos
   Paleta del logo: negro, rojo (#E31B23) y blanco
   ===================================================================== */
:root {
  --bg: #0B0B0D; --bg2: #111114; --card: #17171B; --card2: #0F0F12; --line: #26262C; --line2: #2E2E35;
  --tx: #F5F5F7; --tx2: #D4D4D8; --mut: #A1A1AA;
  --red: #E31B23; --red-tx: #FF4D55; --red-bg: #2A0E10;
  --ok: #22C55E; --warn: #F5B83D; --bad: #FF4D55;
  --r: 16px; --fs: 16px;
  --font: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --disp: Saira, Inter, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font-family: var(--font); font-size: var(--fs); line-height: 1.45; -webkit-text-size-adjust: 100%; }
body.no-scroll { overflow: hidden; }
a { color: var(--red-tx); text-decoration: none; }
a:hover { color: #FF7A80; }
h1, h2, h3 { font-family: var(--disp); font-weight: 700; margin: 0; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; margin-top: 8px; }
p { margin: 0; }
small { display: block; font-size: 13px; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; flex-shrink: 0; }
:focus-visible { outline: 3px solid #FF7A80; outline-offset: 2px; }

/* ----- utilidades ----- */
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.end { align-items: flex-end; }
.row.gap { gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.sm { gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.muted { color: var(--mut); }
.small { font-size: 14px; }
.xs { font-size: 12px; }
.txt-ok { color: var(--ok); } .txt-warn { color: var(--warn); } .txt-bad { color: var(--bad); } .txt-accent { color: var(--red-tx); }
.loading, .empty { padding: 28px 16px; text-align: center; color: var(--mut); }
.empty { border: 1px dashed var(--line2); border-radius: var(--r); }

/* ----- estructura ----- */
.layout { display: flex; min-height: 100vh; }
.sidebar { display: none; }
.main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 8px; position: sticky; top: 0; z-index: 20; background: rgba(11, 11, 13, .94); backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 38px; height: 41px; object-fit: contain; }
.brand-name, .brand > span { font-family: var(--disp); font-weight: 800; font-style: italic; font-size: 19px; letter-spacing: .3px; }
.brand b { color: var(--red-tx); }
.brand small { color: var(--mut); font-size: 12px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line2); background: var(--card); color: var(--tx); font-family: var(--disp); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; }
.avatar.sm { width: 42px; height: 42px; font-size: 14px; cursor: default; }
.avatar.lg { width: 70px; height: 70px; font-size: 24px; border: 2px solid var(--red); cursor: default; }
main#view { flex: 1 1 auto; padding: 4px 16px calc(110px + var(--badge-h, 0px)); outline: none; }
.page { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.page.wide { max-width: 1400px; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--bg2); border-top: 1px solid var(--line); padding: 6px 6px calc(10px + var(--badge-h, 0px) + env(safe-area-inset-bottom)); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center; color: var(--mut); font-size: 12px; font-weight: 600; border-radius: 10px; }
.bottom-nav a.active { color: var(--red-tx); }
.demo-banner { background: #3A2A06; color: #FDE68A; font-size: 13px; text-align: center; padding: 6px 12px; }
.offline-banner { background: #3A2A06; color: #FDE68A; font-size: 14px; text-align: center; padding: 8px; }
.link { background: none; border: 0; color: var(--red-tx); font-weight: 600; cursor: pointer; padding: 6px 0; min-height: 36px; }

@media (min-width: 960px) {
  .sidebar { display: flex; flex-direction: column; gap: 20px; width: 250px; flex-shrink: 0; padding: 22px 14px; background: var(--bg2); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; }
  .sidebar nav { display: flex; flex-direction: column; gap: 4px; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 10px; color: var(--tx2); font-weight: 600; font-size: 15px; }
  .sidebar nav a.active { background: var(--red-bg); color: var(--red-tx); }
  .side-user { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
  .side-user small { color: var(--mut); }
  .topbar .brand { visibility: hidden; }
  .bottom-nav { display: none; }
  main#view { padding: 8px 32px calc(48px + var(--badge-h, 0px)); }
}

/* ----- tarjetas ----- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 8px; color: var(--tx); }
a.card:hover { border-color: var(--line2); color: var(--tx); }
.card.hero { background: linear-gradient(135deg, #1D0B0C 0%, var(--card) 60%); border-color: #3A1518; }
.card.error { border-color: var(--bad); }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; color: var(--red-tx); }
.kicker.muted { color: var(--mut); }
.h2 { font-family: var(--disp); font-size: 26px; font-weight: 800; line-height: 1.1; }
.h3 { font-family: var(--disp); font-size: 20px; font-weight: 700; }
.big-num { font-family: var(--disp); font-size: 44px; font-weight: 800; line-height: 1; text-align: right; }
.big-num small { font-family: var(--font); font-size: 13px; color: var(--mut); font-weight: 500; }
.num { font-family: var(--disp); font-size: 28px; font-weight: 800; line-height: 1.1; }
.num small { display: inline; font-family: var(--font); font-size: 14px; color: var(--mut); font-weight: 500; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line2); color: var(--tx2); white-space: nowrap; }
.tag svg { width: 14px; height: 14px; }
.tag.ok { color: var(--ok); border-color: #1E5631; background: #0F2A18; }
.tag.warn { color: var(--warn); border-color: #5C4A1A; background: #1F1A0E; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.chip-estado { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.phase-line { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--tx2); }
.greet h1 { font-size: 30px; }
.stat { gap: 4px; }
.quick { flex-direction: row; align-items: center; gap: 12px; min-height: 64px; font-weight: 600; }
.quick svg { color: var(--red-tx); }
.list-item { flex-direction: row; align-items: center; gap: 12px; min-height: 64px; }
.list-item.current { border-color: var(--red); }
.btn-row { width: 100%; text-align: left; cursor: pointer; font: inherit; }
.prio { width: 38px; height: 38px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--disp); font-weight: 800; font-size: 16px; background: var(--line2); color: var(--tx); flex-shrink: 0; }
.warn-box { background: #1F1A0E; border-color: #5C4A1A; color: #FDE68A; }
.meter { flex: 1; height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--tx); }
.tip { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: var(--card2); }
.tip p { color: var(--tx2); font-size: 14px; }
.note { padding: 12px; border-radius: 12px; background: var(--card2); display: flex; flex-direction: column; gap: 6px; }
.dl { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 8px 12px; margin: 0; font-size: 15px; }
.dl dt { color: var(--mut); } .dl dd { margin: 0; }
.link-box { display: block; padding: 12px; border-radius: 10px; background: var(--card2); font-size: 14px; word-break: break-all; }
.athlete-head { display: flex; align-items: center; gap: 16px; }
.athlete-head h1 { font-size: 26px; }

/* ----- botones ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); color: var(--tx); font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; }
.btn:hover { color: var(--tx); border-color: #3F3F46; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #C8141B; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: #5C1A1E; color: var(--bad); }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn svg { width: 18px; height: 18px; }
.icon-btn { width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 0; background: transparent; color: var(--tx); cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { background: var(--card); color: var(--tx); }

/* ----- segmentos y pestañas ----- */
.seg { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.seg button { flex: 1 1 auto; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 0; background: transparent; color: var(--tx2); font-weight: 700; font-size: 14px; cursor: pointer; }
.seg button.on { background: var(--red); color: #fff; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs a { padding: 12px 14px; min-height: 46px; color: var(--mut); font-weight: 700; font-size: 15px; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--tx); border-bottom-color: var(--red); }
#tab { display: flex; flex-direction: column; gap: 14px; }
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line2); }
.search svg { color: var(--mut); }
.search input { flex: 1; min-height: 48px; border: 0; background: transparent; outline: none; font-size: 16px; }

/* ----- formularios ----- */
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--tx2); }
.field small { color: var(--mut); }
input, select, textarea { min-height: 48px; padding: 10px 12px; border-radius: 10px; border: 1px solid #3F3F46; background: var(--card2); color: var(--tx); font-size: 16px; width: 100%; }
textarea { min-height: 72px; resize: vertical; }
input[type=checkbox] { width: 24px; height: 24px; min-height: 0; accent-color: var(--red); }
select { appearance: auto; }
.crit { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.scale button { min-height: 50px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card2); color: var(--tx2); font-family: var(--disp); font-weight: 700; font-size: 19px; cursor: pointer; }
.scale button.on { background: var(--red); border-color: var(--red); color: #fff; }
.rpe-grid { display: flex; flex-direction: column; gap: 6px; }
.rpe-grid button { display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--tx); text-align: left; cursor: pointer; }
.rpe-grid button b { font-family: var(--disp); font-size: 19px; width: 26px; }
.rpe-grid button.on { background: var(--red-bg); border-color: var(--red); }
.rpe-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.rpe-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rpe-row select { width: 170px; flex-shrink: 0; }
.test-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.test-entry { display: flex; flex-direction: column; gap: 4px; max-height: 55vh; overflow-y: auto; }
.te-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.te-row > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.te-row input { width: 120px; flex-shrink: 0; }
.te-row.disabled { opacity: .55; }
.multi { display: grid; grid-template-columns: repeat(5, 54px); gap: 4px; }
.multi input { width: 54px; padding: 8px 4px; text-align: center; }

/* ----- acordeón ----- */
.acc { padding: 0; }
.acc.open { border-color: var(--red); }
.acc-h { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 10px 16px; border: 0; background: transparent; color: var(--tx); text-align: left; cursor: pointer; font-size: 20px; }
.acc-b { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 4px; }
details.card summary { cursor: pointer; min-height: 30px; }
details.card[open] { border-color: var(--line2); }
.refs { margin: 4px 0 0; padding-left: 18px; color: var(--mut); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }

/* ----- tablas ----- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; letter-spacing: .5px; color: var(--mut); font-weight: 700; padding: 8px 8px; white-space: nowrap; }
.tbl td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl .r { text-align: right; white-space: nowrap; }

/* ----- gráficos ----- */
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--tx2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-car { background: var(--red); } .lg-club { background: #71717A; } .lg-casa { background: #3F3F46; } .lg-plan { background: #52525B; }
.lg-main { background: var(--red-tx); height: 4px !important; } .lg-ref, .lg-prev { border-top: 2px dashed var(--tx); height: 0 !important; width: 16px !important; border-radius: 0 !important; }
.lg-today { width: 3px !important; background: var(--red-tx); }
.bars { display: flex; align-items: flex-end; gap: 3px; border-bottom: 1px solid #3F3F46; }
.bar { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar i { display: block; }
.b-car { background: var(--red); } .b-car.hoy { background: var(--tx); } .b-club { background: #71717A; } .b-casa { background: #3F3F46; border-radius: 2px 2px 0 0; }
.radar { position: relative; max-width: 100%; }
.radar svg { width: 100%; height: auto; }
.rd-grid { fill: none; stroke: #2E2E35; stroke-width: 1; }
.rd-axis { stroke: #26262C; stroke-width: 1; }
.rd-main { fill: rgba(227, 27, 35, .28); stroke: var(--red-tx); stroke-width: 2; }
.rd-ref, .rd-prev { fill: none; stroke: var(--tx); stroke-width: 1.5; stroke-dasharray: 4 3; }
.rd-label { position: absolute; transform: translate(-50%, -50%); font-size: 12px; font-weight: 600; color: var(--tx2); text-align: center; white-space: nowrap; line-height: 1.2; }
.rd-label b { display: block; color: var(--red-tx); }
.pairs { display: flex; align-items: flex-end; gap: 8px; height: 140px; border-bottom: 1px solid #3F3F46; }
.pair { flex: 1 1 0; display: flex; align-items: flex-end; gap: 2px; }
.pair i { flex: 1; display: block; border-radius: 3px 3px 0 0; }
.pair i.p { background: #52525B; } .pair i.r { background: var(--red); }

/* ----- planificación ----- */
.season { display: flex; flex-direction: column; gap: 8px; }
.season-marks { position: relative; height: 30px; }
.mark { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.mark b { font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.mark i { width: 2px; height: 8px; background: var(--tx); }
.season-bar { position: relative; height: 26px; border-radius: 6px; background: var(--card2); }
.season-bar span { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; border-right: 2px solid var(--card); overflow: hidden; }
.season-bar .today { position: absolute; top: -6px; bottom: -6px; width: 3px; background: var(--red-tx); }
.week { display: flex; flex-direction: column; gap: 8px; }
.day { padding: 10px 12px; border-radius: 12px; background: var(--card2); display: flex; flex-direction: column; gap: 8px; }
.day.is-today { border: 1px solid var(--red); }
.day-h { font-family: var(--disp); font-weight: 700; text-transform: capitalize; color: var(--tx2); }
.ses { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: var(--card); }
.blq { gap: 10px; }

/* ----- sesión guiada ----- */
.steps { display: flex; gap: 4px; }
.steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps i.done { background: #71717A; } .steps i.cur { background: var(--red); }
.big-block h1 { font-size: 26px; }
.timer { font-family: var(--disp); font-size: 84px; font-weight: 800; text-align: center; letter-spacing: 2px; font-variant-numeric: tabular-nums; line-height: 1.1; padding: 8px 0; }
.mini { padding: 10px; border-radius: 10px; background: var(--card2); display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.mini small { font-size: 11px; color: var(--mut); }
.key { padding: 12px; border-radius: 10px; background: #1D0B0C; border: 1px solid #3A1518; font-size: 15px; }
.key b { color: var(--red-tx); }
.controls { display: grid; grid-template-columns: 70px 1fr 70px; gap: 10px; }
.controls .btn { min-height: 60px; font-size: 17px; }

/* ----- panel ----- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1200px) { .panel-grid { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); } }
.alert-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; background: var(--card2); color: var(--tx); }
.alert-row .dot { margin-top: 5px; }
.alert-row small { color: var(--mut); }

/* ----- modal y toast ----- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .65); display: flex; align-items: flex-end; justify-content: center; }
.modal { width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: var(--bg2); border: 1px solid var(--line2); border-radius: 20px 20px 0 0; padding: 0 18px calc(22px + var(--badge-h, 0px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; background: var(--bg2); padding: 16px 0 10px; z-index: 2; }
.modal-head h2 { font-size: 20px; }
.modal-body { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 700px) { .modal-wrap { align-items: center; } .modal { border-radius: 20px; } }
.menu-list { display: flex; flex-direction: column; gap: 4px; }
.menu-list a, .menu-btn { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--tx); font-weight: 600; font-size: 15px; cursor: pointer; text-align: left; width: 100%; }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--badge-h, 0px)); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 60; background: #26262C; color: var(--tx); padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: 92vw; transition: all .2s; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #0F2A18; border: 1px solid var(--ok); }
.toast.err { background: #2A0E10; border: 1px solid var(--bad); }

/* ----- login ----- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; text-align: center; }
.login-card form { text-align: left; }
.login-logo { width: 120px; height: 130px; object-fit: contain; margin: 0 auto; }
.login-card h1 { font-family: var(--disp); font-style: italic; font-weight: 800; font-size: 30px; }
.login-card h1 b { color: var(--red-tx); }
.login-user { flex-direction: column; align-items: flex-start; gap: 0; padding: 10px 16px; min-height: 58px; }
.login-user small { color: var(--mut); font-weight: 500; }
.login-links { display: flex; flex-direction: column; gap: 4px; align-items: center; }

@media (max-width: 420px) {
  .grid-form { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 24px; }
  .multi { grid-template-columns: repeat(5, 46px); }
  .multi input { width: 46px; }
  .te-row { flex-wrap: wrap; }
}

/* Espacio reservado para el botón "Powered by Netlify" (plan gratuito): la app lo detecta y sube sus controles */
.login { padding-bottom: calc(24px + var(--badge-h, 0px)); }

/* ===================== Fase 2: generador, biblioteca, peso, combates, portal ===================== */
.kpis .kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.kpis .kpi b { display: block; font-family: var(--disp); font-size: 28px; }
.kpis:has(.kpi) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.kv span { color: var(--mut); }
.tag.bad { color: var(--bad); border-color: #5C1A1E; background: var(--red-bg); }
.prio.xs { width: 22px; height: 22px; font-size: 12px; display: inline-grid; place-items: center; border-radius: 6px; }
.tbl.xs { font-size: 13px; }
.tbl.xs td, .tbl.xs th { padding: 6px 8px; }
.gen-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-color: #5C1A1E; background: linear-gradient(135deg, #1B0D0F, var(--card)); }
.gen-cta .grow { min-width: 220px; }
.chk { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--card2); cursor: pointer; }
.chk input { width: 20px; height: 20px; accent-color: var(--red); }
.chips-dias { display: flex; flex-wrap: wrap; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line2); color: var(--tx2); font-weight: 600; }
.chips .chip.on { background: var(--red); border-color: var(--red); color: #fff; }
.bib-pick { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.bib-item { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card2); cursor: pointer; }
.bib-item small { color: var(--mut); }
details.ej summary { list-style: none; cursor: pointer; display: grid; gap: 4px; }
details.ej summary::-webkit-details-marker { display: none; }
details.ej[open] { gap: 10px; display: flex; flex-direction: column; }
.ej-cat { justify-self: start; font-size: 12px; font-weight: 700; color: #0B0B0D; padding: 2px 8px; border-radius: 6px; }
.linea { width: 100%; max-width: 560px; height: auto; display: block; }
.linea .ln-main { fill: none; stroke: var(--red-tx); stroke-width: 2.5; }
.linea .ln-pt { fill: var(--red-tx); }
.linea .ln-ref { stroke: var(--ok); stroke-dasharray: 5 4; stroke-width: 1.5; }
.linea .ln-ref2 { stroke: var(--warn); stroke-dasharray: 2 4; stroke-width: 1.5; }
.linea .ln-t { fill: var(--mut); font-size: 11px; font-family: var(--font); }
.video-box video, .video-box iframe, .video-box #yt { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; display: block; }
.file-btn { position: relative; cursor: pointer; }
.tagger { gap: 12px; }
.seg.big button { min-height: 52px; font-size: 16px; }
.tag-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tag-grid button { min-height: 46px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card2); color: var(--tx2); font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px; }
.tag-grid button.on { background: var(--red); border-color: var(--red); color: #fff; }
.tag-actions { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.btn.big { min-height: 58px; font-size: 18px; }
.score { display: flex; align-items: center; justify-content: center; gap: 14px; font-family: var(--disp); margin-bottom: 8px; }
.score b { font-size: 44px; }
.score i { color: var(--mut); font-style: normal; font-size: 30px; }
.score span { color: var(--mut); font-weight: 600; }
.acc-row { padding: 6px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.vinc-list { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; margin-top: 6px; }
.vinc-list .chk { justify-content: flex-start; }
.scale.wide { grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.scale.wide button { min-height: 46px; font-size: 16px; padding: 0; }
.bottom-nav.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 420px) { .tag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.desglose { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; text-align: left; }
.desglose ol, .desglose ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; line-height: 1.45; }
.desglose .kv { font-size: 14px; }
