@font-face {
  font-family: "Hybler Font";
  src: url("./font/HyblerFont.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #eef4fb;
  --bg-top: #f7fbff;
  --page-glow: rgba(96, 168, 216, 0.22);
  --panel: #ffffff;
  --panel-soft: #f7fbff;
  --ink: #102a43;
  --muted: #486581;
  --accent: #0f4c81;
  --accent-2: #1f9d8f;
  --danger: #b42318;
  --line: #d6e2ef;
  --shadow: 0 16px 36px rgba(15, 76, 129, 0.08);
  --shell-bar-bg: rgba(255, 255, 255, 0.92);
  --shell-bar-border: rgba(198, 216, 238, 0.95);
  --brand-ink: #58348b;
  --eyebrow-ink: #5d88b4;
  --bubble-bg: rgba(255, 255, 255, 0.98);
  --bubble-border: rgba(198, 216, 238, 0.95);
  --bubble-shadow: 0 14px 30px rgba(15, 76, 129, 0.14);
  --panel-soft-border: #d9e8f7;
  --session-card-bg: linear-gradient(180deg, #f9fcff 0%, #eef6ff 100%);
  --field-bg: #ffffff;
  --field-border: #bcccdc;
  --field-disabled-bg: #eef4fb;
  --field-disabled-border: #d3dfeb;
  --secondary-bg: #eef5ff;
  --secondary-border: #c3d8ee;
  --danger-bg: #fff2f0;
  --danger-border: #f5b5ae;
  --admin-badge-bg: #dcecff;
  --observer-bg: #eef5ff;
  --observer-border: #d6e6fb;
  --viewer-bg: #dfeaf5;
  --editor-view-bg: radial-gradient(circle at top left, rgba(96, 168, 216, 0.16), transparent 24%), linear-gradient(180deg, #f9fcff 0%, #eef6ff 100%);
  --lightbox-panel-bg: #f8fbff;
  --lightbox-panel-border: rgba(198, 220, 247, 0.9);
  --lightbox-edit-bg: #eef5ff;
  --lightbox-edit-border: #d6e6fb;
  --image-frame-bg: #dbe8f5;
  --map-dock-bg: rgba(255, 255, 255, 0.9);
  --map-dock-border: rgba(198, 216, 238, 0.92);
  --map-panel-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 251, 255, 0.92) 100%);
  --table-head-bg: #f5faff;
  --table-row-alt-bg: #fbfdff;
  --table-line: #e4eef7;
  --note-bg: #f7fbff;
  --note-border: #d9e8f7;
  --note-ink: #486581;
}

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] {
  --bg: #091622;
  --bg-top: #0d1b28;
  --page-glow: rgba(78, 132, 175, 0.18);
  --panel: #102132;
  --panel-soft: #0d1c2b;
  --ink: #e7f0f9;
  --muted: #9bb0c6;
  --accent: #7cb7ff;
  --accent-2: #4ccfbe;
  --danger: #ff8a80;
  --line: #21384c;
  --shadow: 0 20px 42px rgba(0, 0, 0, 0.34);
  --shell-bar-bg: rgba(12, 24, 37, 0.9);
  --shell-bar-border: rgba(51, 79, 104, 0.9);
  --brand-ink: #c9a8ff;
  --eyebrow-ink: #8db3d8;
  --bubble-bg: rgba(15, 30, 44, 0.98);
  --bubble-border: rgba(56, 83, 109, 0.96);
  --bubble-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
  --panel-soft-border: #21384c;
  --session-card-bg: linear-gradient(180deg, rgba(19, 39, 58, 0.98) 0%, rgba(10, 23, 36, 0.98) 100%);
  --field-bg: #13283a;
  --field-border: #30506c;
  --field-disabled-bg: #102132;
  --field-disabled-border: #29455d;
  --secondary-bg: #173149;
  --secondary-border: #325472;
  --danger-bg: #3a1f25;
  --danger-border: #6c3844;
  --admin-badge-bg: #183753;
  --observer-bg: #112338;
  --observer-border: #294760;
  --viewer-bg: #07111b;
  --editor-view-bg: radial-gradient(circle at top left, rgba(78, 132, 175, 0.16), transparent 24%), linear-gradient(180deg, #0d1b28 0%, #07111b 100%);
  --lightbox-panel-bg: #102132;
  --lightbox-panel-border: rgba(56, 83, 109, 0.94);
  --lightbox-edit-bg: #112338;
  --lightbox-edit-border: #2a4660;
  --image-frame-bg: #0a1622;
  --map-dock-bg: rgba(12, 24, 37, 0.92);
  --map-dock-border: rgba(51, 79, 104, 0.92);
  --map-panel-bg: linear-gradient(180deg, rgba(18, 33, 50, 0.96) 0%, rgba(12, 24, 37, 0.92) 100%);
  --table-head-bg: #13283a;
  --table-row-alt-bg: #0f2030;
  --table-line: #1f3649;
  --note-bg: #112338;
  --note-border: #294760;
  --note-ink: #a4bdd4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, var(--page-glow), transparent 30%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
  overflow: hidden;
}

.shell-header {
  padding: 14px 24px 0 24px;
}

.shell-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid var(--shell-bar-border);
  border-radius: 22px;
  background: var(--shell-bar-bg);
  box-shadow: var(--shadow);
}

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

