/* Slikopedia skin.

   Structure only: every colour is a token from slikopedia-themes.css, so a theme is
   a palette swap and dark mode is the palette's dark half. Restrained by intent: one
   subtle elevation for controls that float over the map, 6/8/12px radii, a 4px
   spacing scale, no blur, no motion beyond short colour transitions.

   Loaded last in <head> by Pages/Shared/_Theme.cshtml, after Bootstrap 3, Metronic
   and each page's inline <style>. !important appears only where Metronic or the
   legacy markup sets the same property itself (often inline). No element ids or
   classes are added to the markup; the scripts' DOM contract is untouched. */

:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --t-xs: 12px; --t-sm: 14px; --t-md: 16px; --t-lg: 18px; --t-xl: 24px;
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px;
  --header-h: 52px; --control-h: 36px;
  --dur: 120ms;
  --elev: 0 1px 2px var(--shadow-c), 0 2px 8px var(--shadow-c);
  --icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
}

/* ======================================================================= shared */

html, body { background: var(--bg) !important; }
body {
  color: var(--fg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
body, input, select, textarea, button, .btn, .dropdown-menu, .tt-dropdown-menu,
.header, .page-content, .page-sidebar, #toast-container {
  font-family: var(--font) !important;
}
/* Metronic sets every heading in Open Sans Light; use the site face and real weights. */
h1, h2, h3, h4, h5, h6 { font-family: var(--font) !important; color: var(--fg); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, label:focus-visible {
  outline: 2px solid var(--focus) !important; outline-offset: 2px;
}

/* Tabler icons: sit on the text baseline at roughly the cap height, and keep a fixed
   width in menus so labels line up (what Metronic did for Font Awesome). */
.ti { display: inline-block; vertical-align: -0.125em; font-size: 1.15em; line-height: 1; }
li > a > .ti:first-child { width: 1.25em; text-align: center; }
.input-icon > .ti { font-size: 16px; }

/* ---------- header: map page and dashboard ---------- */
.header.navbar-inverse {
  background: var(--header-bg) !important; border: 0 !important;
  border-bottom: 1px solid var(--header-border) !important;
  height: var(--header-h); min-height: var(--header-h);
}
/* Above the map's search box (z-index 9000), whose full-width box on a phone sits right
   under the header and covered the language and user menus; below fancybox (11000+).
   !important to beat style.css's own 9995 !important on .header.navbar-fixed-top. */
#top_div { z-index: 9500 !important; }
.header.navbar-inverse .header-inner { display: flex; align-items: center; height: var(--header-h); width: 100%; }
.header.navbar-inverse .navbar-brand {
  display: inline-flex !important; align-items: center; gap: var(--s-2); float: none;
  height: var(--header-h); padding: 0 var(--s-5) 0 var(--s-4) !important; margin: 0 !important;
  color: var(--header-fg) !important; font-size: var(--t-lg) !important; font-weight: 600; letter-spacing: -0.01em;
}
.header.navbar-inverse .navbar-brand::before {
  content: "\ea54"; font-family: "tabler-icons"; font-weight: normal; font-size: 17px; color: var(--brand-mark);
}
.header.navbar-inverse .navbar-nav {
  display: flex !important; flex-direction: row !important; flex-wrap: nowrap;
  align-items: center; gap: var(--s-1);
  float: none !important; margin: 0 var(--s-3) 0 auto !important;
}
.header.navbar-inverse .navbar-nav > li { float: none !important; display: block; position: relative; margin: 0 !important; }
.header.navbar-inverse .navbar-nav > li > a {
  display: inline-flex !important; align-items: center; gap: var(--s-2);
  height: var(--control-h); margin: 0 !important; padding: 0 var(--s-3) !important;
  border-radius: var(--r-sm) !important;
  color: var(--header-fg) !important; background: transparent !important;
  font-size: var(--t-sm) !important; font-weight: 500; line-height: 1;
  transition: background-color var(--dur) ease;
}
.header.navbar-inverse .navbar-nav > li > a:hover,
.header.navbar-inverse .navbar-nav > li.open > a { background: var(--header-hover) !important; }
.header.navbar-inverse .navbar-nav .ti-chevron-down { color: var(--header-fg-2) !important; font-size: var(--t-sm); }
.header.navbar-inverse .navbar-nav > li > a.uploadpicfancybox {
  background: var(--hdr-primary) !important; color: var(--hdr-primary-fg) !important;
  font-weight: 600; padding: 0 var(--s-4) !important;
}
.header.navbar-inverse .navbar-nav > li > a.uploadpicfancybox:hover { background: var(--hdr-primary-hover) !important; }
/* Company 5 (Drinkadria) forces a white header with black links from an inline
   block on the map page; keep the upload button's own text colour readable there. */
#top_div .navbar-nav > li > a.uploadpicfancybox { color: var(--hdr-primary-fg) !important; }
.header.navbar-inverse .flag-icon { font-size: 15px; border-radius: 2px; }
.header.navbar-inverse .dropdown.user img {
  width: 28px !important; height: 28px !important; margin: 0 !important;
  border-radius: 50% !important; object-fit: cover;
}
.header.navbar-inverse .username { color: inherit !important; }
.header.navbar-inverse .navbar-toggle { margin: 0 var(--s-2) 0 0; }
.header.navbar-inverse .navbar-toggle img { display: none; }
.header.navbar-inverse .navbar-toggle::before { content: "\ec42"; font-family: "tabler-icons"; font-size: 18px; color: var(--header-fg); }

/* ---------- menus ---------- */
.dropdown-menu {
  background: var(--surface) !important; border: 1px solid var(--border) !important;
  border-radius: var(--r-md) !important; box-shadow: var(--elev) !important;
  padding: var(--s-1) !important; margin-top: var(--s-1) !important; min-width: 208px;
}
.dropdown-menu:before, .dropdown-menu:after { display: none !important; }
.dropdown-menu > li > a {
  display: flex !important; align-items: center; gap: var(--s-2);
  min-height: var(--control-h); padding: 0 var(--s-3) !important;
  border-radius: var(--r-sm); color: var(--fg) !important; font-size: var(--t-sm) !important;
}
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { background: var(--surface-2) !important; color: var(--fg) !important; }
.dropdown-menu > li > a > i { color: var(--fg-2) !important; width: 16px; }
.dropdown-menu .divider { background: var(--border) !important; margin: var(--s-1) 0 !important; }

/* ---------- controls shared by every page ---------- */
.form-control {
  background: var(--surface) !important; color: var(--fg) !important;
  border: 1px solid var(--border-strong) !important; border-radius: var(--r-sm) !important;
  box-shadow: none !important; font-size: var(--t-sm);
}
.form-control::placeholder { color: var(--fg-2) !important; }
.form-control:focus { border-color: var(--focus) !important; outline: 2px solid var(--focus); outline-offset: 0; }
.btn {
  border-radius: var(--r-sm) !important; border: 1px solid var(--border-strong) !important;
  background: var(--surface) !important; color: var(--fg) !important;
  font-weight: 500; box-shadow: none !important; text-shadow: none !important;
  transition: background-color var(--dur) ease;
}
.btn:hover { background: var(--surface-2) !important; }
.btn.blue, .btn.green, .btn-primary, .btn-info, .btn-success {
  background: var(--primary) !important; color: var(--primary-fg) !important; border-color: var(--primary) !important;
}
.btn.blue:hover, .btn.green:hover, .btn-primary:hover, .btn-info:hover, .btn-success:hover { background: var(--primary-hover) !important; }
.btn.red, .btn-danger, .btn-warning {
  background: var(--loc-tint) !important; color: var(--loc-fg) !important; border-color: transparent !important;
}
.btn i[class^="m-icon-"] { display: none; }

/* ---------- gallery and dialogs (fancybox 1.3.4) ----------
   Controls live on the backdrop, not on the photo: close in the window's corner,
   previous/next at the window's edges. Thin-stroke icons drawn with mask-image so
   they take currentColor; 44px targets; a dark fill that reads on photo and scrim. */
:root {
  --lb-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
  --lb-prev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E");
  --lb-next: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
}
#fancybox-overlay { background-color: var(--scrim) !important; opacity: .97 !important; }
#fancybox-outer { background: transparent !important; box-shadow: none !important; }
.fancybox-bg { display: none !important; }
#fancybox-content { border-radius: var(--r-lg) !important; overflow: hidden; }
#fancybox-frame { background: var(--surface); }
#fancybox-title-over {
  background: linear-gradient(to top, rgba(0,0,0,.8), rgba(0,0,0,0)) !important;
  padding: var(--s-6) var(--s-4) var(--s-3) !important;
  font: 400 var(--t-sm)/1.5 var(--font) !important; color: #fff;
}
#fancybox-close, #fancybox-left-ico, #fancybox-right-ico {
  position: fixed !important; z-index: 11010 !important;
  width: 44px !important; height: 44px !important; margin: 0 !important;
  display: inline-flex !important; align-items: center; justify-content: center;
  border-radius: var(--r-md) !important;
  background: rgba(0, 0, 0, .42) none !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .9); cursor: pointer;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}
