:root {
  --ink:#082f3a;
  --ink-soft:#315866;
  --paper:#fbfaf5;
  --surface:#fffefa;
  --surface-2:#edf4f2;
  --line:#dbe4df;
  --teal:#0b7584;
  --teal-2:#14a0ae;
  --coral:#f2674b;
  --amber:#f2aa2f;
  --green:#2b8a67;
  --muted:#6c8387;
  --shadow:0 22px 60px rgba(8,47,58,.10);
  --radius:22px;
}

* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  margin:0;
  color:var(--ink);
  background:
    radial-gradient(circle at 88% 4%, rgba(242,170,47,.11), transparent 24%),
    radial-gradient(circle at 11% 7%, rgba(11,117,132,.10), transparent 28%),
    var(--paper);
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height:1.45;
}

button, input { font:inherit; }
button { color:inherit; cursor:pointer; }
a { color:inherit; text-decoration:none; }

.app-shell {
  min-height:100vh;
  display:grid;
  grid-template-columns:250px 1fr;
  padding:10px;
}

.side-rail {
  position:sticky;
  top:10px;
  height:calc(100vh - 20px);
  padding:24px 20px;
  display:flex;
  flex-direction:column;
  gap:28px;
  border:1px solid rgba(8,47,58,.08);
  border-radius:22px;
  background:linear-gradient(180deg, rgba(255,254,250,.94), rgba(250,248,240,.88));
  backdrop-filter:blur(22px);
  box-shadow:12px 0 54px rgba(8,47,58,.06);
  z-index:10;
}

.brand { display:flex; align-items:center; gap:13px; }
.brand-symbol {
  width:62px;
  height:54px;
  display:block;
  flex:0 0 auto;
}
.brand-symbol img {
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
  mix-blend-mode:multiply;
}
.brand strong {
  font-size:23px;
  line-height:.95;
  letter-spacing:4px;
  text-transform:uppercase;
}