.shell-logo {
  display: block;
  width: 140px;
  max-width: 100%;
  height: auto;
}

.shell-brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.shell-brand-studio {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 72px;
  padding: 16px 0 16px 0;
  overflow: visible;
}

.shell-brand h1 {
  margin: 0;
  font-family: "Hybler Font", "Segoe UI", "Trebuchet MS", sans-serif;
  font-size: 34px;
  line-height: 0.92;
  color: var(--brand-ink);
}

.shell-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.shell-brand-mascot-wrap {
  position: absolute;
  left: clamp(118px, 18vw, 220px);
  bottom: -40px;
  width: 168px;
  transform: translateX(-50%);
  overflow: visible;
  z-index: 2;
}

.shell-brand-mascot {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 22px rgba(15, 76, 129, 0.14));
}

.shell-brand-mascot-bubble {
  position: absolute;
  left: calc(100% + 4px);
  bottom: 44px;
  width: max-content;
  max-width: 280px;
  padding: 12px 14px;
  border: 1px solid var(--bubble-border);
  border-radius: 18px;
  background: var(--bubble-bg);
  box-shadow: var(--bubble-shadow);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  pointer-events: none;
}

.shell-brand-mascot-bubble::after {
  content: "";
  position: absolute;
  right: calc(100% - 2px);
  top: 72%;
  width: 18px;
  height: 18px;
  border: 1px solid var(--bubble-border);
  border-radius: 999px;
  background: var(--bubble-bg);
  box-shadow: 0 8px 18px rgba(15, 76, 129, 0.08);
  transform: translateY(-50%);
}

.shell-brand-mascot-wrap:hover .shell-brand-mascot-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--eyebrow-ink);
}

.hint {
  color: var(--muted);
}

.module-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.session-tabs {
  margin: 0 0 12px 0;
}

.module-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.module-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.module-tab.link {
  cursor: pointer;
}

.layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(340px, 430px) 1fr;
  gap: 18px;
  min-height: 0;
  padding: 18px 24px 24px 24px;
  overflow: hidden;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  height: 100%;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.panel-section {
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--panel-soft-border);
}

.panel-section h2,
.observer h2,
.list-wrap h3 {
  margin: 0 0 6px 0;
}

.session-card {
  background: var(--session-card-bg);
}

.session-card .module-tab {
  flex: 1 1 78px;
  min-height: 40px;
  padding: 8px 12px;
}

.module-tab:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: var(--field-disabled-bg);
  border-color: var(--field-disabled-border);
  color: #7b93ab;
}

