@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  /* superficies: fondo < pozo < panel < elevado */
  --bg: #0c0e10;
  --well: #0f1214;
  --bg-side: #0f1214;
  --panel: #15191c;
  --panel-2: #1b2024;
  --hover: #1f2529;
  --line: #22282c;
  --line-2: #2d3439;
  --line-strong: #3a4247;
  --pop: #1c2125;
  --pop-line: #343c41;
  --thumb: #2a3135;
  --thumb-hover: #3a4247;
  --edge: inset 0 1px 0 rgba(255, 255, 255, .035);
  /* texto */
  --text: #e9edeb;
  --text-2: #b3bbb7;
  --muted: #838d88;
  /* marca y acción */
  --accent: #5fd83a;
  --accent-hover: #74e252;
  --accent-ink: #0a1a06;
  --accent-soft: rgba(95, 216, 58, .12);
  --ring: 0 0 0 3px rgba(95, 216, 58, .22);
  /* datos (validados para daltonismo sobre el fondo oscuro) */
  --lap: #dfe5e2;
  --ref: #9085e9;
  --ref-text: #b9b1f5;
  --loss: #ec5b5b;
  --gain: #4ade80;
  --sess: #838d88;
  --warn: #e0a32e;
  /* escala tipográfica (pocos tamaños, bien separados): 12 · 13 · 14 · 15 · 16 · 22 · 32 · 52 */
  --t11: 12px; --t12: 13px; --t13: 14px; --t14: 15px; --t16: 16px; --t20: 22px; --t28: 32px; --t34: 52px;
  --radius: 12px;
  --r-block: 12px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.23, 1, .32, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: var(--t14)/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  background: var(--bg);
  color: var(--text);
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(95, 216, 58, .28); color: #fff; }
/* Foco: el anillo sigue la forma del control (hereda su radio); los campos de texto lo llevan como halo. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:not([type="checkbox"]):focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: rgba(95,216,58,.6) !important; box-shadow: var(--ring); }
* { scrollbar-width: thin; scrollbar-color: var(--thumb) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--thumb); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--thumb-hover); }
::-webkit-scrollbar-corner { background: transparent; }
input, select, button { caret-color: var(--accent); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11"; }
.muted { color: var(--muted); }
.sm-text { font-size: var(--t12); }
.pos { color: var(--loss); }
.neg { color: var(--gain); }
.ic { flex-shrink: 0; display: block; }
.u { font-size: .78em; color: var(--muted); font-weight: 500; margin-left: 2px; letter-spacing: 0; }

/* ---------- botones y controles ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 var(--t13)/1 var(--font); color: var(--accent-ink);
  background: var(--accent); border: 1px solid transparent; border-radius: 7px;
  padding: 9px 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .16s var(--ease);
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--text-2); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); border-color: var(--line-strong); }
.btn.ghost.on { color: var(--accent); border-color: rgba(95,216,58,.45); background: var(--accent-soft); }
.btn.sm { padding: 7px 10px; font-size: var(--t12); }
.btn.xs { padding: 5px 8px; font-size: var(--t12); gap: 5px; }
.btn.icon { padding: 7px; }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.btn .ic { opacity: .9; }
.select {
  font: 500 var(--t13) var(--font); color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 28px 6px 10px; max-width: 280px;
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23838d88' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  transition: border-color .15s ease;
}
.select:hover { border-color: var(--line-strong); }
.select.sm { font-size: var(--t12); padding: 4px 24px 4px 8px; max-width: 150px; background-position: right 7px center; }
.switch { display: inline-flex; align-items: center; gap: 7px; min-height: 24px; padding: 0 4px; margin-right: -4px; border-radius: 6px; font-size: var(--t12); color: var(--muted); cursor: pointer; user-select: none; }
/* Mismo interruptor que en los diálogos (.tg), en pequeño: nada de casillas nativas. */
.switch input { appearance: none; margin: 0; width: 26px; height: 15px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; cursor: pointer; transition: background-color .18s ease; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #cfd5d2; box-shadow: 0 1px 2px rgba(0,0,0,.35); transition: transform .18s var(--ease), background-color .18s ease; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(11px); background: #fff; }
.switch:hover { color: var(--text-2); }
.switch:hover input:not(:checked) { background: var(--line-strong); }

/* menús desplegables nativos (details) */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; min-width: 200px;
  background: var(--pop); border: 1px solid var(--pop-line); border-radius: 9px; padding: 5px;
  box-shadow: 0 12px 32px rgba(0,0,0,.5), var(--edge);
  transform-origin: top right; animation: pop .16s var(--ease);
}
.menu-pop button:focus-visible, .menu-pop a:focus-visible { outline: none; background: var(--hover); color: var(--text); box-shadow: inset 0 0 0 1px rgba(95,216,58,.5); }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-2px); } }
.menu-pop button, .menu-pop a {
  width: 100%; display: flex; align-items: center; gap: 9px; background: none; border: 0; color: var(--text-2);
  font: 500 var(--t13) var(--font); text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; text-decoration: none;
}
.menu-pop button:hover, .menu-pop a:hover { background: var(--hover); color: var(--text); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line-2); margin: 5px 4px; }
.menu-pop .log { max-height: 260px; width: 440px; }

