:root {
  color-scheme: dark;
  --bg: #0b1016;
  --panel: #101821;
  --panel-2: #121d28;
  --panel-3: #182431;
  --line: #273442;
  --line-soft: rgba(154, 177, 199, 0.14);
  --text: #edf4fa;
  --muted: #91a2b3;
  --faint: #687b8d;
  --blue: #65b7ff;
  --blue-soft: rgba(101, 183, 255, 0.15);
  --green: #61d7a0;
  --orange: #ffb56c;
  --red: #ff7d7d;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
body { display: flex; flex-direction: column; }
button, input { font: inherit; }
button { color: inherit; }

.topbar {
  height: 68px; flex: 0 0 68px; display: flex; align-items: center; gap: 12px;
  padding: 0 22px; border-bottom: 1px solid var(--line-soft); background: #0d141c;
}
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #bde2ff; background: linear-gradient(145deg, #17304a, #12382f); font-size: 22px; }
.brand-copy h1 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.015em; }
.brand-copy p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.top-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; color: #bbc8d4; font-size: 12px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(97, 215, 160, .6); }

.app-shell { min-height: 0; flex: 1; display: grid; grid-template-columns: 310px minmax(0, 1fr); }
.camera-sidebar { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line-soft); background: #0e151d; }
.sidebar-heading { display: flex; align-items: flex-start; padding: 19px 16px 12px 18px; }
.sidebar-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.sidebar-heading p { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.icon-button { margin: -4px -4px 0 auto; width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 21px; cursor: pointer; }
.icon-button:hover { color: var(--text); background: var(--panel-3); }
.search-wrap { display: flex; align-items: center; gap: 8px; margin: 0 14px 12px; padding: 0 10px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #101922; color: var(--muted); }
.search-icon { font-size: 20px; transform: rotate(-20deg); }
.search-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
.search-wrap input::placeholder { color: #6e8090; }
.filter-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding: 0 14px 12px; }
.filter-button, .toolbar-button, .zoom-button { border: 1px solid var(--line); border-radius: 7px; background: #111a23; color: #aebdca; cursor: pointer; transition: .15s ease; }
.filter-button { min-width: 0; padding: 7px 5px; font-size: 10px; }
.filter-select { grid-column: 1 / -1; width: 100%; height: 31px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: #111a23; color: #aebdca; font: inherit; font-size: 10px; }
.filter-select:focus { outline: 1px solid #49627a; }
.filter-button:hover, .toolbar-button:hover, .zoom-button:hover { border-color: #49627a; background: #182634; color: var(--text); }
.filter-button.selected { border-color: rgba(101,183,255,.42); background: var(--blue-soft); color: #b7deff; }
.camera-list { min-height: 0; flex: 1; overflow: auto; padding: 0 9px 10px; scrollbar-color: #344553 transparent; scrollbar-width: thin; }
.country-heading { padding: 13px 8px 7px; color: #7f93a5; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.camera-row { position: relative; width: 100%; display: grid; grid-template-columns: 23px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.camera-row:hover { background: rgba(134, 164, 190, .08); }
.camera-row.active { border-color: rgba(101,183,255,.28); background: rgba(69, 133, 183, .16); }
.load-more { width: 100%; margin: 8px 0 3px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #111a23; color: #a9c8df; font-size: 10px; cursor: pointer; }
.load-more:hover { border-color: #49627a; background: #182634; }
.row-pin { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: #bde2ff; background: rgba(101,183,255,.15); font-size: 10px; }
.camera-row[data-country="HR"] .row-pin { color: #d3c5ff; background: rgba(167, 131, 255, .15); }
.row-copy { min-width: 0; }
.row-name { display: block; overflow: hidden; color: #dce7f0; font-size: 11px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.row-place { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.row-type { padding: 3px 5px; border: 1px solid rgba(97,215,160,.2); border-radius: 5px; color: #8addb8; font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.row-type-live { border-color: rgba(91,190,255,.35); color: #8fd0ff; background: rgba(91,190,255,.08); }
.row-type-seasonal { border-color: rgba(255,181,108,.28); color: #d8ac7d; background: rgba(255,181,108,.06); }
.map-marker.france-video { fill: #53c9ff; stroke: #e5f7ff; }
.empty-list { padding: 24px 10px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.sidebar-note { display: flex; align-items: flex-start; gap: 8px; margin: 8px 12px 13px; padding: 10px; border-radius: 8px; background: rgba(255,181,108,.08); color: #c0a27f; }
.note-mark { flex: 0 0 15px; height: 15px; display: grid; place-items: center; margin-top: 1px; border: 1px solid rgba(255,181,108,.38); border-radius: 50%; font-size: 9px; font-weight: 700; }
.sidebar-note p { margin: 0; font-size: 10px; line-height: 1.45; }
.france-sources { flex: 0 0 auto; margin: 0 12px 12px; border: 1px solid rgba(101,183,255,.18); border-radius: 8px; background: rgba(101,183,255,.035); }
.france-sources summary { padding: 9px 10px; color: #b7d9ef; font-size: 10px; font-weight: 650; cursor: pointer; }
.france-source-list { display: grid; gap: 3px; padding: 0 8px 8px; }
.france-source-list a { display: grid; gap: 3px; padding: 7px; border-radius: 6px; color: #d9e7f1; text-decoration: none; }
.france-source-list a:hover, .france-source-list a:focus-visible { outline: none; background: rgba(101,183,255,.09); }
.france-source-list strong { font-size: 10px; font-weight: 600; }
.france-source-list span { color: var(--muted); font-size: 9px; line-height: 1.4; }
.france-source-list p { margin: 4px 7px 0; color: #8596a5; font-size: 9px; line-height: 1.4; }

.content-area { min-height: 0; display: grid; grid-template-rows: minmax(290px, 1fr) minmax(260px, .85fr) 30px; gap: 9px; padding: 12px 14px 7px; }
.map-panel, .player-panel { min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); overflow: hidden; }
.panel-toolbar { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px 7px 17px; }
.map-heading .eyebrow, .selected-copy .eyebrow { color: #7890a5; font-size: 9px; font-weight: 750; letter-spacing: .14em; }
.map-heading h2 { margin: 2px 0 0; font-size: 14px; font-weight: 620; }
.town-search { display: flex; align-items: center; gap: 5px; min-width: 0; margin: 0 auto 0 22px; }
.town-search input { width: clamp(145px, 18vw, 230px); height: 29px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: #101922; color: var(--text); font-size: 10px; }
.town-search input:focus { border-color: #49627a; }
.town-search input::placeholder { color: #738596; }
.map-actions { display: flex; align-items: center; gap: 5px; }
.toolbar-button { padding: 6px 9px; font-size: 10px; white-space: nowrap; }
.toolbar-button[aria-pressed="true"] { border-color: rgba(101,183,255,.5); background: var(--blue-soft); color: #c3e4ff; }
.zoom-button { width: 27px; height: 27px; padding: 0; font-size: 17px; line-height: 1; }
.zoom-readout { min-width: 34px; color: #91a5b8; font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.map-canvas { position: relative; min-height: 0; flex: 1; overflow: hidden; background: #101e2a; }
#world-map { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
#world-map:focus { outline: none; }
#world-map.dragging { cursor: grabbing; }
.map-ocean { fill: #10202d; }
#terrain-tiles { display: none; }
.terrain-active #terrain-tiles { display: initial; }
.graticule-line { fill: none; stroke: #6f91aa; stroke-width: .55; opacity: .16; vector-effect: non-scaling-stroke; }
.land-path { fill: #253b49; stroke: #658094; stroke-width: .65; stroke-linejoin: round; opacity: .9; vector-effect: non-scaling-stroke; }
.terrain-active .land-path, .terrain-active .graticule-line, .terrain-active .place-label { display: none; }
.map-marker { cursor: pointer; stroke: #dff1ff; stroke-width: 1.5; vector-effect: non-scaling-stroke; transition: r .15s ease, filter .15s ease; }
.map-marker.world { fill: #ffc34d; }
.map-marker.italy { fill: #47e0c0; }
.map-marker.croatia { fill: #ff79a8; }
.cluster-bubble.clustered { stroke-width: 1.2; }
.cluster-label { fill: #071017; font-weight: 800; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.terrain-active .map-marker { stroke: #101820; stroke-width: 2.6; }
.terrain-active .cluster-bubble.clustered { stroke-width: 2.8; }
.terrain-active .selected-ring { stroke: #fff; stroke-width: 2.5; }
.place-label { fill: #d6e4ee; font-weight: 600; letter-spacing: .01em; paint-order: stroke; stroke: #10202d; stroke-width: 2.2px; stroke-linejoin: round; pointer-events: none; }
.selected-ring { fill: none; stroke: #ffdc83; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-marker:hover, .map-marker.selected { stroke-width: 2.3; }
.marker-hit { fill: transparent; cursor: pointer; }
.map-legend { position: absolute; right: 13px; bottom: 11px; display: flex; align-items: center; gap: 12px; padding: 7px 9px; border: 1px solid rgba(150,180,204,.16); border-radius: 7px; background: rgba(9,17,24,.8); color: #aebdca; font-size: 10px; backdrop-filter: blur(7px); }
.terrain-credit { align-items: center; gap: 5px; color: #d9e5ed; }
.terrain-credit[hidden] { display: none; }
.terrain-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.world { background: #ffc34d; }
.legend-dot.france-video { background: #53c9ff; }
.legend-hint { margin-left: 4px; color: #718396; }
.map-message { position: absolute; left: 12px; bottom: 11px; max-width: 45%; padding: 7px 9px; border: 1px solid rgba(101,183,255,.2); border-radius: 7px; background: rgba(10,19,27,.86); color: #a9c9e0; font-size: 10px; }
.mini-feed-strip { position: absolute; z-index: 4; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 7px; max-width: calc(100% - 24px); padding: 9px; border: 1px solid rgba(171,194,213,.28); border-radius: 9px; background: rgba(7,14,20,.94); box-shadow: 0 8px 28px rgba(0,0,0,.38); color: #e4edf4; pointer-events: auto; }
.mini-feed-strip[hidden] { display: none; }
.mini-feed-heading { display: flex; align-items: baseline; gap: 9px; font-size: 10px; }
.mini-feed-heading strong { font-size: 11px; }
.mini-feed-heading span { color: #a9bbc9; font-size: 9px; }
.mini-feed-list { display: flex; gap: 7px; overflow-x: auto; max-width: 100%; padding-bottom: 2px; }
.mini-feed-card { position: relative; flex: 0 0 154px; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 5px; border: 1px solid rgba(170,195,213,.25); border-radius: 7px; background: #111c26; color: #e7eff5; text-align: left; cursor: pointer; }
.mini-feed-card:hover, .mini-feed-card:focus-visible { border-color: #ffc34d; outline: none; background: #182632; }
.mini-feed-card video { display: block; width: 100%; height: 86px; border-radius: 4px; background: #03070a; object-fit: cover; }
.mini-feed-card .mini-feed-name { overflow: hidden; font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.mini-feed-card .mini-feed-location { overflow: hidden; color: #9aabba; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.mini-feed-card .mini-feed-state { position: absolute; top: 9px; left: 9px; padding: 3px 5px; border-radius: 4px; background: rgba(0,0,0,.72); color: #ffd18c; font-size: 8px; }
.mini-feed-card .mini-feed-state[hidden] { display: none; }

.player-title-row { min-height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 15px 7px 17px; }
.selected-copy { min-width: 0; }
.selected-copy h2 { overflow: hidden; margin: 2px 0 0; font-size: 14px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.selected-copy p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.player-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }
.provider-camera-select { max-width: 210px; height: 28px; padding: 0 7px; border: 1px solid rgba(91,190,255,.3); border-radius: 6px; background: #101922; color: #bfe6fb; font: inherit; font-size: 9px; }
.provider-camera-select[hidden] { display: none; }
.status-pill { padding: 4px 7px; border-radius: 5px; background: #202d38; color: #acbbc8; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.status-pill.loading { color: #ffd18c; background: rgba(255,181,108,.1); }
.status-pill.live { color: #8ae1b4; background: rgba(97,215,160,.12); }
.status-pill.error { color: #ffabab; background: rgba(255,125,125,.12); }
.video-wrap { position: relative; min-height: 0; flex: 1; margin: 0 10px 9px; overflow: hidden; border-radius: 8px; background: #05090d; }
#camera-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #05090d; }
#camera-video[hidden] { display: none; }
.camera-embed { display: block; width: 100%; height: 100%; border: 0; background: #05090d; }
.camera-embed[hidden] { display: none; }
.video-placeholder, .video-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 55%, #14232e 0%, #0a1016 65%); color: #8799a9; text-align: center; }
.video-placeholder[hidden], .video-error[hidden], .provider-note[hidden], .map-message[hidden] { display: none; }
.placeholder-symbol { width: 35px; height: 35px; display: grid; place-items: center; margin-bottom: 9px; padding-left: 2px; border: 1px solid #425667; border-radius: 50%; color: #a6c7df; font-size: 12px; }
.video-placeholder p { margin: 0; font-size: 11px; }
.video-error { padding: 16px; color: #e5a4a4; font-size: 11px; line-height: 1.5; }
.provider-note { padding: 6px 12px 8px; color: #bca783; font-size: 10px; line-height: 1.4; }
.privacy-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #748696; font-size: 9px; }
.privacy-footer a { flex: 0 0 auto; color: #8ebce0; text-decoration: none; }
.privacy-footer a:hover { color: #c5e5ff; text-decoration: underline; }

@media (max-width: 1100px) {
  .panel-toolbar { min-height: 86px; flex-wrap: wrap; padding-top: 7px; padding-bottom: 7px; }
  .town-search { order: 3; flex: 1 0 100%; margin: 0; }
  .town-search input { flex: 1; width: auto; }
  .map-actions { margin-left: auto; }
}

@media (max-width: 820px) {
  html, body { min-height: 100%; height: auto; overflow: auto; }
  .topbar { position: sticky; top: 0; z-index: 5; }
  .app-shell { display: flex; flex-direction: column; }
  .camera-sidebar { max-height: 310px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .camera-list { min-height: 90px; }
  .content-area { grid-template-rows: 360px 270px auto; }
  .map-legend { gap: 7px; font-size: 9px; }
  .legend-hint { display: none !important; }
  .mini-feed-strip { right: 12px; }
  .mini-feed-heading { flex-wrap: wrap; }
  .mini-feed-card { flex-basis: 132px; }
  .mini-feed-card video { height: 74px; }
  .provider-camera-select { max-width: 150px; }
}
