:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f4f8;
  --panel: #ffffff;
  --text: #132238;
  --muted: #667386;
  --border: #dde5ee;
  --accent: #e66f2d;
  --accent-2: #173052;
  --good: #15945c;
  --warn: #d49317;
  --bad: #d83b3b;
  --blue: #2a6fb3;
  --shadow: 0 18px 42px rgba(22, 37, 58, 0.1);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e141c;
  --surface: #151e28;
  --surface-2: #1d2935;
  --panel: #111923;
  --text: #eef4fa;
  --muted: #9cabba;
  --border: #263746;
  --accent: #ff781f;
  --accent-2: #8fb2d8;
  --good: #31c87d;
  --warn: #f0a62d;
  --bad: #f06464;
  --blue: #6ca8e4;
  --shadow: 0 24px 56px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

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

button,
input,
select,
textarea {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ops-shell {
  width: min(1480px, calc(100vw - 24px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 0 12px;
}

.ops-topbar,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.ops-brand,
.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.brand-logo {
  width: 170px;
  height: 62px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 5px;
}

html[data-theme="dark"] .brand-logo {
  background: color-mix(in srgb, var(--panel) 90%, white 10%);
}

.ops-brand h1,
.brand-copy h1 {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: 0;
}

.ops-brand p,
.brand-copy p,
.panel-title p,
.field-control span,
.filter-group > span,
.detail-empty p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.system-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  flex: 1;
  gap: 8px;
  min-width: 440px;
}

.health-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  flex: 1;
  gap: 8px;
  min-width: 360px;
}

.health-card,
.health-chip {
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.health-card strong,
.health-chip strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.health-card span,
.health-chip {
  color: var(--muted);
  font-size: 11px;
}

.weather-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.weather-main {
  min-width: 0;
}

.weather-main strong {
  display: block;
  font-size: 13px;
}

.weather-main span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.weather-temp {
  text-align: right;
}

.weather-temp strong {
  display: block;
  font-size: 22px;
}

.weather-icon {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 32px;
  flex: 0 0 auto;
}

.weather-sun,
.weather-moon,
.weather-cloud,
.weather-rain,
.weather-bolt {
  position: absolute;
  display: block;
}

.weather-sun {
  top: 3px;
  left: 4px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #ffd84a;
  box-shadow: 0 0 0 4px rgba(255, 216, 74, 0.18);
}

.weather-moon {
  top: 2px;
  left: 5px;
  width: 22px;
  height: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 242, 168, 0.65);
  border-radius: 50%;
  background: #fff0a8;
  box-shadow: 0 0 10px rgba(255, 240, 168, 0.26);
}

.weather-moon::after {
  content: "";
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 24px;
  border-radius: 50%;
  background: var(--surface);
}

.weather-icon.phase-new .weather-moon {
  background: #516071;
  box-shadow: none;
}

.weather-icon.phase-new .weather-moon::after,
.weather-icon.phase-full .weather-moon::after {
  display: none;
}

.weather-icon.phase-waxing-crescent .weather-moon::after {
  left: 7px;
  right: auto;
}

.weather-icon.phase-first-quarter .weather-moon::after {
  left: 11px;
  right: auto;
}

.weather-icon.phase-waxing-gibbous .weather-moon::after {
  left: 17px;
  right: auto;
}

.weather-icon.phase-waning-gibbous .weather-moon::after {
  left: auto;
  right: 17px;
}

.weather-icon.phase-last-quarter .weather-moon::after {
  left: auto;
  right: 11px;
}

.weather-icon.phase-waning-crescent .weather-moon::after {
  left: auto;
  right: 7px;
}

.weather-cloud {
  left: 8px;
  bottom: 6px;
  width: 27px;
  height: 12px;
  border-radius: 999px;
  background: #d3d7dc;
  box-shadow:
    7px -7px 0 -1px #d3d7dc,
    15px -3px 0 -2px #d3d7dc;
}

.weather-rain {
  left: 14px;
  bottom: 0;
  width: 3px;
  height: 7px;
  border-radius: 999px;
  background: #4b94d6;
  box-shadow:
    8px 0 0 #4b94d6,
    16px 0 0 #4b94d6;
  transform: skewX(-12deg);
}

.weather-bolt {
  right: 6px;
  bottom: 0;
  width: 8px;
  height: 13px;
  background: #f4bd2f;
  clip-path: polygon(42% 0, 100% 0, 64% 43%, 100% 43%, 25% 100%, 44% 55%, 0 55%);
}

.weather-icon.day .weather-moon,
.weather-icon.night .weather-sun,
.weather-icon.condition-clear .weather-cloud,
.weather-icon.condition-clear .weather-rain,
.weather-icon.condition-clear .weather-bolt,
.weather-icon.condition-partly .weather-rain,
.weather-icon.condition-partly .weather-bolt,
.weather-icon.condition-cloud .weather-sun,
.weather-icon.condition-cloud .weather-rain,
.weather-icon.condition-cloud .weather-bolt,
.weather-icon.condition-rain .weather-sun,
.weather-icon.condition-storm .weather-sun,
.weather-icon.condition-rain .weather-bolt {
  display: none;
}

.weather-icon.day.condition-clear .weather-cloud,
.weather-icon.night.condition-clear .weather-cloud {
  display: none;
}

.weather-icon.night.condition-cloud .weather-cloud,
.weather-icon.night.condition-rain .weather-cloud,
.weather-icon.night.condition-storm .weather-cloud,
.weather-icon.night.condition-partly .weather-cloud {
  background: #c7ced7;
  box-shadow:
    7px -7px 0 -1px #c7ced7,
    15px -3px 0 -2px #c7ced7;
}

.top-actions,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-link,
.theme-toggle,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
}