/* ---------- barra lateral ---------- */
.sidebar {
  width: 288px; flex-shrink: 0; background: var(--bg-side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.brand { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 16px 16px 14px; }
.brand-wm { display: block; width: 100%; max-width: 244px; height: auto; }
.brand .brand-text { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 2px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: var(--t12); color: var(--muted); }
.side-block { display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); }
.side-block.combos-block { flex: 0 1 auto; max-height: 52%; }
.side-block.grow { flex: 1; min-height: 200px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px; gap: 8px; }
.side-head h2 { font-size: var(--t12); font-weight: 600; color: var(--text-2); }
.count { color: var(--muted); font-weight: 500; margin-left: 4px; }
.combo-list { padding: 0 8px 18px; flex: 1; min-height: 0; -webkit-mask-image: linear-gradient(#000 calc(100% - 20px), transparent); mask-image: linear-gradient(#000 calc(100% - 20px), transparent); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.combo {
  text-align: left; background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
  padding: 7px 10px; border-radius: 7px; display: flex; flex-direction: column; gap: 1px; width: 100%;
  transition: background-color .12s ease;
}
.combo:hover { background: var(--hover); }
.combo[aria-current="true"] { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.combo .c1 { font-weight: 550; font-size: var(--t13); display: flex; align-items: center; gap: 7px; min-width: 0; }
.combo .c1t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo .c2 { font-size: var(--t12); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-tag {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 18px; padding: 0 5px;
  font-size: var(--t11); font-weight: 650; letter-spacing: .02em; border-radius: 4px;
  color: var(--text-2); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
.game-tag.g-acevo { color: #e8ecea; background: #2a3035; box-shadow: inset 0 0 0 1px #48525a; }
.game-tag.g-demo { color: var(--muted); }
.game-group + .game-group { margin-top: 6px; }
.game-head {
  width: 100%; display: flex; align-items: center; gap: 7px; padding: 6px 8px; margin-top: 2px;
  background: none; border: 0; border-radius: 6px; cursor: pointer; font: 500 var(--t12) var(--font); color: var(--text-2); text-align: left;
}
.game-head:hover { background: var(--hover); color: var(--text); }
.game-head .ic { color: var(--muted); transition: transform .18s var(--ease); }
.game-head[aria-expanded="true"] .ic { transform: rotate(90deg); }
.game-head .gh-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-head .gh-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.combo-search { padding: 0 16px 8px; }
.sec-label { display: flex; align-items: center; gap: 6px; font-size: var(--t12); font-weight: 600; color: var(--text-2); padding: 12px 10px 5px; }
.sec-label .ic { color: var(--muted); }
.combo-sec { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; margin-bottom: 2px; border-bottom: 1px solid var(--line); }
.combo { position: relative; }
.combo .c1t { flex: 1; min-width: 0; }
.combo .c-best { color: var(--text-2); font-weight: 550; }
/* La combinación que estás viendo: selección neutra (panel-2 + borde interior de 1px), sin verde. */
.combo[aria-current="true"] .c1t { color: var(--text); }
.combo[aria-current="true"] .c2 { color: var(--text-2); }
.combo[aria-current="true"] .c-best { color: var(--text); }
.c-acts { display: flex; gap: 2px; margin-left: auto; opacity: 0; transition: opacity .12s ease; }
.combo:hover .c-acts, .combo:focus-within .c-acts { opacity: 1; }
.combo .c-acts:has(.c-act.on) { opacity: 1; }
.combo .c-acts:has(.c-act.on) .c-act:not(.on) { opacity: 0; }
.combo:hover .c-acts .c-act:not(.on) { opacity: 1; }
.c-act { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; padding: 0; transition: color .12s ease, background-color .12s ease; }
.c-act:hover { background: var(--hover); color: var(--text); }
.c-act:active { transform: scale(.94); }
.c-act.on { color: #f2c94c; }
.c-act.on svg { fill: currentColor; }
.track-group { display: flex; flex-direction: column; gap: 2px; }
.track-head { display: flex; align-items: flex-start; gap: 6px; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); padding: 8px 10px; border-radius: 7px; cursor: pointer; font: inherit; transition: background-color .12s ease; }
.track-head:hover { background: var(--hover); }
.track-head .ic { color: var(--muted); margin-top: 3px; flex: none; transition: transform .18s var(--ease), color .12s ease; }
.track-head[aria-expanded="true"] .ic { transform: rotate(90deg); }
.track-group.here > .track-head .c1t { color: var(--text); }
.track-group.here > .track-head .ic { color: var(--text-2); }
.track-head .th-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.track-head .c1t { font-weight: 600; font-size: var(--t13); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-head .c2 { display: flex; align-items: center; gap: 8px; font-size: var(--t12); color: var(--muted); }
.track-head .th-count { font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 6px; border-radius: 4px; background: var(--panel-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.track-cars { display: flex; flex-direction: column; gap: 2px; padding-left: 10px; border-left: 1px solid var(--line-2); margin-left: 16px; }
.track-group.here .track-cars { border-left-color: #3a4247; }
.arch-head .ic + .ic { margin-left: -2px; }
.combo-search input {
  width: 100%; font: var(--t13) var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 7px; padding: 6px 10px; transition: border-color .15s ease, box-shadow .15s ease;
}
.combo-search input::placeholder { color: var(--muted); }
.combo-search input:hover { border-color: var(--line-strong); }
.combo-search input:focus { outline: none; border-color: rgba(95,216,58,.5); }
.combo-search input::-webkit-search-cancel-button { -webkit-appearance: none; width: 12px; height: 12px; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23838d88' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center/contain no-repeat; }

/* lista de vueltas como tabla */
.lap-list { flex: 1; overflow-y: auto; padding: 0 8px 24px; -webkit-mask-image: linear-gradient(#000 calc(100% - 24px), transparent); mask-image: linear-gradient(#000 calc(100% - 24px), transparent); }
.lap-group { font-size: var(--t11); font-weight: 600; color: var(--muted); padding: 10px 10px 4px; letter-spacing: .01em;
  display: flex; justify-content: space-between; gap: 8px; }
.lap-group .lg-meta { font-weight: 500; color: var(--muted); }
.lap-group:first-child { padding-top: 2px; }
.lap-row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 54px 36px 24px; align-items: center; column-gap: 8px;
  height: 32px; padding: 0 4px 0 10px; border-radius: 6px; cursor: pointer; position: relative;
  transition: background-color .12s ease;
}
.lap-row:hover { background: var(--hover); }
.lap-row[aria-selected="true"] { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.lap-row.best::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--accent); }
.lap-row .ln { font-size: var(--t11); color: var(--muted); text-align: right; }
.lap-row .lt { font-size: var(--t14); font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.lap-row .lt .flag { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.lap-row .lt .flag.ref { background: var(--ref); }
.lap-row .lt .flag.imp { background: var(--warn); }
.lap-row .ld { font-size: var(--t12); text-align: right; }
.lap-row .ld.cut { grid-column: 3 / 5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lap-row .lbar { height: 4px; border-radius: 2px; background: var(--line); position: relative; overflow: hidden; }
.lap-row .lbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--loss); opacity: .8; }
.lap-row.excluded .lt { color: var(--muted); text-decoration: line-through; text-decoration-color: #5a6460; text-decoration-thickness: 1px; font-weight: 500; }
.lap-row.excluded:not([aria-selected="true"]) { opacity: .82; }
.lap-row .more {
  width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border-radius: 5px; color: var(--muted);
  background: none; border: 0; cursor: pointer; opacity: 0; transition: opacity .12s ease, background-color .12s ease;
}
.lap-row:hover .more, .lap-row[aria-selected="true"] .more, .lap-row .more[aria-expanded="true"] { opacity: 1; }
.lap-row .more:hover { background: var(--line-2); color: var(--text); }
.lap-row .more:focus-visible { opacity: 1; }
.lap-menu { position: fixed; z-index: 30; right: auto; width: max-content; min-width: 220px; transform-origin: top left; }
.side-foot { display: flex; gap: 6px; padding: 10px 12px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- zona principal ---------- */
.app { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; border-bottom: 1px solid var(--line); min-height: 60px; position: relative;
}
/* Cargando: una línea fina que recorre el borde inferior de la barra, en vez de apagar la página. */
body.loading .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%); background-size: 40% 100%; background-repeat: no-repeat;
  animation: load-sweep 1.1s var(--ease) infinite; }
@keyframes load-sweep { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.title { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.title h1 { font-size: var(--t16); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title .sub { color: var(--muted); font-size: var(--t13); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#titleGame { align-self: center; }
#titleGame:empty { display: none; }
.top-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.conn { display: flex; align-items: center; gap: 8px; font-size: var(--t12); color: var(--text-2); padding: 0 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4a5450; transition: background-color .2s ease; }
.dot.on { background: var(--accent); box-shadow: 0 0 0 3px rgba(95,216,58,.18); }
.dot.wait { background: var(--warn); }
.live-mini { display: flex; align-items: baseline; gap: 6px; padding-right: 10px; margin-right: 2px; border-right: 1px solid var(--line); }
.lm-label { font-size: var(--t12); color: var(--muted); }
.lm-val { font-size: var(--t14); font-weight: 600; min-width: 64px; }

.tabs { display: flex; align-items: center; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.tab-strip { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tabs [role="tab"] {
  background: none; border: 0; color: var(--muted); font: 500 var(--t13) var(--font); padding: 13px 12px 12px; flex: none; white-space: nowrap;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s ease, border-color .15s ease;
}
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"]:focus-visible { outline-offset: -4px; border-radius: 6px; }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs .ref-pick { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: var(--t12); color: var(--muted); }
.tabs .ref-pick .sw { margin-right: 0; }

main { flex: 1; overflow-y: auto; padding: 24px 24px 32px; display: flex; flex-direction: column; gap: 16px; transition: opacity .2s ease; scrollbar-gutter: stable; }
body.loading main { opacity: .7; }
.tab-panel { display: flex; flex-direction: column; gap: 16px; }
/* Cambio de pestaña: un fundido corto, solo opacidad. */
.tab-panel:not([hidden]) { animation: tab-in .18s ease-out; }
@keyframes tab-in { from { opacity: 0; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; box-shadow: var(--edge); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; flex-wrap: wrap; }
.panel-head h3 { font-size: var(--t13); font-weight: 600; letter-spacing: .005em; }
.legend { display: flex; align-items: center; gap: 14px; font-size: var(--t12); color: var(--muted); flex-wrap: wrap; }
.sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.sw.loss { background: var(--loss); } .sw.gain { background: var(--gain); }
.sw.lap { background: var(--lap); } .sw.ref { background: var(--ref); } .sw.sess { background: var(--sess); }
.dotk { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); margin-right: 6px; vertical-align: middle; }
.dotk.sel { background: var(--accent); }
.dotk.out { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }

/* ---------- cabecera de la vuelta (cifras protagonistas) ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; padding: 0 0 4px; }
.hero h2 { font-size: var(--t28); font-weight: 650; letter-spacing: -.025em; line-height: 1.15; }
.v-lines { list-style: none; padding: 0; margin: 10px 0 0; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; max-width: 72ch; }
.figs { display: flex; align-items: flex-end; gap: 28px; }
.fig { display: flex; flex-direction: column; gap: 4px; }
.fig dt { font-size: var(--t11); font-weight: 500; color: var(--muted); letter-spacing: .01em; }
.fig dd { margin: 0; white-space: nowrap; }
.fig.hero-n dd { font-size: var(--t34); font-weight: 650; letter-spacing: -.025em; line-height: 1; }
.fig.small dd { font-size: var(--t16); font-weight: 600; color: var(--text-2); line-height: 1.2; }
.figs .sep { width: 1px; align-self: stretch; background: var(--line-2); }
.fig-col { display: flex; flex-direction: column; gap: 10px; }
.fig dd.fresh { animation: rise .24s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

.resumen-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.right-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* plan */
.plan { list-style: none; margin: 0; padding: 0 8px 8px; display: flex; flex-direction: column; counter-reset: plan; }
.plan-item {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 0 14px; padding: 16px 10px 14px;
  border-top: 1px solid var(--line); border-radius: 7px; cursor: pointer; transition: background-color .15s ease;
}
.plan-item:first-child { border-top-color: transparent; }
.plan-item:hover { background: var(--hover); }
.plan-item:hover + .plan-item { border-top-color: transparent; }
.plan-n {
  counter-increment: plan; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line-2); font-size: var(--t12); font-weight: 650; color: var(--text-2);
}
.plan-n::before { content: counter(plan); }
.plan-item h4 { font-size: var(--t16); font-weight: 600; }
.plan-item p { margin: 5px 0 0; color: var(--text-2); max-width: 64ch; }
.plan-ev { font-size: var(--t12); color: var(--muted); margin-top: 6px; }
.plan-gain { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.plan-gain b { font-size: var(--t20); font-weight: 650; color: var(--text); letter-spacing: -.01em; line-height: 1.1; }
.plan-gain span { font-size: var(--t12); color: var(--muted); }
.plan-gain .ic { color: var(--muted); margin-top: 6px; transition: transform .16s var(--ease), color .15s ease; }
.plan-item:hover .plan-gain .ic { transform: translateX(2px); color: var(--text); }
.plan-chart { grid-column: 2 / 4; margin-top: 12px; height: 104px; background: var(--well); border: 1px solid var(--line); border-radius: 7px; }
.plan-chart canvas { width: 100%; height: 100%; display: block; }
.plan-empty { color: var(--text-2); padding: 4px 10px 10px; }

.map-wrap { padding: 0 8px 8px; }
#map { width: 100%; height: 320px; display: block; }

/* barras por curva */
.bars { padding: 0 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.bar-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) 58px; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px; border-radius: 5px; transition: background-color .12s ease; }
.bar-row:hover { background: var(--hover); }
.bar-name { font-size: var(--t12); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { position: relative; height: 14px; }
.bar-track::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-2); }
.bar { position: absolute; top: 2px; height: 10px; border-radius: 3px; }
.bar.loss { background: var(--loss); left: 50%; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bar.gain { background: var(--gain); right: 50%; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.bar-val { font-size: var(--t12); text-align: right; }

/* ---------- mapa grande ---------- */
.mapa-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.bigmap-wrap { padding: 0 8px 8px; }
#bigMap { width: 100%; height: max(420px, calc(100vh - 330px)); display: block; }
.map-side { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; }
.map-side .cd-head h3 { font-size: var(--t28); }
.map-side .phase-bar { grid-template-columns: 1fr; gap: 6px; }
.map-side .phase { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 12px; }
.map-side .tips li { grid-template-columns: 62px 1fr; font-size: var(--t13); }
.map-side .metrics td, .map-side .metrics th { padding: 7px 8px; font-size: var(--t12); }
.map-side .ref-c { color: var(--ref-text); }
.ms-nav { display: flex; align-items: center; justify-content: space-between; margin: -4px -6px -6px; }
.ms-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1100px) { .mapa-grid { grid-template-columns: 1fr; } .map-side { position: static; } #bigMap { height: 480px; } }

/* ---------- curvas ---------- */
.curvas-grid { display: grid; grid-template-columns: minmax(300px, .78fr) minmax(0, 1.6fr); gap: 16px; align-items: start; }
.corner-table-panel { position: sticky; top: 0; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t13); }
.table th { text-align: left; font-weight: 500; font-size: var(--t12); color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:focus-visible { outline: none; }
.table tbody tr:focus-visible td { box-shadow: inset 0 0 0 1px rgba(95,216,58,.55); }
/* Sin curvas aún: no se enseña una cabecera de tabla vacía. */
.corner-table:has(tbody:empty) thead, .corner-table:has(.no-ref) thead { display: none; }
/* Móvil: la tabla de curvas cabe entera (antes se cortaba la columna Margen). */
@media (max-width: 600px) {
  .corner-table th, .corner-table td { padding-inline: 8px !important; }
  .corner-table th:first-child, .corner-table td:first-child { padding-left: 16px !important; }
  .corner-table th:last-child, .corner-table td:last-child { padding-right: 16px !important; }
  .corner-table th:nth-child(3) { white-space: normal; }
  .corner-table .phases-mini { width: 72px; }
}
.corner-detail:has(> .cd-empty) { min-height: 160px; justify-content: center; align-items: center; }
.corner-detail > .cd-empty { margin: 0; }
.corner-table tbody tr { cursor: pointer; }
.corner-table tbody tr td { transition: background-color .12s ease; }
.corner-table tbody tr:hover td { background: var(--hover); }
.corner-table tbody tr[aria-selected="true"] td { background: var(--panel-2); }
.corner-table tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.cname { font-weight: 600; }
/* Modo enfoque y guía del circuito */
.focus-tag { display: inline-flex; vertical-align: -2px; margin-left: 6px; color: var(--accent); }
.btn.focus-btn[aria-pressed="true"] { color: var(--accent); border-color: rgba(95,216,58,.45); background: var(--accent-soft); }
.plan-focus { margin-top: 10px; }
.guide-panel { margin-top: 24px; }
.guide-panel .panel-head { flex-wrap: wrap; row-gap: 4px; }
.guide-table tbody tr { cursor: pointer; }
.guide-table tbody tr:hover td { background: var(--hover); }
.guide-table th.you, .guide-table td.you { color: var(--text-2); }
.guide-table td.you.pos { color: var(--loss); } .guide-table td.you.neg { color: var(--gain); }
.guide-table tr.gh th { font-size: var(--t12); color: var(--text-2); border-bottom: 0; padding-bottom: 0; }
.guide-table th:nth-child(5), .guide-table td:nth-child(5) { border-left: 1px solid var(--line); }
.guide-table tr.gh th:nth-child(3) { border-left: 1px solid var(--line); }
.guide-panel.no-you .you { display: none; }
.phases-mini { display: flex; gap: 2px; height: 8px; width: 110px; }
.phases-mini span { flex: 1; border-radius: 2px; background: var(--line-2); }

.corner-detail { padding: 20px 20px 20px; display: flex; flex-direction: column; gap: 20px; }
.cd-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.cd-head h3 { font-size: var(--t28); letter-spacing: -.025em; line-height: 1; }
.cd-delta { font-size: var(--t20); font-weight: 650; }
.cd-head .spacer { flex: 1; }
.cd-head .btn { align-self: center; }
.phase-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.phase { border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; background: var(--well); }
.phase .pl { font-size: var(--t12); color: var(--muted); }
.phase .pv { font-size: var(--t16); font-weight: 600; margin-top: 2px; }
.phase.worst { border-color: rgba(236,91,91,.5); background: linear-gradient(rgba(236,91,91,.06), rgba(236,91,91,.06)), var(--well); }
.tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tips li { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: baseline; }
.tip-phase { font-size: var(--t11); font-weight: 600; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line-2); padding: 2px 8px; border-radius: 999px; text-align: center; }
.tip-detail { display: block; margin-top: 3px; font-size: var(--t13); color: var(--muted); }
.pattern-line { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: baseline; margin: 0; padding: 12px 16px 16px; border-top: 1px solid var(--line); font-size: var(--t13); color: var(--text-2); }
.pattern-line .tip-phase { white-space: nowrap; }
.pattern-types { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 16px 14px; }
.pattern-types b { font-weight: 600; color: var(--text-2); margin-right: 4px; }
.tips li.good .tip-phase { color: #86efac; border-color: rgba(74,222,128,.4); }
/* la primera indicación de la curva es la principal; las demás, secundarias */
.tips li.sec { font-size: var(--t13); color: var(--text-2); }
.tips li.sec .tip-phase { opacity: .75; }
/* lo que te funciona y seguimiento de consejos */
.brain { display: flex; flex-direction: column; gap: 12px; }
.brain-follow { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: baseline; }
.brain-follow.good .tip-phase { color: #86efac; border-color: rgba(74,222,128,.4); }
.brain-follow.todo .tip-phase { color: var(--muted); }
.brain-personal { border: 1px solid var(--line); border-radius: 7px; background: var(--well); padding: 12px 14px; }
.brain-personal p { margin: 0; color: var(--text); max-width: 72ch; }
.plan-brain { font-size: var(--t13); color: var(--text-2); margin-top: 6px; max-width: 64ch; padding-left: 10px; border-left: 2px solid var(--line-2); }
.plan-brain.good { border-left-color: var(--gain); }

/* recomendaciones: tarjetas compactas separadas por líneas de 1px, como el plan */
.rec-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rec-grid.one { grid-template-columns: minmax(0, 1fr); }
.rec-list { list-style: none; margin: 0; padding: 0 16px 6px; display: flex; flex-direction: column; }
.rec-card { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 0 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.rec-card:first-child { border-top: 0; padding-top: 4px; }
.rec-card.flat { grid-template-columns: minmax(0, 1fr); }
.rec-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); font-size: var(--t12); font-weight: 650; color: var(--text-2); }
.rec-body { min-width: 0; }
.rec-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; min-height: 26px; }
.rec-head .tip-phase { white-space: nowrap; }
.rec-card h4 { font-size: var(--t14); font-weight: 600; margin-top: 6px; }
.rec-text { margin: 4px 0 0; color: var(--text-2); max-width: 68ch; }
.rec-detail { margin: 4px 0 0; font-size: var(--t13); color: var(--muted); max-width: 68ch; }
.rec-ev { margin: 6px 0 0; font-size: var(--t12); color: var(--muted); max-width: 72ch; }
.rec-conf { font-size: var(--t12); color: var(--muted); }
.gain-pill { font-size: var(--t12); font-weight: 600; color: var(--loss); background: rgba(236, 91, 91, .12); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.gain-pill .u { color: inherit; opacity: .8; }
.rec-brain { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.rec-follow { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: baseline; font-size: var(--t13); color: var(--text-2); }
.rec-follow .tip-phase { white-space: nowrap; }
.rec-follow.good .tip-phase { color: #86efac; border-color: rgba(74, 222, 128, .4); }
.rec-follow.todo .tip-phase { color: var(--muted); }
.plan-cmp { margin-top: 8px; }
.rec-cmp { white-space: normal; flex-wrap: wrap; max-width: 100%; text-align: left; line-height: 1.35; }
.rec-cmp span + span { margin-left: 4px; }
.rec-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rec-go .ic { color: var(--muted); }
.rec-sec { border-top: 1px solid var(--line); }
.rec-sub { font-size: var(--t13); font-weight: 600; padding: 14px 16px 8px; }
.rec-sub .muted { font-weight: 400; }
.rec-rows { list-style: none; margin: 0; padding: 0 16px 12px; display: flex; flex-direction: column; }
.rec-rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.rec-rows li:first-child { border-top: 0; }
.rec-rows .rec-follow { flex: 1; min-width: 0; }
.rec-rows .rec-go { flex-shrink: 0; }
.rec-lead { margin: 0; padding: 0 16px 10px; font-size: var(--t13); color: var(--muted); max-width: 72ch; }
.rec-empty { margin: 0; padding: 0 16px 16px; color: var(--text-2); max-width: 72ch; }
.rec-refdiff { padding: 12px 16px 14px; }
.rec-refdiff p { margin: 0 0 8px; font-size: var(--t13); color: var(--text-2); max-width: 72ch; }
.rec-refdiff .table td, .rec-refdiff .table th { padding-left: 0; }
@media (max-width: 1280px) { .rec-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
  .rec-list, .rec-rows { padding-left: 12px; padding-right: 12px; }
  .rec-card { grid-template-columns: 26px minmax(0, 1fr); gap: 0 10px; }
  .rec-follow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .rec-follow .tip-phase { justify-self: start; }
  .rec-rows li { flex-direction: column; align-items: flex-start; gap: 8px; }
}
.metrics td:first-child { color: var(--text-2); }
.metrics td.diff { font-weight: 600; white-space: nowrap; }
.metrics td.diff.flat { color: var(--text-2); font-weight: 500; }
.metrics .dw { display: block; font-size: var(--t11); font-weight: 500; line-height: 1.2; }
.metrics tr.grp td { padding: 14px 12px 6px; font-size: var(--t12); font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.metrics tr.grp:first-child td { padding-top: 6px; }
.more-rows { margin-top: 8px; }
.more-rows > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 8px; margin-left: -8px; border-radius: 6px;
  cursor: pointer; font-size: var(--t13); font-weight: 500; color: var(--text-2); list-style: none; }
.more-rows > summary::-webkit-details-marker { display: none; }
.more-rows > summary:hover { background: var(--hover); color: var(--text); }
.more-rows > summary .ic { color: var(--muted); transition: transform .18s var(--ease); }
.more-rows[open] > summary .ic { transform: rotate(90deg); }
.more-rows > .table, .more-rows > .tbl-wrap { margin-top: 6px; }
.tbl-wrap { overflow-x: auto; }
.metrics td .muted0 { color: var(--muted); font-weight: 500; }
.cd-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cd-chart { position: relative; height: 140px; border: 1px solid var(--line); border-radius: 7px; background: var(--well); }
.cd-chart canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.cd-session { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; color: var(--text-2); }
.section-label { font-size: var(--t12); font-weight: 600; color: var(--muted); margin-bottom: 8px; }

/* ---------- gráficas ---------- */
.chart-title { position: absolute; left: 50px; top: 6px; font-size: var(--t11); font-weight: 500; color: var(--muted); pointer-events: none; z-index: 1; letter-spacing: .01em; }

/* ---------- telemetría ---------- */
.tele-grid { display: grid; grid-template-columns: minmax(0, 1fr) 272px; align-items: start; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
/* Las gráficas viven directamente en el panel: sin pozo propio, separadas por líneas de 1px. */
.charts { display: flex; flex-direction: column; padding: 4px 4px 8px 0; }
.chart { position: relative; height: 112px; padding-top: 8px; border-top: 1px solid var(--line); }
.chart:first-child { border-top: 0; }
.chart.tall { height: 196px; }
.chart.short { height: 98px; }
.chart canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.chart .chart-title { top: 10px; font-size: var(--t14); font-weight: 600; line-height: 1.2; color: var(--text-2); letter-spacing: 0; }
[data-panel="telemetria"] .panel-head { padding-bottom: 12px; }
[data-panel="telemetria"] .panel-head h3 { font-size: var(--t20); letter-spacing: -.015em; }
.tele-side { display: flex; flex-direction: column; position: sticky; top: 0; border-left: 1px solid var(--line); padding: 12px 16px; }
.tele-corners { padding: 10px 0 0; margin: 0 -8px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.tele-corners button { background: none; border: 0; color: var(--text-2); font: 500 var(--t12) var(--font); text-align: left; padding: 6px 8px; border-radius: 5px; cursor: pointer; display: flex; justify-content: space-between; gap: 6px; transition: background-color .12s ease; }
.tele-corners button:hover { background: var(--hover); color: var(--text); }
.tele-corners button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
#miniMap { width: 100%; height: 220px; display: block; margin-bottom: 10px; }
.readout { padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: var(--t12); display: grid; grid-template-columns: 1fr auto auto; gap: 5px 12px; align-content: start; min-height: 150px; }
.readout .rh { color: var(--muted); font-size: var(--t12); }
.readout .rl { color: var(--text-2); }
.readout .rv { text-align: right; font-weight: 600; }
.readout .rv.ref { color: var(--ref-text); font-weight: 500; }
.hint { color: var(--muted); font-size: var(--t12); padding: 0 16px 14px; margin: 0; }
[data-panel="telemetria"] .hint { padding-top: 12px; }

/* ---------- sesión ---------- */
.sesion-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.session-chart-wrap { padding: 0 12px 4px; }
#sessionChart { width: 100%; height: 260px; display: block; }
/* Sesión: la gráfica crece hasta la altura de la columna de al lado (sin hueco vacío debajo). */
[data-panel="sesion"] .sesion-grid { align-items: stretch; }
[data-panel="sesion"] .sesion-grid > .right-col:first-child > .panel:first-child { flex: 1; display: flex; flex-direction: column; }
[data-panel="sesion"] .session-chart-wrap { flex: 1; min-height: 264px; position: relative; }
[data-panel="sesion"] #sessionChart { position: absolute; inset: 0 12px 4px; width: calc(100% - 24px); height: calc(100% - 4px); }
.notes { list-style: none; margin: 0; padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.notes li { padding-left: 16px; position: relative; max-width: 72ch; }
.notes li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.notes.lead { padding-top: 0; }
.notes.lead li::before { background: var(--text-2); }
.consistency { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.cons-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) 64px; align-items: center; gap: 10px; font-size: var(--t12); }
.cons-track { position: relative; height: 8px; background: var(--well); border-radius: 3px; }
.cons-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--sess); opacity: .55; }
.cons-fill.top { background: var(--loss); opacity: 1; }
.heat-wrap { overflow-x: auto; padding: 0 4px 8px; }
.heat { font-size: var(--t12); }
.heat th, .heat td { padding: 6px 8px; text-align: right; white-space: nowrap; }
.heat th:first-child, .heat td:first-child { text-align: left; position: sticky; left: 0; background: var(--panel); }
.heat tbody tr { cursor: pointer; }
.heat tbody tr:hover td:first-child { color: var(--text); }
.heat tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.heat td.cell { border-left: 2px solid var(--panel); color: var(--text); }
.heat tr.out td { color: var(--muted); }
.heat tr.out td.cell { background: transparent !important; }

/* ---------- estilo ---------- */
.estilo-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.style-table td, .style-table th { vertical-align: middle; }
.style-table .metric { font-weight: 550; }
.style-table .sv { font-weight: 600; white-space: nowrap; }
.style-table .sv.flat { color: var(--text-2); }
.style-table .dw { display: block; font-size: var(--t11); font-weight: 500; line-height: 1.2; }
.style-more > summary { margin: 4px 16px 14px; }
.style-more .style-table { border-top: 1px solid var(--line); }
.style-table .metric small { display: block; color: var(--muted); font-weight: 400; font-size: var(--t12); margin-top: 2px; max-width: 52ch; }
.dotplot { width: 100%; min-width: 200px; position: relative; height: 22px; }
.style-table td:last-child { width: 32%; padding-right: 24px; }
.dotplot .track { position: absolute; left: 0; right: 0; top: 10px; height: 2px; border-radius: 1px; background: var(--line-2); }
.dotplot .d { position: absolute; top: 11px; transform: translate(-50%, -50%); }
.dotplot .d.lap { width: 10px; height: 10px; border-radius: 50%; background: var(--lap); box-shadow: 0 0 0 2px var(--panel); z-index: 2; }
.dotplot .d.ref { width: 2px; height: 14px; border-radius: 1px; background: var(--ref); }
.dotplot .d.sess { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--sess); }
.legend .dk { display: inline-block; vertical-align: middle; margin-right: 6px; }
.legend .dk.lap { width: 9px; height: 9px; border-radius: 50%; background: var(--lap); }
.legend .dk.ref { width: 2px; height: 11px; background: var(--ref); border-radius: 1px; }
.legend .dk.sess { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--sess); }

/* ---------- vacío, avisos ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 72px 20px 40px; max-width: 560px; margin: 0 auto; }
.empty > img { width: 96px; height: 96px; padding: 14px; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), var(--edge); }
.empty h2 { font-size: var(--t28); margin: 22px 0 10px; letter-spacing: -.02em; text-wrap: balance; }
.empty p { color: var(--text-2); margin: 0 0 8px; text-wrap: pretty; }
.empty .btn { margin-top: 14px; }
.plan-empty, .rec-empty { text-wrap: pretty; }
.log { padding: 4px 6px 6px; font-size: var(--t12); color: var(--muted); max-height: 160px; overflow-y: auto; white-space: pre-wrap; }
.tooltip {
  position: fixed; z-index: 40; pointer-events: none; background: var(--hover); border: 1px solid var(--pop-line); color: var(--text);
  border-radius: 7px; padding: 8px 10px; font-size: var(--t12); box-shadow: 0 8px 24px rgba(0,0,0,.45); max-width: 260px;
}
.tooltip b { font-weight: 600; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: var(--hover); border: 1px solid var(--pop-line); padding: 10px 16px; border-radius: 8px; font-size: var(--t13); max-width: min(560px, calc(100vw - 32px)); text-wrap: pretty;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: toast .2s var(--ease);
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 6px); } }

/* ---------- sectores ---------- */
.sectors { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.sectors > .sec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--edge); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; position: relative; }
.sectors > .sec .sn { font-size: var(--t12); color: var(--muted); font-weight: 600; }
.sectors > .sec .st { font-size: var(--t16); font-weight: 600; }
.sectors > .sec .sd { font-size: var(--t12); margin-left: auto; }
.sectors > .sec.best::after { content: "mejor de la sesión"; position: absolute; right: 12px; top: -8px; font-size: var(--t11); color: var(--accent); background: var(--bg); padding: 0 6px; border-radius: 4px; }

/* ---------- neumáticos y coche ---------- */
.car-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; padding: 0 16px 8px; align-items: start; }
.tyres { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: relative; }
.tyre { background: var(--well); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.tyre .tw { font-size: var(--t11); color: var(--muted); }
.tyre .tt { font-size: var(--t20); font-weight: 650; letter-spacing: -.01em; line-height: 1.1; }
.tyre .tp { font-size: var(--t12); color: var(--text-2); }
.tyre .band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 3px; }
.tyre .band i { height: 6px; border-radius: 2px; }
.tyre .bt { font-size: var(--t11); color: var(--muted); }
.cond td, .cond th { padding: 6px 8px; font-size: var(--t12); }
.cond td:first-child { color: var(--text-2); }
.warn-t { color: var(--warn); }

/* ---------- móvil o tablet ---------- */
.qr-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 18px; }
.qr { background: #fff; border-radius: 12px; padding: 10px; width: 196px; height: 196px; display: grid; place-items: center; }
.qr svg, .qr img { width: 176px; height: 176px; display: block; image-rendering: pixelated; }
@media (max-width: 560px) { .qr-row { grid-template-columns: 1fr; justify-items: center; } }

/* ---------- progreso ---------- */
.prog-figs { display: flex; flex-wrap: wrap; gap: 28px 40px; margin: 0; align-items: flex-end; }
.prog-figs .fig dd { font-size: var(--t28); font-weight: 650; letter-spacing: -.02em; line-height: 1.05; }
.prog-figs .fig.sm dd { font-size: var(--t20); color: var(--text-2); }
.prog-figs .fig small { display: block; font-size: var(--t12); color: var(--muted); margin-top: 4px; font-weight: 400; letter-spacing: 0; }
.target-edit { display: flex; gap: 6px; align-items: center; }
.target-edit input { width: 120px; height: 32px; font: 600 var(--t20) var(--font); font-variant-numeric: tabular-nums; color: var(--text); background: var(--well); border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; transition: border-color .15s ease, box-shadow .15s ease; }
.target-edit input:hover { border-color: var(--line-strong); }
.target-edit input:focus { outline: none; border-color: rgba(95,216,58,.55); }
#progChart { width: 100%; height: 260px; display: block; }
#progSessions tbody tr, #progCorners tbody tr { cursor: pointer; }
#progSessions tbody tr:hover td, #progCorners tbody tr:hover td { background: var(--hover); }
.voice-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; font-size: var(--t13); color: var(--text-2); }

/* ---------- trazada ---------- */
.line-wrap { display: grid; grid-template-columns: 1fr; gap: 10px; }
.line-map { position: relative; height: clamp(300px, 42vh, 460px); border: 1px solid var(--line); border-radius: 7px; background: var(--well); }
.line-map canvas { width: 100%; height: 100%; display: block; }
.line-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.line-stat { border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; background: var(--well); }
.line-stat .pl { font-size: var(--t12); color: var(--muted); }
.line-stat .pv { font-size: var(--t16); font-weight: 600; margin-top: 2px; }
.line-stat .pv small { font-size: var(--t12); font-weight: 400; color: var(--text-2); margin-left: 4px; }

/* ---------- diálogos: bienvenida y ajustes ---------- */
.dlg {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; padding: 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,.55), var(--edge);
}
.dlg.wide { width: min(640px, calc(100vw - 32px)); }
.dlg[open] { animation: dlg-in .2s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: scale(.97) translateY(4px); } }
.dlg::backdrop { background: rgba(6, 8, 9, .66); backdrop-filter: blur(2px); }
.dlg h2 { font-size: var(--t20); letter-spacing: -.015em; margin: 14px 0 8px; }
.dlg p { color: var(--text-2); margin: 0 0 18px; max-width: 60ch; text-wrap: pretty; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.dlg-head h2 { margin: 0; }
/* Diálogos largos (Ajustes): la cabecera con el título y el cierre se queda arriba al hacer scroll. */
.dlg:has(> .dlg-head) { padding-top: 0; }
.dlg > .dlg-head { position: sticky; top: 0; z-index: 2; padding: 22px 0 12px; margin: 0 0 2px; background: var(--panel); border-radius: 12px 12px 0 0; }
.dlg > .dlg-head::after { content: ""; position: absolute; left: -28px; right: -28px; bottom: 0; height: 1px; background: var(--line); opacity: 0; }
@supports (animation-timeline: scroll()) {
  .dlg > .dlg-head::after { animation: head-line linear both; animation-timeline: scroll(); animation-range: 0 32px; }
  @keyframes head-line { to { opacity: 1; } }
}
.dlg::-webkit-scrollbar-track { margin: 12px 0; }
.dlg-steps { display: flex; gap: 6px; }
.dlg-steps i { width: 18px; height: 3px; border-radius: 2px; background: var(--line-2); transition: background-color .2s ease; }
.dlg-steps i.on { background: var(--accent); }
.dlg-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 24px; }
.dlg-foot .gap { flex: 1; }
.w-step > img { display: block; margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: var(--t13); font-weight: 550; }
.field em { font-style: normal; color: var(--muted); font-weight: 400; }
.field small { color: var(--muted); font-size: var(--t12); }
.field input, .field textarea {
  font: var(--t14) var(--font); color: var(--text); background: var(--well); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 9px 12px; transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:hover, .field textarea:hover { border-color: var(--line-strong); }
.field input:focus, .field textarea:focus { outline: none; border-color: rgba(95,216,58,.55); }
.field textarea { resize: vertical; min-height: 92px; line-height: 1.45; }
.how { margin: 0; padding: 0; list-style: none; counter-reset: how; display: flex; flex-direction: column; gap: 12px; }
.how li { counter-increment: how; display: grid; grid-template-columns: 26px 1fr; gap: 12px; color: var(--text-2); }
.how li::before { content: counter(how); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); font-size: var(--t12); font-weight: 650; color: var(--text-2); }
.how b { color: var(--text); font-weight: 600; }
.toggles { display: flex; flex-direction: column; gap: 2px; margin-top: 18px; }
.set-group .toggles { margin-top: 0; }
.toggle { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; padding: 10px 10px; margin: 0 -10px; border-radius: 8px; cursor: pointer; transition: background-color .12s ease; }
.toggle:hover { background: var(--hover); }
.toggle b { font-weight: 550; font-size: var(--t14); display: block; }
.toggle small { display: block; color: var(--muted); font-size: var(--t12); margin-top: 2px; }
.tg {
  appearance: none; margin: 2px 0 0; width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer;
  transition: background-color .18s ease;
}
.tg::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #cfd5d2; box-shadow: 0 1px 2px rgba(0,0,0,.35); transition: transform .18s var(--ease), background-color .18s ease; }
.tg:checked { background: var(--accent); }
.tg:checked::after { transform: translateX(14px); background: #fff; }
.toggle:hover .tg:not(:checked) { background: var(--line-strong); }
.tg:focus-visible, .switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tg:active::after { width: 19px; }
.tg:checked:active::after { transform: translateX(11px); }
.set-group { border-top: 1px solid var(--line); padding: 18px 0 6px; margin-top: 18px; }
.set-group:first-of-type { margin-top: 14px; }
.set-group h3 { font-size: var(--t12); font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.checks { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--well); }
.checks li { display: grid; grid-template-columns: 10px 1fr; gap: 4px 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.checks .cdot { width: 8px; height: 8px; border-radius: 50%; background: #4a5450; margin-top: 7px; }
.checks .cdot.ok { background: var(--accent); box-shadow: 0 0 0 3px rgba(95,216,58,.18); }
.checks .cdot.paused, .checks .cdot.memory { background: var(--warn); }
.checks .cdot.open { background: var(--loss); }
.checks .cn { font-weight: 550; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.checks .cs { color: var(--text-2); font-weight: 400; font-size: var(--t13); }
.checks .cs.ok { color: var(--accent); }
.checks .ch { grid-column: 2; color: var(--muted); font-size: var(--t12); max-width: 64ch; }
/* ---------- Ajustes: secciones a la izquierda, filas «qué es · control» a la derecha ---------- */
.dlg.settings {
  width: min(880px, calc(100vw - 32px)); height: min(640px, calc(100vh - 48px)); max-height: none;
  padding: 0; overflow: hidden; grid-template-columns: 208px minmax(0, 1fr);
}
/* Solo abierta: un display propio en un <dialog> gana a «dialog:not([open]) { display: none }» y lo deja pintado
   debajo de la app (con Tab el foco entraba en él y la app subía). */
.dlg.settings[open] { display: grid; }
dialog:not([open]) { display: none !important; }
.set-nav { display: flex; flex-direction: column; gap: 2px; padding: 22px 12px; background: var(--well); border-right: 1px solid var(--line); border-radius: 12px 0 0 12px; }
.set-nav h2 { font-size: var(--t16); margin: 0 10px 14px; }
.set-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: none;
  font: 500 var(--t13) var(--font); color: var(--text-2); text-align: left; cursor: pointer; transition: background-color .12s ease, color .12s ease;
}
.set-nav button svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.set-nav button:hover { background: var(--hover); color: var(--text); }
.set-nav button[aria-current="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.set-nav button[aria-current="true"] svg { opacity: 1; color: var(--accent); }
.set-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.set-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.set-top { display: flex; align-items: center; gap: 12px; padding: 16px 20px 14px 32px; border-bottom: 1px solid var(--line); }
.set-top h3 { font-size: var(--t16); font-weight: 600; margin: 0; flex: 1; }
.set-saved { font-size: var(--t12); color: var(--muted); opacity: 0; transition: opacity .2s ease; }
.set-saved.on { opacity: 1; }
.set-saved.err { color: var(--loss); }
.set-body:focus { outline: none; }
.set-body { flex: 1; overflow-y: auto; padding: 8px 32px 28px; overscroll-behavior: contain; }
.set-sec[hidden] { display: none; }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 28px; padding: 16px 0; border-top: 1px solid var(--line); }
.set-sec > .srow:first-child { border-top: 0; }
.srow.stack { grid-template-columns: minmax(0, 1fr); }
.srow .sl { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.srow .sl > b, .srow .sl > label { font-weight: 550; font-size: var(--t14); color: var(--text); }
.srow .sl small { color: var(--muted); font-size: var(--t12); line-height: 1.45; max-width: 58ch; }
.srow .select { width: 270px; max-width: 100%; font-size: var(--t13); padding: 8px 30px 8px 12px; }
.srow > .btn { justify-self: end; }
.toggle-row { cursor: pointer; }
.toggle-row .tg { justify-self: end; }
.input {
  width: 100%; font: var(--t14) var(--font); color: var(--text); background: var(--well); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 9px 12px; transition: border-color .15s ease;
}
.input::placeholder { color: var(--muted); }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: rgba(95,216,58,.55); }
.voice-deps { transition: opacity .2s ease; }
.set-h { font-size: var(--t14); font-weight: 650; color: var(--text); margin: 0; padding: 26px 0 0; border-top: 1px solid var(--line); }
.set-h + .srow, .set-h + .set-intro + .srow { border-top: 0; }
.set-h + .set-intro { margin: 6px 0 0 !important; }
.voice-deps.off { opacity: .45; }
.set-intro { color: var(--text-2); margin: 14px 0 14px !important; font-size: var(--t13); }
.set-sec[data-sec="juegos"] .checks { margin-bottom: 8px; }
.set-version { margin: 18px 0 0 !important; color: var(--muted) !important; font-size: var(--t12); }
@media (max-width: 720px) {
  .dlg.settings { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: calc(100vh - 32px); }
  .set-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; padding: 10px; gap: 4px; }
  .set-nav h2 { display: none; }
  .set-nav button { width: auto; white-space: nowrap; }
  .set-top { padding-left: 20px; }
  .set-body { padding: 4px 20px 20px; }
  .srow { grid-template-columns: minmax(0, 1fr); }
  .srow > .btn, .toggle-row .tg { justify-self: start; }
  .toggle-row { grid-template-columns: minmax(0, 1fr) auto; }
  .toggle-row .tg { justify-self: end; }
}
.folder-row { display: flex; align-items: center; gap: 10px; }
.folder-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--t12) ui-monospace, Consolas, monospace; color: var(--text-2); background: var(--well); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; }

@media (min-width: 1680px) {
  .estilo-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
  #map { height: 360px; }
}
@media (max-width: 1360px) {
  .hero { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 1500px) { .car-body { grid-template-columns: 1fr; } }
@media (max-width: 1280px) {
  .resumen-grid, .sesion-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .line-stats { grid-template-columns: 1fr; }
  .curvas-grid { grid-template-columns: 1fr; }
  .corner-table-panel { position: static; }
  .tele-grid { grid-template-columns: 1fr; }
  .tele-side { position: static; border-left: 0; border-top: 1px solid var(--line); }
  .cd-charts { grid-template-columns: 1fr; }
  .live-mini { display: none; }
}
@media (max-width: 820px) {
  .top-right { flex-shrink: 0; flex-wrap: nowrap; }
  .conn { padding: 0; }
  .brand { padding: 20px 16px 16px; }
  .style-table { display: block; overflow-x: auto; }
  .style-table .dotplot { min-width: 140px; }
  .side-block.combos-block { max-height: 220px; }
  .lap-list { max-height: 260px; }
  body { flex-direction: column; overflow: auto; }
  /* Primero el análisis; la barra lateral (circuitos y vueltas) queda debajo. */
  .app { order: 0; }
  .sidebar { width: 100%; max-height: none; order: 1; border-right: 0; border-top: 1px solid var(--line); }
  .title { flex-wrap: wrap; row-gap: 2px; }
  .title h1, .title .sub { white-space: normal; }
  .lap-list { max-height: 300px; }
  .topbar { flex-wrap: wrap; padding: 12px 16px; }
  main { padding: 16px; overflow: visible; }
  .tabs { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
  .tab-strip { overflow-x: auto; flex-wrap: nowrap; padding: 0 8px; scrollbar-width: none; }
  .tab-strip::-webkit-scrollbar { display: none; }
  .tabs .ref-pick { margin-left: 0; padding: 8px 16px 10px; border-top: 1px solid var(--line); }
  .tabs .ref-pick .select { flex: 1; min-width: 0; max-width: none; }
  .corner-detail { padding: 16px 14px; }
  #cornerDetail .metrics th, #cornerDetail .metrics td { padding: 8px 6px; }
  #cornerDetail .metrics th { white-space: normal; }
  #cornerDetail .metrics td:first-child { padding-left: 0; }
  .figs { flex-wrap: wrap; gap: 18px; }
  .fig.hero-n dd { font-size: var(--t28); }
  .plan-item { grid-template-columns: 28px minmax(0, 1fr); }
  .plan-gain { grid-column: 2; align-items: flex-start; flex-direction: row; gap: 8px; margin-top: 6px; }
  .plan-chart { grid-column: 1 / -1; }
}
/* Táctil: lo que se toca mide al menos 32–40px y no depende del hover. */
@media (hover: none) {
  .lap-row .more { opacity: 1; width: 32px; height: 32px; }
  .lap-row { grid-template-columns: 20px minmax(0, 1fr) 54px 36px 32px; height: 40px; }
  .c-acts { opacity: 1; }
  .c-act { width: 30px; height: 30px; }
  .map-zoom button { width: 38px; height: 38px; }
  .tabs [role="tab"] { padding-block: 14px 13px; }
  .bar-row { padding-block: 7px; }
  .tele-corners button { padding-block: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Pantallas medianas y móvil: la barra de arriba no corta el nombre del circuito ni se parte en tres filas. */
@media (max-width: 1320px) {
  .top-right > a.btn, .top-right > #btnDemo { font-size: 0; gap: 0; padding-inline: 9px; }
  .top-right > a.btn svg, .top-right > #btnDemo svg { margin: 0; }
  #connText { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .conn { padding: 0 4px; }
  .tabs [role="tab"] { padding-inline: 9px; }
  .tabs .ref-pick label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tabs .ref-pick .select { max-width: 190px; }
}

/* Telemetría: la diferencia acumulada es la gráfica que más importa; el cuadro de lectura no ocupa sitio vacío. */
.chart.delta { height: 160px; }
.readout.idle { min-height: 0; }

/* Zoom de los mapas: rueda o pellizco para acercar, arrastrar para mover, doble clic para volver. */
.map-zoom { position: absolute; top: 10px; right: 16px; display: flex; align-items: center; gap: 4px; z-index: 2; }
.map-zoom button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(15,18,20,.88);
  color: var(--text); font: 600 16px/1 var(--font); cursor: pointer; display: grid; place-items: center;
  transition: background-color .15s ease, border-color .15s ease, transform .12s ease; }
.map-zoom button:hover:not(:disabled) { background: var(--panel-2); border-color: var(--line-strong); }
.map-zoom button:active:not(:disabled) { transform: scale(.94); }
.map-zoom button:disabled { opacity: .35; cursor: default; }
.map-zoom .mz-k { font-size: var(--t12); color: var(--muted); min-width: 30px; }
canvas#bigMap, canvas#map, canvas#lineMap { touch-action: none; }
/* Circuitos de un solo coche alineados con el nombre de los que se despliegan. */
.game-group > .combo { padding-left: 29px; }

.r-help { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--well); font-size: var(--t13); }
/* Fuera del flujo del hover: en pantallas sin ratón los chevrons del plan se ven siempre. */
.plan-item:focus-visible { outline-offset: -2px; }
.sec .st, .sec .sd, .tyre .tt, .tyre .tp, .phase .pv, .line-stat .pv, .cd-delta, .lm-val, .bar-val, .cons-row, .readout, .plan-gain b { font-variant-numeric: tabular-nums; }
#rSeen .cdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--warn); vertical-align: 1px; }
#rSeen .cdot.ok { background: var(--accent); }

/* =====================================================================
   Piel v2 — lenguaje visual de las maquetas: letra más grande, un solo
   nivel de tarjeta, bloques con fondo en vez de bordes, color con intención.
   Sin barra lateral: circuito y coche en un selector (Ctrl K) y las vueltas
   en un panel desplegable con flechas ‹ › en la cabecera.
   ===================================================================== */
body { font-size: 15px; line-height: 1.55; display: block; }
.app { height: 100%; }
h1, h2, h3, h4 { letter-spacing: -.015em; }

/* botones, selects, interruptores */
.btn { border-radius: 10px; padding: 10px 16px; font-size: var(--t13); font-weight: 600; gap: 8px; }
.btn.sm { padding: 8px 12px; font-size: var(--t13); }
.btn.xs { padding: 6px 10px; font-size: var(--t12); border-radius: 8px; }
.btn.icon { padding: 8px; }
.btn.ghost { border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--line-2); }
.select { border-radius: 10px; background-color: var(--panel-2); border-color: var(--line); padding: 8px 32px 8px 12px; font-size: var(--t13); }
.select.sm { font-size: var(--t13); padding: 6px 28px 6px 10px; max-width: 220px; border-radius: 8px; }
.switch { font-size: var(--t13); color: var(--text-2); gap: 10px; }
.switch input { width: 32px; height: 18px; }
.switch input::after { width: 14px; height: 14px; }
.switch input:checked::after { transform: translateX(14px); }
.kbd { font: 700 11px/1 var(--font); color: var(--muted); background: var(--hover); border-radius: 5px; padding: 4px 6px; letter-spacing: .02em; }

/* ---------- cabecera ---------- */
.topbar { padding: 14px 32px; gap: 16px; justify-content: flex-start; border-bottom: 1px solid var(--panel-2); min-height: 68px; }
.topbar .brand { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 0; text-decoration: none; color: var(--text); flex: none; }
.topbar .brand-wm { width: 132px; max-width: none; height: auto; }
.topbar .brand-mark { display: none; width: 28px; height: 28px; }
.topbar .brand-text { display: flex; flex-direction: column; line-height: 1.15; padding-left: 12px; border-left: 1px solid var(--line-2); }
.topbar .brand-name { font-weight: 800; font-size: 16px; }
.topbar .brand-sub { font-size: var(--t11); color: var(--muted); }
.top-gap { flex: 1 1 auto; }
.pick-btn {
  display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 520px; flex: 0 1 auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 8px 14px;
  color: var(--text); font: inherit; cursor: pointer; transition: background-color .15s ease, border-color .15s ease;
}
.pick-btn:hover, .pick-btn[aria-expanded="true"] { background: var(--panel-2); border-color: var(--line-2); }
.pick-btn > .ic { color: var(--text-2); transition: transform .18s var(--ease); }
.pick-btn[aria-expanded="true"] > .ic { transform: rotate(180deg); }
.pick-btn .title { gap: 10px; align-items: center; min-width: 0; }
.pick-btn .t-main { font-weight: 650; font-size: var(--t14); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-btn .sub { color: var(--muted); font-size: var(--t13); }
.lapnav { display: flex; align-items: center; gap: 2px; background: var(--panel); border-radius: 10px; padding: 3px; flex: none; }
.lapnav-arrow { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center; transition: background-color .15s ease, color .15s ease; }
.lapnav-arrow:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.lapnav-arrow:disabled { color: #4a5357; cursor: default; }
.lapnav-btn { display: flex; align-items: baseline; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: var(--t13); cursor: pointer; align-items: center; }
.lapnav-btn:hover, .lapnav-btn[aria-expanded="true"] { background: var(--panel-2); }
.lapnav-btn .lb-k { color: var(--muted); }
.lapnav-btn .lb-n { font-weight: 650; }
.lapnav-btn .lb-t { font-weight: 650; padding-left: 8px; margin-left: 2px; border-left: 1px solid var(--line-2); display: inline-flex; align-items: center; gap: 6px; }
.lapnav-btn .lb-t:empty { display: none; }
.top-right { gap: 8px; }
.conn { font-size: var(--t13); }
.lm-label { font-size: var(--t12); }
.lm-val { font-size: var(--t14); }

/* ---------- pestañas ---------- */
.tabs { padding: 12px 32px; gap: 8px; border-bottom: 0; flex-wrap: wrap; }
.tab-strip { gap: 4px; }
.tabs [role="tab"] { color: var(--text-2); font: 500 var(--t14) var(--font); padding: 9px 16px; border-radius: 10px; border-bottom: 0; margin: 0; transition: background-color .15s ease, color .15s ease; }
.tabs [role="tab"]:hover { color: var(--text); background: var(--panel); }
.tabs [role="tab"][aria-selected="true"] { background: var(--panel-2); color: #fff; font-weight: 600; }
.tabs [role="tab"]:focus-visible { outline-offset: 2px; border-radius: 10px; }
.tabs .ref-pick { font-size: var(--t13); color: var(--text-2); background: var(--panel); border-radius: 10px; padding: 4px 4px 4px 14px; }
.tabs .ref-pick .select { background-color: var(--panel-2); border-color: transparent; }

/* ---------- capas: selector y panel de vueltas ---------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(6, 8, 9, .6); animation: fade .16s ease-out; }
@keyframes fade { from { opacity: 0; } }
.picker {
  position: fixed; z-index: 21; top: 64px; left: 50%; transform: translateX(-50%); width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 96px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 12px; box-shadow: 0 16px 40px -8px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.05); animation: drop .18s var(--ease); overflow: hidden; transform-origin: top center;
}
.picker.kb, .laps-panel.kb { animation: none; }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -6px) scale(.985); } }
.picker .side-head, .laps-panel .side-head { padding: 20px 20px 12px; gap: 12px; }
.picker .side-head h2, .laps-panel .side-head h2 { font-size: var(--t16); font-weight: 700; color: var(--text); flex: 1; }
.picker .combo-search { padding: 0 20px 12px; }
.picker .combo-search input, .combo-search input { font-size: var(--t14); padding: 11px 14px; border-radius: 10px; background: var(--well); border-color: var(--line); }
.picker .combo-list { padding: 0 12px 20px; gap: 2px; }
/* Recientes: tarjetas */
.picker .combo-sec { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; border-bottom: 0; padding: 0 8px 12px; margin-bottom: 4px; }
.picker .combo-sec > .sec-label { grid-column: 1 / -1; padding: 4px 0 2px; }
.picker .combo-sec > .combo { background: var(--well); border-radius: 12px; padding: 12px 14px; gap: 4px; }
.picker .combo-sec > .combo:hover { background: var(--hover); }
.picker .combo-sec > .combo[aria-current="true"] { box-shadow: inset 0 0 0 1px rgba(95,216,58,.45); background: var(--panel-2); }
.sec-label { font-size: var(--t12); color: var(--muted); font-weight: 600; letter-spacing: .02em; padding: 14px 10px 6px; }
.combo { padding: 10px 12px; border-radius: 10px; }
.combo .c1 { font-size: var(--t14); font-weight: 600; }
.combo .c2 { font-size: var(--t12); color: var(--text-2); }
.combo[aria-current="true"] { background: var(--panel-2); box-shadow: none; }
.track-head { padding: 10px 12px; border-radius: 10px; }
.track-head .c1t { font-size: var(--t14); }
.track-head .c2 { font-size: var(--t12); color: var(--text-2); }
.track-head .th-count { font-size: var(--t11); box-shadow: none; background: var(--hover); }
.track-cars { margin-left: 18px; border-left-color: var(--line); }
.game-head { font-size: var(--t13); padding: 8px 10px; border-radius: 8px; }
.game-tag { height: 20px; font-size: 11px; border-radius: 5px; box-shadow: none; background: var(--hover); }
.c-act { width: 28px; height: 28px; border-radius: 7px; }

.laps-panel {
  position: fixed; z-index: 21; top: 0; bottom: 0; left: 0; width: min(400px, 100vw); display: flex; flex-direction: column;
  background: var(--bg-side); border-right: 1px solid var(--line-2); box-shadow: 16px 0 40px -12px rgba(0,0,0,.6); animation: slide .24s cubic-bezier(.32,.72,0,1);
}
@keyframes slide { from { transform: translateX(-16px); opacity: 0; } }
.laps-panel .lap-list { padding: 0 12px 24px; }
.laps-panel .lp-follow { padding: 12px 20px; border-top: 1px solid var(--line); }
.laps-panel .side-foot { padding: 12px 20px 20px; gap: 8px; border-top: 0; }
.lap-group { font-size: var(--t12); color: var(--text-2); padding: 16px 10px 6px; }
.lap-group .lg-meta { color: var(--muted); }
.lap-row { height: 40px; grid-template-columns: 26px minmax(0, 1fr) 64px 40px 28px; padding: 0 4px 0 10px; border-radius: 8px; }
.lap-row[aria-selected="true"] { background: var(--panel-2); box-shadow: none; }
.lap-row[aria-selected="true"] .lt { color: #fff; }
.lap-row.best::before { top: 9px; bottom: 9px; width: 3px; }
.lap-row .ln { font-size: var(--t12); }
.lap-row .lt { font-size: var(--t14); }
.lap-row .ld { font-size: var(--t13); color: var(--text-2); }
.lap-row .ld.cut { color: var(--warn); }
.lap-row .ld.muted { color: var(--muted); }
.lap-row .more { opacity: .55; }
.lap-menu { border-radius: 12px; }
.menu-pop { border-radius: 12px; padding: 6px; }
.menu-pop button, .menu-pop a { font-size: var(--t13); padding: 9px 12px; border-radius: 8px; }

/* ---------- zona principal ---------- */
main { padding: 16px 32px 48px; gap: 24px; }
.tab-panel { gap: 24px; }
/* Superficies (escalera tipo Linear): fondo < panel < elevado; filete de 1px y luz de 1px arriba. Sin sombras difusas. */
.panel { border: 1px solid #1d2226; border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.035); background: var(--panel); }
.panel-head { padding: 24px 28px 16px; gap: 16px; }
.panel-head h3 { font-size: var(--t16); font-weight: 700; letter-spacing: -.01em; }
.panel-head .sm-text, .sm-text { font-size: var(--t13); }
.legend { font-size: var(--t13); color: var(--text-2); gap: 16px; }
.legend .muted { color: var(--muted); }
.sw { width: 16px; height: 3px; }
.table { font-size: var(--t14); }
.table th { font-size: var(--t12); color: var(--muted); padding: 12px 16px; border-bottom-color: var(--line); }
.table td { padding: 12px 16px; border-bottom-color: var(--line); }
.table th:first-child, .table td:first-child { padding-left: 28px; }
.table th:last-child, .table td:last-child { padding-right: 28px; }
.notes { padding: 4px 28px 24px; gap: 8px; color: var(--text-2); }
.hint { padding: 0 28px 24px; font-size: var(--t13); }
.section-label { font-size: var(--t12); color: var(--muted); letter-spacing: .02em; }

/* ---------- Resumen ---------- */
.hero { gap: 40px; padding: 16px 0 0; align-items: end; }
.hero h2 { font-size: 36px; font-weight: 800; letter-spacing: -.02em; line-height: 1.12; text-wrap: balance; }
.v-lines { margin-top: 14px; gap: 6px; font-size: var(--t16); color: var(--text-2); max-width: 76ch; }
.v-lines li:first-child { color: var(--text); }
.figs { gap: 32px; }
.fig dt { font-size: var(--t12); color: var(--muted); font-weight: 500; }
.fig.hero-n dd { font-size: var(--t34); font-weight: 800; letter-spacing: -.02em; }
.fig.small dd { font-size: 20px; font-weight: 650; color: var(--text); }
.fig-col { gap: 14px; }
.sectors { gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.sectors > .sec { border: 0; box-shadow: none; border-radius: 12px; padding: 16px 20px; background: var(--panel); gap: 12px; }
.sectors > .sec .sn { font-size: var(--t13); }
.sectors > .sec .st { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.sectors > .sec .sd { font-size: var(--t14); font-weight: 600; }
.sectors > .sec.best::after { top: -10px; right: 16px; font-size: var(--t12); background: var(--bg); }
.resumen-grid { gap: 24px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: stretch; }
.right-col { gap: 24px; }
.resumen-grid > .right-col > .panel:last-child { flex: 1; }
/* El punto de atención: el plan con tinte verde suave. */
/* El punto de atención de Resumen: el plan lleva un filete verde y su primer consejo manda. Sin degradados. */
.plan-panel { border-color: rgba(95,216,58,.28); }
.plan { padding: 0 16px 16px; gap: 8px; }
.plan-item { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 0 16px; padding: 20px 16px; border-top: 0; border-radius: 12px; }
.plan-item + .plan-item { border-top: 1px solid rgba(255,255,255,.05); border-radius: 0 0 12px 12px; }
.plan-item:hover { background: rgba(255,255,255,.03); border-radius: 12px; }
.plan-n { width: 32px; height: 32px; border: 0; background: var(--panel-2); color: var(--text); font-size: var(--t14); font-weight: 700; }
.plan-item:first-child .plan-n { background: var(--accent); color: var(--accent-ink); }
.plan-item h4 { font-size: 20px; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; }
.plan-item:first-child h4 { font-size: 24px; }
.plan-item p { margin-top: 8px; font-size: var(--t14); color: var(--text-2); max-width: 68ch; }
.plan-ev { font-size: var(--t13); color: var(--muted); margin-top: 8px; }
.plan-gain b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.plan-item:first-child .plan-gain b { font-size: 36px; color: var(--accent); }
.plan-gain span { font-size: var(--t12); }
.plan-chart { height: 136px; margin-top: 16px; border: 0; border-radius: 12px; background: var(--well); }
.plan-brain { font-size: var(--t13); border-left: 0; padding-left: 26px; position: relative; margin-top: 10px; color: var(--text-2); }
.plan-brain::before { content: ""; position: absolute; left: 6px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.plan-brain.good::before { background: var(--gain); }
.pattern-line { padding: 20px 28px 24px; border-top: 1px solid rgba(255,255,255,.05); font-size: var(--t14); gap: 14px; }
.map-wrap { padding: 0 16px 16px; }
#map { height: 380px; }
.bars { padding: 0 20px 24px; gap: 4px; }
.bar-row { grid-template-columns: 84px minmax(0, 1fr) 64px; padding: 6px 8px; border-radius: 8px; }
.bar-name { font-size: var(--t13); color: var(--text); }
.bar-track { height: 16px; }
.bar { height: 12px; border-radius: 4px; }
.bar-val { font-size: var(--t13); font-weight: 600; }

/* ---------- Recomendaciones ---------- */
.rec-grid { gap: 24px; align-items: stretch; }
.rec-list { padding: 0 28px 16px; }
.rec-card { padding: 20px 0; border-top-color: var(--line); grid-template-columns: 32px minmax(0, 1fr); gap: 0 16px; }
.rec-n { width: 32px; height: 32px; border: 0; font-size: var(--t14); font-weight: 700; color: var(--text); }
.rec-card:first-child .rec-n { background: var(--accent); color: var(--accent-ink); }
.rec-card h4 { font-size: 18px; font-weight: 700; margin-top: 8px; }
.rec-text { font-size: var(--t14); color: var(--text-2); margin-top: 6px; }
.rec-detail, .rec-ev, .rec-conf, .rec-lead { font-size: var(--t13); }
.gain-pill { font-size: var(--t13); padding: 4px 10px; }
.rec-follow { font-size: var(--t13); }
.rec-sub { font-size: var(--t14); font-weight: 700; padding: 20px 28px 10px; }
.rec-rows { padding: 0 28px 16px; }
.rec-rows li { padding: 12px 0; }
.rec-lead, .rec-empty { padding: 0 28px 16px; }
.rec-refdiff { padding: 16px 28px 20px; }
.rec-refdiff .table td:first-child, .rec-refdiff .table th:first-child { padding-left: 0; }
.rec-refdiff .table td:last-child, .rec-refdiff .table th:last-child { padding-right: 0; }
.tip-phase { font-size: var(--t12); border: 0; background: var(--hover); padding: 3px 10px; color: var(--text-2); }
.tips li.good .tip-phase, .brain-follow.good .tip-phase, .rec-follow.good .tip-phase { background: rgba(74,222,128,.16); color: #86efac; }
.brain-personal { border: 0; border-radius: 12px; background: var(--well); padding: 16px 18px; }

/* ---------- Mapa ---------- */
.mapa-grid { gap: 24px; grid-template-columns: minmax(0, 1fr) 400px; }
.bigmap-wrap { padding: 0 16px 16px; }
.map-side { padding: 24px 28px 28px; gap: 20px; }
.map-side .cd-head h3 { font-size: 36px; font-weight: 800; }
.map-side .tips li { font-size: var(--t14); }
.map-side .metrics td, .map-side .metrics th { font-size: var(--t13); padding: 8px 8px; }
.map-side .metrics td:first-child, .map-side .metrics th:first-child { padding-left: 0; }
.map-side .metrics td:last-child, .map-side .metrics th:last-child { padding-right: 0; }
.map-zoom button { border-radius: 10px; width: 34px; height: 34px; border-color: var(--line); }

/* ---------- Curvas ---------- */
.curvas-grid { gap: 24px; grid-template-columns: minmax(340px, .8fr) minmax(0, 1.6fr); }
.corner-table tbody tr[aria-selected="true"] td { background: var(--panel-2); color: #fff; }
.cname { font-weight: 650; }
.phases-mini { height: 10px; gap: 3px; }
.phases-mini span { border-radius: 3px; }
.corner-detail { padding: 28px; gap: 24px; }
.cd-head h3 { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.cd-delta { font-size: 28px; font-weight: 800; }
.phase-bar { gap: 12px; }
.phase { border: 0; border-radius: 12px; padding: 14px 16px; }
.phase .pl { font-size: var(--t13); }
.phase .pv { font-size: 22px; font-weight: 700; margin-top: 4px; }
.phase.worst { box-shadow: inset 0 0 0 1px rgba(236,91,91,.45); }
.tips { gap: 14px; }
.tips li { grid-template-columns: 104px 1fr; font-size: var(--t14); }
/* El seguimiento («Primera señal») va en la misma columna que las fases de los consejos de encima. */
.brain-follow { grid-template-columns: 104px 1fr; }
.brain-follow .tip-phase, .tips li .tip-phase { justify-self: start; white-space: nowrap; }
.tip-detail { font-size: var(--t13); color: var(--text-2); }
.cd-charts { gap: 16px; }
.cd-chart { height: 180px; border: 0; border-radius: 12px; }
.cd-session { border-top-color: var(--line); padding-top: 20px; }
.metrics tr.grp td { font-size: var(--t12); padding: 18px 16px 8px; }
.metrics .dw { font-size: var(--t12); }
.corner-detail .metrics td:first-child, .corner-detail .metrics th:first-child { padding-left: 0; }
.corner-detail .metrics td:last-child, .corner-detail .metrics th:last-child { padding-right: 0; }
.more-rows > summary { font-size: var(--t14); padding: 6px 10px; border-radius: 8px; }
.line-map, .line-stat { border: 0; border-radius: 12px; }
.line-stat .pv { font-size: 20px; font-weight: 700; }

/* ---------- Telemetría ---------- */
[data-panel="telemetria"] .panel-head h3 { font-size: 22px; font-weight: 800; }
.tele-grid { grid-template-columns: minmax(0, 1fr) 300px; border-top: 1px solid var(--line); border-bottom: 0; }
.charts { padding: 8px 8px 12px 0; }
.chart { height: 136px; padding-top: 12px; border-top-color: rgba(255,255,255,.05); }
.chart.tall { height: 236px; }
.chart.short { height: 110px; }
.chart.delta { height: 196px; }
.chart .chart-title { font-size: var(--t14); font-weight: 650; color: var(--text); top: 12px; }
.tele-side { padding: 20px; border-left-color: var(--line); gap: 4px; }
#miniMap { height: 240px; }
.readout { font-size: var(--t13); padding: 14px 0; border-color: var(--line); }
.readout .rl { color: var(--text-2); }
.tele-corners button { font-size: var(--t13); padding: 8px 10px; border-radius: 8px; }
.tele-corners button[aria-pressed="true"] { box-shadow: none; background: var(--panel-2); }

/* ---------- Sesión ---------- */
.sesion-grid { gap: 24px; }
.session-chart-wrap { padding: 0 16px 8px; }
#sessionChart { height: 300px; }
[data-panel="sesion"] .sesion-grid > .right-col:last-child > .panel { flex: 1; }
.consistency { padding: 0 28px 24px; gap: 12px; }
.cons-row { grid-template-columns: 84px minmax(0, 1fr) 72px; font-size: var(--t13); gap: 14px; }
.cons-track { height: 10px; border-radius: 5px; }
.cons-fill { border-radius: 5px; opacity: .7; }
.heat { font-size: var(--t13); }
.heat-wrap { padding: 0 0 12px; }
.heat th, .heat td { padding: 9px 10px; }
.car-body { padding: 0 28px 12px; gap: 24px; }
.tyres { gap: 12px; }
.tyre { border: 0; border-radius: 12px; padding: 12px 14px; gap: 4px; }
.tyre .tw, .tyre .bt { font-size: var(--t12); }
.tyre .tt { font-size: 24px; font-weight: 750; }
.tyre .tp { font-size: var(--t13); }
.cond td, .cond th { font-size: var(--t13); padding: 8px 10px; }

/* ---------- Estilo ---------- */
.estilo-grid { gap: 24px; }
.style-table .metric small { font-size: var(--t13); color: var(--text-2); }
.style-table .dw { font-size: var(--t12); }
.style-more > summary { margin: 8px 28px 20px; }
.pattern-types { padding: 0 28px 24px; font-size: var(--t13); }

/* ---------- Progreso ---------- */
.prog-figs { gap: 24px 48px; padding: 8px 0 0; }
.prog-figs .fig dd { font-size: 44px; font-weight: 800; letter-spacing: -.02em; }
.prog-figs .fig.sm dd { font-size: 24px; color: var(--text); font-weight: 700; }
.prog-figs .fig small { font-size: var(--t13); color: var(--text-2); }
.target-edit input { height: 44px; font-size: 24px; border-radius: 10px; width: 140px; }
#progChart { height: 340px; }
[data-panel="progreso"] .sesion-grid { align-items: stretch; }

/* ---------- vacío, avisos, diálogos ---------- */
.empty h2 { font-size: 36px; font-weight: 800; }
.empty p { font-size: var(--t16); }
.toast { border-radius: 12px; padding: 12px 18px; font-size: var(--t14); }
.tooltip { border-radius: 10px; font-size: var(--t13); padding: 10px 12px; }
.dlg { border-radius: 16px; padding: 32px; }
.dlg h2 { font-size: 24px; font-weight: 750; }
.dlg p { font-size: var(--t14); }
.checks, .folder-row code, .r-help { border: 0; border-radius: 12px; }
.field input { border-radius: 10px; }
.toggle small { font-size: var(--t13); color: var(--text-2); }

/* En directo (VUELTA y DELTA en la cabecera) no cabe todo hasta ~1700 px: los botones se quedan en icono y el estado del
   juego en el punto, antes de que el selector de circuito se aplaste. */
@media (min-width: 821px) {
  .pick-btn { min-width: 240px; }
}
@media (max-width: 1700px) {
  body.is-live .top-right > a.btn, body.is-live .top-right > #btnDemo { font-size: 0; gap: 0; padding-inline: 9px; }
  body.is-live .top-right > a.btn svg, body.is-live .top-right > #btnDemo svg { margin: 0; }
  body.is-live #connText { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
body.is-live .pick-btn .kbd { display: none; } /* conduciendo no hace falta el atajo, y quita sitio al circuito */
.kbd { white-space: nowrap; }
/* ---------- iconos (0.1.0.81): pestañas, veredicto, cifras, sectores y plan. Solo iconos y algún filete: sin tarjetas de color. ---------- */
.tabs [role="tab"] { display: inline-flex; align-items: center; gap: 8px; }
.tabs [role="tab"] .ic { opacity: .7; flex: none; }
.tabs [role="tab"][aria-selected="true"] .ic { opacity: 1; color: var(--accent); }
.h-ic { display: inline-flex; align-items: center; gap: 8px; }
.h-ic .ic { color: var(--accent); }
.v-lines li { display: flex; gap: 10px; align-items: flex-start; }
.v-lines li .ic { flex: none; margin-top: 4px; }
.v-lines .vl-plan .ic { color: var(--accent); }
.v-lines .vl-cond .ic { color: #5cb8d6; }
.v-lines .vl-good .ic { color: var(--gain); }
.v-lines .vl-ref .ic { color: var(--ref); }
.v-lines .vl-warn .ic { color: var(--warn); }
.v-lines .vl-info .ic { color: var(--muted); }
.fig dt { display: inline-flex; align-items: center; gap: 6px; }
.fig dt .ic { width: 13px; height: 13px; flex: none; }
.fig dt.dt-gap.neg .ic { color: var(--loss); }
.fig dt.dt-gap.pos .ic { color: var(--gain); }
.fig dt.dt-ideal .ic { color: var(--ref); }
.sectors > .sec.is-loss { box-shadow: inset 0 2px 0 var(--loss); }
.sectors > .sec.is-gain { box-shadow: inset 0 2px 0 var(--gain); }
.sectors > .sec.best::after { content: none; }
.sec-best { display: inline-flex; align-items: center; gap: 5px; color: var(--gain); font-size: var(--t12); font-weight: 600; white-space: nowrap; }
.plan-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 4px; font-size: var(--t13); color: var(--muted); }
.plan-tags .plan-ev { margin: 0; }
.ptag { display: inline-flex; align-items: center; gap: 5px; }
.ptag.ph-brake .ic { color: var(--loss); }
.ptag.ph-mid .ic { color: #5cb8d6; }
.ptag.ph-exit .ic { color: var(--gain); }
.plan-item p.tip-what, .plan-item p.tip-todo { display: flex; gap: 10px; align-items: flex-start; }
.plan-item p.tip-what { margin-top: 12px; }
.plan-item p.tip-todo { margin-top: 6px; color: var(--text); }
.plan-item p.tip-what .ic, .plan-item p.tip-todo .ic { flex: none; margin-top: 3px; }
.plan-item p.tip-what .ic { color: var(--warn); }
.plan-item p.tip-todo .ic { color: var(--gain); }
@media (min-width: 721px) { .tabs [role="tab"] { padding-inline: 13px; gap: 7px; } }
/* Telemetría: plegar y ordenar gráficas. El título es el botón de plegar (encima del título, que no recibe clics). */
.chart .chart-fold { position: absolute; left: 14px; top: 8px; height: 28px; width: 30px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; z-index: 2; }
.chart .chart-fold::after { content: ""; position: absolute; left: 30px; top: 0; height: 28px; width: 260px; } /* el título también pliega */
.chart .chart-fold:hover, .chart .chart-fold:focus-visible { color: var(--text); background: var(--hover); }
.chart .chart-fold .ic { transition: transform .18s var(--ease); }
.chart.folded .chart-fold .ic { transform: rotate(-90deg); }
.chart .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chart-tools { position: absolute; right: 8px; top: 6px; display: flex; gap: 2px; z-index: 2; opacity: 0; transition: opacity .15s ease; }
.chart:hover .chart-tools, .chart:focus-within .chart-tools, .charts.sorting .chart.dragging .chart-tools { opacity: 1; }
.ct-btn, .ct-grip { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: var(--panel-2); color: var(--text-2); }
.ct-btn { cursor: pointer; }
.ct-btn:hover, .ct-btn:focus-visible { color: var(--text); background: var(--hover); }
.ct-grip { cursor: grab; touch-action: none; }
.charts.sorting, .charts.sorting * { cursor: grabbing !important; user-select: none; }
.chart.dragging { background: var(--panel-2); border-radius: 10px; box-shadow: 0 0 0 1px var(--line-2), 0 10px 30px rgba(0,0,0,.35); z-index: 3; }
.chart.folded { height: 44px !important; }
.chart.folded canvas { display: none; }
.chart.folded .chart-title { color: var(--muted); }
@media (hover: none), (max-width: 720px) { .chart-tools { opacity: 1; } }

/* Etiquetas con icono (fase, seguimiento, setup) y fases de la curva. */
.tip-phase { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.tip-phase .ic { flex: none; }
.tip-phase.ci-loss .ic { color: var(--loss); }
.tip-phase.ci-gain .ic { color: var(--gain); }
.tip-phase.ci-info .ic { color: #5cb8d6; }
.tip-phase.ci-warn .ic { color: var(--warn); }
.phase .pl { display: flex; align-items: center; gap: 6px; }
.phase .pl .ic { flex: none; opacity: .8; }
.plan-tip p { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 0; }
.plan-tip p .ic { flex: none; margin-top: 3px; }
.plan-tip p.tip-what .ic { color: var(--warn); }
.plan-tip p.tip-todo { color: var(--text); }
.plan-tip p.tip-todo .ic { color: var(--gain); }
/* Con icono, las etiquetas son algo más anchas: la columna crece para que no se monten sobre el texto. */
.tips li, .brain-follow { grid-template-columns: 124px minmax(0, 1fr); }
.rec-follow { grid-template-columns: 124px minmax(0, 1fr); }
.tips li .tip-phase, .brain-follow .tip-phase, .rec-follow .tip-phase { justify-self: start; white-space: nowrap; }
@media (max-width: 720px) { .rec-follow { grid-template-columns: minmax(0, 1fr); } }
/* En el lateral del mapa no cabe la columna: la etiqueta va encima del texto. */
.map-side .tips li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
/* Notas con icono por línea (Sesión, Progreso, Tu patrón, Tu estilo). */
.fig dt.dt-trophy .ic { color: var(--gain); } .fig dt.dt-target .ic { color: var(--ref); } .fig dt.dt-flag .ic { color: var(--accent); }
.notes li.has-ic { display: flex; gap: 10px; align-items: flex-start; padding-left: 0; }
.notes li.has-ic::before { content: none; }
.notes li.has-ic > .ic { flex: none; margin-top: 4px; }
.notes .vl-good > .ic { color: var(--gain); } .notes .vl-warn > .ic { color: var(--warn); } .notes .vl-ref > .ic { color: var(--ref); }
.notes .vl-cond > .ic { color: #5cb8d6; } .notes .vl-info > .ic { color: var(--muted); }
#condNotes li { display: flex; gap: 10px; align-items: flex-start; padding-left: 0; }
#condNotes li::before { content: none; }
#condNotes li .ic { flex: none; margin-top: 4px; }
#condNotes .vl-cond .ic { color: #5cb8d6; } #condNotes .vl-warn .ic { color: var(--warn); } #condNotes .vl-good .ic { color: var(--gain); } #condNotes .vl-info .ic { color: var(--muted); }
/* Sin sitio para pestañas con icono y «Comparada con» en una fila: fuera los iconos de las pestañas. */
@media (max-width: 1480px) { .tabs [role="tab"] .ic { display: none; } .tabs [role="tab"] { padding-inline: 16px; } }

/* ---------- cabecera: estado con actividad, accesos visibles y marca del juego ---------- */
/* El estado del juego es también el botón de la actividad (conexiones, vueltas descartadas, versión). */
.act-menu > summary.conn { height: 34px; padding: 0 10px; border-radius: 8px; cursor: pointer; user-select: none; transition: background-color .15s ease, color .15s ease; }
.act-menu > summary.conn:hover, .act-menu[open] > summary.conn { background: var(--hover); color: var(--text); }
.act-menu > summary.conn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.act-menu .menu-pop { max-width: calc(100vw - 24px); }
.act-menu .menu-pop .log { width: min(440px, calc(100vw - 48px)); max-height: 300px; }
.act-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 10px 2px; font: 650 var(--t13) var(--font); color: var(--text); }
.act-head .muted { font-weight: 500; font-size: var(--t12); }
/* Móvil, hub y ajustes: siempre a la vista, en icono, separados de los botones con texto. */
.top-icons { display: flex; align-items: center; gap: 2px; padding-left: 8px; border-left: 1px solid var(--line); }
.top-icons .btn.icon { position: relative; }
.hub-dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
/* Icono del juego instalado (si no lo hay, la sigla de siempre). */
.game-ico { width: 22px; height: 22px; border-radius: 5px; object-fit: contain; display: block; flex: none; }
.combo .game-ico, .game-head .game-ico { width: 18px; height: 18px; border-radius: 4px; }
/* Con los tres accesos a la vista, Informe y Pantalla en directo se quedan en icono antes (hasta 1500 px): el nombre del circuito manda. */
@media (max-width: 1500px) {
  .top-right > a.btn, .top-right > #btnDemo { font-size: 0; gap: 0; padding-inline: 9px; }
  .top-right > a.btn svg, .top-right > #btnDemo svg { margin: 0; }
}
@media (max-width: 1320px) { .act-menu > summary.conn { padding: 0 8px; } }
/* En pista y con poco ancho, la marca se queda en el símbolo: el sitio es para el circuito y el delta. */
@media (max-width: 1320px) { body.is-live .topbar .brand-wm { display: none; } body.is-live .topbar .brand-mark { display: block; } }
@media (max-width: 820px) { .top-icons { padding-left: 4px; border-left: 0; } .act-menu { position: static; } .act-menu .menu-pop { left: 12px; right: 12px; top: auto; margin-top: 6px; } }

/* ---------- puntos de corte ---------- */
@media (max-width: 1500px) {
  .topbar .brand-text { display: none; }
}
@media (max-width: 1320px) {
  .topbar { padding: 12px 24px; }
  .tabs { padding: 12px 24px; }
  main { padding: 12px 24px 40px; }
  .tabs [role="tab"] { padding-inline: 12px; }
  .pick-btn .kbd { display: none; }
}
@media (max-width: 1100px) {
  .topbar .brand-wm { display: none; }
  .topbar .brand-mark { display: block; }
  .tele-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100%; }
  .topbar { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
  .topbar .brand { order: 0; }
  .top-gap { display: none; }
  .top-right { order: 1; margin-left: auto; }
  .pick-btn { order: 2; flex: 1 1 100%; max-width: none; }
  .pick-btn .title { flex: 1; flex-wrap: nowrap; }
  .pick-btn .t-main, .pick-btn .sub { white-space: nowrap; }
  .pick-btn .sub { overflow: hidden; text-overflow: ellipsis; }
  .lapnav { order: 3; flex: 1 1 100%; justify-content: space-between; }
  .lapnav-btn { flex: 1; justify-content: center; }
  .tabs { padding: 0 0 8px; gap: 8px; }
  .tab-strip { padding: 0 16px; gap: 4px; }
  .tabs .ref-pick { margin: 0 16px; padding: 4px 4px 4px 12px; border-top: 0; }
  main { padding: 8px 16px 32px; gap: 16px; }
  .tab-panel { gap: 16px; }
  .panel-head { padding: 20px 18px 12px; }
  .table th:first-child, .table td:first-child { padding-left: 18px; }
  .table th:last-child, .table td:last-child { padding-right: 18px; }
  .notes { padding: 4px 18px 20px; }
  .hint, .consistency, .pattern-types { padding-left: 18px; padding-right: 18px; }
  .rec-list, .rec-rows, .rec-lead, .rec-empty, .rec-refdiff { padding-left: 18px; padding-right: 18px; }
  .rec-sub { padding-left: 18px; padding-right: 18px; }
  .car-body { padding: 0 18px 12px; }
  .hero h2 { font-size: 28px; }
  .v-lines { font-size: var(--t14); }
  .fig.hero-n dd { font-size: 40px; }
  .plan { padding: 0 6px 10px; }
  .plan-item { grid-template-columns: 32px minmax(0, 1fr); padding: 18px 10px; gap: 0 12px; }
  .plan-item h4, .plan-item:first-child h4 { font-size: 19px; }
  .plan-item:first-child .plan-gain b, .plan-gain b { font-size: 24px; }
  .plan-chart { height: 120px; }
  .map-wrap, .bigmap-wrap { padding: 0 8px 8px; }
  #map { height: 300px; }
  .corner-detail, .map-side { padding: 20px 18px; }
  .cd-head h3, .map-side .cd-head h3 { font-size: 30px; }
  .phase-bar { grid-template-columns: 1fr; }
  .prog-figs .fig dd { font-size: 32px; }
  .picker { top: 8px; max-height: calc(100vh - 16px); }
  .laps-panel { width: 100vw; border-right: 0; }
  .sectors { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .sectors > .sec { padding: 12px; flex-direction: column; flex-wrap: nowrap; gap: 2px; }
  .sectors > .sec .st { font-size: 17px; }
  .sectors > .sec .sd { margin-left: 0; }
  /* En columna, el «mejor de la sesión» iba de lado y pisaba al sector de al lado. */
  .sectors > .sec.best::after { order: 0; flex-basis: auto; font-size: 10px; letter-spacing: .04em; line-height: 1.25; }
}
@media (hover: none) {
  .lap-row { height: 44px; grid-template-columns: 26px minmax(0, 1fr) 64px 40px 32px; }
  .lapnav-arrow { width: 44px; height: 40px; }
}

/* ---------- instrumentos: etiquetas en versalitas, cifras quietas ---------- */
.fig dt, .table th, .sectors > .sec .sn, .phase .pl, .tyre .tw, .lap-group, .sec-label, .readout .rh, .metrics tr.grp td, .line-stat .pl, .lm-label {
  text-transform: uppercase; letter-spacing: .07em; font-size: 11px; font-weight: 600;
}
.fig dd, .sectors > .sec .st, .plan-gain b, .cd-delta, .phase .pv, .tyre .tt, .lap-row .lt, .lapnav-btn .lb-t, .prog-figs .fig dd, .bar-val {
  font-feature-settings: "tnum", "zero", "cv11";
}
.u { font-size: .5em; letter-spacing: 0; font-weight: 600; margin-left: 3px; }
.fig.hero-n dd .u, .prog-figs .fig dd .u { font-size: .42em; }

/* ---------- franjas de sector (como un monitor de tiempos) ---------- */
.sectors { gap: 0; background: var(--panel); border: 1px solid #1d2226; border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.035); overflow: hidden; }
.sectors > .sec { border-radius: 0; background: transparent; padding: 18px 22px 16px; position: relative; }
.sectors > .sectors > .sec + .sec { border-left: 1px solid #1d2226; }
.sectors > .sec::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--line-2); }
.sectors > .sec:has(.sd.pos)::before { background: var(--loss); }
.sectors > .sec:has(.sd.neg)::before { background: var(--gain); }
.sectors > .sec.best::before { background: var(--accent); }
.sectors > .sec.best::after { position: static; order: 9; margin-left: 0; flex-basis: 100%; background: none; padding: 0; color: var(--accent); font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }

/* ---------- insignias: un solo sistema para estado de vuelta, fase y ganancia ---------- */
.gain-pill, .tip-phase, .lap-row .ld.cut, .lap-row.best .ld, .track-head .th-count {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .02em; line-height: 1; white-space: nowrap; border: 0;
}
.lap-row.best .ld { color: var(--accent); background: rgba(95,216,58,.12); justify-self: end; }
.lap-row .ld.cut { color: #f0bf5e; background: rgba(224,163,46,.12); justify-self: end; max-width: 100%; }
.lap-row .ld.cut.muted { color: #f0bf5e; }
.gain-pill { color: #ff8f8f; background: rgba(236,91,91,.14); }
.tip-phase { background: var(--hover); color: var(--text-2); }
.tips li.good .tip-phase, .brain-follow.good .tip-phase, .rec-follow.good .tip-phase { background: rgba(74,222,128,.16); color: #86efac; }
.lap-row .lt .flag { width: 7px; height: 7px; border-radius: 2px; }
.game-tag { border-radius: 5px; letter-spacing: .04em; }

/* ---------- estados y microinteracciones ---------- */
.plan-item { transition: background-color .15s ease; }
.plan-item:active { background: rgba(255,255,255,.045); }
.lapnav-arrow:active:not(:disabled), .pick-btn:active, .lapnav-btn:active { transform: scale(.97); }
.pick-btn, .lapnav-btn, .lapnav-arrow { transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .12s var(--ease); }
@media (hover: none) { .plan-item:hover { background: transparent; } }
:focus-visible { outline-color: var(--accent); }
.tabs [role="tab"][aria-selected="true"] { box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 0 1px #262d32; }

/* Rejillas: una columna en pantallas medianas y móvil (va al final para ganar a la piel). */
@media (max-width: 1280px) { .resumen-grid, .sesion-grid, .rec-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) { .mapa-grid, .curvas-grid, .tele-grid { grid-template-columns: minmax(0, 1fr); } .tele-side { border-left: 0; border-top: 1px solid var(--line); position: static; } }
@media (max-width: 820px) {
  .tabs { flex-direction: column; align-items: stretch; }
  .tabs { flex-wrap: nowrap; max-width: 100vw; }
  .tab-strip { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .app { min-width: 0; max-width: 100vw; }
  .sectors > .sec { padding: 14px 12px 12px; }
  .sectors > .sectors > .sec + .sec { border-left: 1px solid #1d2226; }
  .figs .sep { display: none; }
  .fig-col { flex-direction: row; gap: 24px; }
}

.corner-table-panel { overflow-x: auto; }
.picker .combo-sec > .combo .c2 { white-space: normal; }
.gain-pill .u { font-size: .9em; opacity: .8; }
.car-body { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
@media (max-width: 1100px) { .car-body { grid-template-columns: minmax(0, 1fr); } }
.laps-panel .lap-list { max-height: none; flex: 1; min-height: 0; }

/* ---------- color: verde = ganas / más rápido, rojo = pierdes / más lento ----------
   El verde de marca (#5fd83a) queda solo para acción: botones, interruptores, foco, conexión.
   Las ganancias usan un verde menta más claro (#4ade80) y las pérdidas un rojo más oscuro (#ec5b5b):
   se distinguen por claridad aunque no se vea el color, y siempre llevan signo y lado del eje. */
.plan-item:first-child .plan-n, .rec-card:first-child .rec-n { background: var(--text); color: #0c0e10; }
.plan-item:first-child .plan-gain b { color: var(--text); }
.plan-panel { border-color: rgba(255,255,255,.14); }
.corner-table tbody tr[aria-selected="true"] td:first-child, .heat tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 2px 0 0 var(--text); }
.sectors > .sec.best::before { background: var(--gain); }
.sectors > .sec.best::after { color: var(--gain); }
.lap-row.best::before { background: var(--gain); }
.lap-row.best .ld { color: var(--gain); background: rgba(74,222,128,.12); }

/* ---------- selector de circuito y coche: paleta de comandos ---------- */
.picker #comboSearchWrap[hidden] { display: block !important; }
.picker .combo-search { position: relative; }
.picker .combo-search input { padding-left: 42px; font-size: 16px; height: 48px; background-color: var(--well);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23838d88' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px center; }
.picker .combo { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 2px; align-items: center; }
.picker .combo .c1 { grid-column: 1; }
.picker .combo .c2 { grid-column: 1; }
.picker .combo .c-when { grid-column: 2; grid-row: 2; justify-self: end; font-size: var(--t12); color: var(--muted); }
.picker .combo .c-best { position: absolute; right: 12px; top: 11px; font-size: var(--t14); font-weight: 650; color: var(--text); }
.picker .combo:has(.c-best) .c1 { padding-right: 84px; }
.picker .combo-sec > .combo .c-best { position: static; }
.picker .combo-sec > .combo .c1 { padding-right: 0; }
.picker .combo-sec > .combo .c-when { grid-column: 1; grid-row: auto; justify-self: start; }
.picker .combo-sec > .combo { grid-template-columns: minmax(0, 1fr); }
.picker .c-acts { opacity: 1; margin-left: 0; order: -1; }
.picker .c-act:not(.on) { color: #4f5a56; }
.picker .c-act[data-arch]:not(:hover) { opacity: 0; }
.picker .combo:hover .c-act[data-arch], .picker .combo:focus-within .c-act[data-arch] { opacity: 1; }
.picker .c-act.on { color: #f2c94c; }
.picker mark { background: rgba(242,201,76,.18); color: #fff; border-radius: 3px; padding: 0 1px; }
.picker .combo.kb-on, .picker .combo:focus-visible { background: var(--hover); box-shadow: inset 0 0 0 1px var(--line-strong); outline: none; }
.picker .combo-list > p { padding: 32px 12px !important; text-align: center; font-size: var(--t14) !important; color: var(--text-2) !important; }
.picker .game-head .gh-count, .picker .track-head .th-count { font-variant-numeric: tabular-nums; }

/* ---------- panel de vueltas ---------- */
.lp-tools { display: flex; flex-direction: column; gap: 12px; padding: 0 20px 12px; border-bottom: 1px solid var(--line); }
.ref-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ref-chips:empty { display: none; }
.chip { font: 500 var(--t12) var(--font); color: var(--text-2); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-variant-numeric: tabular-nums; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip[aria-pressed="true"] { color: var(--ref-text); border-color: rgba(144,133,233,.55); background: rgba(144,133,233,.12); }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 3px; background: var(--panel); border-radius: 10px; }
.seg button { font: 500 var(--t13) var(--font); color: var(--text-2); background: none; border: 0; border-radius: 8px; padding: 7px 4px; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: #fff; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
#laps[data-f="ok"] .lap-row:not([data-k="ok"]), #laps[data-f="void"] .lap-row:not([data-k="void"]), #laps[data-f="pit"] .lap-row:not([data-k="pit"]) { display: none; }
.lap-group { position: sticky; top: 0; z-index: 1; background: var(--bg-side); margin: 0 -4px; padding: 14px 14px 8px; color: var(--text); }
.lap-group > span:first-child { font-weight: 700; }
.laps-panel .lap-row { grid-template-columns: 30px minmax(0, 1fr) auto 44px 72px 28px; height: 44px; column-gap: 10px; }
.laps-panel .lap-row .lt { font-size: 16px; font-weight: 650; }
.laps-panel .lap-row .ld.cut { grid-column: 3 / 5; }
/* Subir al hub desde la fila: una columna más, solo cuando alguna vuelta se puede subir o ya está subida. */
.laps-panel:has(.has-up) { width: min(434px, 100vw); }
.laps-panel .has-up .lap-row { grid-template-columns: 30px minmax(0, 1fr) auto 44px 72px 24px 28px; }
/* La mejor vuelta no lleva barra: su etiqueta ocupa también ese hueco y deja sitio a la marca de referencia. */
.laps-panel .lap-row.best .ld { grid-column: 3 / 5; }
.lap-row .up { width: 24px; height: 28px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); }
.lap-row button.up { cursor: pointer; opacity: .55; transition: opacity .12s ease, background-color .12s ease, transform 160ms cubic-bezier(.23, 1, .32, 1); }
.lap-row:hover button.up, .lap-row[aria-selected="true"] button.up, .lap-row button.up:focus-visible { opacity: 1; }
.lap-row button.up:hover { background: var(--line-2); color: var(--text); }
.lap-row button.up:active { transform: scale(.94); }
.lap-row .up.on { color: var(--accent); }
.lap-row .up.busy { opacity: 1; animation: up-busy 1s ease-in-out infinite; pointer-events: none; }
@keyframes up-busy { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .lap-row .up.busy { animation: none; } }
.lap-row[data-k="void"] .ld.cut::before { content: "Corte "; font-weight: 500; opacity: .85; }
.lap-row[data-k="pit"] .ld.cut { color: var(--text-2); background: var(--hover); }
.lap-row .ld:not(.cut):not(.muted) { color: var(--loss); font-weight: 600; }
.lap-row.best .ld { font-weight: 650; }
.lap-row .lbar i { background: var(--loss); }
.lap-row.is-ref .lt .flag.ref { width: auto; height: auto; border-radius: 5px; padding: 3px 6px; background: rgba(144,133,233,.16); }
.lap-row.is-ref .lt .flag.ref::after { content: "REF"; font: 700 10px/1 var(--font); letter-spacing: .06em; color: var(--ref-text); font-style: normal; }
.lap-row .cmp { justify-self: end; font: 600 var(--t12) var(--font); color: var(--ref-text); background: rgba(144,133,233,.12); border: 0; border-radius: 6px; padding: 5px 8px; cursor: pointer; opacity: 0; transition: opacity .12s ease, background-color .12s ease; }
.lap-row:hover .cmp, .lap-row:focus-within .cmp, .lap-row .cmp:focus-visible { opacity: 1; }
.lap-row .cmp:hover { background: rgba(144,133,233,.22); }
@media (hover: none) { .lap-row .cmp { opacity: 1; } .laps-panel .lap-row { grid-template-columns: 26px minmax(0, 1fr) auto 72px 32px; } .laps-panel .has-up .lap-row { grid-template-columns: 26px minmax(0, 1fr) auto 72px 32px 32px; } .lap-row .up { width: 32px; height: 32px; } .lap-row button.up { opacity: 1; } .laps-panel .lap-row.best .ld { grid-column: 3; } .laps-panel .lap-row .lbar { display: none; } .laps-panel .lap-row .ld.cut { grid-column: 3; } }
@media (max-width: 420px) { .laps-panel .lap-row { grid-template-columns: 26px minmax(0, 1fr) auto 72px 28px; column-gap: 8px; } .laps-panel .has-up .lap-row { grid-template-columns: 26px minmax(0, 1fr) auto 64px 28px 28px; column-gap: 6px; } .laps-panel .lap-row.best .ld { grid-column: 3; } .laps-panel .lap-row .lbar { display: none; } .laps-panel .lap-row .ld.cut { grid-column: 3; } }
.picker .combo:not(.combo-sec > .combo) .c-sep { display: none; }
.picker .c-acts { order: -1; margin: 0 2px 0 -6px; }
.picker .c-act[data-arch] { position: absolute; right: 100px; top: 9px; }
.picker .combo-sec > .combo .c-act[data-arch] { right: 8px; top: 8px; }
.picker .combo .c1 { gap: 8px; }

/* =====================================================================
   Columna de juegos (0.1.0.84): cada juego tiene su espacio. Iconos reales
   del juego instalado, grandes; el elegido con anillo blanco (la selección
   va en blanco), punto verde en el que está abierto, apagados los que aún
   no tienen vueltas. En el móvil pasa a píldoras arriba.
   ===================================================================== */
.game-rail { display: none; }
@media (min-width: 721px) {
  body.has-rail .game-rail {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    position: fixed; z-index: 15; left: 0; top: 0; bottom: 0; width: 88px; padding: 16px 0 14px;
    background: #090b0c; border-right: 1px solid var(--line);
  }
  body.has-rail .app { margin-left: 88px; }
  body.has-rail .laps-panel { left: 88px; width: min(400px, calc(100vw - 88px)); }
  body.has-rail .picker { left: calc(50% + 44px); }
  body.has-rail .topbar .brand { display: none; }
  body.has-rail #titleGame { display: none; }
}
.gr-brand { width: 36px; height: 36px; margin-bottom: 14px; flex: none; }
.gr-games { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 2px 0; }
.gr-games::-webkit-scrollbar { display: none; }
.gr-game {
  position: relative; width: 72px; padding: 9px 0 7px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 0; border-radius: 14px; color: var(--muted); font: 600 11px/1.1 var(--font); letter-spacing: .01em; cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease), opacity .15s var(--ease);
}
.gr-game:hover { background: var(--panel); color: var(--text-2); }
.gr-game:active .gr-ico { transform: scale(.94); }
.gr-game[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }
.gr-ico {
  width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; overflow: hidden; flex: none;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2); transition: transform .12s var(--ease), box-shadow .15s var(--ease);
}
.gr-ico.img { background: #101315; }
.gr-ico img { width: 40px; height: 40px; object-fit: contain; display: block; image-rendering: auto; }
.gr-fb { font: 800 13px/1 var(--font); letter-spacing: -.01em; color: var(--text-2); }
.gr-game[aria-pressed="true"] .gr-ico { box-shadow: 0 0 0 2px var(--panel-2), 0 0 0 4px var(--text); }
.gr-game.off { opacity: .42; cursor: default; }
.gr-game.off:hover { background: none; color: var(--muted); }
.gr-game.off .gr-ico { box-shadow: inset 0 0 0 1px var(--line-2); filter: grayscale(.85); }
.gr-live { position: absolute; top: 5px; right: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px #090b0c; }
.gr-game[aria-pressed="true"] .gr-live { box-shadow: 0 0 0 3px var(--panel-2); }
.gr-live.on { background: var(--accent); }
.gr-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; border-top: 1px solid var(--line); width: 56px; }
.gr-foot .top-icons { flex-direction: column; padding: 0; border: 0; gap: 4px; }
.gr-foot .btn { width: 44px; height: 44px; padding: 0; justify-content: center; border-color: transparent; background: none; color: var(--muted); }
.gr-foot .btn:hover { background: var(--panel); color: var(--text); }
.gr-foot .btn svg { margin: 0; }
.gr-foot .bl-t { display: none; }
/* Cabecera: el juego que estás viendo. */
.gamebar { display: flex; flex-direction: column; line-height: 1.2; flex: none; padding-right: 4px; }
.gb-name { font: 700 11px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.gb-stats { font-size: var(--t12); color: var(--text-2); white-space: nowrap; }
@media (max-width: 1500px) { body.is-live .gamebar { display: none; } }
@media (max-width: 1100px) { .gamebar { display: none; } }

/* Móvil: los juegos como píldoras arriba. */
@media (max-width: 720px) {
  body.has-rail .game-rail {
    display: flex; align-items: center; gap: 8px; padding: 12px 16px 2px; overflow-x: auto; scrollbar-width: none;
  }
  .game-rail::-webkit-scrollbar { display: none; }
  .gr-brand, .gr-foot { display: none; }
  .gr-games { flex-direction: row; gap: 8px; overflow: visible; }
  .gr-game { flex-direction: row; width: auto; padding: 6px 14px 6px 6px; gap: 8px; border-radius: 999px; background: var(--panel); color: var(--text-2); font-size: var(--t13); white-space: nowrap; }
  .gr-game[aria-pressed="true"] { background: var(--text); color: #08090b; }
  .gr-ico { width: 26px; height: 26px; border-radius: 999px; }
  .gr-ico img { width: 22px; height: 22px; }
  .gr-fb { font-size: 10px; }
  .gr-game[aria-pressed="true"] .gr-ico { box-shadow: none; }
  .gr-live { position: static; width: 7px; height: 7px; box-shadow: none !important; margin-left: -2px; order: 3; }
  .gr-game[aria-pressed="true"] .gr-live.on { background: #2fa31a; }
}
@media (prefers-reduced-motion: reduce) { .gr-game, .gr-ico { transition: none; } }

/* Atajos de teclado (Ajustes › Voz): casilla que recoge la combinación pulsada. */
.input.hk { width: 270px; max-width: 100%; font-size: var(--t13); text-align: center; font-variant-numeric: tabular-nums; cursor: pointer; caret-color: transparent; }
.input.hk:focus { border-color: rgba(95,216,58,.55); box-shadow: 0 0 0 3px rgba(95,216,58,.12); }
.srow small.err { color: var(--loss, #f06464); }

/* ---------------------------------------------------------------- vista 3D (Assetto Corsa) */
.p3d .panel-head { flex-wrap: wrap; gap: 10px 14px; }
.p3d .seg { grid-template-columns: repeat(7, auto); }
.p3d .seg button:disabled { opacity: .35; cursor: default; }
.p3d #v3dCam { grid-template-columns: repeat(5, auto); }
#v3dRec[aria-pressed="true"] { color: #fff; background: var(--loss); border-color: transparent; }
.p3d .seg button { padding: 6px 11px; }
.v3d-tools { display: flex; gap: 6px; margin-left: auto; }
.v3d-tools .btn[aria-pressed="true"] { color: #fff; background: var(--panel-2); border-color: var(--line-2); }
.v3d-wrap { position: relative; height: clamp(380px, calc(100vh - 470px), 760px); margin: 4px 0 10px; border-radius: 12px; overflow: hidden; background: #9fb7cc; border: 1px solid var(--line); }
.v3d-wrap canvas { display: block; touch-action: none; cursor: grab; }
.v3d-wrap canvas:active { cursor: grabbing; }
.v3d-msg { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; background: rgba(12,14,16,.78); color: var(--text); font-size: var(--t14); text-align: center; z-index: 2; }
.v3d-bar { width: 240px; height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; margin: 0 auto; }
.v3d-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.v3d-legend { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 12px; flex-wrap: wrap; padding: 6px 10px; border-radius: 8px; background: rgba(12,14,16,.72); font-size: var(--t12); color: var(--text-2); z-index: 1; pointer-events: none; }
.v3d-legend .sw { width: 12px; height: 8px; border-radius: 2px; }
.v3d-legend .v3-gain { background: var(--gain); } .v3d-legend .v3-loss { background: var(--loss); }
.v3d-legend .v3-ref { background: var(--ref); height: 3px; } .v3d-legend .v3-lap { background: var(--lap); }
.v3d-legend .v3-info { background: #4cc3eb; } .v3d-legend .v3-warn { background: var(--warn); }
.v3d-corners { position: absolute; left: 10px; top: 10px; right: 48px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; z-index: 1; }
.v3d-corners::-webkit-scrollbar { display: none; }
.v3d-corners button { flex: none; min-width: 34px; padding: 4px 8px; border-radius: 7px; border: 1px solid rgba(255,255,255,.14); background: rgba(12,14,16,.72); color: var(--text); font: 600 var(--t12)/1.2 inherit; font-variant-numeric: tabular-nums; cursor: pointer; transition: transform 120ms ease-out, background-color 150ms ease; }
.v3d-corners button:hover { background: rgba(12,14,16,.9); }
.v3d-corners button:active { transform: scale(0.96); }
.v3d-corners button[aria-current] { background: var(--accent); color: #0c0e10; border-color: transparent; }
.v3d-help { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; z-index: 1; }
.v3d-help-b { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(255,255,255,.14); background: rgba(12,14,16,.72); color: var(--text); font: 700 var(--t12)/1 inherit; cursor: pointer; }
.v3d-help-b[aria-expanded="true"] { background: var(--panel-2); }
.v3d-help ul { margin: 0; padding: 7px 10px; list-style: none; display: grid; gap: 2px; border-radius: 8px; background: rgba(12,14,16,.62); font-size: var(--t12); color: var(--text-2); pointer-events: none; }
.v3d-help.min ul { display: none; }
.v3d-help.min:hover ul { display: grid; }
.v3d-help b { display: inline-block; min-width: 92px; font-weight: 600; color: var(--text); }
@media (max-width: 900px) { .v3d-help { display: none; } .v3d-corners { right: 10px; } }
.v3d-bar2 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 0 28px 10px; }
.v3d-bar2 .seg button { padding: 5px 10px; font-size: var(--t12); }
.v3d-grow { flex: 1; }
.v3d-speed { min-width: 46px; justify-content: center; font-variant-numeric: tabular-nums; }
.v3d-bar2 .btn.ico { padding: 6px 8px; }
.v3d-layers { position: relative; }
.v3d-layers summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
.v3d-layers summary::-webkit-details-marker { display: none; }
.v3d-layers[open] summary { color: #fff; background: var(--panel-2); border-color: var(--line-2); }
.v3d-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 5; min-width: 220px; padding: 6px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 12px 32px rgba(0,0,0,.45); display: grid; gap: 2px; }
.v3d-pop label { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 7px; font-size: var(--t13); color: var(--text); cursor: pointer; }
.v3d-pop label:hover { background: rgba(255,255,255,.05); }
.v3d-pop input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.v3d-gap { position: absolute; left: 50%; top: 48px; transform: translateX(-50%); display: flex; gap: 10px; align-items: baseline; padding: 6px 12px; border-radius: 8px; background: rgba(12,14,16,.8); font-size: var(--t13); color: var(--text); z-index: 1; pointer-events: none; white-space: nowrap; }
.v3d-gap b { font-weight: 700; }
.v3d-card { position: absolute; right: 10px; bottom: 10px; width: 300px; max-height: calc(100% - 64px); overflow: auto; padding: 12px 14px 14px; border-radius: 12px; background: rgba(15,18,20,.92); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 16px 40px rgba(0,0,0,.4); z-index: 2; display: grid; gap: 10px; font-size: var(--t13); }
.v3d-card header { display: flex; align-items: baseline; gap: 10px; }
.v3d-card header strong { font-size: var(--t16, 16px); font-weight: 700; color: #fff; }
.v3d-card header .num { font-weight: 700; }
.v3c-x { margin-left: auto; align-self: center; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; border: 0; background: none; color: var(--text-2); cursor: pointer; }
.v3c-x:hover { background: rgba(255,255,255,.08); color: #fff; }
.v3c-tip p { margin: 0; display: flex; gap: 8px; line-height: 1.4; color: var(--text); }
.v3c-tip p + p { margin-top: 6px; }
.v3c-tip svg { flex: none; margin-top: 2px; }
.v3c-tip .tip-what svg { color: var(--warn); } .v3c-tip .tip-todo svg { color: var(--gain); }
.v3d-card dl { margin: 0; display: grid; gap: 5px; }
.v3d-card dl div { display: flex; justify-content: space-between; gap: 12px; }
.v3d-card dt { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.v3d-card dd { margin: 0; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.v3c-edge { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.v3c-edge p { margin: 0; display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--t12); }
.v3c-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.v3c-grid div { display: grid; gap: 1px; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.04); }
.v3c-grid span { font-size: var(--t12); color: var(--text-2); }
.v3c-grid b { font-size: var(--t16, 16px); font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.v3c-grid i, .v3c-key i { font-style: normal; color: var(--ref); font-variant-numeric: tabular-nums; font-size: var(--t12); }
.v3c-key { justify-content: flex-end; gap: 10px !important; } .v3c-key b { color: #fff; font-weight: 600; }
.v3d-card .btn[aria-pressed="true"] { color: #fff; background: var(--panel-2); border-color: var(--line-2); }
.v3d-card .btn { justify-self: start; }
.p3d:fullscreen { overflow: auto; background: var(--bg, #0c0e10); border-radius: 0; border: 0; }
.p3d:fullscreen .v3d-player { padding-inline: 16px; }
.p3d:fullscreen .v3d-wrap { height: calc(100vh - 420px); min-height: 360px; margin-inline: 16px; }
.p3d:fullscreen .v3d-charts { padding-inline: 16px; }
.v3d-player { display: flex; align-items: center; gap: 12px; padding: 2px 4px 12px; }
.v3p-play { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: #0c0e10; cursor: pointer; transition: transform 120ms ease-out; }
.v3p-play:active { transform: scale(0.94); }
.v3p-play:focus-visible, .v3p-track:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.v3p-time { font-size: var(--t13); font-variant-numeric: tabular-nums; color: var(--text); min-width: 66px; }
.v3p-total { color: var(--text-2); text-align: right; }
.v3p-track { position: relative; flex: 1; height: 34px; cursor: pointer; touch-action: none; }
.v3p-rail { position: absolute; left: 0; right: 0; top: 9px; height: 16px; border-radius: 5px; background: rgba(255,255,255,.07); overflow: hidden; }
.v3p-segs i { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; font: 600 10px/1 inherit; font-style: normal; color: rgba(255,255,255,.75); background: rgba(255,255,255,.1); border-inline: 1px solid rgba(12,14,16,.6); overflow: hidden; }
.v3p-segs i.is-loss { background: color-mix(in srgb, var(--loss) calc(var(--k) * 100%), rgba(255,255,255,.1)); color: #fff; }
.v3p-segs i.is-gain { background: color-mix(in srgb, var(--gain) calc(var(--k) * 100%), rgba(255,255,255,.1)); color: #0c0e10; }
.v3p-loop { position: absolute; top: 0; bottom: 0; border: 2px solid #fff; border-radius: 5px; pointer-events: none; }
.v3p-knob { position: absolute; top: 3px; width: 3px; height: 28px; margin-left: -1.5px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(12,14,16,.7); pointer-events: none; }
.v3d-hud { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 1; pointer-events: none; }
.v3h { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 12px; padding: 8px 12px; border-radius: 10px; background: rgba(12,14,16,.82); border-top: 2px solid var(--c); min-width: 150px; }
.v3h-who { grid-column: 1 / -1; font-size: 11px; font-weight: 600; color: var(--c); margin-bottom: 2px; }
.v3h-spd { font-size: 26px; font-weight: 800; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.v3h-spd small { font-size: 11px; font-weight: 500; color: var(--text-2); margin-left: 3px; }
.v3h-gear { font-size: var(--t13); color: var(--text-2); margin-top: 3px; font-variant-numeric: tabular-nums; }
.v3h-bars { display: flex; gap: 4px; align-items: flex-end; height: 40px; }
.v3h-bars i { position: relative; width: 8px; height: 100%; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.v3h-bars i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--v) * 100%); background: var(--b); }
.v3h-steer { width: 44px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); position: relative; align-self: center; margin-left: 4px; }
.v3h-steer::after { content: ""; position: absolute; top: -3px; width: 4px; height: 12px; border-radius: 2px; background: #fff; left: calc(50% + var(--s) * 50% - 2px); }
.v3d-corners button.is-loss { box-shadow: inset 0 -2px 0 var(--loss); } .v3d-corners button.is-gain { box-shadow: inset 0 -2px 0 var(--gain); }
@media (max-width: 1100px) { .v3d-legend { display: none; } }
.v3d-note { margin: -4px 0 8px; font-size: var(--t12); color: var(--muted); }
.v3d-charts { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.v3d-charts .chart { height: 104px; }
@media (max-width: 900px) { .v3d-charts { grid-template-columns: 1fr; } .v3d-tools { margin-left: 0; } .p3d #v3dMode { grid-template-columns: repeat(4, auto); } .p3d #v3dCam { grid-template-columns: repeat(3, auto); } .v3d-card { left: 10px; width: auto; } }
/* Con la pestaña 3D hay una pestaña más: entre 1281 y 1480 px se estrechan para que «Comparada con» siga en la fila. */
@media (min-width: 721px) and (max-width: 1480px) { .tabs [role="tab"] { padding-inline: 11px; } }
@media (min-width: 721px) and (max-width: 1380px) { .tabs [role="tab"] { padding-inline: 8px; font-size: var(--t13); } }
@media (min-width: 1481px) and (max-width: 1640px) { .tabs [role="tab"] { padding-inline: 9px; gap: 6px; } }
