/* Dark carbon-fiber professional theme (ForceMetric / SDC style) */
:root {
  --bg-deep: #0a0c0f;
  --bg-panel: #12151a;
  --bg-elevated: #1a1f27;
  --border: #2a3140;
  --accent: #c9a227;
  --accent-dim: #8a7018;
  --text: #e8eaed;
  --text-muted: #b4bac2;
  --danger: #e85d5d;
  --input-bg: #0d1014;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --space: 1rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
}

/* Subtle carbon weave */
body {
  background-color: var(--bg-deep);
  background-image:
    linear-gradient(135deg, rgba(255,255,255,0.03) 25%, transparent 25%),
    linear-gradient(225deg, rgba(255,255,255,0.03) 25%, transparent 25%),
    linear-gradient(45deg, rgba(255,255,255,0.03) 25%, transparent 25%),
    linear-gradient(315deg, rgba(255,255,255,0.03) 25%, transparent 25%),
    radial-gradient(ellipse at top, #151a22 0%, var(--bg-deep) 70%);
  background-size: 8px 8px, 8px 8px, 8px 8px, 8px 8px, 100% 100%;
  background-position: 0 0, 4px 0, 4px -4px, 0 4px, 0 0;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(26,31,39,0.95), rgba(10,12,15,0.85));
  backdrop-filter: blur(6px);
}

.header-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tagline {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.site-header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.site-header h1 span {
  color: var(--accent);
  font-weight: 700;
}

.credit {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.credit strong {
  color: var(--accent);
  font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 0.85rem;
  padding: 0.85rem 1.15rem 1rem;
  max-width: 1520px;
  margin: 0 auto;
  min-height: 0;
  align-items: start; /* no stretched empty band beside tall left rail */
}

/* Map + OSHA stack — table sits tight under the map */
.stage {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  width: 100%;
}

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 28px rgba(0,0,0,0.38);
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  text-align: center;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Metric / Imperial segmented control */
.units-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--input-bg);
}

.units-btn {
  margin: 0;
  padding: 0.4rem 0.45rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.units-btn:hover:not(.is-active) {
  color: var(--text);
  background: rgba(201, 162, 39, 0.1);
}

.units-btn + .units-btn {
  border-left: 1px solid var(--border);
}

.units-btn:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.units-btn.is-active {
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.28), rgba(138, 112, 24, 0.35));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.35);
}

.field {
  margin-bottom: 0.65rem;
}

.field label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.field input,
.field select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.9rem;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.25);
}

