/* TWC Routeatlas — alleen geladen op de pagina "Routes".
   Gebruikt de kleur- en lettertokens (--twc-*) uit user.css van de child template. */
.twc-atlas {
  --twc-font-data: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--twc-ink);
}
.twc-atlas * { box-sizing: border-box; }

/* Kop met cijfers */
.twc-atlas .kop { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: end; padding: 8px 0 20px; }
.twc-atlas .eyebrow { font: 600 .875rem/1.2 var(--twc-font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--twc-muted); margin: 0 0 6px; }
.twc-atlas h1 { font: 700 clamp(2.5rem, 6vw, 4.25rem)/.95 var(--twc-font-display); letter-spacing: -.01em; margin: 0; }
.twc-atlas h1 em { font-style: normal; color: var(--twc-accent); }
.twc-atlas .lead { margin: 12px 0 0; color: var(--twc-muted); max-width: 58ch; }
.twc-atlas .cijfers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--twc-line); border: 1px solid var(--twc-line); border-radius: 10px; overflow: hidden; }
.twc-atlas .cijfer { background: var(--twc-surface); padding: 12px 14px; }
.twc-atlas .cijfer b { display: block; font: 600 2.125rem/1 var(--twc-font-display); font-variant-numeric: tabular-nums; }
.twc-atlas .cijfer span { font-size: .8125rem; color: var(--twc-muted); }

