/* quemellevo — sistema visual (#15).
   Sin fuentes ni librerías externas: la PWA tiene que abrir sin red. */

:root {
  /* Superficies y texto */
  --bg: #f4f6f8;
  --bg-soft: #eaeef2;
  --card: #ffffff;
  --card-2: #f8fafc;
  --fg: #101828;
  --fg-2: #344054;
  --muted: #667085;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;

  /* Marca */
  --accent: #0d7d72;
  --accent-2: #14b8a6;
  --accent-fg: #ffffff;
  --accent-soft: #d9f2ee;
  --accent-ink: #0b5f57;

  /* Semánticos */
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --warn: #b54708;
  --warn-soft: #fef0c7;
  --ok: #067647;

  /* Forma */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .07), 0 2px 4px rgba(16, 24, 40, .04);
  --shadow-lg: 0 18px 40px rgba(16, 24, 40, .16), 0 4px 10px rgba(16, 24, 40, .07);

  /* Ritmo */
  --gap: 12px;
  --pad: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e12;
    --bg-soft: #12151b;
    --card: #171a21;
    --card-2: #1d222a;
    --fg: #f2f4f7;
    --fg-2: #d0d5dd;
    --muted: #98a2b3;
    --border: #262b33;
    --border-strong: #343b45;

    --accent: #2dd4bf;
    --accent-2: #5eead4;
    --accent-fg: #052e2b;
    --accent-soft: #14322f;
    --accent-ink: #7ff0e2;

    --danger: #f97066;
    --danger-soft: #3a1a17;
    --warn: #fdb022;
    --warn-soft: #3a2a12;
    --ok: #47cd89;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 44px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3 { letter-spacing: -.021em; }

::selection { background: var(--accent-soft); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ─── Cabecera ────────────────────────────────────────────────────────────── */
header.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  padding-top: env(safe-area-inset-top);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
body.scrolled header.top { border-bottom-color: var(--border); }

header.top .wrap {
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding-top: 8px; padding-bottom: 8px;
}
header.top h1 {
  font-size: 1.1rem; font-weight: 700; margin: 0; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
header.top h1 a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
header.top .sub {
  display: block; font-size: .75rem; font-weight: 500; color: var(--muted);
  letter-spacing: 0; margin-top: -2px;
}

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  border: 1px solid var(--border); object-fit: cover; background: var(--card-2);
}

.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: 1rem;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-sm);
}

/* ─── Bloques ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  padding: var(--pad); margin-bottom: var(--gap);
}
a.card { display: block; color: inherit; text-decoration: none; }
a.card, button { transition: transform .12s var(--ease), box-shadow .18s var(--ease), background .15s var(--ease); }
a.card:active { transform: scale(.985); }

@media (hover: hover) {
  a.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
}

.muted { color: var(--muted); font-size: .875rem; }
.section-title {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); margin: 22px 0 10px;
}

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: .72rem; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap;
}
.chip.neutral { background: var(--bg-soft); color: var(--muted); }
/* `.chip` es inline-flex y eso pisa el atributo `hidden`: sin esto, un chip oculto sale vacío. */
.chip[hidden] { display: none; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }

/* ─── Botones ─────────────────────────────────────────────────────────────── */
button, .btn {
  font: inherit; cursor: pointer; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--card); color: var(--fg);
  padding: 11px 16px; min-height: 44px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button:active, .btn:active { transform: scale(.97); }
button.primary, .btn.primary {
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: var(--accent-fg); border-color: transparent;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}
button.ghost {
  border: none; background: none; padding: 8px; min-height: 40px; min-width: 40px;
  color: var(--fg-2); font-size: 1.05rem;
}
@media (hover: hover) { button.ghost:hover { background: var(--bg-soft); } }
button.danger { color: var(--danger); border-color: var(--border); }
button.danger:active { background: var(--danger-soft); }
button:disabled { opacity: .5; cursor: default; transform: none; }

