:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1d1d1b;
  --muted: #6b6a66;
  --line: #e2e0da;
  --accent: #0f6e5c;
  --accent-text: #ffffff;
  --accent-soft: #e3f1ed;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --warn: #8a5a00;
  --warn-soft: #fdf3dc;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --card: #1f1f1d;
    --text: #ecebe7;
    --muted: #a3a29c;
    --line: #34332f;
    --accent: #4fbfa6;
    --accent-text: #0b1f1a;
    --accent-soft: #17322c;
    --danger: #f2a39b;
    --danger-soft: #3a1d1a;
    --warn: #f0c46b;
    --warn-soft: #362a12;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
.wrap.ancho { max-width: 1000px; }

header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card);
}
header.top h1 { font-size: 1.05rem; margin: 0; }
h2 { font-size: 1.25rem; margin: 0 0 8px; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}

.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) {
  .grid.c2 { grid-template-columns: 1fr 1fr; }
  .grid.c3 { grid-template-columns: 1fr 1fr 1fr; }
}
.full { grid-column: 1 / -1; }

label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 4px; }
label .opc { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; margin: 0 8px 0 0; }
.campo.error input, .campo.error select { border-color: var(--danger); }
.campo .msg { color: var(--danger); font-size: 0.8125rem; margin-top: 4px; }
.campo .ayuda { color: var(--muted); font-size: 0.8125rem; margin-top: 4px; }
.check { display: flex; align-items: flex-start; font-weight: 400; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; border-radius: 8px; padding: 10px 16px; min-height: 44px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer;
  text-decoration: none;
}
button.primario, .btn.primario { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.peligro { color: var(--danger); border-color: var(--danger); }
button:disabled { opacity: 0.5; cursor: default; }
button.link { border: none; background: none; padding: 4px; min-height: 0; color: var(--accent); }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.aviso { border-radius: 8px; padding: 12px; margin-bottom: 16px; }
.aviso.info { background: var(--accent-soft); }
.aviso.warn { background: var(--warn-soft); color: var(--warn); }
.aviso.error { background: var(--danger-soft); color: var(--danger); }

.escanear {
  border: 1px dashed var(--accent); border-radius: var(--radius); padding: 12px;
  margin-bottom: 16px; background: var(--accent-soft);
}
.escanear input[type="file"] { display: none; }

.viajero-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }

.resultados { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.resultados:empty { display: none; }
.resultados li button {
  width: 100%; justify-content: flex-start; border: none; border-radius: 0; font-weight: 400; min-height: 40px;
}
.resultados li + li button { border-top: 1px solid var(--line); }

.chip {
  display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--line); color: var(--text); white-space: nowrap;
}
.chip.pendiente { background: var(--warn-soft); color: var(--warn); }
.chip.completada { background: var(--danger-soft); color: var(--danger); }
.chip.aprobada { background: var(--accent-soft); color: var(--accent); }
.chip.enviada { background: var(--accent); color: var(--accent-text); }

.lista { list-style: none; margin: 0; padding: 0; }
.lista li { border-top: 1px solid var(--line); }
.lista li:first-child { border-top: none; }
.lista a { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 12px 4px; color: inherit; text-decoration: none; }
.lista a:hover { background: var(--bg); }

.copiar { display: flex; gap: 8px; }
.copiar input { font-family: ui-monospace, Consolas, monospace; font-size: 0.875rem; }
textarea.mensaje { min-height: 140px; font-size: 0.875rem; }

.idiomas { display: flex; gap: 4px; }
.idiomas button { min-height: 36px; padding: 4px 10px; }
.idiomas button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.oculto { display: none !important; }
.centro { text-align: center; padding: 32px 16px; }
details summary { cursor: pointer; font-weight: 600; }
.link-inicio { color: inherit; text-decoration: none; }
