:root {
  --ink: #18222a;
  --muted: #62707b;
  --line: #d8e0e5;
  --panel: #f6f8f9;
  --accent: #1e6a8d;
  --accent-2: #1d7b72;
  --danger: #b84b42;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: #eef3f5;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(420px, 52vw) minmax(520px, 1fr);
  height: 100vh;
  overflow: hidden;
}

.left-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(300px, 46vh) minmax(0, 1fr);
  border-right: 2px solid var(--ink);
  background: #ffffff;
}

.map-pane {
  min-height: 0;
  border-bottom: 1px solid var(--line);
  background: #d8e0e5;
}

.sidebar {
  min-height: 0;
  padding: 12px 14px;
  background: #ffffff;
  overflow: auto;
}

header {
  border-bottom: 2px solid var(--ink);
  margin-bottom: 10px;
  padding-bottom: 8px;
}

h1 {
  font-size: 23px;
  margin: 0 0 4px;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
  margin: 0 0 10px;
}

p {
  margin: 0;
}

header p,
.status {
  color: var(--muted);
  font-size: 13px;
}

.control-stack {
  display: grid;
  gap: 7px;
}

label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea,
button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 8px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  font-size: 14px;
  min-height: 34px;
}

textarea {
  resize: vertical;
}

button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  border-color: #aeb8bf;
  background: #aeb8bf;
  cursor: default;
}

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

.row-3,
.row:has(label:nth-child(3)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 8px;
}

legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px 8px;
  max-height: 190px;
  overflow: auto;
  padding-right: 4px;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.25;
  min-width: 0;
}

.check-grid input {
  width: auto;
}

.panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 12px;
}

#model-note {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #ffffff;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 300px;
}

.report-toolbar {
  display: grid;
  grid-template-columns: 1fr 150px 140px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.compact-control {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.compact-control select {
  min-width: 0;
}

#report-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.leaflet-popup-content strong {
  display: block;
  margin-bottom: 4px;
}

.selector-wind-barb {
  width: 52px;
  height: 52px;
  background: transparent;
  border: 0;
}

.selector-wind-barb .selector-wind-barb-svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 52px;
  height: 52px;
  overflow: visible;
}

.selector-wind-barb .wind-speed-label {
  position: absolute;
  left: 50%;
  top: 39px;
  transform: translateX(-50%);
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.86);
  color: #172027;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .left-column {
    grid-template-rows: 360px auto;
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .report-pane {
    grid-template-rows: auto 80vh;
  }

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

  .row-3,
  .row-4,
  .check-grid {
    grid-template-columns: 1fr 1fr;
  }
}