/* Segmented control */
.segmented {
  display: flex; gap: 4px; padding: 4px; margin: 4px 0 18px;
  background: var(--bg-soft); border-radius: 999px;
}
.segmented button {
  flex: 1; min-height: 38px; padding: 8px 12px; border: none; background: none;
  border-radius: 999px; font-size: .875rem; font-weight: 600; color: var(--muted);
}
.segmented button[aria-selected="true"] {
  background: var(--card); color: var(--fg); box-shadow: var(--shadow-sm);
}
.segmented .count { font-size: .75rem; opacity: .7; margin-left: 4px; }

/* ─── Formularios ─────────────────────────────────────────────────────────── */
input, select, textarea {
  font: inherit; width: 100%; padding: 12px 14px; min-height: 46px;
  border-radius: var(--r-sm); border: 1px solid var(--border-strong);
  background: var(--card); color: var(--fg);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
input::placeholder { color: var(--muted); }
label {
  display: block; font-size: .78rem; font-weight: 700; color: var(--fg-2);
  margin: 14px 0 6px; letter-spacing: .01em;
}
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 8px; }
/* Un aviso del formulario, no una explicación: mismo tamaño, color de error (#39). */
.hint.error { color: var(--danger); font-weight: 600; }

/* Chips de selección (tipo de viaje) */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label {
  margin: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px; font-size: .875rem; font-weight: 600;
  border: 1px solid var(--border-strong); background: var(--card); color: var(--fg-2);
  transition: all .15s var(--ease);
}
.choices input { position: absolute; opacity: 0; width: 0; height: 0; }
.choices input:checked + span, .choices label:has(input:checked) {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink);
}
.choices label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── FAB ─────────────────────────────────────────────────────────────────── */
.fab {
  position: fixed; z-index: 30;
  right: max(16px, calc(50vw - 21rem));
  bottom: calc(20px + env(safe-area-inset-bottom));
  border-radius: 999px; padding: 15px 22px; font-weight: 700;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: var(--accent-fg); border: none;
  box-shadow: var(--shadow-lg);
}
.fab .plus { font-size: 1.15rem; line-height: 1; }

