:root {
  --forest-950: #0a241b;
  --forest-900: #12372a;
  --forest-800: #1c4b39;
  --forest-700: #26634b;
  --forest-100: #dcebe4;
  --cream: #f5f2e8;
  --paper: #fffdf8;
  --ink: #17211c;
  --muted: #66736c;
  --line: #d9dfda;
  --yellow: #f4c84b;
  --yellow-dark: #c99712;
  --red: #b33a32;
  --red-soft: #f9e7e4;
  --blue: #2c6f9e;
  --shadow: 0 14px 40px rgba(13, 36, 28, .17);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; width: 100%; min-height: 100%; }

body { color: var(--ink); background: var(--cream); }

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

button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
#map:focus-visible {
  outline: 3px solid rgba(244, 200, 75, .8);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 10000;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
}

.skip-link:focus { top: 12px; }

.eyebrow {
  margin: 0 0 4px;
  color: var(--forest-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.danger-button,
.toolbar-button,
.icon-button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  font-weight: 750;
}

.primary-button {
  padding: 0 17px;
  color: var(--forest-950);
  background: var(--yellow);
  box-shadow: inset 0 -1px rgba(0, 0, 0, .12);
}

.primary-button:hover { background: #ffd766; }

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled { cursor: wait; opacity: .6; }

.secondary-button {
  padding: 0 15px;
  color: var(--forest-900);
  background: #edf3ef;
  border: 1px solid #c9d7cf;
}

.danger-button {
  padding: 0 15px;
  color: #fff;
  background: var(--red);
}

.icon-button {
  width: 42px;
  padding: 0;
  color: inherit;
  background: transparent;
  font-size: 24px;
}

/* Login */
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 14% 18%, rgba(244, 200, 75, .22) 0 8%, transparent 9%),
    radial-gradient(circle at 88% 74%, rgba(244, 200, 75, .16) 0 13%, transparent 14%),
    linear-gradient(145deg, var(--forest-950), var(--forest-800));
}

.login-page::before,
.login-page::after {
  content: "";
  position: fixed;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 44% 56% 57% 43%;
  transform: rotate(28deg);
}

.login-page::before { left: -120px; bottom: -170px; }
.login-page::after { right: -150px; top: -180px; }

.login-shell { width: min(440px, calc(100% - 32px)); padding: 30px 0; z-index: 1; }

.login-card {
  padding: clamp(28px, 6vw, 46px);
  border-radius: 24px;
  background: rgba(255, 253, 248, .98);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .34);
}