.report-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.report-button:hover {
  border-color: color-mix(in srgb, var(--accent) 82%, #000);
  background: color-mix(in srgb, var(--accent) 88%, #000);
}

.theme-toggle {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #fff;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.ops-filters {
  display: grid;
  grid-template-columns: 160px minmax(340px, 1fr) minmax(280px, 0.8fr) 260px;
  gap: 14px;
  align-items: end;
  padding: 14px 0;
}

.field-control,
.search-control {
  display: grid;
  gap: 6px;
}

.field-control select,
.search-control input,
.report-form input,
.report-form select,
.report-form textarea {
  width: 100%;
  min-height: 40px;
  min-width: 0;
  border-radius: var(--radius);
  padding: 0 10px;
  font-size: 13px;
}

.filter-group {
  display: grid;
  gap: 6px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip,
.status-filter {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
}

.filter-chip.active,
.status-filter.active {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #fff;
}

.ops-grid {
  display: grid;
  grid-template-columns: 350px minmax(380px, 1fr) 330px;
  grid-template-rows: calc(100vh - 178px);
  gap: 12px;
}

.ops-panel,
.filter-rail,
.map-panel,
.events-panel,
.detail-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
}

.panel-title.compact {
  padding: 0 0 8px;
}

.panel-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 820;
  letter-spacing: 0;
}

.panel-title > span,
.cluster-toggle {
  color: var(--muted);
  font-size: 12px;
}

.event-panel {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
}

.event-table-head {
  display: grid;
  grid-template-columns: 1fr 68px 76px 50px;
  gap: 6px;
  padding: 0 12px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.event-list {
  min-height: 0;
  overflow: auto;
  padding: 0 10px;
}

.event-row {
  display: grid;
  grid-template-columns: 1fr 64px 78px 46px;
  gap: 6px;
  width: 100%;
  min-height: 64px;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: var(--radius);
  text-align: left;
  background: var(--surface);
}

.event-row.active {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  box-shadow: inset 3px 0 0 var(--blue);
}

.event-row:disabled,
.event-row[aria-disabled="true"] {
  cursor: default;
  opacity: 0.82;
}

.hmo-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: min(340px, calc(100vw - 24px));
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 94%, #000 6%);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity 120ms ease, transform 120ms ease;
  visibility: hidden;
}

.hmo-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.event-main {
  min-width: 0;
}

.event-main strong,
.event-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-main strong {
  font-size: 12px;
}

.event-main span,
.event-time {
  color: var(--muted);
  font-size: 11px;
}

.status-pill,
.severity-pill,
.dataset-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.pending { color: var(--warn); }
.status-pill.needs_review { color: var(--accent); }
.status-pill.validated { color: var(--good); }
.status-pill.rejected { color: var(--bad); }
.status-pill.merged { color: var(--blue); }

.severity-pill.baja,
.dot.baja { color: var(--blue); background: #58b97a; }
.severity-pill.media,
.dot.media { color: var(--warn); background: #f2b039; }
.severity-pill.alta,
.dot.alta { color: var(--bad); background: #ef4b4b; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--border);
}

.summary-item {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.summary-item strong {
  display: block;
  font-size: 16px;
}

.summary-item span {
  color: var(--muted);
  font-size: 10px;
}

.map-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.leaflet-host {
  position: relative;
  height: 100%;
  min-height: 420px;
  margin: 0 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  z-index: 400;
}

.map-empty.hidden {
  display: none;
}

.leaflet-div-icon {
  border: 0;
  background: transparent;
}

.ios-location-pin {
  position: relative;
  width: 34px;
  height: 42px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.28));
}

.ios-location-pin::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: #1f5d9d;
  transform: rotate(-45deg);
}

.ios-location-pin span {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #61b7ff;
  transform: translateX(-50%);
}

.map-pin {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.26);
  transform: rotate(-45deg);
}

