:root {
  --bg: #f6f7f9;
  --panel: #fff;
  --border: #d8dde4;
  --text: #1a1d23;
  --muted: #5c6570;
  --accent: #1e5a8a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

.page-header {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 0.5rem;
}

.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.lede {
  margin: 0;
  max-width: 52rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1rem 2rem;
  align-items: flex-start;
}

.map-section {
  flex: 1 1 22rem;
  min-width: 0;
}

.map-root {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: auto;
  max-height: min(85vh, 1200px);
}

.map-root svg {
  display: block;
  width: 100%;
  height: auto;
}

.map-root :is(text[data-iso][data-named]) {
  cursor: default;
}

.map-root :is(text[data-iso][data-named]:hover),
.map-root :is(text[data-iso][data-named]:focus) {
  outline: 1px solid rgba(30, 90, 138, 0.45);
  outline-offset: 2px;
}

.hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.detail-panel {
  flex: 0 1 20rem;
  min-width: min(100%, 18rem);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  position: sticky;
  top: 0.5rem;
  max-height: min(88vh, 1200px);
  overflow: auto;
}

.detail-panel__title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.detail-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.detail-iso-line {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
}

.detail-iso-line .detail-dt {
  color: var(--muted);
  font-weight: 600;
}

.detail-dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.92rem;
}

.detail-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.detail-dl dd {
  margin: 0;
  word-break: break-word;
}

.detail-sources h3 {
  margin: 1rem 0 0.4rem;
  font-size: 0.95rem;
}

.source-list {
  margin: 0;
  padding-left: 1.1rem;
}

.source-list a {
  color: var(--accent);
  word-break: break-all;
}

.page-footer {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 52rem) {
  .detail-panel {
    flex: 1 1 100%;
    position: static;
    max-height: none;
  }
}

.page-footer code {
  font-size: 0.9em;
}

.load-error {
  padding: 1rem;
  color: #7a1f1f;
  background: #fde8e8;
  border-radius: 6px;
}
