:root {
  --ink: #172033;
  --ink-2: #3B465C;
  --muted: #6A7487;
  --paper: #F2F4F6;
  --card: #FFFFFF;
  --line: #DCE1E8;
  --brass: #E0A526;
  --ok: #2F7D4F;
  --wait: #B7791F;
  --todo: #B23A48;
  --city: #2B5DA8;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 8px;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.5 var(--body);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--card); padding: 8px 12px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; font-variation-settings: "wdth" 85; }
h2 { font-size: 1.55rem; font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
.muted { color: var(--muted); }
.loading { padding: 40px 20px; color: var(--muted); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: calc(52px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 18px 0;
  background: var(--ink); color: #fff;
}
.brand { white-space: nowrap; flex: none; display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--display); font-weight: 750; font-size: 1.1rem; font-variation-settings: "wdth" 80; }
.brand svg { width: 26px; height: 26px; }
.trip-name { color: #AFB8C8; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net { margin-left: auto; white-space: nowrap; font-size: .78rem; background: var(--brass); color: var(--ink); padding: 3px 10px; border-radius: 99px; }

/* Bottom tabs (mobile) / side rail (desktop) */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .74rem; }
.tabs svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tabs a[aria-current="page"] svg { stroke: var(--ink); stroke-width: 2.3; }

main { max-width: 1040px; margin: 0 auto; outline: none; }
.section { padding: 26px 18px 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head a { font-size: .92rem; color: var(--ink-2); }

/* Hero */
.hero {
  position: relative; min-height: 360px; overflow: hidden;
  display: flex; align-items: flex-end;
  background: var(--city) center/cover no-repeat;
  color: #fff;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,16,30,.1) 0%, rgba(10,16,30,.35) 35%, rgba(10,16,30,.85) 100%); }
.hero-inner { text-shadow: 0 1px 12px rgba(0,0,0,.45); position: relative; z-index: 1; padding: 26px 20px 64px; width: 100%; }
.hero-kicker { font-size: .95rem; opacity: .9; margin: 0 0 6px; }
.hero h1 { font-size: clamp(2.7rem, 11vw, 5.4rem); font-weight: 800; font-variation-settings: "wdth" 78; letter-spacing: -.01em; }
.hero h1 small { display: block; font-size: .42em; font-weight: 600; font-variation-settings: "wdth" 90; margin-top: 6px; opacity: .92; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); font-size: .86rem; backdrop-filter: blur(6px); }
.credit { position: absolute; right: 8px; top: 8px; z-index: 1; font-size: .66rem; color: rgba(255,255,255,.75); text-decoration: none; }

/* Route ribbon — the signature element */
.route { position: relative; padding: 22px 0 8px; }
.route-scroll { overflow-x: auto; scrollbar-width: none; padding: 0 18px 6px; }
.route-scroll::-webkit-scrollbar { display: none; }
.route ol { list-style: none; margin: 0; padding: 0; display: flex; min-width: max-content; }
.route li { position: relative; width: 92px; flex: none; text-align: center; }
.route li::before { content: ""; position: absolute; top: 15px; left: 0; right: 0; height: 3px; background: var(--line); }
.route li:first-child::before { left: 50%; }
.route li:last-child::before { right: 50%; }
.route li.done::before { background: var(--ink); }
.route a { position: relative; display: block; text-decoration: none; padding-top: 0; }
.route .dot { display: block; width: 33px; height: 33px; margin: 0 auto 6px; border-radius: 50%; border: 3px solid var(--paper); background: var(--c); box-shadow: 0 0 0 2px var(--c); font: 700 .66rem/27px var(--body); color: #fff; }
.route li.here .dot { box-shadow: 0 0 0 3px var(--brass), 0 0 0 7px rgba(224,165,38,.25); }
.route .nm { display: block; font-family: var(--display); font-weight: 700; font-size: .95rem; line-height: 1.1; font-variation-settings: "wdth" 82; }
.route .dt { display: block; font-size: .75rem; color: var(--muted); }

/* Cards & lists */
.panel { background: var(--card); border-radius: var(--r-lg); padding: 18px; border: 1px solid var(--line); }
.panel + .panel { margin-top: 12px; }
.grid2 { display: grid; gap: 12px; }
.ev { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; }
.ev .ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--ink)) 12%, white); color: var(--c, var(--ink)); }
.ev .ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ev-t { font-weight: 700; line-height: 1.3; }
.ev-time { font-family: var(--display); font-weight: 700; font-variation-settings: "wdth" 80; color: var(--ink-2); margin-right: 6px; }
.ev-s { color: var(--muted); font-size: .92rem; margin-top: 2px; }
.code { display: inline-block; margin-top: 6px; padding: 3px 9px; border-radius: var(--r-sm); background: var(--paper); font-weight: 700; font-size: .86rem; letter-spacing: .02em; border: 1px dashed #B9C1CE; cursor: copy; }
.badge { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-left: 6px; vertical-align: 2px; }
.badge.aguardando { background: #FBEFD5; color: #7A4F0E; }
.badge.pendente { background: #F7DDE0; color: #8A2433; }
.note { font-size: .88rem; color: var(--ink-2); margin-top: 4px; }

/* Next-up */
.next { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 20px; margin-top: -40px; position: relative; z-index: 2; box-shadow: 0 14px 30px -18px rgba(23,32,51,.7); }
.next .lbl { color: var(--brass); font-weight: 700; font-size: .9rem; }
.next .big { font-family: var(--display); font-size: 1.6rem; font-weight: 750; font-variation-settings: "wdth" 82; line-height: 1.1; margin: 4px 0 6px; }
.next .ev-s { color: #C3CAD7; }
.next .code { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); color: #fff; }

/* Day list (roteiro) */
.city-band { position: sticky; top: calc(52px + env(safe-area-inset-top, 0px)); z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: #fff; background: var(--c) center/cover; }
.city-band::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,16,30,.75), rgba(10,16,30,.25)); }
.city-band > * { position: relative; }
.city-band h2 { font-size: 1.7rem; font-variation-settings: "wdth" 78; }
.city-band span { font-size: .88rem; opacity: .9; }
.day { display: grid; grid-template-columns: 62px 1fr; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--card); scroll-margin-top: 120px; }
.day.today { background: #FFF8E6; }
.day-date { font-family: var(--display); font-variation-settings: "wdth" 78; text-align: center; line-height: 1; }
.day-date b { display: block; font-size: 2rem; font-weight: 800; }
.day-date span { font-size: .78rem; color: var(--muted); }
.day .ev { padding: 8px 0; grid-template-columns: 34px 1fr; }
.day .ev .ic { width: 34px; height: 34px; border-radius: 10px; }
.day .ev .ic svg { width: 19px; height: 19px; }
.stay-line { font-size: .86rem; color: var(--muted); padding-top: 6px; }
.free { color: var(--muted); font-style: italic; padding: 6px 0; }

/* Segmented control */
.seg { display: flex; gap: 6px; overflow-x: auto; padding: 4px 18px 2px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 99px; cursor: pointer; font-size: .92rem; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Boarding pass */
.pass { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: grid; grid-template-columns: 1fr; }
.pass + .pass { margin-top: 12px; }
.pass-top { padding: 16px 18px 12px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }
.pass-top .iata { font-family: var(--display); font-weight: 800; font-size: 2.3rem; line-height: 1; font-variation-settings: "wdth" 75; }
.pass-top .t { font-size: .9rem; color: var(--ink-2); }
.pass-top .r { text-align: right; }
.pass-top .mid { text-align: center; color: var(--muted); font-size: .78rem; padding-bottom: 6px; }
.pass-top .mid svg { width: 26px; height: 26px; fill: none; stroke: var(--muted); stroke-width: 1.6; display: block; margin: 0 auto; }
.pass-bot { border-top: 2px dashed var(--line); padding: 10px 18px 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .9rem; }
.pass-bot b { font-family: var(--display); font-variation-settings: "wdth" 82; }

/* Hotel card */
.hotel { display: grid; grid-template-columns: 96px 1fr; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; }
.hotel + .hotel { margin-top: 12px; }
.hotel .ph { border-radius: var(--r-md); background: var(--c) center/cover; min-height: 96px; }
.hotel h3 { margin-bottom: 2px; }
.hotel ul { margin: 6px 0 0; padding-left: 18px; font-size: .9rem; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; font-size: .9rem; font-weight: 700; cursor: pointer; }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Entry matrix */
.matrix { width: 100%; border-collapse: collapse; font-size: .92rem; }
.matrix th, .matrix td { padding: 10px 8px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.matrix thead th { border-top: 0; font-family: var(--display); font-variation-settings: "wdth" 85; font-size: 1rem; }
.matrix thead small { display: block; font-family: var(--body); color: var(--muted); font-weight: 400; font-size: .78rem; }
.matrix td.todo { color: var(--todo); font-weight: 700; }
.matrix td.ok { color: var(--ok); }
.table-wrap { overflow-x: auto; }

/* Plano */
.check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); align-items: start; }
.check:first-of-type { border-top: 0; }
.check input { width: 22px; height: 22px; accent-color: var(--ok); margin-top: 2px; }
.check.done span { color: var(--muted); text-decoration: line-through; }
.grp-title { margin: 18px 0 4px; font-size: 1.05rem; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: .92rem; }
.bar .track { grid-column: 1 / -1; height: 10px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.bar .fill { height: 100%; background: var(--ink); border-radius: 99px; }
.total { font-family: var(--display); font-weight: 800; font-size: 2.4rem; font-variation-settings: "wdth" 78; line-height: 1; }

/* Trips list */
.trip-card { display: block; position: relative; min-height: 220px; border-radius: var(--r-lg); overflow: hidden; color: #fff; text-decoration: none; background: var(--ink) center/cover; }
.trip-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(10,16,30,.8)); }
.trip-card div { position: absolute; z-index: 1; left: 18px; right: 18px; bottom: 16px; }
.trip-card h2 { font-size: 2rem; }

/* Sheet (taxi card / details) */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(10,16,30,.55); display: grid; place-items: end center; }
.sheet[hidden] { display: none; }
.sheet-card { position: relative; width: min(640px, 100%); max-height: 92vh; overflow: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 26px 20px calc(24px + var(--safe-b)); }
.sheet-close { position: absolute; right: 12px; top: 10px; border: 0; background: var(--paper); width: 38px; height: 38px; border-radius: 50%; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.taxi { font-size: clamp(1.8rem, 8vw, 2.8rem); line-height: 1.35; font-weight: 700; margin: 14px 0; word-break: break-all; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 99px; font-size: .9rem; z-index: 70; }
@media (max-width: 400px) { .trip-name { display: none; } }
footer.foot { padding: 26px 18px; color: var(--muted); font-size: .8rem; }

@media (min-width: 860px) {
  body { padding-bottom: 0; padding-left: 96px; }
  .tabs { top: 0; bottom: 0; right: auto; width: 96px; height: auto; grid-template-columns: 1fr; grid-auto-rows: 84px; align-content: center; border-top: 0; border-right: 1px solid var(--line); padding: 0; }
  .topbar { padding-left: 24px; }
  .hero { min-height: 440px; border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .section { padding: 30px 28px 6px; }
  .route-scroll { padding: 0 28px 6px; }
  .city-band { padding: 14px 28px; }
  .day { padding: 14px 28px; }
  .seg { padding: 4px 28px 2px; }
  .sheet { place-items: center; }
  .sheet-card { border-radius: 24px; }
  .toast { bottom: 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero h1 { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .route li.here .dot { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
  @keyframes pulse { 50% { box-shadow: 0 0 0 3px var(--brass), 0 0 0 11px rgba(224,165,38,.12); } }
}
.panel li, .panel p { overflow-wrap: anywhere; }
.matrix tbody th { width: 30%; }
@media (max-width: 520px) { .matrix { font-size: .84rem; } .matrix th, .matrix td { padding: 9px 5px; } }
