/* The Kaart met paneel template (docs/web.md): a list of 440 px on the left, the map on the right. Shared by Kaart and
   Ritten; later Plannen, Plekken, Gebieden and a group. */
.panel-page { display: flex; }
.panel {
  /* min-width: a long ride name must not widen the panel, or the map shifts under the mouse. */
  flex: 0 0 440px; min-width: 0; display: flex; flex-direction: column; min-height: 0;
  background: var(--shell-panel); border-right: 1px solid var(--shell-line);
}
.panel-head { padding: 22px 22px 16px; border-bottom: 1px solid var(--shell-hairline); }
.panel-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; display: flex; flex-direction: column; gap: 22px; }
.panel-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin: 0; }
.panel-facts dt { font-size: 13px; color: var(--shell-muted); }
.panel-facts dd { margin: 0; font: 700 22px/1.15 "Plus Jakarta Sans", sans-serif; font-variant-numeric: tabular-nums; }
/* The legend on the map, bottom left, as on Importeren. */
.map-legend {
  position: absolute; left: 16px; bottom: 28px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--shell-float); box-shadow: var(--shadow-label); font-size: 12.5px; font-weight: 500;
}
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.legend li { display: flex; align-items: center; gap: 10px; }
/* A short line in the map's colour, with the casing of ridden road where it has one (white by day). */
.swatch {
  flex: 0 0 28px; height: calc(var(--w) + 4px); border-radius: var(--radius-pill);
  background: linear-gradient(var(--c), var(--c)) center / 24px var(--w) no-repeat, var(--casing, transparent);
}
.swatch.dashed { height: 2px; background: repeating-linear-gradient(90deg, var(--shell-countable) 0 4px, transparent 4px 7px); }
.swatch-dir { flex: 0 0 28px; }

/* A segmented control, as on the import page: the design system's Segmented (RMSegmented in the app), a pale capsule
   with the picked segment raised in white, as high as a pill. */
.seg { display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--surface-muted); }
.seg button {
  flex: 1; min-width: 0; min-height: 36px; padding: 4px 8px; border: 0; border-radius: var(--radius-pill); background: transparent;
  font: 600 14px/1.15 var(--font-sans); color: var(--ink); cursor: pointer;
}
.seg button.on { background: var(--surface-raised); box-shadow: 0 1px 3px rgba(31,41,51,.12); }
.view-note { margin: 0; font-size: 13px; color: var(--shell-muted); }
.panel-note { margin: 0; font-size: 14px; color: var(--shell-muted); }
.panel-note a { color: var(--shell-link); font-weight: 600; }

/* The border between panel and map, to drag (Shell.setUpPanelResize): a wide grip over the panel's own line. */
.panel-resize {
  flex: none; position: relative; z-index: 3; width: 9px; margin: 0 -5px 0 -4px; cursor: col-resize; touch-action: none;
}
.panel-resize::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 3px; border-radius: 2px;
  background: transparent; transition: background 0.15s;
}
.panel-resize:hover::after, .panel-resize:focus-visible::after, .panel-resizing .panel-resize::after { background: var(--ink); }
.panel-resize:focus-visible { outline: none; }
.panel-resizing { cursor: col-resize; user-select: none; }
.panel-resizing #map { pointer-events: none; }
.map-wrap { flex: 1; min-width: 0; position: relative; }
#map { position: absolute; inset: 0; }
.map-pills { position: absolute; left: 16px; top: 16px; right: 170px; display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none; }
.map-pill {
  pointer-events: auto; display: flex; align-items: center; gap: 8px; max-width: 100%; height: 38px; padding: 0 5px 0 14px;
  border-radius: var(--radius-pill); background: var(--shell-dark); color: var(--shell-on-dark); font-weight: 600; font-size: 13.5px;
}
.map-pill button {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: var(--radius-lg); border: 0; background: var(--shell-pill-close); color: var(--shell-pill-close-fg);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.pill-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


@media (max-width: 760px) {
  .panel-page { flex-direction: column; }
  .panel-resize { display: none; }
  .panel { flex: 0 0 auto !important; border-right: 0; border-bottom: 1px solid var(--shell-line); }
  .map-wrap { flex: 1 0 60vh; }
  /* Folded (kaart.js): only the title and the tabs, so the map shows at once. */
  .panel.folded > :not(.panel-head) { display: none !important; }
}
.map-error {
  position: absolute; left: 16px; top: 16px; margin: 0; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--shell-panel); box-shadow: var(--shadow-label);
}

/* Lagen on the map, top right beside the zoom buttons: what else can be on the map. */
.map-layers { position: absolute; top: 10px; right: 52px; }
.map-layers-button {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 0; border-radius: var(--radius-sm);
  background: var(--shell-panel); box-shadow: var(--shadow-label); font: 600 14px "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--shell-fg); cursor: pointer;
}
.map-layers-menu {
  position: absolute; right: 0; top: 48px; width: 270px; box-sizing: border-box; margin: 0; padding: 10px 14px 12px;
  border: 0; border-radius: var(--radius-md); background: var(--shell-panel); color: var(--shell-fg); box-shadow: var(--shadow-card);
}
.map-layers-menu legend {
  float: left; width: 100%; padding: 2px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--shell-muted);
}
.map-layers-menu label { clear: both; display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding-top: 4px; cursor: pointer; }
.map-layers-menu input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--shell-fg); flex-shrink: 0; }
.map-layers-menu span { display: flex; flex-direction: column; font-size: 15px; line-height: 1.3; }
.map-layers-menu small { font-size: 13px; color: var(--shell-muted); }

/* Tabs under the title of the panel (Kaart: Ritten and Gebieden), on the line under the head. */
.panel-head.tabbed { padding-bottom: 0; }
/* Folding the list is for a phone only. */
.panel-fold {
  display: none; align-items: center; gap: 6px; width: 100%; justify-content: center; height: 40px; margin: 0; padding: 0;
  border: 0; border-top: 1px solid var(--shell-hairline); background: transparent; color: var(--shell-muted);
  font: 600 14px "Plus Jakarta Sans", system-ui, sans-serif; cursor: pointer;
}
@media (max-width: 760px) { .panel-fold { display: flex; } }
.panel-tabs { display: flex; gap: 4px; margin: 12px -6px 0; }
.panel-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 6px;
  border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--shell-muted); font: 500 15px "Plus Jakarta Sans", sans-serif;
}
.panel-tab:hover { color: var(--shell-fg); }
.panel-tab[aria-selected="true"] { border-bottom-color: var(--primary); color: var(--shell-fg); font-weight: 700; }
.panel-tab small { font-size: 13px; font-weight: 500; color: var(--shell-muted); font-variant-numeric: tabular-nums; }
/* A tab with tools above its list (Ritten: the quick search): the tools stay, the list scrolls. */
.panel-tabpanel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.panel-tools { padding: 14px 22px 0; }
.panel-tools .quick-search { margin-top: 0; }