.side-rail nav { display:grid; gap:8px; }
.side-rail nav a {
  min-height:46px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 13px;
  border-radius:14px;
  color:#355b65;
  font-size:13px;
  font-weight:760;
}
.side-rail nav a span { width:22px; color:var(--teal); text-align:center; }
.side-rail nav a:hover, .side-rail nav a.active { background:#e8f1ee; color:var(--ink); }

.rail-card {
  margin-top:auto;
  min-height:235px;
  padding:22px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  border-radius:26px;
  background:
    linear-gradient(180deg, rgba(255,254,250,.50), var(--surface)),
    radial-gradient(circle at 70% 13%, rgba(242,170,47,.18), transparent 18%),
    linear-gradient(135deg, transparent 45%, rgba(11,117,132,.18) 46% 48%, transparent 49%);
  background-size:auto, auto, 33px 33px;
  box-shadow:var(--shadow);
}
.rail-card img {
  width:100%;
  max-height:112px;
  object-fit:contain;
  object-position:left center;
  margin:0 0 12px -8px;
  mix-blend-mode:multiply;
  opacity:.95;
}
.rail-card strong { margin-top:16px; font:700 22px/1.12 Georgia, serif; }
.rail-card p { margin:10px 0 0; color:var(--ink-soft); font-size:12px; }

main { min-width:0; padding:12px 16px 24px 22px; }
.topbar {
  height:66px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-bottom:18px;
}
.topbar nav { display:flex; gap:26px; color:var(--ink-soft); font-size:13px; font-weight:720; }
.topbar nav a.active { color:var(--teal); border-bottom:3px solid var(--teal); padding-bottom:12px; }
.top-actions { display:flex; align-items:center; gap:12px; }
.icon-button, .user-chip {
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border:0;
  border-radius:50%;
  background:rgba(255,254,250,.78);
  box-shadow:0 8px 24px rgba(8,47,58,.08);
  font-weight:900;
}
.primary-action {
  min-height:44px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:0 21px;
  border-radius:999px;
  background:var(--coral);
  color:white;
  font-weight:850;
  box-shadow:0 14px 30px rgba(242,103,75,.22);
}
.user-chip { background:#f0ede5; color:var(--ink); font-size:12px; }

.hero-board {
  display:grid;
  grid-template-columns:minmax(0, 1.82fr) minmax(350px, .86fr);
  gap:22px;
  align-items:stretch;
}

.map-board, .case-spotlight, .stat-card, .queue-card, .future-card, .commit-card, .participation-card, .subscribe-card, .borough-panel {
  border:1px solid rgba(8,47,58,.10);
  border-radius:var(--radius);
  background:rgba(255,254,250,.84);
  box-shadow:var(--shadow);
  backdrop-filter:blur(18px);
}

.map-board {
  min-height:610px;
  position:relative;
  overflow:visible;
  padding:32px;
  display:grid;
  grid-template-columns:minmax(330px,.76fr) minmax(440px,1.24fr);
  gap:28px;
  align-items:stretch;
}

.map-panel {
  position:relative;
  min-height:546px;
  overflow:hidden;
  border:10px solid rgba(255,254,250,.86);
  border-radius:22px;
  background:#dff1ef;
  box-shadow:0 20px 48px rgba(8,47,58,.13);
}

.map-panel-top {
  position:absolute;
  left:16px;
  top:15px;
  right:74px;
  z-index:500;
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:0 15px;
  border:1px solid rgba(8,47,58,.10);
  border-radius:14px;
  background:rgba(255,254,250,.90);
  box-shadow:0 10px 28px rgba(8,47,58,.08);
  backdrop-filter:blur(12px);
}
.map-panel-top strong { font-size:13px; }
.map-panel-top span { color:var(--muted); font-size:10px; font-weight:800; }

#visual-map {
  position:absolute;
  inset:0;
  z-index:0;
  min-height:100%;
  filter:saturate(.86) contrast(.98) brightness(1.03);
}

.map-tools {
  position:absolute;
  z-index:500;
  right:16px;
  top:74px;
  display:grid;
  gap:9px;
}
.map-tools span {
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:rgba(255,254,250,.94);
  box-shadow:0 10px 22px rgba(8,47,58,.12);
  font-weight:900;
}

.hero-copy, .borough-strip, .legend, .map-cta { position:relative; z-index:2; }
.kicker {
  margin:0 0 16px;
  color:var(--teal);
  text-transform:uppercase;
  letter-spacing:2px;
  font-size:11px;
  font-weight:950;
}
.hero-copy {
  width:100%;
  align-self:center;
  padding-left:3px;
}
.hero-copy h1 {
  margin:0;
  font:700 clamp(46px, 5vw, 69px)/.94 Georgia, serif;
  letter-spacing:-3.2px;
}
.hero-copy p:not(.kicker) {
  max-width:450px;
  margin:22px 0;
  color:var(--ink-soft);
  font-size:17px;
}
.searchbar {
  width:min(100%, 460px);
  min-height:48px;
  display:grid;
  grid-template-columns:38px 1fr;
  align-items:center;
  padding:0 16px;
  border:1px solid rgba(8,47,58,.12);
  border-radius:999px;
  background:rgba(255,254,250,.94);
  box-shadow:0 12px 30px rgba(8,47,58,.08);
}
.searchbar span { color:var(--teal); font-size:20px; }
.searchbar input { border:0; outline:0; min-width:0; background:transparent; color:var(--ink); font-size:13px; }

.borough-strip {
  position:absolute;
  left:20px;
  right:304px;
  bottom:76px;
  display:grid;
  grid-template-columns:repeat(4, minmax(94px, 1fr)) 1.1fr;
  gap:10px;
  z-index:500;
}
.borough-strip button {
  min-height:88px;
  padding:12px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-end;
  gap:2px;
  border:1px solid rgba(8,47,58,.10);
  border-radius:17px;
  background:rgba(255,254,250,.92);
  box-shadow:0 12px 28px rgba(8,47,58,.09);
  text-align:left;
}
.borough-strip button.active { outline:3px solid rgba(11,117,132,.18); border-color:var(--teal); }
.borough-strip span { margin-bottom:auto; font-size:25px; }
.borough-strip strong { font-size:12px; }
.borough-strip small { color:var(--muted); font-size:9px; }

.legend {
  position:absolute;
  left:20px;
  bottom:18px;
  display:flex;
  flex-wrap:wrap;
  gap:18px;
  padding:12px 17px;
  border-radius:999px;
  background:rgba(255,254,250,.92);
  box-shadow:0 12px 28px rgba(8,47,58,.08);
  color:var(--ink-soft);
  font-size:11px;
  z-index:500;
}
.legend span { display:inline-flex; align-items:center; gap:7px; }
.dot { width:9px; height:9px; border-radius:50%; display:inline-block; }
.received { background:var(--teal); } .progress { background:var(--amber); } .execution { background:var(--coral); } .solved { background:var(--green); }
.map-cta {
  position:absolute;
  right:20px;
  bottom:18px;
  min-height:52px;
  display:inline-flex;
  align-items:center;
  gap:18px;
  padding:0 22px;
  border-radius:15px;
  background:var(--surface);
  font-size:13px;
  font-weight:900;
  box-shadow:0 18px 36px rgba(8,47,58,.12);
  z-index:500;
}

.civic-marker {
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border:3px solid white;
  border-radius:50% 50% 50% 9px;
  transform:rotate(-45deg);
  color:white;
  font-size:12px;
  font-weight:950;
  box-shadow:0 10px 20px rgba(8,47,58,.22);
}
.civic-marker span { transform:rotate(45deg); }
.civic-marker.problema { background:var(--coral); }
.civic-marker.ideia { background:var(--teal); }
.civic-marker.concluido { background:var(--green); }
.civic-marker.future { background:#102f3c; box-shadow:0 0 0 5px rgba(20,160,174,.18), 0 10px 20px rgba(8,47,58,.24); }

.case-spotlight {
  min-height:620px;
  position:relative;
  padding:30px;
  display:flex;
  flex-direction:column;
}
.spotlight-top { display:flex; justify-content:space-between; color:var(--ink-soft); font-size:13px; }
.spotlight-top strong { color:var(--ink); }
#spotlight-card h2 { margin:28px 0 8px; font:700 27px/1.08 Georgia, serif; letter-spacing:-.7px; }
.case-location, .case-category { color:var(--muted); font-size:12px; }
.case-category { display:inline-flex; margin:12px 0 26px; padding:6px 12px; border-radius:999px; background:#fff0cf; color:#8a5d08; font-weight:850; }
.case-description { color:var(--ink-soft); font-size:13px; }
.public-actions {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin:22px 0 18px;
}
.case-vote-button, .case-follow-button {
  min-height:58px;
  display:grid;
  grid-template-columns:28px 1fr;
  grid-template-rows:auto auto;
  align-items:center;
  column-gap:9px;
  border:1px solid rgba(8,47,58,.10);
  border-radius:15px;
  background:#fbfaf4;
  text-align:left;
  padding:10px 12px;
}
.case-vote-button span, .case-follow-button span {
  grid-row:1 / span 2;
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#e4f1ee;
  color:var(--teal);
  font-weight:950;
}
.case-vote-button strong, .case-follow-button strong { font-size:17px; line-height:1; }
.case-vote-button small, .case-follow-button small { color:var(--muted); font-size:9px; }
.case-vote-button.active, .case-follow-button.active {
  border-color:rgba(11,117,132,.28);
  background:#edf7f4;
}
.case-vote-button:disabled, .case-follow-button:disabled { cursor:default; opacity:.82; }
.status-line { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; margin:30px 0; }
.status-step { position:relative; text-align:center; color:var(--muted); font-size:9px; }
.status-step::before {
  content:"";
  width:21px;
  height:21px;
  display:block;
  margin:0 auto 8px;
  border:2px solid var(--line);
  border-radius:50%;
  background:var(--surface);
}
.status-step.done::before { background:var(--green); border-color:var(--green); box-shadow:inset 0 0 0 5px var(--green); }
.status-step.active::before { border-color:var(--teal); box-shadow:0 0 0 5px rgba(11,117,132,.12); }
.city-answer {
  margin-top:auto;
  padding:18px;
  border-radius:14px;
  background:#eaf3f2;
  color:var(--ink-soft);
  font-size:12px;
}
.city-answer strong { display:block; margin-bottom:8px; color:var(--ink); }
.spotlight-link {
  margin-top:18px;
  display:inline-flex;
  color:var(--teal);
  font-size:12px;
  font-weight:900;
}
.spotlight-controls { position:absolute; right:25px; top:76px; display:flex; gap:8px; }
.spotlight-controls button {
  width:32px;
  height:32px;
  border:0;
  border-radius:50%;
  background:#eef3f0;
  color:var(--ink);
  font-size:20px;
}

.dashboard-grid {
  margin-top:22px;
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(0,1.1fr) minmax(0,.95fr);
  gap:18px;
}
.dashboard-grid > * { min-width:0; }
.stat-card, .queue-card, .future-card { min-height:245px; }
.stat-card, .queue-card, .commit-card, .participation-card, .subscribe-card { padding:24px; }
.card-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:18px; }
.card-head strong { font-size:14px; }
.card-head span, .card-head a, .card-head button { color:var(--teal); font-size:10px; font-weight:900; border:0; background:transparent; }
.stat-row { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; padding:16px 0 20px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.stat-row strong { display:block; font:700 28px/1 Georgia, serif; }
.stat-row span, .quality-row span { color:var(--muted); font-size:10px; }
.quality-row { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:20px; }
.quality-row strong { display:block; font-size:20px; }

.queue-card { grid-row:span 2; }
.filter-pills { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.filter-pills button {
  min-height:32px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--surface);
  color:var(--muted);
  font-size:10px;
  font-weight:900;
}
.filter-pills button.active { background:var(--ink); color:white; border-color:var(--ink); }
.case-list { display:grid; gap:9px; max-height:390px; overflow:auto; padding-right:4px; }
.case-row {
  display:grid;
  grid-template-columns:38px 1fr auto;
  gap:12px;
  align-items:center;
  padding:12px;
  border:1px solid rgba(8,47,58,.08);
  border-radius:15px;
  background:#fbfaf4;
  text-align:left;
}
.case-row.active { border-color:var(--teal); box-shadow:0 0 0 3px rgba(11,117,132,.12); }
.case-row-icon {
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#e4f1ee;
  color:var(--teal);
  font-weight:950;
}
.case-row.problema .case-row-icon { background:#fde4dc; color:#a33f2b; }
.case-row.concluido .case-row-icon { background:#dff1e8; color:var(--green); }
.case-row strong, .case-row small { display:block; max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.case-row strong { font-size:12px; }
.case-row small, .case-row em { color:var(--muted); font-size:9px; font-style:normal; }

.future-card {
  grid-column:span 1;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  overflow:hidden;
}
.future-copy { min-width:0; padding:28px; }
.future-copy span { color:var(--teal); font-size:12px; font-weight:900; }
.future-copy h2 { margin:24px 0 12px; font:700 31px/1.02 Georgia, serif; letter-spacing:-.8px; }
.future-copy p { color:var(--ink-soft); font-size:13px; }
.support-button {
  min-height:42px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-top:14px;
  padding:0 16px;
  border:0;
  border-radius:10px;
  background:var(--teal);
  color:white;
  font-size:12px;
  font-weight:900;
}
.future-image {
  min-height:100%;
  background:
    linear-gradient(90deg, rgba(255,254,250,.05), rgba(255,254,250,.18)),
    url("assets/lisboa-melhora-design-v2.png") center / cover;
}

.commit-card p, .participation-card p, .subscribe-card p { color:var(--ink-soft); font-size:13px; }
.bar { height:9px; position:relative; border-radius:999px; background:#e5e7e0; overflow:visible; margin:18px 0 16px; }
.bar span { display:block; height:100%; border-radius:999px; background:var(--teal-2); }
.bar.teal span { background:var(--teal); }
.bar em { position:absolute; right:0; top:14px; color:var(--muted); font-size:10px; font-style:normal; }
.commit-card small { color:var(--muted); }

.subscribe-card form { display:flex; gap:8px; margin-top:16px; }
.subscribe-card input { min-width:0; flex:1; height:38px; border:1px solid var(--line); border-radius:9px; padding:0 12px; background:var(--surface); }
.subscribe-card button { border:0; border-radius:9px; padding:0 14px; background:var(--teal); color:white; font-size:11px; font-weight:900; }

.borough-panel {
  margin-top:22px;
  padding:30px;
  display:grid;
  grid-template-columns:.85fr 1.15fr;
  gap:30px;
}
.borough-panel h2 { margin:0; font:700 38px/1.02 Georgia, serif; letter-spacing:-1.2px; }
.borough-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.borough-card {
  min-height:92px;
  padding:15px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fbfaf4;
  text-align:left;
}
.borough-card strong { display:block; font:700 17px/1.1 Georgia, serif; }
.borough-card span { display:block; margin-top:7px; color:var(--muted); font-size:10px; }

.toast {
  position:fixed;
  right:24px;
  bottom:22px;
  z-index:50;
  max-width:360px;
  padding:14px 17px;
  border-radius:13px;
  background:var(--ink);
  color:white;
  box-shadow:var(--shadow);
  opacity:0;
  transform:translateY(16px);
  transition:.22s;
  font-size:12px;
}
.toast.show { opacity:1; transform:none; }

@media (max-width: 1350px) {
  .app-shell { grid-template-columns:1fr; }
  .side-rail { position:relative; top:auto; height:auto; flex-direction:row; align-items:center; padding:16px 20px; }
  .side-rail nav { display:flex; gap:6px; overflow:auto; }
  .side-rail nav a { white-space:nowrap; }
  .rail-card { display:none; }
  .hero-board, .dashboard-grid, .borough-panel { grid-template-columns:1fr; }
  .queue-card { grid-row:auto; }
  .future-card { grid-column:auto; }
}

@media (max-width: 980px) {
  .map-board {
    grid-template-columns:1fr;
    min-height:auto;
  }
  .hero-copy {
    align-self:start;
  }
  .map-panel {
    min-height:560px;
  }
}

@media (max-width: 760px) {
  main { padding:14px; }
  .topbar { height:auto; align-items:flex-start; flex-direction:column; }
  .topbar nav { width:100%; overflow:auto; padding-bottom:4px; }
  .hero-board { gap:14px; }
  .map-board { min-height:auto; padding:24px 18px; }
  .hero-copy { width:100%; }
  .hero-copy h1 { font-size:47px; }
  .map-panel { min-height:680px; }
  .map-panel-top { right:16px; align-items:flex-start; flex-direction:column; justify-content:center; padding:8px 12px; }
  .map-tools { top:92px; }
  .borough-strip { left:14px; right:14px; bottom:86px; grid-template-columns:repeat(2,1fr); }
  .legend { left:14px; right:14px; bottom:18px; border-radius:18px; }
  .map-cta { display:none; }
  .case-spotlight { min-height:auto; }
  .stat-row, .quality-row { grid-template-columns:repeat(2,1fr); }
  .future-card { grid-template-columns:1fr; }
  .future-image { min-height:210px; }
  .borough-grid { grid-template-columns:1fr; }
  .side-rail { align-items:flex-start; flex-direction:column; }
}
