@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  font-family: "DM Sans", sans-serif;
  color: #182328;
  background: #f5f7f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #182328;
  --muted: #7c898e;
  --line: #e8edef;
  --green: #138771;
  --green-dark: #08755f;
  --critical: #df574c;
  --warning: #de9b31;
  --info: #3986c6;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  color: #e6edef;
  background: #141a1f;
  --ink: #e6edef;
  --muted: #9ba9af;
  --line: #303a40;
  --green: #36b798;
  --green-dark: #55c5a7;
  --critical: #f0786e;
  --warning: #e8ad50;
  --info: #66a9e0;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { display: flex; flex-direction: column; height: 100%; }
.topbar {
  height: 72px;
  min-height: 72px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--line);
  z-index: 500;
}
.brand { display: inline-flex; gap: 11px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 12px;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-family: Manrope, sans-serif; font-size: 19px; letter-spacing: -1px; line-height: 1.1; }
.brand-copy strong span { color: var(--green); }
.brand-copy small { color: #97a2a6; font-size: 8px; font-weight: 700; letter-spacing: 1.05px; }
.topbar-location { display: flex; align-items: center; gap: 9px; color: #536268; font-size: 12px; font-weight: 600; }
.live-dot { width: 7px; height: 7px; background: #36b68f; border-radius: 50%; box-shadow: 0 0 0 3px #e6f6f1; }
.topbar-divider { color: #c6cdd0; }
.topbar-date { color: #8a969b; font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.theme-toggle { display: inline-flex; min-height: 37px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #e6ebed; border-radius: 7px; color: #56656a; background: #fff; font-size: 10px; font-weight: 600; }
.theme-toggle:hover { border-color: #c7d7d4; background: #f7faf9; }
.theme-toggle:focus-visible, .emergency-link:focus-visible, .report-button:focus-visible { outline: 2px solid #75bda9; outline-offset: 2px; }
.theme-icon { font-size: 15px; line-height: 1; }
.emergency-link { display: inline-flex; align-items: center; gap: 7px; color: #bd4941; text-decoration: none; }
.emergency-link:hover { color: #96372f; }
.emergency-icon { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid #f1d3d0; border-radius: 50%; background: #fff7f6; font-size: 13px; font-weight: 800; }
.emergency-link > span:last-child { display: grid; gap: 1px; }
.emergency-link small { color: #a16e69; font-size: 7px; font-weight: 700; letter-spacing: .7px; }
.emergency-link strong { font-size: 12px; line-height: 1; }
.report-button, .submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.report-button { min-height: 39px; padding: 0 15px; }
.report-button span { font-size: 19px; font-weight: 400; line-height: 1; }
.report-button:hover, .submit-button:hover { background: var(--green-dark); box-shadow: 0 4px 12px #1387712b; }
.report-button:active, .submit-button:active { transform: translateY(1px); }

.workspace { display: flex; min-height: 0; flex: 1; }
.sidebar {
  position: relative;
  z-index: 400;
  display: flex;
  width: 390px;
  min-width: 350px;
  flex-direction: column;
  padding: 25px 22px 0;
  background: #fff;
  border-right: 1px solid var(--line);
}
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.eyebrow { margin: 0 0 6px; color: #97a2a6; font-size: 9px; font-weight: 700; letter-spacing: 1.2px; }
h1, h2, p { margin-top: 0; }
.sidebar h1 { margin: 0; font-family: Manrope, sans-serif; font-size: 19px; font-weight: 700; letter-spacing: -.55px; }
.incident-count { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: #edf6f4; color: var(--green); font-size: 11px; font-weight: 700; }
.status-strip { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 11px; color: #506168; background: #f6f9f9; border: 1px solid #eff2f3; border-radius: 7px; font-size: 10px; font-weight: 500; }
.status-icon { color: var(--green); font-size: 15px; }
.live-label { margin-left: auto; color: var(--green); font-size: 8px; font-weight: 700; letter-spacing: .7px; }
.filter-heading, .reports-heading { display: flex; justify-content: space-between; align-items: center; color: #9aa4a8; font-size: 9px; font-weight: 700; letter-spacing: .8px; }
.filter-heading { margin: 25px 0 10px; }
.text-button { padding: 0; border: 0; color: var(--green); background: none; font-size: 10px; font-weight: 600; }
.text-button:hover { color: var(--green-dark); text-decoration: underline; }
.priority-filters { display: flex; gap: 5px; }
.filter-chip { display: inline-flex; flex: 1; justify-content: center; align-items: center; gap: 5px; min-height: 29px; padding: 0 5px; border: 1px solid #edf0f1; border-radius: 6px; color: #69777c; background: #fff; font-size: 9px; transition: all .15s; }
.filter-chip span { min-width: 15px; padding: 1px 4px; border-radius: 8px; background: #f2f4f5; color: #859196; font-size: 8px; }
.filter-chip.active { border-color: #c8e5de; color: var(--green-dark); background: #f1faf7; }
.filter-chip.active span { color: var(--green-dark); background: #e1f3ee; }
.priority-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; }
.priority-dot.critical { background: var(--critical); }
.priority-dot.warning { background: var(--warning); }
.priority-dot.info { background: var(--info); }
.reports-heading { margin: 26px 0 0; padding-bottom: 11px; border-bottom: 1px solid #eef1f2; }
.reports-sort { color: #95a0a4; font-size: 9px; font-weight: 400; letter-spacing: 0; }
.reports-sort span { margin-left: 3px; }
.report-list { flex: 1; overflow: auto; overscroll-behavior: contain; }
.report-card { position: relative; padding: 14px 3px 14px 11px; border-bottom: 1px solid #eef1f2; cursor: pointer; transition: background .15s; }
.report-card:hover { background: #f8faf9; }
.report-card:focus-visible { outline: 2px solid #79bba9; outline-offset: -2px; }
.report-card::before { position: absolute; top: 17px; bottom: 17px; left: 0; width: 2px; border-radius: 2px; content: ""; background: var(--priority-color); }
.report-card-top, .report-location, .report-meta { display: flex; align-items: center; }
.report-card-top { justify-content: space-between; margin-bottom: 6px; }
.priority-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--priority-color); font-size: 9px; font-weight: 700; }
.report-time { color: #9aa4a8; font-size: 9px; }
.report-description { display: -webkit-box; overflow: hidden; margin: 0 0 8px; color: #29383d; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.report-location { gap: 4px; margin-bottom: 8px; color: #859196; font-size: 9px; }
.report-location svg { width: 11px; height: 11px; color: #9aa5a8; }
.report-meta { gap: 6px; color: #768489; font-size: 9px; }
.meta-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border: 1px solid #edf0f1; border-radius: 4px; background: #fff; }
.meta-media { color: var(--green); }
.empty-state { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 15px 22px 60px; text-align: center; }
.empty-state.visible { display: flex; }
.empty-pin { display: grid; width: 43px; height: 43px; place-items: center; margin-bottom: 12px; border: 1px solid #e0efeb; border-radius: 50%; color: var(--green); background: #f2f9f7; font-size: 24px; }
.empty-state strong { margin-bottom: 6px; font-family: Manrope, sans-serif; font-size: 12px; }
.empty-state p { max-width: 210px; margin-bottom: 12px; color: #8b979b; font-size: 10px; line-height: 1.6; }
.sidebar-footer { display: flex; min-height: 45px; align-items: center; gap: 7px; margin-top: auto; border-top: 1px solid #eef1f2; color: #9aa4a8; font-size: 9px; }
.footer-shield { color: var(--green); font-size: 15px; }
.sidebar-footer button { margin-left: auto; padding: 4px; border: 0; color: #9aa4a8; background: none; font-size: 13px; }

.map-panel { position: relative; min-width: 0; flex: 1; background: #e8efeb; }
#map { position: absolute; inset: 0; background: #e8efeb; }
.map-top-controls { position: absolute; top: 18px; left: 18px; right: 18px; z-index: 400; display: flex; align-items: flex-start; justify-content: space-between; pointer-events: none; }
.map-label { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #e8edef; border-radius: 8px; color: inherit; text-align: left; background: #fff; box-shadow: 0 2px 9px #213b3210; pointer-events: auto; }
.map-label:hover { border-color: #c6e1da; background: #fbfefd; }
.map-label:focus-visible { outline: 2px solid #79bba9; outline-offset: 2px; }
.map-label-icon { color: var(--green); font-size: 17px; }
.map-label span:last-child { display: grid; gap: 2px; }
.map-label strong { font-size: 10px; }
.map-label small { color: #9aa4a8; font-size: 7px; font-weight: 700; letter-spacing: .9px; }
.map-control { display: grid; width: 36px; height: 36px; place-items: center; padding: 8px; border: 1px solid #e8edef; border-radius: 8px; color: #68777b; background: #fff; box-shadow: 0 2px 9px #213b3210; pointer-events: auto; }
.map-control:hover { color: var(--green); }
.map-control svg { width: 19px; height: 19px; }
.map-hint { position: absolute; bottom: 66px; left: 50%; z-index: 400; display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid #e9edef; border-radius: 20px; color: #647278; background: #ffffffed; box-shadow: 0 3px 12px #1d3b3012; font-size: 10px; transform: translateX(-50%); pointer-events: none; white-space: nowrap; }
.hint-pointer { color: var(--green); font-size: 14px; }
.map-legend { position: absolute; bottom: 16px; left: 16px; z-index: 400; display: flex; align-items: center; gap: 13px; padding: 9px 12px; border: 1px solid #e8edef; border-radius: 7px; color: #657379; background: #fff; box-shadow: 0 2px 10px #203b3010; font-size: 9px; }
.map-legend > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-title { color: #9aa4a8; font-size: 8px; font-weight: 700; letter-spacing: .7px; }
.map-attribution { position: absolute; right: 4px; bottom: 2px; z-index: 400; padding: 2px 5px; color: #68777b; background: #ffffffc7; font-size: 8px; pointer-events: none; }
.map-drawer { position: absolute; right: 18px; bottom: 17px; z-index: 700; display: flex; width: min(520px, calc(100% - 36px)); max-height: min(54%, 430px); flex-direction: column; overflow: hidden; border: 1px solid #e4ebea; border-radius: 12px; background: #fff; box-shadow: 0 8px 32px #163c3028; }
.map-drawer[hidden] { display: none; }
.drawer-grabber { display: none; }
.drawer-header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 13px 16px 11px; border-bottom: 1px solid #eef1f2; }
.drawer-header .eyebrow { margin-bottom: 3px; }
.drawer-header h2 { margin: 0; font-family: Manrope, sans-serif; font-size: 15px; letter-spacing: -.35px; }
.drawer-header .close-button { width: 27px; height: 27px; }
.drawer-content { overflow: auto; padding: 12px 16px 16px; overscroll-behavior: contain; }
.drawer-summary { padding-left: 10px; border-left: 2px solid var(--priority-color); }
.drawer-summary .priority-badge { margin-bottom: 7px; }
.drawer-description { margin: 0 0 5px; color: #26363b; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.drawer-muted { display: block; margin: 0; color: #8d999d; font-size: 9px; line-height: 1.5; }
.drawer-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 12px 0; }
.drawer-fact { display: grid; gap: 3px; min-width: 0; padding: 8px 9px; border: 1px solid #edf0f1; border-radius: 6px; }
.drawer-fact span { color: #8d999d; font-size: 8px; }
.drawer-fact strong { color: #344348; font-size: 9px; font-weight: 600; overflow-wrap: anywhere; }
.drawer-section { padding-top: 10px; border-top: 1px solid #eef1f2; }
.drawer-section h3 { margin: 0 0 7px; color: #3a494e; font-size: 10px; }
.drawer-section > p:not(.drawer-muted) { margin: 0 0 9px; color: #637176; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.drawer-detail-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; padding: 7px 0; border-bottom: 1px solid #f0f2f3; font-size: 9px; }
.drawer-detail-row strong { color: #47565a; }
.drawer-detail-row span { color: #77858a; overflow-wrap: anywhere; }
.drawer-detail-row span:last-child { grid-column: 2; }
.alert-section { margin-top: 10px; }
.alert-section > .drawer-muted { margin-bottom: 7px; }
.recipient-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 35px; border-top: 1px solid #f0f2f3; }
.recipient-name { color: #425257; font-size: 9px; font-weight: 600; }
.recipient-status { color: #a07639; font-size: 8px; white-space: nowrap; }
.recipient-status.confirmed { color: var(--green); }
.confirm-button { min-height: 25px; padding: 0 8px; border: 1px solid #dcebe6; border-radius: 5px; color: var(--green-dark); background: #f5faf8; font-size: 8px; font-weight: 600; white-space: nowrap; }
.confirm-button:hover:not(:disabled) { border-color: #a8d3c7; background: #edf8f4; }
.confirm-button:disabled { border-color: #eef1f2; color: #84918e; background: #f7f9f8; cursor: default; }

.leaflet-container { font-family: "DM Sans", sans-serif; }
.leaflet-control-attribution { display: none; }
.incident-marker { display: flex; width: 35px; height: 43px; align-items: flex-start; justify-content: center; filter: drop-shadow(0 2px 3px #213b3240); }
.incident-marker svg { width: 35px; height: 43px; overflow: visible; }
.marker-inner { display: flex; width: 18px; height: 18px; align-items: center; justify-content: center; margin-top: 7px; border: 2px solid #fff; border-radius: 50%; color: #fff; font-size: 8px; font-weight: 800; }
.temp-marker { display: grid; width: 31px; height: 31px; place-items: center; border: 2px solid #fff; border-radius: 50% 50% 50% 4px; color: #fff; background: var(--green); box-shadow: 0 3px 10px #173d3438; font-size: 17px; transform: rotate(-45deg); }
.temp-marker span { transform: rotate(45deg); }
.leaflet-popup-content-wrapper { padding: 0; overflow: hidden; border-radius: 9px; box-shadow: 0 5px 22px #19372a21; }
.leaflet-popup-content { margin: 0; }
.leaflet-popup-tip { box-shadow: 0 3px 7px #19372a12; }
.popup-card { width: 220px; padding: 13px; }
.popup-priority { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; color: var(--popup-color); font-size: 9px; font-weight: 700; }
.popup-description { margin: 0 0 8px; color: #2b393d; font-size: 11px; line-height: 1.45; }
.popup-details { color: #879398; font-size: 9px; line-height: 1.7; }

.report-dialog, .message-dialog { width: min(560px, calc(100vw - 28px)); max-height: min(92vh, 800px); padding: 0; overflow: auto; border: 0; border-radius: 13px; box-shadow: 0 20px 70px #10251f32; }
.report-dialog::backdrop, .message-dialog::backdrop { background: #12211fc2; backdrop-filter: blur(2px); }
.dialog-header { display: flex; justify-content: space-between; padding: 23px 26px 17px; border-bottom: 1px solid #eef1f2; }
.dialog-header h2 { margin: 0 0 5px; font-family: Manrope, sans-serif; font-size: 20px; letter-spacing: -.6px; }
.dialog-subtitle { margin: 0; color: #829095; font-size: 11px; }
.close-button { width: 30px; height: 30px; align-self: flex-start; border: 0; border-radius: 7px; color: #738085; background: #f5f7f7; font-size: 22px; line-height: 1; }
.close-button:hover { color: #243338; background: #edf1f1; }
.form-body { padding: 19px 26px 21px; }
.field-label { display: block; margin-bottom: 7px; color: #303f44; font-size: 10px; font-weight: 700; }
.required { color: var(--critical); }
.optional { color: #9aa4a8; font-size: 9px; font-weight: 400; }
textarea, select { width: 100%; border: 1px solid #e3e9ea; border-radius: 6px; outline: none; color: #28373c; background: #fff; font-size: 11px; transition: border .15s, box-shadow .15s; }
textarea { min-height: 74px; padding: 10px 11px; resize: vertical; line-height: 1.5; }
textarea::placeholder { color: #a2adb1; }
textarea:focus, select:focus { border-color: #89c7b8; box-shadow: 0 0 0 3px #13877112; }
.field-hint { display: block; margin-top: 5px; color: #9aa4a8; font-size: 9px; }
.conditional-details { margin-top: 12px; }
.conditional-details[hidden] { display: none; }
.vehicle-detail-row { padding: 9px 0; border-top: 1px solid #edf0f1; }
.vehicle-detail-heading { margin-bottom: 6px; color: #77858a; font-size: 9px; font-weight: 600; }
.vehicle-detail-inputs { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.vehicle-detail-inputs input { min-width: 0; height: 34px; padding: 0 9px; border: 1px solid #e3e9ea; border-radius: 6px; outline: none; color: #28373c; font-size: 10px; }
.vehicle-detail-inputs input:focus { border-color: #89c7b8; box-shadow: 0 0 0 3px #13877112; }
.vehicle-detail-inputs input::placeholder { color: #a2adb1; }
.priority-field { min-width: 0; margin: 18px 0; padding: 0; border: 0; }
.priority-field legend { padding: 0; }
.priority-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.priority-option { position: relative; cursor: pointer; }
.priority-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.priority-card { display: flex; min-height: 53px; align-items: center; gap: 7px; padding: 8px; border: 1px solid #e7ebec; border-radius: 7px; transition: border .15s, background .15s, box-shadow .15s; }
.priority-card > span { display: grid; gap: 3px; }
.priority-card strong { font-size: 9px; }
.priority-card small { color: #929da1; font-size: 8px; white-space: nowrap; }
.priority-option input:checked + .info-card { border-color: #8fc5e7; background: #f3f9fd; box-shadow: 0 0 0 1px #8fc5e7; }
.priority-option input:checked + .warning-card { border-color: #ebc27c; background: #fffaf0; box-shadow: 0 0 0 1px #ebc27c; }
.priority-option input:checked + .critical-card { border-color: #e5a09b; background: #fff6f5; box-shadow: 0 0 0 1px #e5a09b; }
.priority-option input:focus-visible + .priority-card { outline: 2px solid var(--green); outline-offset: 2px; }
.two-column-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field select { height: 36px; padding: 0 10px; }
.location-field { margin-top: 17px; }
.location-readout { display: flex; min-height: 35px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #e7ebec; border-radius: 6px; color: #8b979b; background: #f8faf9; font-size: 10px; }
.location-readout span:first-child { color: var(--green); font-size: 14px; }
.location-readout { width: 100%; text-align: left; cursor: pointer; }
.location-readout:hover { border-color: #b7ded4; }
.location-readout .location-action { margin-left: auto; color: var(--green); font-size: 9px; font-weight: 600; white-space: nowrap; }
.location-readout.selected { border-color: #b7ded4; color: #3b6860; background: #f2faf7; }
.location-readout.location-required { border-color: #e5a09b; color: #a54b45; background: #fff6f5; }
.current-location-option { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: #536268; font-size: 10px; cursor: pointer; }
.current-location-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--green); }
.current-location-option .optional { margin-left: auto; font-size: 8px; }
.media-field { margin-top: 17px; }
.upload-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upload-button { display: inline-flex; position: relative; align-items: center; gap: 6px; min-height: 31px; padding: 0 9px; overflow: hidden; border: 1px solid #e2e8e9; border-radius: 5px; color: #5d6c71; background: #fff; font-size: 9px; font-weight: 600; cursor: pointer; }
.upload-button:hover { border-color: #a9d2c8; color: var(--green-dark); background: #f7fbfa; }
.upload-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-note { color: #a0aaad; font-size: 8px; }
.attachment-list { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.attachment-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; border-radius: 4px; color: #56736b; background: #f0f7f5; font-size: 8px; }
.attachment-chip button { padding: 0; border: 0; color: #81928d; background: none; font-size: 12px; line-height: 1; }
.dialog-footer { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 26px; border-top: 1px solid #eef1f2; background: #fbfcfc; }
.privacy-note { display: flex; align-items: center; gap: 6px; color: #909b9f; font-size: 8px; }
.privacy-note span { color: var(--green); font-size: 13px; }
.submit-button { min-height: 36px; padding: 0 13px; font-size: 10px; }
.message-content { display: flex; flex-direction: column; align-items: center; padding: 30px; text-align: center; }
.message-icon { display: grid; width: 39px; height: 39px; place-items: center; margin-bottom: 11px; border-radius: 50%; color: var(--green); background: #eef8f5; font-size: 19px; }
.message-content h2 { margin-bottom: 7px; font-family: Manrope, sans-serif; font-size: 17px; }
.message-content p { max-width: 390px; margin-bottom: 17px; color: #77858a; font-size: 11px; line-height: 1.7; }

html[data-theme="dark"] body,
html[data-theme="dark"] .app-shell { color: #e6edef; background: #141a1f; }
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .map-legend,
html[data-theme="dark"] .map-label,
html[data-theme="dark"] .map-control,
html[data-theme="dark"] .map-drawer,
html[data-theme="dark"] .report-dialog,
html[data-theme="dark"] .message-dialog { color: #e6edef; background-color: #20282e; }
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .map-label,
html[data-theme="dark"] .map-control,
html[data-theme="dark"] .map-legend,
html[data-theme="dark"] .map-drawer,
html[data-theme="dark"] .drawer-header,
html[data-theme="dark"] .drawer-section,
html[data-theme="dark"] .drawer-detail-row,
html[data-theme="dark"] .recipient-row,
html[data-theme="dark"] .dialog-header,
html[data-theme="dark"] .dialog-footer,
html[data-theme="dark"] .sidebar-footer { border-color: #354148; }
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .meta-pill,
html[data-theme="dark"] .priority-card,
html[data-theme="dark"] .location-readout,
html[data-theme="dark"] .upload-button,
html[data-theme="dark"] .close-button,
html[data-theme="dark"] .vehicle-detail-inputs input { color: #dce5e8; background-color: #273138; border-color: #3a474e; }
html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .map-label:hover,
html[data-theme="dark"] .map-control:hover,
html[data-theme="dark"] .report-card:hover { background-color: #2b363d; }
html[data-theme="dark"] .status-strip,
html[data-theme="dark"] .dialog-footer,
html[data-theme="dark"] .empty-pin,
html[data-theme="dark"] .message-icon { color: #a8b8bc; background-color: #252f35; border-color: #37434a; }
html[data-theme="dark"] .report-card { color: #dce5e8; border-color: #354148; }
html[data-theme="dark"] .report-description,
html[data-theme="dark"] .drawer-description,
html[data-theme="dark"] .drawer-header h2,
html[data-theme="dark"] .drawer-fact strong,
html[data-theme="dark"] .drawer-section h3,
html[data-theme="dark"] .drawer-detail-row strong,
html[data-theme="dark"] .priority-card strong,
html[data-theme="dark"] .message-content h2 { color: #e6edef; }
html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .reports-sort,
html[data-theme="dark"] .report-time,
html[data-theme="dark"] .report-location,
html[data-theme="dark"] .report-meta,
html[data-theme="dark"] .drawer-muted,
html[data-theme="dark"] .drawer-fact span,
html[data-theme="dark"] .drawer-detail-row span,
html[data-theme="dark"] .field-hint,
html[data-theme="dark"] .dialog-subtitle,
html[data-theme="dark"] .privacy-note,
html[data-theme="dark"] .message-content p { color: #a3b0b5; }
html[data-theme="dark"] .filter-chip span { color: #bdc8cb; background: #354148; }
html[data-theme="dark"] .filter-chip.active { color: #71d4b8; background: #1f3a35; border-color: #3b7866; }
html[data-theme="dark"] .filter-chip.active span { color: #a3e4d3; background: #294b42; }
html[data-theme="dark"] .priority-option input:checked + .info-card { background: #203745; border-color: #5685a2; box-shadow: 0 0 0 1px #5685a2; }
html[data-theme="dark"] .priority-option input:checked + .warning-card { background: #3c3323; border-color: #ad8548; box-shadow: 0 0 0 1px #ad8548; }
html[data-theme="dark"] .priority-option input:checked + .critical-card { background: #3e2929; border-color: #ad615c; box-shadow: 0 0 0 1px #ad615c; }
html[data-theme="dark"] textarea,
html[data-theme="dark"] select { color: #e6edef; background-color: #273138; border-color: #3a474e; }
html[data-theme="dark"] textarea::placeholder,
html[data-theme="dark"] .vehicle-detail-inputs input::placeholder { color: #85949a; }
html[data-theme="dark"] .location-readout.selected { color: #b2e1d5; background: #203a34; border-color: #3b7866; }
html[data-theme="dark"] .location-readout.location-required { color: #f1a19a; background: #3e2929; border-color: #ad615c; }
html[data-theme="dark"] .upload-button:hover { color: #a3e4d3; background: #203a34; border-color: #3b7866; }
html[data-theme="dark"] .attachment-chip { color: #b2e1d5; background: #203a34; }
html[data-theme="dark"] .confirm-button { color: #a3e4d3; background: #203a34; border-color: #3b5b52; }
html[data-theme="dark"] .confirm-button:disabled { color: #98a6a4; background: #293238; border-color: #3a454a; }
html[data-theme="dark"] .map-panel,
html[data-theme="dark"] #map { background: #1c272d; }
html[data-theme="dark"] .leaflet-tile { filter: brightness(.72) saturate(.72) invert(.84) hue-rotate(180deg); }
html[data-theme="dark"] .leaflet-control-zoom a { color: #e6edef; background: #273138; border-color: #46535a; }
html[data-theme="dark"] .map-attribution { color: #c1cbce; background: #20282ed9; }
html[data-theme="dark"] .map-hint { color: #c5d0d3; background: #20282eef; border-color: #3a474e; }
html[data-theme="dark"] .drawer-grabber { background: #59676e; }
html[data-theme="dark"] .dialog-footer { background-color: #1c2429; }
html[data-theme="dark"] .emergency-link { color: #ff9388; }
html[data-theme="dark"] .emergency-link small { color: #e6aaa4; }
html[data-theme="dark"] .emergency-icon { color: #ff9388; background: #3e2929; border-color: #754441; }

@media (max-width: 760px) {
  .topbar { height: auto; min-height: 61px; padding: max(8px, env(safe-area-inset-top)) 12px 8px; gap: 8px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-copy { min-width: 0; }
  .brand-copy strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  .brand-copy strong span { display: none; }
  .brand-copy small { font-size: 6px; letter-spacing: .6px; }
  .topbar-location { display: none; }
  .topbar-actions { gap: 6px; }
  .theme-toggle { width: 40px; min-width: 40px; min-height: 40px; justify-content: center; padding: 0; }
  .theme-label { display: none; }
  .emergency-link { gap: 5px; }
  .emergency-icon { display: none; }
  .emergency-link small { font-size: 7px; }
  .emergency-link strong { font-size: 10px; white-space: nowrap; }
  .report-button { min-height: 40px; padding: 0 9px; font-size: 10px; white-space: nowrap; }
  .workspace { position: relative; flex-direction: column-reverse; }
  .map-panel { min-height: 38%; flex: 1 1 0; }
  .sidebar { width: 100%; min-width: 0; height: 52%; min-height: 220px; flex: 0 1 52%; padding: 12px 13px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-right: 0; }
  .sidebar-heading { margin-bottom: 11px; }
  .sidebar h1 { font-size: 17px; }
  .status-strip { min-height: 32px; }
  .filter-heading { margin: 13px 0 7px; }
  .priority-filters { gap: 4px; }
  .filter-chip { min-height: 36px; font-size: 10px; }
  .reports-heading { margin-top: 13px; padding-bottom: 8px; }
  .report-card { padding-top: 10px; padding-bottom: 9px; }
  .report-description { margin-bottom: 6px; font-size: 10px; }
  .report-location { margin-bottom: 5px; }
  .map-top-controls { top: 10px; left: 10px; right: 10px; }
  .map-hint { bottom: 55px; max-width: calc(100% - 20px); padding: 8px 10px; font-size: 9px; white-space: normal; }
  .map-legend { bottom: 12px; left: 8px; gap: 7px; padding: 8px; font-size: 9px; }
  .legend-title { display: none !important; }
  .map-drawer { right: 8px; bottom: 8px; width: calc(100% - 16px); max-height: 78%; }
  .drawer-header { padding: 10px 12px 8px; }
  .drawer-content { padding: 9px 12px 12px; }
  .drawer-grabber { display: block; width: 34px; height: 3px; flex: 0 0 3px; align-self: center; margin-top: 6px; border-radius: 3px; background: #dce4e2; }
  .map-control { width: 44px; height: 44px; }
  .leaflet-control-zoom a { width: 42px !important; height: 42px !important; line-height: 42px !important; font-size: 22px !important; }
  .report-card { min-height: 74px; padding-top: 11px; padding-bottom: 11px; }
  .report-time, .report-location, .report-meta { font-size: 10px; }
  .map-attribution { max-width: 55%; font-size: 7px; }
  .form-body { max-height: calc(100dvh - 175px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .report-dialog, .message-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 24px); }
  .report-dialog { display: flex; height: calc(100dvh - 24px); flex-direction: column; overflow: hidden; }
  .report-dialog form { display: flex; min-height: 0; flex: 1; flex-direction: column; }
  .report-dialog .dialog-header, .report-dialog .dialog-footer { flex: 0 0 auto; }
  .report-dialog .form-body { min-height: 0; max-height: none; flex: 1 1 auto; }
  .report-dialog textarea, .report-dialog select, .report-dialog .vehicle-detail-inputs input { font-size: 16px; }
  .priority-card { min-height: 60px; }
  .upload-button { min-height: 40px; font-size: 10px; }
  .close-button { width: 40px; height: 40px; }
  .confirm-button { min-height: 36px; font-size: 9px; }
  .sidebar-footer { min-height: 35px; }
}
@media (max-width: 430px) {
  .topbar { padding-right: 8px; padding-left: 8px; }
  .brand { min-width: 0; flex: 1 1 auto; gap: 6px; }
  .brand-mark { flex: 0 0 32px; width: 32px; height: 32px; }
  .brand-copy strong { font-size: 13px; }
  .brand-copy small { font-size: 5px; letter-spacing: .5px; }
  .topbar-actions { flex: 0 0 auto; gap: 4px; }
  .theme-toggle { width: 36px; min-width: 36px; min-height: 40px; }
  .emergency-link strong { font-size: 9px; }
  .emergency-link small { font-size: 6px; }
  .report-button { gap: 4px; padding: 0 8px; }
  .map-legend { gap: 6px; }
  .map-legend > span { gap: 4px; font-size: 7px; }
  .priority-options { gap: 5px; }
  .priority-card { gap: 5px; padding: 6px; }
  .priority-card strong { font-size: 8px; }
  .priority-card small { font-size: 7px; white-space: normal; }
  .two-column-fields, .vehicle-detail-inputs { grid-template-columns: 1fr; gap: 8px; }
  .current-location-option { flex-wrap: wrap; }
  .current-location-option .optional { margin-left: 21px; }
  .dialog-header, .form-body { padding-right: 17px; padding-left: 17px; }
  .dialog-footer { padding-right: 17px; padding-left: 17px; }
}

@media (max-width: 900px) and (max-height: 500px) {
  .topbar { min-height: 52px; padding-top: 4px; padding-bottom: 4px; }
  .brand-mark { width: 30px; height: 30px; }
  .topbar-actions .theme-toggle,
  .topbar-actions .report-button { min-height: 36px; }
  .sidebar { height: 47%; min-height: 150px; flex-basis: 47%; padding-top: 7px; }
  .sidebar-heading { margin-bottom: 6px; }
  .status-strip { min-height: 27px; }
  .filter-heading { margin: 8px 0 5px; }
  .reports-heading { margin-top: 8px; }
  .map-panel { min-height: 32%; }
  .map-drawer { max-height: 88%; }
  .report-dialog { height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); }
}