.map-pin span {
  transform: rotate(45deg);
}

.map-pin.pending,
.map-pin.needs_review { background: var(--warn); }
.map-pin.validated { background: var(--good); }
.map-pin.rejected { background: var(--bad); }
.map-pin.active { outline: 4px solid color-mix(in srgb, var(--blue) 32%, transparent); }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 11px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-radius: 50%;
}

.detail-panel {
  overflow: hidden;
  padding: 0;
}

.detail-empty {
  height: 100%;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
}

.detail-empty h2 {
  margin: 0;
  font-size: 18px;
}

#detailTitle strong {
  font-weight: 900;
}

.hidden {
  display: none !important;
}

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 0 12px 12px;
  overflow: auto;
}

.detail-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.detail-list,
.meta-grid,
.job-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.detail-list div,
.meta-grid div,
.job-meta div {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.detail-list dt,
.meta-grid dt,
.job-meta dt {
  color: var(--muted);
  font-size: 10px;
}

.detail-list dd,
.meta-grid dd,
.job-meta dd {
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.evidence-frame {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.evidence-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.evidence-actions,
.validation-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
}

.evidence-actions button,
.validation-actions button {
  min-height: 36px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  font-size: 11px;
  font-weight: 780;
}

.validation-actions {
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.validation-actions button[data-status="validated"] { color: var(--good); }
.validation-actions button[data-status="needs_review"] { color: var(--warn); }
.validation-actions button[data-status="rejected"] { color: var(--bad); }

.dedupe-box {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ops-sidepanel,
.dark-preview {
  min-height: 0;
  overflow: auto;
  border-radius: var(--radius);
  background: #0f1722;
  color: #d8e3ee;
  padding: 14px;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #cbd6e2;
  font-size: 12px;
  font-weight: 760;
}

.mini-toggle {
  width: 38px;
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}

.preview-logo {
  width: 100%;
  max-height: 148px;
  object-fit: contain;
  margin: 14px 0;
  border: 1px solid #203044;
  border-radius: var(--radius);
  background: #111923;
}

.dark-card,
.camera-card {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #203044;
  border-radius: var(--radius);
  background: #131d29;
}

.dark-card h2 {
  margin: 0 0 10px;
  font-size: 13px;
}

.camera-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: #0a111a;
}

.side-statuses,
#sideHealth {
  display: grid;
  gap: 7px;
  color: #aebdca;
  font-size: 12px;
}

#adminSideHealth,
#adminSideHealth .side-row,
#adminSideHealth .side-row span,
#adminSideHealth .side-row strong {
  color: #ffffff;
}

.side-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-logo {
  width: 220px;
  max-width: 100%;
  object-fit: contain;
  justify-self: center;
}

.login-copy {
  text-align: center;
}

.login-copy h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.login-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.login-error {
  display: none;
  margin: 0;
  color: var(--bad);
  font-size: 12px;
  text-align: center;
}

.login-error.visible {
  display: block;
}

.ops-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.app-shell {
  width: min(1280px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 24px;
}

.section-heading,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
}

.section-heading span,
.panel-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 820;
}

