:root {
  --bg: #0b1018;
  --surface: #141b26;
  --line: #2a3442;
  --text: #e8edf4;
  --muted: #9aa8b8;
  --accent: #8fc7ff;
  --warn: #ffc27a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
}
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; height: 100dvh; }
.map-pane { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #0b1018; }
.base-tiles { filter: invert(1) hue-rotate(180deg) brightness(.75) contrast(1.1); }
.cloud-layer { pointer-events: none; }

.search { position: absolute; top: 12px; left: 56px; right: 12px; max-width: 380px; z-index: 1000; display: flex; gap: 6px; flex-wrap: wrap; }
.search input { flex: 1; min-width: 0; }
input[type=search], button {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; min-height: 40px;
}
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-results {
  flex-basis: 100%; list-style: none; margin: 0; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.search-results button { width: 100%; text-align: left; background: none; border: 0; }
.search-results button:hover { background: var(--line); }
.search-results .empty { padding: 7px 11px; color: var(--muted); }

.legend {
  position: absolute; left: 12px; bottom: 24px; z-index: 1000; display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; font-size: 12px; background: rgb(11 16 24 / .8); border-radius: 6px;
}
.legend i { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #2a3442, #fff); }

.pin { position: relative; }
.pin .dot {
  position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px;
  background: var(--warn); border: 2px solid #0b1018; border-radius: 50%;
}
.pin .arrow {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: -38px 0 0 -8px;
  border: 8px solid transparent; border-bottom: 14px solid var(--warn); border-top: 0;
  transform-origin: 8px 38px;
}

.panel { overflow-y: auto; padding: 18px 20px; border-left: 1px solid var(--line); background: var(--bg); }
h1 { margin: 0; font-size: 20px; line-height: 1.35; overflow-wrap: anywhere; }
h2 { margin: 22px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.time { margin: 2px 0 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.status { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface); }
.status.error { color: var(--warn); }

.now { display: flex; gap: 18px; align-items: center; margin-top: 14px; }
.total { display: flex; flex-direction: column; flex: none; width: 92px; }
.total strong { font-size: 36px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.total span { font-size: 12px; color: var(--muted); }
.layers { flex: 1; margin: 0; display: grid; gap: 5px; }
.layers > div { display: grid; grid-template-columns: 32px 1fr 40px; gap: 8px; align-items: center; font-size: 13px; }
.layers dt { color: var(--muted); }
.layers dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; grid-column: 3; grid-row: 1; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; grid-column: 2; grid-row: 1; }
.bar i { display: block; height: 100%; background: #fff; }
.flow { margin: 12px 0 0; min-height: 1.6em; }

.winds, .windows { list-style: none; margin: 0; padding: 0; }
.winds li { display: grid; grid-template-columns: 22px 92px 1fr auto; gap: 6px; align-items: center; padding: 4px 0; font-size: 14px; }
.winds .dir { display: inline-block; color: var(--accent); text-align: center; }
.winds .name { color: var(--muted); font-size: 13px; }
.winds .speed { font-variant-numeric: tabular-nums; }
.windows li { padding: 6px 10px; margin-bottom: 5px; border-radius: 8px; background: var(--surface); font-variant-numeric: tabular-nums; }
.windows li.none { background: none; padding: 0; color: var(--muted); }
.windows small { color: var(--muted); margin-left: 6px; }
.note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

.timeline { display: block; width: 100%; height: 132px; cursor: pointer; touch-action: none; }
.controls { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.controls input { flex: 1; min-width: 0; accent-color: var(--accent); height: 40px; }
.controls button { flex: none; }
footer { margin-top: 20px; font-size: 12px; color: var(--muted); }
a { color: var(--accent); }

@media (max-width: 800px) {
  .layout { display: block; height: auto; }
  .map-pane { height: 52dvh; }
  .panel { border-left: 0; border-top: 1px solid var(--line); padding: 16px; overflow: visible; }
}