.admin-access {
  margin-top: 10px;
}

.admin-access-header {
  flex: 0 0 auto;
  min-width: 320px;
  max-width: 420px;
  margin-top: 0;
}

.admin-login-row {
  align-items: center;
  margin: 0;
}

.admin-login-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.admin-login-row button {
  width: auto;
  min-width: 110px;
  flex: 0 0 auto;
}

.admin-session-row {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 0;
}

.admin-session-row button {
  width: auto;
  flex: 0 0 auto;
}

.admin-session-row .is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--admin-badge-bg);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.session-help {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.field-caption {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.row {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.row-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.row-inline input[type="checkbox"] {
  width: auto;
  margin: 0;
}

input,
select,
button {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  font-size: 14px;
}

input,
select {
  background: var(--field-bg);
  color: var(--ink);
}

button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: pointer;
}

button:hover,
.button-link:hover {
  filter: brightness(1.05);
}

button.secondary {
  background: var(--secondary-bg);
  border-color: var(--secondary-border);
  color: var(--accent);
}

button.danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.theme-toggle {
  width: auto;
  min-width: 150px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.theme-toggle strong {
  font-weight: 700;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.stats {
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
  flex-wrap: wrap;
}

.module-panel[data-module-panel="analysis"] {
  display: none;
}

.module-panel[data-module-panel="visualization"] {
  display: none;
}

.module-panel[data-module-panel="report"] {
  display: none;
}

.module-panel[data-module-panel="editor"] {
  display: none;
}

body[data-module="noise"] .module-panel[data-module-panel="analysis"],
body[data-module="shadow"] .module-panel[data-module-panel="analysis"] {
  display: block;
}

body[data-module="noise"] .module-panel[data-module-panel="visualization"],
body[data-module="shadow"] .module-panel[data-module-panel="visualization"] {
  display: none;
}

body[data-module="visualization"] .module-panel[data-module-panel="visualization"] {
  display: block;
}

body[data-module="report"] .module-panel[data-module-panel="report"] {
  display: block;
}

body[data-module="editor"] .module-panel[data-module-panel="editor"] {
  display: block;
}

body[data-module="noise"] .viewer,
body[data-module="shadow"] .viewer,
body[data-module="report"] .viewer {
  grid-template-rows: 1fr;
}

body[data-module="noise"] #streetView,
body[data-module="noise"] #mapyczPanorama,
body[data-module="noise"] #mapbox3d,
body[data-module="shadow"] #streetView,
body[data-module="shadow"] #mapyczPanorama,
body[data-module="shadow"] #mapbox3d,
body[data-module="report"] #streetView,
body[data-module="report"] #mapyczPanorama,
body[data-module="report"] #mapbox3d {
  display: none;
}

body[data-module="editor"] .viewer {
  display: block;
  overflow: hidden;
  background: var(--editor-view-bg);
}

body[data-module="editor"] #map,
body[data-module="editor"] #streetView,
body[data-module="editor"] #mapyczPanorama,
body[data-module="editor"] #mapbox3d {
  display: none;
}

body[data-module="editor"] #adminEditorView {
  display: block;
}

.observer {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--observer-bg);
  border: 1px solid var(--observer-border);
}

.occlusion-lightbox-panel {
  width: min(97vw, 1680px);
}

#vizLightboxBrushSizeInput {
  flex: 1 1 220px;
  min-width: 160px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}

.occlusion-lightbox-stage {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: calc(92vh - 235px);
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--observer-border);
  background:
    radial-gradient(circle at top left, rgba(120, 174, 216, 0.2), transparent 30%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
  overflow: auto;
}

.occlusion-lightbox-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--observer-border);
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  cursor: crosshair;
  touch-action: none;
}

#vizLightboxEditCanvas {
  cursor: none;
}

.analysis-meta {
  margin: 10px 0 0 0;
  color: var(--muted);
}

