/* Itália 26/27. Segue o Apple HIG: fonte do sistema, cores semânticas, áreas de toque de 44pt, safe areas. */
:root {
  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --surface-2: #F7F7FA;
  --label: #000000;
  --label-2: rgba(60,60,67,.62);
  --label-3: rgba(60,60,67,.32);
  --sep: rgba(60,60,67,.18);
  --fill: rgba(120,120,128,.12);
  --tint: #8E2A2A;
  --alta: #C7372F;
  --media: #B7791F;
  --baixa: #4A7A5C;
  --ok: #2E7D4F;
  --tabbar: rgba(249,249,251,.86);
  --r-lg: 14px;
  --r-md: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1C1C1E;
    --surface-2: #2C2C2E;
    --label: #FFFFFF;
    --label-2: rgba(235,235,245,.62);
    --label-3: rgba(235,235,245,.3);
    --sep: rgba(84,84,88,.6);
    --fill: rgba(120,120,128,.24);
    --alta: #FF6B5E;
    --media: #E8A93A;
    --baixa: #7DBF93;
    --ok: #5BC883;
    --tabbar: rgba(22,22,24,.86);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  background: var(--bg);
  color: var(--label);
  font-size: 17px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--tint); text-decoration: none; }
:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; border-radius: 6px; }

.app { min-height: 100%; }

/* Tela */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 12px) 16px calc(84px + var(--safe-b));
  outline: none;
}
.large-title {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  font-size: 34px; font-weight: 700; letter-spacing: .01em;
  margin: 8px 4px 14px;
}
.section-h {
  font-size: 13px; color: var(--label-2);
  margin: 22px 16px 7px; font-weight: 400;
}
.footnote { font-size: 13px; color: var(--label-2); margin: 8px 16px 0; }

/* Lista agrupada (inset grouped) */
.group { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 16px; min-height: 44px; position: relative; width: 100%; text-align: left;
}
.row + .row::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: var(--sep);
}
.row .main { flex: 1; min-width: 0; }
.row .title { font-size: 17px; }
.row .sub { font-size: 15px; color: var(--label-2); margin-top: 2px; }
.row .trail { color: var(--label-2); font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Fita da viagem: um segmento por dia, cor da cidade */
.ribbon { display: flex; gap: 3px; height: 8px; margin: 2px 4px 0; }
.ribbon i { flex: 1; border-radius: 2px; background: var(--c); opacity: .9; }
.ribbon i.past { opacity: .28; }
.ribbon i.today { transform: scaleY(1.9); }

/* Seletor de dias */
.daystrip {
  display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity;
  margin: 0 -16px 4px; padding: 4px 16px 10px; scrollbar-width: none;
}
.daystrip::-webkit-scrollbar { display: none; }
.daychip {
  flex: 0 0 48px; height: 64px; border-radius: 12px; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--surface); position: relative; overflow: hidden;
}
.daychip .wd { font-size: 12px; color: var(--label-2); }
.daychip .dn { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.daychip::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--c); }
.daychip[aria-selected="true"] { background: var(--c); color: #fff; }
.daychip[aria-selected="true"] .wd { color: rgba(255,255,255,.8); }
.daychip .dot { position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--tint); }
.daychip[aria-selected="true"] .dot { background: #fff; }

/* Cabeçalho do dia: o elemento marcante */
.dayhead { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; align-items: end; margin: 6px 4px 14px; }
.dayhead .big {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  font-size: 76px; line-height: .82; font-weight: 800; color: var(--c);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.dayhead .meta { padding-bottom: 4px; }
.dayhead .when { font-size: 15px; color: var(--label-2); }
.dayhead h2 { margin: 2px 0 0; font-size: 22px; line-height: 1.15; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 4px 14px; }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--fill); color: var(--label); }
.chip.city { background: var(--c); color: #fff; }

/* Linha do tempo */
.tl .row { padding-top: 12px; padding-bottom: 12px; }
.tl .time {
  width: 52px; flex: 0 0 52px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--c); padding-top: 1px; font-size: 16px;
}
.tl .move { font-size: 14px; color: var(--label-2); margin-top: 3px; display: flex; gap: 5px; align-items: baseline; }
.tl .move svg { width: 12px; height: 12px; flex: 0 0 12px; stroke: currentColor; fill: none; stroke-width: 2; transform: translateY(1px); }
.tl .note { font-size: 14px; color: var(--label-2); margin-top: 3px; }
.tl .book {
  display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px; color: var(--alta); background: color-mix(in srgb, var(--alta) 12%, transparent);
}
.tl .row.now { background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.tl .row.now .time::after { content: " agora"; font-size: 11px; font-weight: 500; display: block; }
.tl .map {
  flex: 0 0 auto; align-self: center; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--fill); color: var(--c);
}
.tl .map svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.navday { display: flex; justify-content: space-between; margin: 14px 4px 0; }
.navday button { color: var(--tint); min-height: 44px; padding: 0 4px; font-size: 17px; }
.navday button[disabled] { color: var(--label-3); cursor: default; }

