:root {
  --paper: #fffdf8;
  --ink: #1c1408;
  --ink-soft: #5e5344;
  --line: #eadfca;
  --vatican: #f4d125;
  --vatican-deep: #e6b800;
  --cba-red: #9a0c21;
  --cba-sky: #6cace4;
  --cba-sky-deep: #1f6aa5;
  --cba-gold: #8c6a2f;
  --white: #ffffff;
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #c5dff3; color: var(--ink); }
button, a { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: Palatino, "Palatino Linotype", Georgia, serif; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }

.app {
  height: 100dvh;
  max-width: 440px;
  margin: 0 auto;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 800px) {
  body { display: grid; place-items: center; }
  .app {
    height: calc(100dvh - 24px);
    border: 1px solid #9ec3e4;
  }
}

.bar, .sos, .tabs, .flagbar { flex: none; }
.bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: var(--vatican);
  color: var(--ink);
}
.kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cba-red);
  font-weight: 700;
}
.bar strong { font-family: Palatino, Georgia, serif; font-size: 20px; font-weight: 600; }
.net { font-size: 12px; text-align: right; max-width: 9rem; color: var(--ink-soft); }
.net.ready { color: var(--cba-red); font-weight: 650; }

.flagbar { display: grid; grid-template-columns: 1fr 1fr 1fr; height: 6px; }
.flagbar i { display: block; }
.flagbar i:nth-child(1) { background: var(--cba-red); }
.flagbar i:nth-child(2) { background: var(--white); }
.flagbar i:nth-child(3) { background: var(--cba-sky); }

.sos {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.sos a {
  text-decoration: none;
  text-align: center;
  padding: 9px 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--cba-red);
  border-right: 1px solid var(--line);
}
.sos a:last-child { border-right: 0; }
.sos a:active { background: #fdecef; }

main { flex: 1; overflow: auto; padding: 18px 16px 24px; }
main.mapa { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

.tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid var(--line);
  background: var(--white);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  border: 0;
  background: transparent;
  padding: 10px 1px 11px;
  font-size: 11px;
  color: var(--ink-soft);
}
.tabs button[aria-current="page"] {
  color: var(--cba-red);
  font-weight: 700;
  box-shadow: inset 0 3px 0 var(--cba-red);
}

.hero h1 { font-size: 34px; line-height: 1.02; margin: 6px 0 8px; }
.lede { color: var(--ink-soft); margin-bottom: 16px; }
.choice { display: grid; gap: 8px; margin: 12px 0 18px; }
.choice button, .block, .item {
  text-align: left;
  border: 1px solid var(--line);
  border-left: 4px solid var(--vatican-deep);
  background: var(--white);
  border-radius: 12px;
  padding: 12px 14px;
  text-decoration: none;
}
.choice button small, .muted { display: block; color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.choice button strong, .block strong, .item strong { display: block; }

h2 { font-size: 24px; margin: 20px 0 8px; }
h3 { font-size: 17px; margin: 14px 0 6px; }
.section-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cba-gold);
  font-weight: 700;
}

.timeline { margin-top: 8px; }
.slot {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.slot time { font-size: 13px; color: var(--cba-red); font-weight: 700; }
.day {
  margin-top: 18px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cba-sky-deep);
  font-weight: 700;
}

.note, .callout {
  background: #fff6cc;
  border-radius: 12px;
  border-left: 4px solid var(--vatican-deep);
  padding: 12px 14px;
  margin: 12px 0;
}
.callout strong { display: block; margin-bottom: 4px; }
.install { margin: 0 0 16px; }
.install-btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--cba-red);
  color: var(--white);
  padding: 13px 14px;
  font-weight: 700;
}
.install-btn:active { background: #7d091b; }
.install .muted { margin-top: 6px; }
.install-help {
  margin-top: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cba-sky);
  border-radius: 12px;
  padding: 12px 14px;
}
.install-help ol { margin: 8px 0 0; padding-left: 18px; }
.install-help li { margin: 4px 0; }
.install-done {
  background: #fff6cc;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-weight: 650;
}
.list { margin: 8px 0 0; padding-left: 18px; }
.list li { margin: 5px 0; }
.list li::marker { color: var(--cba-red); }
.split { display: grid; gap: 10px; }
@media (min-width: 380px) {
  .split { grid-template-columns: 1fr 1fr; }
}
.item { margin-top: 8px; }

.map-tools {
  display: flex;
  gap: 6px;
  padding: 8px;
  overflow: auto;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.map-tools button {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.map-tools button[aria-pressed="true"] {
  background: var(--cba-red);
  border-color: var(--cba-red);
  color: var(--white);
}

.map-stage { position: relative; flex: 1; min-height: 0; background: #f3f8fd; }
canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.map-note {
  flex: none;
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 6px 10px 5px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 12px;
}
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 4px; border-radius: 4px; display: block; }
.legend i.corridor { background: var(--cba-red); }
.legend i.public { background: var(--vatican-deep); }
.legend b.mark {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  font-family: "Segoe UI", sans-serif;
}
.legend b.park { background: #1570ff; }
.legend b.health { background: #e10600; font-size: 13px; line-height: 1; }
.legend b.exit { background: #128a3e; }
.legend b.bath { background: #0e4c92; font-size: 7px; }
.legend b.lot { background: #1f6aa5; width: 18px; font-size: 8px; }
main.mapa.fadea .sheet { max-height: 24%; }
main.mapa.fadea .map-note { padding-top: 4px; padding-bottom: 4px; }
.credit {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink-soft);
}
.layers-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}
.layers-panel {
  position: absolute;
  top: 56px;
  right: 10px;
  z-index: 2;
  display: grid;
  gap: 4px;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.layers-panel[hidden] { display: none; }
.layers-panel button {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 12px;
  text-align: left;
  color: var(--ink);
}
.layers-panel button[aria-pressed="true"] {
  background: var(--cba-red);
  color: var(--white);
}
.map-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  gap: 6px;
}
.map-zoom button, .locate, .parked, .layers-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--cba-red);
  display: grid;
  place-items: center;
  line-height: 0;
}
.map-zoom svg, .locate svg, .parked svg, .layers-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}
.locate, .parked {
  position: absolute;
  left: 10px;
}
.locate { bottom: 10px; }
.parked { bottom: 56px; }
.parked.saved {
  background: #1570ff;
  border-color: #1570ff;
  color: var(--white);
}
.car-offer {
  flex: none;
  width: 100%;
  border: 0;
  border-top: 1px solid #0d4ea8;
  background: #1570ff;
  color: var(--white);
  text-align: left;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 14px;
}
.car-offer[hidden] { display: none; }
.sheet-actions { display: flex; gap: 8px; margin-top: 10px; }
.sheet-actions button, .car-save {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--cba-red);
  padding: 8px 10px;
  font-weight: 700;
}
.sheet-actions button { flex: 1; }
.car-save, #car-update {
  display: block;
  width: 100%;
  margin-top: 10px;
  background: #1570ff;
  border-color: #1570ff;
  color: var(--white);
}
.sheet-actions #car-update { width: auto; margin-top: 0; }
.sheet {
  flex: none;
  max-height: 32%;
  overflow: auto;
  background: var(--white);
  border-top: 3px solid var(--vatican);
  padding: 12px 14px 14px;
}
.sheet h3 { margin-top: 0; }
.approx { font-size: 12px; color: var(--cba-gold); font-weight: 650; }
.source { font-size: 12px; color: var(--ink-soft); margin-top: 18px; }
.source.author { margin-top: 8px; }
:focus-visible { outline: 2px solid var(--cba-red); outline-offset: 2px; }