/* Kaart naast paneel */
.twc-atlas .atlas { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.twc-atlas .kaart { position: relative; background: var(--twc-night); border-radius: 12px; overflow: hidden; height: min(74vh, 760px); min-height: 440px; }
.twc-atlas .kaart canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.twc-atlas .kaart canvas.slepen { cursor: grabbing; }
.twc-atlas .kaart-knoppen { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; }
.twc-atlas .kaart-knoppen button,
.twc-atlas .kaart-weergave button { font: 600 14px/1 var(--twc-font-body); color: var(--twc-night-ink); background: rgba(20, 30, 40, .82); border: 1px solid rgba(201, 211, 221, .2); border-radius: 8px; padding: 8px 10px; cursor: pointer; min-width: 36px; }
.twc-atlas .kaart-knoppen button:hover,
.twc-atlas .kaart-weergave button:hover { border-color: rgba(201, 211, 221, .5); }
.twc-atlas .kaart-weergave { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.twc-atlas .kaart-weergave button[aria-pressed="true"] { background: var(--twc-oranje); color: #1b0f05; border-color: var(--twc-oranje); }
.twc-atlas .legenda { position: absolute; left: 12px; bottom: 12px; color: var(--twc-night-ink); font-size: 12px; display: flex; align-items: center; gap: 8px; background: rgba(11, 17, 24, .7); padding: 6px 10px; border-radius: 8px; }
.twc-atlas .legenda i { display: block; width: 96px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #5a2a0c, #d9661a, #ffc56b, #fff6e0); }
.twc-atlas .schaal { position: absolute; right: 12px; bottom: 12px; color: var(--twc-night-ink); font: 12px var(--twc-font-data); text-align: right; }
.twc-atlas .schaal i { display: block; height: 6px; border: 1px solid var(--twc-night-ink); border-top: 0; margin-top: 2px; margin-left: auto; }

/* Routekaartje op de kaart */
.twc-atlas .kaartje { position: absolute; left: 12px; right: 12px; bottom: 52px; max-width: 420px; background: var(--twc-surface); color: var(--twc-ink); border-radius: 10px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); display: grid; gap: 8px; }
.twc-atlas .kaartje[hidden] { display: none; }
.twc-atlas .kaartje h3 { font: 600 1.625rem/1.05 var(--twc-font-display); margin: 0; padding-right: 32px; }
.twc-atlas .kaartje .sluit { position: absolute; top: 8px; right: 8px; border: 0; background: transparent; color: var(--twc-muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.twc-atlas .kaartje dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.twc-atlas .kaartje dt { font-size: 12px; font-weight: 400; color: var(--twc-muted); }
.twc-atlas .kaartje dd { margin: 0; font: 500 15px var(--twc-font-data); font-variant-numeric: tabular-nums; }
.twc-atlas .kaartje .acties { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--twc-muted); }
.twc-atlas .knop { display: inline-block; text-decoration: none; font: 600 14px var(--twc-font-body); background: var(--twc-accent); color: var(--twc-accent-ink); border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.twc-atlas .knop[disabled] { opacity: .45; cursor: not-allowed; }
.twc-atlas .knop:hover { background: var(--twc-ink); color: var(--twc-surface); }
.twc-atlas .kaartje .extra { font-size: 13px; color: var(--twc-muted); margin: 0; }
.twc-atlas .kaartje .extra button { font: inherit; color: var(--twc-link); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* Paneel */
.twc-atlas .paneel { display: grid; gap: 14px; }
.twc-atlas .blok { background: var(--twc-surface); border: 1px solid var(--twc-line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; min-width: 0; }
.twc-atlas .blok h2 { font: 600 .9375rem/1.2 var(--twc-font-display); letter-spacing: .1em; text-transform: uppercase; margin: 0; color: var(--twc-muted); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.twc-atlas .blok h2 button { font: 600 13px var(--twc-font-body); letter-spacing: 0; text-transform: none; color: var(--twc-link); background: none; border: 0; cursor: pointer; padding: 0; }
.twc-atlas .groep { display: grid; gap: 6px; margin: 0; }
.twc-atlas .groep > span { font-size: 13px; color: var(--twc-muted); }
.twc-atlas .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.twc-atlas .chip { font: 600 14px var(--twc-font-body); color: var(--twc-ink); background: transparent; border: 1px solid var(--twc-line); border-radius: 999px; padding: 5px 11px; cursor: pointer; display: inline-flex; gap: 6px; align-items: baseline; }
.twc-atlas .chip small { font: 12px var(--twc-font-data); color: var(--twc-muted); }
.twc-atlas .chip[aria-pressed="true"] { background: var(--twc-ink); color: var(--twc-surface); border-color: var(--twc-ink); }
.twc-atlas .chip[aria-pressed="true"] small { color: inherit; opacity: .7; }
.twc-atlas .kaartje .chips .chip { cursor: default; font-size: 13px; padding: 3px 9px; }

.twc-atlas .kompas-rij { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center; }
.twc-atlas .kompas svg { width: 150px; height: 150px; display: block; }
.twc-atlas .kompas path { cursor: pointer; stroke: var(--twc-surface); stroke-width: 2; }
.twc-atlas .kompas text { font: 600 12px var(--twc-font-display); fill: var(--twc-ink); pointer-events: none; letter-spacing: .04em; }
.twc-atlas .kompas-uitleg { font-size: 13px; color: var(--twc-muted); margin: 0; }

.twc-atlas .zoek { width: 100%; font: 16px var(--twc-font-body); color: var(--twc-ink); background: var(--twc-bg); border: 1px solid var(--twc-line); border-radius: 8px; padding: 8px 10px; }
.twc-atlas .sorteer { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--twc-muted); }
.twc-atlas .sorteer label { margin: 0; }
.twc-atlas .sorteer select { font: 14px var(--twc-font-body); color: var(--twc-ink); background: var(--twc-bg); border: 1px solid var(--twc-line); border-radius: 6px; padding: 4px 6px; }
.twc-atlas .lijst { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow-y: auto; border-top: 1px solid var(--twc-line); }
.twc-atlas .lijst li + li { border-top: 1px solid var(--twc-line); }
.twc-atlas .lijst button { width: 100%; text-align: left; background: none; border: 0; color: var(--twc-ink); cursor: pointer; padding: 9px 4px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font: inherit; }
.twc-atlas .lijst button:hover { background: var(--twc-bg); }
.twc-atlas .lijst button[aria-current="true"] { background: var(--twc-accent-soft); }
.twc-atlas .lijst .naam { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.twc-atlas .lijst .vaak { font: 500 11px var(--twc-font-data); color: var(--twc-accent); margin-left: 6px; }
.twc-atlas .lijst .km { font: 500 14px var(--twc-font-data); font-variant-numeric: tabular-nums; text-align: right; }
.twc-atlas .lijst .sub { font-size: 12px; color: var(--twc-muted); }
.twc-atlas .lijst .hm { font: 12px var(--twc-font-data); color: var(--twc-muted); text-align: right; }
.twc-atlas .leeg { color: var(--twc-muted); font-size: 14px; padding: 12px 4px; }
.twc-atlas .bron { font-size: 13px; color: var(--twc-muted); margin: 16px 0 0; }

.twc-atlas button:focus-visible,
.twc-atlas select:focus-visible,
.twc-atlas input:focus-visible,
.twc-atlas .kompas path:focus-visible { outline: 2px solid var(--twc-clubblauw); outline-offset: 2px; }

@media (max-width: 960px) {
  .twc-atlas .kop,
  .twc-atlas .atlas { grid-template-columns: minmax(0, 1fr); }
  .twc-atlas .kaart { height: 64vh; min-height: 380px; }
}
@media (max-width: 480px) {
  .twc-atlas .cijfers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .twc-atlas .cijfer b { font-size: 1.625rem; }
  .twc-atlas .kaartje dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .twc-atlas .kompas-rij { grid-template-columns: minmax(0, 1fr); justify-items: center; }
}
