﻿/* Kiosk Mode - Modern Clean Design */

/* ===
   CSS custom properties — defaults.
   Runtime values are set exclusively by Blazor's reactive :root <style> block in
   KioskMode.razor (single source of truth — see kiosk-system.js for why it must NOT
   also be set from JS). --kiosk-button-size scopes to the round MAP overlay buttons
   (keyboard/language/zoom); --kiosk-sidebar-button-size scopes to the FILTER PANEL's
   category chips and action buttons — these are deliberately independent settings.
=== */
:root {
    --kiosk-button-size: 56px;
    --kiosk-button-font-size: 14px;
    --kiosk-button-radius: 8px;
    --kiosk-marker-size: 40px;
    --kiosk-sidebar-button-size: 44px;
    --kiosk-poi-list-font-size: 13px;
    --kiosk-keyboard-key-size: 58px;
}

/* Custom scrollbar for Blink/WebKit (Chrome, Edge).
   ::-webkit-scrollbar MUST be defined first — it activates the custom
   scrollbar rendering engine, without which ::-webkit-scrollbar-button
   has no effect and arrows remain visible. */
.kiosk-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f5f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

/* === Kiosk Video Player (KVP) === */
.kvp-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.kvp-yt-host,
.kvp-yt-host iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}


.kvp-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.kvp-touch {
    position: absolute;
    inset: 0;
    z-index: 2;
    cursor: pointer;
}

.kvp-centre {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 88px;
    height: 88px;
    padding: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
    transition: transform 0.15s, opacity 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kvp-centre:active {
    transform: translate(-50%, -50%) scale(0.9);
}

.kvp-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    padding: 28px 16px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity 0.25s;
}

.kvp-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kvp-progress {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.kvp-progress:hover { height: 7px; }

.kvp-fill {
    height: 100%;
    background: #1976d2;
    border-radius: 3px;
    pointer-events: none;
}

.kvp-time {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Hides YouTube related-video overlay when video is paused or ended */
.kvp-touch.kvp-pause-block {
    background: rgba(0, 0, 0, 0.85);
}

.kvp-vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 72px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
}

.kvp-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.kvp-vol-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
}

.kvp-wrapper:-webkit-full-screen {
    border-radius: 0;
}

.kvp-wrapper:fullscreen {
    border-radius: 0;
}

.kvp-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Top Bar */
.kiosk-top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    background: #4caf50;
}

