@font-face { font-family: Barlow; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Barlow; font-weight: 500; font-display: swap; src: url(fonts/barlow-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Barlow; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Barlow; font-weight: 700; font-display: swap; src: url(fonts/barlow-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow SC'; font-weight: 700; font-display: swap; src: url(fonts/barlow-semi-condensed-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow SC'; font-weight: 800; font-display: swap; src: url(fonts/barlow-semi-condensed-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow SC'; font-weight: 700; font-style: italic; font-display: swap; src: url(fonts/barlow-semi-condensed-latin-700-italic.woff2) format('woff2'); }
@font-face { font-family: 'Barlow SC'; font-weight: 800; font-style: italic; font-display: swap; src: url(fonts/barlow-semi-condensed-latin-800-italic.woff2) format('woff2'); }

:root {
  /* Pantones da marca MTU */
  --navy: #002B49;      /* 7463 C */
  --blue: #0095C8;      /* 639 C */
  --yellow: #F1C400;    /* 7406 C */
  --green: #97D700;     /* 375 C */
  --green-ink: #4E7A00; /* verde legível sobre branco */
  --ink: #12263A;
  --muted: #5B6B7C;
  --line: #E3E8EE;
  --bg: #F4F7FA;
  --card: #FFFFFF;
  --danger: #C8102E;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0, 43, 73, .14);
  --panel-w: 410px;
  --top-h: 60px;
  font-family: Barlow, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { display: flex; flex-direction: column; overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
svg:not(.leaflet-zoom-animated) { width: 20px; height: 20px; flex: none; }
.end-pin svg { width: 16px; height: 16px; }
[hidden] { display: none !important; }

/* ---------- topo ---------- */
.topbar {
  height: var(--top-h); flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; color: #fff; position: relative; z-index: 1001;
  background: radial-gradient(120% 220% at 0% 0%, #0a6fb0 0%, var(--navy) 55%), var(--navy);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand img { height: 44px; width: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: 'Barlow SC', Barlow, sans-serif; font-style: italic; font-weight: 800; font-size: 21px; letter-spacing: .2px; text-transform: uppercase; }
.brand-text small { font-size: 13px; opacity: .85; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.back-site { color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; padding: 7px 12px; border: 1.5px solid rgba(255,255,255,.4); border-radius: 999px; }
.back-site:hover { background: rgba(255,255,255,.12); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 5px 10px; border-radius: 999px; background: rgba(151,215,0,.16); color: var(--green); }
.live-pill i, .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(151,215,0,.7); animation: pulse 1.8s infinite; display: inline-block; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(151,215,0,0); } 100% { box-shadow: 0 0 0 0 rgba(151,215,0,0); } }
.stripe { height: 5px; flex: none; background: linear-gradient(90deg, var(--yellow) 0 50%, var(--green) 50% 100%); position: relative; z-index: 1001; }

/* ---------- layout ---------- */
.layout { flex: 1; display: flex; min-height: 0; position: relative; }
.panel { width: var(--panel-w); flex: none; background: var(--card); display: flex; flex-direction: column; min-height: 0; box-shadow: 4px 0 18px rgba(0,43,73,.08); z-index: 1000; }
.map-wrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #e8eef3; }
.sheet-handle { display: none; }

.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); flex: none; }
.tabs button { background: none; border: 0; padding: 11px 4px 9px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs button svg { width: 22px; height: 22px; }
.tabs button.active { color: var(--navy); border-bottom-color: var(--blue); }
.tabs button:hover { color: var(--navy); }
.panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 24px; }

/* ---------- elementos ---------- */
h2.title { font-family: 'Barlow SC', Barlow, sans-serif; font-style: italic; font-weight: 800; font-size: 22px; color: var(--navy); margin: 2px 0 10px; text-transform: uppercase; letter-spacing: .2px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input, .field input, .field select { width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px 0 40px; background: var(--bg); outline: none; font-size: 16px; }
.search input:focus, .field input:focus, .field select:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(0,149,200,.15); }

.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 10px; }
.item:hover { background: var(--bg); }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 600; font-size: 15.5px; line-height: 1.25; }
.item-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.item .chev { color: #a8b4c0; transform: rotate(180deg); width: 16px; height: 16px; }
.empty { color: var(--muted); text-align: center; padding: 28px 10px; font-size: 15px; }
.loading { color: var(--muted); padding: 20px 4px; display: flex; gap: 10px; align-items: center; }
.loading::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--blue); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 30px; padding: 0 8px; border-radius: 8px; font-family: 'Barlow SC', Barlow, sans-serif; font-style: italic; font-weight: 800; font-size: 17px; background: var(--navy); color: #fff; flex: none; letter-spacing: .3px; }
.badge.sm { min-width: 34px; height: 22px; font-size: 13.5px; border-radius: 6px; padding: 0 6px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 12px; border: 0; font-weight: 700; font-size: 15px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #0083b0; }
.btn-primary:disabled { background: #9fc9da; cursor: default; }
.btn-ghost { background: var(--bg); color: var(--navy); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--blue); }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--bg); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-btn:hover { background: #e6edf3; }
.icon-btn.on { color: #d29f00; }
.link-btn { background: none; border: 0; color: var(--blue); font-weight: 600; padding: 4px 0; font-size: 14px; }

.detail-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.detail-head .grow { flex: 1; min-width: 0; }
.detail-head h3 { margin: 2px 0 0; font-size: 18px; line-height: 1.2; color: var(--navy); }
.detail-head p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }

.seg { display: flex; background: var(--bg); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 8px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); line-height: 1.15; }
.seg button.active { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(0,43,73,.14); }
.seg button small { display: block; font-weight: 500; font-size: 12px; opacity: .8; }

.section-label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; margin: 18px 0 8px; display: flex; align-items: center; justify-content: space-between; }

/* linha do tempo das paradas */
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.timeline li { position: relative; padding: 7px 0 7px 28px; cursor: pointer; font-size: 14.5px; border-radius: 8px; }
.timeline li:hover .tl-name { color: var(--blue); }
.timeline li::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 4px; background: var(--tl, var(--navy)); }
.timeline li:first-child::before { top: 50%; }
.timeline li:last-child::before { bottom: 50%; }
.timeline li::after { content: ''; position: absolute; left: 3px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--tl, var(--navy)); box-sizing: border-box; }
.timeline li.term::after { width: 16px; height: 16px; left: 1px; }
.timeline .tl-time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; float: right; }
.timeline .tl-bus { color: var(--green-ink); font-weight: 700; font-size: 12px; margin-left: 6px; }