/* Hoje antes da viagem */
.count { margin: 4px 4px 18px; }
.count .n {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  font-size: 96px; line-height: .9; font-weight: 800; color: var(--tint); letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.count .l { font-size: 20px; font-weight: 600; margin-top: 4px; }
.count .s { font-size: 15px; color: var(--label-2); margin-top: 2px; }

/* Segmented control */
.seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin: 0 0 14px; }
.seg button {
  flex: 1; min-height: 32px; border-radius: 7px; font-size: 13px; font-weight: 500; padding: 0 6px;
}
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .dayhead .big, .tl .time, .tl .map, .count .n, .tab[aria-current="page"], a { filter: brightness(1.7) saturate(.9); }
}
@media (prefers-color-scheme: dark) { .seg button[aria-pressed="true"] { background: #636366; } }

/* Reservas */
.urg { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; margin-top: 6px; }
.urg.alta { background: var(--alta); } .urg.media { background: var(--media); } .urg.baixa { background: var(--baixa); }
.check {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--label-3);
  display: grid; place-items: center; margin-top: -1px; position: relative;
}
.check::before { content: ""; position: absolute; inset: -9px; }
.check[aria-checked="true"] { background: var(--ok); border-color: var(--ok); }
.check svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 2.6; opacity: 0; }
.check[aria-checked="true"] svg { opacity: 1; }
.bk.done .title { color: var(--label-2); text-decoration: line-through; text-decoration-color: var(--label-3); }
.bk .detail { display: none; font-size: 14px; color: var(--label-2); margin-top: 6px; }
.bk.open .detail { display: block; }
.bk .detail a { display: inline-flex; min-height: 32px; align-items: center; font-weight: 600; }
.bk .expander { flex: 1; min-width: 0; text-align: left; }
.urgword { font-weight: 600; }
.urgword.alta { color: var(--alta); } .urgword.media { color: var(--media); } .urgword.baixa { color: var(--baixa); }
.est { color: var(--label-3); font-size: 12px; }
.totals { display: flex; gap: 10px; margin: 0 0 14px; }
.totals div { flex: 1; background: var(--surface); border-radius: var(--r-lg); padding: 12px 14px; }
.totals b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.totals span { font-size: 13px; color: var(--label-2); }

/* Info */
.kv { font-size: 15px; color: var(--label-2); margin-top: 3px; }
.kv strong { color: var(--label); font-weight: 500; }
.citybar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--c); flex: 0 0 4px; }

/* Barra de abas (iPhone) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  padding: 6px 8px calc(var(--safe-b) + 4px);
  background: var(--tabbar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep);
}
.tab {
  flex: 1; max-width: 120px; min-height: 44px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--label-2); font-size: 10px; font-weight: 500;
}
.tab svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab svg .fill { fill: currentColor; stroke: none; }
.tab[aria-current="page"] { color: var(--tint); }

/* MacBook: barra lateral */
@media (min-width: 900px) {
  .tabbar {
    top: 0; right: auto; width: 220px; flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 28px 12px; border-top: 0; border-right: .5px solid var(--sep); background: var(--surface-2);
  }
  .tab {
    flex: 0 0 auto; max-width: none; flex-direction: row; gap: 10px;
    padding: 8px 12px; border-radius: 9px; font-size: 15px; min-height: 40px;
  }
  .tab svg { width: 22px; height: 22px; }
  .tab[aria-current="page"] { background: var(--fill); }
  main { padding: 36px 32px 48px; margin-left: calc(220px + max(0px, (100vw - 220px - 720px) / 2)); margin-right: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .daychip, .seg button, .check { transition: background-color .18s, color .18s; }
  .enter { animation: rise .32s cubic-bezier(.2,.8,.2,1); }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