/* ─── Diálogos ────────────────────────────────────────────────────────────── */
dialog {
  border: none; padding: 0; color: var(--fg); background: var(--card);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%; max-width: 34rem; margin: auto auto 0;
  box-shadow: var(--shadow-lg);
  animation: sheet-in .24s var(--ease);
}
@media (min-width: 40rem) {
  dialog { border-radius: var(--r-xl); margin: auto; width: min(34rem, 92vw); }
}
dialog::backdrop { background: rgba(6, 10, 16, .5); backdrop-filter: blur(3px); }
dialog .body { padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); }
dialog h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
dialog .lead { color: var(--muted); font-size: .9rem; margin: 6px 0 4px; }
dialog .grabber {
  width: 38px; height: 4px; border-radius: 999px; background: var(--border-strong);
  margin: 10px auto 2px;
}
@media (min-width: 40rem) { dialog .grabber { display: none; } }
dialog .actions { display: flex; gap: 10px; margin-top: 22px; }
dialog .actions > * { flex: 1; }

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ─── Tarjeta de viaje ────────────────────────────────────────────────────── */
.trip {
  position: relative; overflow: hidden; padding: 0;
}
.trip .banner {
  height: 74px; position: relative;
  background: linear-gradient(135deg, var(--t1, #0d7d72), var(--t2, #14b8a6));
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; color: #fff;
}
.trip .banner .glyph { font-size: 1.9rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.trip .banner .countdown {
  background: rgba(255, 255, 255, .22); border-radius: 999px;
  padding: 5px 12px; font-size: .78rem; font-weight: 700;
  backdrop-filter: blur(4px);
}
.trip .content { padding: 14px 16px 16px; }
.trip .title { display: flex; align-items: baseline; gap: 8px; }
.trip .title strong { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
.trip .title .country { font-size: .8rem; color: var(--muted); }
.trip .meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.trip.past { opacity: .72; }
.trip.past .banner { filter: grayscale(.55); }

/* Progreso */
.bar {
  height: 8px; background: var(--bg-soft); border-radius: 999px;
  overflow: hidden; margin-top: 14px;
}
.bar > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .35s var(--ease);
}
.progress-line {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; font-size: .8rem; color: var(--muted); font-weight: 600;
}

/* Anillo de progreso */
.ring { --p: 0; width: 54px; height: 54px; flex: none; position: relative; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring .track { stroke: var(--bg-soft); }
.ring .fill { stroke: var(--accent); transition: stroke-dashoffset .5s var(--ease); }
.ring .value {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: .78rem; font-weight: 700;
}

/* ─── Resumen del viaje ───────────────────────────────────────────────────── */
.summary { display: flex; align-items: center; gap: 16px; }
.summary .facts { flex: 1; min-width: 0; }
.summary .facts .big { font-size: 1.05rem; font-weight: 700; }

/* Clima */
.weather { display: flex; gap: 14px; align-items: center; }
.weather .icon {
  width: 52px; height: 52px; flex: none; border-radius: var(--r-md);
  display: grid; place-items: center; font-size: 1.7rem;
  background: var(--bg-soft);
}
.weather .temp { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.notice { font-size: .78rem; color: var(--muted); margin-top: 5px; line-height: 1.45; }

/* ─── Listas ──────────────────────────────────────────────────────────────── */
.section-head {
  display: flex; align-items: center; gap: 8px; margin: 22px 0 8px;
}
.section-head .section-title, .section-head h2 { margin: 0; flex: 1; }
.section-head h2 {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
}
.section-head .tally {
  font-size: .75rem; font-weight: 700; color: var(--muted);
  background: var(--bg-soft); border-radius: 999px; padding: 2px 9px;
}
button.add-cat {
  min-height: 32px; min-width: 32px; padding: 0; border-radius: 9px;
  font-size: 1.15rem; line-height: 1; color: var(--accent); font-weight: 700;
  border: 1px solid var(--border); background: var(--card);
}
@media (hover: hover) { button.add-cat:hover { background: var(--accent-soft); border-color: var(--accent); } }

.item {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 4px; border-bottom: 1px solid var(--border);
}
.item:last-child { border-bottom: none; }
.item .name { flex: 1; min-width: 0; }
.item.done .name { text-decoration: line-through; color: var(--muted); }
.item .why { display: block; font-size: .76rem; color: var(--muted); margin-top: 1px; }
/* Editar y quitar se comportan igual: discretos hasta que la fila recibe
   atención. En táctil no hay hover, así que se quedan tenues pero visibles. */
.item .trash, .item .ghost { opacity: 0; transition: opacity .15s var(--ease); font-size: .95rem; }
.item:hover .trash, .item:focus-within .trash,
.item:hover .ghost, .item:focus-within .ghost { opacity: 1; }
@media (hover: none) { .item .trash, .item .ghost { opacity: .45; } }

/* Checkbox propio */
.check { position: relative; width: 24px; height: 24px; flex: none; }
.check input {
  position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%;
  min-height: 0; cursor: pointer;
}
.check .box {
  position: absolute; inset: 0; border-radius: 8px; pointer-events: none;
  border: 2px solid var(--border-strong); background: var(--card);
  transition: all .18s var(--ease);
}
.check .box::after {
  content: ''; position: absolute; left: 7px; top: 3px;
  width: 5px; height: 10px; border: solid var(--accent-fg);
  border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(.4);
  opacity: 0; transition: all .18s var(--ease);
}
.check input:checked + .box {
  background: var(--accent); border-color: var(--accent);
}
.check input:checked + .box::after { opacity: 1; transform: rotate(45deg) scale(1); }
.check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }

.qty {
  font-size: .75rem; font-weight: 700; color: var(--muted);
  background: var(--bg-soft); border-radius: 6px; padding: 1px 7px;
}

/* Recordatorios */
#reminders-section { margin-bottom: 8px; }
#reminders-section .empty { padding: 24px 16px; }
.item.reminder.u-vencido .why { color: var(--danger); font-weight: 700; }
.item.reminder.u-hoy .why { color: var(--accent); font-weight: 700; }

/* ─── Estados ─────────────────────────────────────────────────────────────── */
.empty {
  text-align: center; color: var(--muted); padding: 44px 20px;
  background: var(--card); border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
}
.empty .art { font-size: 2.6rem; margin-bottom: 10px; }
.empty h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--fg); }
.empty p { margin: 0; font-size: .9rem; }
.empty .btn, .empty button { margin-top: 18px; }

/* Skeletons */
.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--card-2) 37%, var(--bg-soft) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s linear infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk-card { height: 152px; border-radius: var(--r-md); margin-bottom: var(--gap); }

/* Aviso de sin conexión */
.offline {
  background: var(--warn-soft); color: var(--warn);
  text-align: center; font-size: .8rem; font-weight: 600;
  padding: 7px; display: none;
}
body.is-offline .offline { display: block; }

/* ─── Toasts (#15) ────────────────────────────────────────────────────────── */
#toasts {
  position: fixed; z-index: 60; left: 0; right: 0;
  bottom: calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 16px;
}
.toast {
  pointer-events: auto; max-width: 30rem; width: fit-content;
  background: var(--fg); color: var(--bg);
  border-radius: 999px; padding: 11px 18px;
  font-size: .875rem; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in .22s var(--ease);
}
.toast.err { background: var(--danger); color: #fff; }
.toast.out { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.96); } }

