:root {
  color-scheme: light;
  --bg: #f5efe6;
  --panel: #fffdfa;
  --ink: #19212a;
  --muted: #617082;
  --line: #e3d8c9;
  --accent: #126e73;
  --accent-2: #d65c36;
  --shadow: 0 14px 34px rgba(36, 30, 23, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 330px) 1fr;
  background: var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", "Yu Gothic", "Hiragino Sans", system-ui, sans-serif;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px 18px 28px;
  background: #172126;
  color: #eef6f6;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent);
  font-weight: 800;
  letter-spacing: .04em;
}
.brand h1, .workspace h2 { margin: 2px 0 0; line-height: 1.18; }
.eyebrow {
  margin: 0;
  color: #7fb5b8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.panel {
  padding: 14px;
  margin: 12px 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
}
.panel h2 { margin: 0 0 12px; font-size: 15px; }
.field, .toggle { display: grid; gap: 8px; margin: 12px 0; font-size: 13px; }
.toggle { grid-template-columns: auto 1fr; align-items: center; }
input, select, button {
  font: inherit;
  border-radius: 12px;
}
select, input[type="datetime-local"] {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.16);
  background: #10181d;
  color: #fff;
}
input[type="range"] { width: 100%; accent-color: var(--accent-2); }
output { color: #ffd9c8; font-weight: 700; }
button {
  border: 0;
  padding: 10px 12px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
.secondary-button { width: 100%; background: #2d3c44; margin: 10px 0; }
.file-drop {
  display: grid;
  gap: 4px;
  padding: 12px;
  margin: 10px 0;
  border: 1px dashed rgba(255,255,255,.32);
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  cursor: pointer;
}
.file-drop span { color: #b9c8c9; font-size: 12px; }
.file-drop input { margin-top: 7px; color: #d9e7e8; font-size: 12px; }
.file-drop.compact { padding: 10px; }
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.preset-grid button { background: var(--accent-2); font-size: 12px; }
.check-list {
  max-height: 210px;
  overflow: auto;
  padding: 8px;
  border-radius: 14px;
  background: rgba(0,0,0,.16);
}
.check-list label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  padding: 7px 4px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 12px;
  word-break: break-all;
}
.check-list.empty { color: #b8c6c8; font-size: 13px; }
.workspace { padding: 24px; min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.build-label { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.status-line, .chart-surface, .map-section, details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.status-line { padding: 13px 16px; color: var(--muted); margin-bottom: 14px; }
.chart-surface { min-height: 440px; padding: 12px; overflow-x: auto; }
.map-section { margin-top: 20px; padding: 18px; }
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}
.section-heading select { max-width: 180px; background: #fff; color: var(--ink); border-color: var(--line); }
#map { height: 520px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.map-fallback { padding: 24px; color: var(--muted); }
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
details { padding: 14px 16px; }
summary { cursor: pointer; font-weight: 800; }
.table-wrap { overflow: auto; max-height: 360px; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { border: 1px solid #e2d8ca; padding: 6px 8px; text-align: left; white-space: nowrap; }
th { background: #f3eadf; }
.fallback-chart { display: block; }
@media (max-width: 920px) {
  body { display: block; }
  .sidebar { position: relative; height: auto; }
  .workspace { padding: 16px; }
  .topbar, .section-heading { align-items: stretch; flex-direction: column; }
  .preview-grid { grid-template-columns: 1fr; }
}
