/* Infoneumatico (c) 2026 Mikel Pires Goni - infoneumatico.com. Todos los derechos reservados. */
/* Codigo propietario. Prohibida su copia o reutilizacion sin permiso por escrito del titular. */
:root {
  --asphalt: #20252b;
  --asphalt-2: #2c333b;
  --ink: #14181c;
  --paper: #eceff2;
  --surface: #ffffff;
  --sunken: #f5f6f8;
  --line: #d6dbe0;
  --line-strong: #b9c0c8;
  --muted: #4f5965;
  --signal: #f5b800;
  --signal-soft: #fff4cc;
  --signal-ink: #4a3800;
  --ok: #1d7a46;
  --ok-soft: #e3f3ea;
  --warn: #7a5200;
  --warn-soft: #fff3d1;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --focus: #1a73e8;
  --radius-s: 6px;
  --radius-m: 10px;
  /* Fuentes del sistema: se ven nitidas en cada dispositivo y no hay que descargar nada */
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-cond: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
:root { color-scheme: light; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.grow { flex: 1; }

/* ---------- Cabecera ---------- */

/* Encabezado adaptable (sigue el tema claro/oscuro) */
.masthead { background: var(--surface); color: var(--ink); padding: 12px 0 0; position: relative; }
.brand-pill { font-size: .78rem; font-weight: 600; color: var(--asphalt); background: var(--signal); padding: 5px 13px; border-radius: 999px; white-space: nowrap; letter-spacing: .01em; }
.masthead::after {
  /* linea discontinua de carretera */
  content: ""; display: block; height: 4px; margin-top: 12px;
  background: repeating-linear-gradient(90deg, var(--signal) 0 28px, transparent 28px 46px);
  opacity: .9;
}
.masthead-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; flex: none; }
.brand-mark { width: 42px; height: 42px; color: var(--ink); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.wordmark { font-family: var(--font-cond); font-weight: 700; font-size: 1.7rem; letter-spacing: .005em; line-height: 1; }
.wm-light { font-weight: 500; color: var(--signal); }
.tagline { margin: 3px 0 0; color: var(--muted); font-size: .88rem; }
.brand-side { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }

.menu { margin: 0; }
.menu-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.menu-inner::-webkit-scrollbar { display: none; }
.seg {
  border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: .98rem; padding: 10px 14px; cursor: pointer;
  white-space: nowrap; border-bottom: 2px solid transparent; border-radius: 8px;
}
.seg:hover { color: var(--ink); background: var(--sunken); }
.lbl-short { display: none; }
.seg.active { color: var(--ink); border-bottom-color: var(--signal); background: var(--sunken); }

/* En escritorio, menu integrado en la misma fila (estilo F) */
@media (min-width: 601px) {
  .masthead-inner { flex-wrap: nowrap; }
  .masthead-inner > .menu { margin-left: auto; min-width: 0; }
  .brand-side { margin-left: 14px; }
  .masthead .lbl-long { display: none; }
  .masthead .lbl-short { display: inline; }
  .seg { display: inline-flex; align-items: center; gap: 7px; }
}

/* ---------- Bloque de entrada ---------- */

main.wrap { padding-top: 20px; padding-bottom: 40px; }
.tool { background: var(--surface); border-radius: var(--radius-m); border: 1px solid var(--line); padding: 18px; margin-bottom: 20px; }
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.btn-reset { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-weight: 600; font-size: .92rem; padding: 7px 14px; border-radius: 999px; cursor: pointer; min-height: 38px; }
.btn-reset svg { width: 17px; height: 17px; }
.btn-reset:hover { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.vehicle { display: flex; align-items: center; gap: 10px; }
.vehicle label { font-weight: 600; font-size: .92rem; }
.vehicle select {
  appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background: var(--sunken)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235b6570' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center;
  padding: 7px 32px 7px 12px; border-radius: var(--radius-s); font-weight: 600; min-height: 38px;
}
.hint { color: var(--muted); margin: 10px 0 14px; max-width: 70ch; }

.rows { display: flex; flex-direction: column; gap: 12px; }
.picker { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; background: var(--sunken); }
.picker-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.picker-name { font-size: .88rem; font-weight: 600; color: var(--muted); }
.readout { font-family: var(--font-cond); font-weight: 600; font-size: 1.9rem; letter-spacing: .03em; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.readout .empty { color: var(--line-strong); }
.readout .svc { color: var(--muted); margin-left: .25em; }
.picker-meta { font-size: .88rem; color: var(--muted); margin-top: 10px; min-height: 1.3em; }

.fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fields .f-load, .fields .f-speed { grid-column: span 1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.field-hint { font-size: .78rem; color: var(--muted); min-height: 1.1em; font-variant-numeric: tabular-nums; }
.picker-remove {
  border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; font-size: .88rem;
  padding: 4px 6px; border-radius: var(--radius-s);
}
.picker-remove:hover { color: var(--bad); background: var(--bad-soft); }

/* ---------- Ajustar a llanta ---------- */

.rimfit { margin-top: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-m); background: var(--surface); padding: 12px 14px 14px; }
.rimfit.active { border-style: solid; border-color: var(--signal); background: var(--signal-soft); }
.rimfit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rimfit-title { font-weight: 700; }
.rimfit-body { padding: 0; }
.rimfit-body .hint { margin: 0 0 10px; }
.rimfit-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 10px; }
/* Distintivos de campo opcional / obligatorio */
.opt-badge { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  background: var(--sunken); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.rimfit.active .opt-badge { color: var(--signal-ink); background: #fff; border-color: var(--signal); }
.req-badge { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--signal-ink);
  background: var(--signal-soft); border: 1px solid var(--signal); border-radius: 999px; padding: 2px 9px; margin-left: 6px; }
.rimfit-clear { font-size: .85rem; }
.add-row { margin-top: 12px; }
.rim-range { display: block; width: 100%; font-size: .8rem; color: var(--muted); }

/* ---------- Configurador ---------- */

.limits { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; background: var(--sunken); }
.limits-title { font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.limits-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 12px; }
.unit-input { position: relative; }
.unit-input input { width: 100%; min-height: 46px; padding: 10px 44px 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--surface); font-weight: 600; font-size: 1.05rem; }
.unit-input input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(26, 115, 232, .18); }
.unit-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.cfg-list { border-top: 1px solid var(--line); margin-top: 14px; }
.cfg-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2.6fr) 150px; gap: 14px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.cfg-row.is-original { background: linear-gradient(90deg, var(--signal-soft), transparent 70%); }
.cfg-size .size-mark { display: block; }
.cfg-meta { font-size: .85rem; color: var(--muted); }
.cfg-combos { display: flex; flex-wrap: wrap; gap: 6px; }
.combo-chip { display: inline-flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 5px 10px; background: var(--surface); line-height: 1.25; }
.combo-chip b { font-family: var(--font-cond); font-size: 1.1rem; }
.combo-chip span { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cfg-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cfg-side strong { font-family: var(--font-cond); font-size: 1.3rem; }

/* ---------- Llanta en el comparador ---------- */

.wheel { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.wheel-title { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 700; margin-bottom: 8px; }
.wheel-title .opt-badge, .wheel-title .req-badge { margin-left: 0; }
.wheel-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 10px; }
.et-input { padding-right: 12px; }
.hint-ok { color: var(--ok); font-weight: 700; }
.hint-bad { color: var(--bad); font-weight: 700; }

.fitbox { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; margin-top: 14px; }
.fitbox h3 { margin: 0 0 8px; font-size: 1rem; }
.fit { margin: 0; display: grid; gap: 6px; }
.fit div { display: grid; grid-template-columns: 190px 1fr; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.fit div:last-child { border-bottom: 0; }
.fit dt { font-weight: 600; }
.fit dt span { font-weight: 400; color: var(--muted); }
.fit dd { margin: 0; }
.fit-note { font-size: .85rem; margin: 8px 0 0; }

/* ---------- Combobox con buscador ---------- */

.combo { position: relative; }
.combo-input {
  width: 100%; min-height: 46px; padding: 10px 34px 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--surface); font-weight: 600; font-size: 1.05rem; font-variant-numeric: tabular-nums;
}
.combo-input::placeholder { color: #9aa3ad; font-weight: 500; }
.combo-input:disabled { background: var(--sunken); border-color: var(--line); cursor: not-allowed; }
.combo-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(26, 115, 232, .18); }
.combo::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 8px; height: 8px; margin-top: -6px; pointer-events: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
}
.combo.open::after { transform: rotate(-135deg); margin-top: -2px; }
.combo-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: 264px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-s); box-shadow: 0 12px 28px rgba(20, 24, 28, .16); min-width: 120px;
  overscroll-behavior: contain;
}
.combo-list li {
  padding: 9px 10px; border-radius: 4px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.combo-list li small { font-weight: 400; color: var(--muted); }
.combo-list li.active { background: var(--signal-soft); }
.combo-list li.selected { box-shadow: inset 3px 0 0 var(--signal); }
.combo-list li.none { color: var(--muted); cursor: default; font-weight: 400; }

/* ---------- Botones y controles ---------- */

.tool-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: var(--radius-s); border: 1px solid transparent; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--asphalt); color: #fff; margin-left: auto; }
.btn-primary:hover { background: #000; }
.btn-quiet { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-quiet:hover { background: var(--sunken); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: .9rem; }
.btn-icon {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--sunken); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; flex: none;
}
.btn-icon svg { width: 20px; height: 20px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .95rem; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 40px; height: 24px; border-radius: 12px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--asphalt); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Avisos ---------- */

.notice { border-radius: var(--radius-s); padding: 10px 14px; margin: 0 0 10px; font-size: .94rem; border-left: 4px solid; }
.notice-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--signal); }
.notice-bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.notice-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }

/* ---------- Resultados de equivalencias ---------- */

.results { background: var(--surface); border-radius: var(--radius-m); border: 1px solid var(--line); padding: 18px; margin-bottom: 20px; }
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 12px; }
.results-head h2 { margin: 0; font-family: var(--font-cond); font-size: 1.6rem; font-weight: 700; }
.results-head p { margin: 0; color: var(--muted); font-size: .92rem; }
.results-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 12px 0 14px; }

.chips-label { font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font-weight: 600; white-space: nowrap; min-height: 36px; font-variant-numeric: tabular-nums;
}
.chip small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--asphalt); border-color: var(--asphalt); color: #fff; }
.chip[aria-pressed="true"] small { color: #c6cdd5; }

.res-list { border-top: 1px solid var(--line); margin-top: 14px; }
.res-row {
  display: grid; grid-template-columns: minmax(0, 1.2fr) 100px minmax(0, 1fr) 150px minmax(0, 1.3fr) 150px;
  align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.res-row.res-header { font-size: .8rem; font-weight: 600; color: var(--muted); padding-top: 8px; padding-bottom: 8px; }
.res-row.is-original { background: linear-gradient(90deg, var(--signal-soft), transparent 70%); }
.res-size { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.size-mark { font-family: var(--font-cond); font-weight: 600; font-size: 1.35rem; letter-spacing: .03em; font-variant-numeric: tabular-nums; margin: 0; line-height: 1.1; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--sunken); color: var(--muted); }
.tag-signal { background: var(--signal); color: var(--signal-ink); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-bad { background: var(--bad-soft); color: var(--bad); }
.num { font-variant-numeric: tabular-nums; }
.res-diam { color: var(--muted); }
.diffs { display: flex; flex-direction: column; gap: 2px; font-size: .92rem; }
.diff { font-variant-numeric: tabular-nums; font-weight: 600; }
.diff small { font-weight: 500; color: var(--muted); }
.diff.out { color: var(--muted); font-weight: 400; text-decoration: line-through; text-decoration-color: var(--line-strong); }
.res-req { font-size: .92rem; }
.count-cap { display: none; font-size: .8rem; color: var(--muted); }
.res-count { display: flex; align-items: center; gap: 10px; }
.res-count strong { font-family: var(--font-cond); font-size: 1.35rem; min-width: 3.2ch; text-align: right; font-variant-numeric: tabular-nums; }
.meter { flex: 1; height: 6px; background: var(--sunken); border-radius: 3px; overflow: hidden; min-width: 40px; }
.meter span { display: block; height: 100%; background: var(--signal); }
.cell-label { display: none; }
.empty-state { padding: 18px 4px; color: var(--muted); }

/* ---------- Comparador ---------- */

.verdict { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius-m); margin-bottom: 14px; }

/* Comparador: cabecera, veredicto y comprobaciones */
.cmp-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-bottom: 16px; }
.cmp-title .size-mark { font-size: 2rem; }
.cmp-title .size-mark.is-old { color: var(--muted); }
.cmp-arrow { font-size: 1.6rem; color: var(--signal); font-weight: 700; }
.verdict-row { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 14px; align-items: stretch; margin-bottom: 22px; }
.verdict-row .verdict { flex-direction: column; align-items: flex-start; justify-content: center; margin: 0; padding: 18px 20px; gap: 8px; }
.verdict-row .verdict-big { font-size: 3rem; }
.verdict-row .verdict p strong { display: block; font-size: 1.05rem; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-s); background: var(--sunken); }
.check strong { display: block; font-size: .98rem; }
.check span:not(.check-icon) { color: var(--muted); font-size: .92rem; }
.check-icon { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .9rem; color: #fff; margin-top: 1px; }
.check-ok .check-icon { background: var(--ok); }
.check-bad .check-icon { background: var(--bad); }
.check-warn .check-icon { background: var(--signal); color: var(--signal-ink); }
.check-bad { background: var(--bad-soft); }

/* Diagramas */
.diagrams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fig { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 12px 6px; background: var(--surface); }
.fig figcaption { font-weight: 700; font-size: .95rem; margin-bottom: 4px; }
.fig figcaption span { font-weight: 500; color: var(--muted); }
.diagram { width: 100%; height: auto; display: block; font-family: var(--font); }
.d-ground { stroke: var(--ink); stroke-width: 2; }
.d-hatch { stroke: var(--line-strong); stroke-width: 1.5; }
.d-tyre-new { fill: var(--asphalt); }
.d-rim-new { fill: #d3d8de; stroke: #9aa3ad; stroke-width: 1.5; }
.d-spoke { stroke: #9aa3ad; stroke-width: 6; stroke-linecap: round; }
.d-hub { fill: var(--asphalt-2); }
.d-outline { fill: none; stroke: #d98c00; stroke-width: 2.5; stroke-dasharray: 7 5; }
.d-dim { stroke: var(--muted); stroke-width: 1.2; }
.d-dim.is-new { stroke: var(--ink); stroke-width: 1.6; }
.d-label { font-size: 14px; font-weight: 600; fill: var(--muted); }
.d-label.is-new { fill: var(--ink); font-weight: 700; }
.d-delta { font-size: 17px; font-weight: 800; fill: var(--ink); font-family: var(--font-cond); }
.d-small { font-size: 12.5px; fill: #fff; font-weight: 600; }
.diagram .d-small[x] { paint-order: stroke; }
.d-small-dark { font-size: 13px; fill: var(--muted); font-weight: 600; }
.d-side { font-size: 13.5px; font-weight: 700; fill: var(--muted); }
.d-body { fill: #9aa3ad; }
.d-body-dark { fill: #7d8792; }
.d-shift { stroke: #d98c00; stroke-width: 3; stroke-linecap: round; }
.d-hubface { stroke: var(--bad); stroke-width: 2; stroke-dasharray: 4 4; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 10px 2px 4px; font-size: .9rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; width: 26px; height: 12px; border-radius: 3px; }
.lg-new { background: var(--asphalt); }
.lg-old { border: 2.5px dashed #d98c00; }

/* Encaje y datos */
.cmp-h { font-size: 1.15rem; margin: 26px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.stat { background: var(--sunken); border-radius: var(--radius-s); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.stat-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.stat-value strong { font-family: var(--font-cond); font-size: 1.6rem; font-weight: 700; line-height: 1.15; white-space: nowrap; }
.stat-value em { font-style: normal; font-weight: 600; }
.stat-sub { font-size: .85rem; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.cmp-card h4 { margin: 0 0 2px; font-size: .88rem; color: var(--muted); font-weight: 600; }
.cmp-count strong { font-family: var(--font-cond); font-size: 1.5rem; }
.verdict-ok { background: var(--ok-soft); color: var(--ok); }
.verdict-bad { background: var(--bad-soft); color: var(--bad); }
.verdict-big { font-family: var(--font-cond); font-weight: 700; font-size: 2.2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.verdict p { margin: 0; }
.cmp-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-top: 6px; }
.cmp-table th, .cmp-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.cmp-table th:first-child, .cmp-table td:first-child { text-align: left; }
.cmp-table thead th { font-size: .82rem; color: var(--muted); font-weight: 600; }
.cmp-table thead th .size-mark { font-size: 1.15rem; color: var(--ink); }
.speedo { margin: 14px 0 0; padding: 12px 14px; background: var(--sunken); border-radius: var(--radius-s); }
.cmp-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.cmp-card { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; }
.cmp-card h3 { margin: 0 0 4px; font-size: .88rem; color: var(--muted); font-weight: 600; }
.cmp-card .size-mark { font-size: 1.6rem; }
.cmp-card p { margin: 6px 0; }

/* ---------- Detalle (hoja) ---------- */

.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(20, 24, 28, .55); display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; }
.sheet-box { background: var(--surface); width: 100%; max-width: 1120px; border-radius: var(--radius-m); box-shadow: 0 24px 64px rgba(0, 0, 0, .3); }
.sheet-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: var(--radius-m) var(--radius-m) 0 0; }
.sheet-head .size-mark { font-size: 1.8rem; }
.sheet-sub { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.sheet-sub:empty { display: none; }
.sheet-body { padding: 16px 18px 24px; }

.filters-toggle { display: none; }
.filters-toggle svg { width: 20px; height: 20px; flex: none; }
.filters-count { background: var(--signal); color: var(--signal-ink); border-radius: 999px; min-width: 24px; height: 24px;
  padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 800; }
.filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.filters .field select {
  appearance: none; -webkit-appearance: none; min-height: 46px; padding: 10px 32px 10px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-s); background: var(--surface)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235b6570' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;
  font-weight: 600;
}
.filters .field input[type=text], .filters .field input[type=number] {
  min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); font-weight: 600; width: 100%;
}
.filters .field-pack { grid-column: span 2; }
.filters .switches { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 22px; }

.list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.list-head h3 { margin: 0; font-family: var(--font-cond); font-size: 1.4rem; }
.list-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.sort { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 700; color: var(--ink);
  background: var(--sunken); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 6px 4px 14px; }
.sort::before { content: ""; width: 16px; height: 16px; flex: none; background: var(--muted);
  -webkit-mask: no-repeat center / contain; mask: no-repeat center / contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 5v14M7 5l-3 3M7 5l3 3M17 19V5M17 19l-3-3M17 19l3-3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 5v14M7 5l-3 3M7 5l3 3M17 19V5M17 19l-3-3M17 19l3-3'/%3E%3C/svg%3E"); }
.sort select { border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 12px; background: var(--surface); font-weight: 700; color: var(--ink); min-height: 38px; cursor: pointer; }

.tyres { border-top: 1px solid var(--line); }
.tyre {
  display: grid; grid-template-columns: minmax(0, 2.4fr) 130px 100px 80px 80px minmax(0, 1.3fr) 130px;
  gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: .94rem;
}
.tyre-head { font-size: .8rem; font-weight: 600; color: var(--muted); }
.tyre-eu, .tyre-foot { display: contents; }
.tyre-name strong { display: block; font-weight: 700; }
.tyre-name span { color: var(--muted); }
.svc-code { font-family: var(--font-cond); font-weight: 600; font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eu { display: inline-flex; align-items: center; gap: 6px; }
.eu-label { display: inline-block; min-width: 22px; text-align: center; font-weight: 800; color: #fff; padding: 2px 11px 2px 7px; font-size: .85rem;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 50%, calc(100% - 7px) 100%, 0 100%); }
.eu-A { background: #0f9d4f; } .eu-B { background: #7ac143; color: #143b05; } .eu-C { background: #ffd200; color: #4a3800; }
.eu-D { background: #f39200; } .eu-E { background: #e2001a; }
.eu-cap { display: none; font-size: .78rem; color: var(--muted); }
.flags { display: flex; flex-wrap: wrap; gap: 4px; }
.tyre-end { font-size: .88rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.pager span { color: var(--muted); font-size: .9rem; }

/* ---------- Pie ---------- */

.method { padding: 8px 2px 0; color: var(--muted); }
.method h2 { color: var(--ink); font-size: 1.05rem; margin: 0 0 10px; }
.method dl { margin: 0 0 12px; display: grid; gap: 8px; }
.method dl div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.method dt { font-weight: 700; color: var(--ink); }
.method dd { margin: 0; }
.disclaimer, .source { font-size: .88rem; margin: 0 0 8px; max-width: 80ch; }
.source a { color: inherit; }
.loading { color: var(--muted); padding: 16px 0; }

/* ---------- Escritorio ---------- */

@media (min-width: 900px) {
  .fields { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- Movil ---------- */

@media (max-width: 899px) {
  .res-row.res-header, .tyre-head { display: none; }
  .res-row {
    grid-template-columns: 1fr auto; grid-template-areas: "size count" "diffs diffs" "req action";
    gap: 8px 12px; padding: 14px 2px;
  }
  .res-size { grid-area: size; }
  .res-diam { display: none; }
  .diffs { grid-area: diffs; flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
  .res-req { grid-area: req; color: var(--muted); }
  .res-count { grid-area: count; }
  .res-count .meter { display: none; }
  .res-count { flex-direction: column; align-items: flex-end; gap: 0; }
  .count-cap { display: block; }
  .res-action { grid-area: action; justify-self: end; }
  .res-diam-inline { font-size: .88rem; }
  .cell-label { display: inline; color: var(--muted); font-size: .85rem; }

  .tyre {
    grid-template-columns: 1fr auto; grid-template-areas: "name svc" "eu eu" "foot foot";
    gap: 8px 10px; padding: 12px 2px;
  }
  .tyre-name { grid-area: name; }
  .tyre-svc { grid-area: svc; text-align: right; align-self: start; }
  .tyre-eu { grid-area: eu; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
  .tyre-eu .eu-cap { display: inline; }
  .tyre-foot { grid-area: foot; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }

  .filters-toggle { display: flex; width: 100%; min-height: 52px; margin-bottom: 14px; background: var(--asphalt); color: #fff; font-size: 1.02rem; }
  .filters-toggle[aria-expanded="true"] { background: var(--sunken); color: var(--ink); border-color: var(--line-strong); }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .field-pack { grid-column: 1 / -1; }
  .filters.collapsed { display: none; }
  .cmp-cards { grid-template-columns: 1fr; }
  .cfg-row { grid-template-columns: 1fr; gap: 8px; }
  .cfg-side { flex-direction: row; justify-content: space-between; align-items: center; }
  .verdict-row { grid-template-columns: 1fr; }
  .diagrams { grid-template-columns: 1fr; }
}

@media (min-width: 900px) {
  .res-diam-inline { display: none; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 12px; }
  .masthead { padding-top: 14px; }
  .masthead::after { margin-top: 0; }
  .wordmark { font-size: 1.55rem; }
  .brand-mark { width: 40px; height: 40px; }
  .tagline { font-size: .85rem; }
  .menu-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 0 8px; }
  .seg { padding: 11px 4px 9px; font-size: .95rem; text-align: center; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  main.wrap { padding-top: 14px; }
  .tool, .results { padding: 14px; border-radius: var(--radius-m); }
  .picker { padding: 12px; }
  .readout { font-size: 1.6rem; }
  .fields { grid-template-columns: repeat(6, 1fr); }
  .fields .f-width, .fields .f-aspect, .fields .f-rim { grid-column: span 2; }
  .fields .f-load, .fields .f-speed { grid-column: span 3; }
  .tool-foot .btn-primary { width: 100%; margin-left: 0; order: 3; }
  .tool-foot .btn-quiet { flex: 1; }
  .add-row .btn { width: 100%; }
  .sheet { padding: 0; }
  .sheet-box { border-radius: 0; min-height: 100%; }
  .sheet-head { border-radius: 0; }
  .sheet-body { padding: 14px 12px 28px; }
  .method dl div { grid-template-columns: 1fr; gap: 0; }
  .fit div { grid-template-columns: 1fr; gap: 2px; }
  .verdict-big { font-size: 1.8rem; }
  .cmp-title .size-mark { font-size: 1.55rem; }
  .verdict-row .verdict-big { font-size: 2.4rem; }
  .stats { grid-template-columns: 1fr 1fr; }
  .limits-fields { grid-template-columns: 1fr; }
  .stat-value strong { font-size: 1.35rem; }
  .btn-reset { padding: 6px 12px; }
  .cmp-table { font-size: .86rem; }
  .cmp-table th, .cmp-table td { padding: 8px 4px; }
  .cmp-table td { white-space: nowrap; }
  .cmp-table td:first-child { white-space: normal; }
  .cmp-table thead th .size-mark { font-size: 1rem; display: inline-block; max-width: 4.6em; white-space: normal; text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Pie de pagina ---------- */

.site-footer { background: var(--asphalt); color: #c6cdd5; margin-top: 30px; font-size: .92rem; }
.site-footer::before { content: ""; display: block; height: 4px;
  background: repeating-linear-gradient(90deg, var(--signal) 0 28px, transparent 28px 46px); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 40px; padding-top: 26px; padding-bottom: 18px; }
.footer-brand { max-width: 520px; }
.footer-brand .wordmark { color: #fff; font-size: 1.5rem; }
.footer-brand p { margin: 8px 0 0; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: #fff; text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--signal); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--asphalt-2); padding-top: 14px; padding-bottom: 22px; font-size: .85rem; color: #9aa3ad; }

/* ---------- Paginas legales ---------- */

.legal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 28px 32px; max-width: 860px; margin: 0 auto; }
.legal h1 { font-family: var(--font-cond); font-size: 2.2rem; margin: 0 0 6px; }
.legal .updated { color: var(--muted); margin: 0 0 22px; font-size: .92rem; }
.legal h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.legal p, .legal li { max-width: 72ch; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal dl { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; margin: 0; }
.legal dt { font-weight: 600; }
.legal dd { margin: 0; }
.legal .ph { background: var(--signal-soft); color: var(--signal-ink); border-radius: 3px; padding: 0 4px; font-weight: 600; }
.legal table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.legal th, .legal td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: #fff; text-decoration: none; font-weight: 600; padding: 12px 0 10px; }
.back-link:hover { color: var(--signal); }
@media (max-width: 600px) {
  .legal { padding: 20px 16px; }
  .legal dl { grid-template-columns: 1fr; gap: 0 0; }
  .legal dd { margin-bottom: 8px; }
}

/* ---------- Contenido para buscadores ---------- */

a.seg { display: inline-flex; align-items: center; text-decoration: none; }
.intro { margin: 4px 2px 16px; }
.intro h1 { font-family: var(--font-cond); font-size: 2rem; margin: 0 0 6px; letter-spacing: .005em; }
.intro p { margin: 0; color: var(--muted); max-width: 75ch; }
.seo-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; margin-bottom: 20px; }
.seo-block h2 { margin: 0 0 12px; font-size: 1.2rem; }
.seo-block h3 { font-size: 1rem; margin: 16px 0 4px; }
.seo-block p { margin: 0 0 8px; max-width: 78ch; }
.link-grid { display: flex; flex-wrap: wrap; gap: 6px; max-width: none !important; }
.link-grid a { display: inline-block; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); text-decoration: none;
  color: var(--ink); font-family: var(--font-cond); font-weight: 600; font-size: 1.05rem; font-variant-numeric: tabular-nums; background: var(--surface); }
.link-grid a:hover { border-color: var(--asphalt); background: var(--signal-soft); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 12px; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.crumbs a { color: var(--muted); }
.seo-page { padding-top: 16px; }
.size-page h1 { margin-bottom: 8px; }
.lead-text { color: var(--muted); font-size: 1.05rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 6px; max-width: none !important; }
.cta-row .btn { text-decoration: none; margin: 0; }
.spec { margin-top: 6px !important; }
.brand-list { display: flex; flex-wrap: wrap; gap: 6px; max-width: none !important; }
.brand-list span { background: var(--sunken); border-radius: 999px; padding: 4px 10px; font-weight: 600; font-size: .9rem; }
.brand-list small { color: var(--muted); font-weight: 500; }
.eq-table a { font-family: var(--font-cond); font-weight: 600; font-size: 1.08rem; }
.size-page h3 { font-size: 1.02rem; margin: 18px 0 4px; }
.legal a, .seo-block a { color: var(--ink); text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.legal a.btn { text-decoration: none; }
.legal a.btn-primary { color: #fff; }
.link-grid a { text-decoration: none !important; }

/* ---------- Catalogo ---------- */

.fields-3 { grid-template-columns: repeat(3, minmax(0, 200px)) !important; }
.progress { height: 6px; background: var(--sunken); border-radius: 3px; overflow: hidden; max-width: 360px; }
.progress span { display: block; height: 100%; width: 0; background: var(--signal); transition: width .2s; }
.svc-size { display: block; font-weight: 700; font-size: .95rem; white-space: nowrap; }
.size-mark, .readout, .svc-code, .wordmark, .stat-value strong, .verdict-big, .results-head h2, .intro h1 { letter-spacing: -0.01em; }
@media (max-width: 600px) {
  .menu-inner { grid-template-columns: repeat(2, 1fr) !important; }
  .fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

/* ---------- Menu con iconos y version movil ---------- */

.seg { display: inline-flex; align-items: center; gap: 8px; }
.seg-icon { width: 18px; height: 18px; flex: none; opacity: .85; }
.seg.active .seg-icon { color: var(--signal); opacity: 1; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .masthead { padding-top: 10px; }
  .brand-mark { width: 34px; height: 34px; }
  .wordmark { font-size: 1.35rem; }
  .tagline { font-size: .78rem; margin-top: 2px; }
  .menu { margin-top: 8px; }
  .menu-inner { grid-template-columns: repeat(4, 1fr) !important; gap: 0; padding: 0 4px; }
  .seg { flex-direction: column; gap: 3px; padding: 8px 2px 7px; font-size: .74rem; font-weight: 600; border-radius: 6px 6px 0 0; min-width: 0; }
  .seg-icon { width: 20px; height: 20px; }
  .seg .lbl-short { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .intro { margin: 2px 2px 12px; }
  .intro h1 { font-size: 1.35rem; margin-bottom: 4px; }
  .intro p { font-size: .9rem; line-height: 1.45; }
  .tool { padding: 12px; }
  .tool-head { flex-wrap: nowrap; }
  .vehicle { gap: 6px; min-width: 0; }
  .vehicle label { font-size: .85rem; }
  .vehicle select { min-width: 0; padding: 6px 28px 6px 10px; font-size: .92rem; }
  .btn-reset { padding: 6px 10px; font-size: .85rem; min-height: 34px; white-space: nowrap; }
  .picker { padding: 10px; }
  .picker-head { margin-bottom: 8px; }
  .readout { font-size: 1.35rem; }
  .fields { gap: 8px; }
  .field > label { font-size: .76rem; }
  .combo-input { min-height: 42px; padding: 8px 26px 8px 10px; font-size: .98rem; }
  .combo::after { right: 10px; width: 7px; height: 7px; }
  .field-hint { font-size: .74rem; }
  .picker-meta { font-size: .8rem; margin-top: 8px; min-height: 0; }
  .btn { min-height: 44px; }
  .results-head h2 { font-size: 1.3rem; }
  .results-head p { font-size: .85rem; }
  .seo-block { padding: 14px; }
  .seo-block h2 { font-size: 1.05rem; }
  .seo-block p, .method { font-size: .92rem; }
}
@media (max-width: 360px) {
  .seg { font-size: .68rem; }
  .btn-reset svg { display: none; }
}
.field-hint:empty, .picker-meta:empty { display: none; }
.fields-3 .field { grid-column: auto !important; }
@media (max-width: 600px) {
  .limits { padding: 12px; }
  .limits-fields { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .limits .field-hint { display: none; }
  .unit-input input { min-height: 42px; padding-right: 38px; }
}

/* ---------- Comparar desde el configurador ---------- */

button.combo-chip { cursor: pointer; font: inherit; text-align: left; color: inherit; }
button.combo-chip:hover { border-color: var(--asphalt); background: var(--signal-soft); }
.cfg-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cc-controls { position: sticky; top: 74px; z-index: 4; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 12px 14px; margin-bottom: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; box-shadow: 0 6px 16px rgba(20, 24, 28, .06); }
.cc-group { min-width: 0; }
.cc-label { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.chip.is-fit { border-color: var(--ok); }
.chip.is-fit:not([aria-pressed="true"])::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-left: 6px; vertical-align: middle; }
.cc-et { display: flex; align-items: center; gap: 10px; }
.cc-et .btn-icon { width: 38px; height: 38px; font-size: 1.3rem; font-weight: 700; }
.cc-et input[type=range] { flex: 1; -webkit-appearance: none; appearance: none; height: 8px; border-radius: 4px; background: var(--line); min-width: 80px; }
.cc-et input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--asphalt); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer; }
.cc-et input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--asphalt); border: 3px solid #fff; cursor: pointer; }
.cc-et output { font-weight: 800; font-size: 1.15rem; min-width: 4.2ch; text-align: right; font-variant-numeric: tabular-nums; }
.cc-hint { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.cc-foot { margin: 16px 0 0; }
.sheet .cmp .cmp-title { display: none; }
@media (max-width: 760px) {
  .cc-controls { grid-template-columns: 1fr; padding: 10px; }
}
@media (max-width: 760px) {
  .cc-controls { position: static; box-shadow: none; }
  .cfg-side { flex-wrap: wrap; }
  .cfg-btns { width: 100%; }
  .cfg-btns .btn { flex: 1; }
}

/* Comparar en directo: resumen y mando fijo abajo en movil */
.sheet-body.cc-mode { display: flex; flex-direction: column; }
.sheet-body.cc-mode .cc-controls { order: -1; }
.cc-summary { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 8px 12px; border-radius: var(--radius-s);
  font-size: .92rem; font-variant-numeric: tabular-nums; }
.cc-summary strong { font-size: 1rem; }
.cc-summary b { font-weight: 800; }
.cc-summary.is-ok { background: var(--ok-soft); color: var(--ok); }
.cc-summary.is-bad { background: var(--bad-soft); color: var(--bad); }

@media (max-width: 760px) {
  .sheet-body.cc-mode { padding-bottom: 0; }
  .sheet-body.cc-mode .cc-controls {
    order: 2; position: sticky; bottom: 0; top: auto; margin: 14px -12px 0; border-radius: 14px 14px 0 0; border-bottom: 0;
    box-shadow: 0 -8px 24px rgba(20, 24, 28, .14); gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }
  .sheet-body.cc-mode .cc-foot { order: 1; }
  .cc-controls .cc-label { display: none; }
  .cc-widths { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .cc-widths .chip { min-height: 40px; padding: 6px 14px; }
  .cc-et { gap: 8px; }
  .cc-et .btn-icon { width: 44px; height: 44px; }
  .cc-et input[type=range] { height: 10px; }
  .cc-et input[type=range]::-webkit-slider-thumb { width: 30px; height: 30px; }
  .cc-et input[type=range]::-moz-range-thumb { width: 26px; height: 26px; }
  .cc-hint { font-size: .8rem; margin-top: 2px; }
  .cc-summary { font-size: .85rem; padding: 6px 10px; gap: 2px 10px; }
  .sheet-body.cc-mode .cc-note { display: none; }
  .sheet-body.cc-mode .cc-art, .sheet-body.cc-mode .mini { width: 52px; height: 52px; }
  .cc-tab { padding: 8px 2px; font-size: .84rem; }
  .mt { padding: 6px 7px; }
  .mt-v { font-size: .98rem; }
}
@media (max-width: 600px) {
  .sheet-head { padding: 10px 12px; }
  .sheet-head .size-mark { font-size: 1.3rem; }
  .sheet-sub { font-size: .8rem; }
}
.sheet-body.cc-mode .diagrams .fig:nth-child(2) { order: -1; }

/* Criterios del configurador */
.criteria-switches { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 12px; }
.combo-chip.is-out { border-color: #e0a14a; background: #fff8ee; }
.combo-chip.is-out b small { display: block; font-family: var(--font); font-size: .7rem; font-weight: 700; color: #a85d00; }
.chip.is-out { border-style: dashed; border-color: #e0a14a; }

/* Sugerencias de modelo */
.suggest::after { display: none; }
.suggest .combo-input { padding-right: 12px; }
@media (max-width: 600px) { .filters .field-model { grid-column: 1 / -1; } }
.suggest .combo-list li { flex-direction: column; gap: 1px; }
.suggest .combo-list li span, .suggest .combo-list li small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Modo delincuente */
.criteria-wrap { margin-top: 14px; }
.criteria-wrap .criteria { margin-top: 12px; border-color: var(--signal); background: var(--signal-soft); }
.criteria-note { margin: 0 0 12px; font-size: .88rem; color: var(--signal-ink); }
.switch-rogue { font-weight: 600; }
.switch-rogue input:checked + .switch-ui { background: var(--signal); }

/* Destellos de policia del modo delincuente (1,3 s, pantalla completa) */
.police-flash { position: fixed; inset: 0; z-index: 9999; pointer-events: none; animation: pf-fade 1.3s ease-out forwards; }
.police-flash i { position: absolute; inset: 0; opacity: 0; }
.pf-r { background: radial-gradient(circle at 0% 30%, rgba(255, 30, 30, .9), rgba(255, 30, 30, .35) 35%, transparent 70%); animation: pf-on .26s steps(1) 5; }
.pf-b { background: radial-gradient(circle at 100% 30%, rgba(30, 90, 255, .9), rgba(30, 90, 255, .35) 35%, transparent 70%); animation: pf-on .26s steps(1) .13s 5; }
@keyframes pf-on { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes pf-fade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
.criteria-wrap .criteria.flash { animation: police-glow .6s steps(1) 4; }
@keyframes police-glow {
  0% { box-shadow: 0 0 0 3px rgba(255, 43, 43, .45); }
  50% { box-shadow: 0 0 0 3px rgba(43, 107, 255, .45); }
}
@media (prefers-reduced-motion: reduce) {
  .criteria-wrap .criteria.flash { animation: none; }
}

/* Hoja de comparacion: barra con medidores, pestanas, mapa */
.cc-controls { display: flex; flex-direction: column; gap: 10px; }
.cc-origins { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-mini-label { font-size: .8rem; font-weight: 700; color: var(--muted); }
.cc-meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cc-meters-lite { grid-template-columns: 1fr; }
.mt { background: var(--sunken); border-radius: var(--radius-s); padding: 7px 9px; min-width: 0; }
.mt-l { display: block; font-size: .72rem; color: var(--muted); }
.mt-v { display: block; font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.mt-max { display: block; font-size: .66rem; color: var(--muted); }
.mt-bar { height: 5px; border-radius: 3px; background: var(--line); margin-top: 5px; overflow: hidden; }
.mt-bar i { display: block; height: 100%; border-radius: 3px; background: var(--ok); }
.mt.is-warn .mt-bar i { background: var(--signal); }
.mt.is-bad .mt-bar i { background: var(--bad); }
.mt.is-warn .mt-v { color: var(--warn); }
.mt.is-bad .mt-v { color: var(--bad); }
.mt.is-empty .mt-v { color: var(--muted); }
.cc-tabs { display: grid; gap: 4px; background: var(--sunken); border-radius: var(--radius-s); padding: 3px; }
.cc-tab { border: 0; background: transparent; font: inherit; font-size: .9rem; font-weight: 600; padding: 9px 4px; border-radius: 5px; color: var(--muted); cursor: pointer; }
.cc-tab.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(20,24,28,.12); }
.cc-panels { min-width: 0; }
.cc-panel { display: flex; flex-direction: column; gap: 10px; }
.cc-panel[hidden] { display: none; }
.cam-row, .gap-row { display: flex; align-items: center; gap: 12px; }
.cam-sliders { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gap-field { flex: 1; min-width: 0; }
.gap-field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.cc-art { flex: none; width: 66px; }
.cc-note { font-size: .78rem; margin: 2px 0 0; }
.mini { width: 66px; height: 66px; display: block; }
.mini-ref { stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 3 3; }
.mini-ground { stroke: var(--ink); stroke-width: 2; }
.mini-old { fill: none; stroke: #d98c00; stroke-width: 2; stroke-dasharray: 4 3; }
.mini-new { fill: var(--asphalt); }
.mini-arch { fill: none; stroke: var(--asphalt-2); stroke-width: 4; stroke-linecap: round; }
.mini-wheel { fill: none; stroke: var(--asphalt); stroke-width: 5; }
.mini-gap { stroke-width: 4; stroke-linecap: round; }
.mini-gap.is-ok { stroke: var(--ok); }
.mini-gap.is-warn { stroke: var(--signal); }
.mini-gap.is-bad { stroke: var(--bad); }
/* Mapa de llantas y legenda */
.cc-card { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; margin-bottom: 16px; background: var(--surface); }
.cc-card .cmp-h { margin: 0 0 10px; }
.cc-card .cmp-h small, .cmp-h small { font-weight: 500; color: var(--muted); font-size: .8rem; margin-left: 6px; }
.cc-full { grid-column: 1 / -1; }
.map-grid { display: grid; gap: 3px; font-size: .78rem; font-variant-numeric: tabular-nums; }
.map-h { color: var(--muted); font-weight: 700; text-align: center; align-self: center; }
.map-w { text-align: left; color: var(--ink); }
.map-cell { height: 34px; border-radius: 5px; border: 1px solid transparent; padding: 0; cursor: pointer; }
.mc-ok { background: #cfead9; border-color: #8fcaa6; }
.mc-out { background: #ffe3b3; border-color: #e0a14a; }
.mc-bad { background: #f6d5d2; border-color: #e7aaa4; }
.map-cell.is-sel { outline: 3px solid var(--asphalt); outline-offset: 1px; }
.map-axis { font-size: .75rem; text-align: right; margin: 4px 0 0; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.map-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; border: 1px solid transparent; }
.tune-field label { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.tune-field output { font-weight: 800; font-variant-numeric: tabular-nums; }
.tune-field input[type=range] { width: 100%; accent-color: var(--asphalt); height: 28px; }
.cc-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.res-action { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.btn-cmp { border-color: var(--asphalt); }
@media (max-width: 760px) {
  .res-action { flex-direction: row; }
  .cc-card { padding: 10px 12px; }
}
.d-arch { fill: none; stroke: var(--asphalt-2); stroke-width: 5; stroke-linecap: round; }
.d-profile { fill: var(--asphalt); }
.d-rimcut { fill: none; stroke: #9aa3ad; stroke-width: 6; stroke-linejoin: round; }
.d-state { font-size: 15px; font-weight: 800; }
.d-state-ok { fill: var(--ok); }
.d-state-bad { fill: var(--bad); }
.cc-card .cmp-h { border-top: 0; padding-top: 0; margin-top: 0; }

/* Barra de navegacion inferior en movil (al alcance del pulgar) */
@media (max-width: 600px) {
  .menu { position: fixed; left: 0; right: 0; bottom: 0; top: auto; margin: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(20, 24, 28, .08);
    padding: 0 0 env(safe-area-inset-bottom); }
  .menu-inner { grid-template-columns: repeat(4, 1fr) !important; gap: 0; padding: 0; overflow: visible; }
  .seg { color: var(--muted); background: transparent; border-radius: 0; border-bottom: 0; box-shadow: none;
    padding: 8px 2px 7px; min-height: 54px; justify-content: center; }
  .seg:hover { background: transparent; color: var(--muted); }
  .seg-icon { opacity: 1; width: 22px; height: 22px; }
  .seg.active { color: var(--asphalt); background: transparent; box-shadow: inset 0 3px 0 var(--signal); }
  .seg.active .seg-icon { color: var(--asphalt); opacity: 1; }
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
}

/* Resultados en tarjetas */
.eqcards, .cfgcards { display: flex; flex-direction: column; gap: 10px; }
.eqcard, .cfgcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; position: relative; }
.eqcard.is-best { border-color: var(--signal); box-shadow: inset 0 0 0 1px var(--signal); }
.eqcard.is-original, .cfgcard.is-original { background: var(--signal-soft); border-color: var(--signal); }
.eqcard-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; color: var(--signal-ink); background: var(--signal-soft); padding: 3px 10px; border-radius: 999px; margin-bottom: 9px; }
.eqcard-top, .cfgcard-top { display: flex; align-items: center; gap: 8px; }
.eqcard-top .size-mark, .cfgcard-top .size-mark { font-size: 1.35rem; }
.diff-pill { font-size: .85rem; font-weight: 700; padding: 4px 11px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-off { background: var(--sunken); color: var(--muted); }
.eqcard-meta, .cfgcard-meta { font-size: .85rem; color: var(--muted); margin: 7px 0 0; }
.warn-text { color: var(--warn); font-weight: 600; }
.eqcard-diffs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.mini-pill { font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.mini-pill small { font-weight: 500; }
.eqcard-count, .cfgcard-count { margin-top: 11px; font-size: .9rem; }
.eqcard-count b, .cfgcard-count b { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.eqcard-count span, .cfgcard-count span { color: var(--muted); }
.eqcard-acts, .cfgcard-acts { display: flex; gap: 8px; margin-top: 12px; }
.eqcard-acts .btn, .cfgcard-acts .btn { flex: 1; }
.cfgcard-combos { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.eqcard-count .meter, .cfgcard-count .meter { margin-top: 6px; width: 100%; }
.cfgcard-hint { font-size: .8rem; color: var(--muted); margin: 11px 0 0; }
.cfgcard-combos { margin-top: 7px; }

/* Entrada de medida mas grande y comoda en movil */
@media (max-width: 600px) {
  .picker { padding: 14px 12px; }
  .picker-head { align-items: center; margin-bottom: 12px; }
  .picker-head > div:first-child { flex: 1; text-align: center; }
  .picker-name { font-size: .78rem; margin-bottom: 2px; }
  .readout { font-size: 1.85rem; }
  .combo-input { min-height: 50px; font-size: 1.12rem; }
  .fields { gap: 9px; }
  .vehicle select { min-height: 46px; }
  .tool-foot .btn-primary { min-height: 52px; font-size: 1.05rem; }
}

/* Tirador para plegar la barra de configuraciones (movil) */
.cc-grab { display: none; }
@media (max-width: 600px) {
  .cc-grab { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 100%; border: 0; background: transparent; padding: 0 0 2px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .cc-grab-dash { width: 42px; height: 5px; border-radius: 3px; background: var(--line-strong); }
  .cc-grab-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--muted);
    background: var(--sunken); padding: 6px 14px; border-radius: 999px; transition: background .15s, color .15s; }
  .cc-grab:hover .cc-grab-pill, .cc-grab:active .cc-grab-pill { background: var(--signal-soft); color: var(--signal-ink); }
  .cc-grab-chev { width: 15px; height: 15px; transition: transform .2s; }
  .cc-controls.is-collapsed .cc-grab-chev { transform: rotate(180deg); }
  .cc-controls.is-collapsed .cc-collapse { display: none; }
  .cc-controls.is-collapsed { gap: 7px; }
}

/* Dock de configuraciones: cabecera estado + tirador fusionados, con mas aire */
.cc-dash { display: none; }
.cc-dockhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; padding: 2px; border-radius: var(--radius-s); }
.cc-dockhead:hover .cc-chev, .cc-dockhead:active .cc-chev { background: var(--signal-soft); color: var(--signal-ink); }
.cc-chev { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--sunken); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.cc-chev svg { width: 16px; height: 16px; transition: transform .2s; }
.cc-controls.is-collapsed .cc-chev svg { transform: rotate(180deg); }
.cc-status { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 1rem; font-weight: 800; }
.cc-status strong { font-weight: 800; }
.cc-status.is-ok { color: var(--ok); }
.cc-status.is-bad { color: var(--bad); }
.cc-status-sub { color: var(--muted); font-weight: 600; font-size: .85rem; white-space: nowrap; }
.cc-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--signal); background: var(--signal-soft);
  border-radius: 999px; padding: 8px 14px; font-size: .82rem; font-weight: 700; color: var(--signal-ink); cursor: pointer; flex: none; transition: background .15s; }
.cc-toggle:hover, .cc-toggle:active { background: #ffe9a6; }
.cc-toggle-ico { width: 16px; height: 16px; flex: none; }
.cc-toggle-chev { width: 14px; height: 14px; transition: transform .2s; }
.cc-controls.is-collapsed .cc-toggle-chev { transform: rotate(180deg); }
.cc-controls.is-collapsed .cc-collapse { display: none; }
.cc-collapse { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.cc-meters { gap: 9px; }
/* Equivalencias: selector simple de ancho de llanta (sin dock) */
.cc-simple { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }

/* Hoja a pantalla completa en movil (alto dinamico, deja respirar al navegador) */
@media (max-width: 600px) {
  .sheet { top: 0; left: 0; right: 0; bottom: auto; height: 100dvh; max-height: 100dvh; padding: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .sheet-box { min-height: 100dvh; }
  .cc-dash { display: block; width: 42px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 10px; }
  .cc-status { font-size: .95rem; }
  .cc-toggle { padding: 9px 14px; }
}

/* Selector de medida estilo matricula (no parece formulario) */
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.picker-name { font-family: var(--font-cond); font-size: 1.2rem; font-weight: 700; color: var(--ink); letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 8px; }
.picker-name::before { content: ""; width: 18px; height: 18px; flex: none; background: var(--signal);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 3.5px, #000 4px, #000 6px, transparent 6.5px) no-repeat center / 100% 100%;
  mask: radial-gradient(circle at 50% 50%, transparent 3.5px, #000 4px, #000 6px, transparent 6.5px) no-repeat center / 100% 100%; }
.plate { background: var(--sunken); border: 2px solid var(--line-strong); border-radius: var(--radius-m); padding: 16px 10px 14px; box-shadow: 0 4px 16px rgba(20, 24, 28, .09); }
.plate-size { display: flex; align-items: stretch; justify-content: center; gap: 7px; }
.plate-size .field { margin: 0; min-width: 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 6px 4px 7px; transition: border-color .15s, box-shadow .15s; }
.plate-size .field:focus-within { border-color: var(--asphalt); box-shadow: 0 2px 10px rgba(20, 24, 28, .12); }
.plate-size .field:has(.combo-input:disabled) { background: var(--sunken); border-color: var(--line); }
.plate-size .f-width { flex: 0 1 94px; }
.plate-size .f-aspect { flex: 0 1 80px; }
.plate-size .f-rim { flex: 0 1 98px; }
.plate-sep { align-self: center; font-family: var(--font-cond); font-size: 2rem; font-weight: 600; color: var(--line-strong); line-height: 1; }
.plate-size .combo-input { text-align: center; font-family: var(--font-cond); font-size: 2rem; font-weight: 600;
  min-height: 46px; padding: 2px; border: 0; background: transparent; color: var(--ink); width: 100%; min-width: 0; }
.plate-size .combo-input:focus { outline: none; box-shadow: none; }
.plate-size .combo-input::placeholder { font-family: var(--font-cond); font-size: 2rem; font-weight: 600; color: var(--line-strong); }
.plate-size .combo::after { display: none; }
.plate-size .combo-input:disabled { color: var(--line-strong); }
.plate-cap { display: block; text-align: center; font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-top: 2px; }
.plate-size .field:focus-within .plate-cap { color: var(--asphalt); }
.plate-svc { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.plate-svc .field { margin: 0; text-align: center; }
.plate-svc .field label { display: block; font-size: .72rem; color: var(--muted); font-weight: 700; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.plate-svc .combo-input { text-align: center; min-height: 44px; min-width: 0; width: 100%; font-size: 1.05rem; }
.plate-svc .field-hint { font-size: .72rem; color: var(--muted); margin-top: 4px; }
@media (max-width: 600px) {
  .plate-size .combo-input { font-size: 1.8rem; min-height: 58px; }
  .plate-sep { font-size: 1.7rem; }
  .plate-size .f-width { flex-basis: 82px; }
  .plate-size .f-aspect { flex-basis: 70px; }
  .plate-size .f-rim { flex-basis: 88px; }
}

/* Arrastre tactil de los deslizadores dentro del dock */
.cc-controls input[type=range] { touch-action: none; }

/* Leyenda dentro de cada diagrama */
.fig-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.fig-legend span { display: inline-flex; align-items: center; gap: 7px; }
.fig-legend i { display: inline-block; width: 22px; height: 10px; border-radius: 3px; flex: none; }
.fig-legend .lg-new { background: var(--asphalt); }
.fig-legend .lg-old { border: 2.5px dashed #d98c00; height: 6px; }

/* Lee tu neumatico */
.tyre-help { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 999px; padding: 8px 15px; font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.tyre-help:hover { background: var(--signal-soft); border-color: var(--signal); }
.tyre-help svg { width: 18px; height: 18px; color: var(--signal-ink); flex: none; }
.tyre-guide { max-width: 560px; margin: 0 auto; }
.tg-diagram { width: 100%; max-width: 340px; display: block; margin: 0 auto 6px; }
.tg-tyre { fill: var(--asphalt); }
.tg-rim { fill: #c7ccd2; stroke: #9aa3ad; stroke-width: 1.5; }
.tg-dim { stroke: var(--muted); stroke-width: 1.6; }
.tg-lab { fill: var(--muted); font-size: 13px; font-weight: 700; font-family: var(--font); }
.tg-cal { transition: opacity .15s; }
.tg-diagram.is-l .tg-cal, .tg-diagram.is-s .tg-cal { opacity: .4; }
.tg-diagram.is-w .tg-cal-a, .tg-diagram.is-w .tg-cal-r,
.tg-diagram.is-a .tg-cal-w, .tg-diagram.is-a .tg-cal-r,
.tg-diagram.is-r .tg-cal-w, .tg-diagram.is-r .tg-cal-a { opacity: .4; }
.tg-diagram.is-w .tg-cal-w .tg-dim, .tg-diagram.is-a .tg-cal-a .tg-dim { stroke: var(--signal-ink); stroke-width: 2.2; }
.tg-diagram.is-w .tg-cal-w .tg-lab, .tg-diagram.is-a .tg-cal-a .tg-lab, .tg-diagram.is-r .tg-cal-r .tg-lab { fill: var(--ink); }
.tg-diagram.is-r .tg-cal-r .tg-rim { fill: var(--signal); stroke: var(--signal-ink); }
.tg-code { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; margin: 12px 0; }
.tg-sep { font-family: var(--font-cond); font-size: 1.8rem; font-weight: 600; color: var(--muted); }
.tg-chip { font-family: var(--font-cond); font-size: 1.8rem; font-weight: 700; border: 2px solid var(--line-strong); background: var(--surface);
  color: var(--ink); border-radius: 10px; padding: 4px 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.tg-chip.is-on { border-color: var(--signal); background: var(--signal-soft); }
.tg-desc { background: var(--sunken); border-radius: var(--radius-m); padding: 14px 16px; font-size: .95rem; line-height: 1.55; }
.tg-desc strong:first-child { display: block; font-size: 1.05rem; margin-bottom: 4px; }

/* Compartir */
.tool-head-btns { display: flex; gap: 8px; flex-wrap: nowrap; flex: none; }
.share { max-width: 360px; margin: 0 auto; text-align: center; }
.share-qr { display: inline-block; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); }
.share-qr svg { display: block; }
.share-hint { font-size: .88rem; color: var(--muted); margin: 10px 0 16px; }
.share-url { display: flex; gap: 8px; margin-bottom: 12px; }
.share-url input { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 10px 12px; font-size: .9rem; background: var(--sunken); color: var(--ink); }
.share .btn-quiet { width: 100%; }

/* ============================================================
   MODO OSCURO (automatico segun el sistema).
   Bloque aislado: para desactivarlo, borra todo este bloque.
   ============================================================ */
/* Se aplica con data-theme="dark" (lo pone el selector sol/luna; por defecto sigue al sistema) */
:root[data-theme="dark"] {
    color-scheme: dark;
    --asphalt: #2b3340;
    --asphalt-2: #38414f;
    --ink: #e7ebef;
    --paper: #14171b;
    --surface: #1c2127;
    --sunken: #242b33;
    --line: #333c45;
    --line-strong: #49545f;
    --muted: #a3adb8;
    --signal: #f5b800;
    --signal-soft: #39300a;
    --signal-ink: #f3cf5e;
    --ok: #4ccf87;
    --ok-soft: #123025;
    --warn: #e6b450;
    --warn-soft: #352b0b;
    --bad: #ff6f63;
    --bad-soft: #3a1714;
    --focus: #4a9eff;
}
[data-theme="dark"] .share-qr { background: #fff; }
[data-theme="dark"] .d-small { fill: #fff; }
[data-theme="dark"] .cc-controls { background: #10151b; }

/* Botones compactos de la cabecera (Compartir / Limpiar comparten fila) */
.btn-mini { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-weight: 600; font-size: .85rem; padding: 6px 12px; border-radius: 999px; cursor: pointer; min-height: 36px; }
.btn-mini svg { width: 16px; height: 16px; flex: none; }
.btn-mini:hover { background: var(--sunken); }
#btnReset.btn-mini:hover { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
@media (max-width: 540px) {
  .btn-mini .lbl { display: none; }
  .btn-mini { padding: 8px; }
}
/* Catalogo: matricula con hueco entre bloques como el resto */
.plate-cat .plate-size { gap: 7px; }

/* Ajustes de MODO OSCURO adicionales (dentro del bloque aislado de abajo tambien valdria) */
[data-theme="dark"] .seg.active { color: var(--ink); }
[data-theme="dark"] .seg.active .seg-icon { color: var(--signal); }
[data-theme="dark"] .eu-B { color: #0a2b02; }

/* Acceso discreto "?" al diagrama de la medida */
.ph-left { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.tg-open { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--muted); font-weight: 700; font-size: .82rem; line-height: 1; cursor: pointer; flex: none; padding: 0; }
.tg-open:hover { background: var(--signal-soft); border-color: var(--signal); color: var(--signal-ink); }
@media (max-width: 1040px) { .brand-pill { display: none; } }

/* Dock del configurador: gris diferenciado, camber siempre visible, boton con texto */
.cc-controls { background: #e5e9ef; }
.cc-controls .mt { background: var(--surface); }
.cc-quick { margin-top: 10px; }
.cc-quick .cam-row { display: flex; align-items: center; gap: 12px; }
.cc-toglabel { display: inline-flex; align-items: center; gap: 6px; flex: none; background: var(--signal-soft); color: var(--signal-ink);
  border: 1px solid var(--signal); border-radius: 999px; padding: 7px 13px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.cc-toglabel-chev { width: 14px; height: 14px; transition: transform .2s; }
.cc-controls.is-collapsed .cc-toglabel-chev { transform: rotate(180deg); }

/* Selector de tema sol/luna */
.brand-side { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.theme-toggle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--sunken);
  color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.theme-toggle:hover { background: var(--line); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .ic-sun { display: none; }
.theme-toggle .ic-moon { display: inline; }
[data-theme="dark"] .theme-toggle .ic-sun { display: inline; }
[data-theme="dark"] .theme-toggle .ic-moon { display: none; }

/* Valor de camber visible con el configurador contraido */
.cc-camread { margin-top: 8px; font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cc-camread b { color: var(--ink); font-weight: 700; }
.cc-camread:empty { display: none; }
.cc-controls:not(.is-collapsed) .cc-camread { display: none; }