/* ─── Chuleta de atajos ───────────────────────────────────────────────────── */
table.keys { width: 100%; border-collapse: collapse; margin-top: 14px; }
table.keys td { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
table.keys tr:last-child td { border-bottom: none; }
table.keys td:first-child { width: 4.5rem; }
kbd {
  display: inline-block; min-width: 1.9rem; text-align: center;
  font: 700 .78rem ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 5px 8px; border-radius: 7px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px;
  background: var(--card-2); color: var(--fg);
}

/* ─── Login ───────────────────────────────────────────────────────────────── */
.login {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(90rem 40rem at 50% -22rem, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--bg);
}
.login .panel {
  width: min(24rem, 100%); text-align: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  padding: 36px 26px calc(30px + env(safe-area-inset-bottom));
}
.login .mark {
  width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 18px;
  display: grid; place-items: center; font-size: 1.9rem;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent);
}
.login h1 { font-size: 1.7rem; margin: 0 0 6px; }
.login .claim { color: var(--muted); font-size: .95rem; margin: 0 0 24px; }
.login .points { text-align: left; display: grid; gap: 12px; margin: 0 0 26px; }
.login .points div { display: flex; gap: 11px; align-items: flex-start; font-size: .9rem; color: var(--fg-2); }
.login .points .ic { font-size: 1.05rem; line-height: 1.3; }
.login .gbtn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; text-decoration: none; min-height: 50px;
  font-weight: 700; border-radius: var(--r-sm);
  background: var(--fg); color: var(--bg); border: none;
}
.login .gbtn svg { width: 18px; height: 18px; background: #fff; border-radius: 3px; padding: 1px; }
.login .legal { font-size: .75rem; color: var(--muted); margin: 16px 0 0; }
.login .error {
  background: var(--danger-soft); color: var(--danger); font-weight: 600;
  border-radius: var(--r-sm); padding: 10px; font-size: .85rem; margin: 0 0 18px;
}

/* «Lo compro allí» (#21): ni pendiente ni metido */
.item.buy-there .name { color: var(--muted); }
.item.buy-there .check { opacity: .35; }
button.ghost.shop { font-size: .95rem; opacity: .4; }
button.ghost.shop.on { opacity: 1; }
.item.buy-there .name::after {
  content: 'se compra allí';
  display: block; font-size: .72rem; font-weight: 700;
  color: var(--warn); letter-spacing: .01em;
}

/* Bultos: se tocan para editarlos (#22) */
.bags { display: flex; gap: 10px; margin: 12px 0 4px; flex-wrap: wrap; }
button.bag {
  flex: 1 1 8rem; min-width: 8rem; min-height: 0;
  background: var(--bg-soft); border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 12px 14px; display: flex; flex-direction: column; align-items: flex-start;
  gap: 1px; text-align: left; font-weight: 400;
}
@media (hover: hover) { button.bag:hover { border-color: var(--border-strong); } }
button.bag.over { background: var(--danger-soft); }
.bag-label { font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); }
.bag-name { font-size: .95rem; font-weight: 600; }
.bag b { font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; }
.bag-limit { font-size: .75rem; line-height: 1.35; }
button.bag.over .bag-limit { color: var(--danger); font-weight: 700; }

