:root {
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #243d4e;
  background: #f4f6f7;
  font-synthesis: none;
  --azul: #16354b;
  --verde: #23765f;
  --borde: #dce4e8;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: var(--verde); }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #3684b5; outline-offset: 3px; }
.topbar { min-height: 76px; background: var(--azul); color: white; display: flex; align-items: center; justify-content: space-between; padding: 16px max(24px, calc((100vw - 1330px)/2)); gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { height: 42px; width: 42px; display: grid; place-items: center; border-radius: 8px; background: var(--verde); color: white; font-weight: 800; }
.brand strong { display: block; font-size: 20px; }
.brand small { display: block; color: #c1d1da; font-size: 12px; margin-top: 3px; }
.project-pill { padding: 8px 12px; border: 1px solid #557080; border-radius: 5px; color: #e0e9ee; font-size: 12px; }
.shell { max-width: 1374px; padding: 30px 22px 20px; margin: auto; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.intro h1 { font-size: clamp(25px, 3vw, 32px); margin: 6px 0 10px; letter-spacing: -.7px; color: var(--azul); }
.intro p:not(.eyebrow) { color: #5b707d; line-height: 1.55; font-size: 14px; margin: 0; }
.nav-link { white-space: nowrap; font-size: 13px; text-underline-offset: 5px; }
.eyebrow { color: var(--verde); font-size: 10px; letter-spacing: 1.6px; font-weight: 750; margin: 0 0 7px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 25px 0; }
.stat { background: white; border: 1px solid var(--borde); border-radius: 8px; padding: 15px 20px; }
.stat span { display: block; color: #536976; font-size: 12px; font-weight: 600; }
.stat strong { display: block; font-size: 28px; margin: 4px 0; color: var(--azul); }
.stat small { color: #647985; font-size: 11px; }
.layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 22px; align-items: start; }
.right-col { display: grid; gap: 22px; min-width: 0; }
.panel { background: white; border: 1px solid var(--borde); border-radius: 10px; padding: 23px; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel h2 { font-size: 20px; letter-spacing: -.4px; margin: 0; color: var(--azul); }
.round-icon { border-radius: 6px; background: #edf5f1; color: var(--verde); padding: 5px 10px; font-size: 22px; }
label { display: block; font-size: 12px; font-weight: 650; margin: 16px 0 7px; }
input, select, textarea { width: 100%; border: 1px solid #c7d4dc; border-radius: 6px; background: white; color: #243c4d; padding: 10px 11px; min-height: 42px; font-size: 13px; }
textarea { resize: vertical; line-height: 1.5; }
.help { font-size: 12px; color: #5f7380; line-height: 1.6; }
.primary { background: var(--verde); color: white; border: 0; border-radius: 6px; min-height: 44px; padding: 12px 15px; font-size: 13px; font-weight: 650; }
.primary:hover:not(:disabled) { background: #1a5c49; }
.form-panel .primary { width: 100%; margin-top: 10px; display: flex; justify-content: space-between; }
.location-box { background: #f0f6f3; border-left: 3px solid var(--verde); padding: 12px; margin-top: 17px; font-size: 12px; }
.location-box p { line-height: 1.6; margin: 7px 0; }
.location-box a { font-weight: 650; text-underline-offset: 3px; }
.sample { margin-top: 22px; border-top: 1px solid var(--borde); padding-top: 17px; }
.sample summary { font-size: 13px; cursor: pointer; font-weight: 650; }
.sample p { font-size: 12px; color: #5b707d; line-height: 1.6; }
.subtle-button, .outline { background: white; color: var(--azul); border: 1px solid #c7d4dc; padding: 9px 12px; border-radius: 6px; font-size: 12px; }
.map-panel { padding: 20px; }
.map-panel .panel-heading { margin-bottom: 10px; }
.map-help { font-size: 12px; color: #5b707d; margin: 0 0 16px; line-height: 1.5; }
#map { height: 450px; width: 100%; background: #e9eeeb; border: 1px solid var(--borde); border-radius: 6px; z-index: 0; }
#mapMessage { margin: 9px 0; }
#map.map-unavailable { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 30px; text-align: center; gap: 15px; line-height: 1.7; }
#map.map-unavailable p { max-width: 480px; margin: 0; }
.map-legend { display: flex; flex-wrap: wrap; gap: 15px; font-size: 11px; margin: 12px 0 7px; }
.map-legend span { display: flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.waiting-dot { background: #b77918; }
.working-dot { background: #27669f; }
.done-dot { background: #258062; }
.selected-dot { background: #328dcb; border-radius: 2px; }
.report-marker span { display: grid; place-items: center; width: 28px; height: 28px; border: 3px solid white; border-radius: 50%; color: white; font-weight: 700; font-size: 12px; box-shadow: 0 1px 5px #16354b66; }
.map-popup { padding: 5px 0; overflow-wrap: anywhere; }
.map-popup + .map-popup { border-top: 1px solid var(--borde); }
.map-popup button { background: var(--azul); color: white; border: 0; border-radius: 4px; padding: 7px 10px; }
.list-heading { margin-bottom: 14px; }
.list-heading select { width: auto; min-width: 130px; }
.search { background: #f4f7f8; padding: 13px; border-radius: 6px; margin-bottom: 18px; }
.search label { margin: 0 0 8px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 80px; }
.search-row button, .actions button { border: 0; border-radius: 5px; background: var(--azul); color: white; padding: 9px 12px; font-weight: 600; font-size: 12px; }
.search-row .outline { background: white; color: var(--azul); border: 1px solid var(--borde); }
#searchFeedback { display: block; margin-top: 6px; color: #286450; }
.incident-list { display: grid; gap: 12px; max-height: 550px; overflow-y: auto; padding-right: 3px; }
.incident { border: 1px solid var(--borde); border-radius: 7px; padding: 15px 17px; overflow-wrap: anywhere; }
.incident-top, .incident-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.code { color: var(--verde); font-size: 12px; font-weight: 750; }
.status { font-size: 11px; border-radius: 4px; padding: 5px 9px; font-weight: 650; }
.waiting { background: #fbf0d9; color: #805716; }
.working { background: #e7eff8; color: #245788; }
.done { background: #e7f3ec; color: #256544; }
.incident h3 { font-size: 15px; margin: 10px 0; color: var(--azul); }
.meta { display: block; font-size: 11px; color: #5d727f; margin-top: 4px; }
.incident p { color: #526773; font-size: 13px; line-height: 1.6; margin: 10px 0; white-space: pre-wrap; }
.incident .location-detail { font-size: 11px; }
.incident-bottom { border-top: 1px solid #e7edef; padding-top: 12px; flex-wrap: wrap; }
.priority-label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 11px; }
.priority-label select { width: 70px; min-height: 36px; padding: 6px; }
.actions { display: flex; gap: 7px; flex-wrap: wrap; }
.actions button { background: #edf5f1; color: #21634f; padding: 9px; }
.actions button:hover { background: #dcece4; }
.algorithms .alg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.alg-grid h3 { font-size: 15px; margin: 0 0 5px; }
.alg-grid p, .alg-grid small { color: #5d727f; font-size: 12px; line-height: 1.6; margin: 0 0 13px; }
.heap-list { display: grid; gap: 7px; min-height: 51px; margin-bottom: 13px; }
.heap-item { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--borde); border-radius: 5px; }
.heap-item > b { height: 25px; min-width: 25px; display: grid; place-items: center; background: #edf5f1; color: var(--verde); border-radius: 4px; font-size: 12px; }
.heap-item span { display: grid; gap: 2px; flex: 1; }
.heap-item span strong { font-size: 12px; }
.heap-item span small { font-size: 10px; margin: 0; }
.heap-item em { font-style: normal; font-size: 12px; font-weight: 700; color: #88601b; }
.secondary { font-size: 12px; width: 100%; background: var(--azul); }
.buckets { display: grid; gap: 5px; max-height: 253px; overflow: auto; }
.bucket { display: flex; gap: 8px; align-items: center; border: 1px solid var(--borde); padding: 6px 9px; border-radius: 5px; font-size: 11px; }
.bucket b { background: #edf3f6; min-width: 24px; padding: 5px; text-align: center; border-radius: 3px; }
.bucket span { overflow-wrap: anywhere; color: #526773; }
.empty { border: 1px dashed #becdd5; border-radius: 7px; padding: 32px 16px; text-align: center; color: #5d727f; font-size: 13px; line-height: 1.8; }
.notice { background: #fff2d6; border: 1px solid #dcb668; border-radius: 6px; color: #68470e; padding: 14px; line-height: 1.5; font-size: 13px; }
footer { text-align: center; padding: 30px 0 10px; color: #5d727f; font-size: 11px; line-height: 1.7; }
.toast { position: fixed; bottom: 24px; right: 24px; max-width: min(450px, calc(100vw - 32px)); background: var(--azul); color: white; padding: 14px 19px; border-radius: 7px; opacity: 0; pointer-events: none; font-size: 13px; z-index: 2000; }
.toast.show { opacity: 1; }
@media (max-width: 1000px) {
  .layout { grid-template-columns: 290px minmax(0, 1fr); gap: 16px; }
  .panel { padding: 17px; }
  .algorithms .alg-grid { grid-template-columns: 1fr; }
  .map-panel .panel-heading { align-items: start; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .layout { display: flex; flex-direction: column; }
  .form-panel, .right-col { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .intro { align-items: start; flex-direction: column; }
  .topbar { padding: 16px; }
  .project-pill { display: none; }
  .shell { padding: 22px 14px; }
  #map { height: 370px; }
  .list-heading { flex-wrap: wrap; }
  .search-row { flex-wrap: wrap; }
  .search-row input { flex-basis: 100%; }
}