.sched-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; }
.sched-grid span { text-align: center; padding: 6px 0; border-radius: 8px; background: var(--bg); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }
.sched-grid span.past { color: #a7b2bd; font-weight: 500; }
.sched-grid span.next { background: var(--navy); color: #fff; }

/* chegadas */
.arr { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.arr-main { flex: 1; min-width: 0; }
.arr-head { font-weight: 600; font-size: 15px; line-height: 1.2; }
.arr-later { color: var(--muted); font-size: 13px; margin-top: 3px; }
.arr-eta { text-align: right; flex: none; }
.arr-eta b { display: block; font-family: 'Barlow SC', Barlow, sans-serif; font-weight: 800; font-size: 24px; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.arr-eta small { font-size: 12px; color: var(--muted); }
.arr-eta.live b { color: var(--green-ink); }
.tag-live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--green-ink); text-transform: uppercase; letter-spacing: .5px; }
.tag-sched { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 12px; line-height: 1.4; }

/* rotas */
.od { position: relative; background: var(--bg); border-radius: var(--radius); padding: 8px 52px 8px 8px; }
.od-row { display: flex; align-items: center; gap: 10px; position: relative; }
.od-row + .od-row { border-top: 1px solid var(--line); }
.od-dot { width: 12px; height: 12px; border-radius: 50%; margin-left: 8px; flex: none; }
.od-dot.o { background: var(--blue); box-shadow: 0 0 0 3px rgba(0,149,200,.22); }
.od-dot.d { background: var(--danger); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.od-row input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; outline: none; font-size: 16px; }
.od-row .clear { background: none; border: 0; color: var(--muted); padding: 6px; display: flex; }
.od .swap { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.suggest { position: absolute; left: 0; right: -44px; top: 100%; z-index: 20; background: #fff; border-radius: 12px; box-shadow: var(--shadow); max-height: 320px; overflow-y: auto; margin-top: 4px; }
.suggest button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; background: none; border: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.suggest button:hover, .suggest button.hl { background: var(--bg); }
.suggest svg { color: var(--muted); }
.suggest b { display: block; font-weight: 600; font-size: 14.5px; }
.suggest small { color: var(--muted); font-size: 12.5px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-size: 13.5px; font-weight: 600; color: var(--navy); }
.chip:hover { border-color: var(--blue); }
.chip svg { width: 16px; height: 16px; }
.when { display: flex; gap: 8px; margin: 10px 0 12px; align-items: center; }
.when select, .when input { height: 40px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; padding: 0 10px; font-size: 15px; }
.when select { flex: 1; }

.itin { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 12px 10px; margin-bottom: 10px; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; }
.itin:hover { border-color: var(--blue); box-shadow: 0 2px 10px rgba(0,149,200,.12); }
.itin.active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,149,200,.15); }
.itin-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.itin-time { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.itin-dur { font-family: 'Barlow SC', Barlow, sans-serif; font-weight: 800; font-size: 22px; color: var(--navy); }
.itin-dur small { font-family: Barlow, sans-serif; font-weight: 600; font-size: 13px; color: var(--muted); }
.itin-chain { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 9px 0 6px; color: var(--muted); }
.itin-chain .walk { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; }
.itin-chain .walk svg { width: 17px; height: 17px; }
.itin-chain .sep { color: #b8c3cd; font-size: 12px; }
.itin-meta { color: var(--muted); font-size: 13px; }
.itin-meta b { color: var(--green-ink); }

.steps { list-style: none; margin: 8px 0 0; padding: 0; }
.step { display: grid; grid-template-columns: 50px 26px 1fr; gap: 0 6px; }
.step-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; padding-top: 2px; text-align: right; }
.step-rail { position: relative; display: flex; justify-content: center; }
.step-rail::before { content: ''; position: absolute; top: 0; bottom: 0; width: 5px; border-radius: 3px; background: var(--rail, var(--navy)); }
.step.walk .step-rail::before { background: repeating-linear-gradient(to bottom, #9aa8b5 0 5px, transparent 5px 10px); width: 4px; }
.step-rail i { position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--rail, var(--navy)); margin-top: 3px; }
.step.walk .step-rail i { border-color: #8696a5; }
.step-body { padding: 0 0 16px; min-width: 0; }
.step-body b { font-size: 15px; display: block; line-height: 1.25; }
.step-body .muted { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.step-body details { margin-top: 6px; font-size: 13.5px; }
.step-body summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.step-body details ol { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.step.end .step-rail::before { display: none; }

.fav-section + .fav-section { margin-top: 6px; }
.hint { background: #F1F8E0; border: 1px solid #DCEFB0; color: #3b5600; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.4; margin: 6px 0 12px; }
.warn { background: #FFF6D6; border: 1px solid #F3DD8C; color: #6b5200; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin: 6px 0 12px; }

/* ---------- mapa ---------- */
.map-tools { position: absolute; right: 12px; bottom: 28px; z-index: 900; display: flex; flex-direction: column; gap: 8px; }
.map-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: var(--navy); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; }
.map-btn:hover { color: var(--blue); }
.pick-banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 950; background: var(--navy); color: #fff; padding: 9px 10px 9px 16px; border-radius: 999px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); font-weight: 600; font-size: 14px; white-space: nowrap; }
.pick-banner button { background: rgba(255,255,255,.16); border: 0; color: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; }
.toast { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 960; font-size: 14px; box-shadow: var(--shadow); max-width: 90%; }
.leaflet-container { font-family: Barlow, system-ui, sans-serif; }
.leaflet-popup-content { margin: 10px 14px; font-size: 14px; }
.leaflet-popup-content b { color: var(--navy); }
.pop-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pop-actions button { border: 0; background: var(--bg); color: var(--navy); font-weight: 700; padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.pop-actions button:hover { background: var(--blue); color: #fff; }

.stop-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.end-pin { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 13px; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); font-family: 'Barlow SC', Barlow, sans-serif; }
.end-pin.start { background: var(--green-ink); }
.end-pin.finish { background: var(--danger); }
.od-pin { width: 22px; height: 22px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.od-pin.o { background: var(--blue); }
.od-pin.d { background: var(--danger); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2F7DF6; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47,125,246,.22), 0 1px 4px rgba(0,0,0,.3); }
.veh { position: relative; width: 34px; height: 34px; }
.veh .veh-body { position: absolute; inset: 3px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); color: #fff; }
.veh .veh-body svg { width: 16px; height: 16px; }
.veh .veh-arrow { position: absolute; inset: 0; }
.veh .veh-arrow::before { content: ''; position: absolute; left: 50%; top: -4px; transform: translateX(-50%); border: 6px solid transparent; border-bottom: 8px solid var(--c, var(--navy)); border-top: 0; }
.veh-tag { position: absolute; left: 50%; top: 34px; transform: translateX(-50%); background: #fff; color: var(--navy); font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,.25); white-space: nowrap; }

/* ---------- celular: painel vira "bottom sheet" ---------- */
@media (max-width: 760px) {
  :root { --top-h: 54px; }
  .brand img { height: 36px; }
  .brand-text strong { font-size: 17px; }
  .brand-text small { font-size: 12px; }
  .back-site { display: none; }
  .layout { display: block; }
  .map-wrap { position: absolute; inset: 0; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; width: auto; z-index: 1000;
    border-radius: 20px 20px 0 0; box-shadow: 0 -6px 24px rgba(0,43,73,.18);
    transition: height .25s ease; padding-bottom: env(safe-area-inset-bottom);
  }
  .panel.sheet-min { height: 128px; }
  .panel.sheet-mid { height: 52%; }
  .panel.sheet-max { height: calc(100% - 8px); }
  .sheet-handle { display: flex; justify-content: center; align-items: center; width: 100%; height: 22px; border: 0; background: none; flex: none; padding: 0; }
  .sheet-handle span { width: 44px; height: 5px; border-radius: 3px; background: #c9d3dc; }
  .tabs button { padding: 6px 2px 7px; font-size: 12px; }
  .panel-body { padding: 12px 14px 20px; }
  .map-tools { bottom: auto; top: 12px; }
  .leaflet-control-zoom { display: none; }
  .leaflet-control-attribution { font-size: 10px; }
}
