/* ── Calling-code map ────────────────────────────────────────────────────────── */

.dc-mono { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }

/* Left panel */
.dc-panel { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.dc-panel-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.dc-panel-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-faint); display: block; margin-bottom: 4px;
}
.dc-panel-title { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; line-height: 1.1; }
.dc-panel-sub { font-size: 12px; color: var(--ink-faint); margin-top: 4px; line-height: 1.4; }

.dc-zone-list { padding: 6px 8px 12px; }
.dc-empty { padding: 20px 16px; font-size: 13px; color: var(--ink-faint); text-align: center; }

.dc-zone-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: 8px; border: none; background: transparent;
  cursor: pointer; text-align: left; transition: background 0.12s; color: var(--ink);
  font-family: inherit; line-height: 1.3;
}
.dc-zone-item:hover { background: var(--bg-warm); }
.dc-zone-item--active { background: color-mix(in srgb, var(--accent) 8%, var(--paper)); }
.dc-zone-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dc-zone-tile {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 27px; padding: 0 8px; border-radius: 8px; flex-shrink: 0;
  font-size: 13px; font-weight: 800; color: var(--z);
  background: color-mix(in srgb, var(--z) 15%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--z) 32%, transparent);
}
.dc-zone-badges { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.dc-zone-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 27px; padding: 0 8px; border-radius: 8px;
  font-size: 13px; font-weight: 800; color: var(--z);
  background: color-mix(in srgb, var(--z) 15%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--z) 32%, transparent);
}
.dc-zone-badges--head { justify-content: center; margin: 0 auto 8px; }
.dc-zone-badges--head .dc-zone-chip {
  min-width: 42px;
  height: 30px;
  font-size: 14px;
}
.dc-zone-name {
  flex: 1; font-size: 14px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dc-zone-count { font-size: 12px; color: var(--ink-faint); flex-shrink: 0; }

/* Map overlays */
.dc-map-title { position: absolute; top: 20px; left: 20px; z-index: 10; pointer-events: none; }
.dc-map-title-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-faint); display: block; margin-bottom: 3px;
}
.dc-map-title-text {
  font-size: clamp(18px, 2vw, 26px); font-weight: 800; letter-spacing: -0.03em;
  color: var(--ink); display: block; margin: 0; line-height: 1.1;
}

.dc-reset-btn {
  position: absolute; bottom: 40px; right: 14px; z-index: 10;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; font-family: inherit; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.dc-reset-btn.visible { opacity: 1; pointer-events: auto; }
.dc-reset-btn:hover { background: var(--bg-warm); }

/* Hover tooltip */
.dc-tooltip {
  position: absolute; bottom: 32px; left: 20px; z-index: 10; width: 260px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 16px;
  padding: 14px; pointer-events: none; opacity: 0; transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  box-shadow: 0 12px 32px rgba(26,58,92,0.16), 0 2px 8px rgba(26,58,92,0.08);
}
.dc-tooltip.visible { opacity: 1; transform: translateY(0); }
.dc-tooltip--float { bottom: auto; right: auto; transform: none; transition: opacity 0.16s ease; will-change: left, top; }
.dc-tooltip--float.visible { transform: none; }

.dc-hc-top { display: flex; align-items: center; gap: 11px; }
.dc-hc-top .hej-flag { flex-shrink: 0; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
.dc-hc-titles { min-width: 0; }
.dc-hc-name {
  font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dc-hc-meta {
  font-size: 11.5px; font-weight: 600; color: var(--ink-faint); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dc-hc-code {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 11px 12px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--dc-hc-accent) 10%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--dc-hc-accent) 26%, transparent);
}
.dc-hc-code-val {
  font-size: 24px; font-weight: 900; line-height: 1; color: var(--dc-hc-accent);
  min-width: 30px; flex-shrink: 0;
}
.dc-hc-code-text { min-width: 0; }
.dc-hc-code-lbl {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint);
}
.dc-hc-zone { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 2px; }

