/* ============ Tema ============ */
:root {
  --bg: #0b0e17;
  --bg-elev: #131826;
  --bg-elev-2: #1a2032;
  --border: #232a3d;
  --border-strong: #2e3650;
  --text: #e6e8ef;
  --text-dim: #9aa3bd;
  --text-faint: #6b7390;
  --accent: #5b8cff;
  --accent-2: #4d7eff;
  --accent-soft: rgba(91, 140, 255, 0.12);
  --ok: #38d39f;
  --warn: #f4b942;
  --err: #f06464;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; }
h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: 18px; letter-spacing: 0.2px; }
h3 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); margin-bottom: 12px; }

.muted { color: var(--text-dim); font-weight: 400; }
.hint { color: var(--text-dim); font-size: 0.85rem; margin: 4px 0; }

/* ============ Topbar ============ */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 1.05rem; font-weight: 600; }
.logo-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #9b6bff);
  box-shadow: 0 0 12px var(--accent);
}
.env-badges { display: flex; gap: 8px; }
.badge {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.badge-pre {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.user-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 3px 4px 3px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-left: 4px;
}
.user-email { font-weight: 500; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
}
.logout-btn:hover { color: var(--err); border-color: var(--err); }

/* ============ Layout ============ */
.layout {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(0, 2fr);
  gap: 20px;
  padding: 20px 28px;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 14px;
    max-width: 100%;
  }
  .layout > * { min-width: 0; }
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

/* ============ Form ============ */
.form-panel { align-self: start; }

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}
.presets .hint { width: 100%; margin-bottom: 4px; }
.preset-btn {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.preset-btn:hover { border-color: var(--accent); color: var(--accent); }
.preset-btn[data-active="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.plate-lookup-panel {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev-2);
}
.plate-lookup-panel > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  list-style: none;
}
.plate-lookup-panel > summary::-webkit-details-marker { display: none; }
.plate-lookup-panel[open] > summary { margin-bottom: 10px; }
.plate-lookup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.plate-lookup-field {
  flex: 1 1 200px;
  margin-bottom: 0;
}
.plate-lookup-field input { margin-top: 4px; }
.plate-lookup-result {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.plate-lookup-err { color: var(--err); margin-top: 10px; margin-bottom: 0; }

.plate-image-upload {
  margin: 4px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
html.route-movil .plate-image-upload {
  display: none;
}
.matricula-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 4px;
}
.matricula-field input[type="text"] {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}
.btn-plate-image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2, var(--panel));
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-plate-image svg {
  width: 20px;
  height: 20px;
}
.btn-plate-image:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-plate-image:disabled {
  opacity: 0.55;
  cursor: progress;
}
html.route-movil .matricula-field,
html.route-movil .btn-plate-image,
html.route-movil .plate-scan-preview,
html.route-movil .plate-scan-status {
  display: none;
}
.plate-scan-preview img {
  display: block;
  max-width: 100%;
  max-height: 140px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.plate-scan-status {
  margin: 0;
  font-size: 0.9rem;
}

.btn-secondary {
  flex: 0 0 auto;
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-secondary:disabled { opacity: 0.55; cursor: progress; }

fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px 16px;
  margin: 0 0 16px 0;
}
legend {
  padding: 0 8px;
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
fieldset.opts { padding-top: 12px; }

label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}
label:last-child { margin-bottom: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.row label { margin-bottom: 0; }

input[type=text], input[type=number], select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 10px;
  margin-top: 4px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type=text]:focus, input[type=number]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { margin: 0; }

button.primary {
  width: 100%;
  background: var(--accent);
  color: #0b0e17;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: background 0.15s ease;
}
button.primary:hover:not(:disabled) { background: var(--accent-2); }
button.primary:disabled { opacity: 0.6; cursor: progress; }

.btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #0b0e17;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer-hint {
  margin-top: 14px;
  color: var(--text-faint);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ============ Results ============ */
.results-panel {
  display: flex; flex-direction: column; gap: 18px;
  min-height: 400px;
}

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  color: var(--text-dim);
  padding: 60px 30px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
}
.empty-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  border: 2px solid var(--border-strong);
  position: relative;
  margin-bottom: 14px;
}
.empty-icon::before {
  content: ""; position: absolute; inset: 14px;
  border: 2px solid var(--text-dim);
  border-bottom: none; border-right: none;
  transform: rotate(135deg);
}
.empty-state strong { color: var(--text); }

