/* Simulador de decisão · Incêndios rurais. Estilo dos mockups do Claude Design (design/README.md):
   fundo creme, barra escura, laranja do fogo para a ação principal, azul e roxo para os planos A e B. */
:root {
  --bg: #F3F0E8;
  --surface: #FFFFFF;
  --surface-2: #F6F3EC;
  --ink: #1E1D1A;
  --muted: #5C584F;
  --line: #DDD7CA;
  --line-strong: #C9C2B3;
  --fire: #C2410C;
  --fire-dark: #9A3412;
  --fire-soft: #FBEDE3;
  --plan-a: #2563A8;
  --plan-b: #7C3AED;
  --plan-s: #0F766E;
  --radius: 12px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-height: 100vh; }
button, select, input { font: inherit; }
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #F29A5C; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Barra de topo */
.topbar {
  background: var(--ink); color: #F3F0E8; padding: 10px 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand div { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-size: 16px; }
.brand span { font-size: 13px; color: #CFC9BC; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--fire-soft); color: #7A2E0B; }
.chips--dark .chip { background: #34322D; color: #F3F0E8; }

/* ---------------------------------------------------------------- Passos */
.steps { background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 24px; display: flex; flex-wrap: wrap; gap: 6px; }
.steps button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 8px; font-size: 14px;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer;
}
.steps__n { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; background: #E7E2D6; color: #3F3C35; }
.steps button.done { color: var(--ink); }
.steps button.done .steps__n { background: var(--ink); color: #FFF; }
.steps button[aria-current="step"] { background: var(--ink); color: #F3F0E8; }
.steps button[aria-current="step"] .steps__n { background: var(--fire); color: #FFF; }
.steps button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------------------------------------------------------------- Disposição */
.layout { padding: 16px 24px 24px; display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.stage { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.panel { flex: 1 1 340px; max-width: 460px; }
.panel__step { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; }
.panel__body { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.panel__foot { border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 10px; justify-content: space-between; background: #FCFBF8; }

.step-head { display: flex; flex-direction: column; gap: 4px; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fire-dark); }
.step-head h1 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
.step-head p { margin: 0; color: var(--muted); }

.block { display: flex; flex-direction: column; gap: 10px; }
.block__title { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.block--quiet summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); min-height: 32px; display: flex; align-items: center; }
.block--suggest { background: #F5F0FE; border: 1px solid #DDD0FB; border-radius: var(--radius); padding: 14px; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.desc { margin: 0; color: var(--muted); font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; margin-top: 8px; }
.field select { min-height: 44px; border-radius: 8px; border: 1px solid var(--line-strong); background: #FAF8F3; padding: 0 10px; font-weight: 400; }

/* ---------------------------------------------------------------- Botões */
.btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; }
.btn--small { min-height: 44px; font-size: 14px; padding: 0 12px; }
.btn--dark { background: var(--ink); border-color: var(--ink); color: #F3F0E8; }
.btn--fire { background: var(--fire); border-color: var(--fire); color: #FFF; }
.btn--next { flex: 1; min-height: 52px; font-size: 16px; }
.btn--back { min-height: 52px; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn--suggest { width: 100%; min-height: 48px; background: var(--plan-s); border-color: var(--plan-s); color: #FFF; }

/* ---------------------------------------------------------------- Passo 1 · Alertas */
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); border-left: 6px solid var(--fire);
  background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 4px; color: var(--ink); font: inherit;
}
.alert-item strong { font-size: 15px; }
.alert-item > span { font-size: 13px; color: var(--muted); }
.alert-item ul { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.alert-item:hover { border-color: var(--line-strong); background: #FCFBF8; }
.alert-item[aria-checked="true"] { border: 2px solid var(--fire); border-left-width: 6px; background: var(--fire-soft); padding: 9px 11px; }
.alert-item[aria-checked="true"]::before { content: '✓ Escolhido'; font-size: 12px; font-weight: 700; color: var(--fire-dark); }
.alert-src { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #E7E2D6; color: #3F3C35; }
.alert-src--satelite { background: #E0E7FF; color: #3730A3; }
.alert-src--112 { background: #FDE2E2; color: #991B1B; }
.alert-src--vigia { background: #E6F4F1; color: #0B5D57; }
.block--phones { background: var(--surface-2); border-radius: var(--radius); padding: 12px; }
.ntfy-code { flex: 1; min-width: 0; min-height: 44px; border-radius: 8px; border: 1px solid var(--line-strong); background: #FFF; padding: 0 10px; font-family: 'IBM Plex Mono', monospace; }
.ntfy-topics { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.ntfy-topics code { font-family: 'IBM Plex Mono', monospace; background: #FFF; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; user-select: all; }
.note-warn { margin: 0; font-size: 14px; background: #FFF4D6; color: #6B4A00; border: 1px solid #F1D48A; border-radius: 10px; padding: 8px 10px; }
.best-tag { font-style: normal; font-size: 12px; font-weight: 700; color: #2F5A1E; background: #E8F0E1; border-radius: 999px; padding: 1px 8px; margin-left: 6px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #E7E2D6; padding: 4px; border-radius: 10px; }
.seg__btn { min-height: 44px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; cursor: pointer; color: var(--ink); }
.seg__btn[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }

.meteo { display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); border-radius: var(--radius); padding: 12px; }
.meteo__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; }
.meteo__grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.meteo__grid input, .meteo__grid select { min-height: 44px; border-radius: 8px; border: 1px solid var(--line-strong); background: #FFF; padding: 0 10px; font-weight: 400; }
.meteo__fine { margin: 0; font-size: 14px; background: var(--fire-soft); color: #5A2A0D; padding: 10px 12px; border-radius: 10px; }
.meteo__note { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- Passo 2 */
.plan-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-tabs button {
  --plan: var(--plan-a);
  display: flex; align-items: flex-start; gap: 10px; text-align: left; min-height: 64px; padding: 10px 12px;
  border-radius: var(--radius); border: 1px solid var(--line); border-top: 4px solid var(--plan); background: var(--surface); cursor: pointer; color: var(--ink);
}
.plan-tabs button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--plan); background: #FCFBF8; }
.plan-tabs__text { display: flex; flex-direction: column; min-width: 0; }
.plan-tabs__text strong { font-size: 14px; line-height: 1.25; }
.plan-tabs__text span { font-size: 12px; color: var(--muted); }

.deployments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.deployments .empty { color: var(--muted); font-size: 14px; padding: 14px; border: 2px dashed var(--line); border-radius: 12px; text-align: center; }
.dep { --team: #C2410C; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dep--selected { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.dep__main { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--ink); }
.dep__badge { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--team); color: #FFF; border: 2px solid #FFF; box-shadow: 0 0 0 2px var(--team); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.dep__text { display: flex; flex-direction: column; font-size: 14px; }
.dep__text span { font-size: 13px; color: var(--muted); }
.dep__edit { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 0 10px 10px; font-size: 14px; }
.dep__edit label { display: flex; align-items: center; gap: 6px; }
.dep__edit select { min-height: 44px; border-radius: 8px; border: 1px solid var(--line-strong); background: #FAF8F3; padding: 0 8px; }
.link-danger { min-height: 44px; border: 0; background: transparent; color: var(--fire-dark); font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Cartões estilo jogo (por cima do mapa, só no passo 2) */
.tray-wrap { background: linear-gradient(#2B2925, #1E1D1A); border-radius: 14px; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.tray-title { color: #CFC9BC; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.tray { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.card {
  --team: #C2410C;
  position: relative; text-align: left; cursor: grab; touch-action: none; user-select: none;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, 0.12);
  background: #34322D; color: #F3F0E8; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
  transition: transform 0.1s, box-shadow 0.1s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.45); border-color: var(--team); }
.card:active { cursor: grabbing; }
.card__badge {
  grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; background: var(--team);
  border: 3px solid #FFF; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
}
.card__name { font-weight: 700; font-size: 14px; }
.card__desc { font-size: 12px; color: #CFC9BC; line-height: 1.3; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.card__count { position: absolute; top: -8px; right: -8px; background: #F29A5C; color: #1E1D1A; font-weight: 700; font-size: 13px; border-radius: 999px; padding: 1px 8px; border: 2px solid #1E1D1A; }
.card--empty { opacity: 0.45; }
.card--empty .card__count { background: #8E8A80; }

.drag-ghost {
  --team: #C2410C;
  position: fixed; z-index: 50; pointer-events: none; width: 54px; height: 54px; margin: -27px 0 0 -27px;
  border-radius: 50%; background: var(--team); border: 4px solid #FFF; color: #FFF; font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  transform: scale(1.1) rotate(-6deg); transition: transform 0.1s, opacity 0.1s;
}
.drag-ghost.over-map { opacity: 0.35; transform: scale(0.8); }
.pop { position: fixed; z-index: 60; pointer-events: none; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 3px solid #F29A5C; animation: pop 0.55s ease-out forwards; }
@keyframes pop { to { transform: scale(4); opacity: 0; } }
.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---------------------------------------------------------------- Passo 3 */
.results { display: flex; flex-direction: column; gap: 12px; }
.summary { margin: 0; font-size: 16px; line-height: 1.5; background: var(--ink); color: #F3F0E8; padding: 14px 16px; border-radius: var(--radius); }
.table-wrap { overflow-x: auto; }
.results table { width: 100%; border-collapse: collapse; font-size: 14px; }
.results th, .results td { padding: 7px 6px; border-bottom: 1px solid #EEE9DE; text-align: right; }
.results th[scope="row"], .results thead th:first-child { text-align: left; font-weight: 500; }
.results td { font-family: 'IBM Plex Mono', monospace; font-size: 13px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.chart .legend span { display: flex; align-items: center; gap: 6px; }
.chart .legend i { width: 14px; height: 4px; border-radius: 2px; }

/* ---------------------------------------------------------------- Mapa */
.map-frame {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 10px 30px -18px rgba(30, 29, 26, 0.45);
}
/* A altura dos canvas é calculada em main.ts (cabe no ecrã sem deformar o mapa). */
canvas { display: block; width: 100%; touch-action: none; cursor: grab; }
canvas.panning { cursor: grabbing; }
body[data-view="perimetro"] #map { cursor: crosshair; }
.map-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(243, 240, 232, 0.85); font-weight: 700; font-size: 18px; }
.map-tools { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; gap: 6px; }
.map-btn { min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.95); font-size: 20px; font-weight: 600; cursor: pointer; color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }
.map-btn--wide { font-size: 14px; padding: 0 12px; }
.map-tools__layers { display: flex; gap: 6px; margin-left: 6px; }
.map-legend {
  position: absolute; left: 12px; bottom: 28px; z-index: 2; max-width: 280px; display: flex; flex-direction: column; gap: 4px;
  background: rgba(255, 255, 255, 0.94); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px;
  font-size: 12px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.map-legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.map-legend li { display: flex; align-items: center; gap: 6px; }
.map-legend i { flex: none; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.2); }
.map-legend i.contour { height: 0; border: 0; border-top: 3px solid #3B2A1A; border-radius: 0; }
.map-legend i.contour--minor { border-top-width: 1px; }
.map-legend p { margin: 0; color: var(--muted); }
/* Camada ligada: fundo escuro e um visto (a cor não é a única diferença). */
.map-btn--toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #F3F0E8; }
.map-btn--toggle[aria-pressed="true"]::before { content: "✓ "; }
.map-note { margin: 0; font-size: 13px; color: var(--muted); }
.map-more summary { padding: 6px 0; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.map-more[open] { display: flex; flex-direction: column; gap: 8px; }

.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.compare figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.compare figcaption { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.compare figcaption > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { margin-left: auto; flex: none; font-family: 'IBM Plex Mono', monospace; font-size: 13px; background: var(--surface); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.tag { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; color: #FFF; font-weight: 700; font-size: 13px; }
.tag--a { background: var(--plan-a); }
.tag--b { background: var(--plan-b); }
.tag--s { background: var(--plan-s); }

.playbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; }
.playbar input[type="range"] { flex: 1 1 200px; accent-color: var(--fire); min-height: 44px; }
.clock { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.speed { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.speed select { min-height: 44px; border-radius: 8px; border: 1px solid var(--line); padding: 0 8px; background: #FAF8F3; }

.legend-map { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: #3F3C35; }
.legend-map li { display: flex; align-items: center; gap: 6px; }
.legend-map i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.15); }
.legend-map i.flame { border: 0; background: #E8420C; clip-path: polygon(50% 0, 85% 45%, 90% 75%, 70% 100%, 30% 100%, 10% 75%, 18% 45%, 35% 55%); }
.legend-map i.boundary { border: 0; border-top: 3px dashed #1E1D1A; height: 0; width: 18px; border-radius: 0; }
.legend-map i.water-point { background: #2B6CB0; border: 2px solid #FFF; box-shadow: 0 0 0 1px #2B6CB0; border-radius: 50%; color: #FFF; font-style: normal; font-size: 8px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.legend-map i.hatch { background: repeating-linear-gradient(135deg, #2E2420 0 3px, #FFE08A 3px 5px); }
.legend-map .toggle { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.legend-map .toggle input { width: 20px; height: 20px; accent-color: var(--fire); }

.toast { position: fixed; z-index: 70; left: 50%; top: 72px; transform: translateX(-50%); background: var(--ink); color: #F3F0E8; padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); max-width: calc(100% - 32px); }

/* ---------------------------------------------------------------- Computador: tudo na janela, sem scroll da página.
   O mapa ocupa o espaço livre; o painel tem scroll próprio e o botão do passo seguinte fica sempre visível. */
/* Passo 4 · Decisão */
.decision-options { display: flex; flex-direction: column; gap: 8px; }
.decision-option {
  --plan: var(--ink);
  text-align: left; min-height: 56px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  border-left: 6px solid var(--plan); background: var(--surface); color: var(--ink); cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; font: inherit;
}
.decision-option strong { font-size: 15px; }
.decision-option span { font-size: 13px; color: var(--muted); }
.decision-option:hover { background: #FCFBF8; }
.decision-option[aria-checked="true"] { border: 2px solid var(--ink); border-left: 6px solid var(--plan); padding: 9px 11px; }
.decision-option[aria-checked="true"] strong::after { content: ' · ✓ Escolhido'; color: var(--ok, #2F5A1E); }
#decision-confirm:disabled { opacity: 1; cursor: default; background: #2F5A1E; border-color: #2F5A1E; }
.note { width: 100%; min-height: 72px; border-radius: 8px; border: 1px solid var(--line-strong); background: #FAF8F3; padding: 8px 10px; font: inherit; resize: vertical; }
.decision-status { margin: 0; background: #E8F0E1; color: #2F5A1E; border: 1px solid #C5D8B5; border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.fichas { display: flex; flex-direction: column; gap: 8px; }
.ficha { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ficha > summary { cursor: pointer; padding: 10px 12px; min-height: 44px; display: flex; flex-direction: column; gap: 2px; }
.ficha > summary strong { font-size: 15px; }
.ficha > summary span { font-size: 13px; color: var(--muted); }
.ficha__body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.ficha__body h3 { margin: 0; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ficha__body ul { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.ficha__body a { color: #1F5A9E; }
.print-root { display: none; }

@media print {
  /* Ao imprimir, só as fichas: uma por página, com a imagem do mapa. */
  body > *:not(.print-root) { display: none !important; }
  body { background: #FFF; height: auto; overflow: visible; display: block; }
  .print-root { display: block; color: #000; font-size: 12pt; }
  .print-ficha { break-after: page; padding: 0 4mm; }
  .print-ficha:last-child { break-after: auto; }
  .print-ficha header { border-bottom: 2px solid #000; margin-bottom: 8px; padding-bottom: 6px; }
  .print-ficha h1 { font-size: 18pt; margin: 0 0 4px; }
  .print-ficha p { margin: 2px 0; }
  .print-ficha h2 { font-size: 11pt; text-transform: uppercase; letter-spacing: 0.06em; margin: 12px 0 4px; }
  .print-ficha ul { margin: 0; padding-left: 18px; }
  .print-ficha li { margin: 2px 0; }
  .print-ficha img { width: 100%; max-height: 95mm; object-fit: contain; border: 1px solid #999; margin: 6px 0; }
  .print-ficha a { color: #000; text-decoration: none; }
  .print-ficha .print-url { font-size: 8pt; word-break: break-all; color: #333; }
  .print-ficha footer { margin-top: 12px; font-size: 9pt; color: #333; border-top: 1px solid #999; padding-top: 6px; }
}

@media (min-width: 1100px) and (min-height: 700px) {
  body { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  .layout { flex: 1; min-height: 0; flex-wrap: nowrap; align-items: stretch; padding: 14px 24px 16px; }
  .stage { min-height: 0; }
  .panel { flex: 0 0 clamp(360px, 30vw, 460px); max-width: none; min-height: 0; display: flex; }
  .panel__step { flex: 1; min-height: 0; }
  .panel__body { flex: 1; min-height: 0; overflow-y: auto; }
  #single-view, .compare { flex: 1; min-height: 160px; }
  .compare { grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
  .compare figure { min-height: 0; }
  .map-frame { --map-fill: 1; flex: 1; min-height: 0; }
  .map-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  .chart svg { max-height: 24vh; }
}

@media (max-width: 640px) {
  .topbar, .steps, .layout { padding-left: 16px; padding-right: 16px; }
  .panel { max-width: none; }
  .steps button { padding-right: 10px; font-size: 14px; }
}

/* Sugestão de colocação: resumo, razão por meio, tática */
.suggest-thorough { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; cursor: pointer; }
.suggest-thorough input { width: 20px; height: 20px; }
.suggestion { background: #E6F4F1; border: 1px solid #A7D7CD; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.suggestion h3 { margin: 0; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: #0B5D57; }
.suggestion p { margin: 0; line-height: 1.45; }
.suggestion__note { color: var(--muted); font-size: 13px; }
.dep__reason { margin: 0; padding: 0 12px 10px 54px; font-size: 13px; line-height: 1.4; color: #3F3C35; }
/* «Porquê» e «Que meios e porquê»: a explicação fica fechada, abre-se se for precisa. */
.why > summary { min-height: 44px; display: flex; align-items: center; padding: 0 12px 0 54px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.why > summary::-webkit-details-marker { display: none; }
.why > summary::before { content: '▸'; margin-right: 6px; transition: transform 0.15s; }
.why[open] > summary::before { transform: rotate(90deg); }
.suggestion .why > summary { padding-left: 0; }
.fleet { margin: 0 0 8px; padding-left: 20px; font-size: 13px; line-height: 1.5; }
.dep__tactic { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; }
.dep__tactic .btn { min-height: 44px; font-size: 14px; padding: 0 12px; }
.dep__tactic .btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #F3F0E8; }
.dep__tactic-note { font-size: 13px; color: var(--muted); }