.flight-warning {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-top: 1px solid var(--border); font-size: .875rem;
}
.flight-warning b { font-weight: 600; }
/* El motivo va en su línea: pegado al nombre se leía como una sola frase corrida. */
.flight-warning .why { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }

.item .why.warn-line { color: var(--warn); }

/* Lo que te encuentras al llegar (#24) */
.dest { display: flex; gap: 10px; }
.dest-item {
  flex: 1; display: flex; flex-direction: column; gap: 1px;
  background: var(--bg-soft); border-radius: var(--r-sm); padding: 11px 12px;
}
.dest-label { font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); }
.dest-item b { font-size: 1.05rem; font-weight: 700; }
.dest-item .muted { font-size: .72rem; line-height: 1.3; }
#destination-card .notice a { color: var(--accent); }

/* Autocompletado con tu histórico (#27) */
.suggestions { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
button.suggestion {
  justify-content: space-between; min-height: 40px; padding: 8px 12px;
  font-weight: 500; font-size: .9rem; background: var(--bg-soft); border-color: transparent;
}
.suggestion-cat { font-size: .7rem; font-weight: 700; color: var(--muted); }

/* Avisos del repaso diario (#25) */
.card.alerts { border-color: var(--warn); background: var(--warn-soft); }
.alert-row {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: .9rem; color: var(--warn); font-weight: 600;
  padding: 4px 0;
}
.card.alerts button.primary { width: 100%; background: var(--warn); box-shadow: none; }

/* Actividades (#26) */
#activities-card .choices { margin-top: 4px; }

/* Aviso de sesión sin cuenta (#28) */
.card.guest {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border-color: var(--warn); background: var(--warn-soft);
}
.card.guest > div { flex: 1; min-width: 12rem; display: flex; flex-direction: column; }
.card.guest b { color: var(--warn); }
.card.guest .muted { font-size: .82rem; }
.card.guest .btn { text-decoration: none; }

/* ─── Sitios pendientes y perfil (#35) ────────────────────────────────────── */

/* Los enlaces de la cabecera se ven como los botones fantasma de al lado. */
.top a.ghost, a.btn.ghost {
  border: none; background: none; padding: 8px; min-height: 40px; min-width: 40px;
  color: var(--fg-2); font-size: 1.05rem; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
@media (hover: hover) { .top a.ghost:hover, a.btn.ghost:hover { background: var(--bg-soft); } }
.top a.avatar-link { line-height: 0; padding: 0; min-width: 0; }

/* De dónde se miden las distancias. Discreto: se lee una vez y se olvida. */
.home-note {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  font-size: .85rem; color: var(--muted); margin-bottom: 12px;
}
.home-note .from { flex: 1; min-width: 0; }
.home-note a.ghost { min-height: 32px; font-size: .8rem; font-weight: 700; color: var(--accent-ink); }

.filters { margin-bottom: 16px; }
.filters .choices label { font-size: .8rem; }
.sortbar { display: flex; justify-content: flex-end; margin: -4px 0 14px; }
.sortbar select { width: auto; min-height: 36px; padding: 5px 10px; font-size: .8rem; color: var(--muted); }

/* Tarjeta de un sitio: icono, lo que es, y a qué distancia. */
button.card.place {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  padding: 14px; margin-bottom: var(--gap); min-height: 0; font-weight: 400;
}
.place .glyph { font-size: 1.6rem; line-height: 1.2; flex: none; }
.place > .body { flex: 1; min-width: 0; display: block; }
.place .title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.place .title strong { font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; }
.place .title .country { font-size: .78rem; color: var(--muted); }
.place .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.place .note {
  display: block; margin-top: 6px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.place .dist { font-size: .8rem; font-weight: 700; color: var(--muted); flex: none; }
.place.done { opacity: .6; }
.place.done .title strong { text-decoration: line-through; }

/* Lo que la app propone (y no lo que has dicho tú) va con el borde punteado. */
.chip.dashed { border: 1px dashed var(--border-strong); background: none; }

/* Resultado del buscador de sitios y direcciones. */
button.result {
  display: flex; width: 100%; text-align: left; justify-content: flex-start;
  margin-top: 6px; font-weight: 500; font-size: .88rem; line-height: 1.35;
  min-height: 40px; padding: 9px 12px;
}

/* Mini mapa de teselas de OpenStreetMap, sin librerías (ver ui.js). */
.minimap {
  position: relative; height: 160px; margin-top: 14px; overflow: hidden;
  border-radius: var(--r-md); background: var(--bg-soft); border: 1px solid var(--border);
}
.minimap .tiles { position: absolute; inset: 0; }
.minimap img { position: absolute; width: 256px; height: 256px; max-width: none; transform: translate(-50%, -50%); }
.minimap .pin {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%);
  font-size: 1.6rem; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .45));
}
.minimap .credit {
  position: absolute; right: 4px; bottom: 3px; font-size: .62rem;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  color: var(--muted); text-decoration: none; padding: 1px 5px; border-radius: 4px;
}

