:root {
  --ink: #141414;
  --muted: #4a4a4a;
  --paper: #ffffff;
  --soft: #f1f4f8;
  --line: #d5dbe3;
  --primary: #0b4f8a;
  --danger: #b00020;
  --ok: #1b5e20;
  --warn: #7a4100;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f2f2;
    --muted: #c4c4c4;
    --paper: #121417;
    --soft: #1d2127;
    --line: #353b44;
    --primary: #6fb1ef;
    --danger: #ff8a8a;
    --ok: #7fd18a;
    --warn: #f0b35a;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.hidden { display: none !important; }
.container { max-width: 960px; margin: 0 auto; padding: 16px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 2;
}
.brand { font-weight: 700; font-size: 19px; }
.topbar-actions { display: flex; gap: 8px; }
h1 { font-size: 28px; margin: 8px 0 16px; }
h2 { font-size: 22px; margin: 20px 0 12px; }
p.muted, .muted { color: var(--muted); }
.card { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.narrow { max-width: 440px; margin: 24px auto; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; margin-right: 8px; transform: scale(1.3); }
.check { display: flex; align-items: flex-start; gap: 6px; font-weight: 400; }
/* Contraseña con botón de ojo: el botón va pegado a la derecha del campo, grande para el dedo. */
.pw { display: flex; gap: 6px; align-items: stretch; }
.pw input { flex: 1; min-width: 0; }
.pw .eye { min-width: 48px; min-height: 44px; padding: 0 10px; font-size: 1.2rem; }
.days { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.days label { margin: 0; font-weight: 400; display: flex; align-items: center; }
button {
  font: inherit; font-weight: 600; border-radius: 8px; padding: 10px 16px; min-height: 44px;
  border: 1px solid var(--primary); background: var(--primary); color: var(--paper); cursor: pointer;
}
/* Enlace con aspecto de botón grande (p. ej. «Descargar la app»). */
a.button {
  display: block; text-align: center; text-decoration: none; font-weight: 700; font-size: 1.2rem;
  border-radius: 8px; padding: 16px; min-height: 56px; background: var(--primary); color: var(--paper);
}
button.ghost { background: transparent; color: var(--primary); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button { background: transparent; color: var(--ink); border: none; border-bottom: 3px solid transparent; border-radius: 0; }
.tabs button[aria-selected=true] { border-bottom-color: var(--primary); color: var(--primary); }
.list { list-style: none; padding: 0; margin: 0; }
.item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 8px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.item .title { font-weight: 700; }
.item .meta { color: var(--muted); font-size: 16px; overflow-wrap: anywhere; }
.badge { display: inline-block; align-self: flex-start; font-size: 14px; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; }
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.danger { color: var(--danger); }
.notice { border-left: 4px solid var(--warn); padding: 8px 12px; background: var(--soft); margin: 12px 0; }
.code { font: 700 28px/1.2 ui-monospace, Consolas, monospace; letter-spacing: 4px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; padding: 12px 16px; border-radius: var(--radius); background: var(--ink); color: var(--paper); }
a { color: var(--primary); }
.map { width: 100%; height: 320px; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 8px; }
.card.alert { border: 2px solid var(--danger); }
.card.install { border: 2px solid var(--primary); }
.qr { display: block; width: 260px; max-width: 100%; height: auto; background: #fff; padding: 8px; border-radius: 8px; margin: 12px 0; }
.card.alert h2 { color: var(--danger); }
details summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
label select { margin-top: 4px; }
@media (max-width: 560px) {
  .container { padding: 12px 16px; }
  h1 { font-size: 24px; }
  .item { flex-direction: column; }
}
