/* Informe Flash de Inspección — estilos responsive (mobile first). */
:root {
  --green: #0d3b2e;
  --green-2: #14523f;
  --accent: #2e7d32;
  --mic-blue: #1565c0;
  --bg: #f2f4f3;
  --card: #ffffff;
  --line: #d7dedb;
  --text: #1d2521;
  --muted: #6b7671;
  --danger: #b71c1c;
  --radius: 10px;
  /* encabezado institucional */
  --hdr-bg: #16362b;
  --hdr-line: #3fbf72;
  /* escenario del mapa isométrico */
  --stage-bg: #0a1712;
  --stage-line: rgba(63, 191, 114, .14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { margin: 0 0 8px; color: var(--green); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, var(--green) 0%, var(--green-2) 60%, #1d6b52 100%);
}
.login-body {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px 40px;
}

/* encabezado institucional (portada) */
.brand-header {
  background: var(--hdr-bg);
  border-bottom: 2px solid var(--hdr-line);
  padding: 14px 22px;
  display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap;
}
/* El wordmark es blanco sobre transparente: se integra directo en el fondo, sin caja. */
.brand-logo {
  display: flex; align-items: center;
  flex-shrink: 0;
}
.brand-logo img { display: block; height: 38px; width: auto; }
.brand-logo-txt {
  color: #fff; font-weight: 800; font-size: 33px; line-height: 1;
  letter-spacing: -.5px;
}
.brand-titles {
  border-left: 1px solid rgba(255,255,255,.16);
  padding-left: 20px;
  min-width: 0;
}
.brand-titles h1 {
  color: #fff; margin: 0;
  font-size: clamp(19px, 3.4vw, 33px); font-weight: 800;
  letter-spacing: -.3px; line-height: 1.1;
  text-transform: uppercase;
}
.brand-titles p {
  color: #fff; margin: 3px 0 0;
  font-size: clamp(10px, 1.5vw, 13px); font-weight: 700;
  letter-spacing: .7px; text-transform: uppercase;
  opacity: .92;
}
@media (max-width: 620px) {
  .brand-header { gap: 10px; padding: 14px 16px; }
  .brand-logo img { height: 28px; }
  .brand-logo-txt { font-size: 26px; }
  .brand-titles { border-left: 0; padding-left: 0; }
}

.login-card {
  background: var(--card); border-radius: 14px; padding: 28px 26px;
  width: 100%; max-width: 400px; box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.login-card h2 { font-size: 21px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

/* campo de contraseña con botón mostrar/ocultar */
.pwd-wrap { position: relative; display: flex; }
.pwd-wrap input { padding-right: 48px; }
.pwd-toggle {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  background: none; border: 0; border-radius: 8px;
  color: var(--muted); cursor: pointer;
}
.pwd-toggle:hover { color: var(--green); background: #eef3f1; }
.pwd-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pwd-toggle[aria-pressed="true"] { color: var(--accent); }

/* ---------- layout ---------- */
.topbar {
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; gap: 12px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { cursor: pointer; display: flex; flex-direction: column; line-height: 1.2; }
.brand-mini { font-size: 11px; letter-spacing: 1.2px; opacity: .8; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.topbar-nav { display: flex; gap: 4px; }
.tab-link {
  font: inherit; font-weight: 600; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: rgba(255,255,255,.85);
  border-radius: 8px; padding: 8px 14px; min-height: 36px;
}
.tab-link:hover, .tab-link:focus-visible { background: rgba(255,255,255,.12); color: #fff; outline: none; }
.main { max-width: 760px; margin: 0 auto; padding: 16px 12px 60px; }
.main.wide { max-width: 1080px; }
/* La pantalla principal aprovecha el ancho disponible: el mapa del equipo lo necesita. */
.main.full { max-width: 1800px; padding-left: 18px; padding-right: 18px; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 8px 0 16px;
}
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- tarjetas ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.insp-card {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; cursor: pointer; transition: box-shadow .15s;
}
.insp-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.insp-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.insp-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- pantalla principal: mapa + listado ---------- */
.home-grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
/* El equipo y su mapa son el trabajo; el historial acompaña en una columna angosta. */
@media (min-width: 940px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (min-width: 1360px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) 310px; }
}

/* ---------- historial discreto ---------- */
.hist-card { padding: 14px 14px 10px; }
.hist-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.hist-head h3 { font-size: 13px; margin: 0; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); }
.hist-head .btn { font-size: 12px; padding: 4px 9px; min-height: 28px; }
.hist-vacio { margin: 6px 0 4px; }
.hist-lista { list-style: none; margin: 0; padding: 0; }
.hist-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 4px; border-top: 1px solid #eef1f0;
  cursor: pointer; position: relative;
}
.hist-item:first-child { border-top: 0; }
.hist-item:hover, .hist-item:focus-visible { background: #f5f8f7; outline: none; }
.hist-punto { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hist-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hist-nombre {
  font-size: 13px; font-weight: 600; color: #29352f;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hist-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Siempre visible pero tenue: depender de :hover lo dejaría inalcanzable en pantallas
   táctiles, donde no existe el estado hover. */
.hist-del {
  flex-shrink: 0; border: 0; background: none; cursor: pointer;
  color: #c3ccc8; font-size: 13px; line-height: 1;
  min-width: 28px; min-height: 28px; border-radius: 6px;
  opacity: .5; transition: opacity .12s, color .12s;
}
.hist-item:hover .hist-del, .hist-del:focus-visible { opacity: 1; }
.hist-del:hover { color: var(--danger); background: #fdeeee; opacity: 1; }
.hist-mas {
  width: 100%; margin-top: 8px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--accent); font-weight: 600;
  padding: 6px; border-radius: 6px;
}
.hist-mas:hover { background: #eef6ee; }
/* En teléfono: filas y botón con área táctil suficiente. */
@media (max-width: 640px) {
  .hist-item { padding: 11px 4px; }
  .hist-nombre { font-size: 14px; }
  .hist-del { min-width: 40px; min-height: 40px; opacity: .65; }
}

.mapa-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mapa-card h3 { margin-bottom: 2px; font-size: 17px; }
.mapa-equipo { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.mapa-vacio { text-align: center; padding: 34px 18px; border-style: dashed; }
/* El panel de identificación y el mapa van apilados en la misma columna. */
.home-mapa { display: grid; gap: 16px; }

.mapa-toggle { display: flex; gap: 6px; }

.mapa-stage { margin: 14px 0 6px; }
.mapa-svg {
  width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 8px;
}
.mapa-svg--iso { display: block; background: var(--stage-bg); }
.mapa-insp { display: none; }
.mapa-stage.modo-insp .mapa-svg { display: none; }
.mapa-stage.modo-insp .mapa-insp { display: block; }
/* La lista numerada de zonas acompaña a los diagramas del equipo, no al croquis. */
.mapa-stage.modo-insp + .mapa-lista { display: none; }
.insp-bloque + .insp-bloque { margin-top: 18px; }
.insp-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.insp-cab h4 { margin: 0; font-size: 15px; color: var(--green); }
.insp-meta { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.insp-zona { margin-top: 8px; }
.insp-zona h5 { margin: 0 0 4px; font-size: 13.5px; }
.insp-zona h5 small { font-weight: 400; color: var(--muted); }
.insp-acciones { margin-top: 10px; }

.mapa-zona { cursor: pointer; }
.mapa-zona:focus { outline: none; }
.mapa-cuenta { fill: #fff; stroke: var(--green); stroke-width: 1.2; }
.mapa-cuenta-txt { font-size: 8.5px; font-weight: 700; fill: var(--green); }

/* ---------- modo isométrico ---------- */
.mapa-zona-iso {
  cursor: pointer; transform-box: fill-box; transform-origin: 50% 50%;
  transition: transform .15s ease;
}
.mapa-zona-iso:hover, .mapa-zona-iso:focus-visible { transform: translate(0, -3px); }
.mapa-zona-iso:focus { outline: none; }
.mapa-zona-iso:focus-visible .iso-cara-frente { stroke: #fff; stroke-width: 1.6; }
.iso-cara-arriba { stroke: rgba(255,255,255,.22); stroke-width: .6; }
.iso-cara-lado { stroke: rgba(0,0,0,.3); stroke-width: .6; }
.iso-cara-frente { stroke: rgba(255,255,255,.14); stroke-width: .6; }
.iso-n { font-size: 6.5px; font-weight: 600; fill: rgba(255,255,255,.65); }
.iso-txt { font-size: 9px; font-weight: 700; fill: #fff; }
.mapa-flujo { fill: none; stroke: #3fbf72; stroke-width: 1; opacity: .55; }
.mapa-flujo.polvo { stroke: #e0a84a; }
@media not (prefers-reduced-motion: reduce) {
  .mapa-flujo { stroke-dasharray: 3 3; animation: mapa-fluir 1.1s linear infinite; }
  @keyframes mapa-fluir { to { stroke-dashoffset: -12; } }
}

.mapa-lista { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
/* Con el mapa ancho, la leyenda en dos columnas evita una lista muy alta. */
@media (min-width: 1360px) {
  .mapa-lista { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; }
}
.mapa-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 6px; cursor: pointer;
  font-size: 13px;
}
.mapa-item:hover, .mapa-item:focus-visible { background: #eef3f1; outline: none; }
.mapa-item-n {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  background: var(--green); color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.mapa-item-nombre { flex: 1; min-width: 0; }
.mapa-punto { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mapa-item-cuenta {
  flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--green);
  background: #eef3f1; border-radius: 10px; padding: 1px 7px;
}

/* En teléfono la leyenda se usa como lista de botones: área táctil más generosa. */
@media (max-width: 640px) {
  .mapa-item { min-height: 44px; padding: 8px; font-size: 14px; }
  .mapa-item-n { width: 24px; height: 24px; font-size: 12px; }
}

.aviso-zona {
  background: #eef6ee; border: 1px solid #bcdfbc; border-radius: 8px;
  padding: 10px 12px; margin: 0 0 14px; font-size: 13.5px; color: #1e4620;
}

/* ---------- formularios ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 600; color: #33403a; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; background: #fff; width: 100%;
  min-height: 42px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled { background: #f2f2f2; color: #777; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }
@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
  .form-grid .span2 { grid-column: span 2; }
}

/* ---------- botones ---------- */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--green);
  border-radius: 8px; padding: 10px 16px; min-height: 42px;
  transition: filter .15s;
}
.btn:hover { filter: brightness(.96); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #e5bcbc; }
.btn.small { padding: 6px 10px; min-height: 32px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: wait; }
.topbar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); }

/* ---------- badges / pills ---------- */
.badge { display: inline-block; color: #fff; border-radius: 12px; padding: 3px 10px; font-size: 12px; font-weight: 600; background: #777; white-space: nowrap; }
.pill { display: inline-block; border-radius: 12px; padding: 3px 10px; font-size: 12px; font-weight: 600; background: #e4e8e6; color: #555; white-space: nowrap; }
.pill.ok { background: #dcedc8; color: #33691e; }
.pill.warn { background: #ffe0b2; color: #a35a00; }

/* ---------- tablas ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px;
  color: var(--muted); font-weight: 700; background: #f7f9f8;
  position: sticky; top: 0; z-index: 1;
}
.table td.num { text-align: right; white-space: nowrap; }
.bom-table-wrap { padding: 0; max-height: 70vh; overflow: auto; }
.bom-table-wrap .table { margin: 0; }
.users-acciones { display: flex; gap: 6px; flex-wrap: wrap; }
.bom-desc { white-space: pre-wrap; }

/* ---------- zona de carga ---------- */
.drop-zone {
  text-align: center; border: 2px dashed var(--line); background: #fbfcfb;
  padding: 22px 16px;
}
.drop-zone.over { border-color: var(--accent); background: #eef6ee; }
.drop-zone p { margin: 6px 0; }
.drop-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- hallazgos ---------- */
.findings-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 10px; flex-wrap: wrap; }
.finding-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.finding-top-actions { margin-left: auto; display: flex; gap: 8px; }
.finding-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 800px) { .finding-grid { grid-template-columns: 300px 1fr; } }
.fcol-photo { display: flex; flex-direction: column; gap: 10px; }
.fcol-photo img {
  width: 100%; border-radius: 8px; border: 1px solid var(--line);
  max-height: 320px; object-fit: contain; background: #f7f7f7;
}
.nophoto { display: flex; align-items: center; justify-content: center; height: 140px; background: #f4f4f4; color: #999; border-radius: 8px; }
/* El botón de dictado vive DENTRO del recuadro del campo (no junto a la etiqueta): así la
   altura de la etiqueta es siempre la misma exista o no dictado en ese campo, y las cajas
   de una misma fila (ej. "Estado general" y "Notas generales") arrancan siempre a la misma
   altura, sin importar el ancho de pantalla ni cuánto texto tenga la etiqueta. */
.obs-wrap { position: relative; }
.obs-wrap textarea, .obs-wrap input { padding-right: 40px; }
.mic-btn {
  position: absolute; width: 30px; height: 30px; padding: 0;
  /* Mismo radio que el resto de los botones de la app (.btn usa 8px): un círculo perfecto
     quedaba como un elemento ajeno al resto de la interfaz. */
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--mic-blue); border-color: var(--mic-blue); color: #fff;
  /* Esquina superior derecha: en un textarea, la esquina inferior derecha ya la usa el
     "grip" nativo para cambiar el alto (resize: vertical) y no hay que taparlo. */
  top: 6px; right: 6px;
}
/* Campo de una sola línea (input): centrado vertical en vez de anclado arriba. */
.obs-wrap--input .mic-btn { top: 50%; transform: translateY(-50%); }
.mic-btn svg { width: 16px; height: 16px; }
.mic-btn.recording { background: #c0392b; border-color: #c0392b; animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,.5); } 50% { box-shadow: 0 0 0 8px rgba(192,57,43,0); } }
.ai-msgs { background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.ai-msgs p { margin: 3px 0; }
.resources summary { cursor: pointer; font-weight: 600; color: var(--green); padding: 4px 0; }
.resources .form-grid { margin-top: 10px; }

/* ---------- informe ---------- */
.report-holder { padding: 0; overflow-x: auto; }

/* ---------- animación de entrada ---------- */
/* Cubre la carga real de catálogo e inspecciones tras el ingreso. */
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px;
  background: linear-gradient(160deg, var(--green) 0%, var(--green-2) 55%, #1d6b52 100%);
}
.splash-logo {
  height: clamp(34px, 9vw, 48px); width: auto;
  animation: splashSube .65s cubic-bezier(.2,.85,.2,1) both;
}
.splash-dept {
  color: rgba(255,255,255,.78);
  font-size: clamp(10px, 2.4vw, 12px); font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; text-align: center;
  animation: splashSube .65s .08s cubic-bezier(.2,.85,.2,1) both;
}
.splash-app {
  color: #fff; font-size: clamp(16px, 4.4vw, 21px); font-weight: 600;
  text-align: center; margin-top: -6px;
  animation: splashSube .65s .16s cubic-bezier(.2,.85,.2,1) both;
}
.splash-track {
  width: min(240px, 60vw); height: 3px; margin-top: 6px;
  background: rgba(255,255,255,.22); border-radius: 3px; overflow: hidden;
}
.splash-fill {
  height: 100%; width: 0; background: #fff; border-radius: 3px;
  animation: splashBarra 1.15s .2s ease-out forwards;
}
.splash-user {
  color: rgba(255,255,255,.9); font-size: 13px; text-align: center;
  animation: splashSube .65s .24s cubic-bezier(.2,.85,.2,1) both;
}
.splash.saliendo { animation: splashSale .4s ease forwards; }

@keyframes splashSube {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes splashBarra { from { width: 0; } to { width: 100%; } }
@keyframes splashSale {
  to { opacity: 0; transform: scale(1.04); visibility: hidden; }
}

/* Quien haya pedido menos movimiento ve la misma pantalla, sin desplazamientos. */
@media (prefers-reduced-motion: reduce) {
  .splash-logo, .splash-dept, .splash-app, .splash-user { animation: none; }
  .splash-fill { animation-duration: .3s; animation-delay: 0s; }
  .splash.saliendo { animation-duration: .15s; }
}

/* Respaldo: si las animaciones no pueden ejecutarse, el contenido se ve igualmente. */
.splash.sin-animacion .splash-logo,
.splash.sin-animacion .splash-dept,
.splash.sin-animacion .splash-app,
.splash.sin-animacion .splash-user { animation: none; }
.splash.sin-animacion .splash-fill { animation: none; width: 100%; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--green); color: #fff; border-radius: 10px;
  padding: 12px 20px; font-size: 14px; z-index: 100;
  box-shadow: 0 6px 24px rgba(0,0,0,.3); max-width: 92vw;
}
.toast.error { background: var(--danger); }
.error-page { padding: 40px; text-align: center; color: var(--danger); }

@media print {
  .topbar, .no-print, .toast, .splash { display: none !important; }
  html, body { background: #fff !important; }
  .main, .main.wide { max-width: none; padding: 0; margin: 0; }
  .card, .report-holder { border: none; margin: 0; padding: 0; box-shadow: none; }
  /* El informe trae su propio bloque de impresión en report.js; aquí solo se retira
     el envoltorio de la aplicación para que no reste espacio a la página. */
}

/* ---------- croquis de inspección posición por posición ---------- */
.croq-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.croq-head h3 { margin-bottom: 2px; }
.croq-head p { margin: 0 0 8px; }
.croq-avance { font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 12px; background: #ffe0b2; color: #a35a00; white-space: nowrap; }
.croq-avance.ok { background: #dcedc8; color: #33691e; }
.croq-tabs { display: flex; gap: 6px; margin: 4px 0 6px; flex-wrap: wrap; }
.croq-tabs button { font: inherit; font-weight: 600; min-height: 40px; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
.croq-tabs button.on { background: var(--green); border-color: var(--green); color: #fff; }
.croq-tabs small { font-weight: 400; opacity: .8; margin-left: 4px; }
.croq-leyenda { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin: 4px 0 6px; }
.croq-leyenda span { display: inline-flex; align-items: center; gap: 5px; }
.croq-leyenda i { width: 12px; height: 12px; border: 1px solid #333; border-radius: 2px; display: inline-block; }
.croq-svg-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 8px; background: #fafbfa; padding: 4px 0; scroll-behavior: smooth; }
.croq-el { cursor: pointer; outline: none; }
.croq-el:hover rect:first-child { fill: rgba(21, 101, 192, .07); }
.croq-el:focus-visible rect:first-child { stroke: #1565c0; stroke-width: 2; }
.croq-cambios { margin: 8px 0 0; font-size: 13.5px; color: #bf360c; }
.croq-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; }
.croq-panel--vacio { color: var(--muted); text-align: center; }
.croq-panel-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.croq-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; border: 2px solid var(--c); color: #1d2521; background: color-mix(in srgb, var(--c) 18%, #fff); }
.croq-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 8px 16px; }
.croq-campo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.croq-campo > span { font-size: 14px; }
.croq-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.croq-seg button { font: inherit; font-size: 14px; min-width: 48px; min-height: 40px; padding: 4px 10px; border: 0; border-left: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
.croq-seg button:first-child { border-left: 0; }
.croq-seg button.on { background: var(--accent); color: #fff; font-weight: 700; }
.croq-seg button.on.malo { background: #d84315; }
.croq-seg button:disabled { cursor: default; }
.croq-nota { display: block; margin-top: 10px; font-size: 13px; }
.croq-nota input { width: 100%; margin-top: 4px; }
.croq-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 600px) {
  .croq-acciones .btn { flex: 1 1 45%; }
  .croq-campos { grid-template-columns: 1fr; }
}
/* El croquis tiene ancho mínimo propio: sin esto estira la columna del inicio en el
   teléfono en lugar de desplazarse dentro de su marco. */
.home-grid > *, .home-mapa > *, .mapa-card, .mapa-stage, .mapa-insp { min-width: 0; }
