:root {
  --ink: #19212a;
  --muted: #617082;
  --paper: #f7f4ed;
  --panel: #fffdf7;
  --line: #d8d0c2;
  --accent: #126e73;
  --accent-2: #d65c36;
  --accent-3: #e6ad2e;
  --shadow: 0 18px 45px rgba(25, 33, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  background:
    linear-gradient(135deg, rgba(18, 110, 115, 0.12), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(230, 173, 46, 0.24), transparent 24rem),
    repeating-linear-gradient(90deg, rgba(25, 33, 42, 0.035) 0 1px, transparent 1px 36px),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 340px;
  padding: 22px;
  overflow-y: auto;
  background: rgba(255, 253, 247, 0.94);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
  z-index: 10;
}

.brand,
.topbar,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  justify-content: flex-start;
  margin-bottom: 20px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: white;
  font-weight: 800;
  background: var(--accent);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--accent-3);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: 1.05rem;
}

h2 {
  font-size: 1.25rem;
}

.panel {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.panel h2 {
  margin-bottom: 12px;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.field {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field input,
.field select,
select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.file-drop {
  display: grid;
  gap: 4px;
  padding: 16px;
  color: var(--ink);
  background: #ffffff;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  cursor: pointer;
}

.file-drop.compact {
  padding: 12px;
}

.file-drop span {
  color: var(--muted);
  font-size: 0.82rem;
}

.file-drop input {
  display: none;
}

.check-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-list.empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.check-list label,
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

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

button {
  min-height: 38px;
  color: white;
  font-weight: 800;
  background: var(--accent-2);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.secondary-button {
  width: 100%;
  margin-top: 10px;
  color: var(--ink);
  background: var(--accent-3);
}

.workspace {
  margin-left: 340px;
  padding: 28px;
}

.topbar {
  margin-bottom: 18px;
}

#renderButton {
  padding: 0 18px;
  background: var(--accent);
}

.status-line {
  margin-bottom: 16px;
  padding: 12px 14px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chart-surface,
.map-section,
details {
  background: rgba(255, 253, 247, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.chart-surface {
  min-height: 420px;
  margin-bottom: 24px;
  padding: 8px;
}

.map-section {
  padding: 18px;
}

#map {
  width: 100%;
  height: 620px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}

details {
  padding: 14px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.table-wrap {
  max-height: 320px;
  overflow: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.82rem;
}

th,
td {
  padding: 7px 9px;
  border-bottom: 1px solid #ece5d8;
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #fff7e6;
  z-index: 1;
}

@media (max-width: 900px) {
  .sidebar {
    position: relative;
    width: auto;
    inset: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    margin-left: 0;
    padding: 18px;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  #map {
    height: 480px;
  }
}

.map-tools {display:flex;flex-wrap:wrap;gap:1rem;align-items:center;margin:1rem 0}
.map-section:fullscreen {background:#fff;padding:1rem;overflow:auto}
.map-section:fullscreen #map {height:85vh}
#quakeStatus, #mapStatus {font-size:.85rem}