/* Right panel chrome */
.dc-info-chevron { transition: transform 0.3s ease; }
[data-panel="right"][data-panel-open="false"] .dc-info-chevron { transform: rotate(180deg); }
.dc-close-btn {
  position: absolute; top: 12px; right: 12px; z-index: 5; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center; border-radius: 8px;
  background: var(--paper); border: 1px solid var(--rule); color: var(--ink-faint);
  cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.dc-close-btn:hover { background: var(--bg-warm); color: var(--ink); border-color: color-mix(in srgb, var(--ink) 20%, transparent); }
[data-panel="right"][data-panel-open="false"] .dc-close-btn { display: none; }

.dc-info-placeholder {
  display: flex; align-items: center; justify-content: center; height: 100%;
  padding: 24px; font-size: 13px; color: var(--ink-faint); text-align: center; line-height: 1.5;
}

/* Right panel — zone view */
.dc-info-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.dc-info-head { padding: 20px 18px 16px; border-bottom: 1px solid var(--rule); text-align: center; flex-shrink: 0; }
.dc-info-lead {
  font-size: 42px; font-weight: 900; line-height: 1; display: block; margin-bottom: 6px; color: var(--dc-accent);
}
.dc-info-name { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.dc-info-sub {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink-faint);
  text-transform: uppercase; margin-top: 4px; overflow-wrap: anywhere;
}
.dc-info-stats { display: flex; border-bottom: 1px solid var(--rule); flex-shrink: 0; }
.dc-info-stat { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 12px 6px; }
.dc-info-stat + .dc-info-stat { border-left: 1px solid var(--rule); }
.dc-info-stat-val { font-family: 'IBM Plex Mono', monospace; font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.dc-info-stat-lbl {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; color: var(--ink-faint);
  text-transform: uppercase; margin-top: 3px;
}
.dc-info-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-faint); padding: 14px 16px 6px;
}
.dc-info-country-list { overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 20px; }
.dc-info-country { display: flex; align-items: center; gap: 10px; padding: 8px 16px; transition: background 0.1s; cursor: pointer; }
.dc-info-country:hover { background: var(--bg-warm); }
.dc-info-country-name {
  flex: 1; font-size: 14px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dc-info-country-code { font-size: 13px; font-weight: 700; color: var(--ink); flex-shrink: 0; }

/* Right panel — single country card */
.dc-cc { display: flex; flex-direction: column; height: 100%; overflow-y: auto; }
.dc-cc-hero { display: flex; align-items: center; gap: 14px; padding: 20px 18px 16px; border-bottom: 1px solid var(--rule); }
.dc-cc-hero .hej-flag { flex-shrink: 0; }
.dc-cc-hero-text { min-width: 0; }
.dc-cc-name { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; line-height: 1.15; }
.dc-cc-cont { font-size: 12px; font-weight: 600; color: var(--ink-faint); margin-top: 3px; }
.dc-cc-code {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin: 16px 16px 0; padding: 18px 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--dc-accent) 9%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--dc-accent) 24%, transparent);
}
.dc-cc-code-lbl {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-faint);
}
.dc-cc-code-val { font-size: 40px; font-weight: 900; line-height: 1; color: var(--dc-accent); }
.dc-cc-code-eg { font-size: 13px; font-weight: 600; color: var(--ink-faint); letter-spacing: 0.04em; }
.dc-cc-facts { padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.dc-cc-fact { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--rule); }
.dc-cc-fact:last-child { border-bottom: none; }
.dc-cc-fact-lbl { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-faint); }
.dc-cc-fact-val { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; color: var(--ink); text-align: right; }
.dc-cc-actions { margin-top: auto; padding: 16px; }
.dc-cc-profile {
  display: block; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  text-decoration: none; padding: 11px 14px; border: 1px solid var(--rule); border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}
.dc-cc-profile:hover { background: var(--bg-warm); color: var(--ink); }

/* Calling-code watermark on the map */
.hejmap-label-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.hejmap-sym {
  position: absolute; transform: translate(-50%, -50%);
  font-family: 'IBM Plex Mono', monospace; font-size: 15px; font-weight: 700;
  color: rgba(255,255,255,0.5); pointer-events: none; white-space: nowrap; user-select: none;
  letter-spacing: 0; text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}
[data-theme="light"] .hejmap-sym { color: rgba(20,40,66,0.62); text-shadow: 0 1px 2px rgba(255,255,255,0.5); }

/* Dial spectrum — signature legend / zone filter */
.dc-spectrum {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 10;
  display: flex; align-items: stretch; gap: 2px; padding: 5px;
  border-radius: 15px; background: var(--paper); border: 1px solid var(--rule);
  box-shadow: 0 10px 30px rgba(26,58,92,0.18), 0 2px 8px rgba(26,58,92,0.08);
  max-width: calc(100% - 32px);
}
.dc-spec-seg {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 54px; padding: 7px 0 6px; border: none; border-radius: 10px;
  background: transparent; cursor: pointer; font-family: inherit;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.dc-spec-bar { width: 26px; height: 6px; border-radius: 3px; background: var(--z); transition: height 0.15s ease, width 0.15s ease; }
.dc-spec-code { font-size: 13px; font-weight: 800; color: var(--ink); line-height: 1; }
.dc-spec-name {
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-faint); line-height: 1; white-space: nowrap;
}
.dc-spec-seg:hover { transform: translateY(-3px); background: var(--bg-warm); }
.dc-spec-seg:hover .dc-spec-bar { width: 32px; }
.dc-spec-seg--active { background: color-mix(in srgb, var(--z) 15%, var(--paper)); }
.dc-spec-seg--active .dc-spec-bar { height: 10px; width: 34px; }
.dc-spec-seg--active .dc-spec-code { color: var(--z); }
.dc-spec-seg--dim { opacity: 0.42; }
.dc-spec-seg--dim:hover { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .dc-spec-seg, .dc-spec-bar { transition: none; }
  .dc-spec-seg:hover { transform: none; }
}