#fancybox-close:hover, #fancybox-left:hover #fancybox-left-ico, #fancybox-right:hover #fancybox-right-ico {
  background-color: rgba(0, 0, 0, .64) !important; color: #fff;
}
#fancybox-close::before, #fancybox-left-ico::before, #fancybox-right-ico::before {
  content: ""; width: 22px; height: 22px; background-color: currentColor;
  -webkit-mask: var(--lb-icon) center / contain no-repeat; mask: var(--lb-icon) center / contain no-repeat;
}
#fancybox-close { top: var(--s-4) !important; right: var(--s-4) !important; --lb-icon: var(--lb-x); }
#fancybox-left-ico, #fancybox-right-ico { top: 50% !important; margin-top: -22px !important; }
#fancybox-left-ico { left: var(--s-4) !important; right: auto !important; --lb-icon: var(--lb-prev); }
#fancybox-right-ico { right: var(--s-4) !important; left: auto !important; --lb-icon: var(--lb-next); }

/* Map in the gallery (map/galleryMap.js): a toggle beside the close button, and a panel
   along the right edge - the bottom on a narrow window - that the photo is fitted beside.
   Laid out while the first photo loads, so that it can be measured; shown with it.
   The photo and the map take the whole window, edge to edge with nothing between them,
   and the controls sit on top of them. */
:root { --gm-w: clamp(240px, 30vw, 480px); --gm-h: clamp(160px, 38vh, 320px); }
/* Read by galleryMap.js: the margin fancybox keeps around the photo, and the gap
   between the photo and the panel. Without this skin fancybox keeps its own 40px. */
:root { --lb-margin: 0px; --gm-gap: 0px; }
#fancybox-content { border-radius: 0 !important; }
.sp-gm-toggle, .sp-gm-panel { display: none; opacity: 0; pointer-events: none; transition: opacity 150ms ease; }
.sp-gm-active .sp-gm-toggle { display: inline-flex; }
.sp-gm-active.sp-gm-on .sp-gm-panel { display: block; }
.sp-gm-shown .sp-gm-toggle, .sp-gm-shown .sp-gm-panel { opacity: 1; pointer-events: auto; }
.sp-gm-toggle {
  position: fixed; z-index: 11010; top: var(--s-4); right: calc(var(--s-4) + 44px + var(--s-2));
  width: 44px; height: 44px; padding: 0; align-items: center; justify-content: center;
  border: 0; border-radius: var(--r-md);
  background: rgba(0, 0, 0, .42); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .9); font-size: 22px; cursor: pointer;
  transition: opacity 150ms ease, background-color var(--dur) ease, color var(--dur) ease;
}
.sp-gm-toggle:hover { background: rgba(0, 0, 0, .64); color: #fff; }
.sp-gm-toggle[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); box-shadow: none; }
.sp-gm-toggle[aria-pressed="true"]:hover { background: var(--primary-hover); }
.sp-gm-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* The panel runs under the close button, which is inside #fancybox-wrap (11001), so it sits
   below the wrap - level with the overlay, and above it by coming later in the page. The
   wrap's transparent 20px padding overlaps the map, so it lets clicks through. */
.sp-gm-panel {
  position: fixed; z-index: 11000;
  top: 0; right: 0; bottom: 0; width: var(--gm-w);
  overflow: hidden; background: var(--surface-2);
}
#fancybox-wrap { pointer-events: none; }
#fancybox-outer { pointer-events: auto; }
.sp-gm-map { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.sp-gm-empty {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2);
  padding: var(--s-4); background: rgba(0, 0, 0, .6); color: #fff;
  font: 400 var(--t-sm)/1.5 var(--font); text-align: center;
}
.sp-gm-empty .ti { font-size: 28px; opacity: .8; }
.sp-gm-nolocation .sp-gm-empty { display: flex; }
.sp-gm-active.sp-gm-on #fancybox-right-ico { right: calc(var(--gm-w) + var(--s-4)) !important; }
@media (max-width: 720px) {
  .sp-gm-panel { top: auto; left: 0; width: auto; height: var(--gm-h); }
  .sp-gm-active.sp-gm-on #fancybox-right-ico { right: var(--s-4) !important; }
}