.analysis-limit {
  --analysis-limit-gradient: linear-gradient(90deg, #30123b, #4361ee, #37b24d, #ffd43b, #d9480f);
  --analysis-limit-progress: 0%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  border: 1px solid var(--panel-soft-border);
}

.analysis-limit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.analysis-limit-head strong {
  color: var(--ink);
  font-size: 15px;
}

.analysis-limit-slider {
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}

.analysis-limit-scale {
  position: relative;
  height: 14px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--analysis-limit-gradient);
  border: 1px solid rgba(16, 42, 67, 0.14);
  box-shadow: inset 0 1px 2px rgba(16, 42, 67, 0.08);
}

.analysis-limit-marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: var(--analysis-limit-progress);
  width: 2px;
  border-radius: 999px;
  background: rgba(16, 42, 67, 0.96);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.88),
    0 3px 12px rgba(16, 42, 67, 0.18);
  transform: translateX(-50%);
}

.analysis-limit-scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.analysis-limit-help {
  margin: 8px 0 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.editor-help {
  margin: 0 0 10px 0;
  color: var(--muted);
  line-height: 1.5;
}

.analysis-legend {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.analysis-legend-compact {
  margin-top: 0;
  min-width: 240px;
  max-width: 280px;
}

.shadow-receptor-tools,
.shadow-report {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.shadow-receptor-name-input {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
}

.shadow-report-meta,
.shadow-report-table small,
.shadow-report-detail small {
  color: var(--muted);
}

.shadow-report-meta {
  margin: 0;
  font-size: 13px;
  text-align: right;
}

.shadow-report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

.shadow-report-summary-table {
  min-width: 0;
}

.shadow-report-summary-table th:last-child,
.shadow-report-summary-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.shadow-report-summary-table th:nth-child(2),
.shadow-report-summary-table td:nth-child(2),
.shadow-report-summary-table th:nth-child(3),
.shadow-report-summary-table td:nth-child(3),
.shadow-report-summary-table th:nth-child(4),
.shadow-report-summary-table td:nth-child(4) {
  width: 1%;
  white-space: normal;
}

.shadow-report-receptor-cell strong,
.shadow-report-receptor-cell small {
  display: block;
}

.shadow-report-receptor-cell small {
  margin-top: 3px;
}

.shadow-report-coordinates-cell small {
  display: block;
  line-height: 1.35;
}

.shadow-report-table th,
.shadow-report-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--table-line);
  vertical-align: top;
}

.shadow-report-table th {
  background: var(--table-head-bg);
  text-align: left;
  font-size: 13px;
}

.shadow-report-table tbody tr:nth-child(even) {
  background: var(--table-row-alt-bg);
}

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

.shadow-report-actions button {
  min-width: 74px;
  padding-left: 10px;
  padding-right: 10px;
}

.shadow-report-actions button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.shadow-report-lightbox-panel {
  width: min(94vw, 1240px);
}

.shadow-report-detail {
  overflow: auto;
  max-height: calc(92vh - 96px);
  display: grid;
  gap: 14px;
}

.shadow-report-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.shadow-report-stat {
  padding: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--panel-soft-border);
}

.shadow-report-stat strong,
.shadow-report-stat span,
.shadow-report-stat small {
  display: block;
}

.shadow-report-stat span {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

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

.shadow-report-note {
  margin: 0 0 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--note-bg);
  border: 1px solid var(--note-border);
  color: var(--note-ink);
  font-size: 14px;
  line-height: 1.5;
}

.shadow-noise-scale {
  display: grid;
  gap: 10px;
  padding-inline: 24px;
}

.shadow-noise-scale-track {
  position: relative;
  padding-top: 32px;
}

