/* Módulo de unidades. Mobile-first: el técnico lo usa desde el celular en campo. */
:root {
  --info: #1d5fbf;
  --info-soft: #e4eefc;
  --ready: #0B3EA8;
  --ready-soft: #e6edfb;
  --ill-ink: #1d2a3d;
  --ill-body: #ffffff;
  --ill-soft: #e6ecf2;
  --ill-glass: #cfe6f2;
  --ill-tire: #2a3546;
  --ill-box: #e9cf9f;
  --ill-box-2: #d8b77a;
  --tap: 48px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --info: #7cb0ff;
    --info-soft: #14284a;
    --ready: #8fb0ff;
    --ready-soft: #16295c;
    --ill-ink: #c9d6e6;
    --ill-body: #1a2c45;
    --ill-soft: #24384f;
    --ill-glass: #1d4560;
    --ill-tire: #0b1424;
    --ill-box: #6b5631;
    --ill-box-2: #57462a;
  }
}

.small { font-size: 12.5px; }
.narrow { max-width: 720px; margin: 0 auto; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.btn-lg { height: var(--tap); padding: 0 18px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.ready { background: var(--ready-soft); color: var(--ready); }
h3.sub { font-size: 13.5px; margin: 8px 0 0; }
textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; resize: vertical;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* -- navegación con iconos ----------------------------------------------- */
.nav a { display: inline-flex; align-items: center; gap: 6px; }
.nav-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn-sm .nav-ico, .tl-head .nav-ico { width: 16px; height: 16px; }
.tl-head strong, h3.sub { display: inline-flex; align-items: center; gap: 6px; }
h3.sub .nav-ico { color: var(--accent); }
.doc h2 { display: flex; align-items: center; gap: 8px; }
.doc h2 .nav-ico { color: var(--accent); }

/* -- campos -------------------------------------------------------------- */
.form { gap: 18px; }
.field { gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text); }
.field-hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.field input, .field select { height: var(--tap); font-size: 16px; padding: 0 12px; border-radius: 10px; width: 100%; }
.field textarea { font-size: 16px; }
.plate-input, .plate-text { font-family: var(--mono); font-weight: 700; letter-spacing: 1px; }

.seg { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg-btn {
  flex: 1; min-height: 40px; border: none; border-right: 1px solid var(--border); background: transparent; color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; padding: 0 12px;
}
.seg-btn:last-child { border-right: none; }
@media (hover: hover) { .seg-btn:not(.on):hover:not(:disabled) { background: var(--surface-2); } }
.seg-btn:disabled { opacity: .4; cursor: not-allowed; }
.seg-btn.on { background: var(--accent); color: var(--accent-text); }
.seg-btn.on.ok { background: var(--ok); color: #fff; }
.seg-btn.on.bad { background: var(--bad); color: #fff; }
.seg-lg .seg-btn { min-height: var(--tap); font-size: 15px; }

/* -- checks como tarjetas grandes --------------------------------------- */
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-card {
  position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start;
  padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface);
  cursor: pointer; color: var(--text); font-size: 14px; font-weight: 400; min-height: var(--tap);
  transition: border-color .12s, background .12s;
}
.check-card input { position: absolute; opacity: 0; pointer-events: none; }
.check-card:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.check-mark { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; margin-top: 1px; }
.check-mark::after { content: ""; width: 8px; height: 14px; border: solid transparent; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg); }
.check-text { display: flex; flex-direction: column; gap: 2px; }
.check-text strong { font-weight: 600; line-height: 1.35; }
.check-text small { color: var(--muted); font-size: 12.5px; }
.check-card.on { border-color: var(--ok); background: var(--ok-soft); }
.check-card.on .check-mark { background: var(--ok); border-color: var(--ok); }
.check-card.on .check-mark::after { border-color: #fff; }

/* -- comandos ------------------------------------------------------------ */
.cmd { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.cmd-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.cmd-text { font-size: 14px; font-weight: 600; word-break: break-all; line-height: 1.5; color: var(--text); user-select: all; }
.cmd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cmd-actions .btn { height: 40px; }

/* -- ilustraciones (SVG en línea, colores del tema) ---------------------- */
.illus svg { display: block; width: 100%; height: auto; }
.illus-step { max-width: 300px; margin: 0 auto; }
.illus-empty { max-width: 220px; margin: 0 auto 8px; }
.illus-mini { width: 72px; flex: none; }
.illus-card { background: var(--surface-2); padding: 16px 24px; border-bottom: 1px solid var(--border); }
.illus-card svg { max-height: 150px; }
.i-line { fill: none; stroke: var(--ill-ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.i-thin { stroke-width: 1.4; opacity: .7; }
.i-thick { stroke-width: 4; }
.i-body { fill: var(--ill-body); stroke: var(--ill-ink); stroke-width: 2.2; stroke-linejoin: round; }
.i-soft { fill: var(--ill-soft); }
.i-glass { fill: var(--ill-glass); }
.i-tire { fill: var(--ill-tire); }
.i-tire-line { fill: none; stroke: var(--ill-tire); stroke-width: 9; stroke-linecap: round; }
.i-acc { fill: var(--accent); }
.i-acc-soft { fill: var(--accent-soft); }
.i-acc-line { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.i-dash { stroke-dasharray: 5 5; }
.i-lens { fill: var(--ill-tire); stroke: var(--brand-teal); stroke-width: 2; }
.i-chip { fill: none; stroke: var(--accent-text); stroke-width: 2; opacity: .7; stroke-linecap: round; }
.i-on-acc { fill: none; stroke: var(--accent-text); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.i-on-acc-fill { fill: var(--accent-text); }
.i-map { fill: none; stroke: var(--ill-body); stroke-width: 6; opacity: .8; }
.i-plate { fill: #ffd54a; stroke: var(--ill-ink); stroke-width: 1.5; }
.i-box { fill: var(--ill-box); stroke: var(--ill-ink); stroke-width: 2.2; }
.i-box-flap { fill: var(--ill-box-2); stroke: var(--ill-ink); stroke-width: 2.2; stroke-linejoin: round; }
.i-barcode { stroke: var(--ill-ink); stroke-width: 2; }
.i-label { fill: var(--muted); font: 600 13px system-ui, sans-serif; }
.i-mini { fill: var(--ill-ink); font: 700 8px system-ui, sans-serif; letter-spacing: 1px; }

/* Cotas ADAS: la medida activa se resalta con el color de acento. */
.dim-line { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.dim-ext { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .7; }
.dim-lbl circle { fill: var(--surface); stroke: var(--muted); stroke-width: 2; }
.dim-lbl text { fill: var(--text); font: 800 14px system-ui, sans-serif; }
.illus-adas[data-on="A"] .dim[data-dim="A"], .illus-adas[data-on="B"] .dim[data-dim="B"], .illus-adas[data-on="C"] .dim[data-dim="C"],
.illus-adas[data-on="D"] .dim[data-dim="D"], .illus-adas[data-on="E"] .dim[data-dim="E"] { --dim: var(--accent); }
.illus-adas[data-on]:not([data-on=""]) .dim { opacity: .35; }
.illus-adas .dim[data-dim] { transition: opacity .15s; }
.illus-adas[data-on="A"] .dim[data-dim="A"], .illus-adas[data-on="B"] .dim[data-dim="B"], .illus-adas[data-on="C"] .dim[data-dim="C"],
.illus-adas[data-on="D"] .dim[data-dim="D"], .illus-adas[data-on="E"] .dim[data-dim="E"] { opacity: 1; }
.illus-adas .dim .dim-line, .illus-adas .dim .dim-ext { stroke: var(--dim, var(--muted)); }
.illus-adas .dim .dim-line { stroke-width: 2.6; }
.illus-adas .dim .dim-lbl circle { stroke: var(--dim, var(--muted)); fill: var(--dim, var(--surface)); }
.illus-adas[data-on="A"] .dim[data-dim="A"] .dim-lbl text, .illus-adas[data-on="B"] .dim[data-dim="B"] .dim-lbl text,
.illus-adas[data-on="C"] .dim[data-dim="C"] .dim-lbl text, .illus-adas[data-on="D"] .dim[data-dim="D"] .dim-lbl text,
.illus-adas[data-on="E"] .dim[data-dim="E"] .dim-lbl text { fill: var(--accent-text); }

.adas-diagrams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adas-diagrams figure { margin: 0; background: var(--surface-2); border-radius: 12px; padding: 8px; }
.adas-diagrams figcaption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 2px; }
.adas-rows { display: flex; flex-direction: column; gap: 8px; }
.adas-row {
  display: grid; grid-template-columns: 34px 1fr auto; grid-template-areas: "badge desc input" "badge desc m";
  gap: 2px 12px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; width: 100%;
}
button.adas-row { grid-template-columns: 34px 1fr; grid-template-areas: "badge desc"; }
.adas-row.on { border-color: var(--accent); background: var(--accent-soft); }
.adas-row .dim-badge { grid-area: badge; }
.adas-desc { grid-area: desc; font-size: 13.5px; line-height: 1.35; }
.adas-input { grid-area: input; display: flex; align-items: center; gap: 6px; }
.adas-input input { width: 96px; height: 44px; font-size: 18px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; border-radius: 10px; }
.adas-input .unit { color: var(--muted); font-size: 13px; }
.adas-m { grid-area: m; font-size: 12px; color: var(--muted); text-align: right; min-height: 16px; }
.dim-badge {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--accent); color: var(--accent-text); font-weight: 800; font-size: 14px;
}
.adas-values { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.adas-value { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* -- listado ------------------------------------------------------------- */
.page-head .btn-lg { align-self: center; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-scan { height: 44px; gap: 8px; }
.scan-ico { width: 18px; height: 14px; border: solid currentColor; border-width: 0 2px; position: relative; }
.scan-ico::before { content: ""; position: absolute; inset: 0 4px; border: solid currentColor; border-width: 0 2px; }
.dot.st-received { background: var(--info); }
.dot.st-preinstall_failed, .dot.st-install_failed { background: var(--bad); }
.dot.st-ready { background: var(--ready); }
.dot.st-installed { background: var(--ok); }
.chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
.search-field { position: relative; flex: 1; display: flex; flex-direction: row; gap: 0; min-width: 0; }
.search-field .nav-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-main .search-field input { width: 100%; height: 48px; padding-left: 42px; }
.search-main input::placeholder { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif; }
.units-home .search-hero { gap: 14px; }
.chips .chip { flex: none; height: 34px; }

.unit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.unit-card {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; color: var(--text); position: relative; overflow: hidden;
  transition: border-color .12s, transform .12s;
}
.unit-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--border); }
.unit-card.st-received::before { background: var(--info); }
.unit-card.st-ready::before { background: var(--ready); }
.unit-card.st-installed::before { background: var(--ok); }
.unit-card.st-preinstall_failed::before, .unit-card.st-install_failed::before { background: var(--bad); }
.unit-card:hover { text-decoration: none; border-color: var(--accent); }
.unit-card:active { transform: scale(.99); }
.unit-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.unit-imei { font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.unit-card-meta { display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.unit-card-vehicle { display: flex; gap: 8px; align-items: center; font-size: 13px; min-width: 0; }
.unit-card-vehicle span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate {
  font-family: var(--mono); font-weight: 800; font-size: 12px; letter-spacing: 1px; padding: 1px 6px; border-radius: 4px;
  background: #ffd54a; color: #1a1a1a; border: 1px solid #c9a52a; flex: none;
}
.unit-card-foot { font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; }
.empty-state { padding: 28px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state p { margin: 0; color: var(--muted); }

/* -- registro de llegada ------------------------------------------------- */
.parse-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.result-hero { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; }
.result-hero.ok { background: var(--ok-soft); }
.result-hero.wait { background: var(--warn-soft); }
.result-ico { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.result-hero.ok .result-ico { background: var(--ok); }
.result-hero.ok .result-ico::after { content: ""; width: 8px; height: 15px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg); }
.result-hero.wait .result-ico { border: 3px solid var(--warn); border-top-color: transparent; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .result-hero.wait .result-ico { animation: none; } }
.imei-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.log-probe:empty { display: none; }

/* -- ficha --------------------------------------------------------------- */
.unit-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: start; margin-top: 12px; }
.unit-hero { display: flex; flex-direction: column; gap: 14px; border-top: 4px solid var(--border); }
.unit-hero.st-received { border-top-color: var(--info); }
.unit-hero.st-ready { border-top-color: var(--ready); }
.unit-hero.st-installed { border-top-color: var(--ok); }
.unit-hero.st-preinstall_failed, .unit-hero.st-install_failed { border-top-color: var(--bad); }
.unit-hero-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.unit-hero-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.unit-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.unit-hero-tools { display: flex; gap: 6px; }
.icon-btn { width: 38px; height: 38px; padding: 0; }
.unit-imei-lg { all: unset; cursor: copy; font-family: var(--mono); font-size: 22px; font-weight: 800; letter-spacing: .5px; overflow-wrap: anywhere; }
.unit-imei-lg:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.warn-note { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.facts dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.facts dd { margin: 1px 0 0; overflow-wrap: anywhere; font-weight: 500; }
.facts-sm { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.unit-actions { display: flex; flex-direction: column; gap: 8px; }
.logs-card { display: flex; align-items: center; gap: 14px; color: var(--text); }
.logs-card:hover { text-decoration: none; border-color: var(--accent); }
.logs-card > div:nth-child(2) { flex: 1; }
.chev { font-size: 26px; color: var(--muted); line-height: 1; }
.note-form { display: flex; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.note-form input { flex: 1; height: 40px; }
.note-form .btn { height: 40px; }

.timeline { list-style: none; margin: 0; padding: 8px 14px 14px; }
.tl-item { display: grid; grid-template-columns: 22px 1fr; gap: 10px; position: relative; padding: 10px 0; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 28px; bottom: -10px; width: 2px; background: var(--border); }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; margin: 4px 0 0 4px; background: var(--info); box-shadow: 0 0 0 4px var(--surface); position: relative; z-index: 1; }
.tl-ok .tl-dot { background: var(--ok); }
.tl-bad .tl-dot { background: var(--bad); }
.tl-note .tl-dot { background: var(--muted); }
.tl-head { display: flex; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; align-items: baseline; }
.tl-summary { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.tl-note .tl-summary { color: var(--text); white-space: pre-wrap; }
.tl-body details { margin-top: 6px; }
.tl-body summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 500; padding: 4px 0; }
.tl-body details[open] > div { margin-top: 8px; padding: 12px; background: var(--surface-2); border-radius: 10px; }
.check-summary { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.check-summary .tick { display: inline-block; width: 18px; font-weight: 800; }
.check-summary .ok .tick { color: var(--ok); }
.check-summary .bad { color: var(--muted); }
.check-summary .bad .tick { color: var(--bad); }
.result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.result-list li { display: flex; justify-content: space-between; gap: 8px; }
.quote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; white-space: pre-wrap; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.photo { position: relative; }
.photo-del {
  position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: none;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 18px; cursor: pointer; line-height: 1;
}
.shot-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* -- asistente ----------------------------------------------------------- */
.wz { display: flex; flex-direction: column; gap: 12px; padding-bottom: 80px; }
.wz-progress { display: flex; flex-direction: column; gap: 4px; }
.wz-count { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .8px; }
.wz-title { font-size: 22px; margin: 0; }
.wz-bar { display: flex; gap: 4px; margin-top: 6px; }
.wz-seg { flex: 1; height: 6px; border-radius: 3px; border: none; padding: 0; background: var(--border); cursor: default; }
.wz-seg.done { background: var(--accent); cursor: pointer; opacity: .55; }
.wz-seg.on { background: var(--accent); }
.wz-card { padding: 18px; }
.step { display: flex; flex-direction: column; gap: 16px; }
.step-lead { margin: 0; font-size: 15.5px; font-weight: 500; }
.how { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.wz-foot {
  position: sticky; bottom: 0; z-index: 4; display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 75%, transparent);
}
.draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-size: 13px; }
.summary-box { padding: 12px 14px; border-radius: 12px; display: flex; flex-direction: column; gap: 4px; }
.summary-box.ok { background: var(--ok-soft); color: var(--ok); }
.summary-box.warn { background: var(--warn-soft); color: var(--warn); }
.result-rows { display: flex; flex-direction: column; gap: 8px; }
.result-row { display: grid; grid-template-columns: 1fr 160px; gap: 12px; align-items: center; font-size: 14px; }

/* -- escáner ------------------------------------------------------------- */
.scan { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 14px; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; left: 10%; right: 10%; top: 35%; height: 22%; border: 3px solid var(--brand-teal); border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
.scan-hint { position: relative; color: #fff; margin: 0; font-weight: 600; }
.scan .btn { position: relative; min-width: 200px; }

/* -- guías --------------------------------------------------------------- */
.guide-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.guide-card { color: var(--text); overflow: hidden; display: flex; flex-direction: column; }
.guide-card:hover { text-decoration: none; border-color: var(--accent); }
.guide-card h2 { font-size: 18px; margin-bottom: 4px; }
.guide-step { display: flex; flex-direction: column; gap: 14px; position: relative; padding-top: 20px; }
.guide-step h2 { font-size: 19px; margin: 0; padding-left: 46px; min-height: 34px; display: flex; align-items: center; }
.guide-num { position: absolute; top: 18px; left: 16px; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.guide-checks { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* -- móvil --------------------------------------------------------------- */
@media (max-width: 860px) {
  .unit-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  /* Navegación inferior, al alcance del pulgar. */
  .topbar { flex-wrap: nowrap; padding: 0 16px; height: 56px; }
  .topbar .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; order: initial; display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--brand-navy);
    box-shadow: 0 -1px 0 rgba(45, 212, 191, .25); overflow: visible;
  }
  .topbar .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 2px; border-radius: 10px; }
  .topbar .nav a.active { box-shadow: none; }
  .topbar .nav-wide { display: none !important; }
  .topbar .nav .nav-ico { width: 22px; height: 22px; }
  .topbar .user { margin-left: auto; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .wz-foot { bottom: calc(62px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

  .page-head h1 { font-size: 24px; }
  .page-head .btn-lg { width: 100%; }
  .page-actions { width: 100%; }
  .search-main { flex-direction: row; }
  .unit-list { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .adas-diagrams { grid-template-columns: 1fr; }
  .adas-values { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .result-row { grid-template-columns: 1fr; gap: 6px; }
  .wz-card { padding: 16px 14px; }
  .wz-title { font-size: 20px; }
  .unit-imei-lg { font-size: 20px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* -- cuentas y perfiles ---------------------------------------------------- */
.link-btn { all: unset; color: var(--accent); font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--accent); border-radius: 3px; }
.login-switch { text-align: center; font-size: 13.5px; }
.login-card .field-hint { margin: -8px 0 0; }
.ok-note { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); font-size: 13.5px; }
.user-link { display: flex; align-items: center; gap: 10px; color: inherit; border-radius: 10px; padding: 4px 6px; }
.user-link:hover { text-decoration: none; background: rgba(255, 255, 255, .07); }
.user-text { display: flex; flex-direction: column; line-height: 1.15; }
.user-role { font-size: 10.5px; font-weight: 600; color: var(--brand-teal); letter-spacing: .3px; }
.avatar-lg { width: 52px; height: 52px; font-size: 22px; }
.account-head { display: flex; gap: 14px; align-items: center; }
.account-head .badge { margin-top: 6px; }
.account-name { font-size: 18px; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
.btn-danger:hover { background: var(--bad); filter: brightness(1.08); }
.btn-danger-text { color: var(--bad); }
.danger-zone { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1.5px solid var(--bad); border-radius: 12px; background: var(--bad-soft); }
.danger-zone input { height: 44px; font-size: 16px; }
.user-card { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; }
.user-card.pending { border-left: 4px solid var(--warn); }
.user-card > div:last-child:not(.user-actions) { grid-column: 1 / -1; }
.user-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.user-actions select { height: 36px; }
.role-help { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.reset-box { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.reset-url { word-break: break-all; font-size: 12.5px; user-select: all; }
.key-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.key-row:last-child { border-bottom: none; }
.key-once { border-color: var(--accent); background: var(--accent-soft); }

@media (max-width: 760px) {
  .user-text { display: none; }
  .user-card { grid-template-columns: 1fr; }
  .user-actions { justify-content: flex-start; }
}

/* -- ejemplos plegables (ⓘ) y comandos peligrosos ------------------------- */
.example { border-top: 1px dashed var(--border); padding-top: 8px; }
.example > summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13.5px; min-height: 32px; list-style: none; }
.example > summary::-webkit-details-marker { display: none; }
.example[open] > summary { margin-bottom: 8px; }
.example > *:not(summary) + * { margin-top: 8px; }
.info-ico { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-text); font: 700 13px/1 Georgia, serif; font-style: italic; flex: none; }
.example-reply { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 8px; border-left: 4px solid var(--ok); background: var(--ok-soft); }
.example-reply.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.example-reply code { word-break: break-all; color: var(--text); font-size: 12.5px; }
.example-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--ok); }
.example-reply.bad .example-tag { color: var(--bad); }
.example-notes { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.danger-cmd { border: 1.5px solid var(--bad); border-radius: 12px; padding: 10px 14px; background: var(--bad-soft); display: flex; flex-direction: column; gap: 8px; }
.danger-cmd > summary { cursor: pointer; color: var(--bad); font-weight: 600; min-height: 28px; }
.danger-cmd[open] { gap: 10px; }
.danger-cmd .cmd-text { display: block; }
.model-facts { margin: 0; display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.model-facts dt { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.model-facts dd { margin: 2px 0 0; }

/* -- selector de modelo en las guías -------------------------------------- */
.model-switch { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); position: sticky; top: 64px; z-index: 3; }
.model-tab { flex: 1; text-align: center; padding: 12px 8px; font-weight: 700; color: var(--text); border-right: 1px solid var(--border); }
.model-tab:last-child { border-right: none; }
.model-tab:hover { text-decoration: none; background: var(--surface-2); }
.model-tab.on { background: var(--accent); color: var(--accent-text); }
.model-cards { display: grid; gap: 12px; }
.model-card { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name chev" "sum chev"; gap: 4px 12px; align-items: center; padding: 18px; color: var(--text); }
.model-card:hover { text-decoration: none; border-color: var(--accent); }
.model-name { grid-area: name; font-size: 22px; font-weight: 800; }
.model-card .muted { grid-area: sum; }
.model-card .chev { grid-area: chev; }
.illus-phone { max-width: 170px; margin: 0 auto; }

/* -- luces --------------------------------------------------------------- */
.led-table { display: flex; flex-direction: column; gap: 6px; }
.led-row { display: grid; grid-template-columns: 18px 150px 1fr; gap: 10px; align-items: center; font-size: 13.5px; }
.led { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px var(--surface-2); }
.led-rojo { background: #e53935; }
.led-azul { background: #1e88e5; }
.led-verde { background: #43a047; }
.led-los { background: transparent; border: 2px solid var(--muted); }
.led.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .led.blink { animation: none; opacity: .5; } }

/* -- pantallas de celular (maquetas WiFiKit) ------------------------------ */
.i-screen { fill: var(--surface); stroke: var(--border); stroke-width: 1; }
.i-scr-row { fill: var(--surface-2); }
.i-scr-sel { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.i-scr-title { fill: var(--text); font: 800 15px system-ui, sans-serif; }
.i-scr-text { fill: var(--text); font: 500 10px system-ui, sans-serif; }
.i-scr-strong { fill: var(--text); font: 700 10.5px system-ui, sans-serif; }
.i-scr-muted { fill: var(--muted); font: 600 8px system-ui, sans-serif; letter-spacing: .3px; }
.i-scr-mono { fill: var(--text); font: 600 9px ui-monospace, Menlo, Consolas, monospace; }
.i-on-acc-text { fill: var(--accent-text); font: 700 11px system-ui, sans-serif; }

@media (max-width: 760px) {
  .led-row { grid-template-columns: 18px 1fr; }
  .led-row .muted { grid-column: 2; }
  .model-switch { top: 56px; }
}

/* Accesorios instalados */
.accessory-rows { display: grid; gap: 8px; }
.accessory-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; }
.accessory-row.on { border-color: var(--ok); background: var(--ok-soft); }
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper .btn { min-width: 44px; min-height: 44px; font-size: 1.2rem; padding: 0; }
.stepper-val { min-width: 2ch; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.accessory-summary { margin: 0; padding-left: 18px; }

/* Visita técnica y estados nuevos */
.dot.st-needs_visit { background: var(--warn); }
.dot.st-retired { background: var(--muted); }
.unit-card.st-needs_visit::before { background: var(--warn); }
.unit-card.st-retired::before { background: var(--muted); }
.unit-hero.st-needs_visit { border-top-color: var(--warn); }
.unit-hero.st-retired { border-top-color: var(--muted); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.muted { background: var(--surface-2); color: var(--muted); }
.seg.seg-stack { display: grid; grid-template-columns: 1fr; }
.seg.seg-stack .seg-btn { border-right: none; border-bottom: 1px solid var(--border); text-align: left; min-height: 44px; padding: 10px 14px; }
.seg.seg-stack .seg-btn:last-child { border-bottom: none; }
.visit-change, .edit-section { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.visit-change:first-of-type, .edit-section:first-of-type { border-top: none; }
.tl-warn .tl-dot { background: var(--warn); }

/* Comandos y vídeo por la pasarela */
.device-cmd { display: flex; flex-direction: column; gap: 8px; }
.device-reply:empty { display: none; }
.live-channel { display: flex; flex-direction: column; gap: 8px; }
.live-video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; }
.live-video[hidden] { display: none; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }

/* Lo que pasó dentro de un alistamiento */
.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.activity-list li { border-left: 2px solid var(--border); padding-left: 10px; min-width: 0; }
.activity-list li.activity-fail { border-left-color: var(--bad, #c0392b); }
.activity-cmd, .activity-reply { display: block; font-size: 12px; overflow-wrap: anywhere; }
.activity-reply { color: var(--muted); }