/* Zoom in the gallery (appViewModel/galleryZoom.js). Fancybox's invisible previous/next
   halves over the photo would take its clicks, drags and double clicks, so only the arrow
   buttons go back and forward. The photo takes touches itself, for pinch and double tap. */
#fancybox-left, #fancybox-right { pointer-events: none; }
#fancybox-left-ico, #fancybox-right-ico { pointer-events: auto; }
.sp-zoom-active #fancybox-content, .sp-zoom-active #fancybox-overlay { touch-action: none; }
.sp-zoomed #fancybox-content { cursor: grab; }
.sp-zoom-dragging #fancybox-content { cursor: grabbing; }
.sp-zoom-active #fancybox-img { transform-origin: 0 0; }
.sp-zoom-pixels #fancybox-img { image-rendering: pixelated; }
/* laid over the photo and kept to it while zoomed; the properties are galleryZoom's */
.sp-zoom-follow {
  position: absolute; left: var(--sp-zoom-x, 0px); top: var(--sp-zoom-y, 0px);
  width: calc(100% * var(--sp-zoom-s, 1)); height: calc(100% * var(--sp-zoom-s, 1));
  transition: left var(--sp-zoom-dur, 0ms) ease, top var(--sp-zoom-dur, 0ms) ease,
              width var(--sp-zoom-dur, 0ms) ease, height var(--sp-zoom-dur, 0ms) ease;
}
.sp-zoom-bar {
  position: fixed; z-index: 11010; top: var(--s-4); left: var(--s-4);
  display: none; align-items: center; gap: var(--s-1); height: 44px; padding: 0 var(--s-1) 0 var(--s-3);
  border-radius: var(--r-md); background: rgba(0, 0, 0, .42); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .9); font: 500 var(--t-sm)/1 var(--font); font-variant-numeric: tabular-nums;
}
.sp-zoomed .sp-zoom-bar { display: inline-flex; }
.sp-zoom-fit {
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: inherit; font-size: 20px; cursor: pointer;
}
.sp-zoom-fit:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.sp-zoom-fit:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

#toast-container > div { border-radius: var(--r-md) !important; box-shadow: var(--elev) !important; opacity: 1 !important; }

/* ===================================================================== map page */

/* search: typeahead wraps the input, so the wrapper is the visible control. Its z-index is
   !important because typeahead.js-bootstrap.css forces 10000 !important, above the header. */
#mid_div > .twitter-typeahead {
  position: absolute !important; top: var(--s-3) !important; left: var(--s-3) !important; z-index: 9000 !important;
  display: block !important; width: 360px; height: 40px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md) !important; box-shadow: var(--elev);
}
/* Drawn as an SVG mask rather than a Font Awesome glyph: the upload dialog's map
   uses the same search control and that page does not load Font Awesome. */
#mid_div > .twitter-typeahead::before, #right .map > .map-search::before {
  content: ""; position: absolute; left: var(--s-3); top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; background-color: var(--fg-2); z-index: 3; pointer-events: none;
  -webkit-mask: var(--icon-search) center / contain no-repeat; mask: var(--icon-search) center / contain no-repeat;
}
#mid_div > .twitter-typeahead:focus-within { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 1px; }
#mid_div > .twitter-typeahead > input, #addresssearchvalue {
  position: absolute !important; top: 0 !important; left: 0 !important;
  width: 100% !important; height: 100% !important; margin: 0 !important;
  padding: 0 var(--s-3) 0 38px !important; border: 0 !important; border-radius: inherit !important;
  background: transparent none !important; box-shadow: none !important; outline: none !important;
  color: var(--fg); font-size: var(--t-md) !important;
}
/* typeahead's hint is a read-only copy of the box, drawn behind it for the grey completion.
   The legacy typeahead.js-bootstrap.css lifts it to z-index 10000, above the box itself, so it
   took every click - with Bootstrap's not-allowed cursor for [readonly] - and nothing could
   be typed. It goes back behind the box, and lets clicks through wherever it is. */
.twitter-typeahead > .tt-hint { pointer-events: none !important; }
#mid_div > .twitter-typeahead > .tt-hint { color: var(--fg-2) !important; opacity: .6 !important; z-index: 0 !important; }
#addresssearchvalue::placeholder { color: var(--fg-2); }
.tt-dropdown-menu {
  background: var(--surface) !important; border: 1px solid var(--border) !important;
  border-radius: var(--r-md) !important; box-shadow: var(--elev) !important;
  padding: var(--s-1) !important; margin-top: var(--s-1); color: var(--fg); font-size: var(--t-sm);
}
.tt-suggestion { border-radius: var(--r-sm); padding: var(--s-2) var(--s-3) !important; }
.tt-suggestion.tt-is-under-cursor { background: var(--surface-2) !important; color: var(--fg) !important; }
/* the dropdown's two sections: entries to pick (tags, detected objects), then descriptions */
.sp-tt-header {
  padding: var(--s-2) var(--s-3) var(--s-1); color: var(--fg-2);
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.sp-tt-entry { display: flex; align-items: center; gap: var(--s-2); }
.sp-tt-icons { display: inline-flex; gap: 2px; color: var(--fg-2); }
.sp-tt-label { flex: 1 1 auto; }
.sp-tt-count { color: var(--fg-2); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
/* Search results: kept inside the map (it ran off the bottom of the window with many
   results) and scrolled within, under a header that stays put. Results sit in an even
   grid of same-sized tiles rather than floated thumbnails of mixed widths. */
#searchresult {
  top: 60px !important; left: var(--s-3) !important;
  width: min(500px, calc(100% - 2 * var(--s-3))) !important;
  max-height: calc(100% - 60px - var(--s-3)); overflow-y: auto; overscroll-behavior: contain;
  padding: 0 var(--s-3) var(--s-3) !important; margin: 0 !important;
  background: var(--surface) !important; color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--r-lg) !important; box-shadow: var(--elev) !important;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
#searchresult .sp-search-head {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) 0 var(--s-2); background: var(--surface);
}
#searchresult .sp-search-title { font-size: var(--t-sm); font-weight: 600; }
#searchresult .sp-search-count { color: var(--fg-2); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
#searchresult .sp-search-head .close { margin-left: auto; float: none; }
#searchresult .sp-search-none { padding: var(--s-2) 0; color: var(--fg-2); font-size: var(--t-sm); }
#searchresult .items {
  display: grid; gap: var(--s-2);
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
#searchresult .myPic {
  float: none; margin: 0 !important; cursor: pointer; background: var(--surface-2);
  outline: 2px solid transparent; outline-offset: -2px; transition: outline-color var(--dur) ease;
}
#searchresult .myPic:hover { outline-color: var(--focus); }
/* an entry picked from the search list, beside the search pill; clicking removes it */
#bottom_div .label.sp-search-pick {
  background: var(--tint) !important; color: var(--tint-fg) !important; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--tint-border);
}