.shadow-noise-scale-gradient {
  height: 16px;
  border-radius: 999px;
  border: 1px solid var(--panel-soft-border);
  background: linear-gradient(90deg, #d7f5df 0%, #c8e6ff 12%, #ffe8a3 34%, #ffc078 56%, #ff922b 78%, #d9480f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.shadow-noise-scale-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 4px;
}

.shadow-noise-scale-marker span {
  padding: 4px 9px;
  border-radius: 999px;
  background: #2f9e44;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(47, 158, 68, 0.22);
}

.shadow-noise-scale-marker::after {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 999px;
  background: #2f9e44;
}

.shadow-noise-scale-ticks {
  position: relative;
  height: 18px;
  overflow: visible;
}

.shadow-noise-scale-ticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--muted);
}

.shadow-noise-scale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.shadow-noise-scale-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--panel-soft-border);
  background: var(--panel);
}

.shadow-noise-scale-item.is-reached {
  background: var(--table-row-alt-bg);
}

.shadow-noise-scale-item.is-current {
  border-color: color-mix(in srgb, var(--danger) 36%, var(--panel-soft-border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 12%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--danger-bg) 72%, var(--panel)) 0%, var(--panel) 100%);
}

.shadow-noise-scale-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.shadow-noise-scale-item-head strong {
  color: var(--ink);
  font-size: 15px;
}

.shadow-noise-scale-item-head span {
  font-size: 20px;
  line-height: 1;
}

.shadow-noise-scale-item b,
.shadow-noise-scale-item small {
  display: block;
}

.shadow-noise-scale-item b {
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 3px;
}

.shadow-noise-scale-item small {
  color: var(--muted);
  line-height: 1.35;
}

.shadow-report-distance-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shadow-report-distance-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--panel-soft-border);
  background: var(--note-bg);
  color: var(--note-ink);
  font-size: 13px;
  line-height: 1.1;
}

#shadowReportDetailTitle {
  flex: 1 1 auto;
}

.analysis-legend-item {
  padding: 10px;
  border: 1px solid var(--observer-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 75%, transparent);
}

.analysis-map-legend-control {
  min-width: 0;
  max-width: min(36vw, 280px);
}

.analysis-legend-item strong {
  display: block;
  margin-bottom: 6px;
}

.analysis-legend-item span,
.analysis-legend-item small {
  display: block;
  color: var(--muted);
}

.analysis-legend-scale-wrap {
  margin: 8px 0 6px;
}

.analysis-legend-scale-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.analysis-legend-scale-labels small {
  color: var(--muted);
}

.analysis-inspector-popup .leaflet-popup-content-wrapper {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--panel-soft-border));
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(50, 19, 91, 0.18);
}

.analysis-inspector-popup .leaflet-popup-tip {
  background: var(--panel);
}

.analysis-inspector-popup .leaflet-popup-content {
  margin: 10px 12px;
  color: var(--ink);
  line-height: 1.45;
}

.analysis-inspector-popup .leaflet-popup-content small {
  color: var(--muted);
}

.leaflet-tooltip.map-point-label {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(138, 40, 70, 0.24);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: 0 4px 12px rgba(16, 42, 67, 0.1);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}

.leaflet-tooltip.map-point-label::before {
  display: none;
}

.leaflet-tooltip.map-point-label-receptor {
  color: #7a1d39;
}

.leaflet-tooltip.map-point-label-turbine {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
}

.leaflet-container.hide-turbine-points .map-point-shape-turbine,
.leaflet-container.hide-turbine-points .leaflet-tooltip.map-point-label-turbine,
.leaflet-container.hide-receptor-points .map-point-shape-receptor,
.leaflet-container.hide-receptor-points .leaflet-tooltip.map-point-label-receptor,
.leaflet-container.hide-turbine-labels .leaflet-tooltip.map-point-label-turbine,
.leaflet-container.hide-receptor-labels .leaflet-tooltip.map-point-label-receptor {
  display: none;
}

.analysis-scale-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  margin-bottom: 6px;
  border: 1px solid rgba(16, 42, 67, 0.12);
}

.analysis-legend-scale-wrap .analysis-scale-bar {
  margin-bottom: 0;
}

.map-tools-corner {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 10px 10px 0 0;
}

.map-tools-corner .leaflet-control {
  margin: 0;
}