.status-indicator.disconnected {
    background: #f44336;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.kiosk-id-badge {
    padding: 4px 12px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.language-selector {
    margin-left: auto;
}

/* Main Content Area */
.kiosk-main-content {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.loading-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Layout */
.kiosk-layout {
    display: grid;
    grid-template-rows: 1fr;
    gap: 0;
    --kiosk-gap: 16px;
    padding: 16px;
    height: 100%;
    transition: grid-template-columns 0.3s ease-in-out;
}

/* Map wrapper — grid child, holds map + floating detail overlay */
.kiosk-map-wrapper {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.kiosk-map-wrapper > .map-area {
    flex: 1 1 0;
    min-height: 0;
}

/* Floating POI detail — fixed to viewport, never affects map layout.
   Width is normally set inline per-instance (KioskMode.razor, _detailWidth) — computed in C#
   alongside the panel's X position so the two can never disagree about how wide it actually is.
   This rule is just the pre-JS/first-paint fallback before that inline style is applied. */
.poi-detail-float {
    position: fixed;
    z-index: 1000;
    width: min(var(--kiosk-detail-panel-width, 460px), 90vw);
    pointer-events: none;
}

/* Drag handles for repositioning the floating detail (title on desktop, top bar on mobile).
   touch-action:none lets the drag take over from the browser's default touch panning. */
.poi-detail-float .poi-html-title,
.poi-detail-float .poi-expand-btn-bar {
    cursor: move;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Grip-dots affordance before the title — signals the panel can be dragged. */
.poi-detail-float .poi-html-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.poi-detail-float .poi-html-title::before {
    content: '';
    flex: 0 0 auto;
    width: 12px;
    height: 18px;
    background-image: radial-gradient(#bdbdbd 1.5px, transparent 1.7px);
    background-size: 6px 6px;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.poi-detail-float .poi-html-title:hover::before,
.poi-detail-float .poi-html-title:active::before {
    opacity: 1;
}

/* Category Sidebar */
.category-sidebar {
    background: white;
    border-radius: 8px;
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 0;
    min-height: 0;
    margin-right: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, margin-right 0.3s ease-out;
}

.category-sidebar.sidebar-open {
    overflow-y: auto;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    margin-right: var(--kiosk-gap);
}

/* Toggle arrow for mobile height — hidden on desktop */
.sidebar-height-toggle {
    display: none !important;
}

/* Map Area — no padding/shadow: the map itself should fill this cell edge-to-edge instead of
   sitting inside its own inner "card" (that inset used to read as a second boxed-in container
   wrapping a visibly smaller map, #3638 point 2). */
.map-area {
    background: white;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.kiosk-leaflet-host,
.kiosk-leaflet-container {
    width: 100%;
    height: 100%;
}

.kiosk-leaflet-host {
    position: relative;
    z-index: 0;
}

.kiosk-leaflet-container {
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    position: relative;
    z-index: 0;
}

.kiosk-leaflet-container .leaflet-container {
    background: #fff;
}

/* Apply kiosk button size/radius config to MudBlazor FABs and icon buttons inside the kiosk.
   The glyph inside (MudBlazor renders it at a fixed rem size via .mud-icon-root/.mud-icon-size-*)
   is rescaled proportionally to the button box — same 0.5-ish ratio used for POI marker icons —
   so "Velikost tlačítka" visibly resizes the icon too, not just the surrounding circle. */
.kiosk-fullscreen .mud-fab {
    width: var(--kiosk-button-size, 56px) !important;
    height: var(--kiosk-button-size, 56px) !important;
    min-width: var(--kiosk-button-size, 56px) !important;
}

.kiosk-fullscreen .mud-fab .mud-icon-root {
    font-size: calc(var(--kiosk-button-size, 56px) * 0.42) !important;
}

.kiosk-fullscreen .mud-button-root:not(.mud-fab):not(.mud-icon-button) {
    border-radius: var(--kiosk-button-radius, 8px) !important;
    font-size: var(--kiosk-button-font-size, 14px) !important;
    min-height: var(--kiosk-sidebar-button-size, 44px) !important;
}

/* The map controls (zoom in/out, reset view) are MudIconButtons, which the rule above
   deliberately excludes (they're not text buttons) — so they need their own sizing,
   otherwise "Velikost tlačítka" has no visible effect on them at all. Keyed off the group's
   own class, not its position, since the group is placeable in any corner (#3778). */
.kiosk-map-controls .mud-icon-button {
    width: var(--kiosk-button-size, 56px) !important;
    height: var(--kiosk-button-size, 56px) !important;
}

.kiosk-map-controls .mud-icon-button .mud-icon-root {
    font-size: calc(var(--kiosk-button-size, 56px) * 0.42) !important;
}

.kiosk-map-overlay {
    position: absolute;
    z-index: 50;
    transition: opacity 0.2s ease;
}

/* Outer positioned overlay: stacks the language switcher row (when enabled) above the
   filter/keyboard FAB row, both anchored to the map's top-left corner. */
.kiosk-map-overlay-top-left-stack {
    top: 30px;
    left: 30px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Inner FAB row — no longer independently positioned, it's a flex child of the stack above. */
.kiosk-map-overlay-top-left {
    display: flex;
    flex-direction: row;
    gap: 14px;
}

.kiosk-map-overlay-bottom-right {
    right: 30px;
    bottom: 30px;
}

/* Zoom controls move here when the language switcher claims the bottom-right corner instead (#3638 point 3). */
.kiosk-map-overlay-bottom-left {
    left: 30px;
    bottom: 30px;
}

/* Remaining placements for the map controls (#3778). Top-left is missing on purpose — there the
   controls join the in-flow .kiosk-map-overlay-top-left-stack instead, so they can never cover the
   filter/keyboard FABs that always live in that corner. */
.kiosk-map-overlay-top-right {
    right: 30px;
    top: 30px;
}

/* Centred on the map's own width, so the controls stay reachable from either side of a wide screen
   without occupying a corner that the language switcher might want. */
.kiosk-map-overlay-top-center {
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.kiosk-map-overlay-bottom-center {
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

/* ── Shared corner: map controls + language switcher in one slot (#3778) ─────────────────
   Used only when both were explicitly placed in the same corner. The slot lays them out
   instead of letting them stack on top of each other; the first child in the markup is the
   one the admin chose to keep nearest the corner, which is why the right/bottom edges use
   the -reverse directions. */
.kiosk-map-slot {
    display: flex;
    gap: 14px;
}

.kiosk-map-slot-top-left     { top: 30px; left: 30px; }
.kiosk-map-slot-top-right    { top: 30px; right: 30px; }
.kiosk-map-slot-bottom-left  { bottom: 30px; left: 30px; }
.kiosk-map-slot-bottom-right { bottom: 30px; right: 30px; }

.kiosk-map-slot-row,
.kiosk-map-slot-row-reverse {
    flex-direction: row;
    align-items: center;
}

.kiosk-map-slot-row-reverse {
    flex-direction: row-reverse;
}

.kiosk-map-slot-column,
.kiosk-map-slot-column-reverse {
    flex-direction: column;
}

.kiosk-map-slot-column-reverse {
    flex-direction: column-reverse;
}

.kiosk-map-slot-top-left.kiosk-map-slot-column,
.kiosk-map-slot-bottom-left.kiosk-map-slot-column-reverse {
    align-items: flex-start;
}

.kiosk-map-slot-top-right.kiosk-map-slot-column,
.kiosk-map-slot-bottom-right.kiosk-map-slot-column-reverse {
    align-items: flex-end;
}

/* The nested Bubble dropdown defaults to opening downward from the top-left (see
   .language-flags-overlay-nested .lang-dropdown). Inside a slot it has to open away from the
   edge it sits on, otherwise it leaves the map — and it must hug the correct side so it doesn't
   drift over the controls beside it. */
.kiosk-map-slot-bottom-left .language-flags-overlay-nested .lang-dropdown,
.kiosk-map-slot-bottom-right .language-flags-overlay-nested .lang-dropdown {
    top: auto;
    bottom: calc(100% + 4px);
}

.kiosk-map-slot-top-right .language-flags-overlay-nested .lang-dropdown,
.kiosk-map-slot-bottom-right .language-flags-overlay-nested .lang-dropdown {
    left: auto;
    right: 0;
}

.kiosk-leaflet-pin {
    background: transparent;
    border: none;
}

.kiosk-leaflet-pin-button {
    width: calc(var(--kiosk-marker-size, 40px) + 4px);
    height: calc(var(--kiosk-marker-size, 40px) + 4px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.kiosk-leaflet-pin-badge {
    position: relative;
    width: var(--kiosk-marker-size, 40px);
    height: var(--kiosk-marker-size, 40px);
    border-radius: 50%;
    border: 2px solid #fff;
    outline: 2px solid transparent;
    outline-offset: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.kiosk-leaflet-pin-icon {
    width: calc(var(--kiosk-marker-size, 40px) * 0.5);
    height: calc(var(--kiosk-marker-size, 40px) * 0.5);
    display: block;
    color: #fff;
    fill: currentColor;
}

.kiosk-leaflet-pin:hover .kiosk-leaflet-pin-badge {
    border-color: #263f61;
    outline-color: rgba(38, 63, 97, 0.22);
}

/* Red fill on selection only makes sense when the marker itself is normally filled (Icon/Dot),
   AND only for the Pulse selection style. For Pin/Cross the fx overlay (further down) IS the
   indicator — forcing the badge red too made it compete with the fx's own white border for the
   same small area, reading as visual noise (a stray white ring) instead of a clean arrow/cross.
   Outline/Hidden POI styles stay see-through when selected regardless of animation style. */
.kiosk-selection-style-pulse.kiosk-poi-style-icon .kiosk-leaflet-pin.is-selected .kiosk-leaflet-pin-badge,
.kiosk-selection-style-pulse.kiosk-poi-style-dot .kiosk-leaflet-pin.is-selected .kiosk-leaflet-pin-badge {
    background: #e53935 !important;
    border-color: #fff;
    outline-color: rgba(229, 57, 53, 0.35);
    box-shadow: 0 0 0 5px rgba(229, 57, 53, 0.25);
}

.kiosk-poi-style-outline .kiosk-leaflet-pin.is-selected .kiosk-leaflet-pin-badge {
    background: transparent !important;
    border-color: #e53935 !important;
    box-shadow: none !important;
}

.kiosk-poi-style-hidden .kiosk-leaflet-pin.is-selected .kiosk-leaflet-pin-badge {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Pulse rings — expanding glow that draws the eye to the selected POI. GPU-composited
   (transform + opacity only), so it never costs layout. The animation loops while the
   .is-pulse class is present; JS removes it after a short window so it settles to solid red.
   Scoped under .kiosk-selection-style-pulse (the default) so switching the config to Pin/Cross
   turns this off. */
.kiosk-selection-style-pulse .kiosk-leaflet-pin.is-selected .kiosk-leaflet-pin-badge.is-pulse::after,
.kiosk-selection-style-pulse .kiosk-leaflet-pin.is-selected .kiosk-leaflet-pin-badge.is-pulse::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: rgba(229, 57, 53, 0.45);
    pointer-events: none;
    will-change: transform, opacity;
    z-index: -1;
}

.kiosk-selection-style-pulse .kiosk-leaflet-pin.is-selected .kiosk-leaflet-pin-badge.is-pulse::after {
    animation: kiosk-pulse-ring 1.4s cubic-bezier(0.2, 0, 0.3, 1) infinite;
}

/* Second ring, offset by half a cycle for a continuous double-wave effect */
.kiosk-selection-style-pulse .kiosk-leaflet-pin.is-selected .kiosk-leaflet-pin-badge.is-pulse::before {
    animation: kiosk-pulse-ring 1.4s cubic-bezier(0.2, 0, 0.3, 1) 0.7s infinite;
}

@keyframes kiosk-pulse-ring {
    0%   { transform: scale(1);   opacity: 0.7; }
    100% { transform: scale(2.6); opacity: 0;   }
}

/* Selection-fx element — an extra always-present child of the badge (see markerHtml in
   kiosk-leaflet.js). Invisible by default; the Pin/Cross selection styles below animate it
   only while its marker carries .is-selected. */
.kiosk-selection-fx {
    display: none;
}

/* Pin/Cross icons — single-path SVGs (Material "place" / "close"), hidden by default and
   switched on per selection style below. A `stroke` traces the WHOLE path as one continuous
   outline (including around "place"'s punched-through hole, giving it the classic map-pin
   white ring), which a two-rectangle CSS cross could never do cleanly — two independently
   bordered/rotated boxes stacked on top of each other hid the crossing point under whichever
   one happened to paint last. */
.kiosk-selection-pin-icon,
.kiosk-selection-cross-icon {
    display: none;
    position: absolute;
    inset: 0;
    fill: #e53935;
    stroke: #fff;
    stroke-width: 1;
    stroke-linejoin: round;
    paint-order: stroke fill;
}

/* Pin/Cross replace the POI's own category glyph rather than sitting on top of it — the
   animation IS the selected state here, so a leftover icon underneath just clutters it.
   (Pulse — the default style — deliberately leaves the icon visible; it's a ring around the
   badge, not a stand-in for it.) */
.kiosk-selection-style-pin .kiosk-leaflet-pin.is-selected .kiosk-leaflet-pin-icon,
.kiosk-selection-style-cross .kiosk-leaflet-pin.is-selected .kiosk-leaflet-pin-icon {
    display: none;
}

/* Pin style — a red map-pin sits centered on the POI and bounces continuously in place for
   as long as the marker stays selected (never fades out — it must read as "alive", not a
   one-shot animation that freezes). The bounce lives on the wrapping .kiosk-selection-fx so it
   stays purely vertical on screen; the icon itself needs no separate rotation/transform since
   the "place" glyph is already drawn upright, point-down. */
.kiosk-selection-style-pin .kiosk-leaflet-pin.is-selected .kiosk-selection-fx {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(var(--kiosk-marker-size, 40px) * 0.55);
    height: calc(var(--kiosk-marker-size, 40px) * 0.55);
    margin-top: calc(var(--kiosk-marker-size, 40px) * -0.275);
    margin-left: calc(var(--kiosk-marker-size, 40px) * -0.275);
    z-index: 5;
    animation: kiosk-pin-bounce 1.2s ease-in-out infinite;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.kiosk-selection-style-pin .kiosk-leaflet-pin.is-selected .kiosk-selection-pin-icon {
    display: block;
}

@keyframes kiosk-pin-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

/* Cross style — a red "×" centered on the selected marker, pulsing continuously (scales up
   and back down) so it keeps drawing the eye without ever disappearing. */
.kiosk-selection-style-cross .kiosk-leaflet-pin.is-selected .kiosk-selection-fx {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(var(--kiosk-marker-size, 40px) * 0.5);
    height: calc(var(--kiosk-marker-size, 40px) * 0.5);
    margin-top: calc(var(--kiosk-marker-size, 40px) * -0.25);
    margin-left: calc(var(--kiosk-marker-size, 40px) * -0.25);
    z-index: 5;
    animation: kiosk-cross-pulse 1s ease-in-out infinite;
}

.kiosk-selection-style-cross .kiosk-leaflet-pin.is-selected .kiosk-selection-cross-icon {
    display: block;
}

@keyframes kiosk-cross-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.25); }
}

.kiosk-leaflet-cluster {
    background: transparent;
    border: none;
}

.kiosk-leaflet-cluster svg {
    overflow: visible;
}

.kiosk-leaflet-tooltip {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
}

.kiosk-leaflet-tooltip:before {
    display: none;
}

.map-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* POI Pins */
.poi-pin {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.poi-pin:hover {
    z-index: 20;
}

/* Category chips are clickable "buttons" too — follow the same "Velikost písma tlačítka"
   setting as the plain Vybrat vše / Zrušit výběr buttons, instead of the unstyled browser
   default they used before (that inconsistency was the actual bug, not intentional). */
.category-chip-custom {
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    font-size: var(--kiosk-button-font-size, 14px);
    min-height: var(--kiosk-sidebar-button-size, 44px);
    box-sizing: border-box;
}

.category-chip-custom .mud-icon-root {
    font-size: calc(var(--kiosk-button-font-size, 14px) * 1.3) !important;
}

.category-chip-custom.is-selected {
    border-color: rgba(0, 0, 0, 0.12);
}

.poi-search-item {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.poi-search-item-icon {
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.poi-search-item-icon-glyph {
    font-size: calc(var(--kiosk-poi-list-font-size, 13px) * 1.3) !important;
}

.poi-search-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--kiosk-poi-list-font-size, 13px);
    font-weight: 500;
}

.poi-search-item-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: calc(var(--kiosk-poi-list-font-size, 13px) * 0.85);
    opacity: 0.7;
}

/* POI Detail Panel */
.poi-detail-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.20), 0 2px 8px rgba(0,0,0,0.10);
    width: 100%;
    /* --kiosk-detail-max-height is set inline on the .poi-detail-float wrapper (KioskMode.razor),
       computed from the MAP AREA's own bounds, not the viewport — the map can be smaller than the
       viewport (e.g. a bottom bar), and this is what previously let a tall gallery push the panel
       out past the bottom of the map. calc(100vh - 80px) only remains as a fallback. */
    max-height: var(--kiosk-detail-max-height, calc(100vh - 80px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px) scale(0.96);
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
    will-change: transform, opacity;
}

.poi-detail-panel.poi-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) scale(1);
}

.poi-detail-float .poi-detail-panel.poi-visible {
    pointer-events: auto;
}

.poi-detail-panel > .mud-paper {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* POI marker display modes — one of these classes sits on .kiosk-fullscreen (Blazor,
   declarative) or on .kiosk-leaflet-container (JS); both are ancestors of every badge, so a
   descendant selector reaches unselected markers. .is-selected always overrides these (it's
   declared afterwards with equal-or-higher specificity), so a selected POI stays visible and
   highlighted even in Outline/Hidden mode. */

/* Dot — solid coloured circle, no icon glyph. */
.kiosk-poi-style-dot .kiosk-leaflet-pin-badge {
    background: var(--pin-color, #263f61) !important;
    border: 2px solid #fff !important;
}

.kiosk-poi-style-dot .kiosk-leaflet-pin-badge .kiosk-leaflet-pin-icon {
    display: none !important;
}

/* Outline — hollow ring only, transparent inside. */
.kiosk-poi-style-outline .kiosk-leaflet-pin-badge {
    background: transparent !important;
    border: 2px solid var(--pin-color, #263f61) !important;
    box-shadow: none !important;
}

.kiosk-poi-style-outline .kiosk-leaflet-pin-badge .kiosk-leaflet-pin-icon {
    display: none !important;
}

/* Hidden — fully invisible until selected (pairs well with the Pin/Cross selection styles). */
.kiosk-poi-style-hidden .kiosk-leaflet-pin-badge {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.kiosk-poi-style-hidden .kiosk-leaflet-pin-badge .kiosk-leaflet-pin-icon {
    display: none !important;
}

/* Expand arrow bar — hidden on desktop, shown as bottom-sheet handle on mobile */
.poi-expand-btn-bar {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 8px 0 4px;
    background: white;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition: background 0.15s;
}

.poi-expand-btn-bar:active {
    background: #f0f0f0;
}

.no-map-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

/* Bottom Bar */
.kiosk-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    font-size: 12px;
    color: #666;
}

/* Sidebar backdrop — visible only on small screens (CSS controls display) */
.sidebar-backdrop {
    display: none;
    transition: opacity 0.2s ease;
}

/* === Responsive === */

/* Medium screens: tighten spacing */
@media (max-width: 1200px) {
    .kiosk-layout {
        gap: 0;
        --kiosk-gap: 12px;
        padding: 12px;
    }
}

/* Tablet + mobile (≤ 1024px): sidebar and detail become overlays */
@media (max-width: 1024px) {
    .kiosk-layout {
        grid-template-columns: 1fr !important;
        padding: 0;
        gap: 0;
    }

    .map-area {
        border-radius: 0;
        height: 100%;
    }

    /* Sidebar: fixed left-side overlay */
    .category-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(340px, 82vw);
        z-index: 600;
        border-radius: 0 16px 16px 0;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
        padding: 16px;
        background: white;
        max-height: none;
        overflow-y: auto;
        margin-right: 0;
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.25s ease-out, opacity 0.25s ease-out;
    }

    .category-sidebar.sidebar-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* Semi-transparent backdrop behind sidebar */
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 599;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .sidebar-backdrop.backdrop-visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* Detail panel: bottom sheet — compact default, expands on button tap */
    .poi-detail-panel {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        height: auto !important;
        max-height: 45vh !important;
        z-index: 400;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.22) !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        transition: height 0.32s cubic-bezier(0.22, 1, 0.36, 1), transform 0.25s ease-out, opacity 0.25s ease-out !important;
        transform: translateY(100%) !important;
        opacity: 0 !important;
        pointer-events: none !important;
        margin-left: 0 !important;
    }

    .poi-detail-panel.poi-visible {
        transform: translateY(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .poi-detail-panel.poi-detail-expanded {
        max-height: 85vh !important;
    }

    .poi-detail-panel > .mud-paper {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        border-radius: 0 !important;
    }

    .poi-expand-btn-bar {
        display: flex;
        flex-shrink: 0;
        z-index: 1;
    }
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
    .sidebar-height-toggle {
        display: inline-flex !important;
    }

    .poi-detail-panel {
        max-height: 50vh !important;
    }

    .poi-detail-panel.poi-detail-expanded {
        max-height: 80vh !important;
    }

    .language-flag {
        width: 28px;
        height: 28px;
    }

    .lightbox-image {
        max-width: 96vw;
        max-height: 64vh;
    }
}

/* === Animations === */
@keyframes kiosk-slide-left {
    from { transform: translateX(-100%); opacity: 0.6; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes kiosk-slide-up {
    from { transform: translateY(100%); opacity: 0.7; }
    to   { transform: translateY(0);   opacity: 1; }
}

@keyframes kiosk-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* (bottom-sheet drag handle removed — replaced by poi-expand-btn-bar arrow button) */

/* Language Flags Overlay */
.language-flags-overlay {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Lower-left placement (#3638 point 3): within a child's reach. Anchored bottom-left and
   column-reverse so the toggle sits at the bottom and the dropdown opens upward above it. */
.language-flags-overlay-bottom-left {
    top: auto;
    right: auto;
    bottom: 30px;
    left: 30px;
    flex-direction: column-reverse;
    align-items: flex-start;
}

/* Lower-right placement: same upward-opening logic as bottom-left, mirrored. The zoom
   controls move out of the way to the bottom-left when this corner is chosen (#3638 point 3),
   see .kiosk-map-overlay-bottom-left. */
.language-flags-overlay-bottom-right {
    top: auto;
    left: auto;
    bottom: 30px;
    right: 30px;
    flex-direction: column-reverse;
    align-items: flex-end;
}

/* Bubble style nested in the top-left FAB stack (in normal flow, NOT position:absolute — the
   parent .kiosk-map-overlay-top-left-stack already owns that). The dropdown still floats over
   the map instead of push down the filter/keyboard FABs below it when opened. */
.language-flags-overlay-nested {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.language-flags-overlay-nested .lang-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
}

/* Alternate style: a plain in-flow flex row of flags with no toggle button, always visible.
   In the top-left corner this nests directly in .kiosk-map-overlay-top-left-stack (in-flow,
   stacked above the filter/keyboard FABs — see .lang-switcher-inline usage in
   KioskMapView.razor). Every other corner uses the standalone, absolutely-positioned
   .lang-switcher-inline-overlay wrapper below instead. */
.lang-switcher-inline {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.lang-switcher-inline-overlay {
    position: absolute;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: min(70vw, 640px);
}

.lang-switcher-inline-overlay-top-right {
    top: 30px;
    right: 30px;
    justify-content: flex-end;
}

.lang-switcher-inline-overlay-bottom-left {
    bottom: 30px;
    left: 30px;
    justify-content: flex-start;
}

.lang-switcher-inline-overlay-bottom-right {
    bottom: 30px;
    right: 30px;
    justify-content: flex-end;
}

/* Toggle button – same FAB style as the filter button */
.lang-toggle-btn {
    width: var(--kiosk-button-size, 56px);
    height: var(--kiosk-button-size, 56px);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #263F61;
    padding: 0;
    box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px 0 rgba(0,0,0,.14), 0 1px 18px 0 rgba(0,0,0,.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    transition: box-shadow 0.2s, background 0.2s;
    overflow: hidden;
}

.lang-toggle-btn:hover {
    background: #1a2d47;
    box-shadow: 0 5px 8px -1px rgba(0,0,0,.25), 0 8px 14px 0 rgba(0,0,0,.18);
}

.lang-toggle-btn .lang-flag-img {
    width: calc(var(--kiosk-button-size, 56px) * 0.57);
    height: calc(var(--kiosk-button-size, 56px) * 0.57);
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.lang-toggle-btn .flag-code {
    font-size: calc(var(--kiosk-button-size, 56px) * 0.2);
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    line-height: 1;
}

/* Down-caret built from two strokes that meet at the bottom centre. The box is
   sized to bound the glyph tightly so its centroid sits at the box centre — that
   way rotate(180deg) on open flips it to an up-caret without drifting up/down. */
.lang-toggle-chevron {
    display: block;
    width: 8px;
    height: 8px;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.lang-toggle-chevron::before,
.lang-toggle-chevron::after {
    content: '';
    position: absolute;
    top: 0;
    width: 9px;       /* long enough that the two strokes overlap at the tip (no gap) */
    height: 2px;
    background: rgba(255,255,255,0.92);
    border-radius: 2px;
}

.lang-toggle-chevron::before {
    left: 0;
    transform-origin: left top;
    transform: rotate(50deg);
}

.lang-toggle-chevron::after {
    right: 0;
    transform-origin: right top;
    transform: rotate(-50deg);
}

.lang-menu-open .lang-toggle-chevron {
    transform: rotate(180deg);
}

/* Bottom-anchored corners open the dropdown upward (column-reverse) instead of downward —
   mirror the chevron so its resting state points up (hinting the opening direction) and
   flips down once expanded, instead of the down-resting/up-open pointing used elsewhere. */
.language-flags-overlay-bottom-left .lang-toggle-chevron,
.language-flags-overlay-bottom-right .lang-toggle-chevron {
    transform: rotate(180deg);
}

.language-flags-overlay-bottom-left.lang-menu-open .lang-toggle-chevron,
.language-flags-overlay-bottom-right.lang-menu-open .lang-toggle-chevron {
    transform: rotate(0deg);
}

/* Dropdown panel with all flags. Scrolling lives on the INNER .lang-dropdown-scroll, not
   here — a scrollbar drawn directly inside a border-radius + overflow:hidden box still
   paints as a straight bar past the rounded corners in Chromium. Keeping this outer box as
   the only thing with border-radius/overflow:hidden clips the inner scrollbar to the pill
   shape instead of letting it poke out past the curve. */
.lang-dropdown {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px;
    border-radius: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.2s ease;
    padding-top: 0;
    padding-bottom: 0;
}

.lang-dropdown.lang-dropdown-open {
    /* Was a flat 300px — with many languages (56px flag + 6px gap each) that clipped the
       list after ~4-5 entries with no way to reach the rest. vh-based cap plus scroll keeps
       the open/close transition working for short lists while never hiding languages. */
    max-height: 70vh;
    opacity: 1;
    pointer-events: auto;
    padding-top: 8px;
    padding-bottom: 8px;
}

.lang-dropdown-scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    overflow-y: auto;
    /* overflow-y:auto alone forces overflow-x to "auto" too (a box can't be non-visible on
       one axis and visible on the other) — pin it to hidden explicitly since nothing here
       should ever need horizontal scroll. */
    overflow-x: hidden;
    /* Lets this flex child actually shrink to the outer box's capped height instead of
       forcing it taller (the flex default min-height is "auto", i.e. content size). */
    min-height: 0;
    /* Thin, rounded scrollbar matching the pill-shaped panel instead of the browser's
       default bar — Firefox via scrollbar-width/-color, Chromium via ::-webkit-scrollbar
       below (both needed, neither implements the other's API). */
    scrollbar-width: thin;
    scrollbar-color: rgba(38, 63, 97, 0.35) transparent;
}

.lang-dropdown-scroll::-webkit-scrollbar {
    width: 6px;
}

.lang-dropdown-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.lang-dropdown-scroll::-webkit-scrollbar-thumb {
    background: rgba(38, 63, 97, 0.35);
    border-radius: 3px;
}

.lang-dropdown-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(38, 63, 97, 0.55);
}

/* Dropdown flags are full-size tappable buttons — same diameter as the toggle button
   itself (--kiosk-button-size), not the smaller icon shown inside the toggle, so they
   stay easy to hit even though they sit high up on the display. */
.language-flag {
    width: var(--kiosk-button-size, 56px);
    height: var(--kiosk-button-size, 56px);
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.language-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.language-flag .flag-code {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: calc(var(--kiosk-button-size, 56px) * 0.35);
    font-weight: 700;
    text-transform: uppercase;
    background: #1976d2;
    color: white;
}

    .language-flag.active {
        /* Was border-color + an extra 1px box-shadow ring on top — permanently a bit
           chunky-looking, and the shadow (paints outside the border box, non-inset) had the
           exact same clipping issue inside the scrollable dropdown as the hover ring did.
           Border alone matches the hover treatment and can't be clipped. */
        border-color: #263F61;
    }

.language-flag:hover {
    transform: scale(1.12);
}

/* Inside the scrollable dropdown, transform:scale and a plain box-shadow ring both paint
   outside the flag's own border box and get clipped by the OUTER .lang-dropdown's rounded
   overflow:hidden. An inset box-shadow doesn't get clipped, but the <img> (100% width/height,
   filling the whole content box) paints on top of it and hides it completely — box-shadow is
   a background-layer effect, always behind content. The flag already reserves a 2px
   transparent border for exactly this (see .language-flag.active below) — border sits outside
   the content box, so the <img> can never cover it. Reuse that instead of inventing a new
   effect that fights the existing markup. */
.lang-dropdown-scroll .language-flag:hover {
    transform: none;
    border-color: #263F61;
}

/* Preview-size gallery: each image is shown at the kiosk-configured width with its
   height scaled automatically (no distortion). Images wrap onto the next line when two
   don't fit side by side. Fullscreen (lightbox) is still one tap away via the thumb. */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-thumb {
    flex: 0 0 auto;
    width: var(--kiosk-poi-image-width, 220px);
    max-width: 100%;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    background: #e0e0e0;
}

.gallery-thumb img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.2s;
}

.gallery-thumb:hover img {
    transform: scale(1.08);
}

/* Lightbox Overlay */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 90vw;
}

.lightbox-main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 80vw;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    user-select: none;
}

.lightbox-controls {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 80vw;
}

.lightbox-ctrl-slot {
    flex-shrink: 0;
    width: 52px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-nav {
    background: rgba(255, 255, 255, 0.18) !important;
    border-radius: 6px !important;
    transition: background 0.2s !important;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.38) !important;
}

.lightbox-counter {
    flex: 1;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.lightbox-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    max-width: 80vw;
    padding: 4px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.lightbox-thumb {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.55;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.lightbox-thumb.active {
    opacity: 1;
    border-color: white;
}

.lightbox-thumb:hover {
    opacity: 0.85;
}

.selectDisable {
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -o-user-select: none;
    user-select: none;
}

/* === Rich-text HTML content rendered from Quill editor === */

/* Title sits in a flex row next to the close button — it must be able to shrink */
.poi-html-title {
    min-width: 0;
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.poi-html-title p,
.poi-html-title h1,
.poi-html-title h2,
.poi-html-title h3 {
    display: inline;
    margin: 0;
    padding: 0;
}

.poi-html-description {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.poi-html-description p:first-child { margin-top: 0; }
.poi-html-description p:last-child  { margin-bottom: 0; }
.poi-html-description img           { max-width: 100%; border-radius: 4px; }
.poi-html-description a             { color: #1976d2; word-break: break-all; }

/* Quill saves both bullet and numbered lists as <ol><li data-list="...">; the
   marker itself (bullet vs number) is drawn by Quill's own CSS via the
   data-list attribute, not by real ul/ol semantics. Reproduce that here. */
.poi-html-description ul,
.poi-html-description ol {
    padding-left: 1.4em;
    margin: 0.4em 0;
    list-style: none;
}
.poi-html-description ol             { counter-reset: poi-ordered; }
.poi-html-description li[data-list="bullet"],
.poi-html-description li[data-list="ordered"] {
    position: relative;
}
.poi-html-description li[data-list="bullet"]::before {
    content: "•";
    position: absolute;
    left: -1em;
}
.poi-html-description li[data-list="ordered"] {
    counter-increment: poi-ordered;
}
.poi-html-description li[data-list="ordered"]::before {
    content: counter(poi-ordered) ".";
    position: absolute;
    left: -1.4em;
}

/* Quill emits formatting as class names (ql-align-*, ql-size-*, ql-indent-*) rather than
   inline styles or semantic tags. Quill's own stylesheet isn't loaded on the kiosk, so
   without these rules the description rendered as plain "Normal" text (#3638 point 10).
   Applied to both title and description. Inline color/background from Quill are already
   inline styles and need no rule here. */
.poi-html-title .ql-align-center,
.poi-html-description .ql-align-center { text-align: center; }
.poi-html-title .ql-align-right,
.poi-html-description .ql-align-right  { text-align: right; }
.poi-html-title .ql-align-justify,
.poi-html-description .ql-align-justify { text-align: justify; }

.poi-html-title .ql-size-small,
.poi-html-description .ql-size-small { font-size: 0.75em; }
.poi-html-title .ql-size-large,
.poi-html-description .ql-size-large { font-size: 1.5em; }
.poi-html-title .ql-size-huge,
.poi-html-description .ql-size-huge  { font-size: 2.5em; }

.poi-html-description .ql-indent-1 { padding-left: 3em; }
.poi-html-description .ql-indent-2 { padding-left: 6em; }
.poi-html-description .ql-indent-3 { padding-left: 9em; }
.poi-html-description .ql-indent-4 { padding-left: 12em; }
.poi-html-description .ql-indent-5 { padding-left: 15em; }

/* === Inactivity countdown (#3638 point 5) ===
   A small card in the lower-right corner. No full-screen backdrop / dimming, and the
   container is pointer-events:none so a tap anywhere on the map falls through to the map's
   background-click handler, which dismisses the countdown. Only the card itself is
   interactive. */
.inactivity-overlay {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 10000;
    pointer-events: none;
    animation: kiosk-fade-in 0.3s ease;
}

.inactivity-card {
    pointer-events: auto;
    background: white;
    border-radius: 16px;
    padding: 18px 22px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    animation: kiosk-scale-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.inactivity-countdown-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e3f2fd;
    border: 4px solid #1976d2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0 2px;
}

.inactivity-countdown-number {
    font-size: 1.7rem;
    font-weight: 700;
    color: #1976d2;
    line-height: 1;
}

/* "Classic" variant (#3638 point 5): the original full-screen, dimmed, centered card —
   kept as an admin-selectable alternative to the compact corner style above. */
/* inset:0 already overrides the compact style's right/bottom offsets — resetting them to auto
   afterwards left the element anchored to the top-left and sized by its content, so the card
   rendered in the corner and the dark backdrop covered only the card itself. */
.inactivity-overlay-classic {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.inactivity-card-classic {
    border-radius: 24px;
    padding: 52px 60px;
    max-width: 500px;
    width: 90vw;
    gap: 8px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.inactivity-countdown-ring-classic {
    width: 100px;
    height: 100px;
    border: 5px solid #1976d2;
    margin: 12px 0 4px;
}

.inactivity-countdown-number-classic {
    font-size: 2.6rem;
}

@keyframes kiosk-scale-in {
    from { transform: scale(0.82); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* === Video Overlay === */
.video-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: kiosk-fade-in 0.25s ease;
}

.video-overlay-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Video Thumbnail === */
/* Mirrors .gallery-grid: videos sit at the configured width and wrap onto the next line when
   more than one fits side by side, instead of always stacking one per row. */
.video-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.video-thumbnail {
    position: relative;
    flex: 0 0 auto;
    width: var(--kiosk-video-width, 100%);
    max-width: 100%;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #111;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.2s;
}

.video-thumbnail:hover .video-thumbnail-img,
.video-thumbnail:active .video-thumbnail-img {
    filter: brightness(0.78);
}

.video-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.video-play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.7));
    transition: transform 0.18s;
    pointer-events: none;
}

.video-thumbnail:hover .video-play-btn,
.video-thumbnail:active .video-play-btn {
    transform: scale(1.12);
}

/* ---------------------------------------------------------------------------
   On-screen virtual keyboard for POI search (#1583)
   Docked bottom-center, above the floating POI detail (z 1000) but below the
   inactivity dialog / lightbox (z 9998+).
   --------------------------------------------------------------------------- */
.kiosk-keyboard-overlay {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    /* Scales with the same ratio as key height (--kiosk-keyboard-scale = key size / 58), so a
       bigger key size grows the whole keyboard's width too, not just each key's height. */
    width: min(calc(960px * var(--kiosk-keyboard-scale, 1)), 94vw);
    z-index: 1200;
    /* Slightly tinted (not pure white) so the white keys read as distinct tiles instead of
       blending into the panel behind them. */
    background: #d7dce3;
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.38);
    padding: 6px 12px 12px;
}

.kiosk-keyboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 38px;
    cursor: move;
    touch-action: none;          /* let the drag handler own touch gestures */
    user-select: none;
    -webkit-user-select: none;
}

/* Leaves a little breathing room above the search box when it scrolls to top. */
.kiosk-search-section {
    scroll-margin-top: 10px;
}

/* Manual keyboard-open FAB — hidden in both kiosk and web mode since the keyboard now
   opens automatically on search-field focus (kiosk only). Kept in the DOM, not removed,
   in case the manual trigger is wanted back later. */
.kiosk-keyboard-fab-btn {
    display: none !important;
}

/* Sidebar heading text ("Filters", "Search POI") scales with the POI list font size,
   same as the search results below them — kiosk.css loads before MudBlazor.min.css
   (see index.html), so this needs !important to win over Mud's own same-specificity
   typography rules. */
.kiosk-sidebar-heading,
.kiosk-sidebar-heading .mud-icon-root {
    font-size: var(--kiosk-poi-list-font-size, 13px) !important;
}

/* Select-all/clear-selection buttons are sidebar "buttons" like the category chips,
   so they track the category/button font size setting, not the POI list one. */
.kiosk-sidebar-action-btn .mud-button-label {
    font-size: var(--kiosk-button-font-size, 14px) !important;
}

/* Scaling the search MudTextField's own font-size (and stopping there) clips the text
   against Mud's fixed dense-outlined input height/label position — the whole control
   needs to grow together. `zoom` re-lays-out the entire control (border, padding,
   adornment icon, floating label) proportionally, which a plain font-size override
   can't do since those dimensions live in Mud's own fixed CSS, not in em/rem units. */
.kiosk-poi-search-field {
    zoom: calc(var(--kiosk-poi-list-font-size, 13px) / 13px * 100%);
}

/* Grab affordance on the left of the header — same grip-dots as the POI detail panel. */
.kiosk-keyboard-grip {
    flex: 0 0 auto;
    width: 34px;
    height: 12px;
    margin-left: 8px;
    background-image: radial-gradient(#bdbdbd 1.5px, transparent 1.7px);
    background-size: 6px 6px;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.kiosk-keyboard-header:hover .kiosk-keyboard-grip,
.kiosk-keyboard-header:active .kiosk-keyboard-grip {
    opacity: 1;
}

.kiosk-keyboard-close {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    color: #555;
    padding: 2px 12px;
    border-radius: 8px;
}

.kiosk-keyboard-close:hover,
.kiosk-keyboard-close:active {
    background: rgba(0, 0, 0, 0.06);
}

/* simple-keyboard — enlarge keys for comfortable touch use */
.kiosk-keyboard-overlay .simple-keyboard.kiosk-hg-theme {
    background: transparent;
    padding: 0;
}

.kiosk-keyboard-overlay .simple-keyboard.kiosk-hg-theme .hg-button {
    height: var(--kiosk-keyboard-key-size, 58px);
    font-size: calc(var(--kiosk-keyboard-key-size, 58px) * 0.38);
    font-weight: 600;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #b8bfc8;
    /* Shadow on all edges (not just the old bottom-only hairline) so each key reads as a
       raised tile against the tinted keyboard background. */
    box-shadow: 0 3px 0 #b0b7c1, 0 4px 8px rgba(0, 0, 0, 0.22);
}

.kiosk-keyboard-overlay .simple-keyboard.kiosk-hg-theme .hg-button.kiosk-key-space {
    max-width: none;
    flex-grow: 6;
}

.kiosk-keyboard-overlay .simple-keyboard.kiosk-hg-theme .hg-button.kiosk-key-action {
    flex-grow: 1.4;
    background: #cfe2fb;
    border-color: #8fb8ee;
    box-shadow: 0 3px 0 #7ba6e3, 0 4px 8px rgba(0, 0, 0, 0.22);
}

.kiosk-keyboard-overlay .simple-keyboard.kiosk-hg-theme .hg-button:active {
    background: #c6dafc;
    transform: translateY(2px);
    box-shadow: 0 1px 0 #b0b7c1, 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* === Public web on a phone (#6710) ===
   Scoped to .web-mode (set by initWebLayout, never present on the kiosk) and placed last so it
   beats the equal-specificity kiosk rules above. Spacing follows the existing 4/8/12 steps. */
@media (max-width: 600px) {
    .web-mode .kiosk-map-overlay-top-left-stack,
    .web-mode .kiosk-map-overlay-top-right,
    .web-mode .kiosk-map-overlay-top-center,
    .web-mode .language-flags-overlay,
    .web-mode .lang-switcher-inline-overlay-top-right {
        top: 12px;
    }

    .web-mode .kiosk-map-overlay-top-left-stack,
    .web-mode .kiosk-map-overlay-bottom-left,
    .web-mode .lang-switcher-inline-overlay-bottom-left {
        left: 12px;
    }

    .web-mode .kiosk-map-overlay-top-right,
    .web-mode .kiosk-map-overlay-bottom-right,
    .web-mode .language-flags-overlay,
    .web-mode .lang-switcher-inline-overlay-top-right,
    .web-mode .lang-switcher-inline-overlay-bottom-right {
        right: 12px;
    }

    .web-mode .kiosk-map-overlay-bottom-left,
    .web-mode .kiosk-map-overlay-bottom-right,
    .web-mode .kiosk-map-overlay-bottom-center,
    .web-mode .lang-switcher-inline-overlay-bottom-left,
    .web-mode .lang-switcher-inline-overlay-bottom-right {
        bottom: 12px;
    }

    /* Language list: one row that fits the screen (scrolls sideways if there are many). */
    .web-mode .lang-switcher-inline,
    .web-mode .lang-switcher-inline-overlay {
        flex-wrap: nowrap;
        gap: 4px;
        max-width: calc(100vw - 24px);
        overflow-x: auto;
    }

    .web-mode .language-flag {
        width: 32px;
        height: 32px;
    }

    .web-mode .language-flag .flag-code {
        font-size: 12px;
    }
}