/* layers: Hybrid is an on/off toggle, the base layers one segmented choice */
#mid_div #baselayers {
  top: var(--s-3); right: var(--s-3); gap: 0; align-items: stretch;
  filter: drop-shadow(0 1px 2px var(--shadow-c)) drop-shadow(0 2px 6px var(--shadow-c));
}
#mid_div #baselayers .vertical { flex-direction: row; gap: 0; }
#mid_div #baselayers .layerswitcher_button,
#mid_div #overlaylayers .layerswitcher_button {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--control-h) !important; padding: 0 var(--s-3) !important; margin: 0 !important;
  background: var(--surface) !important; color: var(--fg) !important;
  border: 1px solid var(--border-strong); border-left-width: 0; border-radius: 0 !important;
  font-size: var(--t-sm) !important; font-weight: 500; text-transform: none !important; white-space: nowrap;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}
#mid_div #baselayers .layerswitcher_button:hover { background: var(--surface-2) !important; }
#mid_div #baselayers #btn_ly_lidar { border-left-width: 1px; border-radius: var(--r-md) 0 0 var(--r-md) !important; }
#mid_div #baselayers #btn_ly_ortophoto2012 { border-radius: 0 var(--r-md) var(--r-md) 0 !important; }
#mid_div #baselayers .layerswitcher_button.active:not(.hybrid) {
  background: var(--selected) !important; color: var(--selected-fg) !important; border-color: var(--selected);
}
#mid_div #baselayers #btn_ly_hybrid { border-left-width: 1px; border-radius: var(--r-md) !important; margin-right: var(--s-2) !important; }
#mid_div #baselayers #btn_ly_hybrid::before { content: "\eb2c"; font-family: "tabler-icons"; font-size: 15px; color: var(--fg-2); }
#mid_div #baselayers #btn_ly_hybrid.active { background: var(--tint) !important; color: var(--tint-fg) !important; border-color: var(--tint-border); }
#mid_div #baselayers #btn_ly_hybrid.active::before { content: "\eb28"; color: var(--tint-fg); }
#mid_div #overlaylayers .layerswitcher_button { border-left-width: 1px; border-radius: var(--r-md) !important; margin-bottom: var(--s-1) !important; }

/* OpenLayers controls */
#mid_div .ol-control { background: transparent !important; padding: 0 !important; border-radius: 0; }
#mid_div .ol-zoom {
  top: auto !important; left: auto !important; right: var(--s-3) !important; bottom: var(--s-4) !important;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface) !important; border: 1px solid var(--border-strong);
  border-radius: var(--r-md) !important; box-shadow: var(--elev);
}
#mid_div .ol-control button {
  width: var(--control-h) !important; height: var(--control-h) !important; margin: 0 !important;
  background: var(--surface) !important; color: var(--fg) !important;
  font-size: 19px !important; font-weight: 400 !important; border-radius: 0 !important;
}
#mid_div .ol-zoom .ol-zoom-in { border-bottom: 1px solid var(--border) !important; }
#mid_div .ol-control button:hover { background: var(--surface-2) !important; }
/* Status row, bottom-left: copyright (i), scale bar, cursor lat/lon. Kept faint in
   OpenLayers' own translucent blue so it reads as part of the map rather than as
   controls; only the (i) takes the pointer. Zoom keeps the bottom-right to itself. */
#mid_div .map-statusbar {
  --map-chip: rgba(0, 60, 136, .3); --map-chip-strong: rgba(0, 60, 136, .5);
  position: absolute; left: var(--s-3); bottom: var(--s-3); right: calc(var(--s-3) + 38px + var(--s-3));
  display: flex; align-items: center; gap: var(--s-1); pointer-events: none;
}
#mid_div .map-statusbar > * { position: static !important; }
#mid_div .map-statusbar .ol-attribution {
  display: flex; align-items: center; max-width: none; min-width: 0; pointer-events: auto;
  background: transparent !important; border-radius: 0;
}
#mid_div .map-statusbar .ol-attribution button {
  order: -1; width: 20px !important; height: 20px !important;
  background: var(--map-chip-strong) !important; color: #fff !important;
  font-size: var(--t-xs) !important; font-weight: 700 !important; border: 0 !important; border-radius: 4px !important;
}
#mid_div .map-statusbar .ol-attribution button:hover { background: rgba(0, 60, 136, .7) !important; }
#mid_div .map-statusbar .ol-attribution ul {
  min-width: 0; margin-left: var(--s-1); padding: 2px var(--s-2); line-height: 16px; text-align: left;
  background: var(--surface); color: var(--fg); text-shadow: none; border-radius: 4px;
}
#mid_div .map-statusbar .ol-scale-line { background: var(--map-chip); border-radius: 4px; }
#mid_div .map-statusbar .ol-mouse-position {
  padding: 2px 6px; background: var(--map-chip); color: #eee; border-radius: 4px;
  font-size: 11px; line-height: 16px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
#mid_div .map-statusbar .ol-mouse-position:empty { display: none; }
/* Touch screens: no hovering pointer, so no position to show, and pinch zooms, so the
   +/- buttons only cover the map. Laptops with a touchscreen still report hover. */
@media (hover: none) {
  #mid_div .map-statusbar .ol-mouse-position,
  #mid_div .ol-zoom { display: none; }
}

/* photo strip: a flat panel; hierarchy from spacing and type */
#bottom_div {
  background: var(--surface) !important; color: var(--fg);
  border-top: 1px solid var(--border); box-shadow: none !important;
  padding: var(--s-3) var(--s-4) var(--s-2) !important;
}
#bottom_div.timeFilter { box-shadow: inset 0 2px 0 var(--ok) !important; background: var(--surface) !important; }
#bottom_div.itemsHover { box-shadow: inset 0 2px 0 var(--loc) !important; background: var(--surface) !important; }
/* One row, always. The panel's height is fixed (205px inline) and exactly filled by this
   row and the strip, so a second line of pills pushed it past the window and gave the
   page a scrollbar whenever a filter chip appeared. Now the chips keep their place and
   the decade pills scroll sideways; the row's height is fixed too, so the pills' thin
   scrollbar hangs into the gap below it instead of adding height. */