.map-tools-dock {
  width: 236px;
  min-width: 236px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: var(--map-dock-bg);
  border: 1px solid var(--map-dock-border);
  box-shadow: 0 14px 28px rgba(16, 42, 67, 0.12);
  backdrop-filter: blur(10px);
}

.map-tools-dock-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.map-tools-dock-tab {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 6px;
  border-radius: 11px;
  border: 1px solid var(--field-border);
  background: var(--panel-soft);
  color: #56708a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  cursor: pointer;
}

.map-tools-dock-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 76, 129, 0.18);
}

.map-tools-dock-body {
  min-height: 0;
}

.map-tools-dock-panel {
  display: none;
}

.map-tools-dock-panel.is-active {
  display: block;
}

.map-tools-control {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  max-height: min(46vh, 350px);
  padding: 9px;
  border-radius: 18px;
  background: var(--map-panel-bg);
  border: 1px solid var(--map-dock-border);
  overflow: hidden;
}

.map-tools-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 2px;
}

.map-tools-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.map-tools-panel-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4d6785;
}

.map-layer-control,
.map-tools-measurement-control {
  min-width: 0;
  max-width: none;
}

.map-tools-visibility-control {
  min-width: 0;
  max-width: none;
}

.map-layer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.map-layer-button {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 7px 5px;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  background: var(--panel-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
  cursor: pointer;
  box-shadow: inset 0 -1px 0 rgba(15, 76, 129, 0.05);
}

.map-layer-button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.12),
    0 8px 18px rgba(15, 76, 129, 0.16);
}

.map-layer-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.map-tools-visibility-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.map-tools-inline-note,
.map-tools-empty-note {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
}

.map-tools-inline-note {
  padding: 0;
}

.map-tools-measure-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  max-height: 228px;
  overflow: auto;
  padding-right: 2px;
}

.map-tools-measure-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--panel-soft-border);
  background: var(--panel-soft);
}

.map-tools-measure-copy strong,
.map-tools-measure-copy small {
  display: block;
}

.map-tools-measure-copy strong {
  color: var(--ink);
  font-size: 12.5px;
}

.map-tools-measure-copy small {
  color: var(--muted);
  margin-top: 2px;
}

.map-tools-measure-remove {
  width: auto;
  min-width: 0;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.map-tools-icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: auto;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--secondary-bg);
  color: var(--accent);
  cursor: pointer;
}

.map-tools-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-tools-icon-button.is-active {
  background: #d9480f;
  border-color: #d9480f;
  color: #fff;
}

.map-tools-icon-button.secondary {
  background: var(--panel);
  color: #b42318;
  border-color: var(--danger-border);
}

.map-tools-icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.map-tools-label-toggle {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 8px;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  background: var(--panel-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
  text-align: center;
  box-shadow: inset 0 -1px 0 rgba(15, 76, 129, 0.05);
}

.map-tools-label-toggle.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.12),
    0 8px 18px rgba(15, 76, 129, 0.16);
}

.map-tools-button {
  width: 100%;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--secondary-bg);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.map-tools-button.secondary {
  background: var(--panel);
}

.map-tools-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.leaflet-container.measure-mode {
  cursor: crosshair;
}

.measure-label-marker {
  background: transparent;
  border: 0;
}

.measure-label-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(16, 42, 67, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(16, 42, 67, 0.18);
}

.picker-map {
  width: 100%;
  height: 240px;
  border-radius: 10px;
  border: 1px solid var(--observer-border);
  overflow: hidden;
}

.admin-editor-view {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.admin-editor-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  height: 100%;
  padding: 22px;
}

.admin-editor-toolbar,
.editor-section-head,
.toolbar-actions,
.form-grid,
.inline-row {
  display: flex;
  gap: 10px;
}

.admin-editor-toolbar,
.editor-section-head {
  justify-content: space-between;
  align-items: flex-start;
}