/* Edge fades */
.dc-fade-top {
  position: absolute; top: 0; left: 0; right: 0; height: 80px;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%); pointer-events: none; z-index: 3;
}
.dc-fade-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%); pointer-events: none; z-index: 3;
}

/* Laptop / smaller desktop displays: increase readability and tap comfort */
@media (min-width: 641px) and ((max-width: 1536px) or (max-height: 900px)) {
  .dc-panel-head { padding: 18px 18px 14px; }
  .dc-panel-title { font-size: 19px; }
  .dc-panel-sub { font-size: 13px; line-height: 1.45; }

  .dc-zone-list { padding: 10px 10px 14px; }
  .dc-zone-item {
    min-height: 44px;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
  }
  .dc-zone-tile { min-width: 40px; height: 29px; font-size: 13.5px; }
  .dc-zone-name { font-size: 14.5px; line-height: 1.25; }
  .dc-zone-count {
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--bg-warm);
    font-size: 11px;
    font-weight: 700;
  }

  .dc-info-head { padding: 22px 18px 16px; }
  .dc-info-name { font-size: 17px; }
  .dc-info-country {
    min-height: 44px;
    gap: 12px;
    padding: 10px 16px;
  }
  .dc-info-country-name { font-size: 14.5px; line-height: 1.25; }
  .dc-info-country-code { font-size: 13.5px; font-family: 'IBM Plex Mono', monospace; }

  .dc-cc-hero { padding: 22px 18px 15px; }
  .dc-cc-name { font-size: 21px; }
  .dc-cc-code { margin: 18px 16px 0; padding: 20px 16px; border-radius: 14px; }
  .dc-cc-facts { padding: 18px 16px; }
  .dc-cc-fact { min-height: 44px; padding: 10px 2px; }
}

/* Mobile bottom-sheet: let content flow so it isn't clipped in the 48vh sheet */
@media (max-width: 640px) {
  .dc-spectrum { display: none; }
  .dc-map-title { top: 12px; left: 12px; }
  .dc-map-title-label { font-size: 10px; }
  .dc-map-title-text { font-size: clamp(17px, 6vw, 22px); }

  /* Increase touch target size and visual breathing room in lists */
  .dc-zone-list { padding: 10px 10px 16px; }
  .dc-zone-item {
    min-height: 46px;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
  }
  .dc-zone-tile {
    min-width: 40px;
    height: 30px;
    font-size: 14px;
  }
  .dc-zone-name {
    font-size: 15px;
    line-height: 1.25;
  }
  .dc-zone-count {
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--bg-warm);
    font-size: 11px;
    font-weight: 700;
  }

  .dc-info-head { padding: 22px 18px 16px; }
  .dc-info-country-list { padding-bottom: 24px; }
  .dc-info-country {
    min-height: 46px;
    gap: 12px;
    padding: 10px 16px;
  }
  .dc-info-country-name {
    font-size: 15px;
    line-height: 1.25;
  }
  .dc-info-country-code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.01em;
  }

  .dc-cc-hero { padding: 22px 18px 14px; }
  .dc-cc-code {
    margin: 18px 16px 0;
    padding: 20px 16px;
    border-radius: 14px;
  }
  .dc-cc-facts { padding: 18px 16px; }
  .dc-cc-fact {
    min-height: 44px;
    padding: 10px 2px;
  }

  /* Give bottom-sheet panels more vertical room on phones */
  body.has-bottom-nav [data-panel="left"],
  body.has-bottom-nav [data-panel="right"] {
    max-height: 58vh;
    height: 58vh;
  }
  body.has-bottom-nav.mobile-panel-open .hejmap-layout {
    max-height: calc(100dvh - var(--nav-h, 64px) - 58vh);
  }

  body.has-bottom-nav .dc-info-panel,
  body.has-bottom-nav .dc-cc { height: auto; }
  body.has-bottom-nav .dc-cc { overflow-y: visible; }
  body.has-bottom-nav .dc-info-country-list { overflow-y: visible; flex: none; }
  body.has-bottom-nav .dc-info-placeholder { height: auto; padding: 32px 24px; }
}
