:root {
  --bg: #eef2f6; --surface: #ffffff; --ink: #14233a; --muted: #5d6b80; --line: #d5dde7;
  --sol: #f0a400; --sol-ink: #3a2700; --sol-bg: #fdeec4; --ok: #1d7a4f; --ok-bg: #dcf1e6;
  --nao: #b4382f; --nao-bg: #f8e0dd; --chip: #e6ebf2; --focus: #2f6fd6; --mar: #dfe7f0; --terra: #c3cdd9;
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0f1724; --surface: #172235; --ink: #e8edf5; --muted: #95a3b8; --line: #2a3850;
  --sol: #f5b52a; --sol-ink: #2a1c00; --sol-bg: #3d3215; --ok: #5fd39a; --ok-bg: #173a2a;
  --nao: #ff8a7f; --nao-bg: #43211f; --chip: #22304a; --focus: #7aa7ff; --mar: #121c2c; --terra: #34445e; color-scheme: dark } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.wrap { max-width: 760px; margin: 0 auto; padding-block: 20px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 18px; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 24px; } h3 { font-size: 19px; }
button { font: inherit; cursor: pointer; color: inherit; }
input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sub { font-size: 13px; color: var(--muted); }
.msg { font-size: 14px; margin: 0; min-height: 0; }
.msg.erro { color: var(--nao); } .msg.ok { color: var(--ok); }
.limpa { list-style: none; padding: 0; margin: 0; }

.topo { display: flex; justify-content: space-between; align-items: center; }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--chip) center/cover; font-weight: 700; }
.topo2 { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.pill { display: flex; gap: 4px; background: var(--chip); padding: 3px; border-radius: 99px; }
.pill button { border: 0; background: transparent; padding: 5px 14px; border-radius: 99px; font-weight: 600; font-size: 14px; }
.pill button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.abas { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 12px; }
.abas a { padding: 8px 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.abas a[aria-current="page"] { color: var(--ink); border-color: var(--sol); }
.aba { display: grid; gap: 16px; }

.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; }
.login { max-width: 420px; margin: 24px auto 0; width: 100%; }
.form { display: grid; gap: 6px; }
.form label { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.form .ir { margin-top: 12px; }
.linha-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.ir { border: 0; background: var(--ink); color: var(--bg); border-radius: 10px; padding: 10px 18px; font-weight: 600; }
.ir:disabled { opacity: .6; cursor: wait; }
.leve { border: 0; background: transparent; color: var(--muted); padding: 6px 4px; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.acoes { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.acoes.esq { justify-content: flex-start; }

.saldo { display: flex; align-items: baseline; gap: 10px; }
.saldo b { font-family: var(--f-display); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.saldo span { color: var(--muted); font-size: 14px; }
.lista { display: grid; gap: 26px; }
.mes { display: grid; gap: 10px; }
.mes h2 { font-size: 22px; text-transform: capitalize; display: flex; align-items: baseline; gap: 10px; }
.mes h2 small { font: 500 13px var(--f-body); color: var(--muted); text-transform: none; }
.trip { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; }
.trip.vou { border-color: var(--ok); }
.linha1 { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.datas { font-family: var(--f-display); font-size: 21px; font-weight: 700; line-height: 1.2; }
.custo { text-align: right; flex: none; }
.custo b { display: block; font-family: var(--f-display); font-size: 21px; line-height: 1.2; }
.custo b.zero { color: var(--ok); }
.duracao, .chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.duracao button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 5px 10px; font-size: 13px; }
.duracao button[aria-pressed="true"] { background: var(--sol); border-color: var(--sol); color: var(--sol-ink); font-weight: 600; }
.chip { border: 0; background: var(--chip); border-radius: 99px; padding: 3px 11px; font-size: 13px; }
.chip.vou { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.chip.nao { background: var(--nao-bg); color: var(--nao); text-decoration: line-through; }
.links a { color: var(--ink); font-size: 14px; }
.oculta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; padding: 8px 14px; }
.generico { font-size: 14px; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 16px; }
.rotulo { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }

.numeros { display: flex; gap: 28px; }
.numeros b { font-family: var(--f-display); font-size: 30px; display: block; line-height: 1.1; }
.numeros span { font-size: 13px; color: var(--muted); }
.mapa-box { overflow: hidden; border-radius: 10px; background: var(--mar); }
#mapa { display: block; width: 100%; height: auto; }
#mapa path.p { fill: var(--terra); stroke: var(--surface); stroke-width: .5; cursor: pointer; }
#mapa path.p.foi { fill: var(--sol); }
.lista-paises { max-height: 460px; overflow-y: auto; display: grid; }
.lp { display: grid; gap: 6px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.lp-top { display: flex; align-items: center; gap: 10px; }
.lp-top .bandeira { font-size: 20px; width: 26px; text-align: center; }
.lp-top .nome { flex: 1; min-width: 0; }
.marca { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 4px 12px; font-size: 13px; }
.lp.foi .marca { background: var(--sol); border-color: var(--sol); color: var(--sol-ink); font-weight: 600; }
.lp-cid { display: flex; gap: 6px; flex-wrap: wrap; padding-left: 36px; align-items: center; }
.lp-cid input { width: 160px; padding: 4px 8px; font-size: 13px; }
.tag-x { border: 0; background: var(--chip); border-radius: 99px; padding: 3px 6px 3px 11px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }

.grupo { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.grupo button.nome { border: 0; background: transparent; font-weight: 600; text-align: left; padding: 0; }
.codigo { font-family: ui-monospace, Menlo, monospace; background: var(--chip); padding: 2px 8px; border-radius: 6px; letter-spacing: .1em; }
.membros { display: flex; gap: 8px; flex-wrap: wrap; }
.membro { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.mini { width: 26px; height: 26px; border-radius: 50%; background: var(--chip) center/cover; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; }
.foto-linha { display: flex; align-items: center; gap: 14px; }
.foto { width: 72px; height: 72px; border-radius: 50%; background: var(--chip) center/cover; display: grid; place-items: center; font: 700 26px var(--f-display); }

select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0; }
.dupla { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
#tela-cadastro .login { max-width: 520px; }
.grade-paises { max-height: 320px; overflow-y: auto; align-content: start; }
.grade-paises .chip[aria-pressed="true"] { background: var(--sol); color: var(--sol-ink); font-weight: 600; }
#mapaCad { display: block; width: 100%; height: auto; }
#mapaCad path.p { fill: var(--terra); stroke: var(--surface); stroke-width: .5; cursor: pointer; }
#mapaCad path.p.foi { fill: var(--sol); }
.aviso { font-size: 14px; border: 1px solid var(--sol); background: var(--sol-bg); border-radius: 12px; padding: 10px 14px; }
.topo-dir { display: flex; align-items: center; gap: 10px; }
.idioma { width: auto; padding: 6px 8px; font-size: 13px; background: transparent; border-color: var(--line); color: var(--muted); }
.criar { border: 1px dashed var(--line); background: transparent; border-radius: 12px; padding: 12px 16px; text-align: left; color: var(--ink); font-weight: 600; font-size: 14px; }
.criar:hover { border-color: var(--sol); }
.form-livre { border-style: dashed; border-color: var(--sol); }
.trip.livre .rotulo { margin-bottom: 2px; }

/* Minhas viagens */
.proxima { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.proxima b { font-family: var(--f-display); font-size: 28px; line-height: 1.1; }
.proxima span { color: var(--muted); font-weight: 600; }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legenda > span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg.viagem { background: var(--ok-bg); border: 1px solid var(--ok); }
.lg.folga { background: var(--ok); }
.lg.feriado { background: var(--sol); }
.cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 14px; }
.cal-nome { font-weight: 600; font-size: 13px; text-transform: capitalize; margin-bottom: 4px; }
.cal-grade { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
.cal-sem { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.cal-dia { padding: 3px 0; border-radius: 4px; position: relative; }
.cal-dia.viagem { background: var(--ok-bg); color: var(--ok); font-weight: 600; cursor: pointer; }
.cal-dia.folga { background: var(--ok); color: var(--surface); }
.cal-dia.feriado::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--sol); }
.cal-dia.hoje { outline: 1.5px solid var(--ink); outline-offset: -1.5px; }
.lista-viagens { display: grid; gap: 12px; }
.passadas summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 0; }
.passadas[open] { display: grid; gap: 12px; }

/* Gastos */
.gastos { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.gastos-topo { display: flex; justify-content: space-between; align-items: baseline; }
.gastos-topo b { font-family: var(--f-display); font-size: 19px; font-variant-numeric: tabular-nums; }
.gasto { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; padding-block: 6px; border-bottom: 1px solid var(--line); font-size: 14px; }
.g-valor { font-variant-numeric: tabular-nums; font-weight: 600; }
.g-tipo { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip.st-comprado { background: var(--ok-bg); color: var(--ok); }
.chip.st-reservado { background: var(--sol-bg); color: var(--sol-ink); }
.chip.st-previsto { background: var(--chip); color: var(--muted); }
.form-gasto { display: grid; gap: 6px; }
.form-gasto label { font-size: 13px; font-weight: 600; color: var(--muted); }
.total-ano { color: var(--ink); }
.gastos > .leve { justify-self: start; }
.sel-cidade { width: auto; max-width: 100%; padding: 4px 8px; font-size: 13px; }
.pergunta { border-color: var(--sol); background: var(--sol-bg); }
.pergunta-txt { margin: 0; }
.linha-form.compra { grid-template-columns: minmax(0, 1fr) auto auto; }
.linha-form.compra select { width: auto; }
.pergunta { grid-template-columns: minmax(0, 1fr); } .linha-form.compra input { min-width: 0; }
.wrap { grid-template-columns: minmax(0, 1fr); } .wrap > section, .aba { min-width: 0; }

/* Preço de voo */
.preco { margin: 10px 0 2px; display: grid; gap: 6px; }
.preco:empty { display: none; }
.preco-voo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.preco-voo b { font-size: 16px; }
.preco .chip b { margin-left: 4px; }
