:root { --nav-h: 64px; --dn-accent: #137b70; }
html, body { height: 100%; overflow: hidden; }
body { display: flex; flex-direction: column; }
.hejmap-layout { flex: 1; min-height: 0; }

.dn-chevron,
.dn-chevron-r { transition: transform 0.3s ease; }
[data-panel="left"][data-panel-open="false"] .dn-chevron,
[data-panel="right"][data-panel-open="false"] .dn-chevron-r { transform: rotate(180deg); }

.dn-panel-shell { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.dn-panel-heading {
  padding: 17px 16px 13px;
  border-bottom: 1px solid var(--rule);
}
.dn-panel-heading strong { display: block; color: var(--ink); font-size: 17px; line-height: 1.2; }
.dn-panel-heading span { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 12px; line-height: 1.4; }
.dn-search-wrap { position: relative; padding: 12px 12px 8px; }
.dn-search-wrap svg {
  position: absolute; left: 22px; top: 22px; width: 14px; height: 14px;
  color: var(--ink-faint); pointer-events: none;
}
.dn-search {
  width: 100%; box-sizing: border-box; padding: 8px 10px 8px 30px;
  border: 1px solid var(--rule); border-radius: 8px; outline: none;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 13px;
}
.dn-search:focus { border-color: var(--dn-accent); }
.dn-unit-row { padding: 0 12px 8px; }
.dn-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 8px 18px; }
.dn-tier,
.dn-search-result {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 42px;
  padding: 8px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.dn-tier:hover,
.dn-search-result:hover { background: var(--bg-warm); }
.dn-tier.is-active { background: color-mix(in srgb, var(--dn-accent) 10%, var(--paper)); }
.dn-tier__swatch { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.dn-tier__label,
.dn-search-result__name { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.dn-tier__count,
.dn-search-result__value { flex: 0 0 auto; color: var(--ink-faint); font-size: 12px; }
.dn-empty { padding: 24px 12px; text-align: center; color: var(--ink-faint); font-size: 13px; }
.dn-source-note { padding: 12px 10px 0; color: var(--ink-faint); font-size: 11px; line-height: 1.45; }

.dn-map-title { position: absolute; z-index: 5; top: 20px; left: 20px; pointer-events: none; }
.dn-map-title__eyebrow {
  display: block; margin-bottom: 3px; color: var(--ink-faint);
  font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
}
.dn-map-title h1 { margin: 0; color: var(--ink); font-size: clamp(20px, 2vw, 28px); line-height: 1.05; }
.dn-fade { position: absolute; z-index: 3; left: 0; right: 0; height: 70px; pointer-events: none; }
.dn-fade--top { top: 0; background: linear-gradient(to bottom, var(--bg), transparent); }
.dn-fade--bottom { bottom: 0; background: linear-gradient(to top, var(--bg), transparent); }
.dn-reset-btn {
  position: absolute; z-index: 6; right: 14px; bottom: 40px; padding: 7px 13px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--paper);
  color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.dn-reset-btn.is-visible { opacity: 1; pointer-events: auto; }

.dn-tooltip {
  position: absolute; z-index: 8; left: 20px; bottom: 40px; width: max-content;
  max-width: 250px; padding: 11px 13px; border: 1px solid var(--rule); border-radius: 12px;
  background: var(--paper); box-shadow: 0 10px 28px rgba(26,58,92,0.16);
  opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.dn-tooltip.is-visible { opacity: 1; }
.dn-tooltip.is-floating { right: auto; bottom: auto; will-change: left, top; }
.dn-tooltip__top { display: flex; align-items: center; gap: 10px; }
.dn-tooltip__top .hej-flag { flex: 0 0 auto; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
.dn-tooltip__name { color: var(--ink); font-size: 15px; font-weight: 800; line-height: 1.2; }
.dn-tooltip__capital { margin-top: 2px; color: var(--ink-faint); font-size: 11.5px; }
.dn-tooltip__value { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.dn-tooltip__dot { width: 8px; height: 8px; border-radius: 50%; }

.dn-detail-empty { display: grid; place-items: center; height: 100%; padding: 24px; color: var(--ink-faint); font-size: 13px; text-align: center; }
.dn-detail { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.dn-detail__head { padding: 20px 18px 16px; border-bottom: 1px solid var(--rule); text-align: center; }
.dn-detail__eyebrow { color: var(--ink-faint); font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.dn-detail__range { display: block; margin-top: 5px; font-family: 'IBM Plex Mono', monospace; font-size: 24px; font-weight: 800; line-height: 1.1; }
.dn-detail__description { margin-top: 6px; color: var(--ink-faint); font-size: 12px; line-height: 1.4; }
.dn-detail__stats { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--rule); }
.dn-detail__stat { padding: 12px 8px; text-align: center; }
.dn-detail__stat + .dn-detail__stat { border-left: 1px solid var(--rule); }
.dn-detail__stat strong { display: block; color: var(--ink); font-family: 'IBM Plex Mono', monospace; font-size: 17px; }
.dn-detail__stat span { color: var(--ink-faint); font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.dn-detail__list { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 18px; }
.dn-detail__label { padding: 13px 16px 6px; color: var(--ink-faint); font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.dn-country-row { display: flex; align-items: center; gap: 9px; padding: 8px 16px; }
.dn-country-row:hover { background: var(--bg-warm); }
.dn-country-row__name { flex: 1; min-width: 0; overflow: hidden; color: var(--ink-soft); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.dn-country-row__value { flex: 0 0 auto; color: var(--ink-faint); font-size: 11px; }

@media (max-width: 640px) {
  .dn-map-title { top: 13px; left: 13px; }
  .dn-tooltip { max-width: min(250px, calc(100vw - 28px)); }
  .dn-reset-btn { bottom: 18px; }
}