.panel-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.primary-button {
  min-height: 42px;
  border: 1px solid var(--accent-2);
  border-color: var(--accent-2);
  border-radius: var(--radius);
  background: var(--accent-2);
  color: #fff;
  font-size: 13px;
  font-weight: 780;
}

.secondary-button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-color: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 780;
}

.progress-box,
.upload-progress {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, var(--border));
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 160ms ease;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.progress-meta strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.report-shell,
.public-shell {
  width: min(1120px, calc(100vw - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 24px;
}

.report-grid,
.public-grid {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 14px;
}

.report-form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.evidence-upload {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.evidence-drop {
  min-height: 132px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.evidence-drop strong {
  color: var(--text);
  font-size: 13px;
}

.evidence-drop p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.evidence-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.file-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  cursor: pointer;
}

.report-form .primary-button.file-action {
  color: #fff;
}

.file-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.photo-thumb {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  aspect-ratio: 1;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(19, 34, 56, 0.82);
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

.report-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.report-form textarea {
  min-height: 94px;
  padding: 10px;
  resize: vertical;
}

.report-map,
.public-map {
  height: min(64vh, 620px);
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.report-actions {
  display: flex;
  gap: 8px;
}

.report-status {
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
}

.report-status.warn {
  color: var(--warn);
}

@media (max-width: 1240px) {
  .ops-topbar,
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .system-cards {
    order: 3;
    min-width: 100%;
  }

  .ops-grid {
    grid-template-columns: 340px minmax(380px, 1fr) 320px;
    grid-template-rows: 540px 360px;
  }

  .ops-sidepanel,
  .dark-preview {
    grid-column: 1 / -1;
  }

  .ops-filters {
    grid-template-columns: 160px 1fr;
  }
}

@media (max-width: 860px) {
  .ops-shell,
  .app-shell,
  .report-shell,
  .public-shell {
    width: min(100vw - 16px, 760px);
  }

  .ops-filters,
  .ops-grid,
  .report-grid,
  .public-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .system-cards,
  .health-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-logo {
    width: 138px;
    height: 52px;
  }

  .ops-brand h1,
  .brand-copy h1 {
    font-size: 22px;
  }

  .event-panel,
  .detail-panel,
  .leaflet-host,
  .report-map,
  .public-map {
    min-height: clamp(360px, 64vh, 560px);
  }

  .ops-footer {
    display: grid;
  }
}

@media (max-width: 560px) {
  .top-actions,
  .topbar-actions,
  .chip-row,
  .report-actions {
    flex-wrap: wrap;
  }

  .evidence-buttons { grid-template-columns: 1fr; }

  .photo-preview-grid { grid-template-columns: 1fr 1fr; }

  .system-cards,
  .health-strip,
  .detail-list,
  .meta-grid,
  .job-meta,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .weather-card {
    grid-column: 1;
  }

  .event-table-head {
    display: none;
  }

  .event-row {
    grid-template-columns: 1fr;
  }
}
