:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2330;
  --muted: #667085;
  --border: #d9dee7;
  --accent: #2f6fde;
  --accent-soft: #dbe7fb;
  --map-sea: #dfe8f2;
  --map-land: #f4f1ea;
  --map-border: #b9b4a8;
  --map-cell: #1b3f8f;
  --radius: 12px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --surface: #1b2029;
    --text: #e6e9ef;
    --muted: #98a2b3;
    --border: #2d3442;
    --accent: #6b9cff;
    --accent-soft: #24365a;
    --map-sea: #0f1a26;
    --map-land: #262c36;
    --map-border: #46505f;
    --map-cell: #c9d8ff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header, main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

header { padding-top: 24px; }
header h1 { margin: 0; font-size: 1.8rem; }
header p { margin: 4px 0 16px; color: var(--muted); }

.drop {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); outline: none; }
.drop.over { background: var(--accent-soft); }
.drop-hint { text-align: center; color: var(--muted); }
.drop-hint button {
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}
#preview { max-width: 100%; max-height: 360px; border-radius: 8px; }

kbd {
  font: 0.85em ui-monospace, monospace;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 12px 0;
}
.toolbar label { font-weight: 600; font-size: 0.95rem; }
select {
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
}
.status { min-height: 1.5em; color: var(--muted); font-size: 0.95rem; }
progress { width: 100%; height: 6px; margin: 0 0 12px; accent-color: var(--accent); }
.status.error { color: #d92d20; }

.results {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}
.map-card { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .results { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.muted { color: var(--muted); font-weight: normal; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 0.95rem; }
.bars .bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 3px;
  background: var(--accent-soft);
  overflow: hidden;
}
.bars .bar span { display: block; height: 100%; background: var(--accent); }
.bars .pct { font-variant-numeric: tabular-nums; color: var(--muted); }

#map { height: 400px; border-radius: 8px; background: var(--map-sea); }

#about { margin: 16px 0 32px; }
#about summary { cursor: pointer; font-weight: 600; }
#model-info {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 12px 0;
  font-size: 0.9rem;
}
#model-info dt { color: var(--muted); }
#model-info dd { margin: 0; overflow-wrap: anywhere; }
.option { font-size: 0.9rem; }