#bottom_div > div:first-child {
  display: flex; align-items: flex-start; flex-wrap: nowrap; gap: var(--s-2);
  height: 32px; margin-bottom: var(--s-3);
}
#bottom_div > div:first-child > span { flex: none; }
#bottom_div > div:first-child > div[style*="clear"] { display: none; }
#bottom_div .label {
  float: none !important; margin: 0 !important;
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 var(--s-3) !important;
  border-radius: var(--r-sm) !important; font-size: var(--t-sm) !important; font-weight: 500 !important;
}
#bottom_div .label[style*="display: none"] { display: none !important; }
#bottom_div > div:first-child > span:nth-of-type(1) { background: var(--ok-tint) !important; color: var(--ok-fg) !important; }
#bottom_div > div:first-child > span:nth-of-type(2) { background: var(--loc-tint) !important; color: var(--loc-fg) !important; }
#bottom_div > div:first-child > span:nth-of-type(3) {
  background: transparent !important; color: var(--fg) !important; box-shadow: inset 0 0 0 1px var(--border-strong);
}
#bottom_div .nav-pills {
  display: flex; align-items: center; flex-wrap: nowrap; gap: var(--s-2); margin: 0 !important;
  flex: 1 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
#bottom_div .nav-pills > li { float: none; margin: 0 !important; flex: none; }
#bottom_div .nav-pills > li > a {
  display: inline-flex !important; align-items: center; gap: var(--s-2); height: 32px;
  padding: 0 var(--s-3) !important; border-radius: var(--r-sm) !important;
  background: var(--surface-2) !important; color: var(--fg) !important;
  font-size: var(--t-sm); font-weight: 500; transition: background-color var(--dur) ease;
}
#bottom_div .nav-pills > li > a:hover { background: var(--surface-3) !important; }
#bottom_div .nav-pills > li.active > a { background: var(--tint) !important; color: var(--tint-fg) !important; box-shadow: inset 0 0 0 1px var(--tint-border); }
#bottom_div .nav-pills .badge {
  order: 2; float: none !important; margin: 0 !important; padding: 0 !important;
  background: transparent !important; color: var(--fg-2) !important;
  font-size: var(--t-sm) !important; line-height: 1 !important; font-weight: 400 !important;
  position: static !important; vertical-align: baseline !important; font-variant-numeric: tabular-nums;
}
#bottom_div .nav-pills > li.active > a .badge { color: var(--tint-fg) !important; opacity: .8; }
#bottom_div .nav-pills > li > span { padding: 0 var(--s-1) 0 var(--s-3) !important; color: var(--fg-2); font-size: var(--t-sm); }
/* The strip scrolls natively, sideways (the pictureStrip binding turns the wheel). Its
   row is exactly as wide as the thumbnails, which is how the binding sees the end near.
   The height leaves room under the thumbnails for the thin scrollbar. */
#bottom_div div.scrollable {
  height: 141px; padding-top: 2px;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
#bottom_div div.scrollable > .items { display: flex; flex-wrap: nowrap; width: max-content; }
#bottom_div .myPic {
  flex: none;
  margin: 0 var(--s-2) 0 0 !important; border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface-2); cursor: pointer;
  outline: 2px solid transparent; outline-offset: -2px; transition: outline-color var(--dur) ease;
}
#bottom_div .myPic:hover { outline-color: var(--focus); }
#bottom_div .myPicThumbnail {
  display: block; height: 128px; width: auto; min-width: 96px; max-width: 240px; object-fit: cover;
}
#searchresult .myPicThumbnail { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
/* Placeholders: tiles for pictures still to come, and thumbnails still loading, which
   keep a landscape tile's width until they have their own. One that cannot load keeps
   the tile and says so. */
#bottom_div .sp-pic-ghost { height: 128px; cursor: default; }
#bottom_div .sp-pic-ghost:hover { outline-color: transparent; }
#bottom_div .sp-pic-ghost, #bottom_div .sp-pic-loading { animation: sp-pic-pulse 1.6s ease-in-out infinite; }
#bottom_div .sp-pic-loading .myPicThumbnail, #bottom_div .sp-pic-missing .myPicThumbnail { width: 171px; opacity: 0; }
#bottom_div .sp-pic-missing::before {
  content: "\ecf6"; font-family: "tabler-icons"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--fg-2); opacity: .6;
}
@keyframes sp-pic-pulse { 50% { background-color: var(--surface-3); } }
@media (prefers-reduced-motion: reduce) {
  #bottom_div .sp-pic-ghost, #bottom_div .sp-pic-loading { animation: none; }
}
#bottom_div .myPicTitle, #searchresult .myPicTitle {
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0)) !important;
  opacity: 1 !important; padding: var(--s-5) var(--s-2) var(--s-2) !important;
  font-size: var(--t-xs); font-weight: 500; line-height: 1.35;
}
#searchresult .myPic { border-radius: var(--r-sm); overflow: hidden; }
#searchresult .close.sp-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: var(--r-sm); color: var(--fg); opacity: .6; font-size: 18px; text-shadow: none;
  /* Metronic's .close hides its text (text-indent, inherited by the icon) and draws an image */
  text-indent: 0; background-image: none !important;
}
#searchresult .close.sp-icon-btn:hover { opacity: 1; background: var(--surface-2); }

/* thumbnail actions: a small toolbar in the corner, shown on hover or keyboard focus */
.sp-pic-actions {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  display: flex; gap: 2px; padding: 2px;
  background: var(--surface); border-radius: var(--r-sm); box-shadow: var(--elev);
  opacity: 0; pointer-events: none; transition: opacity var(--dur) ease;
}
.myPic:hover .sp-pic-actions, .sp-pic-actions:focus-within { opacity: 1; pointer-events: auto; }
@media (hover: none) { .sp-pic-actions { opacity: 1; pointer-events: auto; } }
.sp-pic-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px;
  background: transparent; color: var(--fg); cursor: pointer;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}
.sp-pic-action .ti { font-size: 18px; vertical-align: 0; }
.sp-pic-action:hover { background: var(--tint); color: var(--tint-fg); }
.sp-pic-action-danger:hover { background: var(--loc-tint); color: var(--loc-fg); }

/* picture tooltip: Opentip paints the bubble (colours from init.js), this lays out
   the card inside it */
