:root {
  --ink: #17342f;
  --coral: #ea5c45;
  --paper: #f7f3eb;
  --sand: #e7ddca;
  --muted: #66726b;
  --line: #d5ccbc;
  --sea: #edf1ee;
  --warn: #ae3524;
  --ok: #2f6b52;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Red de seguridad: un código largo o una URL pegada no puede ensanchar la página. */
p, h1, h2, h3, li, blockquote, td, summary { overflow-wrap: anywhere; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
main { max-width: 1080px; margin: auto; padding: 28px 32px 72px; }

.lock-screen { min-height: 100vh; max-width: 530px; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { margin: 0 0 9px; color: var(--coral); font: 500 11px "DM Mono", monospace; letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: "Playfair Display", serif; }
h1 { font-size: clamp(58px, 11vw, 108px); line-height: .88; letter-spacing: -.06em; }
h1 span { color: var(--coral); }
h1 em, h2 em { font-weight: 600; }
.intro { max-width: 340px; color: var(--muted); line-height: 1.6; font-size: 17px; }

.access-form { margin-top: 22px; display: grid; gap: 9px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
input, select, textarea { border: 1px solid var(--line); background: #fffdf8; border-radius: 4px; padding: 12px; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #f3a495; outline-offset: 1px; }
.access-form button, .full-button { border: 0; border-radius: 4px; background: var(--ink); color: white; padding: 13px 16px; font-weight: 700; }
.form-note { min-height: 18px; margin: 0; color: var(--warn); font-size: 13px; }
.form-hint { color: var(--muted); font-size: 12px; margin: 4px 0 0; }

.masthead { display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 22px; }
.masthead h1 { font-size: 42px; margin: 0; }
.masthead-actions { display: flex; gap: 14px; align-items: center; }
.text-button { border: 0; background: none; color: var(--ink); font-size: 13px; text-decoration: underline; padding: 5px 0; }
.text-button.muted { color: var(--muted); }

.hero { padding: 30px 0 6px; margin-top: 30px; border-top: 1px solid var(--line); max-width: 760px; }
.hero h2 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; letter-spacing: -.04em; }
.hero > p:not(.eyebrow) { color: var(--muted); font-size: 16px; }
.status-row { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 12px "DM Mono", monospace; margin-top: 22px; flex-wrap: wrap; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--coral); }

.trip-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--line); padding-top: 18px; }
.trip-stats dt { color: var(--muted); font: 500 10px "DM Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.trip-stats dd { margin: 4px 0 0; font-family: "Playfair Display", serif; font-size: 27px; letter-spacing: -.03em; }

/* ------------------------------------------------------ portada: qué hacer */
.briefing { display: grid; gap: 16px; margin: 8px 0 10px; }
.briefing > div:empty { display: none; }

.alerts { display: grid; gap: 8px; }
.alert { display: grid; grid-template-columns: 22px 1fr auto; gap: 11px; margin: 0; padding: 13px 15px; border-radius: 5px; border-left: 3px solid var(--warn); background: #fdeee9; color: #7c2718; align-items: start; }
.alert-warning { border-left-color: #c8873a; background: #fbf1e2; color: #6d4715; }
.alert-info { border-left-color: var(--ink); background: #eef3ef; color: var(--ink); }
.alert-icon { font-size: 15px; line-height: 1.3; }
.alert-title { margin: 0; font-weight: 700; font-size: 14px; line-height: 1.35; }
.alert-body { margin: 4px 0 0; font-size: 13px; line-height: 1.5; opacity: .88; }
.alert-when { color: inherit; opacity: .65; font: 10px "DM Mono", monospace; white-space: nowrap; }
.alert-actions, .msg-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 9px 0 0; }
.link-button { border: 0; background: none; padding: 0; color: inherit; font: 600 12px "DM Sans", sans-serif; text-decoration: underline; cursor: pointer; }

.next-step { border: 1px solid var(--ink); border-radius: 6px; padding: 22px; background: #fffcf6; }
.next-head { display: flex; gap: 14px; align-items: start; }
.next-icon { font-size: 22px; line-height: 1.1; }
.next-count { margin: 0 0 2px; color: var(--muted); font: 12px "DM Mono", monospace; }
.next-count strong { color: var(--coral); font-family: "DM Mono", monospace; font-size: 14px; }
.next-step h3 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.next-clock { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: end; margin: 18px 0 4px; }
.next-clock.is-missing { grid-template-columns: auto 1fr; align-items: center; }
.clock-slot { display: grid; gap: 1px; }
.clock-slot.end { text-align: right; }
.clock-label { color: var(--muted); font: 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.clock-slot strong { font-family: "Playfair Display", serif; font-size: 38px; line-height: .95; letter-spacing: -.03em; }
.clock-slot em { color: var(--muted); font-style: normal; font: 11px "DM Mono", monospace; }
.clock-gap { display: grid; gap: 3px; justify-items: center; padding-bottom: 9px; }
.clock-gap span:first-child { color: var(--muted); font: 10px "DM Mono", monospace; }
.clock-line { width: 100%; min-width: 40px; height: 1px; background: var(--line); }
.clock-missing { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.clock-missing .link-button { color: var(--coral); }

.next-line { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink); }
.next-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
/* Dónde te recoge el Uber y qué esperar en esa ciudad: es un dato práctico,
   no una alerta, así que va en el tono de las notas y no compite con ellas. */
.uber-note { line-height: 1.5; max-width: 62ch; border-left: 2px solid var(--line); padding-left: 10px; }
.next-state { margin: 10px 0 0; font: 12px "DM Mono", monospace; color: var(--muted); }
.next-state.warn { color: #8a5a12; }
.next-state.ok { color: var(--ok); }
.next-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.pill-button { border: 1px solid var(--line); border-radius: 20px; padding: 7px 14px; background: #fffdf8; color: var(--ink); font: 600 12px "DM Sans", sans-serif; text-decoration: none; }
.pill-button:hover { border-color: var(--ink); }
.pill-button.primary { background: var(--ink); border-color: var(--ink); color: white; }

.doc-strip { border: 1px dashed var(--line); border-radius: 5px; padding: 14px 16px; background: #fffdf8; }
.doc-list { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-chip { border: 1px solid var(--line); border-radius: 4px; padding: 7px 11px; background: var(--paper); color: var(--ink); font: 600 12px "DM Sans", sans-serif; text-decoration: none; }
.doc-chip:hover { border-color: var(--coral); }
.doc-empty { margin: 0; color: var(--muted); font-size: 13px; }

.home-messages { display: grid; gap: 10px; }
.home-message { border: 1px solid var(--line); border-left: 3px solid var(--coral); border-radius: 5px; padding: 16px 18px; background: #fffcf6; }
.msg-where { margin: 0 0 8px; font: 600 14px "DM Sans", sans-serif; }
.msg-quote { margin: 0; padding: 9px 13px; border-left: 2px solid var(--line); background: #f7f2e7; font-size: 13px; line-height: 1.55; white-space: pre-line; }
.msg-quote.muted { color: var(--muted); font-style: italic; }
.msg-foot span { color: var(--muted); font: 10px "DM Mono", monospace; }

.weather-card { border: 1px solid var(--line); border-radius: 5px; padding: 16px 18px; background: #fffcf6; }
.weather-row { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.weather-now { display: flex; gap: 8px; align-items: baseline; }
.weather-now .weather-icon { font-size: 22px; }
.weather-now strong { font-family: "Playfair Display", serif; font-size: 30px; letter-spacing: -.03em; }
.weather-now em { color: var(--muted); font-style: normal; font-size: 13px; }
.weather-days { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; flex-wrap: wrap; }
.weather-days li { display: grid; gap: 2px; justify-items: center; padding: 6px 9px; border-radius: 5px; }
.weather-days li.is-key { background: var(--sand); }
.wd-day { color: var(--muted); font: 10px "DM Mono", monospace; text-transform: uppercase; }
.wd-icon { font-size: 17px; }
.wd-temp { font: 500 12px "DM Mono", monospace; }
.wd-rain { color: #2f5f8a; font: 10px "DM Mono", monospace; }
.weather-note, .weather-loading { margin: 12px 0 0; color: var(--muted); font-size: 13px; }

.upcoming-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.upcoming-list li { display: grid; grid-template-columns: 22px 1fr auto; gap: 11px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.upcoming-list li:last-child { border-bottom: 0; }
.up-icon { font-size: 15px; color: var(--muted); }
.up-main { display: grid; gap: 2px; min-width: 0; }
.up-main strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-main em { color: var(--muted); font-style: normal; font: 11px "DM Mono", monospace; }
.up-count { color: var(--coral); font: 11px "DM Mono", monospace; white-space: nowrap; }

/* -------------------------------------------------------------- mensajes */
.messages { display: grid; gap: 26px; margin-top: 24px; }
.message-group h3 { display: flex; gap: 8px; align-items: center; font-family: "DM Sans", sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.message-group h3 span { border: 1px solid var(--line); border-radius: 9px; padding: 1px 7px; font: 10px "DM Mono", monospace; }
.message-card { border: 1px solid var(--line); border-radius: 6px; padding: 18px; background: #fffcf6; margin-bottom: 10px; }
.message-card.is-new { border-left: 3px solid var(--coral); }
.message-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.message-head h3 { margin: 0; font-size: 19px; text-transform: none; letter-spacing: -.02em; color: var(--ink); }
.message-when { color: var(--muted); font: 10px "DM Mono", monospace; white-space: nowrap; }
.tab-count { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 6px; padding: 0 4px; border-radius: 9px; background: var(--coral); color: white; font: 500 10px "DM Mono", monospace; }

/* ------------------------------------------------------------ documentos */
.documents { display: grid; gap: 26px; margin-top: 20px; }
.doc-group-title { font-family: "DM Sans", sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 10px; }
.doc-card { display: flex; gap: 14px; align-items: start; border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; background: #fffcf6; margin-bottom: 10px; }
/* La tarjeta de embarque es la que se busca corriendo: se distingue sola. */
.doc-card[data-kind="boarding"] { border-left: 3px solid var(--coral); }
.doc-icon { font-size: 20px; line-height: 1.2; }
.doc-body { flex: 1; min-width: 0; }
.doc-body h4 { margin: 0 0 4px; font: 600 17px "DM Sans", sans-serif; letter-spacing: -.02em; overflow-wrap: anywhere; }
.doc-meta { margin: 0; color: var(--muted); font: 11px "DM Mono", monospace; line-height: 1.6; }
.doc-link-item { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.doc-card .mail-links { margin-top: 10px; }
.doc-card .link-button[disabled] { opacity: .5; cursor: progress; }

.stay-messages { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 13px; }
.stay-messages h4 { margin: 0 0 9px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stay-message { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.stay-message:last-of-type { border-bottom: 0; }
.sm-head { margin: 0 0 4px; color: var(--muted); font: 10px "DM Mono", monospace; }
.sm-body { margin: 0 0 5px; font-size: 13px; line-height: 1.5; }
.sm-more { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.instructions { margin: 12px 0 0; border: 1px solid var(--line); border-radius: 5px; padding: 11px 14px; background: #f7f2e7; }
.instructions summary { cursor: pointer; font: 600 13px "DM Sans", sans-serif; }
.instructions p { margin: 9px 0 0; font-size: 13px; line-height: 1.55; white-space: pre-line; }
/* La zona de recogida del Uber es texto normal, no una instrucción copiada
   del anfitrión: no conserva los saltos de línea del original. */
.uber-details p { white-space: normal; }

.dialog-body { padding: 27px; display: grid; gap: 15px; max-height: 86vh; overflow-y: auto; }
.message-meta { margin: 0; color: var(--muted); font: 11px "DM Mono", monospace; line-height: 1.6; }
.message-body { margin: 0; padding: 14px 16px; border-left: 2px solid var(--coral); background: #f7f2e7; font-size: 14px; line-height: 1.6; white-space: pre-line; }

/* Una acción no necesita una tarjeta: un botón y cuándo fue la última vez. */
.sync-bar { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); }
.sync-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sync-button, .file-button { border: 0; border-radius: 3px; padding: 10px 14px; background: var(--ink); color: white; font-size: 13px; font-weight: 700; cursor: pointer; display: inline-grid; place-items: center; text-decoration: none; }
.sync-button[disabled] { opacity: .6; cursor: progress; }
.file-button.secondary { border: 1px solid var(--ink); background: transparent; color: var(--ink); }
.sync-note { margin: 0; color: var(--muted); font: 11px "DM Mono", monospace; line-height: 1.5; }
.sync-help { margin-top: 12px; }
.sync-help summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.sync-help p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 620px; }

.tabs { display: flex; gap: 4px; margin: 24px 0 0; border-bottom: 1px solid var(--line); }
.tab { position: relative; display: flex; align-items: center; gap: 7px; border: 0; background: none; color: var(--muted); padding: 11px 14px; font-size: 14px; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.is-active { color: var(--ink); border-bottom-color: var(--coral); }
.tab-icon { font-size: 14px; opacity: .75; }
.tab.is-active .tab-icon { opacity: 1; }

/* Sub-vistas de un grupo: cambian de panel sin sumar destinos a la barra. */
.segmented { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.segment { border: 1px solid var(--line); background: #fffdf8; color: var(--muted); border-radius: 20px; padding: 7px 14px; font-size: 13px; font-weight: 600; }
.segment.is-active { background: var(--ink); border-color: var(--ink); color: white; }

.icon-action { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: #fffdf8; font-size: 15px; line-height: 1; }
.icon-action:hover { border-color: var(--ink); }
.icon-action.is-done { background: var(--ok); border-color: var(--ok); }
.icon-action.is-done span { visibility: hidden; }
.icon-action.is-done::after { content: '✓'; position: absolute; color: white; font-size: 15px; }

.panel { margin-top: 34px; }
#panel-hoy { margin-top: 22px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; border-bottom: 1px solid var(--ink); padding-bottom: 15px; gap: 12px; }
.section-heading h2 { margin: 0; font-size: 36px; letter-spacing: -.04em; }
.panel-hint { color: var(--muted); font: 11px "DM Mono", monospace; text-align: right; max-width: 260px; }
.add-button { border: 0; background: none; color: var(--coral); padding: 5px 0; font-size: 14px; font-weight: 700; white-space: nowrap; }
.empty-state { padding: 54px 0; text-align: center; color: var(--muted); }
.empty-state p { color: var(--ink); margin-bottom: 5px; font: 600 22px "Playfair Display", serif; }
.empty-inline { color: var(--muted); font-size: 14px; line-height: 1.5; padding: 26px 0; margin: 0; }

/* ------------------------------------------------------------------ mapa */
.map-wrap { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; margin-top: 22px; align-items: start; }
.map-container { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--sea); }
.map { display: block; width: 100%; height: auto; }
.map .sea { fill: var(--sea); }
.map .land path { fill: var(--sand); stroke: #cbbfa8; }
.map .leg { stroke: var(--ink); opacity: .8; cursor: pointer; }
.map .leg-cancelado { stroke: var(--warn); stroke-dasharray: 7 6; }
.map .leg-cambiado, .map .leg-retrasado { stroke: #c8873a; }
.map .leg-pendiente, .map .leg-sin-reserva { stroke: var(--muted); stroke-dasharray: 3 7; opacity: .6; }
.map .leg.is-selected { stroke: var(--coral); opacity: 1; }
.map .arrow-head { fill: var(--ink); }
.map .node { cursor: pointer; }
.map .node-halo { fill: transparent; }
.map .node:hover .node-halo, .map .node:focus .node-halo { fill: #ea5c4522; }
.map .node-dot { fill: #fffcf6; stroke: var(--ink); }
.map .node-off { stroke-dasharray: 4 3; }
.map .node.is-selected .node-dot, .map .node:hover .node-dot { fill: var(--coral); stroke: var(--coral); }
.map .node.is-selected .node-index, .map .node:hover .node-index { fill: white; }
.map .node-index { fill: var(--ink); text-anchor: middle; font-family: "DM Mono", monospace; font-weight: 500; }
.map .node-label { fill: var(--ink); font-family: "DM Sans", sans-serif; font-weight: 700; stroke: var(--sand); paint-order: stroke; }
.map .node-sub { fill: var(--muted); font-family: "DM Mono", monospace; stroke: var(--sand); paint-order: stroke; }
.map .node:focus { outline: none; }

.map .leg-label { fill: var(--ink); font-family: "DM Mono", monospace; text-anchor: middle; stroke: var(--sea); paint-order: stroke; pointer-events: none; }
.map .leg-label-missing { fill: var(--muted); font-style: italic; }

.map-detail { border: 1px solid var(--line); border-radius: 6px; padding: 20px; background: #fffcf6; min-height: 180px; }
.map-detail h3 { margin: 0 0 2px; font-size: 26px; letter-spacing: -.03em; }
.detail-country { color: var(--muted); font: 11px "DM Mono", monospace; margin-bottom: 14px; }
.detail-dates { font: 12px "DM Mono", monospace; color: var(--coral); margin-bottom: 12px; }
.detail-line { font-size: 14px; line-height: 1.5; margin-bottom: 10px; }
.detail-line span { color: var(--muted); font-size: 13px; }

/* --------------------------------------------------------------- gráficos */
.chart-block { margin-top: 34px; }
.chart-block h3 { font-family: "DM Sans", sans-serif; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 14px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.bars li { display: grid; grid-template-columns: 150px 1fr 90px; gap: 12px; align-items: center; font-size: 13px; }
.bar-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--sand); border-radius: 3px; height: 16px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.bar-value { color: var(--muted); font: 11px "DM Mono", monospace; text-align: right; }

.ribbon { position: relative; padding: 26px 0 24px; }
.ribbon-track { position: relative; height: 34px; background: var(--sand); border-radius: 4px; }
.ribbon-block { position: absolute; top: 0; height: 100%; border-radius: 3px; background: var(--ink); color: #fffcf6; display: flex; align-items: center; overflow: hidden; }
.ribbon-block span { font: 10px "DM Mono", monospace; padding: 0 6px; white-space: nowrap; }
.ribbon-block.c1 { background: #24564a; }
.ribbon-block.c2 { background: #3c6f5b; }
.ribbon-block.c3 { background: #55836b; }
.ribbon-block.c4 { background: #6f977c; }
.ribbon-marks { position: relative; height: 22px; }
.ribbon-mark { position: absolute; transform: translateX(-50%); font-size: 13px; color: var(--ink); }
.ribbon-mark.mark-cancelado { color: var(--warn); }
.ribbon-mark.mark-cambiado, .ribbon-mark.mark-retrasado { color: #c8873a; }
.ribbon-axis { position: relative; height: 20px; margin-top: 6px; }
.ribbon-tick { position: absolute; transform: translateX(-50%); font: 10px "DM Mono", monospace; color: var(--muted); text-transform: uppercase; }
.chart-note { font: 11px "DM Mono", monospace; color: var(--muted); margin: 0; }

/* -------------------------------------------------------------- ciudades */
.cities { display: grid; gap: 16px; margin-top: 24px; }
.city-card { border: 1px solid var(--line); border-radius: 6px; padding: 22px; background: #fffcf6; }
.city-head { display: flex; align-items: center; gap: 14px; }
.city-index { font: 500 12px "DM Mono", monospace; color: var(--coral); border: 1px solid var(--coral); border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; flex: none; }
.city-head h3 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.city-country { margin: 0; color: var(--muted); font: 11px "DM Mono", monospace; }
.city-nights { margin-left: auto; text-align: right; }
.city-nights strong { display: block; font-family: "Playfair Display", serif; font-size: 30px; line-height: 1; }
.city-nights span { color: var(--muted); font: 10px "DM Mono", monospace; }
.city-dates { margin: 14px 0 12px; font: 12px "DM Mono", monospace; color: var(--coral); }
.city-transport { display: grid; gap: 5px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; margin-bottom: 14px; }
.city-transport p { margin: 0; font-size: 13px; color: var(--ink); }
.city-transport em { color: var(--muted); }
.transport-tag { display: inline-block; min-width: 62px; color: var(--muted); font: 10px "DM Mono", monospace; text-transform: uppercase; }
.stay-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.stay-row:last-of-type { border-bottom: 0; }
.stay-title { margin: 0 0 3px; font-weight: 700; font-size: 15px; }
.stay-meta { margin: 0; color: var(--muted); font: 11px "DM Mono", monospace; line-height: 1.5; }
.stay-details { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.city-extra { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- vuelos */
.flights { display: grid; gap: 16px; margin-top: 24px; }
.flight-card { border: 1px solid var(--line); border-radius: 6px; padding: 22px; background: #fffcf6; }
.flight-card.is-cancelled { opacity: .72; border-style: dashed; }
.flight-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.flight-head h3 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.flight-head-side { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: end; }
.flight-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 20px 0 14px; }
.endpoint { display: grid; gap: 2px; }
.endpoint.end { text-align: right; }
.endpoint .code { font-family: "Playfair Display", serif; font-size: 30px; letter-spacing: -.03em; line-height: 1; }
.endpoint .time { font: 500 14px "DM Mono", monospace; color: var(--coral); }
.endpoint .place { color: var(--muted); font-size: 12px; }
.endpoint-link { display: grid; grid-template-columns: 26px auto 26px; align-items: center; gap: 5px; position: relative; color: var(--muted); }
.endpoint-link .line { height: 1px; background: var(--line); }
.endpoint-link .glyph { font-size: 15px; color: var(--ink); }
.endpoint-link .duration { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); font: 10px "DM Mono", monospace; white-space: nowrap; }
.flight-meta { margin: 0; color: var(--muted); font: 11px "DM Mono", monospace; line-height: 1.6; }
.flight-details { margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.history { margin: 10px 0 0; padding-left: 16px; color: #6d4715; font: 11px "DM Mono", monospace; line-height: 1.6; }
.mail-note { margin: 12px 0 0; padding: 10px 14px; border-left: 2px solid var(--line); background: #f7f2e7; color: var(--ink); font-size: 13px; line-height: 1.55; white-space: pre-line; }
.mail-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; }
.mail-link { color: var(--ink); font: 600 12px "DM Sans", sans-serif; text-decoration: underline; }
.chip { border: 1px solid var(--line); border-radius: 10px; padding: 3px 9px; color: var(--muted); font: 10px "DM Mono", monospace; background: #fffdf8; }
.pin-link { display: inline-block; margin-top: 6px; color: var(--ink); font: 600 12px "DM Sans", sans-serif; text-decoration: none; border-bottom: 1px solid var(--coral); }
.pin-link:hover { color: var(--coral); }
.updated { margin: 8px 0 0; color: var(--muted); font: 10px "DM Mono", monospace; }

.badge { border-radius: 10px; padding: 4px 9px; font: 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .06em; border: 1px solid; }
.badge-cancelado { color: var(--warn); border-color: var(--warn); background: #fdeee9; }
.badge-cambiado, .badge-retrasado { color: #8a5a12; border-color: #d3a45f; background: #fbf1e2; }
.badge-pendiente { color: var(--muted); border-color: var(--line); background: transparent; }

.heading-actions { display: flex; gap: 10px; align-items: center; }
.panel-note { margin: 18px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 640px; }

.stay-card .stay-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
.stay-grid span { display: block; color: var(--muted); font: 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.stay-grid strong { display: block; font-family: "Playfair Display", serif; font-size: 21px; letter-spacing: -.02em; margin: 3px 0 2px; }
.stay-grid em { color: var(--muted); font-style: normal; font: 11px "DM Mono", monospace; }

.statuses { display: grid; gap: 22px; margin-top: 24px; }
.status-group h3 { font-family: "DM Sans", sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.status-group h3 span { border: 1px solid var(--line); border-radius: 9px; padding: 1px 7px; font: 10px "DM Mono", monospace; }
.status-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.status-group > ul > li { display: flex; justify-content: space-between; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 5px; background: #fffcf6; }
.status-cancelado > ul > li { border-left: 3px solid var(--warn); }
.status-cambiado > ul > li, .status-retrasado > ul > li { border-left: 3px solid #c8873a; }
.status-pendiente > ul > li { border-left: 3px solid var(--line); }
.status-confirmado > ul > li { border-left: 3px solid var(--ok); }
.status-title { margin: 0 0 3px; font-weight: 700; font-size: 15px; }
.status-meta { margin: 0; color: var(--muted); font: 11px "DM Mono", monospace; }
.status-side { display: flex; align-items: center; gap: 10px; flex: none; }
.status-side .updated { margin: 0; white-space: nowrap; }

/* -------------------------------------------------------------- itinerario */
.itinerary { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.trip-item { display: grid; grid-template-columns: 100px 28px 1fr auto auto; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 6px; background: #fffcf6; align-items: center; }
.trip-item.is-cancelled { opacity: .6; border-style: dashed; }
.trip-date { color: var(--coral); font: 12px "DM Mono", monospace; padding-top: 5px; }
.trip-icon { font-size: 19px; }
.trip-icon.upcoming { color: var(--coral); }
.trip-item h3 { margin: 0 0 4px; font-size: 18px; }
.trip-item p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.trip-tag { border: 1px solid var(--line); padding: 4px 7px; border-radius: 10px; color: var(--muted); font: 10px "DM Mono", monospace; text-transform: uppercase; align-self: start; }
.trip-main { min-width: 0; }
.trip-actions { display: flex; gap: 6px; align-self: start; }
.icon-button { border: 1px solid var(--line); background: #fffcf6; color: var(--ink); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; line-height: 1; }
.icon-button:hover { background: var(--ink); color: white; border-color: var(--ink); }
/* Pedir un Uber es una acción secundaria: entra como ícono al lado de las
   demás y no se lleva una fila entera. En celular crece al tamaño de dedo. */
.uber-button { text-decoration: none; font-size: 13px; flex: none; }
.icon-button.delete-btn:hover { background: var(--warn); border-color: var(--warn); }

/* ---------------------------------------------------------------- diálogo */
dialog { width: min(560px, calc(100% - 30px)); border: 0; border-radius: 7px; padding: 0; color: var(--ink); background: #fffcf6; box-shadow: 0 18px 80px #17342f55; }
dialog::backdrop { background: #17342faa; }
dialog form { padding: 27px; display: grid; gap: 15px; max-height: 86vh; overflow-y: auto; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; }
.dialog-heading h2 { margin: 0; font-size: 31px; }
.close { border: 0; background: transparent; color: var(--ink); font-size: 29px; line-height: .8; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fieldset { border: 1px solid var(--line); border-radius: 5px; padding: 16px; display: grid; gap: 12px; margin: 0; }
.fieldset legend { color: var(--muted); font: 500 10px "DM Mono", monospace; letter-spacing: .1em; text-transform: uppercase; padding: 0 6px; }
.dialog-actions { display: grid; gap: 10px; }
.danger-button { border: 1px solid var(--warn); background: transparent; color: var(--warn); padding: 11px 16px; border-radius: 4px; font-weight: 700; }
.danger-button:hover { background: var(--warn); color: white; }

@media (max-width: 900px) {
  .map-wrap { grid-template-columns: 1fr; }
  .trip-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  main { padding: 18px 16px 46px; }

  .hero { padding: 20px 0 6px; margin-top: 22px; }
  .hero .eyebrow { display: none; }
  .hero h2 { font-size: clamp(26px, 8vw, 34px); margin-bottom: 8px; }
  .hero > p:not(.eyebrow) { font-size: 14px; }
  .status-row { margin-top: 14px; font-size: 10px; }
  .trip-stats { margin-top: 16px; padding-top: 14px; gap: 8px; }
  .trip-stats dd { font-size: 22px; }
  .briefing { gap: 12px; }
  .next-clock { gap: 10px; }
  .clock-slot strong { font-size: 32px; }
  .sync-bar { margin-top: 22px; }
  .sync-button { min-height: 44px; padding: 12px 18px; }

  /* Barra inferior fija, como en una app: siempre al alcance del pulgar. */
  main { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
    background: #fffcf6; border-top: 1px solid var(--line); border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -6px 24px #17342f14;
  }
  .tab {
    flex-direction: column; gap: 3px; padding: 9px 2px 8px; margin: 0;
    border-bottom: 0; border-top: 2px solid transparent; font-size: 10px; min-height: 56px;
  }
  .tab.is-active { border-bottom-color: transparent; border-top-color: var(--coral); }
  .tab-icon { font-size: 17px; }
  .tab-label { letter-spacing: .01em; }
  .tab-count { position: absolute; top: 5px; right: calc(50% - 20px); margin: 0; }
  .segmented { margin-top: 14px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .segmented::-webkit-scrollbar { display: none; }
  .segment { flex: none; min-height: 40px; }
  .trip-item { grid-template-columns: 74px 22px 1fr; gap: 10px; padding: 13px 14px; align-items: start; }
  .next-step { padding: 18px 16px; }
  .next-step h3 { font-size: 21px; }
  .next-actions { gap: 7px; }
  /* Objetivo táctil cómodo: 44 px es el mínimo razonable con el pulgar. */
  .pill-button, .doc-chip { min-height: 44px; display: inline-flex; align-items: center; padding: 10px 16px; }
  .uber-button { width: 44px; height: 44px; font-size: 16px; }
  .link-button { padding: 6px 0; }
  .weather-card { padding: 13px 15px; }
  .weather-row { gap: 10px; }
  .weather-now strong { font-size: 24px; }
  .weather-days { gap: 4px; width: 100%; justify-content: space-between; }
  .weather-days li { padding: 4px 6px; }
  .upcoming-list li { padding: 9px 0; }
  .alert { grid-template-columns: 20px 1fr; }
  .alert-when { grid-column: 2; margin-top: 6px; }
  .trip-item { grid-template-columns: 80px 22px 1fr; gap: 8px; }
  .trip-tag { display: none; }
  .trip-actions { grid-column: 1/-1; justify-content: end; }
  .masthead { padding-bottom: 14px; align-items: center; }
  .masthead h1 { font-size: 27px; }
  .masthead .eyebrow { font-size: 9px; margin-bottom: 4px; }
  .masthead-actions { flex-direction: column; align-items: end; gap: 2px; }
  .masthead-actions .text-button { font-size: 11px; }
  .form-grid { grid-template-columns: 1fr; }
  .bars li { grid-template-columns: 92px 1fr 62px; gap: 8px; font-size: 12px; }
  .section-heading { flex-direction: column; align-items: start; gap: 8px; }
  .panel-hint { text-align: left; }
  .endpoint .code { font-size: 24px; }
  .stay-card .stay-grid { grid-template-columns: 1fr; gap: 10px; }
  .flight-route { grid-template-columns: 1fr; gap: 6px; text-align: left; }
  .endpoint.end { text-align: left; }
  .endpoint-link { grid-template-columns: 22px auto 22px; justify-content: start; padding: 6px 0 18px; }
  .message-head { flex-direction: column; gap: 4px; }
}

/* ------------------------------------------------- carga: esqueleto inicial */
/*
  Tres estados del <html>: sin data-boot es la pantalla de clave; data-boot="app"
  muestra el esqueleto; data-boot="ready" lo apaga y hace entrar la app. El
  estado lo enciende el <head> —antes del primer pintado, para que no se vea el
  parpadeo de la pantalla de clave— y lo apaga app.js con el viaje ya dibujado.

  El esqueleto es una capa encima, no un reemplazo: la app se arma detrás y
  aparece cuando la capa se funde. Así el cambio es un cruce y no un salto.
*/
.boot {
  display: none; position: fixed; inset: 0; z-index: 60; overflow-y: auto;
  background: var(--paper); padding: 28px 32px 72px;
}
html[data-boot="app"] .boot,
.boot.is-leaving { display: block; }
.boot.is-leaving { pointer-events: none; animation: boot-out .3s ease forwards; }
/* La capa es opaca y tapa la pantalla de clave: no hace falta esconderla, y así
   sigue ahí si la clave termina rechazada. */

.boot-inner { max-width: 1080px; margin: auto; display: grid; gap: 22px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.sk { position: relative; display: block; overflow: hidden; border-radius: 5px; background: #e8dfcf; }
/* El brillo va en ::after para no tocar el layout: barre el bloque y vuelve. */
.sk::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 253, 248, .85) 55%, transparent);
  animation: sk-sweep 1.6s cubic-bezier(.4, 0, .2, 1) infinite;
}
/* Cada franja arranca un pelo después: el brillo baja por la página. */
.boot-tabs .sk::after { animation-delay: .06s; }
.boot-card .sk::after { animation-delay: .12s; }
.boot-strips .sk::after { animation-delay: .18s; }
.boot-rows .sk::after { animation-delay: .24s; }

.sk-eyebrow { width: 128px; height: 9px; }
.sk-title { width: 190px; height: 30px; border-radius: 4px; }
.sk-dot { width: 34px; height: 34px; border-radius: 50%; }
.sk-tab { width: 88px; height: 20px; }
.sk-head { width: min(70%, 340px); height: 26px; }
.sk-line { width: 100%; height: 12px; }
.sk-line.is-short { width: 58%; }
.sk-mini { width: 74px; height: 9px; }
/* Las dos tiras copian las tarjetas livianas de documento y clima: caja clara
   con una línea adentro, no un bloque macizo. */
.sk-strip { height: 46px; border-radius: 6px; background: #fffcf6; border: 1px solid var(--line); }
.sk-strip::before { content: ''; position: absolute; left: 15px; top: 16px; width: 40%; height: 10px; border-radius: 5px; background: #e8dfcf; }
.sk-chip { width: 104px; height: 15px; }
.sk-icon { width: 22px; height: 22px; border-radius: 50%; }

.boot-masthead { display: flex; justify-content: space-between; align-items: start; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 22px; }
.boot-brand { display: grid; gap: 12px; }
.boot-actions { display: flex; gap: 14px; }
.boot-tabs { display: flex; gap: 22px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.boot-tabs .sk:nth-child(n+4) { display: none; }
.boot-card { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 6px; background: #fffcf6; padding: 22px; }
.boot-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.boot-strips { display: grid; gap: 14px; }
.boot-rows { display: grid; gap: 2px; }
.boot-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }

@media (min-width: 700px) { .boot-tabs .sk:nth-child(n+4) { display: block; } }
@media (max-width: 640px) { .boot { padding: 22px 18px 60px; } }

/* La app no aparece de golpe: sube unos píxeles mientras la capa se funde.
   #app solo se funde, sin transform: es ancestro de la barra inferior fija y
   cualquier transform —incluso `none` al final de una animación con `both`—
   lo convierte en el bloque contenedor y despega la barra del borde de la
   pantalla. El movimiento lo hacen los bloques de adentro, que no son ancestros. */
html[data-boot="ready"] #app { animation: boot-fade .42s ease both; }
html[data-boot="ready"] #panel-hoy > * { animation: boot-in .5s ease both; }
html[data-boot="ready"] #panel-hoy > *:nth-child(2) { animation-delay: .06s; }
html[data-boot="ready"] #panel-hoy > *:nth-child(3) { animation-delay: .12s; }
/* La pantalla de clave también entra en lugar de aparecer. */
html:not([data-boot]) .lock-screen > * { animation: boot-in .55s ease both; }
html:not([data-boot]) .lock-screen > *:nth-child(2) { animation-delay: .07s; }
html:not([data-boot]) .lock-screen > *:nth-child(3) { animation-delay: .14s; }
html:not([data-boot]) .lock-screen > *:nth-child(4) { animation-delay: .21s; }

@keyframes sk-sweep { to { transform: translateX(100%); } }
@keyframes boot-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes boot-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes boot-out { to { opacity: 0; } }

/* Sin movimiento: el esqueleto late apenas y las entradas solo se funden. */
@media (prefers-reduced-motion: reduce) {
  .sk::after { animation: none; }
  .sk { animation: sk-pulse 2.4s ease-in-out infinite; }
  html[data-boot="ready"] #app,
  html[data-boot="ready"] #panel-hoy > *,
  html:not([data-boot]) .lock-screen > * { animation-name: boot-fade; }
}
@keyframes sk-pulse { 50% { opacity: .55; } }
@keyframes boot-fade { from { opacity: 0; } to { opacity: 1; } }