.login-mark,
.brand-mark {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.login-mark {
  width: clamp(112px, 32vw, 144px);
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto 24px;
}

.login-card > .eyebrow, .login-card h1, .login-copy { text-align: center; }

.login-card h1 { margin: 0; font-size: clamp(31px, 8vw, 42px); line-height: 1.04; letter-spacing: -.045em; }
.login-copy { margin: 16px 0 26px; color: var(--muted); line-height: 1.55; }
.login-card label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.password-row { display: flex; border: 1px solid var(--line); border-radius: 12px; background: white; }
.password-row:focus-within { border-color: var(--forest-700); box-shadow: 0 0 0 3px rgba(38, 99, 75, .12); }
.password-row input { min-width: 0; flex: 1; min-height: 50px; padding: 0 14px; border: 0; outline: 0; background: transparent; }
.password-row .icon-button { min-height: 50px; color: var(--forest-700); font-size: 17px; }
.login-button { width: 100%; min-height: 50px; margin-top: 16px; }
.public-view-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; margin-top: 10px; text-decoration: none; }
.public-view-button:hover { background: #e3ece7; }
.public-view-note { margin: 8px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.login-error { margin: 0 0 16px; padding: 11px 13px; color: #7b221c; background: var(--red-soft); border-radius: 9px; font-size: 13px; }
.secure-note { margin: 14px 0 0; color: var(--muted); text-align: center; font-size: 12px; }

/* App frame */
.app-page { height: 100vh; height: 100dvh; overflow: hidden; }
.app-shell { height: 100vh; height: 100dvh; display: grid; grid-template-rows: 68px 54px minmax(0, 1fr); }

.topbar {
  position: relative;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  color: #fff;
  background: var(--forest-900);
  box-shadow: 0 3px 14px rgba(4, 20, 13, .22);
}

.brand-block { min-width: 0; display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 44px; height: 44px; }
.brand-block h1 { margin: 0; font-size: 18px; line-height: 1.15; letter-spacing: -.02em; }
.brand-block p { margin: 3px 0 0; color: #b9d0c4; font-size: 11px; }
.top-actions { position: relative; display: flex; align-items: center; gap: 8px; }
.toolbar-button { display: flex; align-items: center; gap: 7px; padding: 0 13px; color: #fff; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); }
.toolbar-button:hover { background: rgba(255,255,255,.15); }
.viewer-badge { padding: 6px 10px; border: 1px solid rgba(244,200,75,.4); border-radius: 999px; color: var(--yellow); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.viewer-login-link { justify-content: center; color: #fff; text-decoration: none; }
.viewer-login-short { display: none; }
.menu-button { color: #fff; }
.app-menu {
  position: absolute;
  top: 48px;
  right: 0;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.app-menu button { width: 100%; padding: 11px 12px; border: 0; border-radius: 8px; text-align: left; color: var(--ink); background: transparent; }
.app-menu button:hover { background: #edf2ef; }

.search-strip {
  position: relative;
  z-index: 1100;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 16px;
  background: rgba(255, 253, 248, .98);
  border-bottom: 1px solid var(--line);
}
.search-box { min-width: 180px; max-width: 560px; flex: 1; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); }
.search-box:focus-within { border-color: var(--forest-700); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; }
.search-strip select { height: 38px; max-width: 200px; padding: 0 32px 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; }

.map-area { position: relative; min-height: 0; }
#map { width: 100%; height: 100%; background: #dce6df; }
.leaflet-control-zoom a { color: var(--forest-900); }
.leaflet-control-layers { border: 0 !important; box-shadow: 0 3px 16px rgba(0,0,0,.2) !important; }
.leaflet-control-attribution { font-size: 9px; }

.filter-control {
  position: absolute;
  z-index: 900;
  top: 12px;
  right: 12px;
  width: min(370px, calc(100% - 24px));
  color: var(--ink);
}
.filter-toggle {
  min-height: 42px;
  margin-left: auto;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(18,55,42,.16);
  border-radius: 11px;
  color: var(--forest-900);
  background: rgba(255,253,248,.97);
  box-shadow: 0 4px 17px rgba(0,0,0,.22);
  font-weight: 800;
}
.filter-toggle:hover { background: #fff; }
.filter-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--forest-950);
  background: var(--yellow);
  font-size: 11px;
}
.filter-panel {
  max-height: min(720px, calc(100dvh - 158px));
  margin-top: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(18,55,42,.14);
  border-radius: 15px;
  background: rgba(255,253,248,.98);
  box-shadow: 0 16px 42px rgba(6,29,20,.28);
}
.filter-panel-header {
  position: sticky;
  z-index: 2;
  top: 0;
  min-height: 65px;
  padding: 12px 13px 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255,253,248,.98);
}
.filter-panel-header h2 { margin: 0; font-size: 18px; line-height: 1.15; }
.filter-close { width: 36px; height: 36px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 24px; }
.filter-close:hover { color: var(--ink); background: #edf2ef; }
.attribute-filters { padding: 13px 14px 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.attribute-filters label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 750; }
.attribute-filters select {
  width: 100%;
  height: 38px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}
.attribute-filters select:not([data-empty="true"]) { border-color: var(--yellow-dark); background: #fffaf0; }
.filter-summary { margin: 8px 14px 13px; padding: 10px; border-radius: 10px; background: #edf3ef; }
.filter-summary-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.filter-summary-heading button { padding: 4px 7px; border: 0; color: var(--forest-700); background: transparent; font-size: 11px; font-weight: 800; }
.filter-summary-heading button:disabled { opacity: .45; cursor: default; }
.active-filter-list { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.filter-chip { padding: 4px 7px; border: 1px solid #cad8d0; border-radius: 999px; color: var(--forest-900); background: #fff; font-size: 10px; line-height: 1.25; }
.no-active-filters { color: var(--muted); font-size: 11px; }
.map-legend { padding: 12px 14px 15px; border-top: 1px solid var(--line); }
.map-legend h3 { margin: 0 0 10px; font-size: 13px; }
.legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.legend-grid > span,
.missing-load { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.legend-dot { width: 15px; height: 15px; flex: 0 0 auto; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.legend-standard { background: var(--forest-700); }
.legend-problem { background: #dc7a2b; }
.legend-inactive { background: #777f7a; }
.legend-selected { border-color: var(--forest-900); background: var(--yellow); }
.legend-missing { background: #6b7280; }
.load-legend { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.load-legend-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.load-legend-title { min-width: 0; display: grid; gap: 2px; font-size: 11px; }
.load-legend-title span { color: var(--muted); font-size: 9px; }
.load-layer-toggle { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; color: var(--forest-800); font-size: 10px; font-weight: 800; cursor: pointer; }
.load-layer-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--forest-700); }
.load-gradient { height: 9px; margin-top: 8px; border-radius: 999px; background: linear-gradient(90deg, #5069ff, #00cfff, #2ee86d, #fff200, #ff8c00, #f00020); }
.load-gradient-labels { margin: 4px 0 9px; display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }

.station-dot {
  display: grid !important;
  place-items: center;
  width: 24px !important;
  height: 24px !important;
  margin: -12px 0 0 -12px !important;
  border: 3px solid #fff;
  border-radius: 50%;
  color: transparent;
  background: var(--forest-700);
  box-shadow: 0 2px 8px rgba(0,0,0,.32);
}
.station-dot.status-problem { background: #dc7a2b; }
.station-dot.status-inactive { background: #777f7a; }
.station-dot.is-selected { width: 30px !important; height: 30px !important; margin: -15px 0 0 -15px !important; background: var(--yellow); border-color: var(--forest-900); }
.station-dot.is-new { background: var(--blue); }

.station-id-label {
  padding: 3px 7px !important;
  border: 0 !important;
  border-radius: 7px !important;
  color: #fff !important;
  background: var(--forest-950) !important;
  box-shadow: 0 2px 7px rgba(0,0,0,.28);
  font-size: 11px;
  font-weight: 850;
}
.station-id-label::before { border-top-color: var(--forest-950) !important; }
.labels-hidden .station-id-label { display: none !important; }
.labels-scale-hidden .station-id-label { display: none !important; }
.station-load-heat { position: absolute; pointer-events: none; }
.load-symbols-mode .station-dot:not(.is-new) {
  width: 24px !important;
  height: 24px !important;
  margin: -12px 0 0 -12px !important;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.load-symbols-mode .station-dot:not(.is-new)::before {
  content: "";
  width: 6px;
  height: 6px;
  box-sizing: border-box;
  border: 1px solid white;
  border-radius: 50%;
  background: var(--forest-700);
  box-shadow: 0 0 2px rgba(0,0,0,.8);
}
.load-symbols-mode .station-dot.status-problem::before { background: #dc7a2b; }
.load-symbols-mode .station-dot.status-inactive::before { background: #777f7a; }
.load-symbols-mode .station-dot.is-load-missing::before { background: #8b9297; }
.load-symbols-mode .station-dot.is-selected:not(.is-new)::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border: 2px solid var(--yellow);
  border-radius: 50%;
  box-shadow: 0 0 0 1px #102c23;
}

.code-list-field { position: relative; display: block; width: 100%; min-width: 0; }
.code-list-field input { width: 100%; padding-right: 36px; }
.code-list-arrow {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 34px;
  padding: 0;
  border: 0;
  border-radius: 0 9px 9px 0;
  background: transparent;
  color: var(--forest-900);
  cursor: pointer;
}
.code-list-arrow:hover { background: rgba(24,72,51,.09); }
.code-list-popup {
  position: fixed;
  z-index: 5000;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0,0,0,.22);
  padding: 4px;
  color: var(--forest-950);
  font-size: 13px;
}
.code-list-option { padding: 11px 10px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.code-list-option[aria-selected="true"] { font-weight: 800; background: #edf4ef; }
.code-list-option:hover, .code-list-option.is-active { background: #d8eadd; }
.code-list-empty { padding: 12px 10px; color: var(--muted); }

.gps-marker {
  width: 18px !important;
  height: 18px !important;
  margin: -9px 0 0 -9px !important;
  border: 4px solid white;
  border-radius: 50%;
  background: #1976d2;
  box-shadow: 0 0 0 3px rgba(25,118,210,.35), 0 2px 9px rgba(0,0,0,.28);
}

.map-hint,
.offline-banner {
  position: absolute;
  z-index: 800;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 13px;
  border-radius: 9px;
  box-shadow: 0 3px 16px rgba(0,0,0,.2);
  font-size: 12px;
  font-weight: 750;
}
.map-hint { top: 14px; color: #fff; background: var(--forest-900); }
.offline-banner { bottom: 18px; color: #5e4200; background: #fff0b7; }
.mobile-fab { display: none; }
.map-pick-done {
  position: absolute;
  z-index: 850;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  min-height: 50px;
  box-shadow: 0 7px 22px rgba(0, 0, 0, .3);
}
.is-picking-location .mobile-fab { display: none !important; }

/* Side panel */
.panel {
  position: fixed;
  z-index: 1300;
  top: 122px;
  right: 0;
  bottom: 0;
  width: min(470px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: -12px 0 38px rgba(14, 37, 28, .18);
  transform: translateX(103%);
  transition: transform .22s ease;
}
.panel.is-open { transform: translateX(0); }
.panel-grip { display: none; }
.panel-header { min-height: 72px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 13px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; max-width: 350px; font-size: 21px; line-height: 1.2; letter-spacing: -.025em; }
.panel-content { min-height: 0; flex: 1; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 26px; }
.panel-backdrop { position: fixed; z-index: 1250; inset: 122px 0 0; background: rgba(4,18,12,.24); }

.detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.id-chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 11px; border-radius: 9px; color: var(--forest-900); background: var(--yellow); font-size: 13px; font-weight: 850; }
.status-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 999px; color: #285c41; background: #e3f1e8; font-size: 12px; font-weight: 750; }
.status-chip.inactive { color: #5f5552; background: #ece8e6; }
.detail-actions { display: flex; gap: 8px; }
.detail-actions button { flex: 1; }
.photo-gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 84%; gap: 8px; max-width: 100%; overflow-x: auto; margin: 0 0 18px; padding: 0 0 5px; scroll-snap-type: x mandatory; }
.photo-gallery a { display: block; height: 220px; overflow: hidden; border-radius: 12px; background: #e4e9e5; scroll-snap-align: start; }
.photo-gallery img { width: 100%; height: 100%; object-fit: cover; }
.photo-gallery a.is-unavailable { display: grid; place-items: center; padding: 20px; color: var(--muted); border: 1px dashed #abb9b0; text-align: center; text-decoration: none; background: #f2f5f3; }
.photo-unavailable { display: grid; gap: 8px; }
.photo-unavailable strong { color: var(--forest-900); font-size: 14px; }
.photo-unavailable small { overflow-wrap: anywhere; font-size: 12px; }
.detail-section { margin-top: 19px; padding-top: 17px; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 11px; font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 15px; margin: 0; }
.detail-item dt { color: var(--muted); font-size: 11px; font-weight: 650; }
.detail-item dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.35; }
.detail-note { margin: 0; white-space: pre-wrap; line-height: 1.5; font-size: 13px; }
.empty-photo { display: grid; place-items: center; height: 120px; margin-bottom: 18px; border: 1px dashed #bcc7c0; border-radius: 12px; color: var(--muted); background: #f2f5f3; font-size: 13px; }

/* Form */
.station-form { padding-bottom: 0; }
.form-section { margin: 0 0 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.form-section h3 { margin: 0 0 14px; font-size: 15px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-heading h3 { margin: 0; }
.section-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.section-actions .secondary-button { min-height: 38px; padding: 0 10px; font-size: 11px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.full-field { display: block; margin-bottom: 12px; }
.form-section label { color: #3d4b44; font-size: 11px; font-weight: 750; }
.form-section input:not([type="checkbox"]),
.form-section select,
.form-section textarea {
  width: 100%;
  min-height: 42px;
  margin-top: 5px;
  padding: 9px 10px;
  color: var(--ink);
  border: 1px solid #cbd4ce;
  border-radius: 9px;
  background: #fff;
  font-size: 14px;
}
.form-section textarea { resize: vertical; min-height: 92px; }
.form-section input:focus,
.form-section select:focus,
.form-section textarea:focus { border-color: var(--forest-700); box-shadow: 0 0 0 3px rgba(38,99,75,.1); outline: 0; }
.form-section input[readonly] { color: var(--muted); background: #f1f4f2; }
.coordinate-card { display: grid; grid-template-columns: 1fr 1fr .72fr; gap: 8px; margin-top: 12px; }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.field-with-help { display: block; }
.field-with-help .field-help { display: block; font-weight: 500; }
.calculated-field { min-height: 42px; padding: 10px; border: 1px solid #d8e0db; border-radius: 9px; background: #f3f7f4; }
.calculated-field > span { display: block; color: #3d4b44; font-size: 11px; font-weight: 750; }
.calculated-field output { display: block; margin-top: 4px; color: var(--forest-800); font-size: 18px; font-weight: 850; }
.calculated-field .field-help { display: block; font-weight: 500; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.check-grid label { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 9px; border: 1px solid #dce2de; border-radius: 9px; background: #f8faf8; font-size: 12px; }
.check-grid input { width: 17px; height: 17px; margin: 0; accent-color: var(--forest-700); }
.form-details { padding: 0; overflow: hidden; }
.form-details summary { padding: 16px; cursor: pointer; font-size: 14px; font-weight: 800; }
.details-grid, .equipment-checks { margin: 0 16px 16px; }
.photo-picker { min-height: 82px; display: grid; place-items: center; align-content: center; gap: 2px; margin-top: 14px; border: 1.5px dashed #98ada1; border-radius: 12px; color: var(--forest-700) !important; background: #f3f7f4; cursor: pointer; }
.photo-picker span { font-size: 23px; }
.photo-picker small { color: var(--muted); font-weight: 500; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.visually-hidden:focus + .photo-picker { outline: 3px solid rgba(244, 200, 75, .8); outline-offset: 2px; }
.photo-preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.photo-preview { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: #e6ebe7; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview button { position: absolute; top: 5px; right: 5px; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: rgba(25,28,26,.8); font-size: 20px; }
.form-errors { margin: 0 0 12px; padding: 11px 13px; color: #7b221c; background: var(--red-soft); border-radius: 9px; font-size: 12px; }
.form-actions { position: sticky; z-index: 2; bottom: 0; display: flex; gap: 9px; align-items: center; margin: 0 -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,253,248,.96); backdrop-filter: blur(10px); }
.action-spacer { flex: 1; }

/* Feedback */
.toast-region { position: fixed; z-index: 3000; left: 16px; bottom: 18px; display: grid; gap: 8px; width: min(380px, calc(100% - 32px)); pointer-events: none; }
.toast { padding: 12px 14px; border-radius: 10px; color: #fff; background: var(--forest-950); box-shadow: var(--shadow); font-size: 13px; animation: toast-in .2s ease; }
.toast.error { background: #8c2e27; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.confirm-dialog { width: min(390px, calc(100% - 30px)); padding: 23px; border: 0; border-radius: 16px; color: var(--ink); background: var(--paper); box-shadow: 0 25px 80px rgba(0,0,0,.3); }
.confirm-dialog::backdrop { background: rgba(5,22,15,.56); }
.confirm-dialog h2 { margin: 0 0 8px; font-size: 21px; }
.confirm-dialog p { color: var(--muted); line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

@media (min-width: 900px) {
  .panel.is-open ~ .panel-backdrop { display: none !important; }
}

@media (max-width: 720px) {
  .app-shell { grid-template-rows: 62px 50px minmax(0, 1fr); }
  .topbar { padding: 8px 10px; }
  .brand-mark { width: 42px; height: 42px; }
  .brand-block h1 { font-size: 16px; }
  .brand-block p { font-size: 10px; }
  .button-label, .topbar #new-button { display: none; }
  .toolbar-button { width: 42px; justify-content: center; padding: 0; font-size: 20px; }
  .viewer-page .toolbar-button.viewer-login-link { width: auto; padding: 0 12px; font-size: 13px; }
  .viewer-badge { padding: 5px 8px; font-size: 9px; }
  .viewer-login-long { display: none; }
  .viewer-login-short { display: inline; }
  .search-strip { padding: 6px 9px; gap: 6px; }
  .search-strip select { width: 112px; padding-left: 7px; font-size: 11px; }
  .search-box { height: 38px; padding: 0 9px; }
  .search-box input { font-size: 12px; }
  .filter-control { top: 8px; right: 8px; width: min(356px, calc(100% - 16px)); }
  .filter-panel { max-height: calc(100dvh - 138px); }
  .filter-toggle { min-height: 40px; }
  .attribute-filters select { font-size: 16px; }
  .panel { top: auto; width: 100%; height: min(86dvh, 760px); border-radius: 20px 20px 0 0; transform: translateY(103%); }
  .panel.is-open { transform: translateY(0); }
  .panel-grip { display: block; width: 42px; height: 4px; margin: 8px auto 0; border-radius: 99px; background: #c6cdc8; }
  .panel-header { min-height: 62px; padding-top: 7px; }
  .panel-header h2 { max-width: calc(100vw - 100px); font-size: 18px; }
  .panel-backdrop { inset: 112px 0 0; }
  .mobile-fab { position: absolute; z-index: 800; right: 14px; bottom: calc(22px + env(safe-area-inset-bottom)); display: grid; place-items: center; width: 58px; height: 58px; border: 0; border-radius: 18px; color: var(--forest-950); background: var(--yellow); box-shadow: 0 7px 20px rgba(0,0,0,.3); font-size: 30px; }
  .map-hint { top: 11px; width: max-content; max-width: calc(100% - 24px); text-align: center; }
  .offline-banner { bottom: 90px; width: calc(100% - 28px); text-align: center; }
  .toast-region { bottom: 84px; }
  .coordinate-card { grid-template-columns: 1fr 1fr; }
  .coordinate-card label:last-child { grid-column: 1 / -1; }
  .location-section .section-heading { align-items: flex-start; flex-direction: column; }
  .section-actions { width: 100%; justify-content: stretch; }
  .section-actions .secondary-button { flex: 1; }
  .form-section input:not([type="checkbox"]),
  .form-section select,
  .form-section textarea,
  .search-box input { font-size: 16px; }
}

@media (max-width: 430px) {
  .brand-block p { display: none; }
  .field-grid { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .panel-content { padding-left: 14px; padding-right: 14px; }
  .form-actions { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  .form-section { padding: 13px; }
  .details-grid, .equipment-checks { margin-left: 13px; margin-right: 13px; }
  .attribute-filters { grid-template-columns: 1fr; }
  .legend-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
/* Repeating container groups: compact desktop form and single-column mobile cards. */
.container-group { min-width: 0; margin: 16px 0; padding: 14px; border: 1px solid #cbd8d0; border-radius: 12px; }
.container-group legend { padding: 0 6px; font-size: 13px; color: #365345; }
.group-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.group-heading .secondary-button { font-size: 12px; padding: 7px 10px; min-height: 36px; }
.group-unresolved { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; margin: 12px 0; }
.group-unresolved input { width: 18px; height: 18px; flex: 0 0 18px; }
.groups-summary { padding: 12px; background: #edf4ef; border-radius: 8px; font-size: 13px; line-height: 1.6; }
.group-warning { font-size: 12px; color: #855600; background: #fff4d6; padding: 10px; border-radius: 6px; }
.container-group.is-unresolved { border-color: #c29b44; }
.container-group .field-help { margin: 10px 0 0; }
@media (max-width: 540px) { .container-group .field-grid { grid-template-columns: minmax(0, 1fr); } .section-heading { flex-wrap: wrap; } }