.opentip-container.style-sp { max-width: 340px; }
.opentip-container.style-sp .opentip {
  color: var(--fg); text-shadow: none; padding: 10px 12px;
  font: 400 13px/1.4 var(--font);
}
.sp-pictip-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.sp-pictip-title { display: inline-block; font-weight: 600; font-size: var(--t-sm); white-space: nowrap; }
.sp-pictip-title::first-letter, .sp-pictip-label::first-letter { text-transform: uppercase; }
.sp-pictip-date {
  display: inline-flex; align-items: center; gap: var(--s-1);
  color: var(--fg-2); font-size: var(--t-xs); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.sp-pictip-desc {
  margin-top: 6px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
}
.sp-pictip-rows {
  display: grid; grid-template-columns: 16px auto minmax(0, 1fr); column-gap: var(--s-2); row-gap: var(--s-1);
  align-items: baseline; margin-top: var(--s-2); padding-top: var(--s-2); border-top: 1px solid var(--border);
}
.sp-pictip-rows:empty { display: none; }
.sp-pictip-row { display: contents; }
.sp-pictip-row .ti { color: var(--fg-2); font-size: 15px; align-self: center; }
.sp-pictip-label { color: var(--fg-2); font-size: var(--t-xs); white-space: nowrap; }
.sp-pictip-value { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.sp-pictip-sep { color: var(--fg-2); font-size: var(--t-xs); margin: 0 2px; }

/* the same card over a single picture's marker on the map, with the picture on top: an
   OpenLayers overlay drawn in CSS to match the Opentip bubble (init.js) */
.sp-maptip {
  position: relative; width: 260px; padding: 10px 12px;
  background: var(--surface); color: var(--fg); border: 1px solid var(--border-strong);
  border-radius: 8px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  font: 400 13px/1.4 var(--font); pointer-events: none;
  transform: translateX(-50%);
}
.sp-maptip:empty { display: none; }
/* the stem: a rotated square, its border continuing the card's */
.sp-maptip::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px;
  background: var(--surface); border: solid var(--border-strong); border-width: 0 1px 1px 0;
  transform: translateX(-50%) rotate(45deg);
}
.sp-pictip-thumb {
  position: relative; height: 150px; margin: -2px -4px var(--s-2);
  border-radius: 4px; overflow: hidden; background: var(--surface-3);
}
.sp-pictip-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sp-pictip-thumb.sp-pic-missing img { opacity: 0; }
.sp-pictip-thumb.sp-pic-missing::before {
  content: "\ecf6"; font-family: "tabler-icons"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--fg-2); opacity: .6;
}
#right_div { background: var(--surface); color: var(--fg); border-left: 1px solid var(--border); }

/* ======================================================================== login */

/* The backstretch photos sit on a fixed layer behind the page; the body must stay
   transparent or it paints a band across them (Metronic's grey #666 did). */
body.login { background: transparent !important; }
html:has(body.login) { background: var(--header-bg) !important; }
body.login .backstretch::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.20), rgba(0,0,0,.50));
}
.login .logo { margin: 72px auto var(--s-4) !important; padding: 0 !important; text-align: center; }
.login .logo .logoHeaderText {
  display: inline-flex; align-items: center; gap: var(--s-2); padding: 0;
  font: 600 var(--t-xl)/1.2 var(--font); color: #fff; text-shadow: 0 1px 12px rgba(0,0,0,.45);
}
.login .logo .logoHeaderText::before { content: "\ea54"; font-family: "tabler-icons"; font-weight: normal; font-size: 22px; }
.login .content {
  width: 380px !important; max-width: calc(100vw - 32px); margin: 0 auto var(--s-5) !important;
  padding: var(--s-6) !important; background: var(--surface) none !important; color: var(--fg);
  border-radius: var(--r-lg) !important; box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
}
.login .content h3, .login .content h4 { color: var(--fg) !important; }
.login .content .form-title { font-size: 22px !important; font-weight: 600 !important; margin: 0 0 var(--s-5) !important; }
.login .content h4 { font-size: var(--t-md) !important; font-weight: 600 !important; }
.login .content p, .login .content label { color: var(--fg-2) !important; font-size: var(--t-sm); }
.login .content a { color: var(--tint-fg); font-weight: 500; }
.login .content .form-group { margin-bottom: var(--s-4); }
.login .content .input-icon > i { color: var(--fg-2) !important; margin: 13px 2px 4px 12px; }
.login .content .form-control { height: 44px; padding-left: 38px !important; font-size: var(--t-md) !important; }
.login .content .form-actions {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  margin: var(--s-2) 0 0 !important; padding: 0 !important; border: 0 !important;
}
.login .content .form-actions::before, .login .content .form-actions::after { display: none; }
.login .content .form-actions .checkbox { margin: 0 !important; display: inline-flex; align-items: center; gap: var(--s-2); }
.login .content .form-actions .btn { float: none !important; height: 44px; padding: 0 var(--s-5); margin: 0 !important; font-size: var(--t-md); }
.login .content .forget-password { margin-top: var(--s-5) !important; padding-top: var(--s-4); border-top: 1px solid var(--border); }
.login .content .create-account { border-top: 1px solid var(--border) !important; }
.login .copyright { color: rgba(255, 255, 255, .8) !important; text-align: center; font-size: var(--t-xs); }

/* ================================================================ upload dialog */

#container > #left { color: var(--fg); }
#container > #left h4 { font-size: var(--t-md); font-weight: 600; color: var(--fg); margin: var(--s-2) 0 var(--s-3); }
#container > #left hr { border-color: var(--border); }
.upload-picker {
  padding: var(--s-5) !important; background: var(--surface-2) !important;
  border: 1.5px dashed var(--border-strong) !important; border-radius: var(--r-lg) !important;
}
.upload-picker.is-dragover { background: var(--tint) !important; border-color: var(--focus) !important; }
.upload-picker__button {
  height: 40px; padding: 0 var(--s-5) !important; border-radius: var(--r-sm) !important;
  background: var(--primary) !important; color: var(--primary-fg) !important;
}
.upload-picker__button:hover { background: var(--primary-hover) !important; }
.upload-picker__input:focus-visible + .upload-picker__button { outline: 2px solid var(--focus) !important; }
#hscroll .myPic {
  background: var(--surface) !important; color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-3);
}
/* A recognised QR placard was marked cyan; keep the meaning, in the theme's tint. */
#hscroll .myPic[style*="5bc0de"] { background: var(--tint) !important; border-color: var(--tint-border); }
#hscroll .myPic img { border-radius: var(--r-sm); }

/* Joint editing: a panel above the list that edits the photos ticked in it. */
.sp-joint {
  margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.sp-joint__head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-2); }