#addTurbineBtn,
#addEditorReceptorBtn {
  width: auto;
  min-width: 170px;
  flex: 0 0 auto;
}

.spaced-section {
  margin-top: 18px;
}

.editor-actions {
  display: grid;
  gap: 10px;
}

.toolbar-actions {
  flex-wrap: wrap;
}

.toolbar-actions button,
.inline-row button {
  width: auto;
  flex: 0 0 auto;
}

.inline-row > input,
.inline-row > textarea,
.inline-row > select {
  flex: 1 1 auto;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  align-items: start;
  gap: 18px;
  min-height: 0;
}

.editor-card {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border: 1px solid var(--panel-soft-border);
  box-shadow: var(--shadow);
}

.editor-card h3,
.admin-editor-toolbar h2 {
  margin: 0;
}

.form-grid {
  margin-bottom: 18px;
}

.form-grid label {
  flex: 1;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.editor-section-head + .table-wrap {
  margin-top: 12px;
}

.turbine-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}

.receptor-table {
  min-width: 520px;
}

.turbine-table th,
.turbine-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--table-line);
  vertical-align: top;
}

.turbine-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--table-head-bg);
  text-align: left;
  font-size: 13px;
}

.turbine-table tbody tr:nth-child(even) {
  background: var(--table-row-alt-bg);
}

.row-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
  color: var(--accent);
  font-weight: 700;
}

.icon-btn {
  min-width: 40px;
  padding: 8px 10px;
}

.json-editor {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 720px;
  height: 78vh;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  background: #08131f;
  color: #d9ecff;
  border-color: #1f3650;
  resize: vertical;
}

.hidden {
  display: none !important;
}

#vizDownload {
  margin-top: 0;
  color: #fff;
  font-weight: 600;
}

#vizDownload.hidden {
  display: none;
}

.viz-actions {
  align-items: stretch;
}

.viz-actions button,
.viz-actions .button-link {
  flex: 1 1 0;
}

.viz-preview {
  display: block;
  width: 100%;
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid var(--observer-border);
  cursor: zoom-in;
}

body.modal-open {
  overflow: hidden;
}

.viz-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 30, 51, 0.82);
}

.viz-lightbox.hidden {
  display: none;
}

.viz-lightbox-panel {
  width: min(94vw, 1400px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: var(--lightbox-panel-bg);
  border: 1px solid var(--lightbox-panel-border);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
}

.viz-lightbox-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.viz-lightbox-toolbar .button-link,
.viz-lightbox-toolbar button {
  flex: 0 0 auto;
  width: auto;
  min-width: 180px;
}

.viz-lightbox-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.viz-lightbox-view-panel,
.viz-lightbox-edit-panel {
  min-width: 0;
}

.viz-lightbox-view-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  gap: 12px;
}

.viz-lightbox-edit-panel {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: var(--lightbox-edit-bg);
  border: 1px solid var(--lightbox-edit-border);
}

.viz-lightbox-edit-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.viz-lightbox-edit-toolbar button {
  flex: 0 0 auto;
  width: auto;
  min-width: 140px;
}

.viz-lightbox-edit-toolbar button.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.viz-lightbox-image {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: calc(92vh - 170px);
  max-height: calc(92vh - 170px);
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--observer-border);
  background: var(--image-frame-bg);
}

.list-wrap {
  margin-top: 16px;
}

#turbineList {
  margin: 0;
  padding-left: 16px;
  font-size: 14px;
}

.status {
  min-height: 20px;
  color: var(--accent);
  font-size: 14px;
}

.status.error {
  color: var(--danger);
}

.viewer {
  display: grid;
  grid-template-rows: 45% 55%;
  min-height: 0;
  height: 100%;
  background: var(--viewer-bg);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
}

html[data-theme="dark"] .module-tab:disabled {
  color: #7690aa;
}

html[data-theme="dark"] .shell-brand-mascot {
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.34));
}

html[data-theme="dark"] .viz-lightbox {
  background: rgba(2, 10, 18, 0.88);
}