.maplinks { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.maplinks .btn {
  flex: 1 1 0; min-width: 0; font-size: .8rem; padding: 8px 6px; min-height: 40px;
  border: 1px solid var(--border-strong); white-space: nowrap;
}
dialog .actions.wrapped { flex-wrap: wrap; }
dialog .actions.wrapped > * { flex: 1 1 45%; }
.notes { white-space: pre-wrap; font-size: .9rem; color: var(--fg-2); margin-top: 14px; }

/* Perfil */
.card.person { display: flex; align-items: center; gap: 14px; padding: 16px; }
.avatar.big { width: 52px; height: 52px; }
.person .who { min-width: 0; }
.person .who b { display: block; font-size: 1.05rem; }
.card.address { padding: 16px; margin-bottom: var(--gap); }
.card.address.primary { border-color: var(--accent); }
.address .head { display: flex; align-items: center; gap: 8px; }
.address .head b { flex: 1; min-width: 0; }
.address .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.address .actions button { min-height: 40px; font-size: .85rem; border: 1px solid var(--border); }
button.block { width: 100%; margin-top: 8px; }

button.block.ghost { border: 1px solid var(--border); }

/* ─── Coche y mapa que se mueve (#36) ─────────────────────────────────────── */

/* El tiempo manda sobre los kilómetros: va en negrita y encima. */
.place .dist { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.place .dist b { font-size: .85rem; color: var(--fg-2); white-space: nowrap; }
.place .dist span { font-size: .72rem; font-weight: 500; }

.item.route { align-items: center; gap: 10px; }
.item.route .time { font-weight: 700; font-size: .9rem; white-space: nowrap; }

button.ghost.bordered {
  border: 1px solid var(--border-strong); width: 100%; margin-top: 12px;
  min-height: 44px; font-size: .9rem;
}

/* Mapa arrastrable: el pin se queda en el centro y lo que se mueve es el mundo. */
.minimap.pickable {
  height: 220px; cursor: grab; touch-action: none; user-select: none; margin-top: 12px;
}
.minimap.pickable:active { cursor: grabbing; }
.minimap.pickable img { pointer-events: none; }
.minimap .zoom { position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; }
.minimap .zoom button {
  width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0;
  font-size: 1.1rem; font-weight: 700; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
#place-map:not(:empty) + .hint { margin-top: 10px; }

/* Un tiempo estimado se ve que lo es: llega el de verdad en unos segundos (#37). */
.place .dist.guess b { opacity: .65; font-style: italic; }

/* ─── Etapas del viaje (ADR-011) ──────────────────────────────────────────── */
/* Color por tipo: estancia = acento; tramos en tonos propios para leer la tira de un vistazo. */
.stage[data-kind="stay"], .seg[data-kind="stay"] { --stage: var(--accent); }
.stage[data-kind="flight"], .seg[data-kind="flight"] { --stage: #c2410c; }
.stage[data-kind="ferry"], .seg[data-kind="ferry"] { --stage: #1d4ed8; }
.stage[data-kind="departure"], .seg[data-kind="departure"],
.stage[data-kind="return"], .seg[data-kind="return"] { --stage: var(--fg-2); }

.stage-strip { display: flex; gap: 3px; height: 44px; margin: 4px 0 2px; }
.seg {
  position: relative; border-radius: 8px; min-width: 6px; background: var(--stage);
  color: #fff; display: flex; align-items: flex-end; padding: 4px 7px; overflow: hidden;
  font-size: .68rem; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.seg.t0 { flex: none; width: 12px; padding: 0; }
.seg.t0::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(255,255,255,.4) 3px 5px);
}
.stage-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-bottom: 8px; }

.stage {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: start;
  padding: 10px 12px 10px 14px; border-left: 4px solid var(--stage);
  border-bottom: 1px solid var(--border);
}
.stage:last-child { border-bottom: 0; }
.stage .when { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage .when b { color: var(--fg); font-weight: 600; }
.stage .head { display: flex; align-items: center; gap: 8px; }
.stage .head .chip { background: var(--stage); color: #fff; }
.stage input.title {
  flex: 1; min-width: 0; font-size: 1rem; font-weight: 600; background: none; border: 0;
  border-bottom: 1px dashed transparent; padding: 2px 0; color: var(--fg); border-radius: 0;
}
.stage input.title:focus { outline: none; border-bottom-color: var(--border-strong); }
.stage .fields { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--muted); align-items: center; }
.stage .fields label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.stage .fields input[type="number"] {
  width: 62px; padding: 3px 6px; min-height: 0; font-size: .82rem; text-align: right;
  font-variant-numeric: tabular-nums; border-radius: 7px; border: 1px solid var(--border);
  background: var(--card-2); color: var(--fg);
}
.stage .fields input.notes { flex: 1 1 160px; width: auto; text-align: left; }
.stage .stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.stage .stepper button { min-height: 0; height: 26px; width: 26px; padding: 0; border: 0; border-radius: 0; background: var(--bg-soft); font-size: 1rem; }
.stage .stepper b { width: 30px; text-align: center; font-size: .85rem; font-variant-numeric: tabular-nums; }
.stage .side { display: grid; justify-items: end; gap: 6px; }
.stage .cost { font-weight: 700; font-variant-numeric: tabular-nums; }
.stage .cost small { display: block; font-weight: 400; font-size: .7rem; color: var(--muted); }
.stage .actions { display: flex; gap: 4px; }
.stage .actions button {
  min-height: 0; height: 28px; width: 28px; padding: 0; font-size: .85rem;
  border: 1px solid var(--border); background: var(--card); color: var(--muted); border-radius: 8px;
}
.stage .actions button:disabled { opacity: .35; }
.stage .actions button.del:hover { color: var(--danger); border-color: var(--danger); }

.stage-costs { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px 14px; padding: 12px 14px; margin-top: 10px; }
.stage-costs .k { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stage-costs .v { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.stage-costs .v.total { color: var(--accent-ink); }

/* La barra de añadir queda fija al pie mientras se recorre la lista: se añade con el pulgar. */
.stage-add {
  position: sticky; bottom: 76px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; padding: 10px 12px; margin-top: 10px; box-shadow: var(--shadow-md);
}
.stage-add select, .stage-add input, .stage-add button { min-height: 38px; }
.stage-add input#stage-title { flex: 1 1 150px; }
.stage-add .stage-nights-field { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.stage-add .stage-nights-field input { width: 64px; text-align: right; }
@media (max-width: 480px) {
  .stage { grid-template-columns: 1fr; }
  .stage .side { grid-template-columns: auto auto; justify-content: space-between; justify-items: start; }
  .seg { font-size: 0; }
}

/* Notas del viaje: pregunta + valor; vacío = pendiente. Agrupadas por sección. */
.note-section { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 12px 4px; }
.note { display: grid; grid-template-columns: 1fr 120px 28px; gap: 8px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--border); }
.note:last-child { border-bottom: 0; }
.note input { min-height: 0; padding: 4px 0; background: none; border: 0; border-bottom: 1px dashed transparent; border-radius: 0; color: var(--fg); font-size: .9rem; min-width: 0; }
.note input:focus { outline: none; border-bottom-color: var(--border-strong); }
.note input.value { text-align: right; font-weight: 600; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.note input.value:placeholder-shown { font-weight: 400; color: var(--muted); }
.note button { min-height: 0; height: 28px; width: 28px; padding: 0; font-size: .85rem; border: 1px solid var(--border); background: var(--card); color: var(--muted); border-radius: 8px; }
@media (max-width: 480px) { .note { grid-template-columns: 1fr 90px 28px; } }

.stage-weather { margin-left: 8px; font-size: .74rem; color: var(--fg-2); white-space: nowrap; }
.stage-weather.estimate { color: var(--warn); }

/* Compartir (#56) */
.members { display: grid; gap: 6px; margin: 12px 0; }
.member { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--card-2); border-radius: var(--r-sm); font-size: .9rem; }
.member .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.member .who small { display: block; color: var(--muted); font-size: .75rem; }
.member button { min-height: 0; height: 28px; padding: 0 10px; font-size: .78rem; }
.card.trip .shared { font-size: .72rem; }

/* Vuelos apuntados (#55) */
.quotes-wrap { overflow-x: auto; }
table.quotes { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 560px; }
table.quotes th { text-align: left; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; }
table.quotes th.on { color: var(--accent-ink); }
table.quotes td { padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
table.quotes tr:last-child td { border-bottom: 0; }
table.quotes td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.quotes td.price { font-weight: 700; }
table.quotes tr.best td { background: var(--accent-soft); }
.prob { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.prob i { width: 36px; height: 5px; border-radius: 99px; background: var(--bg-soft); position: relative; overflow: hidden; }
.prob i::after { content: ""; position: absolute; inset: 0; width: var(--p); background: var(--ok); border-radius: 99px; }
.prob.up i::after { background: var(--danger); }
.trend { font-size: .72rem; color: var(--muted); margin-left: 4px; }
table.quotes button { min-height: 0; height: 26px; padding: 0 8px; font-size: .75rem; }
.quote-add { position: static; box-shadow: none; }
.quote-add input { flex: 1 1 90px; min-width: 0; }
.quote-add input#q-origin, .quote-add input#q-dest { flex: 0 0 64px; text-transform: uppercase; }
.quote-add input#q-stops { flex: 0 0 56px; }
.quote-add input#q-price { flex: 0 0 90px; }

/* ─── Archivos del viaje ──────────────────────────────────────────────────── */
.item.file { gap: 10px; }
.item.file .file-glyph { font-size: 1.3rem; flex: none; }
.item.file a.name { color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.item.file a.name b { font-weight: 600; }

/* Página de un archivo: /f/<id> */
.file-view { text-align: center; }
.file-view .preview { margin: 14px 0; }
.file-view img, .file-view video {
  max-width: 100%; max-height: 70vh; border-radius: var(--r-sm); background: var(--card-2);
}
.file-view audio { width: 100%; }
.file-view iframe {
  width: 100%; height: 72vh; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: #fff;
}
.file-view pre {
  text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 70vh;
  overflow: auto; background: var(--card-2); padding: 12px; border-radius: var(--r-sm);
  font-size: .85rem;
}
.file-view .big-glyph { font-size: 4rem; margin: 18px 0 8px; }
.file-view .file-name { overflow-wrap: anywhere; }
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.file-actions > * { flex: 1 1 140px; }
.file-actions a.btn { text-decoration: none; }
