:root {
  color-scheme: dark;
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  color: #eff5f5;
  background: #101b21;
  font-synthesis: none;
  --panel: #14242beb;
  --line: #e9f4f020;
  --muted: #a6bec1;
  --accent: #89e1cb;
}

* { box-sizing: border-box; }
body { margin: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
button, select { font: inherit; }
.masthead {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 22px;
  background: #101b21;
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.mark { border-radius: 8px; background: #203a3e; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.identity { flex: 1; }
h1, h2, p { margin: 0; }
h1 { font-size: 17px; letter-spacing: .025em; }
.identity p { font-size: 11px; color: var(--muted); margin-top: 1px; }
.masthead-end { color: #a9c4c6; font-size: 12px; letter-spacing: .08em; }

main { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(ellipse, #243f44, #101b21); }
#globe { position: absolute; inset: 0; }
.controls {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 240px;
  max-height: calc(100% - 68px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #d9f3ef31;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 9px 34px #050e1470;
  backdrop-filter: blur(14px);
}
.section-title { padding: 1px 1px 12px; border-bottom: 1px solid var(--line); }
h2 { font-size: 14px; letter-spacing: .025em; }
#status { margin-top: 6px; font-size: 11px; color: var(--muted); line-height: 1.5; }
#status::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 7px 2px 0; border-radius: 50%; background: #f2ba69; }
#status[data-state="ready"]::before { background: var(--accent); }
#status[data-state="error"] { color: #ffb5a9; }
#status[data-state="error"]::before { background: #ff9585; }
.layer-controls { padding: 7px 0 9px; }
.layer { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 10px; font-size: 13px; }
.layer > label { white-space: nowrap; }
.layer[hidden] { display: none; }
.map-opacity { min-height: 28px; gap: 5px; color: var(--muted); font-size: 10px; }
.map-opacity input { flex: 1; min-width: 0; margin-inline: 4px; accent-color: var(--accent); }
.map-opacity output { min-width: 31px; text-align: right; font-variant-numeric: tabular-nums; }
.layer-error { margin: 2px 0 6px; color: #ffb5a9; font-size: 11px; }
.toggle {
  appearance: none;
  display: inline-grid;
  align-items: center;
  padding: 2px;
  width: 34px;
  height: 20px;
  margin: 0;
  border: 1px solid #a9c5c47a;
  background: #283f46;
  border-radius: 99px;
  cursor: pointer;
}
.toggle::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #bdd1d2; }
.toggle:checked { background: #347e73; border-color: #65bbac; }
.toggle:checked::before { transform: translateX(14px); background: #eefffc; }
select, button {
  color: #edf6f6;
  background: #253940;
  border: 1px solid #92b6b440;
  border-radius: 6px;
  padding: 5px 9px;
  cursor: pointer;
}
button:hover:not(:disabled), select:hover:not(:disabled) { background: #31515a; }
:is(button, select, input):disabled { opacity: .48; cursor: default; }
:is(button, select, input, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.views { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding-bottom: 10px; }
.views button { display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 36px; font-size: 12px; }
.views svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
details { border-top: 1px solid var(--line); padding-top: 9px; font-size: 11px; color: var(--muted); }
summary { cursor: pointer; width: fit-content; }
dl { margin: 9px 0 7px; }
dl div { display: flex; justify-content: space-between; gap: 5px; margin-block: 3px; }
dd { margin: 0; color: #f2f7f7; font-variant-numeric: tabular-nums; }
.help { position: absolute; left: 20px; bottom: 24px; display: flex; flex-wrap: wrap; gap: 13px; padding: 7px 9px; border-radius: 5px; background: #14242be5; color: #d1e0df; font-size: 10px; pointer-events: none; }
.location { position: absolute; right: 14px; bottom: 24px; border-radius: 5px; padding: 4px 8px; background: #14242be5; color: #d1e0df; font-variant-numeric: tabular-nums; font-size: 11px; pointer-events: none; }
.location:empty { display: none; }
.cesium-viewer-bottom { left: auto !important; right: 3px; }

@media (max-width: 600px) {
  .masthead { padding: 8px 12px; }
  .masthead-end, .help { display: none; }
  .controls { top: 10px; left: 10px; width: 182px; padding: 10px; }
  .layer { gap: 7px; font-size: 12px; }
  .map-opacity { font-size: 10px; }
  .location { right: 7px; bottom: 22px; }
  .mark { width: 31px; height: 31px; }
  h1 { font-size: 15px; }
}