.sp-joint__title { margin: 0 !important; font-size: var(--t-sm); font-weight: 600; color: var(--fg); }
.sp-joint__count { color: var(--fg-2); font-size: var(--t-sm); margin-right: auto; }
.sp-joint__hint, .sp-joint__note { color: var(--fg-2); font-size: var(--t-xs); margin: 0 0 var(--s-2); }
.sp-joint p { margin-bottom: var(--s-2); }
.sp-joint textarea { resize: vertical; }
.sp-joint__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.sp-joint__actions .btn { margin: 0 !important; }
.sp-joint__actions .btn.active { background: var(--focus) !important; border-color: var(--focus) !important; color: var(--primary-fg) !important; }
#jointLocateHint { margin: var(--s-2) 0 0; color: var(--fg); font-weight: 600; }
.sp-joint-pick {
  display: flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-2);
  font-size: var(--t-sm); font-weight: 600; color: var(--fg-2); cursor: pointer;
}
.sp-joint-pick input { margin: 0; width: 16px; height: 16px; cursor: pointer; }
#hscroll .myPic.is-selected { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); background: var(--tint) !important; }
#hscroll .myPic.is-selected .sp-joint-pick { color: var(--fg); }

/* The dialog's own map: search and layer chips. Scoped to #right so the tiny
   per-photo maps in the list (their .mini buttons) keep their compact layout.
   The search has no suggestions, so no typeahead: the page wraps it in .map-search. */
#right .map > .map-search {
  position: absolute !important; top: var(--s-3) !important; left: var(--s-3) !important; z-index: 10000;
  display: block !important; width: 220px; height: 36px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md) !important; box-shadow: var(--elev);
}
#right .map > .map-search:focus-within { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 1px; }
#right .map > .map-search > input {
  position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; margin: 0 !important;
  padding: 0 var(--s-2) 0 34px !important; border: 0 !important; border-radius: inherit !important;
  background: transparent none !important; box-shadow: none !important; outline: none !important;
  color: var(--fg); font-size: var(--t-sm) !important;
}
/* One column in the top-right corner, clear of the search field on the left: Hybrid
   first, set slightly apart because it is an overlay toggle, then the base layers,
   all the same width. */
#right #baselayers {
  top: var(--s-3); right: var(--s-3); left: auto;
  flex-direction: column; align-items: stretch; gap: var(--s-1);
}
#right #baselayers #buttonHybrid { margin-bottom: var(--s-1) !important; }
#right #baselayers .layerswitcher_of { flex-direction: column; gap: var(--s-1); }
#right #baselayers .layerswitcher_button {
  height: 32px; display: inline-flex; align-items: center; padding: 0 10px !important;
  background: var(--surface) !important; color: var(--fg) !important;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm) !important; box-shadow: var(--elev);
  font-size: 13px !important; font-weight: 500; text-transform: none !important; white-space: nowrap;
}
#right #baselayers .layerswitcher_button:hover { background: var(--surface-2) !important; }
#right #baselayers .layerswitcher_button.active:not(.hybrid) { background: var(--selected) !important; color: var(--selected-fg) !important; border-color: var(--selected); }
#right #baselayers .layerswitcher_button.hybrid.active { background: var(--tint) !important; color: var(--tint-fg) !important; border-color: var(--tint-border); }
#right .ol-control { background: transparent !important; padding: 0 !important; }
#right .ol-zoom { overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--r-md) !important; box-shadow: var(--elev); }
#right .ol-control button { width: 32px !important; height: 32px !important; margin: 0 !important; background: var(--surface) !important; color: var(--fg) !important; border-radius: 0 !important; font-size: 17px !important; font-weight: 400 !important; }
#right .ol-zoom .ol-zoom-in { border-bottom: 1px solid var(--border) !important; }
#right .ol-control button:hover { background: var(--surface-2) !important; }
/* Bottom-left: the attribution button already holds the bottom-right corner. */
#right .ol-zoom { top: auto !important; bottom: var(--s-3) !important; left: var(--s-3) !important; right: auto !important; }

/* ==================================================================== dashboard */

.page-header-fixed .page-container { margin-top: var(--header-h) !important; }
.page-sidebar, .page-sidebar-wrapper, ul.page-sidebar-menu { background: transparent !important; }
ul.page-sidebar-menu { padding: var(--s-3) var(--s-2) !important; }
ul.page-sidebar-menu > li { border: 0 !important; margin-bottom: 2px; }
ul.page-sidebar-menu > li > a {
  display: flex !important; align-items: center; gap: var(--s-3);
  min-height: 40px; padding: 0 var(--s-3) !important; border: 0 !important; border-radius: var(--r-sm);
  color: var(--fg) !important; font-size: var(--t-sm) !important; font-weight: 500;
  background: transparent !important;
}
ul.page-sidebar-menu > li > a > i { color: var(--fg-2) !important; font-size: 16px; width: 18px; text-align: center; margin: 0 !important; }
ul.page-sidebar-menu > li > a:hover { background: var(--surface-2) !important; }
ul.page-sidebar-menu > li.active > a, ul.page-sidebar-menu > li.active > a:hover {
  background: var(--tint) !important; color: var(--tint-fg) !important;
}
ul.page-sidebar-menu > li.active > a > i { color: var(--tint-fg) !important; }
ul.page-sidebar-menu .selected, ul.page-sidebar-menu .arrow { display: none !important; }
.page-sidebar .sidebar-toggler {
  background: none !important; width: 32px; height: 32px; margin: 0 0 var(--s-2) auto !important;
  display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); cursor: pointer;
}
.page-sidebar .sidebar-toggler::before { content: "\ec42"; font-family: "tabler-icons"; color: var(--fg-2); font-size: 16px; }
.page-sidebar .sidebar-toggler:hover { background: var(--surface-2) !important; }

/* collapsed: Metronic's rail is 35px. The open menu's 8px + 12px of padding pushed every
   icon past the middle of its own highlight; here the highlight fills the rail less 4px a
   side and the icon sits centred in it. Padding rather than justify-content, so the icon
   stays put when hovering widens the item to show its label. */
.page-sidebar-closed ul.page-sidebar-menu { padding-left: 4px !important; padding-right: 4px !important; }
.page-sidebar-closed ul.page-sidebar-menu > li > a { padding: 0 0 0 3.5px !important; }
.page-sidebar-closed .page-sidebar .sidebar-toggler { width: 27px; margin: 0 0 var(--s-2) 0 !important; }

.page-content {
  background: var(--bg) !important; color: var(--fg);
  border-left: 1px solid var(--border); padding: var(--s-5) var(--s-6) !important;
}
.page-content .page-title {
  font-size: var(--t-xl) !important; font-weight: 600 !important; color: var(--fg) !important;
  letter-spacing: -0.01em; margin: 0 0 var(--s-2) !important;
}
.page-content .page-title small { font-size: var(--t-sm); font-weight: 400; color: var(--fg-2) !important; margin-left: var(--s-2); }
.page-content .page-breadcrumb {
  background: transparent !important; padding: 0 !important; margin: 0 0 var(--s-5) !important;
  font-size: var(--t-sm); color: var(--fg-2);
}
.page-content .page-breadcrumb a, .page-content .page-breadcrumb i { color: var(--fg-2) !important; }