.section-label {
  margin: 0.75rem 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.btn {
  display: block;
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.6rem 0.9rem;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}

.btn:focus-visible,
.units-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(180deg, #d4b03a, var(--accent-dim));
  color: #0a0c0f;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #e8cb58, #b08c24);
  box-shadow: 0 6px 18px rgba(201, 162, 39, 0.35);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.inline-legend {
  margin-top: 0.65rem;
  padding: 0.6rem 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.legend-heading {
  margin: 0 0 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.3rem 0;
  font-size: 0.75rem;
  color: var(--text);
}

.swatch {
  width: 28px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.swatch-high { background: #ff3030; } /* ≈180 */
.swatch-med { background: #28d25a; }  /* ≈120 */
.swatch-low { background: #14aad2; }  /* ≈80 */
.swatch-vlow { background: #2040dc; } /* ≈60 */

.grid-info {
  margin-top: 0.55rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Map panel: fill stage width; grow vertically into freed space */
.map-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: #000;
  width: 100%;
  /* Prefer a tall usable map; square floor, grow with width up to viewport */
  aspect-ratio: 1 / 1;
  max-height: min(78vh, 920px);
  min-height: 0;
  flex: 0 0 auto;
}

.map-wrap {
  flex: 1;
  display: block;
  position: relative;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Glass legend chip — lower-left on the map */
.map-legend.glass-legend {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  z-index: 3;
  margin: 0;
  max-width: min(15.5rem, calc(100% - 1.1rem));
  padding: 0.55rem 0.65rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 12, 16, 0.55);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.map-legend .legend-heading {
  margin: 0 0 0.35rem;
  font-size: 0.65rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.map-legend .legend-row {
  margin: 0.22rem 0;
  font-size: 0.72rem;
  color: #f2f4f7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  gap: 0.45rem;
}

.map-legend .swatch {
  width: 22px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

#noiseMap {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  cursor: crosshair;
  touch-action: none;
}

.readout {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  background: rgba(8, 10, 14, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  font-size: 0.85rem;
  font-weight: 600;
  color: #f5f7fa;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 4;
}

.site-footer {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  box-shadow: 0 10px 28px rgba(0,0,0,0.38);
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 0 0 auto;
}

.site-footer strong {
  color: var(--text);
}


.footer-osha {
  margin-top: 0.55rem;
  color: var(--text-muted);
}

.footer-osha strong {
  color: var(--accent);
  font-weight: 600;
}

.disclaimer {
  margin-top: 0.4rem;
  color: var(--danger);
  opacity: 0.9;
}

@media (max-width: 800px) {
  .map-panel {
    max-height: none;
    width: 100%;
    margin: 0;
    aspect-ratio: 1 / 1;
  }
}


/* Phase 4 — A/B scenarios + compact actions + CSV */
.ab-panel,
.export-panel {
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.ab-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin: 0.35rem 0 0.45rem;
}

.ab-slot {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  padding: 0.4rem 0.45rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  min-height: 2.6rem;
}

.ab-slot-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 3px;
  background: var(--accent);
  color: #0a0c0f;
  font-size: 0.7rem;
  font-weight: 800;
}

.ab-slot-body {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.3;
  word-break: break-word;
}

.ab-slot-body.is-filled {
  color: var(--text);
}

.ab-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.btn-compact {
  margin-top: 0;
  padding: 0.4rem 0.45rem;
  font-size: 0.72rem;
}

.ab-actions .btn-compact:last-child {
  grid-column: 1 / -1;
}

.footer-phase4 {
  margin-top: 0.55rem;
  color: var(--text-muted);
}

.footer-phase4 strong {
  color: var(--accent);
  font-weight: 600;
}

/* Phase 2 / UX — OSHA panel under map (no horizontal scroll) */
.osha-panel {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  flex: 0 0 auto;
}

.osha-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  margin-bottom: 0.65rem;
}

.osha-panel-title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
  text-transform: none;
  text-align: left;
}

.osha-view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--input-bg);
}

.osha-table-note,
.osha-peak-note {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 52rem;
}

.osha-peak-note {
  margin-top: 0.75rem;
}

.osha-peak-note strong {
  color: var(--accent);
  font-weight: 600;
}

.osha-table-wrap {
  overflow-x: visible;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.osha-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.osha-table th,
.osha-table td {
  padding: 0.55rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid rgba(42, 49, 64, 0.85);
  white-space: normal;
  word-break: break-word;
}

.osha-table th:first-child,
.osha-table td:first-child {
  text-align: left;
  width: 28%;
  color: var(--text-muted);
}

.osha-table thead th {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
}

.osha-table tbody tr:hover td {
  background: rgba(201, 162, 39, 0.06);
}

.osha-table tbody tr.is-peak-row td {
  color: #ff8fa3;
}

.osha-table tbody tr.is-peak-row td:first-child {
  color: #ff8fa3;
  font-weight: 600;
}

.osha-table .beyond {
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 800px) {
  .osha-panel {
    margin: 0;
  }
  .osha-view-toggle {
    width: 100%;
    min-width: 0;
  }
}

.readout {
  max-width: calc(100% - 1.1rem);
  line-height: 1.35;
  font-size: 0.78rem;
}

.footer-phase2 {
  margin-top: 0.55rem;
  color: var(--text-muted);
}

.footer-phase2 strong {
  color: var(--accent);
  font-weight: 600;
}

.footer-model {
  margin-top: 0.55rem;
}

/* Phase 3 — profiles + bare vs suppressed compare (airy UX) */
.layout {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
}

.field-note,
.hint {
  margin: 0.25rem 0 0;
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.hint {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.list-wrap {
  max-height: 11.5rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--input-bg);
  -webkit-overflow-scrolling: touch;
}

.profile-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.profile-list li {
  display: block;
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: none;
  border-bottom: 1px solid rgba(42, 49, 64, 0.7);
  background: transparent;
  color: var(--text);
  font-size: 0.72rem;
  text-align: left;
  cursor: pointer;
  line-height: 1.3;
}

.profile-list li:last-child {
  border-bottom: none;
}

.profile-list li:hover,
.profile-list li:focus {
  background: var(--bg-elevated);
  outline: none;
}

.profile-list li.is-selected {
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.22), rgba(138, 112, 24, 0.28));
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.profile-list .spl-tag {
  display: inline-block;
  min-width: 3.2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent);
}

.map-source-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0.55rem 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--input-bg);
}

.map-source-toggle .units-btn + .units-btn {
  border-left: 1px solid var(--border);
}

.compare-summary {
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.compare-grid .cmp-label {
  display: inline-block;
  min-width: 7.5rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.osha-table-compare thead tr:first-child th[colspan] {
  text-align: center;
  border-bottom: none;
  padding-bottom: 0.1rem;
}

.osha-table-compare thead tr:last-child th {
  font-size: 0.58rem;
}

.osha-table-compare td.col-supp,
.osha-table-compare th.col-supp {
  background: rgba(201, 162, 39, 0.06);
}

.osha-table-compare .na {
  color: var(--text-muted);
}

.footer-phase3 {
  margin-top: 0.55rem;
  color: var(--text-muted);
}

.footer-phase3 strong {
  color: var(--accent);
  font-weight: 600;
}

.footer-phase3 code {
  font-size: 0.68rem;
  color: var(--text);
}

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .list-wrap {
    max-height: 9.5rem;
  }
}


/* ——— Airy UX polish ——— */
.controls {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.controls .section-label {
  margin: 1rem 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.controls .field {
  margin-bottom: 0.55rem;
}

.controls .list-wrap {
  max-height: 11.5rem;
}

.ab-panel,
.export-panel,
.compare-summary,
.inline-legend {
  margin-top: 0.75rem;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
}

.site-footer {
  max-width: 1520px;
  padding: 1rem 1.25rem 1.75rem;
}

.btn-primary {
  margin-top: 0.85rem;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}


/* ——— Mobile + polish pass ——— */
.tools-drawer {
  margin-top: 0.75rem;
  border: none;
  padding: 0;
}

.tools-drawer-summary {
  display: none;
  list-style: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.tools-drawer-summary::-webkit-details-marker {
  display: none;
}

.field-note,
.hint,
.osha-table-note,
.osha-peak-note,
.grid-info,
.ab-slot-body {
  color: var(--text-muted);
}

.field-note,
.hint {
  font-size: 0.72rem;
  line-height: 1.4;
}

.controls .section-label {
  margin: 1.15rem 0 0.55rem;
}

.controls .field label {
  font-size: 0.78rem;
}

.profile-list li {
  min-height: 2.5rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.78rem;
}

.units-btn {
  min-height: 2.5rem;
  font-size: 0.8rem;
}

.btn {
  min-height: 2.75rem;
}

.btn-compact {
  min-height: 2.5rem;
  font-size: 0.78rem;
  padding: 0.55rem 0.6rem;
}

input[type="number"],
input[type="search"],
select {
  min-height: 2.6rem;
  font-size: 0.9rem;
}

.readout {
  font-size: 0.8rem;
  max-width: calc(100% - 1rem);
  line-height: 1.35;
}

@media (max-width: 800px) {
  .layout {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    min-height: 0;
  }

  /* Flatten stage so map can order above controls */
  .stage {
    display: contents;
  }

  .map-panel {
    order: -1;
    width: 100%;
    max-width: 100%;
    max-height: none;
    aspect-ratio: 1 / 1;
  }

  .map-legend.glass-legend {
    left: 0.45rem;
    bottom: 0.45rem;
    padding: 0.5rem 0.55rem;
    max-width: min(14.5rem, calc(100% - 0.9rem));
  }

  .map-legend .legend-row {
    min-height: 22px;
    font-size: 0.74rem;
  }

  .map-legend .swatch {
    width: 24px;
    height: 11px;
  }

  .readout {
    font-size: 0.78rem;
    max-width: calc(100% - 1rem);
  }

  .osha-panel {
    order: 0;
    margin: 0;
    padding: 0.85rem 0.9rem 1rem;
  }

  .site-footer {
    order: 0;
    margin: 0;
    padding: 0.85rem 0.9rem 1rem;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .controls {
    order: 1;
    padding: 1rem 0.95rem 1.15rem;
  }

  .site-header {
    padding: 0.75rem 0.85rem;
    align-items: flex-start;
  }

  .site-header h1 {
    font-size: 1rem;
  }

  .tagline {
    font-size: 0.74rem;
  }

  .tools-drawer-summary {
    display: block;
    margin-bottom: 0.55rem;
  }

  .tools-drawer-label {
    display: none;
  }

  .tools-drawer:not([open]) .ab-panel,
  .tools-drawer:not([open]) .export-panel {
    display: none;
  }

  .ab-actions {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .btn,
  .btn-compact,
  .units-btn,
  .osha-view-toggle .units-btn {
    min-height: 44px;
  }

  input[type="number"],
  input[type="search"],
  select {
    min-height: 44px;
    font-size: 16px; /* avoid iOS zoom */
  }

  .profile-list li {
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 0.82rem;
  }

  .list-wrap {
    max-height: 12rem;
  }

  .osha-panel {
    margin: 0;
    padding: 0.85rem 0.9rem 1rem;
  }

  .osha-table {
    font-size: 0.8rem;
  }

  .osha-table th,
  .osha-table td {
    padding: 0.65rem 0.55rem;
  }

  .field-note,
  .hint,
  .osha-table-note,
  .osha-peak-note,
  .grid-info {
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .site-footer {
    padding: 1rem 0.85rem 2rem;
    font-size: 0.78rem;
  }

  .inline-legend {
    font-size: 0.8rem;
  }
}

@media (min-width: 801px) {
  .tools-drawer-summary {
    display: none;
  }

  .controls {
    gap: 0.25rem;
  }

  .ab-panel,
  .export-panel {
    margin-top: 0.85rem;
  }
}