.progress-card, .meta-card, .quotes-card, .coverages-card, .error-card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
}

.step-list {
  list-style: none;
  margin: 0; padding: 0;
}
.step-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.step-list li:last-child { border-bottom: none; }
.step-list li .icon { width: 18px; text-align: center; }
.step-list li .icon.spin {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid var(--text-faint);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.step-list li.done .icon { color: var(--ok); }
.step-list li.warn .icon { color: var(--warn); }
.step-list li.error .icon { color: var(--err); }
.step-list li .label { flex: 1; }
.step-list li .meta { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.78rem; }

.meta-card dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 0;
}
.meta-card dt { color: var(--text-dim); font-size: 0.82rem; }
.meta-card dd { margin: 0; font-family: var(--font-mono); font-size: 0.85rem; }

/* ============ Tabla cotizaciones ============ */
.quotes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.quotes-table th, .quotes-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.quotes-table th {
  font-weight: 600;
  color: var(--text-dim);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.quotes-table td.num, .quotes-table th.num { text-align: right; font-family: var(--font-mono); }
.quotes-table tr:hover td { background: rgba(91, 140, 255, 0.04); }
.quotes-table .modalidad-cell { font-family: var(--font-mono); color: var(--accent); }
.quotes-table .desc-cell { color: var(--text-dim); }
.quotes-table .price-best { color: var(--ok); font-weight: 600; }
.quotes-table .fp-blocked { color: var(--err); opacity: 0.7; text-decoration: line-through; }
.payment-warning { color: var(--warn); }

/* ============ Coberturas ============ */
.coverage-block {
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.coverage-block:last-child { margin-bottom: 0; }
.coverage-block h4 {
  margin: 0 0 10px 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
}
.coverage-block h4 .desc { color: var(--text-dim); font-weight: 400; font-family: var(--font-sans); margin-left: 8px; font-size: 0.82rem; }
.coverage-list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 4px 18px;
}
.coverage-list li {
  display: flex; justify-content: space-between;
  padding: 4px 0;
  font-size: 0.85rem;
  border-bottom: 1px dotted var(--border);
}
.coverage-list .nombre { color: var(--text); }
.coverage-list .valor { color: var(--ok); font-family: var(--font-mono); margin-left: 12px; }

/* ============ Error ============ */
.error-card { border-color: var(--err); }
.error-card h3 { color: var(--err); }
.error-card pre {
  background: var(--bg);
  padding: 12px;
  border-radius: 4px;
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: var(--text-dim);
}

/* ============ Ruta /movil (vista app móvil, patrón similar a CRM /movil) ============ */
html.route-movil {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
}
html.route-movil * {
  -webkit-tap-highlight-color: transparent;
}
html.route-movil body {
  overflow-x: hidden;
  width: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overscroll-behavior-x: none;
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  touch-action: pan-y;
}
html.route-movil .topbar {
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  max-width: 100%;
  box-sizing: border-box;
}
html.route-movil .brand {
  min-width: 0;
  flex: 1;
}
html.route-movil .brand h1 {
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.route-movil .env-badges {
  display: none;
}
html.route-movil .layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  padding: 10px 12px;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}
html.route-movil .layout > * {
  min-width: 0;
  max-width: 100%;
}
html.route-movil .panel {
  padding: 14px 12px;
  border-radius: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
html.route-movil .form-panel {
  overflow-wrap: break-word;
  word-break: break-word;
}
html.route-movil .results-panel {
  overflow-wrap: normal;
  word-break: normal;
}
html.route-movil .form-panel,
html.route-movil .results-panel {
  min-width: 0;
}
html.route-movil .form-panel label,
html.route-movil .form-panel fieldset,
html.route-movil .form-panel .hint,
html.route-movil .form-panel p,
html.route-movil .form-panel summary,
html.route-movil .form-panel h2 {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
html.route-movil .form-panel fieldset {
  min-width: 0;
  padding: 12px 10px 14px;
}
html.route-movil .form-panel input[type=text],
html.route-movil .form-panel input[type=number],
html.route-movil .form-panel select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
html.route-movil .form-panel code {
  word-break: break-all;
  white-space: normal;
}
html.route-movil .plate-lookup-panel {
  display: none !important;
}
html.route-movil .presets {
  flex-wrap: wrap;
  overflow-x: visible;
  overflow-y: visible;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
}
html.route-movil .presets .hint {
  flex: 1 1 100%;
}
html.route-movil .preset-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
  font-size: 0.8rem;
  min-height: 44px;
  text-align: center;
  line-height: 1.25;
  white-space: normal;
}
html.route-movil .check {
  align-items: flex-start;
}
html.route-movil .check input {
  flex-shrink: 0;
  margin-top: 3px;
}
html.route-movil .footer-hint {
  margin-top: 12px;
  margin-bottom: 4px;
  padding-right: 0;
}
html.route-movil .row {
  grid-template-columns: 1fr;
  gap: 10px;
}
html.route-movil input[type=text],
html.route-movil input[type=number],
html.route-movil select {
  font-size: 16px !important;
  min-height: 44px;
  padding: 10px 12px;
  touch-action: manipulation;
}
html.route-movil button.primary {
  min-height: 48px;
  font-size: 1rem;
}
html.route-movil .results-panel {
  overflow-x: hidden;
  min-height: 240px;
}

/* Progreso: etiqueta arriba, meta abajo (evita texto en columna de 1 carácter) */
html.route-movil .step-list li {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 10px;
  padding: 10px 0;
}
html.route-movil .step-list li .icon {
  flex-shrink: 0;
  margin-top: 2px;
}
html.route-movil .step-list li .label {
  flex: 1 1 calc(100% - 28px);
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
}
html.route-movil .step-list li .meta {
  flex: 1 1 100%;
  margin-left: 28px;
  margin-top: 2px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Cotizaciones: tarjetas apiladas en lugar de tabla estrecha */
html.route-movil .quotes-card {
  padding: 14px 12px;
}
html.route-movil .quotes-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  border-collapse: separate;
  border-spacing: 0 10px;
}
html.route-movil .quotes-table thead {
  display: none;
}
html.route-movil .quotes-table tbody {
  display: block;
}
html.route-movil .quotes-table tr {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
html.route-movil .quotes-table tr:last-child {
  margin-bottom: 0;
}
html.route-movil .quotes-table td {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  text-align: right !important;
  white-space: nowrap;
  font-size: 0.9rem;
}
html.route-movil .quotes-table td:last-child {
  border-bottom: none;
}
html.route-movil .quotes-table td::before {
  content: attr(data-label);
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--text-dim);
  white-space: normal;
  line-height: 1.3;
  font-family: var(--font-sans);
}
html.route-movil .quotes-table td.desc-cell {
  flex-direction: column;
  align-items: stretch;
  text-align: left !important;
  white-space: normal;
  line-height: 1.35;
}
html.route-movil .quotes-table td.desc-cell::before {
  margin-bottom: 2px;
}
html.route-movil .quotes-table td.modalidad-cell {
  font-size: 0.95rem;
  padding-top: 2px;
}
html.route-movil .coverage-block h4 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.35;
}
html.route-movil .coverage-block h4 .desc {
  margin-left: 0;
  font-size: 0.8rem;
  line-height: 1.35;
}
html.route-movil .coverage-list li {
  flex-wrap: wrap;
  gap: 4px 8px;
}
html.route-movil .coverage-list .nombre {
  flex: 1 1 55%;
  min-width: 0;
  line-height: 1.35;
}
html.route-movil .coverage-list .valor {
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}
html.route-movil .coverage-list {
  grid-template-columns: minmax(0, 1fr);
}
html.route-movil .meta-card,
html.route-movil .progress-card,
html.route-movil .quotes-card,
html.route-movil .coverages-card,
html.route-movil .error-card {
  min-width: 0;
  max-width: 100%;
}
html.route-movil pre,
html.route-movil .plate-lookup-result,
html.route-movil #error-body {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
html.route-movil .empty-state {
  padding: 36px 14px;
}
html.route-movil .meta-card dl {
  grid-template-columns: 1fr;
  gap: 4px 0;
}
html.route-movil .meta-card dt { margin-top: 8px; }
html.route-movil .meta-card dt:first-child { margin-top: 0; }
html.route-movil .meta-card dd { margin-bottom: 4px; }

.movil-scan-panel,
.movil-bottom-bar {
  display: none;
}
html.route-movil .movil-scan-panel {
  display: block !important;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
html.route-movil .movil-scan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
html.route-movil .movil-scan-panel h2 {
  margin: 0;
  font-size: 1rem;
  flex: 1;
  min-width: 0;
}
html.route-movil .movil-scan-panel .hint {
  font-size: 0.82rem;
  line-height: 1.45;
}
html.route-movil .movil-logout-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}
html.route-movil .movil-logout-btn:active {
  color: var(--err);
}
html.route-movil .movil-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  display: flex !important;
  align-items: stretch;
  gap: 0;
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background-color: #131826;
  background-color: var(--bg-elev);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  isolation: isolate;
}
html.route-movil .movil-bar-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
html.route-movil .movil-bar-btn:active {
  background: var(--bg-elev-2);
}
html.route-movil .movil-bar-icon {
  font-size: 1.35rem;
  line-height: 1;
}
html.route-movil .movil-bar-label {
  letter-spacing: 0.02em;
}
body.movil-modal-open .movil-bottom-bar {
  visibility: hidden;
  pointer-events: none;
}
html.route-movil .movil-scan-preview {
  margin-top: 12px;
}
html.route-movil .movil-scan-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 8px;
  background: #0a0c12;
}
html.route-movil .movil-vehicle-card {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}
html.route-movil .movil-vehicle-card h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}
html.route-movil .movil-vehicle-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0 0 14px;
  font-size: 0.88rem;
}
html.route-movil .movil-vehicle-card dt {
  color: var(--text-dim);
  margin: 0;
}
html.route-movil .movil-vehicle-card dd {
  margin: 0;
  word-break: break-word;
}
html.route-movil .movil-vehicle-warn {
  color: var(--warn, #e6a23c);
  margin-top: 8px;
}

body.movil-modal-open {
  overflow: hidden;
}
.movil-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.movil-modal[hidden] {
  display: none !important;
}
.movil-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.movil-modal-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px 18px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  background: var(--bg-elev);
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}
.movil-modal-sheet h3 {
  margin: 0 0 8px;
}
.movil-modal-sheet label {
  display: block;
  margin: 14px 0;
}
.movil-modal-sheet input {
  width: 100%;
  margin-top: 6px;
  font-size: 18px !important;
  min-height: 48px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.movil-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.movil-modal-actions .primary,
.movil-modal-actions .btn-secondary {
  min-height: 48px;
}

/* Pantallas estrechas aunque la URL sea / (sin /movil) */
@media (max-width: 640px) {
  .topbar {
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
    box-sizing: border-box;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 14px;
    gap: 14px;
    max-width: 100%;
  }
  .layout > * { min-width: 0; }
  .panel { padding: 16px; min-width: 0; }
  .row { grid-template-columns: 1fr; }
  .hint, p, summary, label { overflow-wrap: anywhere; }
  input[type=text],
  input[type=number],
  select {
    font-size: 16px !important;
    min-height: 44px;
    touch-action: manipulation;
  }
  .preset-btn { min-height: 44px; }
  .quotes-table { display: block; overflow-x: auto; }
  .coverage-list { grid-template-columns: 1fr; }
}
