/* "Na trasie" (POI) tool — markers, clusters, place card, tool panel, layer chip.
   Each element takes its category colour from the --poi custom property. */

/* ── markers ── */
.poi-pin-wrap, .poi-cluster-wrap { background: none; border: 0; }

.poi-pin {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--poi);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    box-sizing: border-box;
    transition: transform 0.12s ease;
}
.poi-pin:hover { transform: scale(1.12); }
.poi-pin--sel {
    font-size: 16px;
    border-width: 3px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--poi) 35%, transparent), 0 2px 6px rgba(0, 0, 0, 0.5);
}
.poi-pin-cert {
    position: absolute;
    right: -5px;
    top: -5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #1b1b1f;
    border: 1.5px solid #fff;
    color: #fbbf24;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poi-cluster {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: color-mix(in srgb, var(--poi) 88%, #000);
    border: 2px solid #fff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--poi) 30%, transparent), 0 1px 4px rgba(0, 0, 0, 0.45);
    color: #fff;
    font: 700 12px/1 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* ── place card (Leaflet popup) ── */
.poi-popup .leaflet-popup-content-wrapper {
    background: var(--glass-bg, rgba(27, 27, 31, 0.96));
    color: var(--text-main, #f4f3f0);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
}
.poi-popup .leaflet-popup-tip { background: var(--glass-bg, rgba(27, 27, 31, 0.96)); }
.poi-popup .leaflet-popup-content { margin: 14px 14px 12px; font-family: 'Inter', sans-serif; }
.poi-popup a.leaflet-popup-close-button { color: var(--text-muted, #a3a3a7); top: 6px; right: 6px; }

.poi-card { display: flex; flex-direction: column; gap: 8px; font-size: 12px; line-height: 1.4; }
.poi-card-head { display: flex; gap: 10px; align-items: flex-start; padding-right: 14px; }
.poi-card-badge {
    flex: 0 0 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--poi);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.poi-card-titles { min-width: 0; }
.poi-card-name { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.poi-card-type { color: var(--text-muted, #a3a3a7); font-size: 11px; }
.poi-card-where { color: var(--text-main, #f4f3f0); font-weight: 600; }
.poi-card-cert { color: #fbbf24; font-weight: 600; }
.poi-card-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.poi-chip-f {
    padding: 3px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--poi) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--poi) 35%, transparent);
    font-size: 11px;
    white-space: nowrap;
}
.poi-card-line { color: var(--text-main, #f4f3f0); }
.poi-card-unknown { color: var(--text-muted, #a3a3a7); font-size: 11px; }
.poi-card-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.poi-card-price strong { font-size: 15px; }
.poi-card-price-src { color: var(--text-muted, #a3a3a7); font-size: 11px; }
.poi-card-detour {
    padding: 6px 8px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--poi) 14%, transparent);
    border-left: 3px solid var(--poi);
    font-weight: 600;
}
.poi-card-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.poi-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--poi);
    background: var(--poi);
    color: #fff !important;
    font: 700 12px/1.2 'Inter', sans-serif;
    text-decoration: none;
    cursor: pointer;
}
.poi-btn:hover { filter: brightness(1.08); }
.poi-btn-ghost {
    background: transparent;
    border-color: var(--glass-border, rgba(255, 255, 255, 0.18));
    color: var(--text-main, #f4f3f0) !important;
}
.poi-btn-on { background: transparent; color: var(--poi) !important; }
.poi-card-src { color: var(--text-muted, #a3a3a7); font-size: 10px; }

/* ── tool panel ── */
/* Capped between the top bar and the bottom edge; the content scrolls inside, so the panel never
   covers the HUD and the header buttons. Scroll sits on the content, not the positioned container,
   for the same reason as the tachograph panel (keeps the toggle tab at left:-44px visible). */
.tools-panel-container.poi-panel { max-height: calc(100vh - 190px); padding-top: 24px; padding-bottom: 20px; }
.tools-panel-container.poi-panel #poi-tool-content {
    max-height: calc(100vh - 290px);
    overflow-y: auto;
    margin-right: -10px;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.tools-panel-container.poi-panel #poi-tool-content::-webkit-scrollbar { width: 5px; }
.tools-panel-container.poi-panel #poi-tool-content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 10px; }
/* openToolView() sets an inline display:block on the slot, so sections are spaced with margins. */
#poi-tool-content > * + * { margin-top: 16px; }
#poi-tool-content {
    font-family: var(--emx-font-body, 'Inter', sans-serif);
    color: var(--text-main, #f4f3f0);
}
.poi-sec {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted, #a3a3a7);
    margin: 4px 2px -2px;
}

/* summary card: route length, places count, vehicle and corridor */
.poi-summary {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px 12px;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}
.poi-summary-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--emx-accent, #3cbfda) 16%, transparent);
    color: var(--emx-accent, #3cbfda);
    font-size: 15px;
}
.poi-summary-text { min-width: 0; }
.poi-summary-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.poi-summary-sub { font-size: 12px; color: var(--text-muted, #a3a3a7); margin-top: 2px; }
.poi-summary-sub:empty { display: none; }
.poi-pills { grid-column: 1 / -1; display: flex; gap: 6px; }
.poi-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main, #f4f3f0);
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.poi-pill i { font-size: 10px; color: var(--text-muted, #a3a3a7); }

/* category list with switches */
.poi-cats {
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    background: rgba(255, 255, 255, 0.025);
    overflow: hidden;
}
.poi-cat {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto 30px;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    background: transparent;
    color: var(--text-main, #f4f3f0);
    font: 600 13px/1.2 var(--emx-font-body, 'Inter', sans-serif);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}
.poi-cat + .poi-cat { border-top: 1px solid var(--glass-border, rgba(255, 255, 255, 0.06)); }
.poi-cat:hover { background: rgba(255, 255, 255, 0.04); }
.poi-cat:focus-visible { outline: 2px solid var(--poi); outline-offset: -2px; }
.poi-cat-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--poi) 14%, transparent);
    color: var(--poi);
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}
.poi-cat.on .poi-cat-icon { background: var(--poi); color: #fff; }
.poi-cat-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted, #a3a3a7); transition: color 0.15s; }
.poi-cat.on .poi-cat-label { color: var(--text-main, #f4f3f0); }
.poi-cat-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #a3a3a7);
    font-variant-numeric: tabular-nums;
}
.poi-switch {
    position: relative;
    width: 30px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    transition: background 0.18s;
}
.poi-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d4d4d8;
    transition: transform 0.18s var(--emx-ease, ease), background 0.18s;
}
.poi-cat.on .poi-switch { background: var(--poi); }
.poi-cat.on .poi-switch::after { transform: translateX(12px); background: #fff; }

/* hints and errors */
.poi-notice {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted, #a3a3a7);
    font-size: 12px;
    line-height: 1.45;
}
.poi-notice:empty { display: none; }
.poi-notice i { margin-top: 2px; font-size: 12px; }
.poi-notice--warn {
    background: color-mix(in srgb, var(--emx-warn, #e8a33d) 12%, transparent);
    color: color-mix(in srgb, var(--emx-warn, #e8a33d) 70%, #fff);
}

/* chosen stops */
.poi-stops:empty, .poi-note:empty { display: none; }
.poi-stops {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.poi-stops .poi-sec { margin-bottom: 4px; }
.poi-stop {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px 7px 10px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--poi) 10%, transparent);
    border-left: 3px solid var(--poi);
    font-size: 12px;
}
.poi-stop + .poi-stop { margin-top: 4px; }
.poi-stop-icon { color: var(--poi); width: 14px; text-align: center; font-size: 12px; }
.poi-stop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.poi-stop-km { color: var(--text-main, #f4f3f0); font-variant-numeric: tabular-nums; font-weight: 600; }
.poi-stop-x {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted, #a3a3a7);
    cursor: pointer;
    font-size: 11px;
}
.poi-stop-x:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.poi-stop-sum { font-size: 11px; color: var(--text-muted, #a3a3a7); text-align: right; margin-top: 4px; }

/* places along the route: km on the left, a thin line through the dots */
.poi-places[hidden] { display: none; }
.poi-places { display: flex; flex-direction: column; gap: 8px; }
.poi-list { display: flex; flex-direction: column; padding-right: 2px; }
.poi-places:not(.open) .poi-list { display: none; }
/* the list header folds the list in and out */
.poi-sec-places {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 9px 12px;
    margin: 0;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.poi-sec-places:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-main, #f4f3f0); }
.poi-sec-places i { font-size: 10px; transition: transform 0.2s var(--emx-ease, ease); }
.poi-places.open .poi-sec-places i { transform: rotate(180deg); }
.poi-row {
    position: relative;
    display: grid;
    grid-template-columns: 50px 22px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 6px 6px 6px 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-main, #f4f3f0);
    text-align: left;
    cursor: pointer;
}
.poi-row::before {
    content: '';
    position: absolute;
    left: 72.5px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}
.poi-row:first-child::before { top: 50%; }
.poi-row:last-of-type::before { bottom: 50%; }
.poi-row:hover { background: rgba(255, 255, 255, 0.045); }
.poi-row.picked { background: color-mix(in srgb, var(--poi) 12%, transparent); }
.poi-row-km {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #a3a3a7);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.poi-row-dot {
    position: relative;
    z-index: 1;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--poi);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 0 0 3px var(--glass-bg, #18181b);
}
.poi-row-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.poi-row-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poi-row-sub { font-size: 11px; color: var(--text-muted, #a3a3a7); }
.poi-row-sub:empty { display: none; }
.poi-more {
    margin-top: 6px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main, #f4f3f0);
    font: 600 12px var(--emx-font-body, 'Inter', sans-serif);
    cursor: pointer;
}
.poi-more:hover { background: rgba(255, 255, 255, 0.07); }
.poi-note { font-size: 10.5px; color: var(--text-muted, #a3a3a7); line-height: 1.5; opacity: 0.8; }

/* ── active layers on the map: one glass capsule ── */
.poi-layers-chip {
    position: absolute;
    left: 16px;
    right: 92px;            /* clear of the chat bubble in the corner */
    bottom: 18px;
    z-index: 650;
    display: flex;
    justify-content: center;
    pointer-events: none;   /* the strip beside the capsule stays part of the map */
}
.poi-layers-chip[hidden] { display: none; }
.poi-layers-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    max-width: 100%;
    padding: 4px;
    border-radius: 999px;
    background: rgba(22, 22, 26, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    pointer-events: auto;
}
.poi-layers-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 8px 4px 4px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #ecebe7;
    font: 600 11.5px/1 var(--emx-font-body, 'Inter', sans-serif);
    cursor: pointer;
    transition: background 0.15s;
}
.poi-layers-item:hover { background: rgba(255, 255, 255, 0.08); }
.poi-layers-item:focus-visible { outline: 2px solid var(--poi); outline-offset: 1px; }
.poi-layers-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--poi);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}
.poi-layers-x { color: #a3a3a7; font-size: 10px; opacity: 0.55; transition: opacity 0.15s, color 0.15s; }
.poi-layers-item:hover .poi-layers-x { opacity: 1; color: #fff; }
/* Phones: above the chat bubble and the attribution; icons only so the capsule stays one line. */
@media (max-width: 768px) {
    .poi-layers-chip { bottom: 84px; right: 16px; }
}
@media (max-width: 480px) {
    .poi-layers-label, .poi-layers-x { display: none; }
    .poi-layers-item { padding: 4px; }
    .poi-layers-dot { width: 26px; height: 26px; font-size: 11px; }
}

/* ── HUD: POI costs, shown only when a chosen stop has a verified price ── */
#hud-poi-metric[hidden] { display: none; }