html[data-theme="dark"] .analysis-limit-scale {
  border-color: rgba(231, 240, 249, 0.16);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .analysis-limit-marker {
  background: rgba(231, 240, 249, 0.94);
  box-shadow:
    0 0 0 2px rgba(9, 22, 34, 0.9),
    0 3px 12px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .shadow-noise-scale-gradient {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .analysis-inspector-popup .leaflet-popup-content-wrapper {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .leaflet-tooltip.map-point-label {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .leaflet-tooltip.map-point-label-receptor {
  color: #ff9ab8;
}

html[data-theme="dark"] .map-tools-dock-tab,
html[data-theme="dark"] .map-tools-panel-title {
  color: var(--muted);
}

html[data-theme="dark"] .map-tools-icon-button.secondary {
  color: var(--danger);
}

html[data-theme="dark"] .leaflet-container {
  background: #08131f;
}

html[data-theme="dark"] .leaflet-bar a,
html[data-theme="dark"] .leaflet-bar a:hover,
html[data-theme="dark"] .leaflet-control-layers,
html[data-theme="dark"] .leaflet-control-layers-expanded {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--field-border);
}

#map,
#streetView,
#mapyczPanorama,
#mapbox3d {
  width: 100%;
  height: 100%;
}

#map {
  grid-row: 1;
}

#streetView,
#mapyczPanorama,
#mapbox3d {
  grid-row: 2;
}

@media (max-width: 1100px) {
  .shell-header,
  .layout {
    padding-left: 16px;
    padding-right: 16px;
  }

  .shell-header-bar {
    flex-wrap: wrap;
  }

  .shell-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .admin-access-header {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
}

@media (max-width: 980px) {
  body {
    height: auto;
    overflow: auto;
  }

  .shell-header,
  .layout {
    grid-template-columns: 1fr;
    display: block;
  }

  .shell-header {
    padding-top: 16px;
  }

  .layout {
    height: auto;
    min-height: 0;
    padding-top: 16px;
  }

  .shell-header-bar {
    align-items: stretch;
  }

  .shell-brand {
    align-items: flex-start;
  }

  .shell-logo {
    width: 120px;
  }

  .shell-brand-studio {
    min-height: 62px;
    padding: 14px 0 14px 0;
  }

  .shell-brand-mascot-wrap {
    left: clamp(116px, 26vw, 170px);
    bottom: -22px;
    width: 130px;
  }

  .shell-brand-mascot-bubble {
    max-width: 220px;
    padding: 10px 12px;
    font-size: 12px;
    left: calc(100% + 2px);
    bottom: 38px;
  }

  .module-tabs,
  .row,
  .stats {
    flex-direction: column;
  }

  .shell-header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .theme-toggle {
    width: 100%;
  }

  .admin-login-row,
  .admin-session-row {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-login-row button,
  .admin-session-row button,
  .admin-session-row .admin-badge,
  .toolbar-actions button,
  .inline-row button {
    width: 100%;
  }

  .admin-editor-toolbar,
  .editor-section-head,
  .toolbar-actions,
  .form-grid,
  .inline-row {
    flex-direction: column;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }

  #addTurbineBtn,
  #addEditorReceptorBtn {
    width: 100%;
  }

  .viz-lightbox {
    padding: 12px;
  }

  .viz-lightbox-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .viz-lightbox-toolbar .button-link,
  .viz-lightbox-toolbar button {
    width: 100%;
    min-width: 0;
  }

  .viz-lightbox-edit-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .viz-lightbox-edit-toolbar button {
    width: 100%;
    min-width: 0;
  }

  .viz-lightbox-image {
    height: auto;
    max-height: calc(92vh - 240px);
  }

  .occlusion-lightbox-stage {
    height: auto;
    max-height: calc(92vh - 290px);
  }

  .viewer {
    margin-top: 16px;
    min-height: 72vh;
    grid-template-rows: 42vh 42vh;
  }
}