.portlet, .portlet.box {
  background: var(--surface) !important; border: 1px solid var(--border) !important;
  border-radius: var(--r-lg) !important; padding: 0 !important; overflow: hidden;
}
.portlet > .portlet-title, .portlet.box > .portlet-title {
  background: transparent !important; border-bottom: 1px solid var(--border) !important;
  padding: var(--s-3) var(--s-4) !important; min-height: 0; margin: 0 !important;
}
.portlet > .portlet-title > .caption, .portlet.box > .portlet-title > .caption {
  color: var(--fg) !important; font-size: var(--t-md) !important; font-weight: 600; margin: 0 !important; padding: 0 !important;
}
.portlet > .portlet-title > .caption i { color: var(--fg-2) !important; }
.portlet > .portlet-body, .portlet.box > .portlet-body { background: transparent !important; padding: var(--s-4) !important; color: var(--fg); }

.table { color: var(--fg); font-size: var(--t-sm); }
.table > thead > tr > th {
  background: var(--surface-2) !important; color: var(--fg-2) !important;
  font-size: var(--t-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--border) !important;
}
.table > thead > tr > th, .table > tbody > tr > td { padding: var(--s-2) var(--s-3) !important; border-color: var(--border) !important; vertical-align: middle !important; }
.table-bordered { border-color: var(--border) !important; }
.table-striped > tbody > tr:nth-child(odd) > td { background: transparent !important; }
.table-hover > tbody > tr:hover > td { background: var(--surface-2) !important; }

/* row commands under a cell (dashboard/users.aspx): space is always kept, so the row
   does not grow when the pointer reaches it; touch screens have no hover to wait for */
.sp-row-actions {
  display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-1);
  opacity: 0; transition: opacity var(--dur) ease;
}
tr:hover .sp-row-actions, .sp-row-actions:focus-within { opacity: 1; }
@media (hover: none) { .sp-row-actions { opacity: 1; } }
.sp-row-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; margin: 0;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--fg-2) !important;
  line-height: 1; text-decoration: none !important; cursor: pointer;
  transition: background-color var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
}
.sp-row-action .ti { font-size: 15px; vertical-align: 0; }
.sp-row-action:hover { background: var(--tint); color: var(--tint-fg) !important; }
.sp-row-action-danger:hover { background: var(--loc-tint); color: var(--loc-fg) !important; }
.sp-row-action:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.dashboard-stat {
  background: var(--surface) !important; border: 1px solid var(--border);
  border-radius: var(--r-lg) !important; overflow: hidden;
}
.dashboard-stat .visual i { color: var(--tint-fg) !important; opacity: .35; }
.dashboard-stat .details .number { color: var(--fg) !important; font-weight: 600; }
.dashboard-stat .details .desc { color: var(--fg-2) !important; }
.dashboard-stat .more { background: var(--surface-2) !important; color: var(--fg-2) !important; }

.footer { background: transparent !important; }
.footer .footer-inner { color: var(--fg-2) !important; font-size: var(--t-xs); }
.footer .go-top { background: var(--surface-2) !important; border-radius: var(--r-sm); }
.footer .go-top i { color: var(--fg-2) !important; }

/* ---------- appearance setting (dashboard/myprofile.aspx) ---------- */
.sp-appearance { max-width: 720px; margin-bottom: var(--s-6); }
.sp-appearance h4 { font-size: var(--t-md) !important; font-weight: 600 !important; color: var(--fg); margin: 0 0 var(--s-1); }
.sp-appearance > p { color: var(--fg-2); font-size: var(--t-sm); margin: 0 0 var(--s-4); }
.sp-appearance fieldset { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-3); }
.sp-appearance legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sp-theme-option {
  position: relative; display: grid; gap: var(--s-2); margin: 0 !important; cursor: pointer;
  padding: var(--s-3); background: var(--surface); color: var(--fg) !important;
  border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  font-weight: 400 !important; transition: border-color var(--dur) ease;
}
.sp-theme-option:hover { border-color: var(--fg-2); }
.sp-theme-option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.sp-theme-option:has(input:checked) { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
.sp-theme-option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.sp-theme-option .sp-swatch { display: flex; height: 36px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); }
.sp-theme-option .sp-swatch span { flex: 1; }
.sp-theme-option .sp-swatch span:first-child { flex: 2; }
.sp-swatch .sp-swatch-header { background: var(--header-bg); }
.sp-swatch .sp-swatch-surface { background: var(--surface-2); }
.sp-swatch .sp-swatch-accent { background: var(--primary); }
.sp-theme-option strong { font-size: var(--t-sm); font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.sp-theme-option strong::after { content: "\ea5e"; font-family: "tabler-icons"; font-weight: normal; color: var(--focus); opacity: 0; }
.sp-theme-option:has(input:checked) strong::after { opacity: 1; }
.sp-theme-option small { font-size: var(--t-xs); color: var(--fg-2); }

/* ================================================================ narrow windows */

@media (max-width: 720px) {
  .header.navbar-inverse .navbar-brand { padding: 0 var(--s-2) 0 var(--s-3) !important; }
  .header.navbar-inverse .navbar-nav { margin-right: var(--s-2) !important; }
  .header.navbar-inverse .navbar-nav > li > a { padding: 0 10px !important; }
  .header.navbar-inverse a.uploadpicfancybox span,
  .header.navbar-inverse .navbar-nav .username,
  .header.navbar-inverse .navbar-nav .ti-chevron-down { display: none; }
  .header.navbar-inverse .navbar-nav > li.dropdown:not(.user) > a { font-size: 0 !important; }
  #mid_div > .twitter-typeahead { width: calc(100vw - 24px); }
  #mid_div #baselayers { top: 60px; right: auto; left: var(--s-3); }
  #mid_div #baselayers .layerswitcher_button { padding: 0 10px !important; font-size: 13px !important; }
  #mid_div #baselayers #btn_ly_hybrid::before { display: none; }
  #bottom_div .nav-pills { scrollbar-width: none; }
  #bottom_div .myPicThumbnail, #bottom_div .sp-pic-ghost { height: 120px; }
  .page-content { padding: var(--s-4) !important; border-left: 0; }
  .login .logo { margin-top: var(--s-6) !important; }
  .login .content { padding: var(--s-5) !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
