:root {
  --gold: #d4af37;
  --gold-rgb: 212, 175, 55;
  --gold-ink: #0b1f33;
  --gold-soft: #f7f0dc;
  --gold-surface: linear-gradient(105deg, #bb9029 0%, #d4af37 23%, #f2dfa0 46%, #d4af37 68%, #c39a2f 100%);
  color-scheme: light;
  --bg: #e8eef5;
  --panel: #f8fafc;
  --panel-2: #eef4fa;
  --text: #122033;
  --muted: #64748b;
  --accent: #c1121f;
  --accent-2: var(--gold);
  --border: #cbd5e1;
  --navy: #0b1f33;
  --panel-navy: #102a43;
  --red: #c1121f;
  --dark-red: #8f0d18;
  --orange: #f05a28;
  --yellow: var(--gold);
  --soft-yellow: var(--gold-soft);
  --soft-red: #fde2e2;
  --soft-card: #f8fafc;
  --green: #34d399;
  --blue: #5aa9ff;
  --planning-blue: #1683dc;
  --purple: #b388ff;
  --gray: #8fa2b8;
  --black: #0f172a;
  --hazmatiq-font-body: "Bahnschrift", "DIN Alternate", "DejaVu Sans Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --hazmatiq-font-heading: "Black Ops One", "Stencil Std", Copperplate, "Bahnschrift Condensed", "DejaVu Sans Condensed", Impact, sans-serif;
  --hazmatiq-text-body: 0.9375rem;
  --hazmatiq-text-small: 0.8rem;
  --hazmatiq-text-section: 1.125rem;
  --hazmatiq-card-padding: 14px;
  --hazmatiq-gap-small: 8px;
  --hazmatiq-gap-card: 10px;
  /* Optional future experiment: change --hazmatiq-font-body to this serif stack. */
  --hazmatiq-font-serif-experiment: Georgia, "Times New Roman", Times, serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body {
  margin: 0;
  font-family: var(--hazmatiq-font-body);
  font-weight: 400;
  font-size: var(--hazmatiq-text-body);
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}
/* Command-header refinement cascade lock. */
.layout > .sidebar { display: none; }

.hazmat-command-bar.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(300px, 0.8fr) minmax(520px, 1.35fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 84px;
  padding: 8px 12px;
  overflow: visible;
  border: 1px solid var(--hazmat-border);
  border-radius: 14px;
  background:
    radial-gradient(circle at 82% 20%, rgba(46, 140, 255, 0.2), transparent 34%),
    linear-gradient(90deg, var(--hazmat-navy) 0%, var(--hazmat-navy-2) 58%, var(--hazmat-card) 100%);
  color: var(--hazmat-text);
  box-shadow: 0 10px 28px rgba(6, 26, 46, 0.24);
}
.hazmat-command-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hazmat-command-bar .brand-logo {
  width: clamp(142px, 12vw, 184px);
  max-width: 184px;
  height: 56px;
  object-fit: contain;
}

.hazmat-command-incident {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding-left: 9px;
  border-left: 1px solid var(--hazmat-border);
}

.hazmat-command-incident span,
.hazmat-command-incident small {
  color: var(--hazmat-muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hazmat-command-incident strong {
  max-width: 170px;
  overflow: hidden;
  color: var(--hazmat-text);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hazmat-command-context.notification-center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.hazmat-command-context .notification-feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.hazmat-command-context .notification-item {
  min-height: 48px;
  padding: 5px 8px;
  border: 1px solid var(--hazmat-border);
  border-radius: 9px;
  background: rgba(16, 42, 67, 0.9);
}

.hazmat-command-context .notification-item > span {
  color: var(--hazmat-yellow);
  font-size: 0.58rem;
  font-weight: 900;
}

.hazmat-command-context .notification-item > strong,
.hazmat-command-context .notification-updated {
  color: var(--hazmat-text);
  font-size: 0.68rem;
  font-weight: 800;
}

.hazmat-command-context .notification-system {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.hazmat-command-context .notification-system > span { grid-column: 1; }
.hazmat-command-context .notification-system > time { grid-column: 2; grid-row: 1; justify-self: end; }
.hazmat-command-context .notification-system > strong { grid-column: 1 / -1; }

.hazmat-command-context .notification-alert-count,
.hazmat-command-context .notification-details-btn,
.hazmat-command-context .notification-ack-btn {
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--hazmat-border);
  border-radius: 8px;
  background: var(--hazmat-card-2);
  color: var(--hazmat-text);
  font-size: 0.68rem;
  font-weight: 900;
  cursor: pointer;
}

.hazmat-command-nav.module-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(74px, 1fr));
  gap: 5px;
  min-width: 0;
}

.hazmat-command-nav .module-btn,
.hazmat-nav-button {
  min-width: 0;
  min-height: 31px;
  padding: 4px 7px;
  border: 1px solid var(--hazmat-border);
  border-radius: 8px;
  background: var(--hazmat-card);
  color: var(--hazmat-text);
  font-size: 0.67rem;
  font-weight: 900;
  line-height: 1.12;
  text-decoration: none;
  white-space: normal;
}

.hazmat-command-nav .module-btn:hover,
.hazmat-command-nav .module-btn:focus-visible {
  border-color: var(--hazmat-blue);
  background: var(--hazmat-card-2);
  color: #fff;
  transform: translateY(-1px);
}

.hazmat-command-nav .module-btn.active {
  border-color: var(--hazmat-yellow);
  background: var(--gold-surface);
  color: var(--hazmat-navy-2) !important;
  box-shadow: 0 0 0 2px rgba(var(--gold-rgb), 0.15);
}

.hazmat-command-bar .department-logo {
  width: 50px;
  height: 50px;
}

.content-area > .view.active:not(#plume):not(#map) {
  display: grid;
  gap: 12px;
}

.hazmat-page { min-width: 0; }

.hazmat-page-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  min-height: 178px;
  margin: 0 0 12px;
  padding: 20px 22px;
  overflow: hidden;
  border: 1px solid var(--hazmat-border);
  border-radius: 16px;
  background:
    radial-gradient(circle at 78% 30%, rgba(46, 140, 255, 0.25), transparent 34%),
    radial-gradient(circle at 20% 80%, rgba(var(--gold-rgb), 0.14), transparent 28%),
    linear-gradient(135deg, var(--hazmat-navy) 0%, var(--hazmat-navy-2) 52%, var(--hazmat-card) 100%);
  color: var(--hazmat-text);
  box-shadow: 0 14px 30px rgba(6, 26, 46, 0.22);
}

.hazmat-page-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(rgba(64, 107, 145, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 107, 145, 0.13) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(90deg, transparent 15%, #000 58%);
  pointer-events: none;
}

.hazmat-page-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 8%;
  width: 230px;
  height: 110px;
  border: 2px solid rgba(221, 231, 242, 0.15);
  border-radius: 48% 52% 44% 56%;
  box-shadow:
    0 0 0 14px rgba(46, 140, 255, 0.07),
    0 0 0 30px rgba(var(--gold-rgb), 0.035),
    0 0 0 48px rgba(193, 18, 31, 0.025);
  transform: rotate(-8deg);
  pointer-events: none;
}

.hazmat-page-hero-compact,
.hazmat-page-hero.compact {
  min-height: 112px;
  padding: 13px 17px;
}

.hazmat-page-hero-content {
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 850px;
}

.hazmat-hero-eyebrow {
  margin: 0;
  color: var(--hazmat-yellow) !important;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hazmat-hero-title {
  margin: 5px 0 7px;
  color: var(--hazmat-text) !important;
  font-family: var(--hazmatiq-font-heading);
  font-size: clamp(1.9rem, 3.4vw, 3.65rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
}

.hazmat-page-hero-compact .hazmat-hero-title,
.hazmat-page-hero.compact .hazmat-hero-title {
  font-size: clamp(1.45rem, 2.4vw, 2.25rem);
}

.hazmat-hero-subtitle {
  max-width: 760px;
  margin: 0;
  color: var(--hazmat-text-2) !important;
  font-size: clamp(0.88rem, 1.25vw, 1.02rem);
  line-height: 1.4;
}

.hazmat-hero-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.hazmat-hero-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--hazmat-border);
  border-radius: 999px;
  background: rgba(16, 42, 67, 0.9);
  color: var(--hazmat-text) !important;
  font-size: 0.72rem;
  font-weight: 800;
}

.hazmat-hero-diamond {
  border-radius: 0;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.variant-chemical {
  background:
    radial-gradient(circle at 76% 32%, rgba(46, 140, 255, 0.24), transparent 32%),
    radial-gradient(circle at 88% 64%, rgba(var(--gold-rgb), 0.13), transparent 30%),
    linear-gradient(135deg, var(--hazmat-navy) 0%, var(--hazmat-navy-2) 52%, var(--hazmat-card) 100%);
}

.variant-guided-response { border-left: 5px solid var(--hazmat-red); }
.variant-reports { border-left: 5px solid var(--hazmat-yellow); }
.variant-monitoring { border-left: 5px solid var(--hazmat-blue); }
.variant-my-chemicals { border-left: 5px solid #34d399; }

.hazmat-panel,
.hazmat-card {
  border: 1px solid var(--hazmat-border);
  border-radius: 14px;
  background: var(--hazmat-card);
  color: var(--hazmat-text);
}

.hazmat-action-button {
  border: 1px solid var(--hazmat-border);
  border-radius: 9px;
  background: var(--hazmat-card-2);
  color: var(--hazmat-text);
}

.hazmat-graphic-grid,
.hazmat-contour-overlay { pointer-events: none; }

#monitor .monitor-simulated-label {
  border-color: var(--hazmat-yellow);
  background: rgba(var(--gold-rgb), 0.12);
  color: var(--hazmat-yellow) !important;
}

#chemical-id-results .chemical-profile-toolbar {
  border-color: var(--hazmat-border);
  background: var(--hazmat-navy-2);
  color: var(--hazmat-text);
}

#chemical-id-results .chemical-profile-header-card {
  border: 1px solid var(--hazmat-border);
  border-top: 5px solid var(--hazmat-blue);
}

button, input, select, textarea, table {
  font-family: var(--hazmatiq-font-body);
}

label {
  font-weight: 600;
}

button {
  font-weight: 600;
  line-height: 1.2;
}

input, select, textarea, table {
  font-weight: 400;
}

input, select, textarea {
  line-height: 1.4;
}

input::placeholder,
textarea::placeholder {
  font-weight: 400;
}

.app-shell {
  min-height: 100vh;
  padding: var(--app-top-space, 8px);
  background: #d4d6d8;
}

.topbar, .sidebar-card, .panel-card, .hero-card, .map-placeholder, .footer-note, .alert-banner {
  border: 1px solid var(--border);
  background: rgba(239, 241, 243, 0.97);
  box-shadow: 0 10px 28px rgba(45, 51, 57, 0.12);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-radius: 18px;
  overflow: hidden;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: clamp(300px, 40vw, 480px);
  max-width: calc(100vw - 104px);
  height: clamp(72px, 9.5vw, 112px);
  object-fit: cover;
  object-position: center;
}

.brand-emblem {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 4px solid #111;
  background: #111;
  box-shadow: 7px 7px 0 rgba(32, 35, 39, 0.14);
  transform: rotate(45deg);
  overflow: hidden;
}

.nfpa-cell {
  display: grid;
  place-items: center;
}

.nfpa-cell > span {
  color: #fff;
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 950;
  transform: rotate(-45deg);
}

.nfpa-health { background: #005baa; }
.nfpa-fire { background: #e31b23; }
.nfpa-reactivity { background: #ffd100; }
.nfpa-reactivity > span { color: #16181b; }
.nfpa-special { background: #fff; }
.nfpa-special > span {
  color: #1769aa;
  text-decoration: line-through;
  text-decoration-color: #1769aa;
}

.brand-lockup {
  display: grid;
  gap: 2px;
}

.brand-name {
  display: flex;
  align-items: baseline;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 0.9;
  font-weight: 950;
  font-style: italic;
  letter-spacing: -0.075em;
  transform: skewX(-4deg);
}

.brand-name > span {
  color: var(--text);
  -webkit-text-stroke: 0.6px #b20f16;
  paint-order: stroke fill;
}
.brand-name strong {
  margin-left: 0.1em;
  color: var(--yellow);
  font-weight: 1000;
  text-shadow:
    1px 1px 0 #f05a28,
    2px 2px 0 var(--red),
    3px 3px 0 #9f1016,
    4px 4px 2px rgba(32, 35, 39, 0.24);
}

.brand-tagline {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.department-logo-link {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  line-height: 0;
  background: transparent;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.department-logo-link:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 5px 8px rgba(32, 35, 39, 0.18));
}

.department-logo-link:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

.department-logo {
  display: block;
  width: clamp(56px, 5vw, 68px);
  height: clamp(56px, 5vw, 68px);
  object-fit: contain;
  background: transparent;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.74rem;
  color: #a70f16;
  margin: 0 0 6px;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, h4,
.box-title,
.notification-center-title {
  font-family: var(--hazmatiq-font-heading);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}
h1 { font-weight: 800; }
.brand-name { font-family: var(--hazmatiq-font-heading); }

.topbar h1 { margin: 0; font-size: 2rem; line-height: 1.1; font-weight: 800; }
.topbar-actions, .button-row { display: flex; gap: 12px; flex-wrap: wrap; }

.alert-banner {
  margin: 16px 0;
  padding: 14px 18px;
  border-left: 5px solid var(--yellow);
  background: linear-gradient(90deg, rgba(227, 32, 39, 0.12), rgba(239, 241, 243, 0.98) 40%);
  border-radius: 14px;
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 6px;
}

.sidebar-card {
  padding: 16px;
  border-radius: 16px;
  margin-bottom: 16px;
}

.layout:has(#plume.active) .sidebar {
  position: relative;
  z-index: 3;
}

.module-nav {
  display: grid;
  gap: 10px;
}

.module-btn, .primary-btn, .ghost-btn, .accent-btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.module-btn:hover, .primary-btn:hover, .ghost-btn:hover, .accent-btn:hover {
  transform: translateY(-1px);
  border-color: var(--yellow);
}

.module-btn, .primary-btn, .ghost-btn, .accent-btn {
  min-height: 46px;
}

.module-btn.active {
  background: var(--gold-surface);
  color: #1c1714;
  font-weight: 700;
}

.home-logo-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.home-nav-emblem {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border: 1px solid #111;
  background: #111;
  transform: rotate(45deg);
}

.home-nav-cell {
  display: grid;
  place-items: center;
}

.home-nav-cell > span {
  color: #fff;
  font-size: 0.55rem;
  font-weight: 950;
  line-height: 1;
  transform: rotate(-45deg);
}

.home-nav-health { background: #005baa; }
.home-nav-fire { background: #e31b23; }
.home-nav-reactivity { background: #ffd100; }
.home-nav-reactivity > span { color: #111; }
.home-nav-special { background: #fff; }
.home-nav-special > span {
  color: #1769aa;
  text-decoration: line-through;
}

.home-nav-brand {
  color: var(--text);
  font-weight: 900;
  letter-spacing: 0.02em;
  transform: scaleX(1.12);
  transform-origin: left center;
}

.home-nav-brand strong {
  color: #b20f16;
}

.my-chemicals-nav {
  color: var(--gold) !important;
  font-style: italic;
  font-weight: 700;
}

.primary-btn { background: var(--red); font-weight: 700; }
.ghost-btn { background: var(--panel-2); border-color: #745f52; }
.accent-btn { background: linear-gradient(105deg, #b70e16, var(--red)); font-weight: 700; }

.content-area { min-width: 0; }
.view { display: none; }
.view.active { display: block; }

.hero-card, .panel-card, .map-placeholder {
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 18px;
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background: linear-gradient(135deg, #f3f5f6, #e4e8eb);
}

.map-hero {
  margin-bottom: 14px;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
}

.map-toolbar-title {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.map-toolbar-title span {
  color: var(--muted);
  font-size: 0.95rem;
}

.map-toolbar-actions, .map-toolbar-secondary, .map-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-toolbar-secondary {
  margin-top: 8px;
}

.map-action-row {
  margin-bottom: 16px;
}

.live-radar-panel {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(180, 218, 241, .78);
  border-radius: 10px;
  background: rgba(5, 25, 43, .94) !important;
  box-shadow: 0 10px 26px rgba(3, 14, 25, .38);
  color: #f8fafc;
  font-size: .75rem;
  pointer-events: auto;
}

.live-radar-panel-heading,
.live-radar-control-row,
.live-radar-panel label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.live-radar-panel-heading strong { color: #fff; font-size: .85rem; }
.live-radar-panel-heading span { color: var(--gold); font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.live-radar-panel label { color: #b9d0df; font-size: .7rem; }
.live-radar-panel output { color: #fff; font-weight: 800; text-align: right; }
.live-radar-panel select,
.live-radar-panel input[type="range"] { width: 100%; }
.live-radar-panel select { min-height: 30px; padding: 4px 6px; }
.live-radar-panel input[type="range"] { accent-color: var(--gold); }
.live-radar-panel .ghost-btn { min-height: 30px; padding: 4px 9px; background: #123e60; border-color: #5488aa; color: #fff; font-size: .7rem; }
.live-radar-panel small { color: #b9d0df; line-height: 1.25; }

/* Keep native radar controls legible across dark browser/OS form themes. */
#map .live-radar-panel select {
  background: #fff;
  color: #0a2236;
  font-weight: 800;
  border: 1px solid #9dafbf;
  border-radius: 5px;
}
#map .live-radar-panel select option {
  background: #fff;
  color: #0a2236;
  font-weight: 800;
}
#map .live-radar-panel select:disabled {
  background: #dce5eb;
  color: #5f7180;
  opacity: 1;
}
#map .live-radar-panel select:hover { border-color: var(--gold); }
#map .live-radar-panel select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: #0a527f;
}

.live-map-marker-dialog {
  width: min(460px, calc(100% - 24px));
  border: 1px solid #0b1f33;
  border-radius: 12px;
}

.live-map-marker-dialog form,
.live-map-marker-dialog label,
#live-monitor-fields {
  display: grid;
  gap: 6px;
}

.live-map-marker-dialog form { gap: 10px; }
.live-map-marker-dialog h3 { margin: 0; }
.live-map-marker-dialog form > div:last-child { display: flex; gap: 8px; }
.live-marker-coordinates, #live-monitor-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 620px) {
  .live-marker-coordinates, #live-monitor-fields { grid-template-columns: 1fr; }
}

.wind-arrow {
  position: absolute;
  top: 22px;
  right: 24px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(25, 184, 255, 0.16);
  border: 1px solid rgba(25, 184, 255, 0.35);
  color: var(--accent-2);
  font-weight: 700;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.compact-home {
  align-items: flex-start;
  padding: 24px;
}

.home-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.command-shell {
  display: block;
}

.command-console {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(135deg, #040a12, #0d1520);
  font-family: var(--hazmatiq-font-body);
}

.console-topbar,
.console-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  color: #7ef9ff;
}

.console-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.console-btn {
  text-align: left;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: #0f1b2b;
  border: 1px solid #2a3f59;
}

.priority-btn {
  min-height: 88px;
  padding: 16px 18px;
  font-size: 1rem;
  background: linear-gradient(135deg, #14233b, #1a365f);
  border: 2px solid #3a6aa0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.priority-btn:hover {
  background: linear-gradient(135deg, #1d3550, #23507d);
  border-color: #5ca4ff;
}

.console-btn:hover {
  background: #16253b;
}

.command-caption {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.mode-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(16, 27, 44, 0.9);
  color: var(--text);
  text-align: left;
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.mode-card span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 10px;
}

.stat-box {
  background: var(--panel-2);
  padding: 14px;
  border-radius: 12px;
  text-align: center;
}

.stat-box span { display: block; color: var(--muted); font-size: 0.8rem; }
.stat-box strong { font-size: 1rem; }

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.incident-command-snapshot {
  margin-bottom: 4px;
  padding: 6px;
  border: 2px solid #aeb5bc;
  border-radius: 16px;
  background: #f1f3f4;
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.1);
}

.command-snapshot-heading,
.command-status-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.command-snapshot-heading {
  margin-bottom: 4px;
}

.command-snapshot-heading .box-title {
  font-size: 1.1rem;
  line-height: 1;
}

.command-snapshot-heading #update-incident-location-btn {
  align-self: flex-start;
  margin-left: auto;
  min-height: 28px;
  padding: 3px 8px;
}

.command-snapshot-heading .eyebrow,
.box-title {
  margin-bottom: 0;
}

.eyebrow.box-title {
  color: #a70f16;
  font-size: 0.86rem;
  font-weight: 700;
}

.command-snapshot-provenance {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 400;
  text-align: right;
}

.command-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.command-status-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, auto) auto auto;
  gap: 3px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--border);
  border-top: 3px solid #6c757d;
  border-radius: 11px;
  background: var(--soft-card);
}

.command-chemical-card { border-top-color: #d71920; }
.command-plume-card { border-top-color: var(--gold); }
.command-ppe-card { border-top-color: #168349; }
.command-weather-card {
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-color: #2779ad;
  border-top-color: #1677b8;
}

.command-weather-refresh {
  border-color: #2779ad;
  color: #155b87;
}

.command-status-heading > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.command-status-heading > strong {
  padding: 3px 7px;
  border-radius: 999px;
  background: #e9ecef;
  font-size: 0.68rem;
  white-space: nowrap;
}

.command-status-card h4,
.command-status-card p {
  margin: 0;
}

.command-status-card h4 {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.command-status-card p {
  color: var(--muted);
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.72rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.incident-command-snapshot .command-status-card > p {
  display: none;
}

.command-weather-data {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.command-weather-row {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
}

.command-weather-row > span {
  color: var(--muted);
  white-space: nowrap;
}

.command-weather-row > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.command-status-card details {
  border-top: 1px solid #d4d8dc;
  padding-top: 2px;
  font-size: 0.74rem;
}

.command-status-card summary {
  cursor: pointer;
  font-weight: 600;
}

.command-status-card ul {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding-left: 18px;
}

.command-card-action {
  align-self: end;
  min-height: 26px;
  padding: 2px 7px;
  font-size: 0.75rem;
  font-weight: 600;
}

.incident-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.incident-input-card,
.facility-information-card {
  grid-column: 1 / -1;
  min-height: 0;
}

.incident-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 5px;
}

.incident-field {
  display: grid;
  gap: 2px;
}

.incident-field-wide {
  grid-column: span 2;
}

.incident-field-full {
  grid-column: 1 / -1;
}

.incident-field > span,
.incident-field-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.required-marker {
  color: var(--red);
  font-size: 0.72rem;
}

.incident-address-autocomplete {
  position: relative;
}

.incident-address-suggestions {
  max-height: 280px;
}

.incident-field textarea {
  min-height: 48px;
  height: auto;
  resize: none;
  font: inherit;
  font-weight: 400;
}

.incident-field[for="incident-notes"] {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
}

.incident-field[for="incident-notes"] > span,
#incident-notes {
  position: static;
  margin: 0;
  transform: none;
}

#incident-notes {
  width: 100%;
  box-sizing: border-box;
}

.incident-form-actions {
  align-items: center;
  width: 100%;
  margin-top: 8px;
}

.incident-form-actions #complete-incident-btn {
  margin-left: auto;
}

#incident-location-status {
  margin: 5px 0 0;
  font-size: 0.72rem;
}

.incident-timer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.incident-input-card {
  padding: 9px 12px;
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.18);
  overflow: visible;
}

.incident-input-card input,
.incident-input-card textarea {
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 0.82rem;
}

.incident-input-card .chemical-card-header {
  align-items: center;
  margin-bottom: 0;
}

.incident-input-card .button-row {
  gap: 7px;
}

.incident-input-card button,
.incident-input-card .status-pill {
  min-height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 0.75rem;
}

.incident-guidance-card {
  min-height: 0;
  padding: 14px;
}

.ppe-summary-card {
  border-color: #8bc99a;
  background: #e6f4ea;
  color: #0b1f33;
}

.medical-summary-card {
  border-color: #8aaedb;
  background: #e8f1ff;
  color: #0b1f33;
}

.ppe-summary-card,
.medical-summary-card {
  align-self: stretch;
}

.protective-summary-card {
  grid-column: 1 / -1;
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  color: #0b1f33;
}

.command-reference-stack .facility-information-card {
  border-color: #9aafc4;
  background: #e8eef5;
  color: #0b1f33;
}

.command-reference-stack .command-reference-panel {
  border-width: 2px;
}

.protective-summary-card .incident-guidance-list {
  grid-template-columns: 1fr;
  width: 100%;
  padding-left: 0;
  list-style: none;
}

.protective-summary-card .incident-guidance-list > li {
  min-width: 0;
  padding: 8px 10px;
}

.protective-summary-card .incident-guidance-list > li > ul {
  display: grid;
  gap: 8px;
  margin: 7px 0 0;
  padding-left: 20px;
}

.protective-summary-card .incident-guidance-list > li > ul > li {
  padding: 3px 5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.incident-guidance-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.incident-guidance-sources {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.ppe-reference-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.medical-primary-source {
  margin: 0 0 6px;
  font-size: 0.78rem;
}

.medical-reference-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-bottom: 10px;
  font-size: 0.74rem;
  font-weight: 600;
}

.incident-guidance-warning {
  margin: 8px 0 0;
  padding: 6px 8px;
  border: 1px solid var(--gold);
  border-radius: 7px;
  background: var(--gold-soft);
  color: #162231;
  font-size: 0.72rem;
  line-height: 1.35;
}

.report-tabs,
.report-section {
  margin-top: 18px;
}

.report-incident-list,
.ics-form-library {
  display: grid;
  gap: 10px;
}

.report-incident-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.report-incident-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.report-form-options {
  margin-top: 20px;
}

.incident-ics-form-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ics-form-text-link {
  width: fit-content;
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ics-form-text-link:hover,
.ics-form-text-link:focus-visible {
  color: var(--accent);
}

.incident-report-summary-heading,
.report-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.incident-report-summary-heading {
  align-items: flex-start;
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
}

.print-summary-btn {
  min-width: 48px;
  padding: 10px;
}

.print-summary-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.report-summary-block {
  margin-top: 18px;
  break-inside: avoid;
}

.report-summary-block h3 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
}

.report-summary-block dl {
  margin: 0;
}

.report-summary-row {
  padding: 6px 0;
}

.report-summary-row dt {
  color: var(--muted);
  font-weight: 700;
}

.report-summary-row dd {
  max-width: 70%;
  margin: 0;
  text-align: right;
}

.report-summary-row ul {
  margin: 0;
  padding-left: 18px;
  text-align: left;
}

.plume-map-summary img {
  display: block;
  width: 100%;
  max-height: 720px;
  border: 1px solid var(--border);
  object-fit: contain;
}

.report-edit-notice {
  margin: 16px 0 10px;
  padding: 9px 12px;
  border-left: 4px solid var(--accent);
  color: var(--navy);
  background: var(--panel-2);
  font-weight: 750;
}

.completed-report-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.completed-report-edit-grid label {
  display: grid;
  align-content: start;
  gap: 4px;
}

.completed-report-edit-grid label > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.completed-report-edit-grid input,
.completed-report-edit-grid textarea { width: 100%; }
.completed-report-edit-grid .report-edit-field-wide { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .completed-report-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ics-form-library {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.ics-form-library a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ics-pdf-preview { display: block; width: 100%; height: min(78dvh, 1000px); min-height: 360px; border: 1px solid #7893a8; border-radius: 6px; background: #e5e7eb; }
.ics-pdf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 10px 0; }
.ics-pdf-actions a { color: #fff; }
#ics-form-corrections { margin-top: 12px; }
#ics-form-corrections > summary, .incident-report-optional > summary { cursor: pointer; font-weight: 800; padding: 10px; }
@media print { .incident-report-optional { display: none !important; } }

.ics-form-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.ics-form-field {
  display: grid;
  align-content: start;
  gap: 6px;
}

.ics-form-field:has(textarea) {
  grid-column: 1 / -1;
}

.ics-form-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.ics-form-field input,
.ics-form-field textarea {
  width: 100%;
}

.ics-form-field input:disabled,
.ics-form-field textarea:disabled {
  color: var(--text);
  opacity: 1;
}

@media (max-width: 620px) {
  .ics-form-fields {
    grid-template-columns: 1fr;
  }

  .report-incident-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .completed-report-edit-grid { grid-template-columns: 1fr; }
}

@media print {
  body * {
    visibility: hidden;
  }

  #incident-report-summary,
  #incident-report-summary * {
    visibility: visible;
  }

  #incident-report-summary {
    position: absolute;
    inset: 0;
    width: 100%;
    margin: 0;
    color: #000;
    background: #fff;
  }

  #report .report-center {
    position: static;
  }

  .report-summary-actions {
    display: none;
  }

  .plume-map-summary {
    break-before: page;
  }
}

#plume .plume-weather-refresh {
  min-height: 28px;
  border: 1px solid #7996af;
  border-radius: 7px;
  padding: 3px 9px;
  background: #f8fafc;
  color: #061a2e;
  font-size: 11px;
  font-weight: 850;
}

#plume .plume-weather-section .plume-model-section-heading {
  align-items: center;
  margin-bottom: 5px;
}

#plume .plume-weather-section .plume-weather-grid {
  align-items: start;
  grid-auto-rows: auto;
}

#plume .plume-weather-section .plume-weather-review {
  border: 1px solid #d7e0e8 !important;
  border-radius: 7px !important;
  background: #f8fafc !important;
}

#plume .plume-weather-section .plume-weather-review > summary {
  padding: 1px 0;
  color: #061a2e !important;
}

/* Source-backed NFPA 704 placard. Values are populated from the selected
   Chemical Companion NFPA record; dashes explicitly represent missing data. */
#chemical-id-results .chemical-profile-header-card {
  grid-template-columns: minmax(116px, 0.22fr) minmax(0, 1fr);
  grid-template-areas:
    "placard heading"
    "placard summary"
    "placard meta";
  align-items: center;
}

.chemical-nfpa-placard {
  grid-area: placard;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  align-self: stretch;
  min-width: 108px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #39739e;
  border-radius: 10px;
  background: rgba(3, 21, 37, 0.72);
}

.chemical-nfpa-placard figcaption {
  color: #cfe6f7;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chemical-nfpa-placard small {
  max-width: 120px;
  color: #8fb4cd;
  font-size: 0.62rem;
  line-height: 1.25;
  text-align: center;
}

.nfpa-704-diamond {
  display: grid;
  grid-template-columns: repeat(2, 42px);
  grid-template-rows: repeat(2, 42px);
  gap: 2px;
  transform: rotate(45deg);
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.32));
}

.nfpa-704-cell {
  display: grid;
  place-items: center;
  border: 2px solid #f2f4f6;
  color: #fff;
  font-family: var(--hazmatiq-font-heading);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.nfpa-704-cell > b {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  transform: rotate(-45deg);
  font: inherit;
}

.nfpa-704-flammability { background: #d9252a; }
.nfpa-704-instability { background: #e6b817; color: #101820; text-shadow: none; }
.nfpa-704-health { background: #1769aa; }
.nfpa-704-special { background: #f4f5f6; color: #101820; text-shadow: none; }

.chemical-nfpa-placard[data-state="missing"] .nfpa-704-diamond {
  opacity: 0.58;
}

@media (max-width: 620px) {
  #chemical-id-results .chemical-profile-header-card {
    grid-template-columns: 1fr;
    grid-template-areas: "placard" "heading" "summary" "meta";
  }

  .chemical-nfpa-placard {
    width: 100%;
    box-sizing: border-box;
  }
}

.tier2-card {
  border-color: rgba(25, 184, 255, 0.35);
}

.facility-information-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.facility-information-heading .eyebrow,
.facility-information-heading p {
  margin-bottom: 0;
}

@media (max-width: 1200px) {
  .command-snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.facility-information-heading .big-label {
  flex: 1;
  max-width: none;
  font-weight: 900;
  text-align: center;
}

.eplan-login-form {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(220px, 0.75fr);
  gap: 6px;
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
  align-items: center;
}

.eplan-logo {
  display: block;
  width: 100%;
  height: 56px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  mix-blend-mode: multiply;
  object-fit: contain;
  object-position: left center;
  justify-self: start;
}

.eplan-login-form label {
  display: grid;
  gap: 6px;
}

.eplan-login-form label > span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
}

.eplan-login-form .primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 220px;
  min-height: 36px;
  margin-top: 0;
  border-color: #b65000;
  background: #ed7203;
  color: #fff;
  justify-self: end;
  white-space: nowrap;
}

.eplan-login-form .primary-btn:hover,
.eplan-login-form .primary-btn:focus-visible {
  border-color: #833b00;
  background: #c85d00;
}

.facility-information-card {
  padding: 10px 14px;
}

.facility-information-card .eplan-login-form {
  grid-template-columns: minmax(200px, 1fr) minmax(220px, 0.75fr);
  gap: 6px;
}

.facility-information-card .eplan-logo {
  width: 100%;
  max-width: none;
  height: 56px;
  justify-self: start;
  padding: 0;
  border-radius: 0;
  background: transparent;
  mix-blend-mode: multiply;
  object-fit: contain;
  object-position: left center;
}

.facility-information-card .eplan-login-form label {
  gap: 3px;
}

.facility-information-card .eplan-login-form .primary-btn {
  min-height: 36px;
  margin-top: 0;
}

@media (max-width: 900px) {
  .facility-information-card .eplan-logo,
  .facility-information-card .eplan-login-form .primary-btn {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .facility-information-card .eplan-login-form {
    grid-template-columns: minmax(0, 1.6fr) minmax(120px, 0.55fr);
  }

  .facility-information-card .eplan-logo {
    grid-column: 1;
    grid-row: 1;
  }

  .facility-information-card .eplan-login-form .primary-btn {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
  }

  .protective-summary-card .incident-guidance-list {
    grid-template-columns: 1fr;
  }
}

.tier2-results,
.tier2-detail {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.tier2-result-btn {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(7, 17, 31, 0.8);
  color: var(--text);
  cursor: pointer;
}

.tier2-result-btn strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-2);
}

.tier2-detail {
  padding: 12px;
  border-radius: 12px;
  background: rgba(25, 184, 255, 0.1);
  border: 1px solid rgba(25, 184, 255, 0.3);
}

.color-logic-panel {
  margin-bottom: 18px;
}

.chemical-card-grid {
  display: grid;
  gap: clamp(20px, 2vw, 32px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  width: 100%;
  margin-inline: 0;
}

.chemical-card-grid > .chemical-card-panel {
  height: 100%;
}

.chemical-id-search-card {
  z-index: 10;
  min-height: clamp(420px, 52dvh, 600px);
  display: grid;
  align-content: center;
  padding: clamp(24px, 4vw, 52px);
  margin-bottom: 12px;
  overflow: visible;
  border-color: rgba(148, 163, 184, 0.72);
  background-color: #f8fbff;
  background-image:
    linear-gradient(rgba(238, 247, 255, 0.18), rgba(238, 247, 255, 0.18)),
    url("assets/chemical-id-search-background-v2.webp");
  background-position: center, center right;
  background-size: cover, cover;
  background-repeat: no-repeat;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
}

.chemical-id-search-content {
  position: relative;
  z-index: 1;
  width: min(980px, 76%);
  margin-inline: auto;
  padding: clamp(18px, 2.5vw, 28px);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(5px);
}

.chemical-id-search-card h3 {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  text-align: center;
}

.chemical-id-search-card > :last-child {
  margin-bottom: 0;
}

@media (min-width: 720px) {
  .layout:has(#lookup.active) > .content-area,
  .layout:has(#lookup.active) #lookup.active {
    min-height: 100%;
  }

  .layout:has(#lookup.active) #lookup.active {
    display: grid;
    grid-template-rows: minmax(clamp(420px, 52dvh, 600px), 1fr) auto auto;
    align-content: stretch;
  }

  .layout:has(#lookup.active) .chemical-id-search-card {
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
  }
}

.chemical-search-types {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.84rem;
}

.chemical-search-types span {
  display: inline-flex;
  align-items: center;
}

.chemical-search-types span + span::before {
  content: "•";
  margin-right: 10px;
  color: var(--border);
}

.chemical-search-form {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(112px, auto) minmax(190px, auto);
  align-items: stretch;
  gap: 10px;
}

.chemical-search-input-wrap {
  position: relative;
}

.chemical-id-search-card #chemical-search,
.chemical-id-search-card .chemical-search-form > button {
  min-height: 54px;
  box-sizing: border-box;
}

.chemical-id-search-card #chemical-search {
  width: 100%;
  padding-inline: 16px;
  border: 2px solid #9fb1c3;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  font-size: 1rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.chemical-id-search-card #chemical-search:focus {
  outline: 3px solid rgba(var(--gold-rgb), 0.42);
  border-color: var(--navy);
}

.chemical-id-search-card .chemical-search-form > button {
  padding-inline: 18px;
  border-radius: 12px;
  white-space: nowrap;
}

.chemical-search-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 390px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid #397aa4;
  border-radius: 4px;
  background: #061a2e;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.42);
}

.chemical-suggestion {
  width: 100%;
  display: grid;
  border-radius: 3px;
  color: #fff;
}

.chemical-suggestion-select {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.chemical-suggestion:hover,
.chemical-suggestion:focus-within {
  outline: none;
  background: #103b5b;
}

.chemical-additional-transport-matches {
  margin: 6px 0 2px;
  padding: 4px;
  border: 1px solid rgba(159, 177, 195, 0.55);
  border-radius: 5px;
  background: rgba(3, 17, 31, 0.72);
}

.chemical-additional-transport-matches > summary {
  padding: 9px 10px;
  color: #f7d889;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.chemical-transport-only-note {
  margin: 2px 10px 8px;
  color: #f2c8c8;
  font-size: 0.74rem;
}

.chemical-suggestion-type {
  padding: 5px 7px;
  border-radius: 6px;
  color: #fff;
  background: var(--navy);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.chemical-suggestion.is-chemical-suggestion .chemical-suggestion-type { display: none; }
.chemical-suggestion.is-chemical-suggestion .chemical-suggestion-select { align-items: start; }
.chemical-suggestion.is-canonical-chemical-suggestion .chemical-suggestion-type { display: inline-flex; width: max-content; }
.chemical-suggestion.is-canonical-chemical-suggestion .chemical-suggestion-select { grid-template-columns: max-content minmax(0, 1fr); }

.chemical-suggestion strong,
.chemical-suggestion small {
  display: block;
}

.chemical-suggestion small {
  margin-top: 3px;
  color: #8fd9fa;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.chemical-identifier-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.chemical-identifier-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #b9c8d6;
  border-radius: 999px;
  background: #eef4fa;
  color: #173b5c;
  font-size: 0.68rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.chemical-linked-identifiers {
  margin: 0 10px 9px min(170px, 28%);
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.chemical-linked-identifiers > summary {
  color: #174f7d;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
}

.chemical-transport-warning {
  margin-top: 7px;
  padding: 6px 8px;
  border-left: 3px solid var(--red);
  background: var(--soft-red);
  color: #7f1d1d !important;
  line-height: 1.35;
}

.chemical-search-help,
.chemical-search-status {
  margin: 9px 0 0;
}

.chemical-search-status {
  min-height: 1.25em;
  font-weight: 700;
}

.chemical-search-status:empty {
  display: none;
}

.chemical-search-status[data-state="error"] { color: #a40e14; }
.chemical-search-status[data-state="success"] { color: #17603a; }

.facility-inventory {
  min-height: 0;
  margin-bottom: 18px;
  border-left: 5px solid var(--yellow);
}

.facility-chemical-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.my-chemicals-list {
  grid-template-columns: 1fr;
}

.facility-chemical-btn {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--panel-2);
  text-align: left;
  cursor: pointer;
}

.facility-chemical-btn:hover,
.facility-chemical-btn:focus-visible {
  border-color: var(--navy);
  outline: 2px solid rgba(90, 169, 255, 0.28);
}

.facility-chemical-btn strong {
  color: var(--navy);
  text-transform: capitalize;
}

.facility-chemical-btn span {
  color: var(--muted);
  font-size: 0.84rem;
}

.chemical-id-results {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  scroll-margin-top: 16px;
}

.chemical-profile-shell {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.chemical-profile-header-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-height: 0;
  margin-bottom: 0;
  padding: 10px 14px;
  border-color: #2b5d85;
  background: linear-gradient(145deg, #164a75, #0d3457);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 8px 20px rgba(13, 52, 87, 0.24);
}

.chemical-profile-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chemical-profile-header-top .eyebrow {
  margin: 0 0 2px;
  color: var(--yellow);
  font-family: var(--hazmatiq-font-heading);
  font-size: 1.08rem;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-shadow: none;
}

.chemical-profile-header-top h3 {
  margin: 0;
  color: #fff;
  font-weight: 800;
}

.chemical-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  font-size: 0.86rem;
}

.chemical-profile-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid rgba(220, 239, 255, 0.42);
  border-radius: 999px;
  background: rgba(7, 31, 54, 0.54);
}

.chemical-profile-meta-item[data-field="cas"],
.chemical-profile-meta-item[data-field="un-na"],
.chemical-profile-meta-item[data-field="erg"] {
  border-color: #c4cbd2;
  background: #e3e6e9;
}

.chemical-profile-meta-title {
  color: #dcefff;
  font-weight: 700;
}

.chemical-profile-meta-value {
  display: inline-flex;
  align-items: center;
  color: #fff;
  font-weight: 500;
}

.chemical-profile-meta-item[data-field="cas"] .chemical-profile-meta-title,
.chemical-profile-meta-item[data-field="cas"] .chemical-profile-meta-value,
.chemical-profile-meta-item[data-field="un-na"] .chemical-profile-meta-title,
.chemical-profile-meta-item[data-field="un-na"] .chemical-profile-meta-value,
.chemical-profile-meta-item[data-field="erg"] .chemical-profile-meta-title,
.chemical-profile-meta-item[data-field="erg"] .chemical-profile-meta-value {
  color: #071f36;
}

.chemical-profile-meta-item[data-field^="idlh"],
.chemical-profile-row[data-field^="idlh"],
.chemical-profile-list-row[data-field^="idlh"] {
  border-color: var(--dark-red);
  background: var(--red);
  box-shadow: none;
}

.chemical-profile-meta-item[data-field^="idlh"] .chemical-profile-meta-title,
.chemical-profile-row[data-field^="idlh"] > span,
.chemical-profile-list-row[data-field^="idlh"] strong {
  color: #fff;
  font-weight: 700;
}

.chemical-profile-meta-item[data-field^="idlh"] .chemical-profile-meta-value,
.chemical-profile-row[data-field^="idlh"] > strong,
.chemical-profile-list-row[data-field^="idlh"] span {
  color: #fff;
  font-weight: 500;
}

.chemical-profile-summary {
  margin: 0;
  color: #dcefff;
  line-height: 1.4;
  font-size: 0.84rem;
  font-weight: 400;
}

.chemical-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}

.chemical-profile-actions button {
  min-height: 40px;
  white-space: nowrap;
}

.chemical-profile-actions .ghost-btn {
  border-color: #bdd6e9;
  background: #f8fafc;
  color: #0d3457;
}

.guided-response-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 5px;
}

.guided-response-actions button,
.guided-card-action { min-height: 36px; }

.guided-response-actions button {
  padding: 6px 10px;
  font-size: 0.75rem;
}

.guided-response-action-status {
  grid-column: 1;
  grid-row: 3;
  color: #44576a;
  font-size: 0.82rem;
}

.guided-response-action-status:empty { display: none; }

.guided-response-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.guided-response-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.guided-response-workspace > .guided-response-content {
  min-width: 0;
}

.guided-command-actions {
  position: static;
  top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 10px;
  box-sizing: border-box;
  border-color: #afc4d3;
  background: #082540;
  color: #f8fafc;
}

.guided-command-actions h3,
.guided-command-actions p { margin: 0; }

.guided-command-actions h3 { color: #f8fafc; }

.guided-command-actions > div:first-child p {
  margin-top: 4px;
  color: #a9bfd1;
  font-size: 0.75rem;
}

.guided-command-actions .guided-response-actions {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.guided-command-actions .guided-response-actions button {
  width: auto;
  flex: 1 1 150px;
  color: #082540;
  background: #e7eef3;
  border-color: #c3d1da;
}

.guided-command-actions .guided-response-actions #guided-open-plume-btn {
  color: #fff;
  background: #b11226;
  border-color: #ef3340;
}

.guided-command-actions .guided-response-actions #guided-save-record-btn,
.guided-command-actions .guided-response-actions #guided-save-incident-btn {
  color: #fff;
  background: #082540;
  border-color: #315d82;
}

.guided-command-actions .guided-response-actions #guided-back-btn {
  color: #082540;
  background: #fff;
  border-color: #c3d1da;
}

.guided-command-actions .guided-response-actions #guided-open-hazard-btn {
  color: #2b2200;
  background: var(--gold-surface);
  border-color: var(--gold);
}

.guided-command-actions .guided-response-actions #guided-save-record-btn {
  color: #fff;
  background: #082540;
  border-color: #315d82;
}

.guided-command-actions .guided-response-action-status {
  margin: 0;
}

.guided-response-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.guided-response-card {
  min-width: 0;
  margin: 0;
  padding: 14px;
  background: #f5f7f8;
  color: #102235;
}

.guided-ppe-card,
.guided-response-main > .guided-response-card:last-child {
  grid-column: 1 / -1;
}

.guided-response-card h3 {
  margin: 0 0 10px;
  color: #0b2942;
  font-size: 1.02rem;
}

.guided-section-sources {
  margin: -5px 0 10px;
  color: #607383;
  font-size: 0.7rem;
  font-weight: 650;
}

.guided-response-list {
  display: grid;
  gap: 6px;
  margin: 0;
}

.guided-response-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.4fr);
  gap: 8px 12px;
  align-items: start;
  padding: 8px 9px;
  border: 1px solid #d4dde4;
  border-radius: 7px;
  background: #fff;
}

.guided-response-row dt {
  color: #506273;
  font-size: 0.76rem;
  font-weight: 750;
}

.guided-response-row dd {
  display: flex;
  min-width: 0;
  margin: 0;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  color: #142b3e;
  overflow-wrap: anywhere;
}

.guided-source-badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid #9fb9cb;
  border-radius: 999px;
  background: #e3eef5;
  color: #174666;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.25;
}

.guided-respiratory-decision {
  border: 2px solid #345f7d;
  background: #e9f1f6;
}

.guided-respiratory-decision dd > span {
  color: #092c47;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.025em;
}

.guided-protection-level {
  border: 2px solid var(--gold);
  background: #fff5e8;
}

.guided-protection-level dd > span {
  color: #713500;
  font-weight: 900;
}

.guided-manufacturer-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #bdcbd5;
}

.guided-manufacturer-section > h3 { margin-bottom: 9px; }

.guided-manufacturer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.guided-manufacturer-box {
  min-width: 0;
  padding: 11px;
  border: 1px solid #bdcbd5;
  border-radius: 8px;
  background: #fff;
}

.guided-manufacturer-box h4 {
  margin: 0 0 6px;
  color: #0b2942;
}

.guided-manufacturer-box p {
  margin: 0 0 7px;
  color: #263e50;
  font-size: 0.78rem;
}

.guided-manufacturer-box small {
  display: block;
  color: #667987;
  line-height: 1.35;
}

.guided-tactical-flow {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 18px;
  border-color: #8ca8bb;
  background: #eaf0f4;
}

.guided-tactical-section-heading {
  margin-bottom: 4px;
  text-align: center;
}

.guided-tactical-section-heading h3 {
  margin: 0;
  color: #0b2942;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.015em;
}

.guided-tactical-section-heading p {
  margin: 4px 0 0;
  color: #506779;
  font-size: 0.9rem;
  line-height: 1.4;
}

.guided-flow-box {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 14px;
  border: 1px solid #adc0cd;
  border-left: 4px solid #2e658c;
  border-radius: 8px;
  background: #fff;
}

.guided-flow-box h4 {
  margin: 0 0 8px;
  color: #0b2942;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.guided-flow-status {
  display: block;
  margin-bottom: 7px;
  padding: 6px 7px;
  border-radius: 5px;
  background: #e6eef4;
  color: #123d5c;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.guided-flow-box dl {
  display: grid;
  gap: 4px;
  margin: 0;
}

.guided-flow-box dl > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(0, 1.45fr);
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid #e3e8ec;
  font-size: 0.84rem;
  line-height: 1.4;
}

.guided-flow-box dt { color: #40596c; font-weight: 800; }
.guided-flow-box dd { min-width: 0; margin: 0; color: #1d3548; overflow-wrap: anywhere; }

.guided-flow-sources,
.guided-flow-approval {
  margin: 9px 0 0;
  color: #526b7c;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.4;
}

.guided-flow-approval {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--gold-soft);
  color: var(--gold-ink);
}

.guided-flow-arrow {
  display: grid;
  padding: 0;
  place-items: center;
  color: #2e658c;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.guided-mitigation-support {
  margin: 0;
  padding: 18px;
  border-color: #9cb1bf;
  background: #f4f6f7;
}

.guided-mitigation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.guided-mitigation-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #c5d1d8;
  border-radius: 8px;
  background: #fff;
}

.guided-mitigation-card:last-child { grid-column: 1 / -1; }

.guided-mitigation-card h4,
.guided-mitigation-card p { margin: 0; }

.guided-mitigation-card h4 {
  margin-bottom: 7px;
  color: #0b2942;
  font-size: 0.84rem;
}

.guided-mitigation-card strong {
  display: block;
  color: #173f5c;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.guided-mitigation-card small {
  display: block;
  margin: 6px 0;
  color: #607383;
}

.guided-mitigation-card p {
  margin-top: 4px;
  color: #405566;
  font-size: 0.72rem;
  line-height: 1.35;
}

.guided-card-action { margin-top: 10px; }

.guided-response-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  color: #273c4c;
  text-align: center;
}

.guided-response-blocked {
  border-left: 5px solid var(--dark-red);
  background: var(--soft-red);
}

.guided-response-disclaimers {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 9px 12px;
  border-left: 4px solid var(--gold);
  background: var(--gold-soft);
  color: #3d4650;
  font-size: 0.72rem;
}

.guided-response-disclaimers p { margin: 0; }

@media (max-width: 900px) {
  .guided-response-workspace { grid-template-columns: 1fr; }
  .guided-command-actions { position: static; }
  .guided-response-content { grid-template-columns: 1fr; }
  .guided-flow-arrow { padding: 2px 0; }
}

@media (max-width: 620px) {
  .guided-response-actions button { min-height: 40px; }
  .chemical-profile-actions { width: 100%; margin-left: 0; }
  .chemical-profile-actions button,
  .guided-response-actions button { flex: 1 1 150px; }
  .guided-command-actions .guided-response-actions button { flex: 0 0 auto; }
  .guided-response-row { grid-template-columns: 1fr; }
  .guided-flow-box dl > div { grid-template-columns: 1fr; }
  .guided-mitigation-grid { grid-template-columns: 1fr; }
  .guided-mitigation-card:last-child { grid-column: auto; }
  .guided-response-main,
  .guided-manufacturer-grid { grid-template-columns: 1fr; }
  .guided-response-main > .guided-response-card { grid-column: auto; }
}

.chemical-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "tabs"
    "content";
  gap: 10px;
  align-items: start;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
}

.chemical-profile-content-card {
  grid-area: content;
  min-width: 0;
  min-height: 0;
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.chemical-profile-content {
  display: grid;
  gap: 12px;
  max-height: 70vh;
  overflow: auto;
  padding-right: 4px;
}

.chemical-profile-content[data-active-tab="exposures"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.chemical-profile-content[data-active-tab="exposures"] > .chemical-profile-section {
  grid-column: 1 / -1;
}

.chemical-profile-content[data-active-tab="exposures"] > .chemical-profile-section[data-section="aegl-levels"],
.chemical-profile-content[data-active-tab="exposures"] > .chemical-profile-section[data-section="erpg-teel-levels"],
.chemical-profile-content[data-active-tab="exposures"] > .chemical-profile-section[data-section="additional-exposure-levels"] {
  grid-column: auto;
  min-width: 0;
}

.chemical-profile-tabs {
  display: grid;
  grid-area: tabs;
  grid-template-columns: repeat(9, minmax(104px, 1fr));
  gap: 7px;
  position: sticky;
  top: 12px;
  z-index: 5;
  padding: 9px;
  overflow-x: auto;
  border: 1px solid var(--dark-red);
  border-radius: 11px;
  background: linear-gradient(145deg, var(--red), var(--dark-red));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 24px rgba(13, 52, 87, 0.24);
}

.chemical-profile-tab {
  width: 100%;
  min-height: 56px;
  padding: 8px 6px;
  border: 1px solid #2b5d85;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #164a75, #0d3457);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 5px 12px rgba(7, 31, 54, 0.2);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: normal;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.chemical-profile-tab:hover,
.chemical-profile-tab:focus-visible {
  background: linear-gradient(145deg, #1d5c8f, #12446f);
  border-color: #6f9fc5;
  color: #fff;
  outline: none;
  transform: translateY(-1px);
}

.chemical-profile-tab.active {
  border-color: #9bc2df;
  background: linear-gradient(145deg, #215f91, #123f67);
  color: #fff;
  box-shadow:
    inset 0 -3px 0 #fff,
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 6px 14px rgba(7, 31, 54, 0.28);
}

.chemical-profile-tab[data-tab="isolationErg"] {
  white-space: normal;
}

.chemical-profile-section {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft-card);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 6px 16px rgba(11, 31, 51, 0.08);
}

.chemical-profile-section h4 {
  margin: 0;
  color: #071f36;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.hybrid-decon-section {
  gap: 8px;
  padding: 12px 16px;
}

.hybrid-decon-link {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
  border: 2px solid #8aa51d;
  border-radius: 10px;
  background: #000;
  color: #fff;
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.hybrid-decon-link:hover,
.hybrid-decon-link:focus-visible {
  border-color: #5f7510;
  outline: none;
  box-shadow: 0 6px 16px rgba(67, 85, 7, 0.22);
  transform: translateY(-1px);
}

.hybrid-decon-logo {
  display: block;
  width: min(360px, 72%);
  max-height: 72px;
  object-fit: contain;
  object-position: left center;
}

.hybrid-decon-action {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hybrid-decon-action::after {
  content: ' \2197';
}

@media (max-width: 560px) {
  .hybrid-decon-link { gap: 10px; padding: 9px 10px; }
  .hybrid-decon-logo { width: min(240px, 68%); }
  .hybrid-decon-action { font-size: 0.67rem; }
}

.chemical-profile-section[data-section="reactivity"] {
  grid-column: 1 / -1;
  width: 100%;
}

.chemical-profile-section[data-section="reactivity"] .chemical-profile-list {
  gap: 10px;
  padding-left: 22px;
  color: #071f36;
}

.chemical-profile-section[data-section="reactivity"] .chemical-profile-list li {
  padding-left: 4px;
  line-height: 1.55;
}

.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-section {
  border-color: var(--gold);
  background: var(--gold-surface);
  color: #111;
  box-shadow: 0 7px 18px rgba(var(--gold-rgb), 0.2);
}

.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-section h4,
.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-list {
  color: #111;
}

.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-row,
.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-value-list li {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: #111;
}

.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-row > span,
.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-row strong,
.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-value-list {
  color: #111;
}

.chemical-profile-section[data-section="recommended-ppe"],
.chemical-profile-section[data-section="recommended-detector"],
.chemical-profile-section[data-section="ppe-options"],
.chemical-profile-section[data-section="glove-suit-materials"] {
  grid-column: 1 / -1;
  width: 100%;
}

.chemical-profile-section[data-section="recommended-ppe"] .chemical-profile-row,
.chemical-profile-section[data-section="recommended-detector"] .chemical-profile-row {
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: var(--gold-soft);
  box-shadow: inset 4px 0 0 var(--red);
}

.chemical-profile-section[data-section="recommended-ppe"] .chemical-profile-row span,
.chemical-profile-section[data-section="recommended-detector"] .chemical-profile-row span {
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 700;
}

.chemical-profile-section[data-section="ppe-options"] .chemical-profile-list,
.chemical-profile-section[data-section="glove-suit-materials"] .chemical-profile-list {
  padding: 0;
  list-style: none;
}

.chemical-profile-section[data-section="ppe-options"] .chemical-profile-list li,
.chemical-profile-section[data-section="glove-suit-materials"] .chemical-profile-list li {
  padding: 10px 12px;
  border: 1px solid rgba(7, 31, 54, 0.14);
  border-radius: 9px;
  background: rgba(255, 253, 241, 0.9);
}

.erg-profile-table {
  grid-column: 1 / -1;
  width: 100%;
  border-color: #287443;
  background: linear-gradient(145deg, #23814a, #146838);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 7px 18px rgba(20, 104, 56, 0.22);
}

.erg-profile-table h4 {
  color: #fff;
}

.erg-profile-table-wrap {
  overflow-x: auto;
  border: 1px solid #0d542c;
  border-radius: 9px;
  background: #f5fbf6;
}

.erg-profile-table table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  color: #123722;
}

.erg-profile-table th,
.erg-profile-table td {
  padding: 9px 10px;
  border: 1px solid #83b695;
  text-align: left;
  vertical-align: top;
}

.erg-profile-table th {
  background: #168349;
  color: #fff;
  font-weight: 700;
}

.erg-profile-table tbody tr:nth-child(even) {
  background: #e5f3e9;
}

.erg-profile-summary {
  border-color: #287443;
  background: linear-gradient(145deg, #23814a, #146838);
  color: #fff;
  box-shadow: 0 7px 18px rgba(20, 104, 56, 0.22);
}

.erg-profile-summary h4 { color: #fff; }
.erg-profile-summary .chemical-profile-row {
  border-color: #83b695;
  background: #f5fbf6;
}
.erg-profile-summary .chemical-profile-row > span { color: #17603a; }
.erg-profile-summary .chemical-profile-row strong,
.erg-profile-summary .chemical-profile-value-list { color: #123722; }

.chemical-profile-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
}

.chemical-profile-section[data-section="chemical-properties"] .chemical-profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chemical-profile-row {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(7, 31, 54, 0.12);
  border-radius: 10px;
  background: #fff;
}

.chemical-profile-row strong {
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.chemical-profile-value-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  color: #071f36;
  list-style: none;
}

.chemical-profile-value-list li {
  padding: 7px 9px;
  border-left: 3px solid #2b5d85;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.58);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.chemical-treatment-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.chemical-treatment-column h5 {
  margin: 0 0 7px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--gold);
  color: #071f36;
  font-size: 0.92rem;
  font-family: var(--hazmatiq-font-heading);
  font-weight: 700;
}

.chemical-treatment-column ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chemical-treatment-column li {
  padding: 7px 9px;
  border-left: 3px solid #2b5d85;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.58);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.chemical-profile-value-list.compact-columns,
.chemical-profile-list.compact-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  column-gap: 10px;
  row-gap: 7px;
}

.chemical-profile-value-list.compact-columns li,
.chemical-profile-list.compact-columns li {
  min-width: 0;
  height: 100%;
}

.chemical-profile-row span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chemical-profile-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 22px;
  color: #071f36;
}

.chemical-profile-list li {
  padding-left: 3px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.chemical-profile-list-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: center;
  padding: 9px 11px !important;
  border: 1px solid rgba(7, 31, 54, 0.14);
  border-radius: 9px;
  background: #fff;
}

.chemical-profile-list-row strong {
  color: #071f36;
  font-size: 0.82rem;
  letter-spacing: 0.025em;
}

.chemical-profile-list-row span {
  color: #071f36;
  font-weight: 500;
}

/* Present stability details as a short, scan-friendly operational summary. */
.chemical-profile-section[data-section="stability-and-decomposition"] .chemical-profile-grid {
  grid-template-columns: 1fr;
}

.chemical-profile-section[data-section="stability-and-decomposition"] .chemical-profile-row {
  grid-template-columns: minmax(170px, 0.35fr) minmax(0, 1fr);
  align-content: start;
  align-items: start;
  min-height: 0;
  padding: 13px 14px;
  border-top: 4px solid var(--navy);
}

.chemical-profile-section[data-section="stability-and-decomposition"] .chemical-profile-row > span {
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 700;
}

.chemical-profile-section[data-section="stability-and-decomposition"] .chemical-profile-row strong,
.chemical-profile-section[data-section="stability-and-decomposition"] .chemical-profile-value-list {
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Medical uses the same polished navy treatment as the command schema. */
.chemical-profile-content[data-active-tab="medical"] .chemical-profile-section {
  border-color: #2b5d85;
  background: linear-gradient(145deg, #164a75, #0d3457);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 24px rgba(13, 52, 87, 0.24);
}

.chemical-profile-content[data-active-tab="medical"] .chemical-profile-row,
.chemical-profile-content[data-active-tab="medical"] .chemical-profile-list-row,
.chemical-profile-content[data-active-tab="medical"] .chemical-profile-value-list li,
.chemical-profile-content[data-active-tab="medical"] .chemical-treatment-column li {
  border-color: #4779a2;
  background: rgba(7, 31, 54, 0.56);
  color: #fff;
}

.chemical-profile-content[data-active-tab="medical"] .chemical-profile-section h4,
.chemical-profile-content[data-active-tab="medical"] .chemical-profile-row > span,
.chemical-profile-content[data-active-tab="medical"] .chemical-profile-row strong,
.chemical-profile-content[data-active-tab="medical"] .chemical-profile-list,
.chemical-profile-content[data-active-tab="medical"] .chemical-profile-value-list,
.chemical-profile-content[data-active-tab="medical"] .chemical-profile-list-row strong,
.chemical-profile-content[data-active-tab="medical"] .chemical-profile-list-row span,
.chemical-profile-content[data-active-tab="medical"] .chemical-treatment-column h5 {
  color: #fff;
}

.chemical-profile-content[data-active-tab="medical"] .chemical-profile-row > span,
.chemical-profile-content[data-active-tab="medical"] .chemical-profile-list-row strong,
.chemical-profile-content[data-active-tab="medical"] .chemical-treatment-column h5 {
  color: #dcefff;
}

.chemical-profile-content[data-active-tab="medical"] .chemical-treatment-column h5 {
  border-bottom-color: #5f91bb;
}

/* Patient instructions stay in one ordered reading path instead of flowing across columns. */
.chemical-profile-content[data-active-tab="medical"] .chemical-profile-row[data-field="contaminated-patient-handling"] .chemical-profile-value-list {
  grid-template-columns: 1fr;
}

.chemical-profile-content[data-active-tab="medical"] .chemical-profile-row[data-field="contaminated-patient-handling"] .chemical-profile-value-list li {
  height: auto;
  min-height: 0;
}

/* Fire keeps responder-red panels with light matte-grey data bubbles. */
.chemical-profile-content[data-active-tab="fire"] .chemical-profile-section {
  border-color: var(--dark-red);
  background: var(--red);
  color: #fff;
}

.chemical-profile-content[data-active-tab="fire"] .chemical-profile-row,
.chemical-profile-content[data-active-tab="fire"] .chemical-profile-list-row,
.chemical-profile-content[data-active-tab="fire"] .chemical-profile-value-list li {
  border-color: #b8bec4;
  background: #dce0e3;
  color: var(--text);
}

.chemical-profile-content[data-active-tab="fire"] .chemical-profile-section h4 {
  color: #fff;
}

.chemical-profile-content[data-active-tab="fire"] .chemical-profile-row > span,
.chemical-profile-content[data-active-tab="fire"] .chemical-profile-row strong,
.chemical-profile-content[data-active-tab="fire"] .chemical-profile-list,
.chemical-profile-content[data-active-tab="fire"] .chemical-profile-value-list,
.chemical-profile-content[data-active-tab="fire"] .chemical-profile-list-row strong,
.chemical-profile-content[data-active-tab="fire"] .chemical-profile-list-row span {
  color: var(--text);
}

/* DECON uses light matte-grey panels and clean inner data bubbles. */
.chemical-profile-content[data-active-tab="decon"] .chemical-profile-section {
  border-color: #b8bec4;
  background: #dce0e3;
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 7px 18px rgba(0, 0, 0, 0.24);
}

.chemical-profile-content[data-active-tab="decon"] .chemical-profile-section h4 {
  color: var(--text);
}

.chemical-profile-content[data-active-tab="decon"] .chemical-profile-row,
.chemical-profile-content[data-active-tab="decon"] .chemical-profile-list-row {
  border-color: var(--border);
  background: var(--soft-card);
}

.chemical-profile-content[data-active-tab="decon"] .chemical-profile-row > span,
.chemical-profile-content[data-active-tab="decon"] .chemical-profile-list-row strong {
  color: var(--muted);
  font-weight: 700;
}

.chemical-profile-content[data-active-tab="decon"] .chemical-profile-row strong,
.chemical-profile-content[data-active-tab="decon"] .chemical-profile-list,
.chemical-profile-content[data-active-tab="decon"] .chemical-profile-value-list,
.chemical-profile-content[data-active-tab="decon"] .chemical-profile-list-row span {
  color: var(--text);
}

.chemical-profile-content[data-active-tab="decon"] .chemical-profile-value-list li {
  border-left-color: var(--yellow);
  background: #fff;
}

/* Every side-tab uses the same matte-grey inner information cards. */
.chemical-profile-content[data-active-tab] .chemical-profile-row,
.chemical-profile-content[data-active-tab] .chemical-profile-list-row,
.chemical-profile-content[data-active-tab] .chemical-profile-value-list li,
.chemical-profile-content[data-active-tab] .chemical-treatment-column li {
  border-color: #b8bec4;
  background: #dce0e3;
  color: var(--text);
}

.chemical-profile-content[data-active-tab] .chemical-profile-row > span,
.chemical-profile-content[data-active-tab] .chemical-profile-row strong,
.chemical-profile-content[data-active-tab] .chemical-profile-value-list,
.chemical-profile-content[data-active-tab] .chemical-profile-list-row strong,
.chemical-profile-content[data-active-tab] .chemical-profile-list-row span,
.chemical-profile-content[data-active-tab] .chemical-treatment-column h5 {
  color: var(--text);
}

.chemical-profile-content[data-active-tab] .chemical-profile-row > span,
.chemical-profile-content[data-active-tab] .chemical-profile-list-row strong {
  color: var(--muted);
}

.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-row,
.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-list-row,
.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-value-list li {
  border-color: #cbd5e1;
  background: #fff;
  color: #111;
}

.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-row > span,
.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-row strong,
.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-list,
.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-value-list,
.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-list-row strong,
.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-list-row span {
  color: #111;
}

/* Reactivity is intentionally a full-width reading surface. Incompatibilities
   are the primary scan target; secondary concerns stay compact below it. */
.chemical-profile-content[data-active-tab="reactivity"] {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.chemical-profile-content[data-active-tab="reactivity"] > .chemical-profile-section {
  grid-column: 1 / -1;
  min-width: 0;
}

.chemical-profile-reactivity-panel {
  display: grid;
  gap: 12px;
}

.chemical-profile-reactivity-main,
.chemical-profile-reactivity-secondary {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.chemical-profile-reactivity-main {
  grid-template-columns: minmax(0, 1fr);
}

.chemical-profile-reactivity-secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chemical-profile-reactivity-block {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(203, 213, 225, 0.32);
  border-radius: 9px;
  background: #102f4d;
}

.chemical-profile-reactivity-block h5 {
  margin: 0 0 7px;
  color: #b8c7d9;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chemical-profile-reactivity-primary {
  background: #0b2741;
}

.chemical-profile-reactivity-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chemical-profile-reactivity-list li {
  min-width: 0;
  padding: 9px 10px;
  border-left: 3px solid #4c92c7;
  border-radius: 6px;
  color: #f8fafc;
  background: #16466f;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.chemical-profile-reactivity-empty {
  margin: 0;
  color: #b8c7d9;
  font-size: 0.86rem;
}

@media (max-width: 900px) {
  .chemical-profile-reactivity-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chemical-profile-reactivity-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .chemical-profile-reactivity-list,
  .chemical-profile-reactivity-secondary {
    grid-template-columns: 1fr;
  }
}

.chemical-profile-content[data-active-tab="ppeRespiratory"] .chemical-profile-section[data-section="recommended-ppe"] .chemical-profile-row {
  border-color: var(--dark-red);
  background: var(--red);
  color: #fff;
  box-shadow: inset 4px 0 0 var(--dark-red);
}

.chemical-profile-content[data-active-tab="ppeRespiratory"] .chemical-profile-section[data-section="recommended-ppe"] .chemical-profile-row > span,
.chemical-profile-content[data-active-tab="ppeRespiratory"] .chemical-profile-section[data-section="recommended-ppe"] .chemical-profile-row strong {
  color: #fff;
}

@media (max-width: 760px) {
  .chemical-profile-section[data-section="stability-and-decomposition"] .chemical-profile-grid {
    grid-template-columns: 1fr;
  }

  .chemical-profile-section[data-section="stability-and-decomposition"] .chemical-profile-row {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}


/* Animated HazMatIQ command header — CSS-only mission-interface treatment. */
.command-header.hazmat-command-bar.topbar {
  isolation: isolate;
  grid-template-columns: minmax(330px, 0.85fr) minmax(620px, 1.65fr);
  grid-template-rows: minmax(112px, auto);
  align-items: center;
  min-height: 136px;
  gap: clamp(18px, 2.4vw, 40px);
  padding: 12px clamp(16px, 2vw, 30px);
  overflow: hidden;
  border: 0;
  border-bottom: 2px solid rgba(var(--gold-rgb), 0.55);
  border-radius: 0 0 14px 14px;
  background:
    radial-gradient(circle at 12% 18%, rgba(46, 140, 255, 0.22), transparent 32%),
    radial-gradient(circle at 82% 24%, rgba(var(--gold-rgb), 0.1), transparent 30%),
    linear-gradient(135deg, #061a2e 0%, #0b1f33 45%, #102a43 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.command-header-plume {
  position: absolute;
  pointer-events: none;
}

.command-header-plume {
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 50%, rgba(var(--gold-rgb), 0.18), transparent 16%),
    radial-gradient(ellipse at 62% 48%, rgba(46, 140, 255, 0.12), transparent 22%),
    radial-gradient(ellipse at 54% 45%, rgba(255, 255, 255, 0.06), transparent 28%);
  filter: blur(10px);
  opacity: 0.14;
  animation: commandPlumeBreathe 14s ease-in-out infinite alternate;
}


.command-header .hazmat-command-identity,
.command-header .command-header-footer {
  position: relative;
  z-index: 2;
}

.command-header .hazmat-command-identity,
.command-header .hazmat-command-identity .brand {
  height: auto;
  min-width: 0;
  overflow: visible;
}

.command-brand-home.module-btn,
.command-brand-home.module-btn:hover,
.command-brand-home.module-btn:focus-visible,
.command-brand-home.module-btn.active {
  display: block;
  width: min(520px, 100%);
  min-height: 0;
  padding: 0;
  border: 0;
  outline-offset: 5px;
  background: transparent;
  box-shadow: none;
  transform: none;
  cursor: pointer;
}

.command-brand-home.module-btn:focus-visible {
  outline: 3px solid var(--gold);
  border-radius: 8px;
}

.command-header .brand-logo-command {
  display: block;
  width: 100%;
  height: 108px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.42));
}

.command-header .command-header-footer {
  grid-template-columns: minmax(142px, 0.34fr) minmax(0, 1.66fr);
  gap: 10px;
  width: 100%;
  height: auto;
  margin: 0;
}

.command-header .command-center-launch,
.command-header .hazmat-command-context .notification-item {
  border-color: rgba(103, 151, 190, 0.58);
  background: rgba(6, 26, 46, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 5px 16px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(5px);
}

.command-header .command-center-launch {
  justify-content: flex-start;
  min-height: 76px;
  padding: 10px 12px;
}

.command-header .command-center-launch .command-menu-toggle {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  border: 2px solid var(--gold);
}

.command-header .command-center-launch .command-menu-toggle span {
  width: 26px;
  height: 3px;
  background: #f8fafc;
}

.command-header .command-center-label {
  color: var(--gold);
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: normal;
}

.command-header .hazmat-command-context.notification-center {
  height: auto;
}

.command-header .hazmat-command-context .notification-feed {
  grid-template-columns: repeat(4, minmax(105px, 1fr));
  gap: 7px;
}

.command-header .hazmat-command-context .notification-item,
.command-header .hazmat-command-context .notification-system {
  min-height: 76px;
  padding: 8px;
}

.command-header .hazmat-command-context .notification-item > span {
  color: var(--gold);
  font-size: 0.68rem;
}

.command-header .hazmat-command-context .notification-item > strong,
.command-header .hazmat-command-context .notification-updated {
  color: #f8fafc;
  font-size: 0.73rem;
}

.command-header .hazmat-command-context .notification-item > small {
  color: #b8c7d9;
  font-size: 0.62rem;
}

.command-header .hazmat-command-context .notification-feed > :last-child {
  padding-right: 78px;
}

/* Internal command pages expose navigation only; the homepage keeps its full brand rail. */
.app-shell:not(:has(#overview.view.active)) > .command-header {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(56px, auto);
  min-height: 64px;
  padding: 6px 12px;
  border-radius: 0;
}

.app-shell:not(:has(#overview.view.active)) > .command-header .hazmat-command-identity,
.app-shell:not(:has(#overview.view.active)) > .command-header .notification-item:not(.notification-system),
.app-shell:not(:has(#overview.view.active)) > .command-header .notification-alert-count,
.app-shell:not(:has(#overview.view.active)) > .command-header .notification-system > span,
.app-shell:not(:has(#overview.view.active)) > .command-header .notification-system > time,
.app-shell:not(:has(#overview.view.active)) > .command-header .notification-system > strong {
  display: none;
}

.app-shell:not(:has(#overview.view.active)) > .command-header .command-header-footer,
.app-shell:not(:has(#overview.view.active)) > .command-header .hazmat-command-context.notification-center,
.app-shell:not(:has(#overview.view.active)) > .command-header .notification-feed,
.app-shell:not(:has(#overview.view.active)) > .command-header .notification-system {
  display: block;
  width: max-content;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-shell:not(:has(#overview.view.active)) > .command-header .command-center-launch {
  display: flex;
  width: max-content;
  min-height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-shell:not(:has(#overview.view.active)) > .command-header .command-center-launch .command-menu-toggle {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
}

.app-shell:not(:has(#overview.view.active)) > .command-header .command-center-label { display: none; }

/* Compact internal navigation: brand above the menu, with no empty radar rail. */
.app-shell:not(:has(#overview.view.active)) > .command-header {
  display: grid;
  grid-template-columns: 164px;
  grid-template-rows: auto auto;
  align-content: start;
  justify-content: start;
  gap: 2px;
  min-height: 92px;
  padding: 7px 12px 8px;
  overflow: visible;
  border-bottom: 1px solid rgba(82, 153, 201, 0.55);
  background: #061a2e;
  box-shadow: none;
}

.app-shell:not(:has(#overview.view.active)) > .command-header .command-header-plume {
  display: none;
}

.app-shell:not(:has(#overview.view.active)) > .command-header .hazmat-command-identity {
  display: block;
  grid-column: 1;
  grid-row: 1;
  width: 154px;
  height: 37px;
}

.app-shell:not(:has(#overview.view.active)) > .command-header .hazmat-command-identity .brand,
.app-shell:not(:has(#overview.view.active)) > .command-header .command-brand-home.module-btn {
  display: block;
  width: 154px;
  height: 37px;
}

.app-shell:not(:has(#overview.view.active)) > .command-header .brand-logo-command {
  width: 154px;
  height: 37px;
  object-fit: contain;
  object-position: left center;
}

.app-shell:not(:has(#overview.view.active)) > .command-header .command-header-footer {
  grid-column: 1;
  grid-row: 2;
  width: 52px;
  height: 48px;
}

.app-shell:not(:has(#overview.view.active)) > .command-header .command-center-launch {
  min-height: 48px;
  width: 48px;
}

.app-shell:not(:has(#overview.view.active)) > .command-header .command-center-launch .command-menu-toggle {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  border-color: var(--gold);
  background: #0b3557;
}

/* Incident Command's own banner starts at the top of the workspace and stays centered. */
#incident .incident-command-hero .hazmat-page-hero-content {
  justify-items: center;
  margin-inline: auto;
  text-align: center;
}

@media (max-width: 720px) {
  .app-shell:not(:has(#overview.view.active)) > .command-header {
    grid-template-columns: 136px;
    min-height: 82px;
    padding: 5px 8px 6px;
  }

  .app-shell:not(:has(#overview.view.active)) > .command-header .hazmat-command-identity,
  .app-shell:not(:has(#overview.view.active)) > .command-header .hazmat-command-identity .brand,
  .app-shell:not(:has(#overview.view.active)) > .command-header .command-brand-home.module-btn,
  .app-shell:not(:has(#overview.view.active)) > .command-header .brand-logo-command {
    width: 132px;
    height: 31px;
  }
}

@keyframes commandPlumeBreathe {
  from { transform: translateX(-8px) scale(1); opacity: 0.1; }
  to { transform: translateX(10px) scale(1.04); opacity: 0.18; }
}

@media (max-width: 1100px) {
  .command-header.hazmat-command-bar.topbar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 96px auto;
    gap: 8px;
  }

  .command-brand-home.module-btn { width: min(470px, 82vw); }
  .command-header .brand-logo-command { height: 92px; }
  .command-header .command-header-footer { grid-template-columns: minmax(130px, 0.34fr) minmax(0, 1.66fr); }
}

@media (max-width: 720px) {
  .command-header.hazmat-command-bar.topbar {
    grid-template-rows: 84px auto;
    padding: 9px;
  }

  .command-header .brand-logo-command { height: 80px; }
  .command-header .command-header-footer { grid-template-columns: 1fr; height: auto; }
  .command-header .command-center-launch { justify-content: center; min-height: 58px; }
  .command-header .command-center-launch .command-menu-toggle { width: 48px; height: 48px; flex-basis: 48px; }
  .command-header .command-center-label { font-size: 0.72rem; white-space: nowrap; }
  .command-header .hazmat-command-context .notification-feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-header .hazmat-command-context .notification-item,
  .command-header .hazmat-command-context .notification-system { min-height: 64px; }
  .command-header .hazmat-command-context .notification-feed > :last-child { padding-right: 8px; }
  .command-header .hazmat-command-context .notification-alert-count { right: 7px; bottom: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .command-header-plume { animation: none; }
}

.app-shell:has(#overview.view.active) > .layout {
  padding: 0 clamp(12px, 1.5vw, 24px) clamp(12px, 1.5vw, 24px);
}

#overview .incident-overview-actions .overview-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.88);
}

#overview .incident-overview-actions .overview-action-incident {
  --overview-accent: #a90f18;
  --overview-accent-rgb: 169, 15, 24;
}

#overview .incident-overview-actions .overview-action-planning {
  --overview-accent: #167238;
  --overview-accent-rgb: 22, 114, 56;
}

#overview .incident-overview-actions .overview-action-reports {
  --overview-accent: var(--gold);
  --overview-accent-rgb: var(--gold-rgb);
}

#overview .incident-overview-actions .overview-action-btn:hover,
#overview .incident-overview-actions .overview-action-btn:focus-visible {
  border: 5px solid var(--overview-accent);
  box-shadow: 0 0 0 2px rgba(var(--overview-accent-rgb), 0.42), 0 20px 42px rgba(var(--overview-accent-rgb), 0.38);
}

.chemical-profile-section[data-section$="levels"] .chemical-profile-list,
.chemical-profile-section[data-section="primary-limits"] .chemical-profile-list,
.chemical-profile-section[data-section="additional-exposure-levels"] .chemical-profile-list,
.chemical-profile-section[data-section="other-monitoring-concerns"] .chemical-profile-list {
  padding: 0;
  list-style: none;
}

.chemical-profile-section[data-section$="levels"] .chemical-profile-list-row,
.chemical-profile-section[data-section="primary-limits"] .chemical-profile-list-row,
.chemical-profile-section[data-section="additional-exposure-levels"] .chemical-profile-list-row {
  grid-template-columns: minmax(130px, 0.45fr) minmax(0, 1fr);
  align-items: start;
}

.chemical-profile-section[data-section$="levels"] .chemical-profile-list-row span,
.chemical-profile-section[data-section="primary-limits"] .chemical-profile-list-row span,
.chemical-profile-section[data-section="additional-exposure-levels"] .chemical-profile-list-row span {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.chemical-profile-section[data-section="primary-limits"] .chemical-profile-list-row strong {
  white-space: nowrap;
}

.chemical-profile-section[data-section="primary-limits"] h4,
.chemical-profile-section[data-section="aegl-levels"] h4,
.chemical-profile-section[data-section="erpg-teel-levels"] h4,
.chemical-profile-section[data-section="additional-exposure-levels"] h4 {
  white-space: nowrap;
}

.chemical-profile-empty {
  margin: 0;
  color: #445567;
  font-weight: 700;
}

.erg-additional-tables {
  margin: 0 0 18px;
}

.erg-additional-table-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid #8aae73;
  border-left: 5px solid #398044;
  border-radius: 10px;
  background: #f3faef;
}

.erg-additional-table-row + .erg-additional-table-row { margin-top: 10px; }
.erg-additional-table-row h4,
.erg-additional-table-row p { margin: 0; }
.erg-additional-table-row .eyebrow { color: #17603a; }

.erg-container-distances {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #8aae73;
}

.erg-container-distances > h4,
.erg-container-distances > p { margin: 0 0 8px; }
.erg-container-distances h4 small { color: #17603a; }
.erg-container-table { min-width: 980px; }
.erg-container-table th:first-child,
.erg-container-table td:first-child { min-width: 220px; text-align: left; }
.erg-container-table td:not(:first-child) { white-space: nowrap; }
.erg-table-footnote { margin-top: 8px !important; font-size: 0.82rem; }

@media (max-width: 700px) {
  .erg-additional-table-row { grid-template-columns: 1fr; }
}

@media (min-width: 981px) {
  .chemical-card-grid .first-responder-card {
    grid-column: 1;
  }

  .chemical-card-grid .specialist-card {
    grid-column: 2;
  }
}

/* Reference-matched Chemical Profile refinements. Navy information surfaces
   sit on light-grey gutters so every control and card boundary remains clear. */
#lookup .chemical-id-search-card #chemical-search {
  border-color: #b8c0c8;
  color: #172536;
  background: #e2e5e8;
  box-shadow: inset 0 1px 2px rgba(7, 31, 54, 0.12), 0 4px 12px rgba(2, 15, 27, 0.14);
}

#lookup .chemical-id-search-card #chemical-search::placeholder {
  color: #5b6876;
  opacity: 1;
}

.chemical-profile-toolbar {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #24597f;
  border-radius: 12px;
  color: #fff;
  background: #061f34;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-weather-item {
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-weather-item > span,
.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-weather-item > strong {
  justify-self: center;
  text-align: center;
}

.chemical-profile-toolbar > strong {
  font-family: var(--hazmatiq-font-heading);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.chemical-profile-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

/* ChemCompare source-backed comparison workspace. */
.chemical-action-button.chem-compare {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: var(--gold-surface);
  color: #111;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.chemical-action-button.chem-compare:hover,
.chemical-action-button.chem-compare:focus-visible {
  filter: brightness(0.96);
  outline: 2px solid #111;
  outline-offset: 2px;
}

.chemcompare-page {
  width: 100%;
  min-height: 100%;
  padding: 12px;
  background: #e5e7eb;
  font-family: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
}

.chemcompare-shell {
  overflow: hidden;
  color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #061a2e;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.26);
}

.chemcompare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 8px solid #e5e7eb;
  background: linear-gradient(90deg, #061a2e, #0b1f33);
}

.chemcompare-header h1 {
  margin: 0;
  color: #f8fafc;
  font-size: 28px;
  font-weight: 900;
}

.chemcompare-header p {
  margin: 4px 0 0;
  color: #dde7f2;
  font-size: 15px;
}

.chemcompare-header .ghost-btn,
.chemcompare-column .ghost-btn {
  border-color: #7ab8ff;
  background: #102a43;
  color: #f8fafc;
}

.chemcompare-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  background: #e5e7eb;
}

.chemcompare-column {
  min-width: 0;
  padding: 16px;
  border: 1px solid #406b91;
  border-radius: 14px;
  background: linear-gradient(180deg, #102a43, #0b223a);
}

.chemcompare-column h2,
.chemcompare-column h3 {
  margin-top: 0;
  color: #f8fafc;
}

.chemcompare-column-heading,
.chemcompare-summary-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chemcompare-clear {
  min-height: 38px !important;
  padding: 8px 10px !important;
  white-space: nowrap;
}

.chemcompare-search-wrap {
  position: relative;
}

.chemcompare-search-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  background: #f1f5f9;
  color: #0b1f33;
  font-size: 16px;
}

.chemcompare-search-input:focus {
  border-color: #2e8cff;
  box-shadow: 0 0 0 3px rgba(46, 140, 255, 0.3);
}

.chemcompare-search-input::placeholder {
  color: #64748b;
}

.chemcompare-search-suggestions {
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 20;
}

.chemcompare-summary {
  min-height: 190px;
}

.chemcompare-summary-heading h3 {
  margin: 0 0 10px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #d7dce1;
  color: #071f36;
  font-size: 1.35rem;
}

.chemcompare-identifiers {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 12px;
  margin: 0 0 12px;
}

.chemcompare-identifiers dt {
  color: #b8c7d9;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chemcompare-identifiers dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #f8fafc;
  font-weight: 700;
}

.chemcompare-summary-ppe {
  margin: 12px 0 0;
  color: #f8fafc;
  line-height: 1.45;
}

.chemcompare-results {
  padding: 10px;
  background: #e5e7eb;
}

.chemcompare-results-empty {
  margin: 0;
  padding: 18px;
  border: 1px solid #406b91;
  border-radius: 12px;
  background: #102a43;
  color: #dde7f2;
  text-align: center;
  font-weight: 700;
}

.chemcompare-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.chemcompare-value,
.chemcompare-label {
  position: relative;
  min-width: 0;
  padding: 14px;
  border: 1px solid #406b91;
  border-radius: 12px;
  background: linear-gradient(180deg, #102a43, #0b223a);
  color: #f8fafc;
  overflow-wrap: anywhere;
}

.chemcompare-value.is-different {
  border-width: 2px;
  border-color: #7ab8ff;
}

.chemcompare-label {
  display: grid;
  place-items: center;
  border-color: var(--gold);
  background: var(--gold-soft);
  color: #111;
  text-align: center;
  font-weight: 900;
}

.chemcompare-value-title {
  margin: 0 70px 7px 0;
  padding: 5px 7px;
  border-radius: 6px;
  background: #d7dce1;
  color: #071f36;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chemcompare-value-main {
  color: #f8fafc;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

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

.chemcompare-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid #6e9dc6;
  border-radius: 999px;
  background: #143b5d;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.chemcompare-difference-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 6px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.chemcompare-empty {
  color: #dde7f2;
  font-weight: 600;
}

.chemcompare-warning {
  margin: 0 10px 10px;
  padding: 12px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: var(--gold-soft);
  color: #0b1f33;
  font-weight: 700;
  line-height: 1.45;
}

.chemcompare-nfpa {
  flex: 0 0 74px;
  margin: 0;
  text-align: center;
}

.chemcompare-nfpa figcaption {
  margin-bottom: 7px;
  color: #b8c7d9;
  font-size: 0.68rem;
  font-weight: 850;
}

.chemcompare-nfpa-diamond {
  display: grid;
  grid-template-columns: 28px 28px;
  grid-template-rows: 28px 28px;
  width: 56px;
  margin: 0 auto;
  transform: rotate(45deg);
}

.chemcompare-nfpa-cell {
  display: grid;
  place-items: center;
  border: 1px solid #fff;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 1px #000;
}

.chemcompare-nfpa-cell.fire { background: #e31b23; }
.chemcompare-nfpa-cell.reactivity { background: #ffd100; color: #111; text-shadow: none; }
.chemcompare-nfpa-cell.health { background: #005baa; }
.chemcompare-nfpa-cell.special { background: #fff; color: #111; text-shadow: none; }

.chemcompare-nfpa-cell:nth-child(1) { grid-column: 2; grid-row: 1; }
.chemcompare-nfpa-cell:nth-child(2) { grid-column: 2; grid-row: 2; }
.chemcompare-nfpa-cell:nth-child(3) { grid-column: 1; grid-row: 2; }
.chemcompare-nfpa-cell:nth-child(4) { grid-column: 1; grid-row: 1; }

.chemcompare-nfpa-cell b {
  display: block;
  transform: rotate(-45deg);
}

@media (max-width: 1100px) {
  .chemcompare-row {
    grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .chemcompare-page { padding: 6px; }
  .chemcompare-header { align-items: flex-start; flex-direction: column; }
  .chemcompare-split,
  .chemcompare-row { grid-template-columns: 1fr; }
  .chemcompare-label { order: -1; }
  .chemcompare-summary { min-height: 0; }
}

.chemical-profile-toolbar button {
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 0.76rem;
  white-space: nowrap;
}

#chemical-id-results {
  background: #d7dce1;
}

#chemical-id-results .chemical-profile-shell {
  gap: 7px;
}

#chemical-id-results .chemical-profile-header-card {
  grid-template-areas: "heading" "summary" "meta";
  gap: 8px;
  margin: 0;
  border-radius: 12px;
}

#chemical-id-results .chemical-profile-layout {
  gap: 7px;
  padding: 0;
  border-radius: 12px;
  background: #d7dce1;
}

#chemical-id-results .chemical-profile-tabs {
  gap: 5px;
  padding: 6px;
  border-color: #b8c0c8;
  background: #d7dce1;
  box-shadow: none;
}

#chemical-id-results .chemical-profile-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding-inline: 8px;
  border-radius: 7px;
}

.chemical-profile-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #78bfff;
}

.chemical-profile-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#chemical-id-results .chemical-profile-tab.active .chemical-profile-icon {
  color: #071f36;
}

#chemical-id-results .chemical-profile-section h4,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-section h4,
#chemical-id-results .erg-profile-table h4 {
  display: flex;
  align-items: center;
  gap: 8px;
}

#chemical-id-results .chemical-profile-content {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 7px;
  padding: 7px;
  border: 1px solid #b8c0c8;
  border-radius: 12px;
  background: #d7dce1;
}

#chemical-id-results .chemical-profile-content > .chemical-profile-section,
#chemical-id-results .chemical-profile-content > .hybrid-decon-section {
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
}

#chemical-id-results .chemical-profile-content > .chemical-profile-source-summary,
#chemical-id-results .chemical-profile-content > .chemical-profile-empty-state,
#chemical-id-results .chemical-profile-content > .erg-profile-table,
#chemical-id-results .chemical-profile-content > .erg-profile-summary,
#chemical-id-results .chemical-profile-content > .chemical-profile-section[data-section="reactivity"],
#chemical-id-results .chemical-profile-content > .chemical-profile-section[data-section="stability-and-decomposition"] {
  grid-column: 1 / -1;
}

#chemical-id-results .chemical-profile-section,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-section {
  border-radius: 9px;
}

@media (min-width: 1200px) {
  #lookup.active:has(#chemical-id-results:not([hidden])) .chemical-profile-shell {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  #lookup.active:has(#chemical-id-results:not([hidden])) .chemical-profile-layout {
    grid-template-rows: auto minmax(0, 1fr);
  }
}

@media (max-width: 1500px) {
  #chemical-id-results .chemical-profile-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .chemical-profile-toolbar {
    grid-template-columns: 1fr;
  }

  .chemical-profile-toolbar > strong {
    grid-row: 1;
  }

  .chemical-profile-toolbar-actions,
  .chemical-profile-toolbar > button {
    justify-content: stretch;
    width: 100%;
  }

  .chemical-profile-toolbar-actions > button {
    flex: 1 1 150px;
  }

  #chemical-id-results .chemical-profile-content {
    grid-template-columns: 1fr;
  }

  #chemical-id-results .chemical-profile-content > * {
    grid-column: 1;
  }
}

.chemical-results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  margin-top: 8px;
}

.chemical-results-header h2 {
  margin-bottom: 0;
}

.chemical-results-header .accent-btn {
  flex: 0 0 auto;
  margin-left: auto;
}

.chemical-result-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.chemical-result-actions .accent-btn {
  margin-left: 0;
}

.chemical-card-panel {
  width: 100%;
  min-height: auto;
  min-width: 0;
  padding: clamp(18px, 2vw, 28px);
}

#chemical-id-results .first-responder-card {
  border: 5px solid #760d14;
  box-shadow: 0 12px 28px rgba(118, 13, 20, 0.2);
}

#chemical-id-results .specialist-card {
  border: 5px solid #111;
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.2);
}

.chemical-view-title {
  margin-bottom: 8px;
  color: var(--text);
  font-size: clamp(1.3rem, 1.8vw, 1.75rem);
  font-family: var(--hazmatiq-font-heading);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.055em;
  white-space: nowrap;
}

.first-responder-card .chemical-view-title {
  color: #760d14;
}

.specialist-card .chemical-view-title {
  color: #111;
}

.first-responder-card {
  border-color: rgba(255, 77, 77, 0.45);
  background: linear-gradient(135deg, rgba(255, 77, 77, 0.14), rgba(16, 27, 44, 0.95));
}

.specialist-card {
  border-color: rgba(var(--gold-rgb), 0.35);
  background: linear-gradient(135deg, rgba(var(--gold-rgb), 0.12), rgba(16, 27, 44, 0.95));
}

.chemical-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.erg-guide-heading,
.erg-material-summary {
  margin: 5px 0 0;
  color: #4d5257;
}

.erg-guide-number {
  min-width: 70px;
  padding: 10px 14px;
  border: 3px solid #bd4d0c;
  border-radius: 8px;
  color: #111;
  background: #f58220;
  font-size: 1.45rem;
  font-weight: 800;
  text-align: center;
}

.erg-quick-facts {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.7fr);
  gap: 10px;
  margin: 16px 0;
}

.erg-quick-fact {
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  border: 2px solid #d36a1e;
  border-radius: 8px;
  color: #171717;
  background: var(--gold-soft);
}

.erg-quick-fact-primary {
  border-width: 3px;
  border-color: #a70f16;
  background: var(--gold-soft);
}

.erg-quick-fact span {
  color: #7a240d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.erg-quick-fact strong {
  font-size: 1.05rem;
  line-height: 1.35;
}

.erg-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  color: #171717;
}

.erg-page-column {
  display: grid;
  align-content: start;
  gap: 14px;
}

.erg-section {
  overflow: hidden;
  border: 2px solid #d36a1e;
  border-radius: 8px;
  background: #fff;
}

.erg-section > h4 {
  margin: 0;
  padding: 9px 12px;
  color: #111;
  background: #f58220;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.erg-section > h5 {
  margin: 0;
  padding: 8px 12px 2px;
  color: #8c2d0b;
  font-size: 0.9rem;
  font-family: var(--hazmatiq-font-heading);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.erg-section > ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 6px 18px 12px 31px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.erg-list-subheading {
  margin: 3px 0 -2px -16px;
  list-style: none;
  font-weight: 700;
}

.erg-table-card {
  margin: 0 0 16px;
  padding: 14px;
  border: 4px solid #168349;
  border-radius: 10px;
  color: #11251b;
  background: #eaf8ef;
}

.erg-table-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.erg-table-heading h4,
.erg-table-heading p {
  margin: 0;
}

.erg-green-badge {
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  background: #168349;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.erg-table-wrap {
  overflow-x: auto;
}

.erg-table-card table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.erg-table-card th,
.erg-table-card td {
  padding: 9px 10px;
  border: 1px solid #7db596;
  text-align: left;
}

.erg-table-card th {
  color: #fff;
  background: #168349;
}

.erg-table-card small {
  font-weight: 500;
}

@media (max-width: 900px) {
  .command-snapshot-grid {
    grid-template-columns: 1fr;
  }

  .chemical-profile-layout {
    grid-template-columns: 1fr;
  }

  .chemical-profile-grid {
    grid-template-columns: 1fr;
  }

  .chemical-profile-section[data-section="chemical-properties"] .chemical-profile-grid {
    grid-template-columns: 1fr;
  }

  .chemical-profile-content[data-active-tab="exposures"] {
    grid-template-columns: 1fr;
  }

  .chemical-profile-content[data-active-tab="exposures"] > .chemical-profile-section[data-section] {
    grid-column: 1;
  }

  .chemical-profile-list-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .chemical-profile-value-list.compact-columns,
  .chemical-profile-list.compact-columns {
    grid-template-columns: 1fr;
  }

  .chemical-profile-tabs {
    position: sticky;
    grid-template-columns: repeat(9, minmax(104px, 1fr));
    padding: 8px;
    border-left: 1px solid var(--dark-red);
    border-radius: 12px;
  }

  .chemical-profile-tab {
    border-left: 1px solid #2b5d85;
    border-radius: 9px;
    white-space: normal;
  }

  .chemical-profile-content-card {
    border-radius: 18px;
  }

  .command-snapshot-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .command-snapshot-provenance {
    text-align: left;
  }

  .erg-page,
  .erg-quick-facts {
    grid-template-columns: 1fr;
  }
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  line-height: 1.4;
}

.legend-item::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16);
  background: var(--gray);
}

.legend-item.red { border-color: rgba(255, 77, 77, 0.35); }
.legend-item.red::before { background: var(--red); }

.legend-item.orange { border-color: rgba(var(--gold-rgb), 0.35); }
.legend-item.orange::before { background: var(--orange); }

.legend-item.yellow { border-color: rgba(var(--gold-rgb), 0.35); }
.legend-item.yellow::before { background: var(--yellow); }

.legend-item.green { border-color: rgba(52, 211, 153, 0.35); }
.legend-item.green::before { background: var(--green); }

.legend-item.blue { border-color: rgba(90, 169, 255, 0.35); }
.legend-item.blue::before { background: var(--blue); }

.legend-item.purple { border-color: rgba(179, 136, 255, 0.35); }
.legend-item.purple::before { background: var(--purple); }

.legend-item.gray { border-color: rgba(143, 162, 184, 0.35); }
.legend-item.gray::before { background: var(--gray); }

.legend-item.black { border-color: rgba(15, 23, 42, 0.7); }
.legend-item.black::before { background: var(--black); }

.plume-map-frame {
  width: 100%;
  min-height: 680px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #0f172a;
}

.plume-source-marker {
  cursor: grab;
}

.plume-source-marker:active {
  cursor: grabbing;
}

.plume-model-controls {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.plume-model-controls-heading,
.plume-model-actions,
.plume-linked-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plume-model-controls-heading h3,
.plume-model-controls-heading .eyebrow,
.plume-model-controls-heading p {
  margin: 0;
}

.plume-model-controls-heading {
  align-self: start;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.plume-model-controls-heading .eyebrow {
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 950;
}

.plume-model-controls-heading #plume-input-status {
  max-width: 190px;
  color: var(--muted);
  text-align: left;
}

.plume-weather-verification {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
}

.plume-weather-verification strong {
  color: var(--text);
  font-weight: 600;
}

.plume-input-review {
  grid-column: 1 / -1;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0b1f33;
}

.plume-input-review > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  color: #0b1f33;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.plume-review-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 8px 7px;
}

.plume-review-list > div {
  display: grid;
  grid-template-columns: minmax(95px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  padding: 4px 0;
  border-top: 1px solid #e2e8f0;
}

.plume-review-list dt {
  color: #334155;
  font-size: 0.68rem;
  font-weight: 600;
}

.plume-review-list dd {
  min-width: 0;
  margin: 0;
  color: #0b1f33;
  font-size: 0.72rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.plume-status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #e8eef5;
  color: #0b1f33;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
}

.plume-status-badge[data-state="verified"] {
  border-color: #8bc99a;
  background: #e6f4ea;
}

.plume-status-badge[data-state="warning"],
.plume-status-badge[data-state="verify"] {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.plume-status-badge[data-state="missing"] {
  border-color: #e57373;
  background: #fde2e2;
}

#plume-input-status[data-state="error"] {
  padding: 5px 8px;
  border: 1px solid #e57373;
  border-radius: 7px;
  background: #fde2e2;
  color: #7f1d1d;
  font-weight: 600;
}

.plume-model-input-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.plume-model-section {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
}

.plume-model-section > strong {
  color: #071f36;
  font-size: 0.92rem;
  font-weight: 800;
}

.plume-model-section:first-child > strong { color: #c9141b; }
.plume-model-section:nth-child(2) > strong { color: #0d3457; }

.plume-model-section-grid {
  display: grid;
  gap: 6px;
}

.plume-release-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 0.9fr);
}

.plume-release-grid > label[for="plume-release-quantity"] {
  grid-column: span 2;
}

.container-profile {
  display: grid;
  grid-column: 1 / -1;
  gap: 7px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft-card);
}

.container-profile-heading {
  display: grid;
  gap: 3px;
}

.container-profile-title,
.container-profile-note {
  margin: 0;
}

.container-profile-title {
  color: #071f36;
  font-size: 0.82rem;
  font-weight: 700;
}

.container-profile-note {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.container-profile-controls {
  display: grid;
  gap: 10px;
  min-width: 0;
  grid-template-columns: repeat(15, minmax(0, 1fr));
}

.container-type-control { grid-column: 1 / span 3; grid-row: 1; }
.container-capacity-control { grid-column: 4 / span 3; grid-row: 1; }
.container-pressure-control { grid-column: 7 / span 4; grid-row: 1; }
.container-fill-control { grid-column: 11 / span 2; grid-row: 1; }
.container-release-control { grid-column: 13 / span 3; grid-row: 1; }
.container-size-control { grid-column: 1 / span 7; grid-row: 2; }
.container-pressure-profile-control { grid-column: 8 / span 8; grid-row: 2; }

.container-profile small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.45;
}

.container-bubble-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 6px;
}

.container-bubble {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 850;
}

.container-bubble > span {
  color: #fff;
  font-weight: 850;
}

.container-bubble select {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 28px 0 8px;
  border: 1px solid #aeb8c1;
  border-radius: 12px;
  background-color: #fff;
  color: #142b3f;
  font-size: 0.74rem;
  font-weight: 500;
  text-overflow: ellipsis;
}

.container-details {
  padding: 5px 8px;
  border: 1px solid #d1d7dc;
  border-radius: 9px;
  background: #eef1f3;
  color: #102a43;
}

.container-details > summary {
  color: #102a43;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 650;
}

.container-details[open] > summary { margin-bottom: 10px; }
.container-details .release-data-facts { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.container-detail-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.container-detail-fields label,
.pressure-override label {
  display: grid;
  gap: 5px;
  color: #102a43;
  font-size: 0.72rem;
  font-weight: 600;
}

.release-data-control {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.release-data-control[open] {
  box-shadow: 0 2px 8px rgba(7, 31, 54, 0.08);
}

.release-data-control.reference-control {
  background: #f0f3f5;
}

.release-data-control summary {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 58px;
  padding: 9px 26px 9px 10px;
  color: #071f36;
  cursor: pointer;
  list-style: none;
  position: relative;
  text-align: left;
}

.release-data-control summary::after {
  content: '▾';
  position: absolute;
  top: 11px;
  right: 6px;
  color: #d71920;
}

.release-data-control[open] summary::after { transform: rotate(180deg); }
.release-data-control summary > span { color: #4f5963; font-size: 0.7rem; font-weight: 650; line-height: 1.25; }
.release-data-control summary > strong { overflow-wrap: anywhere; font-size: 0.86rem; font-weight: 700; line-height: 1.5; }
.release-data-control:has(input[required], select[required]) summary > span::after {
  content: ' *';
  color: #d71920;
  font-size: 0.8rem;
}
.release-data-control > label,
.release-data-control > select,
.release-data-control > input,
.release-data-control > dl,
.release-data-control > .release-override-row { margin: 0 9px 9px; width: calc(100% - 18px); }
.release-data-control label { display: grid; gap: 5px; color: #273746; font-size: 0.74rem; font-weight: 650; line-height: 1.35; }
.release-override-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 0.45fr); gap: 6px; }
.release-data-facts { display: grid; gap: 5px; }
.release-data-facts > div { display: grid; gap: 1px; }
.release-data-facts dt { color: #102a43; font-size: 0.67rem; font-weight: 700; }
.release-data-facts dd { margin: 0; color: #102a43; font-size: 0.82rem; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }

.pressure-confidence-badge {
  display: inline-block;
  margin: 0 9px 8px;
  padding: 3px 7px;
  width: fit-content;
  border-radius: 999px;
  background: #e3ebf2;
  color: #29465f;
}

.pressure-condition-note {
  display: block;
  margin: 0 9px 9px;
  color: #102a43;
}

.pressure-override {
  margin: 0 9px 9px;
  padding: 7px;
  border: 1px solid #d4d9de;
  border-radius: 7px;
  background: #f7f8f9;
}

.pressure-override > summary {
  display: block;
  min-height: 0;
  padding: 2px 18px 2px 0;
  color: #102a43;
  font-size: 0.72rem;
  font-weight: 650;
}

.release-data-control .pressure-override > summary::after {
  top: 1px;
  right: 1px;
}

.pressure-override[open] > summary { margin-bottom: 8px; }
.pressure-override label + label { margin-top: 8px; }

@media (max-width: 1100px) {
  .container-bubble-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .container-details .release-data-facts,
  .container-detail-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .container-profile-controls { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .container-profile-controls > .release-data-control { grid-column: auto; grid-row: auto; }
}

@media (max-width: 760px) {
  .plume-release-grid { grid-template-columns: 1fr; }
  .plume-release-grid > label[for="plume-release-quantity"] { grid-column: auto; }
  .container-bubble-grid,
  .container-details .release-data-facts,
  .container-detail-fields { grid-template-columns: 1fr; }
  .container-profile-controls { grid-template-columns: 1fr; }
}

.container-profile input,
.container-profile select {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.container-profile-footer {
  display: none;
}

.plume-weather-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plume-weather-source-status {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plume-columbia-values {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.plume-model-field {
  display: grid;
  align-content: start;
  gap: 3px;
}

.plume-model-field > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.plume-release-grid .plume-model-field > span,
.plume-weather-grid .plume-model-field > span {
  color: #111;
  font-size: 0.8rem;
  font-weight: 900;
}

.plume-model-controls input,
.plume-model-controls select {
  width: 100%;
  min-height: 30px;
  padding: 4px 7px;
}

#plume-release-quantity::placeholder {
  color: #c9141b;
  font-weight: 400;
  opacity: 1;
}

@media (min-width: 1101px) {
  .container-bubble[for="container-capacity"] {
    grid-column: span 2;
  }
}

.plume-chemical-field {
  grid-column: 1 / -1;
}

.plume-chemical-search {
  position: relative;
}

.plume-linked-input input {
  min-width: 0;
  flex: 1;
  font-weight: 800;
}

.plume-linked-input button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.plume-quantity-input {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(68px, 3fr);
}

.plume-quantity-input input {
  min-width: 0;
  border-radius: 8px 0 0 8px;
}

.plume-quantity-input select {
  min-width: 0;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  font-weight: 800;
}

.plume-linked-input .ghost-btn {
  min-height: 32px;
  padding: 4px 8px;
  white-space: nowrap;
}

.plume-model-actions {
  display: flex;
  grid-column: 2;
  grid-row: 3;
  gap: 5px;
  justify-content: flex-end;
}

#use-live-plume-weather-btn {
  min-width: 132px;
  min-height: 32px;
  padding: 5px 12px;
  border: 2px solid #0d3457;
  background: linear-gradient(145deg, #1b527e, #0d3457);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 5px 12px rgba(13, 52, 87, 0.24);
  color: #fff;
  font-weight: 900;
}

#use-live-plume-weather-btn:hover,
#use-live-plume-weather-btn:focus-visible {
  border-color: #071f36;
  background: linear-gradient(145deg, #1d5684, #103b61);
  color: #fff;
}

.plume-plot-btn {
  min-width: 132px;
  min-height: 32px;
  padding: 5px 12px;
  border: 2px solid #8f0d12;
  border-radius: 12px;
  background: linear-gradient(135deg, #c81b22, #a10c13);
  box-shadow: 0 5px 12px rgba(183, 14, 22, 0.25);
  color: #fff;
  cursor: pointer;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plume-plot-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--yellow);
}

.plume-plot-btn:disabled {
  box-shadow: none;
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.55;
}

.demographics-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.demographics-heading h3,
.demographics-heading .eyebrow {
  margin-bottom: 4px;
}

.demographics-summary {
  margin: 8px 0 12px;
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.4;
}

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

.demographic-stat {
  display: grid;
  align-content: center;
  min-height: 64px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
  text-align: center;
}

.demographic-stat span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.demographic-stat strong {
  margin-top: 3px;
  color: #c9141b;
  font-size: 1rem;
}

.demographics-priorities {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
}

.demographics-priorities ul {
  display: grid;
  gap: 5px;
  margin: 7px 0 0;
  padding-left: 18px;
}

.demographics-source-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.35;
}

.demographics-estimate-warning {
  margin: 10px 0 0;
  padding: 7px 8px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: var(--gold-soft);
  color: #17202a;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.35;
}

#demographics-zone-badge {
  justify-content: center;
  min-width: 92px;
  text-align: center;
}

#demographics-zone-badge[data-zone-color='red'] {
  border-color: #c9141b;
  background: #d4d6d8;
  color: #c9141b;
}

#demographics-zone-badge[data-zone-color='yellow'] {
  border-color: var(--gold);
  background: var(--gold-surface);
  color: #111;
}

#demographics-zone-badge[data-zone-color='green'] {
  border-color: #17603a;
  background: #d4d6d8;
  color: #17603a;
}

@media (max-width: 900px) {
  .incident-form-grid {
    grid-template-columns: 1fr;
  }

  .facility-information-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .eplan-login-form {
    grid-template-columns: minmax(0, 1.6fr) minmax(120px, 0.55fr);
  }

  .eplan-logo,
  .eplan-login-form .primary-btn {
    grid-column: auto;
  }

  .plume-model-input-grid {
    grid-template-columns: 1fr;
  }

  .incident-field-wide,
  .incident-field-full {
    grid-column: auto;
  }

}

@media (max-width: 620px) {
  .plume-linked-input {
    align-items: stretch;
    flex-direction: column;
  }

  .eplan-login-form {
    grid-template-columns: minmax(0, 1.6fr) minmax(120px, 0.55fr);
  }

  .eplan-logo,
  .eplan-login-form .primary-btn {
    grid-column: auto;
  }

}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.workflow-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.card-grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-card.big { min-height: 210px; }

.detail-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.detail-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.detail-list span { color: var(--muted); }

.input-label { display: block; margin: 10px 0 6px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0c1420;
  color: var(--text);
}

.chip-list {
  display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0;
}
.chip-list li {
  padding: 8px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border);
}

.pill-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}

.tag {
  display: inline-block; padding: 6px 10px; border-radius: 999px; background: rgba(25, 184, 255, 0.15); color: var(--accent-2); font-size: 0.85rem;
}

.workflow-stages {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 10px;
}

.stage {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; text-align: center; min-height: 68px; display: flex; align-items: center; justify-content: center;
}

.logic-steps {
  display: grid; gap: 8px; margin-top: 10px;
}

.logic-step {
  display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border);
}

.logic-step strong { color: var(--accent-2); }

.hazard-card { border: 1px solid rgba(var(--gold-rgb), 0.35); }
.urgent-card {
  border: 2px solid rgba(var(--gold-rgb), 0.7);
  background: linear-gradient(135deg, rgba(var(--gold-rgb), 0.12), rgba(16, 27, 44, 0.95));
}
.big-label { font-size: 1.05rem; color: var(--muted); }
.action-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(7, 17, 31, 0.8);
  border: 1px solid var(--border);
}
.action-box h4 { margin: 0 0 8px; }
.action-box ul { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 6px; }
.status-pill {
  display: inline-block; margin-top: 10px; padding: 8px 12px; border-radius: 999px; background: rgba(25, 184, 255, 0.15); color: var(--accent-2);
}

.map-placeholder {
  min-height: 420px;
  background: linear-gradient(135deg, rgba(25, 184, 255, 0.16), rgba(var(--gold-rgb), 0.12));
  position: relative; overflow: hidden;
  border: 1px solid rgba(25, 184, 255, 0.25);
}

.map-hero {
  margin-bottom: 14px;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
}

.map-toolbar-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-toolbar-title span {
  color: var(--muted);
  font-size: 0.95rem;
}

.map-toolbar-actions, .map-toolbar-secondary, .map-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-toolbar-secondary {
  margin-top: 8px;
}

.map-action-row {
  margin-bottom: 16px;
}

.wind-arrow {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(25, 184, 255, 0.16);
  border: 1px solid rgba(25, 184, 255, 0.35);
  color: var(--accent-2);
  font-weight: 700;
  z-index: 2;
}

.map-placeholder p {
  position: absolute;
  bottom: 20px;
  left: 20px;
  max-width: 420px;
  color: var(--muted);
  z-index: 1;
}

.tier2-facility-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.tier2-facility-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(var(--gold-rgb), 0.45);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(var(--gold-rgb), 0.92);
  color: #0b1320;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.26);
}

.tier2-facility-pin:hover {
  transform: translate(-50%, -50%) scale(1.03);
}

.tier2-facility-card {
  position: absolute;
  right: 16px;
  top: 72px;
  width: min(320px, calc(100% - 32px));
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(25, 184, 255, 0.35);
  background: rgba(7, 17, 31, 0.96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

.tier2-facility-card h4 {
  margin: 0 0 8px;
  color: var(--accent-2);
}

.tier2-facility-card p {
  position: static;
  margin: 0 0 8px;
  color: var(--muted);
}

.tier2-facility-card a {
  color: var(--accent-2);
  font-weight: 700;
  text-decoration: none;
}

.map-legend {
  display: flex; flex-wrap: wrap; gap: 8px; position: absolute; top: 16px; left: 16px; z-index: 2;
}

.legend-item {
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: rgba(16, 27, 44, 0.95); font-size: 0.82rem;
}

.map-marker {
  position: absolute; padding: 8px 12px; border-radius: 999px; background: rgba(16, 27, 44, 0.95); border: 1px solid var(--border); cursor: grab; user-select: none; z-index: 3;
}

.map-marker.dragging { cursor: grabbing; }
.map-marker.hot { top: 90px; left: 90px; background: rgba(255, 77, 77, 0.9); }
.map-marker.warm { top: 160px; right: 130px; background: rgba(var(--gold-rgb), 0.9); }
.map-marker.cold { bottom: 110px; left: 220px; background: rgba(52, 211, 153, 0.9); }
.map-marker.plume { bottom: 80px; right: 120px; background: rgba(179, 136, 255, 0.9); }
.map-marker.entry { top: 220px; left: 180px; background: rgba(90, 169, 255, 0.9); }
.map-marker.decon { bottom: 140px; right: 220px; background: rgba(90, 169, 255, 0.9); }
.map-marker.monitor { top: 240px; right: 180px; background: rgba(179, 136, 255, 0.9); }
.map-marker.command { top: 300px; left: 320px; background: rgba(90, 169, 255, 0.9); }
.map-marker.staging { top: 300px; right: 260px; background: rgba(52, 211, 153, 0.9); }
.map-marker.road { top: 70px; right: 40px; background: rgba(143, 162, 184, 0.95); }
.map-marker.shelter { bottom: 70px; left: 80px; background: rgba(var(--gold-rgb), 0.9); }
.map-marker.evac { bottom: 40px; right: 220px; background: rgba(var(--gold-rgb), 0.9); }
.map-marker.sensitive { top: 130px; right: 40px; background: rgba(143, 162, 184, 0.95); }

.footer-note {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 14px;
  color: var(--muted);
}

.muted { color: var(--muted); }

.unit-secondary { font-size: 0.85em; color: var(--muted); font-weight: normal; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .topbar, .hero-card { flex-direction: column; align-items: flex-start; }
  .hero-stats, .card-grid, .workflow-grid, .mode-row, .workflow-stages, .compact-grid, .incident-layout { grid-template-columns: 1fr; }
  .facility-chemical-list { grid-template-columns: 1fr; }

  .chemical-id-search-card {
    min-height: 400px;
    background-image:
      linear-gradient(rgba(238, 247, 255, 0.26), rgba(238, 247, 255, 0.26)),
      url("assets/chemical-id-search-background-v2.webp");
  }

  .chemical-id-search-content {
    width: min(760px, 88%);
  }

  .chemical-search-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .chemical-search-form #save-my-chemical-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .chemical-search-form { grid-template-columns: 1fr; }
  .chemical-search-form #save-my-chemical-btn { grid-column: auto; }
  .chemical-search-form .primary-btn,
  .chemical-search-form .accent-btn { width: 100%; }
  .chemical-suggestion-select { grid-template-columns: 100px minmax(0, 1fr); }
  .chemical-suggestion.is-chemical-suggestion .chemical-suggestion-select { grid-template-columns: minmax(0, 1fr); }
  .chemical-linked-identifiers { margin-left: 10px; }

  .chemical-id-search-card {
    min-height: 0;
    padding: 18px;
    background-position: center, 68% center;
  }

  .chemical-id-search-content {
    width: 100%;
    box-sizing: border-box;
    padding: 18px;
    background: rgba(255, 255, 255, 0.92);
  }
}

/* HazMatIQ red / yellow command theme */
.command-console {
  background: linear-gradient(135deg, #171310, #251e19);
  border-color: #654d3f;
}

.console-topbar,
.console-footer {
  color: var(--yellow);
}

.console-btn {
  background: #2b221d;
  border-color: #6b5143;
}

.priority-btn {
  background: linear-gradient(135deg, #4b1618, #9f1219);
  border-color: #e32027;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22), 0 8px 20px rgba(0, 0, 0, 0.25);
}

.priority-btn:hover,
.console-btn:hover {
  background: linear-gradient(135deg, #751619, #c51a21);
  border-color: var(--yellow);
}

.mode-card,
.action-box,
.tier2-result-btn {
  background: rgba(25, 21, 18, 0.9);
}

.incident-input-card,
.tier2-card,
.hazard-card,
.specialist-card {
  border-color: rgba(var(--gold-rgb), 0.48);
  box-shadow: inset 0 0 0 1px rgba(var(--gold-rgb), 0.08);
}

.tier2-detail {
  background: rgba(var(--gold-rgb), 0.08);
  border-color: rgba(var(--gold-rgb), 0.32);
}

.tier2-result-btn strong,
.logic-step strong,
.tier2-facility-card h4,
.tier2-facility-card a {
  color: var(--yellow);
}

.first-responder-card,
.urgent-card {
  border-color: rgba(227, 32, 39, 0.8);
  background: linear-gradient(135deg, rgba(227, 32, 39, 0.18), rgba(33, 29, 26, 0.98));
}

.tag,
.status-pill,
.wind-arrow {
  background: rgba(var(--gold-rgb), 0.12);
  border-color: rgba(var(--gold-rgb), 0.35);
  color: var(--yellow);
}

input,
select,
textarea {
  background: #181310;
  border-color: #695346;
}

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

.map-placeholder {
  background: linear-gradient(135deg, rgba(227, 32, 39, 0.12), rgba(var(--gold-rgb), 0.08));
  border-color: rgba(var(--gold-rgb), 0.3);
}

.tier2-facility-pin {
  border-color: var(--yellow);
  background: var(--red);
  color: #fff;
}

.tier2-facility-card {
  border-color: rgba(var(--gold-rgb), 0.38);
  background: rgba(28, 23, 20, 0.97);
}

.map-legend .legend-item,
.map-marker {
  background-color: rgba(33, 29, 26, 0.96);
}

::selection {
  background: var(--yellow);
  color: #1c1714;
}

@media (max-width: 620px) {
  .topbar { padding: 18px; }
  .brand { gap: 13px; }
  .brand-emblem { width: 44px; height: 44px; flex-basis: 44px; border-width: 3px; }
  .brand-name { font-size: 2rem; }
  .brand-tagline { font-size: 0.58rem; letter-spacing: 0.2em; }
  .topbar-actions { width: 100%; }
  .topbar-actions button { flex: 1; }
}

/* Light-grey operational surfaces */
.module-btn,
.mode-card,
.tier2-result-btn,
.legend-item,
.map-marker {
  color: var(--text);
}

.primary-btn,
.accent-btn,
.priority-btn,
.console-btn {
  color: #fff;
}

.ghost-btn {
  background: #e3e6e9;
  border-color: #aeb5bc;
  color: var(--text);
}

.command-console {
  background: linear-gradient(135deg, #eceff1, #dfe3e6);
  border-color: #aeb5bc;
}

.console-topbar,
.console-footer {
  background: #fff;
  border-color: #bcc2c8;
  color: #9f1016;
}

.mode-card,
.action-box,
.tier2-result-btn {
  background: #eef0f2;
}

.tier2-detail {
  background: var(--gold-soft);
  border-color: var(--gold);
}

.tier2-result-btn strong,
.logic-step strong,
.tier2-facility-card h4,
.tier2-facility-card a {
  color: #a70f16;
}

.first-responder-card,
.urgent-card {
  background: linear-gradient(135deg, #fff3f3, #f2e7e7);
}

.specialist-card {
  background: linear-gradient(135deg, #fffbea, #eef0f2);
}

.tag,
.status-pill,
.wind-arrow {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: #3b3408;
}

input,
select,
textarea {
  background: #fff;
  border-color: #aeb5bc;
  color: var(--text);
}

.map-placeholder {
  background: linear-gradient(135deg, #eceff1, #dfe3e6);
  border-color: #aeb5bc;
}

.plume-map-frame {
  background: #e2e5e8;
  border-color: #aeb5bc;
}

.tier2-facility-card {
  background: rgba(250, 251, 252, 0.98);
  border-color: var(--gold);
}

.map-legend .legend-item,
.map-marker {
  background-color: rgba(250, 251, 252, 0.96);
}

.chip-list li,
.stage,
.logic-step,
.stat-box {
  background: var(--panel-2);
}

/* Command dashboard polished treatment using the Planning Tools blue. */
.sidebar .sidebar-card {
  background: #083b66;
  border: 2px solid var(--planning-blue);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 4px 0 0 rgba(111, 196, 255, 0.72),
    0 10px 28px rgba(7, 59, 105, 0.34),
    0 0 0 1px rgba(22, 131, 220, 0.24);
}

.sidebar .muted,
.sidebar-card.compact li {
  color: #dceeff;
}

.sidebar .module-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 50px;
  padding: 11px 16px;
  background: #fff;
  border-color: #cbd5e1;
  color: #071f36;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
}

.sidebar-card h2 {
  font-family: var(--hazmatiq-font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(7, 59, 105, 0.45);
}

.sidebar-card > .muted {
  font-size: 0.95rem;
}

.sidebar .module-btn:hover {
  background: #eef4fa;
  border-color: #071f36;
}

.sidebar .module-btn.active {
  background: #fff;
  border-color: #071f36;
  color: #071f36;
  box-shadow: inset 3px 0 0 #071f36;
}

.sidebar .home-logo-btn,
.sidebar .home-logo-btn:hover,
.sidebar .home-logo-btn.active {
  background: var(--gold-surface);
  border-color: var(--gold);
  color: #111;
  box-shadow: none;
}

.sidebar .my-chemicals-nav {
  color: #071f36 !important;
}

@media (max-width: 620px) {
  .chemical-results-header {
    align-items: stretch;
    flex-direction: column;
  }

  .chemical-result-actions {
    width: 100%;
    margin-left: 0;
  }

  .chemical-result-actions button {
    flex: 1;
  }

}

/* Compact default incident entry screen */
.layout {
  align-items: stretch;
}

.content-area {
  display: grid;
}

.content-area > .view {
  grid-area: 1 / 1;
}

.command-reference-stack {
  display: contents;
}

.command-reference-panel {
  min-width: 0;
  min-height: 96px;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.command-reference-panel > summary {
  position: relative;
  flex: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  background: inherit;
  cursor: pointer;
  font-size: 0.88rem;
  color: #0b1f33;
  font-weight: 700;
  overflow-wrap: anywhere;
  list-style: none;
}

.command-reference-panel > summary::-webkit-details-marker { display: none; }
.command-reference-panel > summary::before { content: "▸"; flex: 0 0 auto; }
.command-reference-panel[open] > summary::before { content: "▾"; }
.command-reference-panel[open] > summary { border-bottom: 1px solid var(--border); }

.command-reference-panel > summary.incident-image-bubble {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--red);
  border-radius: 16px;
  color: #fff;
  background: transparent;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  list-style: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, filter 160ms ease;
}

/* The artwork supplies the complete bubble treatment. Remove the legacy
   colored card eyebrows and use the responder-red schema color consistently. */
.command-reference-stack > .protective-summary-card,
.command-reference-stack > .ppe-summary-card,
.command-reference-stack > .medical-summary-card,
.command-reference-stack > .facility-information-card {
  border-color: var(--red);
  background: transparent;
}

.command-reference-stack > .command-reference-panel .command-reference-content {
  background: #f8fafc;
}

.command-reference-panel > summary.incident-image-bubble::before { content: none; }

.command-reference-panel > summary.incident-image-bubble:hover {
  border-color: var(--red);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
  transform: translateY(-2px);
}

.command-reference-panel > summary.incident-image-bubble:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -4px;
}

.command-reference-panel[open] > summary.incident-image-bubble {
  border-color: var(--red);
  border-bottom-color: var(--red);
  box-shadow: 0 0 0 2px rgba(193, 18, 31, 0.3), 0 14px 30px rgba(0, 0, 0, 0.34);
}

.incident-image-bubble__bg {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  pointer-events: none;
}

.incident-image-bubble__overlay {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

@media (max-width: 900px) {
  .command-reference-panel { min-height: 84px; }

  .command-reference-panel > summary.incident-image-bubble {
    min-height: 84px;
    border-radius: 14px;
  }
}

.command-reference-content {
  padding: 10px 12px;
  color: #0b1f33;
  font-weight: 400;
}

.command-reference-content strong {
  color: #0b1f33;
  font-weight: 600;
}

.command-reference-panel .eplan-login-form {
  grid-template-columns: minmax(0, 1fr);
}

.command-reference-panel .eplan-login-form .primary-btn {
  width: 100%;
  min-width: 0;
  color: #0b1f33;
  justify-self: stretch;
}

@media (max-width: 980px) {
  .command-reference-panel { padding: 0; }
}

/* Operational labels must wrap inside their existing cards, pills, and buttons. */
.incident-command-snapshot *,
.plume-model-controls * {
  min-width: 0;
}

.incident-command-snapshot button,
.incident-command-snapshot .status-pill,
.plume-model-controls button {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Chemical ID split workspace: bright industrial photo on the left and an
   all-navy Chemical Profile workspace on the right. */
#lookup .chemical-id-search-card {
  border-color: #1f537d;
  background-color: #0a2943;
  background-image:
    linear-gradient(115deg, rgba(235, 248, 255, 0.32), rgba(174, 220, 247, 0.16)),
    url("assets/chemical-id-search-background-v2.webp");
  background-blend-mode: screen, normal;
  box-shadow: inset 0 0 0 1px rgba(142, 203, 241, 0.16), 0 16px 36px rgba(2, 15, 27, 0.28);
}

#lookup .chemical-id-search-content {
  border-color: rgba(112, 174, 215, 0.62);
  color: #fff;
  background: rgba(4, 27, 46, 0.88);
  box-shadow: 0 18px 42px rgba(2, 15, 27, 0.3);
  backdrop-filter: blur(8px);
}

#lookup .chemical-id-search-card h3 {
  color: #fff;
  text-shadow: 0 2px 12px rgba(1, 14, 25, 0.55);
}

#lookup .chemical-id-search-card #chemical-search {
  border-color: #39739e;
  color: #fff;
  background: rgba(5, 34, 57, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#lookup .chemical-id-search-card #chemical-search::placeholder {
  color: #b9d0e1;
}

#lookup .chemical-id-search-card #chemical-search:focus {
  border-color: var(--gold);
  outline-color: rgba(var(--gold-rgb), 0.35);
}

#lookup #chemical-lookup-btn,
#lookup #open-plume-btn {
  border-color: var(--gold);
  color: #071f36;
  background: linear-gradient(180deg, var(--gold), var(--gold));
}

#lookup #save-my-chemical-btn,
#lookup #profile-save-chemical-btn,
#lookup #open-guided-response-btn,
#lookup #chemical-profile-back-btn {
  border-color: #39739e;
  color: #e8f5ff;
  background: #0b3557;
}

#lookup #save-my-chemical-btn:hover,
#lookup #profile-save-chemical-btn:hover,
#lookup #open-guided-response-btn:hover,
#lookup #chemical-profile-back-btn:hover {
  border-color: var(--gold);
  background: #124a75;
}

#chemical-id-results {
  padding: 12px;
  border: 1px solid #1f537d;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #061f34, #031525);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 36px rgba(2, 15, 27, 0.3);
}

#chemical-id-results .chemical-profile-header-card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "actions" "heading" "summary" "meta";
  border-color: #2e678f;
  background:
    radial-gradient(circle at 86% 28%, rgba(77, 167, 220, 0.22), transparent 28%),
    linear-gradient(135deg, #0b3557, #061f34 72%);
}

#chemical-id-results .chemical-profile-actions {
  width: 100%;
  max-width: none;
  margin: 0;
  justify-content: flex-end;
}

#chemical-id-results .chemical-profile-tabs {
  border-color: #24597f;
  background: #061f34;
}

#chemical-id-results .chemical-profile-tab {
  border-color: #214f72;
  color: #d8eafb;
  background: #0a2d49;
}

#chemical-id-results .chemical-profile-tab:hover,
#chemical-id-results .chemical-profile-tab:focus-visible {
  border-color: #5a91ba;
  background: #10466f;
}

#chemical-id-results .chemical-profile-tab.active {
  border-color: var(--gold);
  color: #071f36;
  background: var(--gold-surface);
}

#chemical-id-results .chemical-profile-section,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-section,
#chemical-id-results .erg-profile-table,
#chemical-id-results .erg-profile-summary,
#chemical-id-results .hybrid-decon-section {
  border-color: #24597f;
  border-top-color: #3d7daa;
  color: #eef7ff;
  background: linear-gradient(145deg, #0b3557, #082944);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 20px rgba(1, 14, 25, 0.22);
}

#chemical-id-results .chemical-profile-section h4,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-section h4,
#chemical-id-results .chemical-treatment-column h5,
#chemical-id-results .erg-profile-table h4 {
  color: #fff;
}

#chemical-id-results .chemical-profile-row,
#chemical-id-results .chemical-profile-list-row,
#chemical-id-results .chemical-profile-value-list li,
#chemical-id-results .chemical-treatment-column li,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-row,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-list-row,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-value-list li,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-treatment-column li {
  border-color: #24597f;
  color: #e8f5ff;
  background: #061f34;
}

#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-row > span,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-row strong,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-value-list,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-list,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-list-row strong,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-list-row span,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-treatment-column h5 {
  color: #e8f5ff;
}

#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-row > span,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-list-row strong {
  color: #9fc3dc;
}

#chemical-id-results .chemical-profile-meta-item,
#chemical-id-results .chemical-profile-meta-item[data-field="cas"],
#chemical-id-results .chemical-profile-meta-item[data-field="un-na"],
#chemical-id-results .chemical-profile-meta-item[data-field="erg"],
#chemical-id-results .chemical-profile-meta-item[data-field^="idlh"] {
  border-color: #39739e;
  color: #fff;
  background: #061f34;
}

#chemical-id-results .chemical-profile-meta-item .chemical-profile-meta-title,
#chemical-id-results .chemical-profile-meta-item .chemical-profile-meta-value,
#chemical-id-results .chemical-profile-meta-item[data-field] .chemical-profile-meta-title,
#chemical-id-results .chemical-profile-meta-item[data-field] .chemical-profile-meta-value {
  color: #e8f5ff;
}

#chemical-id-results .chemical-profile-meta-item[data-field^="idlh"] {
  border-color: var(--gold);
}

#chemical-id-results .chemical-profile-source-summary,
#chemical-id-results .chemical-profile-empty-state {
  border-color: #24597f;
  color: #cfe6f7;
  background: #061f34;
}

#chemical-id-results .chemical-profile-source-summary p {
  color: #9fc3dc;
}

#chemical-id-results .erg-profile-table-wrap,
#chemical-id-results .erg-profile-table tbody tr:nth-child(even) {
  border-color: #24597f;
  color: #e8f5ff;
  background: #061f34;
}

#chemical-id-results .erg-profile-table table,
#chemical-id-results .erg-profile-table td {
  color: #e8f5ff;
  border-color: #24597f;
}

#chemical-id-results .erg-profile-table th {
  border-color: #39739e;
  color: #fff;
  background: #10466f;
}

#chemical-id-results .hybrid-decon-link {
  border-color: #39739e;
  background: #031525;
}

#chemical-id-results .chemical-profile-content[data-active-tab="overview"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

#chemical-id-results .chemical-profile-content[data-active-tab="overview"] > * {
  min-width: 0;
}

@media (min-width: 1200px) {
  .layout:has(#lookup.active) > .content-area {
    min-height: 0;
  }

  .layout:has(#lookup.active) #lookup.active:has(#chemical-id-results:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(360px, 48fr) minmax(520px, 52fr);
    grid-template-rows: minmax(680px, calc(100dvh - 205px));
    gap: 10px;
    align-items: stretch;
    min-height: 680px;
  }

  #lookup.active:has(#chemical-id-results:not([hidden])) > .chemical-id-search-card {
    grid-column: 1;
    grid-row: 1;
    align-content: center;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: clamp(20px, 2.3vw, 38px);
    border-radius: 18px 0 0 18px;
    background-position: center, 61% center;
  }

  #lookup.active:has(#chemical-id-results:not([hidden])) .chemical-id-search-content {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
  }

  #lookup.active:has(#chemical-id-results:not([hidden])) .chemical-search-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #lookup.active:has(#chemical-id-results:not([hidden])) #save-my-chemical-btn {
    grid-column: 1 / -1;
  }

  #lookup.active:has(#chemical-id-results:not([hidden])) > #chemical-id-results {
    grid-column: 2;
    grid-row: 1;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 0 18px 18px 0;
  }

  #lookup.active:has(#chemical-id-results:not([hidden])) .chemical-results-header {
    display: none;
  }

  #lookup.active:has(#chemical-id-results:not([hidden])) .chemical-profile-shell {
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    margin: 0;
  }

  #lookup.active:has(#chemical-id-results:not([hidden])) .chemical-profile-layout,
  #lookup.active:has(#chemical-id-results:not([hidden])) .chemical-profile-content-card {
    min-height: 0;
  }

  #lookup.active:has(#chemical-id-results:not([hidden])) .chemical-profile-layout {
    grid-template-rows: auto minmax(0, 1fr);
  }

  #lookup.active:has(#chemical-id-results:not([hidden])) .chemical-profile-content {
    max-height: none;
    height: 100%;
    min-height: 0;
    overflow: auto;
  }
}

@media (max-width: 1199px) {
  #chemical-id-results .chemical-profile-content[data-active-tab="overview"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #chemical-id-results .chemical-profile-content[data-active-tab="overview"] {
    grid-template-columns: 1fr;
  }
}

.threat-zone-summary h3 {
  margin: 0 0 4px;
  color: #0b1f33;
  font-size: 0.88rem;
}

.threat-zone-summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 10px;
  margin: 0 0 8px;
  padding: 7px;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  background: #eef2f5;
}

.threat-zone-summary-list div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  min-width: 0;
}

.threat-zone-summary-list dt {
  color: #526272;
  font-size: 0.62rem;
  font-weight: 800;
}

.threat-zone-summary-list dd {
  min-width: 0;
  margin: 0;
  color: #0b1f33;
  font-size: 0.65rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

#plume .threat-zone-primary-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

#plume .threat-zone-primary-metrics .demographic-stat {
  min-height: 72px;
  background: #f2f4f6;
  color: #0b1f33;
}

#plume .threat-zone-primary-metrics .demographic-stat[hidden] {
  display: none;
}

#plume .threat-zone-primary-metrics .demographic-stat strong {
  color: #0b1f33;
  font-size: 1.2rem;
}

#plume .threat-zone-primary-metrics .demographic-stat small {
  margin-top: 3px;
  color: #526272;
  font-size: 0.61rem;
  line-height: 1.25;
}

.threat-zone-estimate-details {
  margin-top: 7px;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  background: #f7f9fb;
}

.threat-zone-estimate-details[hidden] { display: none; }

.threat-zone-estimate-details > summary {
  padding: 6px 8px;
  color: #0b1f33;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 850;
}

.threat-zone-estimate-details dl {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0 8px 8px;
}

.threat-zone-estimate-details dl div {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
  gap: 7px;
  font-size: 0.65rem;
}

.threat-zone-estimate-details dl div[hidden] { display: none; }
.threat-zone-estimate-details dt { color: #526272; }
.threat-zone-estimate-details dd { margin: 0; color: #0b1f33; overflow-wrap: anywhere; }

@media (max-width: 520px) {
  .threat-zone-summary-list,
  #plume .threat-zone-primary-metrics {
    grid-template-columns: 1fr;
  }
}

/* Unified HazMatIQ command-platform shell and shared page heroes. */
:root {
  --hazmat-navy: #061a2e;
  --hazmat-navy-2: #0b1f33;
  --hazmat-card: #102a43;
  --hazmat-card-2: #143b5d;
  --hazmat-border: #406b91;
  --hazmat-gutter: #e5e7eb;
  --hazmat-text: #f8fafc;
  --hazmat-text-2: #dde7f2;
  --hazmat-muted: #b8c7d9;
  --hazmat-label: #e2e8f0;
  --hazmat-yellow: var(--gold);
  --hazmat-red: #c1121f;
  --hazmat-blue: #2e8cff;
}

.app-shell {
  padding: var(--app-top-space, 8px);
  background: var(--hazmat-gutter);
}

.layout,
.layout:has(#incident.active),
.layout:has(#lookup.active),
.layout:has(#plume.active),
.layout:has(#map.active) {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.layout > .content-area,
.layout:has(#plume.active) > .content-area,
.layout:has(#map.active) > .content-area {
  grid-column: 1;
  width: 100%;
  min-width: 0;
}

/* Command-header refinement cascade lock. */
.hazmat-command-bar.topbar {
  grid-template-columns: 44px minmax(320px, auto) minmax(300px, 0.85fr) minmax(560px, 1.35fr) 50px 44px;
  min-height: 98px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #0c3152 0%, #082540 52%, #061a2e 100%);
}

#overview.view.active {
  display: grid;
  min-height: calc(100dvh - 126px);
}

.incident-overview-card {
  display: grid;
  min-height: inherit;
}

.incident-overview-actions {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  grid-template-rows: none;
  gap: clamp(14px, 1.5vw, 24px);
  min-height: inherit;
}

.incident-overview-actions .overview-action-btn {
  min-height: clamp(300px, calc(100dvh - 150px), 590px);
  padding: clamp(20px, 2.3vw, 34px);
  border-width: 4px;
  background: #0b2944;
}

.incident-overview-actions .overview-action-btn::after {
  background: linear-gradient(90deg, rgba(5, 23, 39, 0.98) 0%, rgba(7, 34, 57, 0.93) 39%, rgba(7, 34, 57, 0.45) 68%, rgba(7, 34, 57, 0.05) 100%);
}

.overview-action-copy { width: min(72%, 520px); }
.overview-action-title,
.overview-action-description { color: #fff; text-shadow: 0 2px 5px rgba(0, 0, 0, 0.72); }
.overview-action-arrow { color: var(--gold); }
.overview-action-incident .overview-action-copy { transform: none; }
.overview-action-incident .overview-action-title { white-space: normal; }

.incident-overview-actions .overview-action-active {
  --overview-accent: var(--gold);
  --overview-accent-rgb: var(--gold-rgb);
}

.incident-overview-actions .overview-action-reports {
  --overview-accent: #2e8cff;
  --overview-accent-rgb: 46, 140, 255;
}

.incident-overview-actions .overview-action-active::before { background-position: center bottom; }
.incident-overview-actions .overview-action-reports::before { background-position: center center; }

.content-area > .view > .hazmat-page-hero {
  min-height: 214px;
  max-height: none;
  padding: 28px 30px;
  color: #fff;
}

#map > .hazmat-page-hero,
.content-area > .view > .hazmat-page-hero-compact,
.content-area > .view > .hazmat-page-hero.compact {
  min-height: 176px;
  max-height: none;
  padding: 21px 25px;
}

@media (max-width: 1680px) {
  .hazmat-command-bar.topbar {
    grid-template-columns: 44px minmax(300px, auto) minmax(340px, 1fr) 50px 44px;
  }

  .hazmat-command-nav.module-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(9, minmax(84px, 1fr));
  }
}

@media (max-width: 1000px) {
  .hazmat-command-bar.topbar { grid-template-columns: 44px minmax(0, 1fr) 48px 44px; }
  .hazmat-command-context.notification-center { grid-column: 1 / -1; grid-row: 2; }
  .hazmat-command-nav.module-nav { grid-column: 1 / -1; grid-row: 3; display: flex; overflow-x: auto; }
  .hazmat-command-nav .module-btn { flex: 0 0 104px; }
  .incident-overview-actions .overview-action-btn { min-height: 320px; }
}

@media (max-width: 700px) {
  .hazmat-command-bar.topbar { grid-template-columns: 40px minmax(0, 1fr) 40px; padding: 8px; }
  .department-logo-link { display: none; }
  .hazmat-command-incident { display: none; }
  #overview.view.active { min-height: auto; }
  .incident-overview-actions { grid-template-columns: 1fr; }
  .incident-overview-actions .overview-action-btn { min-height: 245px; }
  .content-area > .view > .hazmat-page-hero,
  #map > .hazmat-page-hero { min-height: 170px; padding: 18px; }
}

/* HazMatIQ command header and landing-page refinement. Keep this block last. */
body {
  background: #e8edf2;
}

.app-shell {
  background: #e8edf2;
}

.hazmat-command-bar.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  grid-template-columns: 44px minmax(320px, auto) minmax(300px, 0.85fr) minmax(560px, 1.35fr) 50px 44px;
  min-height: 98px;
  padding: 10px 14px;
  gap: 10px;
  border: 1px solid #315d82;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, #0c3152 0%, #082540 52%, #061a2e 100%);
  box-shadow: 0 9px 24px rgba(6, 26, 46, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.command-menu-toggle,
.command-profile-control {
  display: grid;
  width: 44px;
  height: 44px;
  place-content: center;
  gap: 5px;
  padding: 0;
  border: 1px solid #406b91;
  border-radius: 9px;
  background: #0d2d49;
  color: #fff;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.command-menu-toggle span {
  display: block;
  width: 21px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.command-profile-control {
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.command-menu-toggle:hover,
.command-profile-control:hover {
  border-color: #69adff;
  background: #15598a;
  transform: translateY(-1px);
}

.command-menu-toggle:focus-visible,
.command-profile-control:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.hazmatiq-logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  color: #fff;
}

.hazmatiq-logo-placard {
  display: grid;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  overflow: hidden;
  border: 2px solid #fff;
  background: #fff;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.34);
  transform: rotate(45deg);
}

.hazmatiq-logo-placard i {
  display: grid;
  place-items: center;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.65);
  transform: rotate(-45deg);
}

.hazmatiq-logo-placard .logo-fire { background: #d71920; }
.hazmatiq-logo-placard .logo-health { background: #1765b0; }
.hazmatiq-logo-placard .logo-reactivity { background: var(--gold); color: #071524; text-shadow: none; }
.hazmatiq-logo-placard .logo-special { background: #fff; color: #15344e; text-decoration: line-through; text-shadow: none; }

.hazmatiq-logo-type {
  display: grid;
  min-width: 0;
  gap: 1px;
  line-height: 1;
}

.hazmatiq-logo-word {
  display: flex;
  align-items: baseline;
  white-space: nowrap;
  font-family: var(--hazmatiq-font-heading);
  font-size: clamp(2rem, 2.3vw, 2.7rem);
  font-weight: 950;
  letter-spacing: -0.035em;
}

.hazmatiq-logo-word b {
  color: #fff;
  background: linear-gradient(180deg, #fff 0%, #fff 32%, #cbd8e2 58%, #fff 82%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.hazmatiq-logo-word strong {
  color: var(--gold);
  background: linear-gradient(180deg, var(--gold) 4%, var(--gold) 50%, #dc5a12 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.42));
}

.hazmatiq-logo-type small {
  color: #fff;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hazmat-command-identity {
  gap: 16px;
}

.hazmat-command-incident {
  flex: 0 1 155px;
}

.hazmat-command-nav.module-nav {
  gap: 2px;
  padding: 3px;
  border: 1px solid #315d82;
  border-radius: 10px;
  background: rgba(5, 22, 38, 0.55);
}

.hazmat-command-nav .module-btn,
.hazmat-nav-button {
  min-height: 34px;
  border-color: transparent;
  border-radius: 6px;
  background: #0d2d49;
}

.hazmat-command-nav .module-btn:hover,
.hazmat-command-nav .module-btn:focus-visible {
  border-color: #69adff;
  background: #15598a;
}

.hazmat-command-nav .module-btn.active {
  border-color: var(--gold);
  background: var(--gold-surface);
  color: #061a2e !important;
  box-shadow: inset 0 -3px 0 rgba(var(--gold-rgb), 0.2), 0 0 12px rgba(var(--gold-rgb), 0.22);
}

.hazmat-command-bar .department-logo {
  width: 48px;
  height: 48px;
}

.workspace-drawer-backdrop {
  position: fixed;
  z-index: 210;
  inset: 0;
  background: rgba(3, 14, 25, 0.62);
  backdrop-filter: blur(2px);
}

.workspace-navigation-drawer {
  position: fixed;
  z-index: 220;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(360px, 90vw);
  overflow-y: auto;
  border-right: 1px solid #406b91;
  background: linear-gradient(160deg, #0d3457 0%, #082540 48%, #061a2e 100%);
  color: #fff;
  box-shadow: 18px 0 45px rgba(2, 13, 23, 0.5);
}

.workspace-drawer-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 20px 16px;
  border-bottom: 1px solid #315d82;
  background: #082540;
}

.workspace-drawer-header p,
.workspace-drawer-header h2 { margin: 0; }
.workspace-drawer-header p { color: var(--gold); font-size: 0.68rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.workspace-drawer-header h2 { margin-top: 4px; color: #fff; font-size: 1.25rem; }

.workspace-drawer-close {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #5e83a4;
  border-radius: 7px;
  background: #102f4b;
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.workspace-drawer-nav {
  display: grid;
  gap: 7px;
  padding: 16px 18px 28px;
}

.workspace-drawer-nav .module-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 45px;
  padding: 9px 13px;
  border: 1px solid #315d82;
  border-radius: 8px;
  background: #0d2d49;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.workspace-drawer-nav .module-btn:hover,
.workspace-drawer-nav .module-btn:focus-visible {
  border-color: #69adff;
  background: #15598a;
}

.workspace-drawer-nav .module-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.workspace-drawer-nav .module-btn:disabled { cursor: not-allowed; opacity: 0.58; }
.workspace-drawer-nav small { color: #bfd0df; font-size: 0.63rem; }
body.workspace-drawer-open { overflow: hidden; }

#overview.view.active {
  display: grid;
  min-height: calc(100dvh - 126px);
}

.incident-overview-card {
  display: grid;
  min-height: inherit;
}

.incident-overview-actions {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  grid-template-rows: none;
  gap: clamp(14px, 1.5vw, 24px);
  min-height: inherit;
}

.incident-overview-actions .overview-action-btn {
  min-height: clamp(300px, calc(100dvh - 150px), 590px);
  padding: clamp(20px, 2.3vw, 34px);
  border-width: 4px;
  background: #0b2944;
}

.incident-overview-actions .overview-action-btn::after {
  background: linear-gradient(90deg, rgba(5, 23, 39, 0.98) 0%, rgba(7, 34, 57, 0.93) 39%, rgba(7, 34, 57, 0.45) 68%, rgba(7, 34, 57, 0.05) 100%);
}

.overview-action-copy {
  width: min(72%, 520px);
}

.overview-action-title,
.overview-action-description { color: #fff; text-shadow: 0 2px 5px rgba(0, 0, 0, 0.72); }
.overview-action-arrow { color: var(--gold); text-shadow: 0 2px 5px rgba(0, 0, 0, 0.55); }
.overview-action-incident .overview-action-copy { transform: none; }
.overview-action-incident .overview-action-title { white-space: normal; }

.incident-overview-actions .overview-action-active {
  --overview-accent: var(--gold);
  --overview-accent-rgb: var(--gold-rgb);
}

.incident-overview-actions .overview-action-reports {
  --overview-accent: #2e8cff;
  --overview-accent-rgb: 46, 140, 255;
}

.incident-overview-actions .overview-action-active::before { background-position: center bottom; }
.incident-overview-actions .overview-action-reports::before { background-position: center center; }

.hazmat-page-hero,
.content-area > .view > .hazmat-page-hero {
  min-height: 214px;
  max-height: none;
  padding: 28px 30px;
  border-color: #406b91;
  background-color: #082540;
  background-repeat: no-repeat;
  background-size: cover;
  color: #fff;
}

.hazmat-page-hero-compact,
.hazmat-page-hero.compact,
#map > .hazmat-page-hero {
  min-height: 176px;
  max-height: none;
  padding: 21px 25px;
}

.hazmat-hero-title,
.hazmat-page-hero-compact .hazmat-hero-title,
.hazmat-page-hero.compact .hazmat-hero-title {
  color: #fff !important;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  text-shadow: 0 3px 9px rgba(0, 0, 0, 0.72);
}

.hazmat-page-hero-compact .hazmat-hero-title,
.hazmat-page-hero.compact .hazmat-hero-title { font-size: clamp(1.9rem, 3.2vw, 3.2rem); }
.hazmat-hero-subtitle { color: #f4f8fb !important; font-size: clamp(0.96rem, 1.25vw, 1.12rem); font-weight: 650; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7); }
.hazmat-hero-eyebrow { text-shadow: 0 2px 5px rgba(0, 0, 0, 0.65); }

.variant-planning {
  background-image: linear-gradient(90deg, rgba(6, 26, 46, 0.98) 0%, rgba(8, 37, 64, 0.86) 42%, rgba(8, 37, 64, 0.18) 78%), url("assets/home-card-scenes-v5.webp") !important;
  background-position: center, center center;
  background-size: cover, 100% 300% !important;
}

.variant-incident {
  background-image: linear-gradient(90deg, rgba(6, 26, 46, 0.98) 0%, rgba(8, 37, 64, 0.82) 48%, rgba(8, 37, 64, 0.2) 100%), url("assets/chemical-id-search-background-v2.webp") !important;
  background-position: center, center 60%;
}

.variant-chemical,
.variant-chemical-profile {
  background-image: linear-gradient(90deg, rgba(6, 26, 46, 0.99) 0%, rgba(8, 37, 64, 0.88) 48%, rgba(8, 37, 64, 0.22) 100%), url("assets/chemical-id-search-background-v2.webp") !important;
  background-position: center, center 50%;
}

.variant-guided-response {
  background-image: linear-gradient(90deg, rgba(6, 26, 46, 0.99) 0%, rgba(8, 37, 64, 0.84) 48%, rgba(8, 37, 64, 0.18) 100%), url("assets/guided-response-hero.webp") !important;
  background-position: center, center 45%;
}

.variant-monitoring {
  background-image: linear-gradient(90deg, rgba(6, 26, 46, 0.99), rgba(8, 37, 64, 0.74) 56%, rgba(8, 37, 64, 0.22)), url("assets/home-card-scenes-v5.webp") !important;
  background-position: center, center bottom;
  background-size: cover, 100% 300% !important;
}

.variant-reports,
.variant-about {
  background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(75, 151, 214, 0.12) 32px), repeating-linear-gradient(90deg, transparent 0 31px, rgba(75, 151, 214, 0.12) 32px), linear-gradient(120deg, #061a2e, #0d3a60 70%, #15598a) !important;
}

.variant-my-chemicals {
  background-image: radial-gradient(circle at 79% 34%, rgba(52, 211, 153, 0.28) 0 8px, transparent 9px), radial-gradient(circle at 89% 61%, rgba(46, 140, 255, 0.32) 0 11px, transparent 12px), linear-gradient(145deg, transparent 72%, rgba(133, 210, 255, 0.19) 72.5% 73%, transparent 73.5%), linear-gradient(120deg, #061a2e, #0d3a60 67%, #15526e) !important;
}

.hazmatiq-logo-lockup-hero { transform: scale(0.9); transform-origin: left center; }

@media (min-width: 1200px) {
  #lookup.active:has(#chemical-id-results:not([hidden])) {
    grid-template-columns: minmax(360px, 48fr) minmax(520px, 52fr);
    grid-template-rows: auto minmax(680px, calc(100dvh - 430px));
  }

  #lookup.active:has(#chemical-id-results:not([hidden])) > .hazmat-page-hero { grid-column: 1 / -1; grid-row: 1; }
  #lookup.active:has(#chemical-id-results:not([hidden])) > .chemical-id-search-card { grid-column: 1; grid-row: 2; }
  #lookup.active:has(#chemical-id-results:not([hidden])) > #chemical-id-results { grid-column: 2; grid-row: 2; }
}

@media (max-width: 1680px) {
  .hazmat-command-bar.topbar {
    grid-template-columns: 44px minmax(300px, auto) minmax(340px, 1fr) 50px 44px;
  }

  .hazmat-command-nav.module-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(9, minmax(84px, 1fr));
  }
}

@media (max-width: 1000px) {
  .hazmat-command-bar.topbar {
    grid-template-columns: 44px minmax(0, 1fr) 48px 44px;
  }

  .hazmat-command-context.notification-center {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .hazmat-command-nav.module-nav {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    overflow-x: auto;
  }

  .hazmat-command-nav .module-btn { flex: 0 0 104px; }
  .incident-overview-actions .overview-action-btn { min-height: 320px; }
}

@media (max-width: 700px) {
  .hazmat-command-bar.topbar {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    padding: 8px;
  }

  .command-menu-toggle,
  .command-profile-control { width: 40px; height: 40px; }
  .department-logo-link { display: none; }
  .hazmat-command-incident { display: none; }
  .hazmatiq-logo-lockup { gap: 10px; }
  .hazmatiq-logo-placard { flex-basis: 40px; width: 40px; height: 40px; }
  .hazmatiq-logo-word { font-size: clamp(1.55rem, 8vw, 2rem); }
  .hazmatiq-logo-type small { font-size: 0.53rem; letter-spacing: 0.13em; }
  .hazmat-command-context .notification-feed { grid-template-columns: repeat(3, minmax(118px, 1fr)); overflow-x: auto; }
  .hazmat-command-context.notification-center { grid-template-columns: minmax(0, 1fr) auto; }
  #overview.view.active { min-height: auto; }
  .incident-overview-actions { grid-template-columns: 1fr; }
  .incident-overview-actions .overview-action-btn { min-height: 245px; }
  .overview-action-copy { width: 78%; }
  .hazmat-page-hero,
  .content-area > .view > .hazmat-page-hero,
  #plume > .plume-page-header,
  .hazmat-page-hero-compact,
  .hazmat-page-hero.compact,
  #map > .hazmat-page-hero { min-height: 170px; padding: 18px; }
}

@media (max-width: 430px) {
  .hazmatiq-logo-type small { display: none; }
  .hazmatiq-logo-word { font-size: 1.5rem; }
  .hazmatiq-logo-placard { flex-basis: 36px; width: 36px; height: 36px; }
  .hazmat-command-context .notification-alert-count { display: none; }
  .overview-action-copy { width: 88%; }
}

@media (max-width: 1450px) {
  .hazmat-command-bar.topbar {
    grid-template-columns: minmax(220px, auto) minmax(0, 1fr) auto;
  }

  .hazmat-command-context { grid-column: 2; }
  .hazmat-command-nav.module-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(9, minmax(78px, 1fr));
  }
}

@media (max-width: 900px) {
  .hazmat-command-bar.topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px;
  }

  .hazmat-command-context.notification-center {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .hazmat-command-nav.module-nav {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    gap: 5px;
    padding-bottom: 3px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .hazmat-command-nav .module-btn {
    flex: 0 0 auto;
    min-width: 92px;
  }

  .hazmat-command-bar .department-logo { width: 44px; height: 44px; }
  .hazmat-page-hero { min-height: 148px; padding: 16px; }
}

@media (max-width: 620px) {
  .hazmat-command-identity { align-items: flex-start; flex-direction: column; gap: 4px; }
  .hazmat-command-bar .brand-logo { width: 138px; height: 42px; }
  .hazmat-command-incident { padding-left: 0; border-left: 0; }
  .hazmat-command-context .notification-feed { grid-template-columns: repeat(3, minmax(112px, 1fr)); overflow-x: auto; }
  .hazmat-command-context.notification-center { grid-template-columns: minmax(0, 1fr); }
  .hazmat-command-context .notification-alert-count { justify-self: start; }
  .hazmat-page-hero { min-height: 132px; }
  .hazmat-page-hero::after { right: -90px; }
  .hazmat-hero-title { font-size: clamp(1.45rem, 8vw, 2.1rem); }
  .hazmat-hero-chip-row { margin-top: 9px; }
}

/* Hero plume graphic and completed-required-field state. */
#plume .plume-page-header {
  justify-content: flex-start;
}

#plume .plume-hero-plume {
  display: grid;
  place-items: center;
  flex: 0 0 94px;
  width: 94px;
  height: 56px;
  border: 1px solid rgba(64, 107, 145, 0.9);
  border-radius: 11px;
  background: linear-gradient(145deg, #143b5d, #061a2e 68%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 5px 12px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

#plume .plume-hero-plume svg {
  display: block;
  width: 88px;
  height: 52px;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.26));
}

#plume .plume-hero-shadow {
  fill: rgba(0, 0, 0, 0.3);
}

#plume .plume-hero-zone {
  stroke-width: 1.25;
  transform-box: fill-box;
  transform-origin: center;
}

#plume .plume-hero-zone.zone-one { fill: url(#plume-aegl-one); stroke: var(--gold); transform: skewY(-2deg); }
#plume .plume-hero-zone.zone-two { fill: url(#plume-aegl-two); stroke: var(--gold); transform: translateY(1px) skewY(-2deg); }
#plume .plume-hero-zone.zone-three { fill: url(#plume-aegl-three); stroke: #ff5960; transform: translateY(2px) skewY(-2deg); }
#plume .plume-hero-centerline { fill: none; stroke: rgba(255, 255, 255, 0.82); stroke-width: 1; stroke-dasharray: 3 2; }
#plume .plume-hero-source { fill: #fff; stroke: #d71920; stroke-width: 3; }

#plume .plume-required-field.is-complete input,
#plume .plume-required-field.is-complete select {
  border: 1px solid #7996af !important;
}

#plume .plume-required-field.is-complete input:focus,
#plume .plume-required-field.is-complete select:focus {
  outline-color: rgba(46, 140, 255, 0.2);
}

#plume .plume-planning-notices {
  margin-top: 10px;
  border-top: 1px solid #406b91;
  padding-top: 8px;
}

#plume .plume-planning-notices p {
  margin: 4px 0;
  color: #dce9f4;
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 620px) {
  #plume .plume-hero-plume {
    flex-basis: 76px;
    width: 76px;
    height: 48px;
  }

  #plume .plume-hero-plume svg {
    width: 72px;
    height: 44px;
  }
}

.incident-overview-card {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.incident-overview-actions {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, minmax(150px, 1fr));
  gap: 24px;
}

.incident-overview-actions .overview-action-btn {
  --overview-accent: #d71920;
  --overview-accent-rgb: 215, 25, 32;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 0;
  padding: clamp(18px, 2.3vw, 34px);
  overflow: hidden;
  background: #eef2f5;
  border: 5px solid var(--overview-accent);
  border-radius: 18px;
  color: #071524;
  font-family: var(--hazmatiq-font-heading);
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
  box-shadow:
    0 0 0 1px rgba(var(--overview-accent-rgb), 0.28),
    0 10px 24px rgba(11, 31, 51, 0.16);
  touch-action: manipulation;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.incident-overview-actions .overview-action-btn::before,
.incident-overview-actions .overview-action-btn::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.incident-overview-actions .overview-action-btn::before {
  z-index: -2;
  background-image: url("assets/home-card-scenes-v5.webp");
  background-repeat: no-repeat;
  background-size: 100% 300%;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.incident-overview-actions .overview-action-btn::after {
  z-index: -1;
  background: linear-gradient(90deg, rgba(250, 252, 253, 0.98) 0%, rgba(250, 252, 253, 0.92) 31%, rgba(250, 252, 253, 0.28) 58%, transparent 76%);
}

.overview-action-copy {
  display: grid;
  width: min(54%, 620px);
  max-width: calc(100% - 24px);
  gap: 8px;
}

.overview-action-title,
.overview-action-description,
.overview-action-arrow {
  display: block;
}

.overview-action-title {
  padding-left: 24px;
  border-left: 8px solid var(--overview-accent);
  font-size: clamp(1.9rem, 3.25vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-transform: uppercase;
}

.overview-action-incident .overview-action-copy {
  transform: translateY(clamp(8px, 1.2vw, 18px));
}

.overview-action-incident .overview-action-title {
  font-size: clamp(1.8rem, 2.9vw, 3.3rem);
  white-space: nowrap;
}

.overview-action-description {
  max-width: 31rem;
  padding-left: 32px;
  font-family: var(--hazmatiq-font-body);
  font-size: clamp(0.95rem, 1.35vw, 1.3rem);
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.overview-action-arrow {
  padding-left: 32px;
  font-family: var(--hazmatiq-font-body);
  font-size: clamp(1.8rem, 2.8vw, 3rem);
  font-weight: 400;
  line-height: 0.75;
  color: var(--overview-accent);
  transition: transform 0.2s ease;
}

.incident-overview-actions .overview-action-planning {
  --overview-accent: var(--planning-blue);
  --overview-accent-rgb: 22, 131, 220;
}

.incident-overview-actions .overview-action-incident::before {
  background-position: center top;
}

.incident-overview-actions .overview-action-planning::before {
  background-position: center center;
}

.incident-overview-actions .overview-action-training {
  --overview-accent: #53b719;
  --overview-accent-rgb: 83, 183, 25;
}

.incident-overview-actions .overview-action-training::before {
  background-position: center bottom;
}

.incident-overview-actions .overview-action-btn:hover::before,
.incident-overview-actions .overview-action-btn:focus-visible::before {
  transform: scale(1.07);
  filter: saturate(1.22) contrast(1.08) brightness(1.04);
}

.incident-overview-actions .overview-action-btn:hover,
.incident-overview-actions .overview-action-btn:focus-visible {
  transform: translateY(-4px) scale(1.008);
  box-shadow:
    0 0 0 4px rgba(var(--overview-accent-rgb), 0.28),
    0 18px 38px rgba(var(--overview-accent-rgb), 0.34);
}

.incident-overview-actions .overview-action-btn:hover .overview-action-arrow,
.incident-overview-actions .overview-action-btn:focus-visible .overview-action-arrow {
  transform: translateX(8px);
}

.incident-overview-actions .overview-action-btn:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
}

.planning-tools-card {
  display: grid;
  gap: 26px;
  color: #17120a;
  border: 1px solid #aeb4b9;
  background: #f2f4f5;
  box-shadow: 0 10px 24px rgba(34, 38, 42, 0.12);
}

.planning-tools-heading h2,
.planning-tools-heading p {
  margin-bottom: 6px;
}

.planning-tools-heading h2 {
  color: #111;
}

.planning-tools-heading .eyebrow {
  color: #5d646b;
  font-weight: 900;
}

.planning-tools-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  min-height: 480px;
}

.planning-tools-primary {
  display: grid;
  align-content: start;
  gap: 18px;
}

.planning-tools-primary .eplan-login-form {
  grid-template-columns: minmax(200px, 1fr) minmax(220px, 0.75fr);
}

.planning-tools-primary .eplan-logo,
.planning-tools-primary .eplan-login-form .primary-btn {
  grid-column: auto;
}

.planning-eplan-card,
.facility-preplan-section {
  padding: 20px;
  border: 1px solid #c3c8cc;
  border-radius: 12px;
  color: #17120a;
  box-shadow: none;
}

.planning-eplan-card {
  background: #fff;
}

.facility-preplan-section {
  background: #fff;
}

.facility-preplan-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.facility-preplan-heading h3 {
  margin-bottom: 0;
}

.facility-preplan-add-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #9f1016;
  border-radius: 8px;
  background: #9f1016;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.facility-preplan-add-btn:hover,
.facility-preplan-add-btn:focus-visible {
  border-color: #111;
  background: #111;
  transform: translateY(-1px);
}

.planning-tools-future {
  min-width: 0;
}

.planning-eplan-card h3,
.facility-preplan-section h3,
.planning-eplan-card .big-label,
.facility-preplan-section .muted,
.eplan-login-form label > span {
  color: #17120a;
}

.planning-eplan-card .eplan-logo {
  border: 0;
}

.planning-eplan-card input {
  border: 2px solid #17120a;
  background: #fffdf2;
  color: #111;
}

.planning-eplan-card .primary-btn {
  border: 1px solid #b65000;
  background: #ed7203;
  color: #fff;
  box-shadow: none;
}
.planning-eplan-card .primary-btn:hover,
.planning-eplan-card .primary-btn:focus-visible {
  border-color: #8f3d00;
  background: #b65000;
}

.planning-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.planning-tool-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 20px;
  border: 1px solid #c3c8cc;
  border-top: 4px solid #1683dc;
  background: #fff;
  box-shadow: 0 5px 12px rgba(34, 38, 42, 0.08);
}

.planning-tool-eplan { border-top-color: #ed7203; }
.planning-tool-scenario {
  grid-column: 1 / -1;
  border-top-color: #9f1016;
}

.planning-tool-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.planning-tool-index {
  flex: 0 0 auto;
  color: #9f1016;
  font-family: var(--hazmatiq-font-heading);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.planning-tool-label {
  margin: 0 0 3px;
  color: #5d646b;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.planning-tool-section h3 {
  margin: 0;
  color: #17120a;
  font-size: 1.12rem;
}

.planning-tool-section > p {
  margin: 0;
  color: #3e454a;
}

.planning-tool-list {
  display: grid;
  gap: 5px;
  width: 100%;
  margin: 0;
  padding-left: 18px;
  color: #3e454a;
  font-size: 0.86rem;
}

.planning-tool-list li::marker {
  color: #ed7203;
  font-weight: 900;
}

.planning-tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.planning-tool-section .primary-btn,
.planning-tool-section .ghost-btn {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 0.78rem;
}

.planning-scenario-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.planning-scenario-examples span {
  padding: 5px 8px;
  border: 1px solid #d5b0b2;
  border-radius: 4px;
  background: #fff6f6;
  color: #731017;
  font-size: 0.78rem;
  font-weight: 700;
}

.planning-tools-status {
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid #c3c8cc;
}

@media (max-width: 900px) {
  .planning-tools-grid { grid-template-columns: 1fr; }
  .planning-tool-scenario { grid-column: auto; }
}

@media (max-width: 719px) {
  .planning-tool-actions,
  .planning-tool-actions .primary-btn,
  .planning-tool-actions .ghost-btn { width: 100%; }
  .facility-preplan-grid { grid-template-columns: 1fr; }
  .facility-preplan-btn { min-height: 0; }
}

/* Tier II Live Map overlay: compact NFPA-inspired facility symbol without
   inventing NFPA health/fire/reactivity values. */
.tier2-live-map-panel {
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid rgba(var(--gold-rgb), 0.45);
  border-radius: 8px;
  background: rgba(5, 18, 30, 0.92);
  color: #f8fbff;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tier2-live-map-panel span { color: #c9d6e3; font-size: 0.62rem; text-transform: none; }
.tier2-facility-cluster-marker {
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: #c62828;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .68), 0 0 0 1px rgba(11, 31, 51, .9);
  color: #fff;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}
.tier2-facility-cluster-marker:hover,
.tier2-facility-cluster-marker:focus-visible {
  background: #a91f1f;
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.tier2-facility-marker {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .65));
}
.tier2-facility-marker:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.tier2-facility-placard {
  position: relative;
  display: grid;
  width: 24px;
  height: 24px;
  grid-template: 1fr 1fr / 1fr 1fr;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 2px;
  box-shadow: 0 0 0 1px #17283a, 0 0 12px rgba(var(--gold-rgb), .55);
  transform: rotate(45deg);
}
.tier2-facility-placard > span { display: block; }
.tier2-facility-placard-red { background: #d71920; }
.tier2-facility-placard-blue { background: #1769aa; }
.tier2-facility-placard-yellow { background: var(--gold); }
.tier2-facility-placard-white { background: #f4f7f9; }
.tier2-facility-placard > b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #17283a;
  font-size: 10px;
  line-height: 1;
  transform: rotate(-45deg);
}
.tier2-facility-popup { min-width: 250px; max-width: 310px; color: #17283a; }
.tier2-facility-popup h3 { margin: 0 0 4px; font-size: 0.95rem; line-height: 1.15; }
.tier2-facility-popup p { margin: 3px 0; font-size: 0.76rem; line-height: 1.35; }
.tier2-facility-popup .eyebrow { color: var(--gold-ink); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.1em; }
.tier2-facility-popup .tier2-popup-actions { display: flex; gap: 6px; margin-top: 9px; }
.tier2-facility-popup button { border: 0; border-radius: 5px; padding: 7px 9px; background: #0d3457; color: #fff; cursor: pointer; font: inherit; font-size: 0.7rem; font-weight: 700; }
.tier2-facility-popup button.secondary { background: #e6eef5; color: #0d3457; }
.tier2-facility-popup button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Local DOM fire symbols stay visible above imagery, smoke, facilities, and labels. */
.wildfire-fire-marker,
.wildfire-fire-cluster-marker {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .72));
  z-index: 20;
}
.wildfire-fire-marker svg,
.wildfire-fire-cluster-marker svg {
  width: 26px;
  height: 30px;
  overflow: visible;
}
.wildfire-fire-marker svg > path:first-child,
.wildfire-fire-cluster-marker svg > path:first-child {
  fill: #e43b25;
  stroke: #17283a;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.wildfire-fire-marker-core { fill: var(--gold); }
.wildfire-fire-cluster-marker { width: 42px; height: 38px; }
.wildfire-fire-cluster-marker svg { width: 30px; height: 34px; }
.wildfire-fire-cluster-count {
  position: absolute;
  right: -8px;
  top: -4px;
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 3px;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: #8e1d18;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  line-height: 1;
}
.wildfire-fire-marker:focus-visible,
.wildfire-fire-cluster-marker:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Compact tactical alert strip and overlay history drawer. */
.alert-banner.notification-center {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  min-height: 40px;
  margin: 8px 0;
  padding: 4px 8px;
  border-left-width: 4px;
  border-radius: 10px;
  background: #5d646b;
  box-shadow: 0 4px 12px rgba(45, 51, 57, 0.16);
  overflow: hidden;
}

.notification-center[data-severity="advisory"] { background: var(--gold); }
.notification-center[data-severity="warning"] { background: var(--orange); }
.notification-center[data-severity="critical"] { background: var(--red); }

.notification-severity-icon {
  flex: 0 0 auto;
  color: var(--yellow);
  line-height: 0;
}

.notification-center-title {
  flex: 0 0 auto;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.notification-severity-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-center .notification-feed {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.notification-center .notification-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  white-space: nowrap;
}

.notification-center .notification-item > span {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 0.61rem;
}

.notification-center .notification-item > strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-center[data-severity]:not([data-severity="normal"]) .notification-system { grid-column: 1 / -1; }
.notification-center[data-severity]:not([data-severity="normal"]) .notification-item:not(.notification-system) { display: none; }

.notification-alert-count,
.notification-details-btn,
.notification-ack-btn {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.22);
  color: #fff;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.notification-alert-count:focus-visible,
.notification-details-btn:focus-visible,
.notification-ack-btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; }

.notification-center .notification-updated {
  flex: 0 0 7.5ch;
  width: auto;
  color: var(--gold);
  font-size: 0.76rem;
}

.notification-drawer-backdrop {
  position: fixed;
  z-index: 99;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.notification-drawer {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(420px, 92vw);
  height: 100dvh;
  padding: 16px;
  border-left: 1px solid var(--border);
  background: var(--panel);
  box-shadow: -12px 0 32px rgba(15, 23, 42, 0.28);
}

.notification-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.notification-drawer-header h2,
.notification-drawer-header .eyebrow { margin-bottom: 0; }
.notification-drawer-body { min-height: 0; overflow-y: auto; padding-top: 10px; }
.notification-history-item { padding: 10px; border: 1px solid var(--border); border-left: 4px solid var(--gray); border-radius: 10px; background: var(--panel-2); }
.notification-history-item + .notification-history-item { margin-top: 8px; }
.notification-history-item[data-severity="advisory"] { border-left-color: var(--yellow); }
.notification-history-item[data-severity="warning"] { border-left-color: var(--orange); }
.notification-history-item[data-severity="critical"] { border-left-color: var(--red); }
.notification-history-heading { display: flex; justify-content: space-between; gap: 8px; text-transform: capitalize; }
.notification-history-item p { margin: 6px 0; overflow-wrap: anywhere; }
.notification-history-item time { color: var(--muted); font-size: 0.7rem; }

@media (max-width: 900px) {
  .notification-center .notification-item:not(.notification-system) { display: none; }
  .notification-center .notification-system { grid-column: 1 / -1; }
  .notification-center .notification-details-btn { display: none; }
  .notification-center-title { font-size: 0.64rem; }
}

@media (max-width: 520px) {
  .alert-banner.notification-center { height: 36px; min-height: 36px; margin: 6px 0; }
  .notification-center .notification-item > span { display: none; }
  .notification-center .notification-ack-btn { display: none; }
  .notification-alert-count { padding-inline: 6px; }
  .notification-center-title { max-width: 88px; overflow: hidden; text-overflow: ellipsis; }
  .notification-center .notification-updated { flex-basis: 7.5ch; font-size: 0.68rem; }
}

@media (min-width: 820px) {
  #plume .container-bubble[for="container-pressure-condition"] select {
    min-width: 0;
    font-size: clamp(0.68rem, 0.72vw, 0.78rem);
  }
}

/* Operational Guidance owns its phase-card typography here so the field
   workflow does not depend on a later override stylesheet. */
#guided-response .guided-seven-phase-flow,
#guided-response .guided-seven-phase-flow button,
#guided-response .guided-seven-phase-flow input,
#guided-response .guided-seven-phase-flow select,
#guided-response .guided-seven-phase-flow textarea {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#guided-response .guided-seven-phase-flow { display: grid; gap: 12px; width: min(100%, 1180px); margin-inline: auto; }
#guided-response .guided-command-flow-heading { align-items: start; margin: 0 2px 4px; }
#guided-response .guided-command-flow-heading h2 { color: #fff; font-size: clamp(1.375rem, 2vw, 1.625rem); font-weight: 850; letter-spacing: normal; line-height: 1.2; }
#guided-response .guided-command-flow-heading p,
#guided-response .guided-command-flow-notice { color: #fff; font-size: 1rem; line-height: 1.5; }
#guided-response .guided-command-flow-notice { margin: 0; padding: 10px 12px; border: 1px solid #5c8bb2; border-left: 5px solid var(--gold); border-radius: 6px; background: #0b2944; }
#guided-response .guided-operational-strategy { display: grid; gap: 8px; height: auto; min-height: 0; margin-bottom: 0; align-content: start; overflow: visible; padding: 12px 14px; border: 1px solid #4f8c69; border-left: 5px solid #54c77b; border-radius: 8px; background: #0c3327; color: #f4fff7; }
#guided-response .guided-operational-strategy-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 12px 18px; align-items: start; min-width: 0; }
#guided-response .guided-operational-strategy-heading { min-width: 0; }
#guided-response .guided-operational-strategy h2 { margin: 0; color: #d7ffe2; font-size: 1.15rem; line-height: 1.25; }
#guided-response .guided-operational-strategy p { margin: 4px 0 0; color: #d4eee0; font-size: .95rem; line-height: 1.45; }
#guided-response .guided-operational-strategy-controls { display: grid; min-width: 0; gap: 5px; align-items: end; }
#guided-response .guided-operational-strategy-controls label { display: grid; gap: 5px; color: #effff3; font-size: .9rem; font-weight: 850; }
#guided-response .guided-operational-strategy-controls select { min-height: 44px; width: 100%; padding: 8px 9px; border: 1px solid #9bd7ad; border-radius: 5px; color: #123c27; background: #fff; font: inherit; font-size: 1rem; font-weight: 800; }
#guided-response .guided-operational-strategy-status { margin: 0; color: #b8dfc5; font-size: .78rem; line-height: 1.35; }
#guided-response .guided-phase-grid { display: grid; gap: 11px; }
#guided-response .guided-phase-card { overflow: hidden; border: 1px solid #c4d2dc; border-left: 6px solid #7794a7; border-radius: 9px; background: #fff; box-shadow: 0 2px 7px rgba(19, 50, 69, .07); }
#guided-response .guided-phase-card.is-current { border-color: var(--gold); border-left-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--gold-rgb), .18); }
#guided-response .guided-phase-card.is-complete { border-left-color: #258a4a; }
#guided-response .guided-phase-summary { display: grid; grid-template-columns: 32px 30px minmax(0, 1fr) auto; gap: 9px; align-items: center; min-width: 0; padding: 10px 13px; cursor: pointer; list-style: none; }
#guided-response .guided-phase-card > .guided-phase-summary { background: #e7f5e9; color: #173b2a; }
#guided-response .guided-phase-summary::-webkit-details-marker { display: none; }
#guided-response .guided-phase-number { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: #b11226; color: #fff; font-size: 1rem; font-weight: 850; }
#guided-response .guided-phase-card.is-not-started .guided-phase-number { background: #b11226; }
#guided-response .guided-phase-card.is-in-progress .guided-phase-number { background: var(--gold-surface); color: #2b2200; }
#guided-response .guided-phase-card.is-complete .guided-phase-number { background: #258a4a; }
#guided-response .guided-phase-card.is-current .guided-phase-number { box-shadow: 0 0 0 2px rgba(var(--gold-rgb), .8); }
#guided-response .guided-phase-title { min-width: 0; color: #173b2a; font-size: 1.12rem; font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; }
#guided-response .guided-phase-state { color: #28563a; font-size: .9rem; font-weight: 850; letter-spacing: .04em; }
#guided-response .guided-phase-card.is-current .guided-phase-state,
#guided-response .guided-phase-card.is-complete .guided-phase-state { color: #28563a; }
#guided-response .guided-phase-body { display: grid; gap: 10px; padding: 0 13px 13px; }
#guided-response .guided-phase-goal { box-sizing: border-box; width: 100%; margin: 0; padding: 12px 14px; border: 2px solid #2d6388; border-radius: 7px; background: #eaf4fa; color: #102f46; font-size: 1.1rem; font-weight: 850; line-height: 1.45; overflow-wrap: anywhere; }
#guided-response .guided-phase-body > section { min-width: 0; padding: 11px 12px; border: 1px solid #d1dee6; border-radius: 7px; background: #fbfdfe; }
#guided-response .guided-phase-body > section h3 { margin: 0 0 7px; color: #173e57; font-size: 1.08rem; font-weight: 850; line-height: 1.25; }
#guided-response .guided-phase-list { display: grid; gap: 8px; margin: 0; padding-inline-start: 2.45rem; color: #1e3c50; font-size: 1.1rem; line-height: 1.45; list-style-position: outside; }
#guided-response .guided-phase-list li { min-width: 0; padding-inline-start: .2rem; overflow-wrap: anywhere; }
#guided-response .guided-phase-list li::marker { color: #176d3e; font-size: 1.18em; font-weight: 950; }
#guided-response .guided-phase-product-guidance,
#guided-response .guided-scba-management > p { margin: 0 0 10px; color: #294a5e; font-size: 1.05rem; line-height: 1.5; }
#guided-response .guided-scba-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#guided-response .guided-scba-grid label { display: grid; gap: 5px; min-width: 0; color: #173e57; font-size: 1rem; font-weight: 750; line-height: 1.35; }
#guided-response .guided-scba-grid input,
#guided-response .guided-phase-evidence { min-height: 42px; width: 100%; max-width: 100%; padding: 8px 10px; border: 1px solid #7794a7; border-radius: 5px; background: #fff; color: #102f46; font: inherit; font-size: 1rem; line-height: 1.35; }
#guided-response .guided-scba-grid input:focus-visible,
#guided-response .guided-phase-evidence:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
#guided-response .guided-phase-body > section:nth-of-type(4) { border-color: #d89a96; background: #fff8f7; }
#guided-response .guided-phase-decision-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
#guided-response .guided-goal-status { min-width: 0; padding: 10px 12px; border: 1px solid #d89a96; border-left: 5px solid #b42318; border-radius: 7px; background: #fff3f2; color: #5f1b1b; }
#guided-response .guided-goal-status h3 { margin: 0 0 4px; color: #8f1d1d; font-size: 1.08rem; font-weight: 900; }
#guided-response .guided-goal-status-note { display: block; margin: 0 0 7px; color: #6e2a2a; font-size: .82rem; line-height: 1.35; }
#guided-response .guided-goal-status select { min-height: 40px; width: 100%; padding: 7px 9px; border: 1px solid #b85e59; border-radius: 5px; background: #fff; color: #4e1717; font: inherit; font-size: 1rem; font-weight: 800; }
#guided-response .guided-next-decision { min-width: 0; padding: 11px 12px; border: 1px solid #b8cfbd; border-left: 5px solid #258a4a; border-radius: 7px; background: #f1faf4; color: #164c32; }
#guided-response .guided-next-decision h3 { margin: 0 0 7px; color: #164c32; font-size: 1.08rem; font-weight: 850; }
#guided-response .guided-next-decision p { margin: 0; color: #1f5133; font-size: 1.05rem; line-height: 1.45; }
#guided-response .guided-phase-scenario,
#guided-response .guided-readiness-detail,
#guided-response .guided-phase-sources { border: 1px solid #c1d3df; border-radius: 6px; background: #f4f8fa; }
#guided-response .guided-phase-scenario summary,
#guided-response .guided-readiness-detail summary,
#guided-response .guided-phase-sources summary { padding: 10px 12px; color: #173e57; cursor: pointer; font-size: 1rem; font-weight: 800; line-height: 1.5; }
#guided-response .guided-scenario-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 0 12px 12px; }
#guided-response .guided-scenario-grid div { display: grid; gap: 3px; min-width: 0; }
#guided-response .guided-scenario-grid span { color: #4a6878; font-size: .9rem; font-weight: 800; }
#guided-response .guided-scenario-grid strong { overflow-wrap: anywhere; color: #173e57; font-size: 1rem; line-height: 1.4; }
#guided-response .guided-readiness-detail > .guided-phase-list { padding: 0 12px 12px 32px; }
#guided-response .guided-phase-sources .guided-source-trace { margin: 0 12px 12px; }
#guided-response .guided-reference-section { min-width: 0; padding: 11px 12px; border: 1px solid #b9ccd7; border-left: 5px solid #2d6388; border-radius: 7px; background: #f2f7fa; }
#guided-response .guided-reference-section h3 { margin: 0 0 5px; color: #173e57; font-size: 1.08rem; font-weight: 900; line-height: 1.25; }
#guided-response .guided-reference-intro { margin: 0 0 9px; color: #3d5c6e; font-size: .92rem; line-height: 1.4; }
#guided-response .guided-reference-list { display: grid; gap: 8px; }
#guided-response.guided-response-page .guided-phase-grid .guided-phase-body .guided-reference-card { min-width: 0; padding: 9px 10px; border: 1px solid #c6d6df; border-radius: 6px; background: #fff !important; color: #1d3b4e !important; }
#guided-response .guided-reference-card h4 { margin: 0; color: #173e57; font-size: 1rem; line-height: 1.3; }
#guided-response .guided-reference-publisher { margin: 2px 0 7px; color: #486577; font-size: .85rem; font-weight: 800; line-height: 1.35; }
#guided-response .guided-reference-card dl { display: grid; gap: 4px; margin: 0; }
#guided-response .guided-reference-card dl > div { display: grid; grid-template-columns: minmax(135px, .42fr) minmax(0, 1.58fr); gap: 7px; padding-top: 4px; border-top: 1px solid #e4ebef; font-size: .84rem; line-height: 1.35; }
#guided-response .guided-reference-card dt { color: #466275; font-weight: 850; }
#guided-response .guided-reference-card dd { min-width: 0; margin: 0; color: #1d3b4e; overflow-wrap: anywhere; }
#guided-response .guided-reference-link { display: inline-block; margin-top: 8px; color: #075d8d; font-size: .86rem; font-weight: 850; overflow-wrap: anywhere; }
#guided-response .guided-reference-gap { margin: 8px 0 0; color: var(--gold-ink); font-size: .84rem; line-height: 1.4; }
#guided-response .guided-phase-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 11px 12px 0; border-top: 1px solid #d9e3e8; background: #f7fafc; }
#guided-response .guided-phase-footer h3 { grid-column: 1 / -1; margin: 0; color: #173e57; font-size: 1.08rem; font-weight: 850; }
#guided-response .guided-phase-footer span { color: #4a6878; font-size: .95rem; line-height: 1.4; }
#guided-response .guided-phase-evidence { grid-column: 1 / -1; resize: vertical; }
#guided-response .guided-phase-footer .guided-goal-status,
#guided-response .guided-phase-footer .primary-btn { grid-column: 1 / -1; }
#guided-response .guided-scba-management { margin-top: 12px; padding-top: 12px; border-top: 1px solid #c1d3df; }
#guided-response .guided-scba-management h5 { margin: 0 0 7px; color: #173e57; font-size: 1.15rem; font-weight: 850; line-height: 1.3; }
#guided-response .guided-scba-status { margin: 10px 0 0; color: var(--gold-ink); font-size: 1rem; font-weight: 750; line-height: 1.5; }
#guided-response .guided-phase-icon { display: grid; width: 28px; height: 32px; place-items: center; color: #1e6c94; }
#guided-response .guided-phase-icon svg { width: 28px; height: 32px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
#guided-response .guided-phase-card.is-current .guided-phase-icon,
#guided-response .guided-phase-card.is-complete .guided-phase-icon { color: #28563a; }

@media (max-width: 700px) {
  #guided-response .guided-operational-strategy-top { grid-template-columns: 1fr; }
  #guided-response .guided-operational-strategy-controls,
  #guided-response .guided-scba-grid,
  #guided-response .guided-scenario-grid { grid-template-columns: 1fr; }
  #guided-response .guided-phase-summary { grid-template-columns: 30px 26px minmax(0, 1fr); gap: 7px; padding: 9px 10px; }
  #guided-response .guided-phase-state { grid-column: 3; }
  #guided-response .guided-phase-decision-grid { grid-template-columns: 1fr; }
  #guided-response .guided-phase-footer { grid-template-columns: 1fr; align-items: stretch; }
  #guided-response .guided-phase-footer .primary-btn,
  #guided-response .guided-phase-footer .ghost-btn { width: 100%; min-height: 46px; }
  #guided-response .guided-reference-card dl > div { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 380px) {
  .brand { gap: 9px; }
  .brand-emblem { width: 40px; height: 40px; flex-basis: 40px; }
  .brand-name { font-size: 1.65rem; }
  .brand-tagline { font-size: 0.5rem; letter-spacing: 0.14em; }
  .department-logo { width: 54px; height: 54px; }
}

/* Live tactical notification center */
.alert-banner.notification-center {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 12px;
  padding: 12px 14px;
  color: #fff;
  background: linear-gradient(105deg, #9f1016, #c9141b 48%, #a70f16);
  border: 1px solid #851016;
  border-left: 6px solid var(--yellow);
  box-shadow: 0 8px 22px rgba(126, 10, 16, 0.24);
}

.notification-heading {
  min-width: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.notification-heading > strong {
  font-size: 0.95rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.notification-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notification-live > span {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(var(--gold-rgb), 0.18);
}

.notification-feed {
  min-width: 0;
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 8px;
}

.notification-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: rgba(91, 5, 10, 0.28);
}

.notification-item > span {
  color: var(--gold);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.notification-item > strong {
  overflow: hidden;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
}

.notification-updated {
  width: 8.75ch;
  align-self: center;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.04em;
  text-align: right;
  white-space: nowrap;
}

.notification-updated .unit-secondary {
  color: #fff;
}

/* Plume Model desktop command shell: 20% command / 56% map / 24% response. */
@media (min-width: 981px) {
  .app-shell:has(#plume.active) {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell:has(#plume.active) .footer-note { display: none; }

  .layout:has(#plume.active) {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .layout:has(#plume.active) > .sidebar {
    display: grid;
    grid-template-rows: auto minmax(48px, 1fr);
    align-content: start;
    gap: 0;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    position: relative;
  }

  .layout:has(#plume.active) > .sidebar .module-nav { gap: 6px; }
  .layout:has(#plume.active) > .sidebar .module-btn { padding-block: 8px; }
  .layout:has(#plume.active) > .sidebar > .sidebar-card { margin-bottom: 0; }
  .layout:has(#plume.active) > .content-area {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  #plume .plume-model-controls,
  #plume .plume-model-input-grid {
    display: contents;
  }

  #plume .plume-model-actions { display: contents; }

  #plume .plume-model-actions button {
    min-width: 118px;
    min-height: 34px;
  }

  #plume #use-live-plume-weather-btn {
    z-index: 2;
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    justify-self: stretch;
    margin: 0 10px 10px;
    min-height: 38px;
    white-space: normal;
  }

  #plume .plume-model-section {
    grid-column: 2;
    min-width: 0;
    min-height: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    overflow: visible;
  }

  #plume .plume-model-section:first-child {
    grid-row: 1;
    align-content: start;
    gap: 3px;
    padding: 5px 8px 7px;
  }

  #plume .plume-model-section:first-child > strong {
    margin: 0;
    line-height: 1.1;
  }

  #plume .plume-model-section:first-child .plume-model-section-grid { gap: 4px; }
  #plume .plume-model-section:first-child .plume-model-field { gap: 2px; }
  #plume .plume-model-section:first-child input,
  #plume .plume-model-section:first-child select { min-height: 26px; }

  #plume .plume-model-section:first-child .container-profile {
    gap: 2px;
    padding: 4px;
  }

  #plume .plume-model-section:first-child .container-bubble-grid { gap: 2px 4px; }
  #plume .plume-model-section:first-child .container-bubble {
    gap: 1px;
    font-size: 0.66rem;
  }
  #plume .plume-model-section:first-child .container-bubble select {
    height: 24px;
    min-height: 24px;
    padding-block: 0;
    font-size: 0.68rem;
  }

  #plume .plume-model-section:first-child .container-details { padding-block: 4px; }
  #plume .plume-model-section:nth-child(2) {
    grid-row: 2;
    padding-bottom: 54px;
  }

  #plume .plume-weather-grid .plume-model-field > span,
  #plume .plume-weather-grid select,
  #plume .plume-weather-grid input,
  #plume .container-bubble > span {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.2;
  }

  #plume .plume-weather-grid select,
  #plume .plume-weather-grid input {
    min-width: 0;
    padding-inline: 5px;
    font-size: clamp(0.68rem, 0.72vw, 0.78rem);
  }
  #plume .plume-release-grid,
  #plume .plume-weather-grid,
  #plume .container-bubble-grid,
  #plume .container-detail-fields,
  #plume .container-details .release-data-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #plume .plume-release-grid > label[for="plume-release-quantity"] { grid-column: auto; }
  #plume .plume-chemical-field,
  #plume .container-profile,
  #plume .plume-weather-source-status { grid-column: 1 / -1; }

  #plume .plume-model-section { padding: 8px; }
  #plume section.plume-model-section {
    display: block;
  }
  #plume .plume-model-section-heading {
    display: grid;
    gap: 3px;
  }
  #plume .plume-model-section-heading > strong { color: #0d3457; font-size: 0.9rem; }
  #plume .plume-model-section:first-child .plume-model-section-heading > strong {
    color: #c1121f;
    font-weight: 900;
  }
  #plume .plume-model-section:nth-child(2) .plume-model-section-heading > strong {
    color: #0d3457;
    font-weight: 900;
  }
  #plume .plume-model-section-heading > span {
    color: var(--muted);
    font-size: 0.66rem;
    line-height: 1.25;
  }
  #plume section.plume-model-section > .plume-model-section-grid {
    min-height: 0;
    overflow: visible;
  }
  #plume section.plume-model-section .container-profile { display: grid; }
  #plume .plume-model-section > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 8px;
    align-items: center;
    cursor: pointer;
    list-style: none;
  }
  #plume .plume-model-section > summary::-webkit-details-marker { display: none; }
  #plume .plume-model-section > summary::after { content: "▸"; color: #0d3457; font-weight: 900; }
  #plume .plume-model-section[open] > summary::after { content: "▾"; }
  #plume .plume-model-section > summary > strong { color: #0d3457; font-size: 0.9rem; }
  #plume .plume-model-section > summary > span:not(.status-pill) {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 0.66rem;
    line-height: 1.25;
  }
  #plume .plume-model-section[open] {
    display: block;
  }
  #plume .plume-model-section[open] > .plume-model-section-grid,
  #plume .plume-model-section[open] > .plume-card-details {
    min-height: 0;
    overflow: visible;
  }
  #plume .plume-model-section .demographics-summary,
  #plume .plume-model-section .demographics-source-status { margin: 0 0 6px; font-size: 0.7rem; }
  #plume .plume-model-section .demographics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  #plume .plume-model-section .demographic-stat { padding: 5px; }
  #plume .plume-model-section .demographic-stat span { font-size: 0.62rem; }
  #plume .plume-model-section .demographic-stat strong { font-size: 0.78rem; }

  .layout:has(#plume.active) > .sidebar:has(#plume-demographics[open]) > .sidebar-card:first-child {
    visibility: hidden;
  }
  .layout:has(#plume.active) #plume-demographics[open] {
    position: absolute;
    z-index: 8;
    inset: 0 0 8px;
    box-sizing: border-box;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    width: 100%;
    height: auto;
    max-height: none;
    margin: 0;
    overflow: hidden;
    background: var(--panel);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  }
  .layout:has(#plume.active) #plume-demographics[open] .demographics-grid {
    min-height: 0;
    overflow-y: auto;
  }
}

@media (min-width: 981px) {
  .app-shell:has(#plume.active) {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .layout:has(#plume.active) {
    height: auto;
    min-height: 0;
    overflow: visible;
    align-items: start;
  }

  .layout:has(#plume.active) > .sidebar {
    display: block;
    position: sticky;
    top: 8px;
    max-height: calc(100dvh - 16px);
  }

  .layout:has(#plume.active) > .content-area {
    overflow: visible;
  }

  #plume #plume-demographics {
    grid-row: 1;
    width: 100%;
    box-sizing: border-box;
  }

  #plume .plume-model-section:first-child { grid-column: 1; }
  #plume #plume-demographics {
    grid-column: 2;
    max-width: 100%;
  }

  #plume .plume-model-section:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: auto;
    height: auto;
    max-height: none;
    padding: 8px;
  }

  #plume .plume-lower-card-content { min-height: 0; }

  #plume #plume-demographics[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
  }

  #plume #plume-demographics > summary {
    grid-column: auto;
    margin: 0;
  }

  #plume #use-live-plume-weather-btn {
    grid-column: 1 / -1;
    grid-row: auto;
    position: static;
    align-self: start;
    justify-self: stretch;
    margin: 0;
  }
}

@media (max-width: 980px) {
  #plume .plume-model-section,
  #plume #plume-demographics {
    width: 100%;
    max-height: none;
    overflow: visible;
  }

  #plume .plume-lower-card-content,
  #plume section.plume-model-section > .plume-model-section-grid {
    overflow: visible;
  }
}

@media (max-width: 900px) {
  .alert-banner.notification-center {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
  }

  .notification-heading { min-width: 0; }
  .notification-feed { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .notification-updated {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 719px) {
  .alert-banner.notification-center {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 9px;
  }

  .notification-heading {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .notification-heading > strong { font-size: 0.76rem; }
  .notification-live { font-size: 0.58rem; }
  .notification-feed { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .notification-system { display: none; }
  .notification-item { padding: 6px 7px; }
  .notification-item > strong { font-size: 0.67rem; }
}

/* Cascade-safe compact notification clock. */
.alert-banner.notification-center {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  height: 40px;
  min-height: 40px;
  margin: 8px 0;
  padding: 4px 8px;
  border-left: 1px solid #851016;
  overflow: hidden;
}

.notification-center .notification-system {
  display: flex;
}

.notification-system-message {
  display: none;
}

.notification-center[data-severity]:not([data-severity="normal"]) .notification-system .notification-updated {
  display: none !important;
}

.notification-center[data-severity]:not([data-severity="normal"]) .notification-system-message {
  display: block;
}

.notification-center .notification-updated {
  display: block !important;
  flex: 0 0 8.5ch;
  width: 8.5ch;
  min-width: 8.5ch;
  align-self: center;
  grid-column: auto;
  color: #fff;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
  visibility: visible;
}

@media (max-width: 520px) {
  .alert-banner.notification-center { height: 36px; min-height: 36px; margin: 6px 0; padding: 3px 6px; }
  .notification-center .notification-updated { flex-basis: 8.5ch; min-width: 8.5ch; font-size: 0.68rem; }
}

/* Monitoring Equipment Phase 1 */
#monitor {
  --monitor-navy: #0d3457;
  --monitor-blue: #1c5b89;
  --monitor-soft: #eef4f8;
  --monitor-line: #b9cad7;
  color: #13283a;
}

.monitor-page-heading,
.monitor-section-heading,
.monitor-status-bar,
.monitor-alarm-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.monitor-page-heading {
  padding: 8px 12px;
  border-radius: 10px 10px 0 0;
  background: var(--monitor-navy);
  color: #fff;
}

.monitor-purpose {
  margin: 0;
  padding: 8px 11px;
  border: 1px solid var(--monitor-line);
  border-top: 0;
  background: #e8f0f5;
  color: #29475d;
  font-size: 0.76rem;
  line-height: 1.4;
}

.monitor-page-heading h2,
.monitor-section-heading h3,
.safety-suite-card h3 { margin: 0; }
.monitor-page-heading .eyebrow { margin-bottom: 2px; color: #b9d9ee; }

.monitor-simulated-label,
.monitor-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.monitor-simulated-label { background: #d9efff; color: #0c4f7b; }
.monitor-state.normal { background: #d9f3e4; color: #17633a; }
.monitor-state.caution { background: var(--gold-soft); color: var(--gold-ink); }
.monitor-state.alarm { background: #c9141b; color: #fff; }
.monitor-state.offline { background: #dfe3e6; color: #4d5961; }
.monitor-state.training { background: #d9eaff; color: #174f7a; }
.monitor-state.unknown { background: #e3e6e8; color: #505d66; }

.monitor-status-bar {
  flex-wrap: wrap;
  padding: 7px 10px;
  border: 1px solid var(--monitor-line);
  border-top: 0;
  background: #fff;
}

.monitor-status-bar label,
.monitor-status-bar > div { display: grid; gap: 2px; }
.monitor-status-bar label,
.monitor-status-bar span { color: #586b79; font-size: 0.66rem; font-weight: 750; text-transform: uppercase; }
.monitor-status-bar strong { color: var(--monitor-navy); font-size: 0.82rem; }
.monitor-status-bar select { min-width: 190px; padding: 5px 7px; border: 1px solid #8fa8ba; border-radius: 5px; background: #fff; color: #13283a; }

.monitor-refresh-btn,
.monitor-actions button,
.monitor-add-btn,
.monitor-save-btn {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #244f70;
  border-radius: 6px;
  background: var(--monitor-blue);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.monitor-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  margin: 7px 0;
}

.monitor-tab {
  min-height: 38px;
  padding: 6px 5px;
  border: 1px solid #244f70;
  border-radius: 6px;
  background: var(--monitor-navy);
  color: #fff;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.monitor-tab:hover,
.monitor-tab:focus-visible { background: #1e608e; }
.monitor-tab.active { box-shadow: inset 0 -4px 0 #fff; background: #225f8a; }

.monitor-tab-panel {
  min-height: 0;
  padding: 9px;
  border: 1px solid var(--monitor-line);
  border-radius: 8px;
  background: var(--monitor-soft);
}

.monitor-alarm-banner {
  justify-content: flex-start;
  margin-bottom: 8px;
  padding: 7px 10px;
  border-left: 4px solid #258257;
  border-radius: 5px;
  background: #e5f5ec;
  color: #164e32;
  font-size: 0.82rem;
}
.monitor-alarm-banner span { margin-left: auto; color: #0c4f7b; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; }

.monitor-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.monitor-device-card {
  padding: 8px;
  border: 1px solid var(--monitor-line);
  border-top: 4px solid #258257;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(13, 52, 87, 0.08);
}
.monitor-device-card[data-state="caution"] { border-top-color: var(--gold); }
.monitor-device-card[data-state="alarm"] { border-top-color: #c9141b; }
.monitor-device-card[data-state="offline"] { border-top-color: #7b858c; }
.monitor-device-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.monitor-device-card h3 { margin: 0; color: var(--monitor-navy); font-size: 0.9rem; }
.monitor-device-card header p { margin: 2px 0 0; color: #607382; font-size: 0.68rem; }

.monitor-device-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 7px;
}
.monitor-device-meta div { display: grid; gap: 1px; padding: 4px; border-radius: 4px; background: #edf3f6; }
.monitor-device-meta span { color: #687985; font-size: 0.56rem; font-weight: 750; text-transform: uppercase; }
.monitor-device-meta strong { color: #263c4d; font-size: 0.68rem; font-weight: 500; }

.monitor-sensor-list { display: flex; flex-wrap: wrap; gap: 4px; }
.monitor-sensor {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 6px;
  border: 1px solid #b9d8c6;
  border-radius: 999px;
  background: #e8f5ed;
  color: #195d38;
  font-size: 0.66rem;
}
.monitor-sensor strong { color: #123f2a; }
.monitor-sensor.caution { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-ink); }
.monitor-sensor.alarm { border-color: #c9141b; background: #c9141b; color: #fff; }
.monitor-sensor.alarm strong { color: #fff; }

.monitor-section-heading { margin-bottom: 8px; }
.monitor-section-heading p { margin: 2px 0 0; color: #5e6d77; font-size: 0.78rem; }
.monitor-section-heading > div { min-width: 0; }
.monitor-add-btn { flex: 0 0 auto; }
.monitor-objective-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.monitor-objective { display: grid; gap: 5px; min-height: 92px; padding: 9px; border: 1px solid var(--monitor-line); border-radius: 7px; background: #fff; color: #1d3547; cursor: pointer; text-align: left; }
.monitor-objective strong { color: var(--monitor-navy); font-size: 0.82rem; }
.monitor-objective span { font-size: 0.7rem; line-height: 1.35; }
.monitor-objective.selected { border: 2px solid var(--monitor-blue); background: #e2f0fa; }

.monitor-table-wrap { overflow-x: auto; border: 1px solid var(--monitor-line); border-radius: 6px; }
.monitor-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 0.72rem; }
.monitor-table th { padding: 7px; background: var(--monitor-navy); color: #fff; text-align: left; white-space: nowrap; }
.monitor-table td { padding: 7px; border-bottom: 1px solid #d9e2e8; vertical-align: middle; }
.monitor-table tbody tr:nth-child(even) { background: #f3f7f9; }
.monitor-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.monitor-placeholder-note { margin: 7px 0 0; color: #647681; font-size: 0.7rem; }

.monitor-saved-inventory { margin-bottom: 12px; }
.monitor-inventory-label { display: flex; align-items: baseline; gap: 9px; margin: 7px 0 5px; }
.monitor-inventory-label h4 { margin: 0; color: var(--monitor-navy); font-size: 0.82rem; }
.monitor-inventory-label span { color: #657783; font-size: 0.68rem; }
.monitor-row-actions { display: flex; gap: 4px; white-space: nowrap; }
.monitor-row-actions button { padding: 4px 7px; border: 1px solid #7790a2; border-radius: 4px; background: #edf3f6; color: #173a56; cursor: pointer; font-size: 0.66rem; font-weight: 600; }
.monitor-row-actions .monitor-delete-btn { border-color: #b6242b; background: #fff; color: #a3181f; }
.monitor-source-badge {
  display: inline-flex;
  width: fit-content;
  padding: 2px 6px;
  border-radius: 999px;
  background: #d9eaff;
  color: #174f7a;
  font-size: 0.62rem;
  font-weight: 850;
  white-space: nowrap;
}
.monitor-latest-reading { margin: 5px 0 7px; padding: 6px 7px; border-left: 3px solid var(--monitor-blue); background: #eaf3f9; color: #24465f; font-size: 0.7rem; }
.monitor-log-filters { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 8px; }
.monitor-log-filters button { padding: 5px 9px; border: 1px solid #7892a4; border-radius: 999px; background: #fff; color: #24465f; cursor: pointer; font-size: 0.68rem; font-weight: 600; }
.monitor-log-filters button.active { border-color: var(--monitor-navy); background: var(--monitor-navy); color: #fff; }
.monitor-import-dialog { width: min(900px, calc(100vw - 32px)); }
.monitor-import-parse-actions { margin-top: 8px; }
.monitor-import-confirm { margin: 8px 0 2px; color: #344e61; font-size: 0.7rem; font-weight: 800; }

.monitor-source-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  padding: 10px;
  border: 1px solid var(--monitor-line);
  border-left: 4px solid var(--monitor-navy);
  border-radius: 6px;
  background: #fff;
}
.monitor-source-card h4 { margin: 0 0 3px; color: var(--monitor-navy); }
.monitor-source-card p,
.monitor-reference-note { margin: 0; color: #536875; font-size: 0.74rem; line-height: 1.4; }
.monitor-reference-note { margin-bottom: 6px; padding: 7px 9px; border-left: 4px solid var(--gold); background: var(--gold-soft); }
.monitor-reference-tag { color: var(--gold-ink); font-size: 0.62rem; font-weight: 850; text-transform: uppercase; }
.monitor-empty { padding: 18px; border: 1px dashed #91a7b6; border-radius: 6px; background: #fff; color: #627580; font-size: 0.78rem; text-align: center; }

.monitor-assignment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.monitor-assignment-card { padding: 10px; border: 1px solid var(--monitor-line); border-top: 4px solid var(--monitor-blue); border-radius: 7px; background: #fff; }
.monitor-assignment-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.monitor-assignment-card h4 { margin: 0; color: var(--monitor-navy); }
.monitor-assignment-model,
.monitor-assignment-notes { margin: 3px 0 7px; color: #607382; font-size: 0.7rem; }
.monitor-assignment-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 8px; margin: 7px 0; font-size: 0.7rem; }
.monitor-assignment-card dt { color: #607382; font-weight: 600; }
.monitor-assignment-card dd { margin: 0; color: #20394c; }
.monitor-temporary-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.monitor-temporary-fields[hidden] { display: none; }
.monitor-checkbox { display: flex !important; grid-template-columns: auto 1fr; align-items: center; justify-content: flex-start; }
.monitor-checkbox input { width: auto; }
.monitor-integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }

.monitor-device-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
  padding: 0;
  border: 1px solid #6d8799;
  border-radius: 9px;
  background: #f4f7f9;
  color: #13283a;
  box-shadow: 0 18px 55px rgba(7, 31, 54, 0.42);
}
.monitor-device-dialog::backdrop { background: rgba(5, 20, 32, 0.62); }
.monitor-device-dialog form { padding: 12px; }
.monitor-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: -12px -12px 11px; padding: 10px 12px; border-radius: 8px 8px 0 0; background: var(--monitor-navy); color: #fff; }
.monitor-dialog-heading h3 { margin: 0; }
.monitor-dialog-heading .eyebrow { margin-bottom: 2px; color: #b9d9ee; }
.monitor-dialog-close { width: 30px; height: 30px; padding: 0; border: 1px solid #91b2c9; border-radius: 5px; background: transparent; color: #fff; cursor: pointer; font-size: 1.25rem; line-height: 1; }
.monitor-device-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.monitor-device-form-grid label { display: grid; gap: 3px; min-width: 0; color: #344e61; font-size: 0.7rem; font-weight: 600; }
.monitor-device-form-grid input,
.monitor-device-form-grid select,
.monitor-device-form-grid textarea { width: 100%; min-width: 0; box-sizing: border-box; padding: 7px 8px; border: 1px solid #91a7b6; border-radius: 5px; background: #fff; color: #13283a; font-family: var(--hazmatiq-font-body); font-weight: 400; }
.monitor-device-form-grid textarea { resize: vertical; }
.monitor-form-span-two { grid-column: 1 / -1; }
.monitor-form-status { min-height: 1em; margin: 6px 0 0; color: #a3181f; font-size: 0.72rem; font-weight: 750; }
.monitor-dialog-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 5px; }
.monitor-cancel-btn { min-height: 34px; padding: 6px 11px; border: 1px solid #7790a2; border-radius: 6px; background: #fff; color: #1f3c51; cursor: pointer; font-weight: 600; }

.safety-suite-card { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px; border: 1px solid var(--monitor-line); border-top: 5px solid var(--monitor-navy); border-radius: 8px; background: #fff; }
.safety-suite-message { grid-column: 1 / -1; margin: 0; padding: 10px; border-left: 4px solid var(--gold); background: var(--gold-soft); font-size: 0.84rem; }
.safety-suite-checklist { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 22px; margin: 0; padding-left: 22px; font-size: 0.78rem; }
.safety-suite-card .monitor-placeholder-note { grid-column: 1 / -1; }

@media (max-width: 1100px) {
  .monitor-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-objective-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .monitor-integration-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .monitor-card-grid,
  .monitor-assignment-grid,
  .monitor-objective-grid,
  .safety-suite-checklist { grid-template-columns: 1fr; }
  .monitor-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-status-bar { align-items: stretch; }
  .monitor-status-bar > * { flex: 1 1 45%; }
  .monitor-page-heading { align-items: flex-start; flex-direction: column; }
  .monitor-section-heading { align-items: flex-start; flex-direction: column; }
  .monitor-device-form-grid { grid-template-columns: 1fr; }
  .monitor-temporary-fields { grid-template-columns: 1fr; }
  .monitor-form-span-two { grid-column: auto; }
}

/* Shared responder typography: final constraints intentionally follow the
   page-specific themes so spacing and type remain consistent. */
.chemical-profile-section,
.guided-response-card,
.guided-flow-box,
.guided-mitigation-card,
.incident-input-card,
.incident-guidance-card,
.command-status-card,
.plume-model-section,
.threat-zone-summary,
.threat-zone-estimate-details,
.report-summary-block {
  font-family: var(--hazmatiq-font-body);
  line-height: 1.5;
}

.chemical-profile-section,
.guided-response-card,
.guided-flow-box,
.guided-mitigation-card,
.incident-input-card,
.incident-guidance-card,
.command-status-card,
.report-summary-block {
  padding: var(--hazmatiq-card-padding);
}

.chemical-profile-section h4,
.guided-response-card h3,
.guided-flow-box h4,
.guided-mitigation-card h4,
.incident-input-card h3,
.incident-guidance-card h3,
.command-status-card h3,
.threat-zone-summary h3,
.report-summary-block h3 {
  margin-top: 0;
  margin-bottom: var(--hazmatiq-gap-small);
  font-family: var(--hazmatiq-font-heading);
  font-weight: 700;
}

.chemical-profile-value-list,
.chemical-profile-list,
.chemical-treatment-column ul,
.incident-guidance-list,
.report-summary-block ul {
  gap: 6px;
  line-height: 1.5;
}

.chemical-profile-value-list li,
.chemical-profile-list li,
.chemical-treatment-column li,
.incident-guidance-list li,
.report-summary-block li {
  overflow-wrap: anywhere;
}

.guided-respiratory-decision dd > span,
.guided-protection-level dd > span,
.guided-flow-box dt,
.guided-flow-sources,
.guided-flow-approval {
  font-weight: 700;
}

.guided-section-sources,
.guided-manufacturer-box small,
.guided-mitigation-card small,
.guided-response-disclaimers,
.threat-zone-summary-list dt,
#plume .threat-zone-primary-metrics .demographic-stat small,
.threat-zone-estimate-details,
.threat-zone-summary-list dd,
.threat-zone-estimate-details > summary,
.threat-zone-estimate-details dl div {
  font-size: var(--hazmatiq-text-small);
  line-height: 1.45;
}

/* Chemical Profile visual system — shared shell, hero, tab nav, cards, guidance,
   metrics, source summary, and empty state. */
.chemical-profile-shell {
  font-family: var(--hazmatiq-font-body);
}

.chemical-profile-header-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "heading actions"
    "summary actions"
    "meta actions";
  align-items: center;
  gap: 8px 20px;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid #356a94;
  border-radius: 16px;
  background:
    radial-gradient(circle at 82% 18%, rgba(var(--gold-rgb), 0.18), transparent 28%),
    linear-gradient(135deg, #123f67 0%, #0b2d4b 68%, #071f36 100%);
}

.chemical-profile-header-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 58%;
  opacity: 0.24;
  background-image:
    linear-gradient(30deg, transparent 48%, rgba(220, 239, 255, 0.42) 49%, rgba(220, 239, 255, 0.42) 51%, transparent 52%),
    linear-gradient(150deg, transparent 48%, rgba(220, 239, 255, 0.32) 49%, rgba(220, 239, 255, 0.32) 51%, transparent 52%);
  background-size: 42px 72px;
  mask-image: linear-gradient(to left, #000, transparent);
}

.chemical-profile-header-top { grid-area: heading; }
.chemical-profile-summary { grid-area: summary; max-width: 780px; font-size: 0.92rem; }
.chemical-profile-meta { grid-area: meta; }
.chemical-profile-actions {
  grid-area: actions;
  max-width: 410px;
  justify-content: flex-end;
}

.chemical-profile-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(var(--gold-rgb), 0.74);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(7, 31, 54, 0.7);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.chemical-profile-status-chip[data-state="verified"]::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #70d59b;
  box-shadow: 0 0 0 3px rgba(112, 213, 155, 0.15);
}

.chemical-profile-layout {
  gap: 12px;
  padding: 0;
}

.chemical-profile-tabs {
  grid-template-columns: repeat(11, minmax(112px, 1fr));
  border-color: #234f73;
  background: linear-gradient(145deg, #123f67, #071f36);
}

.chemical-profile-tab {
  min-height: 48px;
  border-color: rgba(220, 239, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  font-size: 0.8rem;
  font-weight: 600;
}

.chemical-profile-tab:hover,
.chemical-profile-tab:focus-visible {
  border-color: rgba(var(--gold-rgb), 0.7);
  background: rgba(255, 255, 255, 0.12);
  transform: none;
}

.chemical-profile-tab.active {
  border-color: var(--gold);
  color: #071f36;
  background: var(--gold-surface);
  box-shadow: inset 0 -3px 0 var(--gold);
}

.chemical-profile-content {
  gap: 14px;
  padding: 2px 4px 8px 2px;
}

.chemical-profile-section,
.chemical-profile-content[data-active-tab="medical"] .chemical-profile-section,
.chemical-profile-content[data-active-tab="fire"] .chemical-profile-section,
.chemical-profile-content[data-active-tab="decon"] .chemical-profile-section,
.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-section {
  border: 1px solid #c7d1db;
  border-top: 4px solid #234f73;
  border-radius: 14px;
  color: var(--text);
  background: #f2f4f6;
  box-shadow: 0 8px 20px rgba(7, 31, 54, 0.09);
}

.chemical-profile-content[data-active-tab="fire"] .chemical-profile-section {
  border-top-color: var(--red);
}

.chemical-profile-content[data-active-tab="decon"] .chemical-profile-section {
  border-top-color: var(--gold);
}

.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-section {
  border-top-color: var(--gold);
}

.chemical-profile-section h4,
.chemical-profile-content[data-active-tab="medical"] .chemical-profile-section h4,
.chemical-profile-content[data-active-tab="fire"] .chemical-profile-section h4,
.chemical-profile-content[data-active-tab="decon"] .chemical-profile-section h4,
.chemical-profile-content[data-active-tab="reactivity"] .chemical-profile-section h4 {
  color: #071f36;
  font-size: 1.05rem;
}

.chemical-profile-row,
.chemical-profile-list-row,
.chemical-profile-value-list li,
.chemical-treatment-column li,
.chemical-profile-content[data-active-tab] .chemical-profile-row,
.chemical-profile-content[data-active-tab] .chemical-profile-list-row,
.chemical-profile-content[data-active-tab] .chemical-profile-value-list li,
.chemical-profile-content[data-active-tab] .chemical-treatment-column li {
  border-color: #d1d8df;
  color: var(--text);
  background: #fff;
}

.chemical-profile-content[data-active-tab] .chemical-profile-row > span,
.chemical-profile-content[data-active-tab] .chemical-profile-row strong,
.chemical-profile-content[data-active-tab] .chemical-profile-value-list,
.chemical-profile-content[data-active-tab] .chemical-profile-list-row strong,
.chemical-profile-content[data-active-tab] .chemical-profile-list-row span,
.chemical-profile-content[data-active-tab] .chemical-treatment-column h5,
.chemical-profile-content[data-active-tab] .chemical-profile-list {
  color: var(--text);
}

.chemical-profile-content[data-active-tab] .chemical-profile-row > span,
.chemical-profile-content[data-active-tab] .chemical-profile-list-row strong {
  color: #4a5e70;
}

.chemical-profile-content[data-active-tab="ppeRespiratory"] .chemical-profile-section[data-section="recommended-ppe"] .chemical-profile-row,
.chemical-profile-meta-item[data-field^="idlh"] {
  border-color: var(--dark-red);
  color: #fff;
  background: var(--red);
}

.chemical-profile-source-summary {
  grid-column: 1 / -1;
  padding: 9px 12px;
  border: 1px solid #b9c8d6;
  border-radius: 10px;
  color: #173b5c;
  background: #eaf0f5;
  font-size: 0.8rem;
}

.chemical-profile-source-summary > summary {
  cursor: pointer;
  font-weight: 700;
}

.chemical-profile-source-summary p {
  margin: 7px 0 0;
  color: #4a5e70;
}

.chemical-profile-empty-state {
  grid-column: 1 / -1;
  padding: 26px;
  border: 1px dashed #9fb1c3;
  border-radius: 14px;
  color: #4a5e70;
  background: #f2f4f6;
  text-align: center;
}

@media (max-width: 900px) {
  .chemical-profile-header-card {
    grid-template-columns: 1fr;
    grid-template-areas: "heading" "summary" "meta" "actions";
  }

  .chemical-profile-actions {
    max-width: none;
    margin-left: 0;
    justify-content: flex-start;
  }

  .chemical-profile-tabs {
    grid-template-columns: repeat(11, minmax(112px, 1fr));
    border-left-color: #234f73;
  }
}

/* Final Chemical ID/Profile layout contract. Keep these rules last so legacy
   page themes cannot turn the search field dark or the profile cards pale. */
#lookup .chemical-id-search-card #chemical-search {
  border-color: #cbd5e1;
  color: #0b1f33;
  background: #f1f5f9;
  caret-color: #0b1f33;
  box-shadow: inset 0 1px 2px rgba(7, 31, 54, 0.12), 0 4px 12px rgba(2, 15, 27, 0.14);
}

#lookup .chemical-id-search-card #chemical-search::placeholder {
  color: #64748b;
  opacity: 1;
}

#lookup .chemical-id-search-card #chemical-search:focus {
  border-color: #2e8cff;
  outline-color: rgba(46, 140, 255, 0.28);
  background: #f1f5f9;
}

#chemical-id-results .chemical-profile-toolbar-actions {
  gap: 8px;
  padding: 5px;
  border-radius: 10px;
  background: #d7dce1;
}

#chemical-id-results .chemical-profile-header-card {
  grid-template-columns: minmax(120px, 148px) minmax(0, 1fr);
  grid-template-areas:
    "placard heading"
    "placard summary"
    "placard meta";
  gap: 8px 16px;
  background:
    radial-gradient(circle at 86% 28%, rgba(46, 140, 255, 0.18), transparent 30%),
    linear-gradient(135deg, #0e2a44, #061a2e 72%);
}

#chemical-id-results .chemical-profile-tabs {
  grid-template-columns: repeat(8, minmax(118px, 1fr));
}

#chemical-id-results .chemical-profile-content {
  color: #f8fafc;
  background: #d7dce1;
}

#chemical-id-results .chemical-profile-section,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-section,
#chemical-id-results .chemical-profile-content > .hybrid-decon-section {
  border-color: #2f5f86;
  border-top-color: #4c92c7;
  color: #f8fafc;
  background: linear-gradient(180deg, #0e2a44, #0a2239);
  box-shadow: 0 8px 20px rgba(2, 15, 27, 0.2);
}

#chemical-id-results .chemical-profile-section h4,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-section h4,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-treatment-column h5 {
  color: #f8fafc;
}

#chemical-id-results .chemical-profile-row,
#chemical-id-results .chemical-profile-list-row,
#chemical-id-results .chemical-profile-value-list li,
#chemical-id-results .chemical-treatment-column li,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-row,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-list-row,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-value-list li,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-treatment-column li {
  border-color: rgba(203, 213, 225, 0.16);
  color: #f8fafc;
  background: #102f4d;
}

#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-row > span,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-row strong,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-value-list,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-list-row strong,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-list-row span,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-list {
  color: #f8fafc;
}

#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-row > span,
#chemical-id-results .chemical-profile-content[data-active-tab] .chemical-profile-list-row strong {
  color: #b8c7d9;
}

#chemical-id-results .chemical-profile-source-summary,
#chemical-id-results .chemical-profile-empty-state {
  border-color: #2f5f86;
  color: #dce9f4;
  background: #0b1f33;
}

#chemical-id-results .chemical-profile-source-summary p {
  color: #b8c7d9;
}

@media (min-width: 1200px) {
  .layout:has(#lookup.active) #lookup.active:has(#chemical-id-results:not([hidden])) {
    grid-template-columns: minmax(360px, 48fr) minmax(520px, 52fr);
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 18px;
    background: #d7dce1;
  }

  #lookup.active:has(#chemical-id-results:not([hidden])) > .chemical-id-search-card,
  #lookup.active:has(#chemical-id-results:not([hidden])) > #chemical-id-results {
    border-radius: 14px;
  }
}

@media (max-width: 700px) {
  #chemical-id-results .chemical-profile-header-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "placard"
      "heading"
      "summary"
      "meta";
  }

  #chemical-id-results .chemical-profile-toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Keep every plume action on the same red response-action palette. */
#lookup #open-plume-btn,
#guided-response #guided-open-plume-btn,
#plume #plot-plume-btn {
  border: 2px solid #8f0d12;
  background: linear-gradient(135deg, #c81b22, #a10c13);
  box-shadow: 0 5px 12px rgba(183, 14, 22, 0.25);
  color: #fff;
  font-weight: 900;
}

#lookup #open-plume-btn,
#guided-response #guided-open-plume-btn {
  min-width: 154px;
  padding-inline: 18px;
}

#lookup #open-plume-btn:hover,
#lookup #open-plume-btn:focus-visible,
#guided-response #guided-open-plume-btn:hover,
#guided-response #guided-open-plume-btn:focus-visible,
#plume #plot-plume-btn:hover:not(:disabled),
#plume #plot-plume-btn:focus-visible:not(:disabled) {
  border-color: var(--gold);
  background: linear-gradient(135deg, #f2383f, #c1121f);
  color: #fff;
}

/* Final cascade lock for the recovered global shell. Keep this block last. */
.layout,
.layout:has(#incident.active),
.layout:has(#lookup.active),
.layout:has(#plume.active),
.layout:has(#map.active) {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.layout > .content-area,
.layout:has(#incident.active) > .content-area,
.layout:has(#lookup.active) > .content-area,
.layout:has(#plume.active) > .content-area,
.layout:has(#map.active) > .content-area {
  grid-column: 1;
  width: 100%;
  min-width: 0;
}

.layout > .sidebar,
.layout:has(#plume.active) > .sidebar,
.layout:has(#map.active) > .sidebar {
  display: none;
}

.hazmat-command-bar.topbar {
  display: grid;
  background:
    radial-gradient(circle at 82% 20%, rgba(46, 140, 255, 0.2), transparent 34%),
    linear-gradient(90deg, var(--hazmat-navy) 0%, var(--hazmat-navy-2) 58%, var(--hazmat-card) 100%);
  color: var(--hazmat-text);
}

.content-area > .view > .hazmat-page-hero,
#plume > .plume-page-header {
  border-color: var(--hazmat-border);
  background:
    radial-gradient(circle at 78% 30%, rgba(46, 140, 255, 0.22), transparent 34%),
    radial-gradient(circle at 20% 80%, rgba(var(--gold-rgb), 0.12), transparent 28%),
    linear-gradient(135deg, var(--hazmat-navy) 0%, var(--hazmat-navy-2) 52%, var(--hazmat-card) 100%);
  color: var(--hazmat-text);
}

#plume > .plume-page-header {
  min-height: 118px;
  max-height: 150px;
  padding: 13px 16px;
}

/* Final command-header cascade lock. */
.hazmat-command-bar.topbar {
  grid-template-columns: 44px minmax(320px, auto) minmax(300px, 0.85fr) minmax(560px, 1.35fr) 50px 44px;
  min-height: 98px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #0c3152 0%, #082540 52%, #061a2e 100%);
}

#overview.view.active { display: grid; min-height: calc(100dvh - 126px); }
.incident-overview-card { display: grid; min-height: inherit; }
.incident-overview-actions {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  grid-template-rows: none;
  gap: clamp(14px, 1.5vw, 24px);
  min-height: inherit;
}
.incident-overview-actions .overview-action-btn {
  min-height: clamp(300px, calc(100dvh - 150px), 590px);
  padding: clamp(20px, 2.3vw, 34px);
  border-width: 4px;
  background: #0b2944;
}
.incident-overview-actions .overview-action-btn::after {
  background: linear-gradient(90deg, rgba(5, 23, 39, 0.98) 0%, rgba(7, 34, 57, 0.93) 39%, rgba(7, 34, 57, 0.45) 68%, rgba(7, 34, 57, 0.05) 100%);
}
.overview-action-copy { width: min(72%, 520px); }
.overview-action-title,
.overview-action-description { color: #fff; text-shadow: 0 2px 5px rgba(0, 0, 0, 0.72); }
.overview-action-arrow { color: var(--gold); }
.overview-action-incident .overview-action-copy { transform: none; }
.overview-action-incident .overview-action-title { white-space: normal; }
.incident-overview-actions .overview-action-active { --overview-accent: var(--gold); --overview-accent-rgb: var(--gold-rgb); }
.incident-overview-actions .overview-action-reports { --overview-accent: #2e8cff; --overview-accent-rgb: 46, 140, 255; }
.incident-overview-actions .overview-action-active::before { background-position: center bottom; }
.incident-overview-actions .overview-action-reports::before { background-position: center center; }

.content-area > .view > .hazmat-page-hero,
#plume > .plume-page-header {
  min-height: 214px;
  max-height: none;
  padding: 28px 30px;
  color: #fff;
}
#plume > .plume-page-header,
#map > .hazmat-page-hero,
.content-area > .view > .hazmat-page-hero-compact,
.content-area > .view > .hazmat-page-hero.compact {
  min-height: 176px;
  max-height: none;
  padding: 21px 25px;
}

@media (max-width: 1680px) {
  .hazmat-command-bar.topbar { grid-template-columns: 44px minmax(300px, auto) minmax(340px, 1fr) 50px 44px; }
  .hazmat-command-nav.module-nav { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(9, minmax(84px, 1fr)); }
}
@media (max-width: 1000px) {
  .hazmat-command-bar.topbar { grid-template-columns: 44px minmax(0, 1fr) 48px 44px; }
  .hazmat-command-context.notification-center { grid-column: 1 / -1; grid-row: 2; }
  .hazmat-command-nav.module-nav { grid-column: 1 / -1; grid-row: 3; display: flex; overflow-x: auto; }
  .hazmat-command-nav .module-btn { flex: 0 0 104px; }
  .incident-overview-actions .overview-action-btn { min-height: 320px; }
}
@media (max-width: 700px) {
  .hazmat-command-bar.topbar { grid-template-columns: 40px minmax(0, 1fr) 40px; padding: 8px; }
  .department-logo-link { display: none; }
  .hazmat-command-incident { display: none; }
  #overview.view.active { min-height: auto; }
  .incident-overview-actions { grid-template-columns: 1fr; }
  .incident-overview-actions .overview-action-btn { min-height: 245px; }
  .content-area > .view > .hazmat-page-hero,
  #plume > .plume-page-header,
  #map > .hazmat-page-hero { min-height: 170px; padding: 18px; }
}

/* Tactical command-board refinement. Keep last. */
:root {
  --hazmatiq-font-heading: "Black Ops One", "Stencil Std", Copperplate, "Bahnschrift Condensed", "DejaVu Sans Condensed", Impact, sans-serif;
}

.hazmat-command-bar.topbar {
  grid-template-columns: 48px minmax(390px, auto) minmax(390px, 1fr) 54px 46px;
  min-height: 98px;
  padding: 10px 16px;
}

.hazmat-command-nav { display: none !important; }

.command-menu-toggle {
  width: 48px;
  height: 48px;
  border-width: 2px;
  border-color: #5b89ad;
}

.command-menu-toggle span {
  width: 24px;
  height: 3px;
}

.hazmat-command-identity {
  display: grid;
  grid-template-columns: minmax(300px, auto) minmax(120px, 1fr);
  align-items: center;
}

.hazmatiq-logo-lockup { gap: 17px; }

.hazmatiq-logo-placard {
  flex-basis: 66px;
  width: 66px;
  height: 66px;
  border-width: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.hazmatiq-logo-placard i { font-size: 0.92rem; }

.hazmatiq-logo-word {
  font-family: "Bahnschrift Condensed", "Arial Narrow", Impact, sans-serif;
  font-size: clamp(2.75rem, 3.1vw, 3.7rem);
  font-stretch: condensed;
  font-weight: 950;
  letter-spacing: -0.045em;
  line-height: 0.88;
  transform: skewX(-3deg);
}

.hazmatiq-logo-word b {
  background: linear-gradient(180deg, #fff 0%, #fff 27%, #b9c8d3 54%, #fff 78%, #879aaa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #03111e);
}

.hazmatiq-logo-type small {
  margin-top: 7px;
  color: #fff;
  font-size: 0.79rem;
  font-weight: 900;
  letter-spacing: 0.24em;
}

.hazmat-command-incident { max-width: 170px; }

.workspace-drawer-nav .module-btn,
.overview-action-title,
.hazmat-hero-title,
.workspace-drawer-header h2 {
  font-family: "Bahnschrift Condensed", "Arial Narrow", Impact, sans-serif;
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.workspace-drawer-nav .module-btn {
  min-height: 49px;
  border-left: 4px solid transparent;
  font-size: 1rem;
}

.workspace-drawer-nav .module-btn:hover,
.workspace-drawer-nav .module-btn:focus-visible {
  border-left-color: var(--gold);
}

#overview.view.active {
  min-height: calc(100dvh - 122px);
}

.incident-overview-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(168px, 1fr));
  gap: 14px;
}

.incident-overview-actions .overview-action-btn {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  min-height: 168px;
  padding: clamp(18px, 2vw, 28px);
  border: 2px solid #3d6d94;
  border-left: 7px solid var(--gold);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(6, 26, 46, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.incident-overview-actions .overview-action-btn::before {
  background-size: cover;
  background-position: center;
}

.incident-overview-actions .overview-action-btn::after {
  background: linear-gradient(90deg, rgba(4, 20, 34, 0.98) 0%, rgba(7, 34, 57, 0.91) 50%, rgba(7, 34, 57, 0.3) 100%);
}

.overview-action-icon {
  position: relative;
  z-index: 2;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 8px;
  background: rgba(6, 26, 46, 0.83);
  color: var(--gold);
  font-family: "Bahnschrift Condensed", "Arial Narrow", Impact, sans-serif;
  font-size: 1.25rem;
  font-weight: 950;
  letter-spacing: 0.03em;
  box-shadow: 0 0 16px rgba(var(--gold-rgb), 0.18);
}

.overview-action-copy {
  width: 100%;
  max-width: 560px;
  gap: 4px;
}

.overview-action-title,
.overview-action-incident .overview-action-title {
  padding-left: 0;
  border-left: 0;
  font-size: clamp(1.75rem, 2.5vw, 2.8rem);
  letter-spacing: 0.025em;
  line-height: 0.95;
  white-space: nowrap;
}

.overview-action-description {
  max-width: 32rem;
  padding-left: 0;
  font-size: clamp(0.86rem, 1.05vw, 1rem);
  font-weight: 650;
  line-height: 1.25;
}

.overview-action-arrow {
  padding-left: 0;
  font-size: 1.65rem;
  line-height: 0.8;
}

.incident-overview-actions .overview-action-btn:hover,
.incident-overview-actions .overview-action-btn:focus-visible {
  z-index: 3;
  border-color: var(--gold);
  transform: translateY(-5px) scale(1.012);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.23), 0 18px 34px rgba(6, 26, 46, 0.38);
}

.overview-action-incident::before,
.overview-action-active::before { background-image: url("assets/incident-command-hero-v2.webp") !important; }
.overview-action-chemical::before { background-image: url("assets/chemical-id-search-background-v2.webp") !important; }
.overview-action-plume::before { background-image: url("assets/plume-model-hero-v2.webp") !important; }
.overview-action-map::before { background-image: url("assets/live-map-hero-v2.webp") !important; }
.overview-action-reports::before { background-image: url("assets/reports-hero-v2.webp") !important; }

.variant-incident { background-image: linear-gradient(90deg, rgba(6, 26, 46, 0.98), rgba(8, 37, 64, 0.78) 50%, rgba(8, 37, 64, 0.12)), url("assets/incident-command-hero-v2.webp") !important; }
.variant-reports { background-image: linear-gradient(90deg, rgba(6, 26, 46, 0.98), rgba(8, 37, 64, 0.68) 48%, rgba(8, 37, 64, 0.06)), url("assets/reports-hero-v2.webp") !important; }
.variant-monitoring { background-image: linear-gradient(90deg, rgba(6, 26, 46, 0.98), rgba(8, 37, 64, 0.68) 48%, rgba(8, 37, 64, 0.06)), url("assets/equipment-hero-v2.webp") !important; }
.variant-my-chemicals { background-image: linear-gradient(90deg, rgba(6, 26, 46, 0.98), rgba(8, 37, 64, 0.68) 48%, rgba(8, 37, 64, 0.06)), url("assets/my-chemicals-hero-v2.webp") !important; }

@media (max-width: 1180px) {
  .hazmat-command-bar.topbar { grid-template-columns: 48px minmax(350px, 1fr) minmax(330px, 1fr) 46px; }
  .department-logo-link { display: none; }
  .hazmat-command-identity { grid-template-columns: minmax(280px, auto) minmax(110px, 1fr); }
}

@media (max-width: 820px) {
  .hazmat-command-bar.topbar { grid-template-columns: 44px minmax(0, 1fr) 42px; }
  .hazmat-command-context.notification-center { grid-column: 1 / -1; grid-row: 2; }
  .hazmat-command-identity { grid-template-columns: 1fr; }
  .hazmat-command-incident { display: none; }
  .hazmatiq-logo-placard { flex-basis: 56px; width: 56px; height: 56px; }
  .hazmatiq-logo-word { font-size: clamp(2.25rem, 7.5vw, 3rem); }
  .incident-overview-actions { grid-template-columns: 1fr; grid-template-rows: none; }
  .incident-overview-actions .overview-action-btn { min-height: 170px; }
}

@media (max-width: 500px) {
  .hazmatiq-logo-placard { flex-basis: 46px; width: 46px; height: 46px; }
  .hazmatiq-logo-word { font-size: clamp(1.72rem, 8vw, 2.2rem); }
  .hazmatiq-logo-type small { display: block; margin-top: 4px; font-size: 0.55rem; letter-spacing: 0.15em; }
  .incident-overview-actions .overview-action-btn { grid-template-columns: 52px minmax(0, 1fr); padding: 16px; }
  .overview-action-icon { width: 44px; height: 44px; font-size: 1rem; }
  .overview-action-title,
  .overview-action-incident .overview-action-title { font-size: clamp(1.45rem, 7vw, 2rem); }
}

/* Command-center shell and calm three-panel home. Keep this block last. */
:root {
  color-scheme: dark;
  --bg: #061626;
  --panel: #0b2944;
  --panel-2: #102f4b;
  --text: #edf5fb;
  --muted: #a8bac9;
  --border: #315d82;
}

body,
.app-shell {
  background:
    radial-gradient(circle at 84% 18%, rgba(37, 105, 155, 0.2), transparent 32%),
    linear-gradient(145deg, #061626 0%, #082540 54%, #0b2944 100%);
  color: var(--text);
}

.app-shell { padding: var(--app-top-space, 8px); }

.hazmat-command-bar.topbar {
  position: relative;
  isolation: isolate;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: stretch;
  min-height: 408px;
  padding: 10px 16px 14px;
  border: 1px solid #3d6d94;
  border-radius: 12px;
  background:
    radial-gradient(circle at 82% 12%, rgba(220, 45, 43, 0.16), transparent 25%),
    linear-gradient(180deg, #0c3152 0%, #082540 58%, #061a2e 100%);
  box-shadow: 0 12px 34px rgba(1, 10, 18, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hazmat-command-identity {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  min-width: 0;
}

.brand-logo-command {
  display: block;
  width: min(1240px, 100%);
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: left center;
}

.command-center-launch {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.command-center-launch .command-menu-toggle {
  flex: 0 0 48px;
  border-color: var(--gold);
  background: linear-gradient(145deg, #173f61, #0a233a);
  box-shadow: 0 0 0 1px rgba(var(--gold-rgb), 0.18), 0 5px 14px rgba(0, 0, 0, 0.28);
}

.command-center-launch .command-menu-toggle:hover,
.command-center-launch .command-menu-toggle:focus-visible {
  border-color: var(--gold);
  background: #174a73;
}

.command-center-label {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.command-header-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  margin-top: 8px;
}

.command-promo-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}

.overview-promo-strip {
  margin-top: 14px;
  padding: 10px 2px 2px;
  border-top: 1px solid rgba(77, 124, 160, 0.55);
}

.command-promo-grid article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  min-height: 54px;
  padding: 7px 9px;
  border: 1px solid rgba(77, 124, 160, 0.72);
  border-radius: 8px;
  background: rgba(5, 27, 46, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(3px);
}

.command-promo-grid article > span {
  color: var(--gold);
  font-size: 1.35rem;
  line-height: 1;
  text-align: center;
}

.command-promo-grid strong,
.command-promo-grid small { display: block; overflow: hidden; text-overflow: ellipsis; }
.command-promo-grid strong { color: #fff; font-size: 0.7rem; line-height: 1.15; }
.command-promo-grid small { margin-top: 2px; color: #9eb7cb; font-size: 0.57rem; line-height: 1.2; }

.hazmat-command-context.notification-center {
  position: relative;
  right: auto;
  bottom: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  width: 100%;
  max-width: none;
  padding: 9px;
  border: 1px solid rgba(77, 124, 160, 0.78);
  border-radius: 9px;
  background: rgba(4, 23, 39, 0.86);
  overflow: hidden;
  backdrop-filter: blur(4px);
}

.hazmat-command-context .notification-feed {
  display: grid;
  grid-template-columns: minmax(145px, 0.8fr) minmax(390px, 2.2fr) minmax(145px, 0.8fr);
  gap: 8px;
  overflow: hidden;
}

.hazmat-command-context .notification-item,
.hazmat-command-context .notification-system {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 62px;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid rgba(76, 117, 151, 0.64);
  border-radius: 7px;
  background: rgba(11, 41, 68, 0.92);
  text-align: center;
}

.hazmat-command-context .notification-item > span {
  color: var(--gold);
  font-size: 0.64rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hazmat-command-context .notification-item > strong,
.hazmat-command-context .notification-updated {
  width: auto;
  max-width: 100%;
  overflow: hidden;
  color: #fff;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hazmat-command-context .notification-weather-item > strong {
  overflow: visible;
  font-size: 0.78rem;
  text-overflow: clip;
  white-space: normal;
}

.hazmat-command-context .notification-weather-item > small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #8fb1cc;
  font-size: 0.56rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hazmat-command-context .notification-system > span,
.hazmat-command-context .notification-system > time,
.hazmat-command-context .notification-system > strong {
  grid-column: auto;
  grid-row: auto;
  justify-self: center;
}

.hazmat-command-context .notification-system > time { position: static; }
.hazmat-command-context .notification-alert-count { justify-self: end; min-height: 26px; margin-top: 5px; padding: 3px 9px; }

#overview.view.active {
  min-height: calc(100dvh - 248px);
  padding-top: 10px;
  padding-left: clamp(6px, 0.65vw, 12px);
}

.incident-overview-card,
.incident-overview-actions {
  min-height: inherit;
}

.incident-overview-actions {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, minmax(245px, 1fr));
  gap: 14px;
}

.overview-command-panel {
  --panel-accent: #d71920;
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: 245px;
  overflow: hidden;
  border: 2px solid var(--panel-accent);
  border-radius: 10px;
  background-color: #0b2944;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  box-shadow: 0 10px 26px rgba(1, 11, 20, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: border-width 0.16s ease, border-color 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
  cursor: pointer;
}

.overview-command-panel::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(4, 20, 34, 0.92) 0%, rgba(6, 28, 47, 0.8) 43%, rgba(7, 34, 57, 0.42) 70%, rgba(7, 34, 57, 0.14) 100%);
  transition: background 0.22s ease;
}

.overview-command-incident {
  background-image: url("assets/home-new-incident-hero-v5.webp");
}

.overview-command-planning {
  --panel-accent: var(--gold);
  background-image: url("assets/home-planning-tools-hero-v4.webp");
}

.overview-command-reports {
  --panel-accent: #fff;
  background-image: url("assets/home-incident-reports-hero-v4.webp");
}

.overview-command-panel:hover,
.overview-command-panel:focus-within {
  z-index: 2;
  transform: none;
  border-width: 6px;
  border-style: solid;
  border-color: var(--panel-accent);
  outline: 4px solid color-mix(in srgb, var(--panel-accent) 72%, transparent);
  outline-offset: 3px;
  filter: saturate(1.18) contrast(1.04) brightness(1.12);
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--panel-accent) 42%, transparent),
    0 24px 46px rgba(1, 10, 18, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.overview-command-panel:hover::after,
.overview-command-panel:focus-within::after {
  background: linear-gradient(90deg, rgba(4, 20, 34, 0.84) 0%, rgba(6, 28, 47, 0.67) 43%, rgba(7, 34, 57, 0.28) 70%, rgba(7, 34, 57, 0.06) 100%);
}

.overview-command-incident:hover,
.overview-command-incident:focus-within { box-shadow: 0 0 0 6px rgba(215, 25, 32, 0.54), 0 24px 48px rgba(105, 5, 10, 0.66); }
.overview-command-planning:hover,
.overview-command-planning:focus-within { box-shadow: 0 0 0 6px rgba(var(--gold-rgb), 0.52), 0 24px 48px rgba(var(--gold-rgb), 0.62); }
.overview-command-reports:hover,
.overview-command-reports:focus-within { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.68), 0 24px 48px rgba(1, 10, 18, 0.64); }

.overview-command-copy {
  display: grid;
  gap: 7px;
  width: min(760px, 68%);
  padding: clamp(20px, 2.6vw, 34px);
}

.overview-command-kicker {
  margin: 0;
  color: var(--panel-accent);
  font-family: var(--hazmatiq-font-heading);
  font-size: clamp(2.5rem, 4.25vw, 4.8rem);
  font-weight: 950;
  letter-spacing: 0.025em;
  line-height: 0.88;
  text-transform: uppercase;
  text-shadow: none;
}

.overview-command-panel h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(1rem, 1.55vw, 1.45rem);
  font-weight: 760;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.72);
}

.overview-command-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-command-links .module-btn,
.overview-command-primary {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid #557d9f;
  border-radius: 6px;
  background: rgba(10, 42, 68, 0.9);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.025em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.overview-command-links .module-btn:hover,
.overview-command-links .module-btn:focus-visible,
.overview-command-primary:hover,
.overview-command-primary:focus-visible {
  border-color: var(--gold);
  background: #174a73;
  color: #fff;
  transform: translateY(-2px);
}

.overview-command-primary {
  justify-self: start;
  min-width: 190px;
  border-color: #d71920;
  background: linear-gradient(135deg, #b5161c, #d72b27);
  font-size: 0.9rem;
}

.overview-command-primary span { margin-left: 16px; color: var(--gold); }

.workspace-navigation-drawer {
  width: min(390px, 92vw);
  border-right: 2px solid var(--gold);
  background: linear-gradient(160deg, #0d3457 0%, #082540 50%, #051827 100%);
}

.workspace-drawer-header {
  padding-top: 28px;
  border-bottom-color: #426b8d;
}

.workspace-drawer-header p { color: var(--gold); }

.workspace-drawer-nav .module-btn {
  border-left: 4px solid transparent;
  background: #0b2944;
}

@media (max-width: 1180px) {
  .hazmat-command-bar.topbar { min-height: 0; padding: 10px 12px 12px; }
  .brand-logo-command { width: min(980px, 100%); }
  .command-promo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hazmat-command-context.notification-center { width: min(790px, 100%); justify-self: end; }
}

@media (max-width: 820px) {
  .hazmat-command-bar.topbar {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 8px 9px 10px;
  }
  .brand-logo-command { width: 100%; }
  .command-promo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hazmat-command-context.notification-center { width: 100%; }
  .hazmat-command-context .notification-feed {
    grid-template-columns: minmax(105px, 0.75fr) minmax(300px, 2fr) minmax(105px, 0.75fr);
  }
  #overview.view.active { min-height: auto; }
  .incident-overview-actions { grid-template-rows: none; }
  .overview-command-copy { width: min(92%, 680px); }
}

@media (max-width: 560px) {
  .hazmat-command-bar.topbar { min-height: 0; padding: 7px; }
  .brand-logo-command { width: 100%; }
  .command-center-launch { gap: 8px; }
  .command-center-launch .command-menu-toggle { width: 42px; height: 42px; flex-basis: 42px; }
  .command-center-label { font-size: 0.67rem; }
  .command-header-footer { margin-top: 8px; }
  .command-promo-grid article { min-height: 48px; }
  .command-promo-grid small { display: none; }
  .hazmat-command-context .notification-feed { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .hazmat-command-context .notification-weather-item { grid-column: 1 / -1; grid-row: 1; }
  .hazmat-command-context .notification-system { grid-column: 1; grid-row: 2; }
  .hazmat-command-context .notification-weather-item + .notification-item { grid-column: 2; grid-row: 2; }
  .hazmat-command-context .notification-item { min-height: 56px; gap: 3px; padding: 6px; }
  .hazmat-command-context .notification-item > span { font-size: 0.56rem; }
  .hazmat-command-context .notification-item > strong,
  .hazmat-command-context .notification-updated { max-width: 100%; font-size: 0.6rem; }
  .overview-command-panel { min-height: 250px; }
  .overview-command-copy { width: 100%; padding: 18px; }
  .overview-command-panel::after { background: linear-gradient(90deg, rgba(4, 20, 34, 0.99), rgba(6, 28, 47, 0.88) 74%, rgba(7, 34, 57, 0.62)); }
  .overview-command-links { gap: 6px; }
  .overview-command-links .module-btn { flex: 1 1 calc(50% - 6px); }
}

.content-area > .view > .hazmat-page-hero,
#plume > .plume-page-header,
#map > .hazmat-page-hero {
  position: relative;
  top: auto;
}

@media (min-width: 981px) {
  .app-shell:has(#incident.active),
  .app-shell:has(#plume.active) {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .layout:has(#incident.active),
  .layout:has(#incident.active) > .content-area,
  .layout:has(#incident.active) #incident.active {
    height: auto;
    overflow: visible;
  }
}

.workspace-drawer-header h2 {
  margin: 0;
  color: var(--gold);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
}

.workspace-drawer-nav .workspace-home-btn,
.workspace-drawer-nav .workspace-home-btn:hover,
.workspace-drawer-nav .workspace-home-btn:focus-visible,
.workspace-drawer-nav .workspace-home-btn.active {
  justify-content: center;
  min-height: 74px;
  padding: 8px 14px;
  border: 2px solid var(--gold);
  border-left: 4px solid var(--gold);
  background: var(--gold-surface);
  box-shadow: 0 6px 18px rgba(var(--gold-rgb), 0.24);
}

.workspace-home-btn img {
  display: block;
  width: min(270px, 100%);
  height: 54px;
  object-fit: contain;
}

@media (max-width: 900px) {
  .hazmat-command-context .notification-feed > :last-child {
    padding-right: 84px;
  }

  .command-center-launch {
    padding-inline: 7px;
  }

  .command-center-label {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }
}

@media (max-width: 560px) {
  .hazmat-command-bar.topbar {
    grid-template-rows: 96px 58px;
  }

  .hazmat-command-identity {
    height: 96px;
  }

  .brand-logo-command {
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
    transform: none;
  }

  .hazmat-command-context.notification-center {
    height: 58px;
  }

  .command-header-footer {
    grid-template-columns: minmax(82px, 1fr) minmax(0, 3fr);
    gap: 5px;
    height: 58px;
  }

  .hazmat-command-context .notification-feed {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .hazmat-command-context .notification-weather-item,
  .hazmat-command-context .notification-system,
  .hazmat-command-context .notification-weather-item + .notification-item {
    grid-column: auto;
    grid-row: auto;
  }

  .hazmat-command-context .notification-item,
  .hazmat-command-context .notification-system,
  .command-center-launch {
    min-height: 58px;
    padding: 4px;
  }

  .command-center-launch {
    gap: 4px;
  }

  .command-center-launch .command-menu-toggle {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .command-center-label {
    font-size: 0.52rem;
    letter-spacing: 0.05em;
  }

  .hazmat-command-context .notification-weather-item > small,
  .hazmat-command-context .notification-item > span {
    display: none;
  }

  .hazmat-command-context .notification-weather-item > strong,
  .hazmat-command-context .notification-item > strong,
  .hazmat-command-context .notification-updated {
    font-size: 0.55rem;
    line-height: 1.15;
    white-space: normal;
  }

  .hazmat-command-context .notification-feed > :last-child {
    padding-right: 6px;
  }

  .hazmat-command-context .notification-alert-count {
    right: 4px;
    bottom: 4px;
    min-height: 22px;
    padding: 2px 4px;
    font-size: 0.52rem;
  }
}

/* Unified HAZARD ID workspace. Keep last to supersede the legacy lookup split. */
#lookup.view.active {
  display: grid !important;
  grid-template-columns: minmax(360px, 42fr) minmax(520px, 58fr) !important;
  grid-template-rows: auto auto 1fr;
  align-items: start;
  gap: 10px !important;
  padding: 10px !important;
  border-radius: 16px;
  background:
    linear-gradient(rgba(46, 140, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 140, 255, 0.035) 1px, transparent 1px),
    #031625;
  background-size: 30px 30px;
}

#lookup > .hazard-id-page-hero {
  grid-column: 1 / -1 !important;
  grid-row: 1;
  min-height: 164px !important;
  margin: 0 !important;
  border: 1px solid #285778 !important;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(3, 22, 37, 0.98), rgba(5, 36, 59, 0.86) 58%, rgba(6, 49, 78, 0.58)),
    url("assets/chemical-id-search-background-v2.webp") center 46% / cover !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.hazard-id-page-hero .hazmat-page-hero-content small {
  display: block;
  margin-top: 8px;
  color: #b8c7d9;
  font-size: 0.86rem;
  font-weight: 650;
}

#lookup > .hazard-id-search-stack {
  grid-column: 1 !important;
  grid-row: 2 / span 2;
  display: grid !important;
  gap: 10px;
  width: 100% !important;
  min-width: 0;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.hazard-search-panel {
  position: relative;
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: clamp(15px, 1.5vw, 22px);
  overflow: visible;
  border: 1px solid #24577c;
  border-radius: 11px;
  background:
    radial-gradient(circle at 92% 8%, rgba(46, 140, 255, 0.15), transparent 34%),
    linear-gradient(145deg, rgba(8, 42, 68, 0.98), rgba(3, 25, 43, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 8px 22px rgba(0, 0, 0, 0.26);
}

.hazard-search-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 11px 0 0 11px;
  background: #2e8cff;
  content: "";
}

.hazard-search-panel-cbrne::before { background: var(--gold); }
.hazard-search-panel-radiological::before { background: #ff8a1c; }

.hazard-search-panel > header {
  display: flex;
  align-items: center;
  gap: 11px;
}

.hazard-lane-icon {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid #3d82b8;
  border-radius: 9px;
  background: #092c49;
  color: #6bb8ff;
  font-family: var(--hazmatiq-font-heading);
  font-size: 0.85rem;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.hazard-search-panel-cbrne .hazard-lane-icon { border-color: var(--gold); color: var(--gold); }
.hazard-search-panel-radiological .hazard-lane-icon { border-color: #a95724; color: #ff9b3e; }
.hazard-search-panel header p,
.hazard-search-panel header h2,
.hazard-search-panel > p { margin: 0; }
.hazard-search-panel header p { color: #8ec7f4; font-size: 0.66rem; font-weight: 900; letter-spacing: 0.14em; }
.hazard-search-panel header h2 { color: #f8fafc; font-family: var(--hazmatiq-font-heading); font-size: clamp(1.45rem, 2vw, 2rem); letter-spacing: 0.025em; }
.hazard-search-panel > p { color: #dce7f2; font-size: 0.82rem; line-height: 1.45; }

.hazard-search-panel .chemical-search-form,
.hazard-lane-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.hazard-search-panel .chemical-search-input-wrap,
.hazard-lane-input-wrap { position: relative; min-width: 0; }

.hazard-search-panel input[type="search"],
.hazard-lane-input-wrap input {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 1px solid #326b94;
  border-radius: 8px;
  background: rgba(2, 19, 33, 0.88);
  color: #f8fafc;
  font-size: 0.9rem;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.32);
}

.hazard-search-panel input::placeholder { color: #9fb3c8; opacity: 1; }
.hazard-search-panel input:focus { border-color: var(--gold); outline: 3px solid rgba(var(--gold-rgb), 0.2); }
.hazard-search-panel .primary-btn { min-width: 104px; border: 1px solid var(--gold); background: linear-gradient(180deg, var(--gold), var(--gold)); color: #171006; font-weight: 950; text-transform: uppercase; }

.hazard-search-examples,
.hazard-search-panel .chemical-search-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  color: #9fb3c8;
  font-size: 0.66rem;
}

.hazard-search-examples button,
.hazard-search-panel .chemical-search-examples button {
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid #244e6d;
  border-radius: 999px;
  background: #08263f;
  color: #dce7f2;
  font-size: 0.65rem;
}

.hazard-lane-results { display: grid; gap: 6px; }
.hazard-search-result-card {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 0;
  padding: 9px 11px;
  border: 1px solid #326b94;
  border-radius: 7px;
  background: rgba(11, 48, 77, 0.9);
  color: #f8fafc;
  text-align: left;
}
.hazard-search-result-card:hover,
.hazard-search-result-card:focus-visible { border-color: var(--gold); background: #123f63; }
.hazard-search-result-card strong { color: #f8fafc; font-size: 0.88rem; }
.hazard-search-result-card span { color: var(--gold); font-size: 0.68rem; font-weight: 800; }
.hazard-search-result-card small,
.hazard-lane-empty { margin: 0; color: #b8c7d9; font-size: 0.64rem; }

#lookup > .hazard-id-empty-profile,
#lookup > .hazard-profile-results,
#lookup > #chemical-id-results {
  grid-column: 2 !important;
  grid-row: 2 / span 2 !important;
  width: 100% !important;
  min-width: 0;
  margin: 0 !important;
}

#lookup > [hidden] { display: none !important; }

.hazard-id-empty-profile {
  display: grid;
  align-self: stretch;
  min-height: 0;
  place-content: center;
  justify-items: center;
  padding: 36px;
  border: 1px solid #24577c;
  border-radius: 11px;
  background:
    radial-gradient(circle at 50% 42%, rgba(46, 140, 255, 0.16), transparent 32%),
    linear-gradient(145deg, #082b47, #031827);
  color: #dce7f2;
  text-align: center;
}
.hazard-id-empty-profile > span { display: grid; width: 92px; height: 92px; place-items: center; border: 2px solid var(--gold); border-radius: 50%; color: var(--gold); font: 950 2rem var(--hazmatiq-font-heading); box-shadow: 0 0 34px rgba(46, 140, 255, 0.25); }
.hazard-id-empty-profile h2 { margin: 8px 0; color: #f8fafc; font-size: 2rem; }
.hazard-id-empty-profile p:last-child { max-width: 570px; color: #b8c7d9; line-height: 1.6; }

.hazard-profile-plume-btn,
.hazard-profile-plume-btn:disabled { border-color: #792026; background: #57151a; color: #d9a1a5; cursor: not-allowed; opacity: 0.8; }

#lookup > #facility-inventory { grid-column: 1 !important; grid-row: 3; width: 100%; margin: 0; }
#lookup #open-plume-btn { border: 2px solid #8f0d12; background: linear-gradient(135deg, #c81b22, #a10c13); color: #fff; font-weight: 950; text-transform: uppercase; }

@media (max-width: 1100px) {
  #lookup.view.active { grid-template-columns: minmax(0, 1fr) !important; }
  #lookup > .hazard-id-page-hero,
  #lookup > .hazard-id-search-stack,
  #lookup > .hazard-id-empty-profile,
  #lookup > .hazard-profile-results,
  #lookup > #chemical-id-results,
  #lookup > #facility-inventory { grid-column: 1 !important; grid-row: auto !important; }
  .hazard-id-search-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hazard-search-panel .chemical-search-form,
  .hazard-lane-search-form { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .hazard-id-search-stack { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  #lookup.view.active { padding: 5px !important; }
  #lookup > .hazard-id-page-hero { min-height: 190px !important; }
  .hazard-search-panel { padding: 13px; }
}

/* Shared workspace rhythm keeps section spacing consistent across every view. */
:root {
  --workspace-page-padding: 10px;
  --workspace-section-gap: 4px;
}

.content-area > .view.active:not(#plume):not(#map) {
  gap: var(--workspace-section-gap);
}

/* Tight Hazard ID title-to-search transition. */
#lookup.view.active {
  grid-template-rows: max-content max-content max-content !important;
  align-content: start;
  min-height: 0;
  row-gap: var(--workspace-section-gap) !important;
  padding: var(--workspace-page-padding) !important;
}

#lookup > .hazard-id-page-hero {
  min-height: 0 !important;
  padding: 7px 22px !important;
  margin-bottom: 0 !important;
}

#lookup > .hazard-id-search-stack {
  align-self: start;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

@media (max-width: 520px) {
  :root { --workspace-page-padding: 6px; --workspace-section-gap: 4px; }
  #lookup > .hazard-id-page-hero { min-height: 0 !important; padding: 7px 14px !important; }
}

/* Centered tactical Hazard ID title with no inherited hero-height spacer. */
#lookup.view.active {
  gap: var(--workspace-section-gap) !important;
  row-gap: var(--workspace-section-gap) !important;
}

#lookup > .hazard-id-page-hero {
  display: grid;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  place-items: center;
  padding: 7px 74px !important;
}

#lookup > .hazard-id-page-hero::after {
  content: none;
  display: none;
}

#lookup > .hazard-id-page-hero .hazmat-page-hero-content {
  display: grid;
  justify-items: center;
  width: min(1040px, 100%);
  max-width: none;
  margin: 0 auto;
  text-align: center;
}

#lookup > .hazard-id-page-hero .hazmat-hero-title {
  margin: 0;
  color: #f8fafc;
  font-family: Impact, "Agency FB", "DIN Condensed", "Bahnschrift Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(2.35rem, 4.1vw, 4.6rem);
  font-stretch: condensed;
  font-weight: 950;
  letter-spacing: 0.09em;
  line-height: 0.86;
  text-align: center;
  text-shadow: 3px 4px 0 #03111e, 0 0 20px rgba(46, 140, 255, 0.32);
  text-transform: uppercase;
  transform: skewX(-6deg) scaleX(0.94);
  transform-origin: center;
}

#lookup > .hazard-id-page-hero .hazmat-hero-subtitle {
  margin: 7px 0 0;
  color: var(--gold) !important;
  font-family: "Bahnschrift Condensed", "Arial Narrow", Impact, sans-serif;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  font-weight: 850;
  letter-spacing: 0.12em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

#lookup > .hazard-id-search-stack {
  margin-block: 0 !important;
  transform: none !important;
}

@media (max-width: 520px) {
  #lookup > .hazard-id-page-hero { min-height: 0 !important; padding: 7px 48px !important; }
  #lookup > .hazard-id-page-hero .hazmat-hero-title { font-size: clamp(2rem, 10vw, 3rem); }
}

/* Incident Command — real-time operational dashboard. */
.layout:has(#incident.active),
.app-shell:has(#incident.active) {
  height: auto !important;
  min-height: 100dvh !important;
  overflow: visible !important;
}

.layout:has(#incident.active) > .content-area { overflow: visible !important; }

.layout:has(#incident.active) #incident.active {
  display: block !important;
  height: auto !important;
  overflow: visible !important;
  padding: 0 0 18px;
  color: #f8fafc;
  background: #061a2e;
}

#incident > .incident-command-snapshot,
#incident > .incident-layout { display: none !important; }

#incident.show-incident-editor > .incident-command-snapshot,
#incident.show-incident-editor > .incident-layout {
  display: grid !important;
  margin: 12px;
}

#incident .incident-command-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(138px, 15vw, 205px) !important;
  margin: 0;
  border: 0;
  border-bottom: 2px solid rgba(var(--gold-rgb), 0.7);
  border-radius: 0;
  background-image:
    linear-gradient(90deg, rgba(6, 26, 46, 0.98), rgba(6, 26, 46, 0.46) 54%, rgba(6, 26, 46, 0.85)),
    url("assets/incident-command-hero-v2.webp") !important;
  background-position: center;
  background-size: cover;
}

#incident .incident-command-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  right: auto;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: linear-gradient(180deg, transparent 58%, rgba(3, 17, 30, 0.92));
  transform: none;
}

#incident .incident-command-hero .hazmat-page-hero-content {
  display: grid;
  justify-items: center;
  width: 100%;
  max-width: none;
  align-items: center;
  text-align: center;
}

#incident .incident-command-title {
  margin: 0;
  color: #f8fafc;
  font-family: Impact, "Agency FB", "Bahnschrift Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(2.7rem, 5.1vw, 5.4rem);
  font-weight: 950;
  letter-spacing: 0.045em;
  line-height: 0.9;
  text-shadow: 4px 5px 0 #03111e, 0 0 26px rgba(36, 143, 218, 0.34);
  text-transform: uppercase;
}

#incident .incident-command-subtitle {
  width: max-content;
  max-width: 100%;
  margin: 8px auto 0;
  color: var(--gold) !important;
  font-family: "Bahnschrift Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(1rem, 1.8vw, 1.6rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.incident-command-dashboard {
  min-height: 480px;
  color: #f8fafc;
  background: linear-gradient(180deg, #061a2e, #041422);
}

/* Incident Command is the operational exception to the generic page hero. */
.app-shell:has(#incident.active) .command-header {
  min-height: 54px;
}

.app-shell:has(#incident.active) .command-header-footer {
  display: none;
}

.incident-command-hero {
  min-height: 154px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(3, 16, 29, 0.96) 0%, rgba(4, 25, 44, 0.78) 42%, rgba(4, 25, 44, 0.42) 100%),
    url("assets/incident-command-hero-v2.webp") center 44% / cover;
  box-shadow: inset 0 -1px 0 rgba(91, 170, 222, 0.4);
}

.incident-command-hero::before {
  background-size: 22px 22px;
  mask-image: linear-gradient(90deg, #000 0%, #000 55%, transparent 100%);
}

.incident-command-hero::after {
  right: 10%;
  border-color: rgba(71, 185, 239, 0.3);
  box-shadow: 0 0 0 14px rgba(44, 154, 221, 0.1), 0 0 0 32px rgba(var(--gold-rgb), 0.06);
}

.incident-command-banner-identity {
  display: grid;
  flex: 0 0 190px;
  align-self: stretch;
  place-items: center start;
  padding-left: 10px;
  border-right: 1px solid rgba(109, 190, 237, 0.34);
}

.incident-command-banner-identity img {
  width: min(180px, 100%);
  height: auto;
}

.incident-command-hero .hazmat-page-hero-content { flex: 1; }
.incident-command-hero .hazmat-hero-eyebrow { color: var(--gold) !important; }
.incident-command-hero .hazmat-hero-subtitle { color: #d5edf9 !important; }

.incident-command-empty {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 460px;
  padding: 48px 24px;
  text-align: center;
}

.incident-command-empty[hidden],
#incident-command-active[hidden] { display: none !important; }
.incident-command-empty h2 { margin: 0; font-size: clamp(2rem, 4vw, 4rem); letter-spacing: 0.06em; }
.incident-command-empty p { max-width: 700px; margin: 0; color: #b8cee0; }

.incident-command-summary-strip {
  display: grid;
  grid-template-columns: 1.25fr 1.35fr 1.2fr 1.35fr 1fr 0.95fr;
  padding: 9px 12px;
  border-bottom: 1px solid #244d6d;
  background: rgba(3, 17, 30, 0.93);
}

.incident-command-summary-strip > div {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 3px 11px;
  border-right: 1px solid rgba(93, 142, 180, 0.28);
}
.incident-command-summary-strip > div:last-child { border-right: 0; }
.incident-command-summary-strip > label,
.incident-command-summary-strip > div {
  position: relative;
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 3px 10px;
  border-right: 1px solid rgba(93, 142, 180, 0.28);
}
.incident-command-summary-strip > label > span,
.incident-command-summary-strip > div > span {
  color: #9dc4df;
  font-family: "Bahnschrift Condensed", "Arial Narrow", sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.incident-command-summary-strip input,
.incident-command-summary-strip select {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid #397aa4;
  border-radius: 3px;
  color: #071f36;
  background: #fff;
  font: inherit;
  font-size: 0.78rem;
}
.incident-command-summary-strip input::placeholder { color: #52677a; }
.incident-command-summary-strip select { color: #071f36; font-weight: 800; }
.incident-command-summary-strip select option { color: #071f36; background: #fff; }
.incident-command-summary-strip > label:first-child { grid-template-columns: minmax(0, 1fr) 30px; }
.incident-command-summary-strip > label:first-child > span { grid-column: 1 / -1; }
.incident-command-summary-strip > label:first-child button {
  min-height: 30px;
  border: 1px solid var(--gold);
  border-radius: 3px;
  color: #071f36;
  background: var(--gold-surface);
  font-weight: 900;
  cursor: pointer;
}
.incident-command-summary-strip > div time,
.incident-command-summary-strip > div strong { color: #fff; font-size: 0.82rem; white-space: nowrap; }
.incident-command-summary-strip .chemical-search-input-wrap,
.incident-command-summary-strip .incident-address-autocomplete { min-width: 0; }
.incident-command-summary-strip .chemical-search-suggestions { top: calc(100% + 4px); z-index: 30; }
.incident-command-summary-strip span {
  color: #9dc4df;
  font-family: "Bahnschrift Condensed", "Arial Narrow", sans-serif;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.incident-command-summary-strip span b { margin-right: 4px; color: #56bdf3; font-size: 0.82rem; }
.incident-command-summary-strip strong { color: #fff; overflow-wrap: anywhere; font-size: 0.9rem; }

.incident-command-main-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 10px;
  padding: 8px;
  align-items: start;
}

.incident-command-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(64, 107, 145, 0.82);
  border-radius: 5px;
  color: #f8fafc;
  background: rgba(8, 31, 52, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.incident-command-panel > h2,
.incident-command-tools > h2 {
  margin: 0;
  padding: 8px 11px;
  border-bottom: 1px solid rgba(64, 107, 145, 0.4);
  color: #acd7f4;
  background: linear-gradient(90deg, rgba(17, 54, 83, 0.85), rgba(8, 31, 52, 0.3));
  font-family: "Bahnschrift Condensed", "Arial Narrow", sans-serif;
  font-size: 0.98rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.incident-command-panel > h2 > span,
.incident-command-tools > h2 > span { margin-right: 6px; font-size: 0.95rem; }
.incident-command-panel-action {
  display: inline-grid;
  width: 28px;
  height: 28px;
  min-height: 28px;
  margin-left: auto;
  place-items: center;
  padding: 4px;
  border: 1px solid #56bdf3;
  border-radius: 3px;
  color: #dff5ff;
  background: #0a2a44;
  cursor: pointer;
}
.incident-command-panel-action:hover { border-color: #fff; background: #124568; }
.incident-command-panel-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }


.incident-command-inline-actions button,
.incident-command-wide-action {
  min-height: 30px;
  border: 1px solid var(--gold);
  border-radius: 5px;
  color: var(--gold);
  background: rgba(6, 26, 46, 0.75);
  font-weight: 750;
  cursor: pointer;
}

.incident-command-guided-content {
  display: grid;
  gap: 10px;
  padding: 9px 10px 11px;
}

.incident-command-status-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
}

.incident-command-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  grid-template-rows: auto;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
  padding: 6px 0;
  border-bottom: 1px solid rgba(120, 160, 190, .28);
}

.incident-command-status-row > strong {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  color: #f8fbff;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.incident-command-status-row > .incident-command-status-control {
  display: block;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

@media (max-width: 720px) {
  .incident-command-status-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 4px;
  }
  .incident-command-status-row > strong {
    grid-column: 1;
    grid-row: 1;
  }
  .incident-command-status-row > .incident-command-status-control {
    grid-column: 1;
    grid-row: 2;
  }
}

.incident-command-guided-content section { min-width: 0; }
.incident-command-guided-content h3 {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.incident-command-guided-progress {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.incident-command-guided-progress > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 0;
  border-bottom: 1px dotted rgba(120, 160, 190, 0.3);
  color: #e5f2fa;
  font-size: 1.02rem;
  font-weight: 850;
}
.incident-command-guided-progress .is-complete span { color: #a8f0bd; border-color: #3a9d5d; }
.incident-command-guided-progress span { color: var(--gold); font-size: 0.62rem; font-weight: 800; text-transform: uppercase; }
.incident-command-guided-links { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.incident-command-guided-links button {
  min-height: 28px;
  padding: 4px 6px;
  border: 1px solid #377ba8;
  border-radius: 4px;
  color: #dff5ff;
  background: #0a2a44;
  font-size: 0.66rem;
  font-weight: 800;
  cursor: pointer;
}
.incident-command-guided-links button:hover { border-color: #65c9f4; background: #103a5b; }
.incident-command-guided-progress > div { grid-template-columns: 66px minmax(0, 1fr); }
.incident-command-guided-progress .is-pending span { color: var(--gold); }

.internal-command-menu,
.internal-command-menu:hover,
.internal-command-menu:focus-visible {
  position: absolute;
  z-index: 5;
  top: 14px;
  left: 16px;
  display: grid;
  width: 62px;
  height: 56px;
  min-width: 62px;
  min-height: 56px;
  place-content: center;
  gap: 6px;
  padding: 0;
  border: 2px solid var(--gold);
  border-radius: 5px;
  outline-offset: 3px;
  background: #0b3557;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.internal-command-menu::before,
.internal-command-menu::after { display: none !important; content: none !important; }
.internal-command-menu span { display: block; width: 32px; height: 4px; background: #fff; }
.internal-command-menu:hover { border-color: #fff; background: #124568; }

#incident .incident-command-hero .internal-command-menu {
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 720px) {
  .internal-command-menu,
  .internal-command-menu:hover,
  .internal-command-menu:focus-visible {
    top: 10px;
    left: 10px;
    width: 56px;
    height: 50px;
    min-width: 56px;
    min-height: 50px;
  }
  .internal-command-menu span { width: 28px; height: 3px; }
  #incident .incident-command-hero .internal-command-menu { top: 50%; }
}

.incident-command-reports-panel > section { margin: 7px 9px; }
.incident-command-reports-panel h3 { margin: 0 0 7px; color: #9dcbe8; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
.incident-command-report-card {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(68, 114, 150, 0.5);
  border-radius: 8px;
  background: rgba(15, 44, 68, 0.72);
}
.incident-command-report-card span, .incident-command-report-card small { color: #9fc5df; }
.incident-command-inline-actions { display: flex; gap: 6px; margin-top: 8px; }
.incident-command-inline-actions button { flex: 1; padding: 5px; font-size: 0.68rem; }
.incident-command-recent-reports { display: grid; gap: 5px; color: #b9cede; font-size: 0.72rem; }
.incident-command-recent-reports > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px; border-bottom: 1px solid rgba(103, 145, 177, 0.2); }
.incident-command-recent-reports button { border: 1px solid #3387c1; color: #a7ddff; background: transparent; }
.incident-command-wide-action { width: calc(100% - 24px); margin: 2px 12px 12px; border-color: #3387c1; color: #a7ddff; }

.incident-command-tools { margin: 10px 8px 0; }
.incident-command-tool-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; padding: 7px 9px 9px; }
.incident-command-tool {
  display: grid;
  gap: 4px;
  min-height: 74px;
  height: 100%;
  padding: 9px 10px;
  border: 1px solid #b8c2cc;
  border-radius: 7px;
  color: #102a43;
  background: #e5e7eb;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.incident-command-tool:hover { border-color: #102a43; background: #f3f4f6; box-shadow: 0 6px 14px rgba(8, 37, 64, .18); }
.incident-command-tool:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.incident-command-tool:active { background: #cfd4da; box-shadow: inset 0 2px 4px rgba(8, 37, 64, .18); }
.incident-command-tool strong { display: flex; align-items: center; gap: 6px; min-width: 0; color: #102a43; font-size: .9rem; font-weight: 900; line-height: 1.15; text-transform: uppercase; }
.incident-command-tool strong > span { min-width: 0; color: #102a43; }
.incident-command-tool > span { color: #102a43; font-size: .75rem; line-height: 1.25; }
.incident-command-tool-icon { width: 22px; height: 22px; flex: 0 0 22px; fill: none; stroke: #102a43; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.incident-command-tool-danger { border: 2px solid #b91c1c; background: #e5e7eb; }
.incident-command-tool-danger:hover,
.incident-command-tool-danger:focus-visible { border-color: #991b1b; background: #f3f4f6; }

.incident-command-operational-details { display: block; position: static; flex: 0 0 auto; order: initial; margin: 0 8px 8px; color: #0b2540; background: #dfe4e8; border: 2px solid #8b949e; box-shadow: none; }
.incident-command-operational-details > summary { position: static; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; cursor: pointer; list-style: none; }
.incident-command-operational-details > summary::-webkit-details-marker { display: none; }
.incident-command-operational-details > summary::after { content: '⌄'; flex: 0 0 auto; color: var(--gold); font-size: 1.35rem; font-weight: 900; line-height: 1; transform: rotate(0deg); transition: transform 150ms ease; }
.incident-command-operational-details[open] > summary::after { transform: rotate(180deg); }
.incident-command-operational-details > summary strong { color: #0b2540; text-transform: uppercase; }
.incident-command-operational-details > summary span { color: #334e68; font-size: 0.76rem; }
.incident-command-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; border-top: 1px solid #aeb7c1; }
.incident-command-detail-grid section { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 11px; border: 1px solid #b2bac3; border-radius: 7px; background: #f7f8fa; }
.incident-command-detail-grid h3 { margin: 0 0 6px; color: #0b2540; font-size: 0.8rem; }
.incident-command-detail-grid section > div { color: #243b53; font-size: 0.74rem; line-height: 1.45; }
#ic-edit-scene-btn { margin: 0 12px 12px; }

.incident-command-primary,
.incident-command-secondary {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  color: #071f36;
  background: var(--gold);
  font-weight: 850;
  text-transform: uppercase;
  cursor: pointer;
}
.incident-command-secondary { border-color: #4296cd; color: #dff3ff; background: #0b3557; }

#incident-note-dialog { max-width: min(560px, calc(100vw - 30px)); border-color: #39739e; color: #f8fafc; background: #081f34; }
#incident-note-dialog label { display: grid; gap: 7px; }
#incident-note-dialog textarea { width: 100%; color: #071f36; background: #f8fafc; }

/* Medical guidance is intentionally source-led; keep the external CHEMM action
   and product-specific cautions readable without restoring a browser embed. */
#chemical-id-results .chemical-profile-content[data-active-tab="medical"] {
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: stretch;
}
#chemical-id-results .chemical-profile-content[data-active-tab="medical"] > .chemical-profile-section { grid-column: 1 !important; }

/* Decon follows a symmetric three-part operational sequence. */
#chemical-id-results .chemical-profile-content[data-active-tab="decon"] {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: stretch;
}
#chemical-id-results .chemical-profile-content[data-active-tab="decon"] > .chemical-profile-section {
  grid-column: auto !important;
  min-width: 0;
  height: 100%;
}
#chemical-id-results .chemical-profile-content[data-active-tab="decon"] > .chemical-profile-source-summary {
  grid-column: 1 / -1 !important;
}
.hybrid-decon-consideration {
  margin: 0;
  color: #d7e6f2;
  font-size: 0.84rem;
  line-height: 1.5;
}
#chemical-id-results .hybrid-decon-link {
  margin-top: auto;
  flex-direction: column;
  align-items: stretch;
}
#chemical-id-results .hybrid-decon-logo { width: 100%; }

#chemical-id-results .chemical-profile-life-safety {
  position: relative;
  border-color: #ef3340 !important;
  border-top-color: #ef3340 !important;
  box-shadow: inset 0 0 0 1px rgba(239, 51, 64, 0.22), 0 8px 20px rgba(99, 10, 22, 0.2) !important;
}
#chemical-id-results .chemical-profile-life-safety h4::after {
  content: "LIFE SAFETY";
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 4px;
  color: #fff;
  background: #b11226;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

/* IDLH is a primary life-safety value everywhere it is rendered semantically. */
[data-field="idlh"],
[data-field="idlh"] *,
[data-field^="idlh-"] ,
[data-field^="idlh-"] *,
.chemcompare-row[data-field="idlh"] .chemcompare-label,
.chemcompare-row[data-field="idlh"] .chemcompare-value-main {
  color: #ff4d57 !important;
  font-weight: 900 !important;
}
#chemical-id-results .chemical-profile-meta-item[data-field^="idlh"] {
  border-color: #ef3340 !important;
  background: rgba(177, 18, 38, 0.24) !important;
}

/* Every action whose purpose is opening or plotting the Plume Model uses red. */
button[data-view="plume"],
button[data-command-view="plume"]:not([data-incident-flow-action]):not(.incident-command-tool),
#open-plume-btn,
#guided-open-plume-btn,
#hazard-profile-plume-btn,
#plot-plume-btn,
.incident-command-plume-copy > button,
.chemical-profile-plume {
  border-color: #8f0d12 !important;
  color: #fff !important;
  background: linear-gradient(135deg, #c81b22, #a10c13) !important;
  box-shadow: 0 5px 12px rgba(183, 14, 22, .25) !important;
}
button[data-view="plume"]:hover,
button[data-command-view="plume"]:not([data-incident-flow-action]):not(.incident-command-tool):hover,
#open-plume-btn:hover,
#guided-open-plume-btn:hover,
#hazard-profile-plume-btn:hover,
#plot-plume-btn:hover,
.incident-command-plume-copy > button:hover,
.chemical-profile-plume:hover { border-color: #ff7277 !important; background: linear-gradient(135deg, #f33b42, #c8151e) !important; }
button[data-view="plume"]:disabled,
button[data-command-view="plume"]:not([data-incident-flow-action]):not(.incident-command-tool):disabled,
#open-plume-btn:disabled,
#guided-open-plume-btn:disabled,
#hazard-profile-plume-btn:disabled,
#plot-plume-btn:disabled,
.incident-command-plume-copy > button:disabled,
.chemical-profile-plume:disabled { color: rgba(255,255,255,.7) !important; background: #714144 !important; opacity: .68; }

/* Every Guided Response action uses the green action schema. */
button[data-view="guided-response"],
button[data-command-view="guided-response"]:not([data-incident-flow-action]),
#open-guided-response-btn,
.incident-guided-primary,
.chemical-profile-guided {
  border-color: #238a4b !important;
  color: #fff !important;
  background: linear-gradient(180deg, #146733, #10552b) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 6px 14px rgba(13, 92, 46, .22) !important;
}
button[data-view="guided-response"]:hover,
button[data-command-view="guided-response"]:not([data-incident-flow-action]):hover,
#open-guided-response-btn:hover,
.incident-guided-primary:hover,
.chemical-profile-guided:hover {
  border-color: #5ed487 !important;
  background: linear-gradient(180deg, #35ac62, #1c7a42) !important;
}
button[data-view="guided-response"]:disabled,
button[data-command-view="guided-response"]:not([data-incident-flow-action]):disabled,
#open-guided-response-btn:disabled,
.incident-guided-primary:disabled,
.chemical-profile-guided:disabled {
  color: rgba(255,255,255,.7) !important;
  background: #416c51 !important;
  opacity: .68;
}

@media (max-width: 1180px) {
  .incident-command-summary-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .incident-command-summary-strip > div:nth-child(4) { border-right: 0; }
  .incident-command-main-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .incident-command-summary-strip,
  .incident-command-main-grid,
  .incident-command-tool-grid,
  .incident-command-detail-grid,
  #chemical-id-results .chemical-profile-content[data-active-tab="medical"] { grid-template-columns: 1fr !important; }
  .incident-command-summary-strip > div { border-right: 0; border-bottom: 1px solid rgba(93, 142, 180, 0.28); }
  #chemical-id-results .chemical-profile-content[data-active-tab="medical"] > .chemical-profile-section { grid-column: 1 !important; }
  #chemical-id-results .chemical-profile-content[data-active-tab="decon"] { grid-template-columns: 1fr !important; }
  #chemical-id-results .chemical-profile-content[data-active-tab="decon"] > .chemical-profile-section { grid-column: 1 !important; }
  #incident .incident-command-title { font-size: clamp(2.7rem, 13vw, 4.5rem); }
  .incident-command-hero { align-items: end; min-height: 138px; padding: 16px; }
  .incident-command-banner-identity { display: none; }
  .incident-command-guided-links { grid-template-columns: 1fr; }
}

/* Superseded legacy homepage rollback retained outside the active cascade. */
@media not all {
#overview.view.active {
  display: grid;
  min-height: calc(100dvh - 248px);
  padding: 10px 0 0 clamp(6px, 0.65vw, 12px);
}

#overview .incident-overview-card {
  display: grid;
  width: 100%;
  min-height: inherit;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#overview .incident-overview-actions {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, minmax(150px, 1fr));
  gap: clamp(14px, 1.5vw, 24px);
  min-height: inherit;
}

#overview .incident-overview-actions .overview-action-btn {
  --overview-accent: #d71920;
  --overview-accent-rgb: 215, 25, 32;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 150px;
  padding: clamp(18px, 2.3vw, 34px);
  overflow: hidden;
  border: 5px solid var(--overview-accent);
  border-radius: 18px;
  color: #071524;
  background: #eef2f5;
  font-family: var(--hazmatiq-font-heading);
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
  box-shadow: 0 0 0 1px rgba(var(--overview-accent-rgb), 0.28), 0 10px 24px rgba(11, 31, 51, 0.16);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

#overview .incident-overview-actions .overview-action-btn::before,
#overview .incident-overview-actions .overview-action-btn::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

#overview .incident-overview-actions .overview-action-btn::before {
  z-index: -2;
  background-image: url("assets/home-card-scenes-v5.webp") !important;
  background-position: center top !important;
  background-size: 100% 300%;
  background-repeat: no-repeat;
  transition: transform 0.25s ease, filter 0.25s ease;
}

#overview .incident-overview-actions .overview-action-btn::after {
  z-index: -1;
  background: linear-gradient(90deg, rgba(250, 252, 253, 0.98) 0%, rgba(250, 252, 253, 0.92) 31%, rgba(250, 252, 253, 0.28) 58%, transparent 76%);
}

#overview .overview-action-copy {
  display: grid;
  width: min(54%, 620px);
  max-width: calc(100% - 24px);
  gap: 8px;
  transform: none;
}

#overview .overview-action-title {
  padding-left: 24px;
  border-left: 8px solid var(--overview-accent);
  color: #071524;
  font-size: clamp(1.9rem, 3.25vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-shadow: none;
  text-transform: uppercase;
  white-space: normal;
}

#overview .overview-action-description {
  max-width: 31rem;
  padding-left: 32px;
  color: #263b4d;
  font-family: var(--hazmatiq-font-body);
  font-size: clamp(0.95rem, 1.35vw, 1.3rem);
  font-weight: 600;
  line-height: 1.35;
  text-shadow: none;
}

#overview .overview-action-arrow {
  padding-left: 32px;
  color: var(--overview-accent);
  font-size: clamp(1.8rem, 2.8vw, 3rem);
  line-height: 0.75;
}

#overview .overview-action-planning { --overview-accent: #1683dc; --overview-accent-rgb: 22, 131, 220; }
#overview .overview-action-planning::before { background-position: center center !important; }
#overview .overview-action-training { --overview-accent: #53b719; --overview-accent-rgb: 83, 183, 25; }
#overview .overview-action-training::before { background-position: center bottom !important; }

#overview .incident-overview-actions .overview-action-btn:hover,
#overview .incident-overview-actions .overview-action-btn:focus-visible {
  border-color: var(--overview-accent);
  transform: translateY(-4px) scale(1.008);
  box-shadow: 0 0 0 4px rgba(var(--overview-accent-rgb), 0.28), 0 18px 38px rgba(var(--overview-accent-rgb), 0.34);
}

#overview .incident-overview-actions .overview-action-btn:hover::before,
#overview .incident-overview-actions .overview-action-btn:focus-visible::before {
  transform: scale(1.07);
  filter: saturate(1.22) contrast(1.08) brightness(1.04);
}

@media (max-width: 700px) {
  #overview.view.active { min-height: auto; padding-left: 0; }
  #overview .incident-overview-actions { grid-template-rows: none; }
  #overview .incident-overview-actions .overview-action-btn { min-height: 220px; padding: 18px; }
  #overview .overview-action-copy { width: 72%; gap: 7px; }
  #overview .overview-action-title { padding-left: 14px; border-left-width: 6px; font-size: clamp(1.55rem, 8vw, 2.2rem); }
  #overview .overview-action-description { padding-left: 20px; font-size: 0.9rem; }
  #overview .overview-action-arrow { padding-left: 20px; }
}
}

/* Yesterday's approved full-bleed cinematic Home cards. */
#overview.view.active {
  display: grid;
  min-height: auto;
  padding: 10px;
  background: #02090f;
}

#overview .incident-overview-card {
  display: grid;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#overview .incident-overview-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(3, minmax(clamp(260px, 20.8vw, 330px), auto));
  gap: 16px;
  width: 100%;
}

#overview .overview-action-layout {
  display: grid;
  min-width: 0;
  min-height: clamp(260px, 20.8vw, 330px);
  margin: 0;
}

#overview .incident-overview-actions .overview-action-btn {
  --overview-accent: #d71920;
  --overview-accent-rgb: 215, 25, 32;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: clamp(260px, 20.8vw, 330px);
  padding: clamp(28px, 3.2vw, 48px);
  overflow: hidden;
  border: 2px solid var(--overview-accent);
  border-radius: 18px;
  color: #fff;
  background: #02090f;
  font-family: var(--hazmatiq-font-heading);
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

#overview .incident-overview-actions .overview-action-btn::before,
#overview .incident-overview-actions .overview-action-btn::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

#overview .incident-overview-actions .overview-action-btn::before {
  z-index: 0;
  background-image: url("assets/home-card-scenes-v5.webp") !important;
  background-repeat: no-repeat !important;
  background-position: center top !important;
  background-size: 100% 300% !important;
  opacity: 1;
  transition: transform 0.25s ease, filter 0.25s ease;
}

#overview .incident-overview-actions .overview-action-btn::after {
  z-index: 1;
  background: linear-gradient(90deg, rgba(0, 5, 9, 0.98) 0%, rgba(0, 7, 12, 0.9) 29%, rgba(0, 10, 17, 0.55) 48%, rgba(0, 7, 12, 0.2) 72%, rgba(0, 0, 0, 0.24) 100%);
}

#overview .overview-action-copy {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(48%, 660px);
  max-width: calc(100% - 24px);
  gap: 16px;
  transform: none;
}

#overview .overview-action-title,
#overview .overview-action-description,
#overview .overview-action-arrow {
  display: block;
  color: #fff;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.88);
}

#overview .overview-action-title,
#overview .overview-action-incident .overview-action-title {
  padding-left: 34px;
  border-left: 10px solid var(--overview-accent);
  color: #fff;
  font-family: "Bahnschrift Condensed", "Arial Narrow", Impact, sans-serif;
  font-size: clamp(2.7rem, 4.35vw, 4.65rem);
  font-weight: 950;
  letter-spacing: -0.025em;
  line-height: 0.98;
  text-transform: uppercase;
  white-space: normal;
}

#overview .overview-action-description {
  max-width: 38rem;
  padding-left: 44px;
  font-family: var(--hazmatiq-font-body);
  font-size: clamp(1.1rem, 1.7vw, 1.75rem);
  font-weight: 500;
  line-height: 1.28;
}

#overview .overview-action-arrow {
  padding-left: 44px;
  color: var(--overview-accent);
  font-family: var(--hazmatiq-font-body);
  font-size: clamp(2.3rem, 3.4vw, 3.7rem);
  font-weight: 400;
  line-height: 0.75;
}

#overview .overview-action-planning {
  --overview-accent: #2e9df4;
  --overview-accent-rgb: 46, 157, 244;
}

#overview .incident-overview-actions .overview-action-planning::before {
  background-position: center center !important;
}

#overview .overview-action-reports {
  --overview-accent: #53b719;
  --overview-accent-rgb: 83, 183, 25;
}

#overview .incident-overview-actions .overview-action-reports::before {
  background-image: url("assets/home-card-scenes-v5.webp") !important;
  background-position: center bottom !important;
}

#overview .incident-overview-actions .overview-action-btn:hover,
#overview .incident-overview-actions .overview-action-btn:focus-visible {
  z-index: 3;
  border-color: var(--overview-accent);
  transform: translateY(-4px) scale(1.006);
  outline: none;
  box-shadow: 0 0 0 4px rgba(var(--overview-accent-rgb), 0.28), 0 18px 38px rgba(0, 0, 0, 0.48);
}

#overview .incident-overview-actions .overview-action-btn:hover::before,
#overview .incident-overview-actions .overview-action-btn:focus-visible::before {
  transform: scale(1.035);
  filter: saturate(1.1) contrast(1.05) brightness(1.03);
}

@media (max-width: 760px) {
  #overview.view.active { padding: 7px; }
  #overview .incident-overview-actions { grid-template-rows: none; gap: 10px; }
  #overview .incident-overview-actions .overview-action-btn { min-height: 230px; padding: 22px; border-radius: 13px; }
  #overview .overview-action-layout { min-height: 230px; }
  #overview .overview-action-copy { width: min(78%, 560px); gap: 10px; }
  #overview .overview-action-title,
  #overview .overview-action-incident .overview-action-title { padding-left: 18px; border-left-width: 7px; font-size: clamp(2rem, 8vw, 3rem); }
  #overview .overview-action-description { padding-left: 25px; font-size: clamp(0.95rem, 3.8vw, 1.15rem); }
  #overview .overview-action-arrow { padding-left: 25px; font-size: 2.4rem; }
}

/* Approved command-launch copy and touch targets; keep Home limited to three launchers. */
.app-shell:has(#overview.view.active) > .footer-note {
  display: none;
}

#overview .overview-action-phrase,
#overview .overview-action-cta {
  position: relative;
  z-index: 2;
  display: block;
  margin-left: 44px;
}

#overview .overview-action-phrase {
  color: var(--gold);
  font-size: clamp(1rem, 1.4vw, 1.35rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.85);
}

#overview .overview-action-cta {
  justify-self: start;
  min-width: 220px;
  min-height: 48px;
  padding: 13px 18px;
  border: 2px solid var(--overview-accent);
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, rgba(var(--overview-accent-rgb), 0.94), rgba(var(--overview-accent-rgb), 0.68));
  font-size: 0.88rem;
  font-weight: 950;
  letter-spacing: 0.055em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 7px 18px rgba(0, 0, 0, 0.3);
}

#overview .overview-action-cta > span {
  margin-left: 18px;
  color: var(--gold);
  font-size: 1.2rem;
}

.workspace-drawer-nav .workspace-settings-btn {
  margin-top: 18px;
  border-top-color: #557895;
}

@media (max-width: 760px) {
  #overview .overview-action-phrase,
  #overview .overview-action-cta { margin-left: 25px; }
  #overview .overview-action-cta { min-width: 190px; min-height: 46px; padding: 12px 14px; }
}

/* Editable Homepage layout. Keep homepage changes in this section while it is in development. */
body:has(#overview.view.active),
.app-shell:has(#overview.view.active) {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background-color: #020d17;
  background-image:
    linear-gradient(rgba(103, 156, 197, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 156, 197, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 84% 8%, rgba(42, 121, 180, 0.16), transparent 27%),
    linear-gradient(145deg, #020d17 0%, #061a2e 48%, #071f35 100%);
  background-size: 42px 42px, 42px 42px, auto, auto;
}

.app-shell:has(#overview.view.active) {
  overflow-x: hidden;
}

.app-shell:has(#overview.view.active) > .command-header .command-center-label {
  display: none;
}

.app-shell:has(#overview.view.active) > .command-header .command-center-launch .command-menu-toggle {
  width: 46px;
  height: 42px;
  flex: 0 0 46px;
}

.app-shell:has(#overview.view.active) > .command-header .command-header-footer {
  position: relative;
  z-index: 4;
  inset: auto;
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context.notification-center {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(5px, 0.65vw, 10px);
  width: 100%;
}

.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-feed > .notification-item:last-child {
  display: grid;
  padding-right: 10px;
}

.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-item,
.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-system {
  min-width: 0;
  min-height: 46px;
  padding: 2px clamp(7px, 0.8vw, 12px);
  border: 1px solid rgba(78, 132, 174, 0.66);
  border-radius: 7px;
  background: rgba(5, 27, 46, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.command-header .hazmat-command-context .notification-system {
  position: relative;
  grid-template-columns: minmax(48px, 1fr) minmax(0, 2fr) minmax(48px, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  padding-inline: 58px;
  text-align: center;
}

.command-header .hazmat-command-context .notification-system > .command-center-launch {
  position: absolute;
  top: 50%;
  left: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: translateY(-50%);
}

.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-system .command-center-launch .command-menu-toggle {
  width: 32px;
  height: 32px;
  min-height: 32px;
  flex: 0 0 32px;
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}

.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-system .command-center-launch .command-menu-toggle:hover,
.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-system .command-center-launch .command-menu-toggle:focus-visible {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-system .command-center-launch .command-menu-toggle span {
  width: 27px;
  height: 4px;
  border-radius: 3px;
  background: #f8fafc;
}

.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-system .command-center-launch .command-menu-toggle:hover span,
.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-system .command-center-launch .command-menu-toggle:focus-visible span {
  background: #69adff;
  box-shadow: 0 0 5px rgba(105, 173, 255, 0.75);
}

.command-header .hazmat-command-context .notification-system > span,
.command-header .hazmat-command-context .notification-system > time,
.command-header .hazmat-command-context .notification-system > strong {
  grid-column: 2;
  justify-self: center;
  text-align: center;
}

.command-header .hazmat-command-context .notification-system > span,
.command-header .hazmat-command-context .notification-system > time {
  grid-row: 1;
}

.command-header .hazmat-command-context .notification-system > span {
  transform: translateX(-34px);
}

.command-header .hazmat-command-context .notification-system > time {
  transform: translateX(34px);
}

.command-header .hazmat-command-context .notification-system > strong {
  grid-row: 2;
}

.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-system > span,
.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-system > time,
.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-system > strong {
  font-size: 0.78rem;
  line-height: 1.2;
}

.app-shell:has(#overview.view.active) > .command-header .hazmat-command-context .notification-alert-count {
  display: none;
}

.app-shell:has(#overview.view.active) > .layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(8px, 1vw, 14px) clamp(32px, 6vw, 120px) clamp(18px, 2vw, 32px) clamp(6px, 0.6vw, 10px);
  background: transparent;
}

.app-shell:has(#overview.view.active) > .layout > .content-area,
#overview.view.active,
#overview .incident-overview-card,
#overview .incident-overview-actions,
#overview .overview-action-layout {
  grid-column: 1;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  background: transparent;
  box-sizing: border-box;
}

#overview.view.active,
#overview .incident-overview-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#overview .incident-overview-actions {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  justify-items: start;
  gap: clamp(12px, 1vw, 16px);
}

#overview .overview-action-layout {
  justify-self: start;
  min-height: clamp(170px, 14vw, 205px);
}

#overview .incident-overview-actions .overview-action-btn {
  width: 100%;
  max-width: none;
  min-height: clamp(170px, 14vw, 205px);
  padding: clamp(14px, 1.4vw, 22px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-sizing: border-box;
}

#overview .incident-overview-actions .overview-action-copy {
  gap: clamp(5px, 0.55vw, 8px);
}

#overview .incident-overview-actions .overview-action-title,
#overview .incident-overview-actions .overview-action-incident .overview-action-title {
  font-size: clamp(2rem, 3vw, 3.2rem);
}

#overview .incident-overview-actions .overview-action-description {
  font-size: clamp(1rem, 1.45vw, 1.45rem);
}

#overview .incident-overview-actions .overview-action-cta {
  min-height: 40px;
  padding-block: 9px;
}

/* Map the generated sprite's actual 311px / 261px / 264px scene bands. */
#overview .incident-overview-actions .overview-action-incident::before {
  background-position: center top !important;
  background-size: 100% 269% !important;
}

#overview .incident-overview-actions .overview-action-planning::before {
  background-position: center 54.1% !important;
  background-size: 100% 320% !important;
}

#overview .incident-overview-actions .overview-action-reports::before {
  background-position: center bottom !important;
  background-size: 100% 317% !important;
}

#overview .incident-overview-actions .overview-action-incident {
  --overview-accent: #c8102e;
  --overview-accent-rgb: 200, 16, 46;
  border: 4px solid var(--overview-accent);
}

#overview .incident-overview-actions .overview-action-planning {
  --overview-accent: #1765b0;
  --overview-accent-rgb: 23, 101, 176;
  border: 4px solid var(--overview-accent);
}

#overview .incident-overview-actions .overview-action-reports {
  --overview-accent: var(--gold);
  --overview-accent-rgb: var(--gold-rgb);
  border: 4px solid var(--overview-accent);
}

#overview .incident-overview-actions .overview-action-btn:hover,
#overview .incident-overview-actions .overview-action-btn:focus-visible {
  border: 8px solid var(--overview-accent);
  transform: translateY(-2px);
  box-shadow: inset 0 0 24px rgba(var(--overview-accent-rgb), 0.16), 0 0 0 2px rgba(var(--overview-accent-rgb), 0.4);
}

#overview .overview-promo-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(112px, 1fr));
  gap: clamp(6px, 0.65vw, 10px);
  width: 100%;
  margin-top: clamp(14px, 1.2vw, 20px);
  padding: 12px 0 0;
  overflow-x: auto;
  border-top: 1px solid rgba(77, 124, 160, 0.55);
  box-sizing: border-box;
}

#overview .overview-promo-strip .overview-promo-box {
  min-width: 0;
  min-height: 54px;
  padding: 7px 8px;
}

#overview .overview-promo-strip .overview-promo-box > span {
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 950;
}

#overview .overview-promo-strip .promo-monitor > span {
  color: #d59cff;
}

#overview .overview-promo-strip .promo-monitor .monitor-device-icon {
  display: block;
  width: 24px;
  height: 24px;
}

body:has(#overview.view.active) .workspace-drawer-backdrop.workspace-drawer-home {
  top: var(--workspace-drawer-top, 0);
  background: transparent;
  backdrop-filter: none;
}

body:has(#overview.view.active) .workspace-navigation-drawer.workspace-drawer-home {
  top: var(--workspace-drawer-top, 0);
  bottom: auto;
  left: var(--workspace-drawer-left, 6px);
  width: min(320px, calc(100vw - var(--workspace-drawer-left, 6px) - 8px));
  max-height: calc(100dvh - var(--workspace-drawer-top, 0px) - 8px);
  border: 2px solid var(--gold);
  border-radius: 0 10px 10px 10px;
  box-shadow: 10px 14px 34px rgba(2, 13, 23, 0.58);
  transform-origin: top left;
  animation: homepageDashboardDrop 180ms ease-out;
}

body:has(#overview.view.active) .workspace-navigation-drawer.workspace-drawer-home .workspace-drawer-header {
  padding: 12px 12px 10px;
}

body:has(#overview.view.active) .workspace-navigation-drawer.workspace-drawer-home .workspace-drawer-header h2 {
  font-size: 1rem;
}

body:has(#overview.view.active) .workspace-navigation-drawer.workspace-drawer-home .workspace-drawer-close {
  min-height: 32px;
  padding: 5px 8px;
}

body:has(#overview.view.active) .workspace-navigation-drawer.workspace-drawer-home .workspace-drawer-nav {
  gap: 5px;
  padding: 10px 12px 14px;
}

body:has(#overview.view.active) .workspace-navigation-drawer.workspace-drawer-home .workspace-drawer-nav .module-btn {
  min-height: 39px;
  padding: 7px 10px;
  font-size: 0.8rem;
}

body:has(#overview.view.active) .workspace-navigation-drawer.workspace-drawer-home .workspace-settings-btn {
  margin-top: 8px;
}

@keyframes homepageDashboardDrop {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
  .app-shell:has(#overview.view.active) > .layout {
    padding-right: clamp(14px, 4vw, 24px);
    padding-left: 6px;
  }

  #overview .incident-overview-actions .overview-action-btn {
    min-height: clamp(170px, 46vw, 205px);
    padding: 14px;
  }

  #overview .overview-action-layout {
    min-height: clamp(170px, 46vw, 205px);
  }
}

.view:not(#overview) > .hazmat-page-hero,
.view:not(#overview) > .plume-page-header {
  position: relative;
}

.internal-command-menu,
.internal-command-menu:hover,
.internal-command-menu:focus-visible {
  display: grid;
  width: 62px;
  height: 56px;
  min-width: 62px;
  min-height: 56px;
  flex: 0 0 56px;
  place-content: center;
  gap: 6px;
  padding: 0;
  border: 2px solid var(--gold);
  border-radius: 5px;
  outline-offset: 3px;
  background: #0b3557;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.internal-command-menu::before,
.internal-command-menu::after {
  display: none !important;
  content: none !important;
}

.internal-command-menu span {
  display: block;
  width: 32px;
  height: 4px;
  margin: 0;
  border-radius: 1px;
  background: #fff;
}

.internal-command-menu:hover { border-color: #fff; background: #124568; }

#incident .incident-command-hero .hazmat-page-hero-content {
  position: relative;
  z-index: 2;
  padding-inline: 180px;
}

@media (max-width: 720px) {
  .internal-command-menu,
  .internal-command-menu:hover,
  .internal-command-menu:focus-visible { width: 54px; height: 50px; min-width: 54px; min-height: 50px; flex-basis: 50px; }
  .internal-command-menu span { width: 28px; height: 3px; }
  #incident .incident-command-hero .hazmat-page-hero-content { padding-inline: 130px 12px; }
}

/* Internal command hero alignment: menu and title share one tactical heading row. */
.view:not(#overview) .hazmat-page-hero .hazmat-page-hero-content {
  align-self: center;
  justify-items: start;
  margin-inline: 0;
  padding-inline: 0;
  text-align: left;
}

.view:not(#overview) .hazmat-page-hero .internal-command-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(12px, 1.4vw, 22px);
  width: 100%;
  margin: 5px 0 7px;
  text-align: left;
}

.view:not(#overview) .hazmat-page-hero .internal-command-title-row .hazmat-hero-title {
  min-width: 0;
  margin: 0;
  font-family: "Black Ops One", "Stencil Std", Copperplate, "Bahnschrift Condensed", "Arial Narrow", Impact, sans-serif;
  font-stretch: condensed;
  font-weight: 950;
  letter-spacing: 0.055em;
  text-align: left;
  text-transform: uppercase;
  -webkit-text-stroke: 0.35px currentColor;
}

.view:not(#overview) .hazmat-page-hero .internal-command-title-row .internal-command-menu,
.view:not(#overview) .hazmat-page-hero .internal-command-title-row .internal-command-menu:hover,
.view:not(#overview) .hazmat-page-hero .internal-command-title-row .internal-command-menu:focus-visible {
  position: static;
  top: auto;
  left: auto;
  flex: 0 0 62px;
  transform: none;
}

#incident .incident-command-hero .hazmat-page-hero-content {
  justify-items: start;
  width: 100%;
  margin-inline: 0;
  padding-inline: 0;
  text-align: left;
}

#incident .incident-command-hero .incident-command-subtitle {
  margin-inline: 84px 0;
  text-align: left;
}

#lookup > .hazard-id-page-hero {
  place-items: center start;
}

#lookup > .hazard-id-page-hero .hazmat-page-hero-content,
#lookup > .hazard-id-page-hero .hazmat-hero-subtitle,
#lookup > .hazard-id-page-hero .hazmat-hero-title {
  justify-items: start;
  margin-inline: 0;
  text-align: left;
}

@media (max-width: 720px) {
  .view:not(#overview) .hazmat-page-hero .internal-command-title-row .internal-command-menu,
  .view:not(#overview) .hazmat-page-hero .internal-command-title-row .internal-command-menu:hover,
  .view:not(#overview) .hazmat-page-hero .internal-command-title-row .internal-command-menu:focus-visible {
    flex-basis: 54px;
  }

  #incident .incident-command-hero .incident-command-subtitle {
    margin-inline-start: 66px;
  }
}

/* Shared operational typography and panel-heading treatment across every page. */
.view :is(p, li, dt, dd, td, th, label, button, input, select, textarea, small, strong) {
  font-family: var(--hazmatiq-font-body) !important;
}

.view :is(h2, h3, h4, h5, h6, .box-title),
.view :is(.plume-model-section-heading, .plume-card-heading, .monitor-inventory-label) > strong {
  font-family: var(--hazmatiq-font-heading) !important;
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Safe CSS-only readability pass: dark command surfaces and high-contrast controls. */
:root,
[data-theme="dark"] {
  --hmi-bg-main: #020b14;
  --hmi-bg-page: #061a2e;
  --hmi-bg-panel: rgba(8, 31, 52, 0.94);
  --hmi-bg-card: rgba(12, 39, 66, 0.94);
  --hmi-bg-card-solid: #0b1f33;
  --hmi-text-primary: #f8fafc;
  --hmi-text-secondary: #dde7f2;
  --hmi-text-muted: #b8c7d9;
  --hmi-border: rgba(64, 107, 145, 0.82);
  --hmi-border-strong: #406b91;
  --hmi-yellow: var(--gold);
  --hmi-yellow-dark: var(--gold);
  --hmi-red: #c1121f;
  --hmi-blue: #2e8cff;
  --hmi-green: #2e8b57;
  --hmi-purple: #8b5cf6;
  --hmi-control-bg: #102a43;
  --hmi-control-bg-hover: #143b5d;
  --hmi-control-border: #406b91;
  --hmi-control-text: #f8fafc;
  --hmi-control-active-bg: var(--gold);
  --hmi-control-active-text: #061a2e;
  --hmi-control-danger-bg: #c1121f;
  --hmi-control-danger-text: #fff;
  --hmi-disabled-bg: #243b53;
  --hmi-disabled-text: #dde7f2;
  --hmi-disabled-border: #52677c;
}

@media screen {
  body {
    background:
      radial-gradient(circle at 15% 8%, rgba(46, 140, 255, 0.12), transparent 28%),
      radial-gradient(circle at 82% 12%, rgba(var(--gold-rgb), 0.08), transparent 26%),
      linear-gradient(135deg, var(--hmi-bg-main) 0%, var(--hmi-bg-page) 38%, var(--hmi-bg-card-solid) 100%);
    color: var(--hmi-text-primary);
  }

  .app-shell,
  .layout,
  .content-area,
  .view.active {
    background: transparent;
    color: var(--hmi-text-primary);
  }

  .view:not(#overview) :is(
    .panel-card,
    [class$="-card"]:not(.erg-review-distance-card),
    [class*="-card "],
    [class$="-panel"],
    [class*="-panel "]:not(.incident-command-tools)
  ) {
    border-color: var(--hmi-border);
    background: var(--hmi-bg-panel) !important;
    color: var(--hmi-text-primary);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  }

  .hmi-button,
  .hmi-tab,
  .hmi-pill,
  .hmi-chip,
  .hmi-bubble,
  .hmi-segment-button,
  .report-tab,
  .forms-tab,
  .command-tab,
  button.tab,
  button.pill,
  button.segment,
  .view:not(#overview) .ghost-btn,
  .view:not(#overview) .module-btn,
  .hazard-search-tab,
  .monitor-tab,
  .chemical-profile-tab,
  #report .report-tabs [data-report-tab] {
    border: 1px solid var(--hmi-control-border);
    border-radius: 12px;
    background: var(--hmi-control-bg);
    color: var(--hmi-control-text) !important;
    font-weight: 800;
    text-shadow: none;
  }

  .hmi-button:hover,
  .hmi-tab:hover,
  .hmi-pill:hover,
  .hmi-chip:hover,
  .hmi-bubble:hover,
  .hmi-segment-button:hover,
  .report-tab:hover,
  .forms-tab:hover,
  .command-tab:hover,
  button.tab:hover,
  button.pill:hover,
  button.segment:hover,
  .view:not(#overview) .ghost-btn:hover,
  .view:not(#overview) .module-btn:hover,
  .hazard-search-tab:hover,
  .monitor-tab:hover,
  .chemical-profile-tab:hover,
  #report .report-tabs [data-report-tab]:hover {
    border-color: var(--hmi-blue);
    background: var(--hmi-control-bg-hover);
    color: #fff !important;
  }

  .hmi-button.active,
  .hmi-button[aria-selected="true"],
  .hmi-tab.active,
  .hmi-tab[aria-selected="true"],
  .hmi-pill.active,
  .hmi-chip.active,
  .hmi-bubble.active,
  .hmi-segment-button.active,
  .report-tab.active,
  .forms-tab.active,
  .command-tab.active,
  button.tab.active,
  button.pill.active,
  button.segment.active,
  .hazard-search-tab.active,
  .hazard-search-tab[aria-selected="true"],
  .monitor-tab.active,
  .monitor-tab[aria-selected="true"],
  .chemical-profile-tab.active,
  .chemical-profile-tab[aria-selected="true"] {
    border-color: var(--hmi-control-active-bg);
    background: var(--gold-surface);
    color: var(--hmi-control-active-text) !important;
    text-shadow: none;
  }

  #report .report-tabs [data-report-tab].primary-btn {
    border-color: var(--hmi-control-danger-bg);
    background: var(--hmi-control-danger-bg);
    color: var(--hmi-control-danger-text) !important;
    text-shadow: none;
  }

  .hmi-button:disabled,
  .hmi-tab:disabled,
  .hmi-pill:disabled,
  .hmi-chip:disabled,
  .hmi-bubble:disabled,
  .hmi-segment-button:disabled,
  .report-tab:disabled,
  .forms-tab:disabled,
  .command-tab:disabled,
  button.tab:disabled,
  button.pill:disabled,
  button.segment:disabled,
  .view button:disabled,
  .view [aria-disabled="true"] {
    border-color: var(--hmi-disabled-border) !important;
    background: var(--hmi-disabled-bg) !important;
    color: var(--hmi-disabled-text) !important;
    opacity: 1 !important;
    cursor: not-allowed;
  }

  #report .report-center,
  #report .report-section,
  #report .report-incident-item {
    color: var(--hmi-text-primary);
  }

  #report .report-incident-item {
    border-color: var(--hmi-border-strong);
    background: var(--hmi-bg-card);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  }

  #report :is(.muted, .report-incident-item small) {
    color: var(--hmi-text-muted) !important;
  }

  #report :is(.ics-form-library a, .ics-form-text-link) {
    color: #69adff;
  }

  #report :is(.ics-form-library a, .ics-form-text-link):hover,
  #report :is(.ics-form-library a, .ics-form-text-link):focus-visible {
    color: var(--hmi-yellow);
  }
}

/* Command Dashboard settings: theme token is the first settings option. */
.workspace-settings-menu {
  margin-top: 18px;
  border-top: 1px solid #557895;
}

.workspace-settings-menu > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 45px;
  padding: 9px 13px;
  border: 1px solid #315d82;
  border-radius: 8px;
  background: #0d2d49;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 850;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.workspace-settings-menu > .workspace-settings-btn { margin-top: 0 !important; }

.workspace-settings-menu > summary::-webkit-details-marker { display: none; }
.workspace-settings-menu > summary::after { content: "+"; color: var(--gold); font-size: 1.15rem; }
.workspace-settings-menu[open] > summary::after { content: "−"; }
.workspace-settings-menu > summary:hover,
.workspace-settings-menu > summary:focus-visible { border-color: #69adff; background: #15598a; }
.workspace-settings-menu > summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.workspace-settings-menu > summary small { margin-left: auto; margin-right: 10px; color: #bfd0df; font-size: 0.63rem; }

.workspace-settings-options {
  padding: 9px 0 0;
}

.workspace-settings-options > p {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-theme-option,
.workspace-setting-note {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #406b91;
  border-radius: 8px;
  background: #102a43;
  color: #f8fafc;
  text-align: left;
}

.workspace-theme-option { cursor: pointer; }
.workspace-theme-option:hover,
.workspace-theme-option:focus-visible { border-color: #2e8cff; background: #143b5d; }
.workspace-theme-option:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.workspace-theme-option.active { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }

.workspace-theme-swatch {
  width: 24px;
  height: 24px;
  border: 1px solid #69adff;
  border-radius: 50%;
  background: linear-gradient(135deg, #020b14, #061a2e 55%, #0b1f33);
  box-shadow: inset 0 0 0 4px rgba(46, 140, 255, 0.12);
}

.workspace-theme-option > span:nth-child(2),
.workspace-setting-note > span { display: grid; gap: 2px; }
.workspace-theme-option strong,
.workspace-setting-note strong { color: #f8fafc; font-size: 0.75rem; }
.workspace-theme-option small,
.workspace-setting-note small { display: block; color: #b8c7d9; font-size: 0.61rem; }
.workspace-theme-option b { color: var(--gold); font-size: 0.62rem; text-transform: uppercase; }

.workspace-setting-note {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 7px;
  background: rgba(8, 31, 52, 0.78);
}

/* Homepage launch cards: three equal cinematic panels above the promo strip. */
@media (min-width: 900px) {
  .app-shell:has(#overview.view.active) > .layout {
    min-height: calc(100svh - 190px);
    padding: clamp(10px, 1vw, 16px) clamp(8px, 0.7vw, 11px) 14px !important;
  }
  #overview .incident-overview-card {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: calc(100svh - 190px);
  }
  #overview .incident-overview-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    height: calc(100svh - 290px);
    min-height: 0 !important;
    gap: clamp(12px, 1.3vw, 24px);
  }
  #overview .overview-action-layout {
    grid-column: auto !important;
    min-height: 0 !important;
    height: 100%;
  }
  #overview .incident-overview-actions .overview-action-btn {
    height: 100%;
    min-height: 0 !important;
    align-items: flex-end;
    padding: clamp(18px, 2vw, 32px);
    border-width: 2px;
    border-radius: 18px;
    background: #061a2e;
    box-shadow: 0 22px 48px rgba(0,0,0,.36);
  }
  #overview .overview-action-btn::before {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    filter: saturate(1.12) contrast(1.08);
    image-rendering: auto;
  }
  #overview .overview-action-incident::before {
    background-image: url("assets/home-action-incident-v2.webp") !important;
    background-position: center center !important;
    transform: none !important;
    filter: saturate(1.05) contrast(1.12) brightness(1.06);
  }
  #overview .overview-action-incident::after {
    background: linear-gradient(180deg, rgba(2,11,20,.08) 0%, rgba(2,11,20,.42) 55%, rgba(2,11,20,.92) 100%) !important;
  }
  #overview .overview-action-planning::before { background-image: url("assets/home-action-planning-v2.webp") !important; }
  #overview .overview-action-reports::before { background-image: url("assets/home-action-reports-v2.webp") !important; }
  #overview .overview-action-copy { width: 100%; max-width: none; }
  #overview .overview-action-title { color: #f8fafc; text-shadow: 0 4px 18px rgba(0,0,0,.65); }
  #overview .overview-action-description { color: #dde7f2; text-shadow: 0 2px 8px rgba(0,0,0,.72); }
  #overview .overview-promo-strip {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: clamp(6px, .8vw, 12px);
    width: 100%;
    margin-top: 14px;
    padding-top: 12px;
    overflow: hidden;
    border-top: 1px solid rgba(77,124,160,.55);
  }
  #overview .overview-promo-strip .overview-promo-box > span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 1px solid currentColor;
    border-radius: 9px;
    background: rgba(2, 11, 20, .72);
    font-size: 1.35rem;
    line-height: 1;
    text-shadow: 0 0 10px currentColor;
  }
  #overview .promo-chemical > span { color: #69adff; }
  #overview .promo-cbrn > span { color: #ff6b6b; }
  #overview .promo-rad > span { color: var(--gold); }
  #overview .promo-guided > span { color: #62e6a7; }
  #overview .promo-plume > span { color: #b7d7ff; }
  #overview .promo-map > span { color: #53c7ff; }
  #overview .promo-monitor > span { color: #d59cff; }
  #overview .promo-reports > span { color: var(--gold); }
}
@media (max-width: 899px) {
  #overview .incident-overview-actions { grid-template-columns: 1fr !important; grid-template-rows: none !important; }
}

/* Present the populated Chemical Profile as its own full lookup-page surface. */
#lookup:has(#chemical-id-results:not([hidden])) .hazard-id-command-console,
#lookup:has(#chemical-id-results:not([hidden])) .hazard-id-empty-profile,
#lookup:has(#chemical-id-results:not([hidden])) #facility-inventory,
#lookup:has(#chemical-id-results:not([hidden])) #hazard-profile-results {
  display: none !important;
}
#lookup:has(#chemical-id-results:not([hidden])) #chemical-id-results {
  display: block !important;
  margin-top: 14px;
}

/* Use the current card artwork at every homepage breakpoint, including preview widths. */
#overview .incident-overview-actions .overview-action-btn::before {
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-position: center !important;
  transform: none !important;
}
#overview .incident-overview-actions .overview-action-incident::before {
  background-image: url("assets/home-action-incident-v2.webp?v=1") !important;
}
#overview .incident-overview-actions .overview-action-planning::before {
  background-image: url("assets/home-action-planning-v2.webp?v=3") !important;
}
#overview .incident-overview-actions .overview-action-reports::before {
  background-image: url("assets/home-action-reports-v2.webp?v=3") !important;
}
#overview .incident-overview-actions .overview-action-planning::after,
#overview .incident-overview-actions .overview-action-reports::after {
  background: linear-gradient(
    180deg,
    rgba(2, 11, 20, 0.04) 0%,
    rgba(2, 11, 20, 0.18) 52%,
    rgba(2, 11, 20, 0.9) 100%
  ) !important;
}

/* Unified HazMatIQ hero standard for every non-homepage view. */
.view:not(#overview) > .hazmat-page-hero,
.view:not(#overview) > .plume-page-header {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: clamp(170px, 18svh, 245px) !important;
  max-height: none !important;
  padding: clamp(22px, 2.2vw, 38px) !important;
  overflow: hidden;
  border: 1px solid rgba(64, 107, 145, 0.85) !important;
  border-radius: 18px !important;
  background:
    radial-gradient(circle at 82% 18%, rgba(46, 140, 255, 0.16), transparent 30%),
    radial-gradient(circle at 18% 12%, rgba(var(--gold-rgb), 0.08), transparent 24%),
    linear-gradient(135deg, rgba(2, 11, 20, 0.98), rgba(6, 26, 46, 0.96), rgba(11, 31, 51, 0.98)) !important;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.34) !important;
  color: #f8fafc;
}

.view:not(#overview) > .hazmat-page-hero::before,
.view:not(#overview) > .plume-page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: .28;
  pointer-events: none;
}

.view:not(#overview) .hazmat-page-hero .hazmat-page-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  padding: 0 !important;
  text-align: left !important;
}

.view:not(#overview) .hazmat-page-hero .internal-command-title-row {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  margin: 0 0 8px;
}

.view:not(#overview) .hazmat-page-hero .hazmat-hero-title,
.view:not(#overview) .hazmat-page-hero .plume-page-title {
  margin: 0 !important;
  color: #f8fafc !important;
  font-family: "Segoe UI", "Bahnschrift", "Roboto", "Helvetica Neue", Arial, sans-serif !important;
  font-size: clamp(44px, 5vw, 84px) !important;
  font-weight: 950 !important;
  letter-spacing: .035em !important;
  line-height: .95 !important;
  text-align: left !important;
  text-transform: uppercase !important;
  text-shadow: 0 5px 24px rgba(0,0,0,.68) !important;
  transform: none !important;
}

.view:not(#overview) .hazmat-page-hero .hazmat-hero-subtitle {
  margin: clamp(8px, .8vw, 14px) 0 0 !important;
  color: var(--gold) !important;
  font-family: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif !important;
  font-size: clamp(17px, 1.45vw, 27px) !important;
  font-style: italic !important;
  font-weight: 800 !important;
  letter-spacing: .045em !important;
  line-height: 1.25 !important;
  text-align: left !important;
}

.view:not(#overview) .hazmat-page-hero .internal-command-menu {
  width: clamp(54px, 4.4vw, 72px) !important;
  height: clamp(54px, 4.4vw, 72px) !important;
  flex: 0 0 clamp(54px, 4.4vw, 72px) !important;
  border: 2px solid var(--gold) !important;
  border-radius: 14px !important;
  background: rgba(8,31,52,.92) !important;
  box-shadow: 0 0 18px rgba(var(--gold-rgb), .22), inset 0 0 16px rgba(46,140,255,.08) !important;
}

@media (max-width: 760px) {
  .view:not(#overview) > .hazmat-page-hero,
  .view:not(#overview) > .plume-page-header { min-height: 170px !important; padding: 20px !important; }
  .view:not(#overview) .hazmat-page-hero .hazmat-hero-title,
  .view:not(#overview) .hazmat-page-hero .plume-page-title { font-size: clamp(36px, 11vw, 58px) !important; }
  .view:not(#overview) .hazmat-page-hero .internal-command-title-row { gap: 12px; }
  .view:not(#overview) .hazmat-page-hero .hazmat-hero-subtitle { font-size: clamp(16px, 4vw, 22px) !important; }
}

/* Homepage action-card tertiary copy: center the supporting line and keep
   the long operational phrases balanced under the card hierarchy. */
#overview .incident-overview-actions .overview-action-description {
  width: 100%;
  max-width: none;
  padding-left: 0;
  text-align: center;
  text-wrap: balance;
  font-size: clamp(0.84rem, 1.02vw, 1.05rem);
  letter-spacing: -0.012em;
}

@media (min-width: 1200px) {
  #overview .incident-overview-actions .overview-action-description {
    white-space: nowrap;
  }
}

/* Live Map tactical command surface. Keep the map operational, compact, and
   readable at a glance in field conditions. */
#map.live-map-page {
  --map-ink: #edf7ff;
  --map-muted: #8faec4;
  --map-panel: rgba(5, 20, 34, 0.96);
  --map-panel-soft: rgba(10, 34, 55, 0.92);
  --map-line: rgba(110, 164, 198, 0.38);
  --map-yellow: var(--gold);
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: #061a2e;
  color: var(--map-ink);
}

#map .live-map-tactical-header {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
  padding: 0 !important;
  border-bottom: 1px solid var(--map-line);
  background: #061a2e;
}

#map .live-map-tactical-header::before,
#map .live-map-tactical-header::after {
  display: none;
}

#map .live-map-hero-image {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  flex: 1 1 auto;
  object-fit: contain;
  object-position: left center;
}

#map .live-map-control-label,
#map .live-map-menu-heading small {
  display: block;
  color: var(--map-yellow);
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .14em;
  line-height: 1.1;
  text-transform: uppercase;
}
#map .live-map-operations {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: end;
  gap: 14px;
  min-height: 68px;
  padding: 8px 18px 9px;
  border-bottom: 1px solid rgba(111, 166, 201, .34);
  background: #081f35;
}
#map .live-map-control-groups { position: relative; display: flex; align-items: end; flex-wrap: nowrap; gap: 22px; min-width: 0; }
#map .live-map-control-group { display: grid; flex: 0 0 auto; gap: 5px; min-width: 0; }
#map .live-map-control-label { color: #88abc2; font-size: .56rem; letter-spacing: .16em; }
#map .live-map-control-buttons { display: flex; flex-wrap: nowrap; gap: 5px; }
#map .live-map-mode-button,
#map .live-map-parent-button,
#map .live-map-edge-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(118, 163, 190, .46);
  border-radius: 5px;
  background: rgba(10, 35, 56, .84);
  color: #dcecf6;
  cursor: pointer;
  font-family: inherit;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .055em;
  transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}
#map .live-map-mode-button svg,
#map .live-map-parent-button svg,
#map .live-map-edge-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
#map .live-map-mode-button:hover,
#map .live-map-mode-button:focus-visible,
#map .live-map-parent-button:hover,
#map .live-map-parent-button:focus-visible,
#map .live-map-edge-button:hover,
#map .live-map-edge-button:focus-visible { border-color: #6eb5df; background: #113c5e; color: #fff; outline: none; }
#map .live-map-mode-button.active,
#map .live-map-parent-button.active,
#map .live-map-parent-button[aria-expanded="true"] {
  border-color: var(--map-yellow);
  background: rgba(var(--gold-rgb), .72);
  color: #071f36;
  font-weight: 950;
  box-shadow: 0 0 0 1px rgba(var(--gold-rgb), .12), 0 0 14px rgba(var(--gold-rgb), .1);
}
#map .live-map-parent-button b { min-width: 15px; color: #86abc3; font-size: .6rem; }
#map .live-map-mode-button.active svg,
#map .live-map-parent-button.active svg,
#map .live-map-parent-button[aria-expanded="true"] svg,
#map .live-map-parent-button.active b,
#map .live-map-parent-button[aria-expanded="true"] b { color: #071f36; }
#map .live-map-mode-button.active span,
#map .live-map-parent-button.active span,
#map .live-map-parent-button[aria-expanded="true"] span { color: #071f36; }
#map .live-map-parent-button i { color: #6f96ae; font-size: .8rem; font-style: normal; line-height: 1; }
#map .live-map-parent-button[aria-expanded="true"] i { color: #071f36; transform: rotate(180deg); }

#map .live-map-layer-menus { position: absolute; top: 58px; left: 0; }
#map .live-map-layer-menu {
  display: grid;
  width: min(326px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid rgba(119, 177, 209, .62);
  border-radius: 7px;
  background: rgba(4, 19, 32, .98);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .45), 0 0 0 1px rgba(var(--gold-rgb), .05);
}
#map .live-map-menu-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 2px 5px 7px; border-bottom: 1px solid rgba(116, 165, 192, .24); }
#map .live-map-menu-heading strong { color: #f3f9fd; font-size: .68rem; letter-spacing: .09em; }
#map .live-map-menu-heading small { color: #759ab1; font-size: .53rem; letter-spacing: .1em; }
#map .live-map-layer-menu button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 5px;
  border: 0;
  border-bottom: 1px solid rgba(117, 162, 187, .13);
  background: transparent;
  color: #d9e8f1;
  cursor: pointer;
  font: inherit;
  font-size: .71rem;
  font-weight: 800;
  text-align: left;
}
#map .live-map-layer-menu button:last-of-type { border-bottom: 0; }
#map .live-map-layer-menu button:hover,
#map .live-map-layer-menu button:focus-visible,
#map .live-map-layer-menu button.active { background: rgba(var(--gold-rgb), .1); color: #fff; outline: none; }
#map .live-map-layer-menu button.active { box-shadow: inset 2px 0 var(--map-yellow); }
#map .live-map-layer-menu button.is-unavailable { color: #6d8798; cursor: not-allowed; }
#map .live-map-layer-menu button.is-unavailable:hover { background: transparent; }
#map .live-map-toggle-icon { width: 19px; height: 19px; color: var(--map-yellow); fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; text-align: center; }
#map .live-map-layer-menu button.is-unavailable .live-map-toggle-icon { color: #697f8e; }
#map .live-map-layer-menu button span:nth-child(2) { min-width: 0; }
#map .live-map-layer-menu button span small { display: block; color: #7898ac; font-size: .58rem; font-weight: 600; }
#map .live-map-layer-menu button em { color: #78d5a4; font-size: .53rem; font-style: normal; font-weight: 900; letter-spacing: .06em; text-align: right; white-space: nowrap; }
#map .live-map-layer-menu button.is-unavailable em { color: #899aa6; }
#map .live-map-menu-foot { padding: 7px 5px 2px; border-top: 1px solid rgba(117, 162, 187, .18); color: #8ba8ba; font-size: .61rem; }
#map .live-map-menu-foot strong { color: var(--map-yellow); }

#map .live-map-bottom-bar { display: grid; gap: 3px; min-width: 0; padding: 5px 18px 6px; border-top: 1px solid rgba(111, 166, 201, .34); background: #061a2e; }
#map .live-map-status-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 14px; min-width: 0; color: #9eb8c9; font-size: .57rem; font-weight: 800; letter-spacing: .045em; line-height: 1.2; }
#map .live-map-status-item { display: inline-flex; align-items: center; gap: 4px; }
#map .live-map-status-item b { color: #e7f3f9; font-size: .57rem; }
#map .live-map-status-item[data-state="failed"] { color: #ff9ca2; }
#map .live-map-status-item[data-state="stale"] { color: #f3d77c; }
#map .status-dot { width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 7px currentColor; }
#map .status-dot.is-green { background: #46e39b; color: #46e39b; }
#map .status-dot.is-yellow { background: var(--map-yellow); color: var(--map-yellow); }
#map .status-dot.is-gray { background: #8393a0; color: #8393a0; box-shadow: none; }
#map .status-dot.is-red { background: #ff5962; color: #ff5962; }
#map .wildfire-live-map-panel { display: grid; gap: 4px; }
#map .wildfire-live-map-panel strong { color: var(--gold); font-size: .62rem; letter-spacing: .09em; }
#map .wildfire-live-map-panel span { color: #c8dbe5; font-size: .63rem; line-height: 1.45; }
#map .live-map-incident-resources { display: grid; gap: 6px; }
#map .live-map-incident-resources > strong { color: var(--gold); font-size: .65rem; letter-spacing: .09em; }
#map .live-map-incident-resources > span { color: #c8dbe5; font-size: .63rem; }
#map #live-map-incident-resources-list { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
#map .live-map-incident-resource { display: grid; gap: 2px; padding: 6px 0; border-top: 1px solid rgba(117, 162, 187, .24); }
#map .live-map-incident-resource strong { color: #f5fbff; font-size: .68rem; }
#map .live-map-incident-resource span,
#map .live-map-incident-resource small { color: #b8cbd6; font-size: .6rem; line-height: 1.3; }
#map .live-map-incident-resource button { justify-self: start; min-height: 28px; padding: 4px 7px; border-color: #7197b0; background: #123d5a; color: #fff; font-size: .62rem; }
#map #live-map-selected:not([hidden]) {
  display: grid;
  gap: 8px;
  max-width: min(330px, calc(100vw - 42px));
  padding: 10px;
  border: 1px solid rgba(var(--gold-rgb), .72);
  border-radius: 6px;
  background: rgba(4, 20, 33, .95);
  color: #e7f3f9;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .34);
}
#map #live-map-selected[hidden] { display: none; }
#map #live-map-selected > strong { color: var(--gold); font-size: .68rem; letter-spacing: .09em; }
#map #live-map-selected dl { display: grid; gap: 3px; margin: 0; }
#map #live-map-selected dl > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
#map #live-map-selected dt { color: #8faec4; font-size: .6rem; font-weight: 800; }
#map #live-map-selected dd { min-width: 0; margin: 0; color: #f5fbff; font-size: .62rem; overflow-wrap: anywhere; }
#map #live-map-selected small { color: #b8cbd6; font-size: .58rem; line-height: 1.35; }
#map .live-map-gps-marker {
  position: relative;
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #2f9dff;
  box-shadow: 0 0 0 5px rgba(47, 157, 255, .24), 0 2px 12px rgba(0, 0, 0, .55);
}
#map .live-map-gps-marker::after {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #082540;
  content: "";
}

/* LIVE MAP — CANONICAL LAYOUT. Keep stage, overlays, and generated markers
   scoped to the one Live Map owner. */
#map .live-map-panels {
  position: absolute;
  z-index: 8;
  display: grid;
  align-content: start;
  gap: 6px;
  max-height: calc(100% - 118px);
  overflow-y: auto;
  pointer-events: none;
}
#map .live-map-panels > div:not([hidden]) {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid #9dafbf;
  border-radius: 10px;
  font-size: 0.75rem;
  pointer-events: auto;
}
#map .live-map-panels p { margin: 0; }
#map .live-map-marker {
  position: relative;
  z-index: 5;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #0b1f33;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 900;
}
#map .live-map-marker[data-layer="entry"] { background: #c1121f; }
#map .live-map-marker[data-layer="decon"] { background: #168349; }
#map .live-map-marker[data-layer="monitors"] { background: #6f42c1; }
#map .live-map-marker[data-layer="staging"] { background: #1769aa; }
#map .live-map-marker[data-layer="medical"] { background: #fff; color: #c1121f; }
#map .live-map-marker[data-layer="trafficCams"] { background: #46525e; font-size: 0.75rem; }
#map .live-map-marker[data-layer="incidentResources"] { background: #6d3ba8; border-color: var(--gold); }

#map .live-map-stage {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 420px;
  height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #102a3d;
}
#map #live-gis-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 420px;
}
#map .live-map-stage::after { position: absolute; z-index: 2; inset: 0; border: 1px solid rgba(115, 186, 222, .26); box-shadow: inset 0 0 45px rgba(4, 20, 33, .32); content: ""; pointer-events: none; }
#map .live-map-edge-controls,
#map .live-map-edge-readout { position: absolute; z-index: 9; }
#map .live-map-edge-controls-left { top: 14px; left: 14px; }
#map .live-map-edge-controls-right { top: 14px; right: 14px; display: grid; gap: 5px; }
#map .live-map-edge-button { min-width: 34px; min-height: 34px; padding: 7px; border-color: rgba(141, 188, 213, .5); border-radius: 4px; background: rgba(5, 24, 40, .88); box-shadow: 0 5px 14px rgba(0, 0, 0, .2); backdrop-filter: blur(8px); }
#map .live-map-edge-button span { font-size: .6rem; }
#map .live-map-icon-button { font-size: 1.28rem; line-height: 1; }
#map .live-map-edge-readout { bottom: 14px; display: grid; gap: 1px; padding: 6px 8px; border: 1px solid rgba(125, 172, 197, .42); border-radius: 4px; background: rgba(5, 24, 40, .84); box-shadow: 0 5px 14px rgba(0, 0, 0, .2); backdrop-filter: blur(8px); }
#map .live-map-edge-readout-right { right: 14px; text-align: right; }
#map .live-map-legend { position: absolute; z-index: 9; bottom: 14px; left: 14px; display: grid; grid-template-columns: repeat(4, auto); gap: 5px 9px; max-width: min(450px, calc(100% - 220px)); padding: 7px 9px; border: 1px solid rgba(125, 172, 197, .42); border-radius: 4px; background: rgba(5, 24, 40, .88); box-shadow: 0 5px 14px rgba(0, 0, 0, .2); backdrop-filter: blur(8px); }
#map .live-map-legend > strong { grid-column: 1 / -1; color: #e7f5fb; font-size: .59rem; letter-spacing: .08em; }
#map .live-map-legend > span { display: inline-flex; align-items: center; gap: 3px; color: #d9eaf3; font-size: .55rem; font-weight: 800; white-space: nowrap; }
#map .live-map-legend svg { width: 14px; height: 14px; fill: none; stroke: var(--map-yellow); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
#map .live-map-edge-readout strong { color: #e7f5fb; font-size: .59rem; letter-spacing: .08em; }
#map .live-map-edge-readout small { color: #86a8bb; font-size: .54rem; font-weight: 800; letter-spacing: .08em; }
#map .live-map-legend-swatch { width: 8px; height: 8px; border: 1px solid var(--gold); background: rgba(var(--gold-rgb), .35); transform: rotate(45deg); }
#map #live-map-loading { position: absolute; z-index: 7; top: 50%; left: 50%; padding: 8px 11px; border: 1px solid rgba(151, 204, 233, .46); border-radius: 4px; background: rgba(4, 20, 33, .82); color: #dff2fc; font-size: .72rem; transform: translate(-50%, -50%); }
#map .map-ready #live-map-loading { display: none; }
#map .live-map-panels { top: 14px; right: 62px; width: min(300px, calc(100% - 140px)); }
#map .live-map-panels > div:not([hidden]) { border-color: rgba(119, 177, 209, .55); border-radius: 6px; background: rgba(4, 20, 33, .94); color: #d9eaf3; box-shadow: 0 12px 28px rgba(0, 0, 0, .34); }
#map .live-map-bottom-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
#map .live-map-status { margin: 0; min-width: 0; padding: 0; background: transparent; color: #8daabd; font-size: .58rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
#map .live-map-status span { padding: 0 3px; color: var(--map-yellow); }
#map .live-map-attribution { max-width: 55%; overflow: hidden; color: #7595a9; font-size: .54rem; font-weight: 700; letter-spacing: .035em; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
#map .live-map-tools { position: relative; align-self: end; min-width: 106px; }
#map .live-map-tools summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(118, 163, 190, .46);
  border-radius: 5px;
  background: rgba(10, 35, 56, .84);
  color: #dcecf6;
  cursor: pointer;
  font-size: .63rem;
  font-weight: 900;
  letter-spacing: .055em;
  list-style: none;
}
#map .live-map-tools summary::-webkit-details-marker { display: none; }
#map .live-map-tools summary::after { color: #6f96ae; content: '⌄'; font-size: .8rem; }
#map .live-map-tools[open] summary { border-color: var(--map-yellow); color: var(--map-yellow); }
#map .live-map-tools summary svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
#map .live-map-tools-panel { position: absolute; z-index: 30; right: 0; bottom: 39px; display: grid; width: 170px; padding: 6px; border: 1px solid rgba(119, 177, 209, .62); border-radius: 7px; background: rgba(4, 19, 32, .98); box-shadow: 0 18px 38px rgba(0, 0, 0, .45); }
#map .live-map-tool-button { display: flex; align-items: center; gap: 8px; min-height: 31px; padding: 5px 6px; border: 0; border-bottom: 1px solid rgba(117, 162, 187, .13); background: transparent; color: #d9e8f1; cursor: pointer; font: inherit; font-size: .61rem; font-weight: 850; letter-spacing: .04em; text-align: left; }
#map .live-map-tool-button:last-child { border-bottom: 0; }
#map .live-map-tool-button:hover, #map .live-map-tool-button:focus-visible { background: rgba(var(--gold-rgb), .1); color: #fff; outline: none; }
#map .live-map-tool-button strong { width: 15px; color: var(--map-yellow); font-size: .95rem; text-align: center; }
#map .maplibregl-ctrl-bottom-right { display: none; }
#map .maplibregl-ctrl-bottom-left { bottom: 10px; left: 155px; z-index: 10; }
#map .maplibregl-ctrl-attrib { max-width: min(330px, calc(100vw - 190px)); border-radius: 3px; background: rgba(5, 24, 40, .82); color: #b8cbd6; font-size: .52rem; }
#map .maplibregl-ctrl-attrib a { color: #d8eaf4; }
#map .live-map-marker-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
#map.live-map-page:fullscreen { width: 100vw; height: 100vh; }
#map.live-map-page:fullscreen .live-map-stage { min-height: 0; }
#map .live-map-stage:fullscreen { width: 100vw; height: 100vh; }
#map .live-map-stage:fullscreen #live-gis-map { height: 100%; }
#map .live-map-stage:fullscreen .live-map-edge-readout { bottom: 18px; }

@media (max-width: 900px) {
  #map .live-map-operations { grid-template-columns: minmax(0, 1fr); align-items: start; }
  #map .live-map-control-groups { width: 100%; flex-wrap: wrap; gap: 10px 18px; }
  #map .live-map-tools { grid-column: 1; }
  #map .live-map-status-strip { justify-content: start; }
  #map .live-map-layer-menus { top: 94px; }
}

@media (max-width: 819px) {
  #map.live-map-page { height: auto; min-height: 100dvh; overflow: visible; }
  #map .live-map-stage { height: min(70dvh, 720px); min-height: 480px; }
  #map #live-gis-map { height: 100%; min-height: 0; }
}

@media (max-width: 620px) {
  #map .live-map-stage { overflow: visible; }
  #map .live-map-tactical-header { min-height: 0; padding: 0; }
  #map .live-map-operations { padding: 8px 13px; }
  #map .live-map-control-groups { display: grid; grid-template-columns: 1fr; }
  #map .live-map-control-buttons { width: 100%; }
  #map .live-map-base-group .live-map-control-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #map .live-map-ops-group .live-map-control-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #map .live-map-mode-button,
  #map .live-map-parent-button { min-width: 0; }
  #map .live-map-layer-menus { top: 170px; left: 0; }
  #map .live-map-panels { top: 60px; right: 13px; width: calc(100% - 26px); }
  #map .live-map-legend { grid-template-columns: repeat(2, auto); max-width: calc(100% - 26px); bottom: 14px; left: 13px; }
  #map .live-map-legend > strong { grid-column: 1 / -1; }
  #map .maplibregl-ctrl-bottom-left { left: 13px; bottom: 145px; }
  #map .live-map-bottom-meta { align-items: flex-start; flex-direction: column; gap: 3px; }
  #map .live-map-attribution { max-width: 100%; text-align: left; }
  #map .live-map-edge-readout-right { display: none; }
  #map .live-map-tools { align-self: start; }
  #map .live-map-tools-panel { left: 0; right: auto; }
}

/* Live Map layout contract. Keep the stage and canvas in one ownership block so
   MapLibre always receives a real viewport before it measures the container. */
@media (min-width: 820px) {
  .app-shell:has(#map.active) {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .layout:has(#map.active),
  .layout:has(#map.active) > .content-area,
  #map.view.active {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell:has(#map.active) .footer-note { display: none; }

  .layout:has(#map.active) > .sidebar {
    min-height: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .layout:has(#map.active) > .content-area {
    min-width: 0;
  }

  #map.view.active {
    display: grid;
    grid-template-rows: auto auto minmax(420px, 1fr) auto;
    width: 100%;
    min-width: 0;
  }

  #map.active .live-map-stage {
    min-height: 420px;
    height: 100%;
  }

  #map.active .live-map-stage,
  #map.active #live-gis-map {
    min-width: 0;
  }

  #map.active #live-gis-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 420px;
  }

  #map.active .live-map-status { margin-bottom: 0; }
}

/* Guided Response command palette is intentionally explicit after the global
   HMI panel/control contract: these are operational actions, not generic tabs. */
#guided-response .guided-command-actions {
  background: #082540 !important;
  color: #f8fafc !important;
}

#guided-response .guided-command-actions .guided-response-actions #guided-open-hazard-btn {
  color: #2b2200 !important;
  background: var(--gold-surface) !important;
  border-color: var(--gold) !important;
}

#guided-response .guided-command-actions .guided-response-actions #guided-save-record-btn,
#guided-response .guided-command-actions .guided-response-actions #guided-save-incident-btn {
  color: #fff !important;
  background: #082540 !important;
  border-color: #315d82 !important;
}
