/* Look and feel of the Lingonberry design system (LUI, @secuis/ccp-lingonberry-components), dark
   theme: its colours, backgrounds, radii, shadows and SecuritasPro font, mimicked in plain CSS.
   Token values from LUI 7.3.0 src/themes.ts and src/securitasColors.ts. */

@font-face { font-family: SecuritasPro; font-display: swap; font-weight: 100 200; src: url(fonts/SecuritasPro-Light.woff2) format("woff2"); }
@font-face { font-family: SecuritasPro; font-display: swap; font-weight: 300 400; src: url(fonts/SecuritasPro-Regular.woff2) format("woff2"); }
@font-face { font-family: SecuritasPro; font-display: swap; font-weight: 500 1000; src: url(fonts/SecuritasPro-Bold.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  /* backgrounds 0-5 (paper elevations) */
  --bg0: #0A131A;
  --bg1: #132330;
  --bg2: #162634;
  --bg3: #1B2B3D;
  --bg4: #1D2C3F;
  --text: #FFFFFF;
  --text2: rgb(255 255 255 / 0.7);
  --text3: rgb(255 255 255 / 0.38);
  --divider: rgb(255 255 255 / 0.12);
  --hover: rgb(255 255 255 / 0.08);
  --selected: rgb(255 255 255 / 0.16);
  --on-colour: rgb(0 0 0 / 0.87);   /* contrastText on the light dark-theme colours */
  --primary: #9A89FB;               /* purple 300 */
  --primary-dark: #7B5BF5;          /* purple 400 */
  --primary-light: #AC9EFA;         /* purple 200 */
  --success: #79CD97;               /* green 300 */
  --warning: #EC9E5B;               /* orange 300 */
  --error: #ED5A5A;                 /* red 300 */
  --info: #80A0C6;                  /* blueGrey 300 */
  --sev1: #80A0C6;                  /* blueGrey 300 */
  --sev2: #5E94D4;                  /* blue 300 */
  --sev3: #ECB95B;                  /* amber 300 */
  --sev4: #E38363;                  /* coral 300 */
  --sev5: #ED5A5A;                  /* red 300 */
  --r-sm: 4px; --r-md: 6px; --r-lg: 12px; --r-full: 99px;
  --shadow1: 0 0.5px 2px rgb(0 0 0 / 0.18);
  --shadow3: 0 2px 8px rgb(0 0 0 / 0.16);
  --shadow4: 0 4px 16px rgb(0 0 0 / 0.16);
  --shadow5: 8px 8px 30px rgb(0 0 0 / 0.6);
  font: 14px/1.5 SecuritasPro, Arial, Helvetica, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; background: var(--bg0); }
body { display: flex; flex-direction: column; }
::selection { background: var(--primary); color: var(--on-colour); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* App bar */
.bar {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 10px 16px;
  /* Above everything on the map (banner, sheet), so its menu opens over them. */
  padding: 8px 16px; background: var(--bg1); box-shadow: var(--shadow3); position: relative; z-index: 10;
}
.brand { font-size: 18px; font-weight: 800; color: var(--text); margin-right: auto; letter-spacing: 0.01em; }
.brand span { font-weight: 400; color: var(--text2); }

/* Toggle button group */
.segmented { display: inline-flex; border: 1px solid var(--divider); border-radius: var(--r-md); overflow: hidden; }
.segmented button {
  border: 0; background: transparent; padding: 5px 12px; font: inherit; font-weight: 500; cursor: pointer; color: var(--text2);
}
.segmented button + button { border-left: 1px solid var(--divider); }
.segmented button:hover { background: var(--hover); }
.segmented button[aria-selected="true"] { background: rgb(154 137 251 / 0.16); color: var(--primary); }

/* Selects, styled like LUI's outlined small inputs */
.field { display: inline-flex; align-items: center; gap: 8px; color: var(--text2); }
.field select {
  font: inherit; color: var(--text); padding: 5px 28px 5px 10px; border: 1px solid var(--divider);
  border-radius: var(--r-md); background: var(--bg2); cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text2) 50%), linear-gradient(135deg, var(--text2) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.field select:hover { border-color: var(--text2); }
.field select:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.field select option { background: var(--bg3); color: var(--text); }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text2); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 34px; height: 14px; border-radius: var(--r-full); background: rgb(255 255 255 / 0.3); position: relative; transition: background 0.15s;
}
.switch .track::after {
  content: ""; position: absolute; top: -3px; left: -2px; width: 20px; height: 20px; border-radius: 50%;
  background: #E0E0E0; box-shadow: var(--shadow3); transition: transform 0.15s, background 0.15s;
}
.switch input:checked + .track { background: rgb(154 137 251 / 0.5); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--primary); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 4px; }
.switch input:checked ~ .switch-label { color: var(--primary); }  /* colour only: bold would widen it and shift the controls */

/* Text button */
.link {
  margin-left: auto; border: 0; background: none; color: var(--primary); cursor: pointer; font: inherit; font-weight: 500;
  padding: 6px 12px; border-radius: var(--r-full);
}
.link:hover { background: rgb(154 137 251 / 0.08); }

main { flex: 1; display: flex; min-height: 0; position: relative; }
#map { flex: 1; min-width: 0; }

/* Side panel */
#panel {
  width: 400px; max-width: 45vw; display: flex; flex-direction: column;
  border-left: 1px solid var(--divider); background: var(--bg0); overflow: hidden;
}
#panel-head { padding: 14px 16px; border-bottom: 1px solid var(--divider); background: var(--bg1); }
#panel-head h1 { font-size: 18px; font-weight: 800; line-height: 1.55; margin: 0 0 2px; }
#panel-head .sub { color: var(--text2); font-size: 13px; }
#panel-head .live::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 3px rgb(121 205 151 / 0.2);
}
#panel-head .warn { color: var(--warning); font-size: 13px; margin-top: 4px; }
#panel-head .error { color: var(--error); font-size: 13px; margin-top: 4px; }
#panel-head .notice { color: var(--primary-light); margin-top: 4px; }
#panel-head .ai-paused {
  margin-top: 8px; padding: 6px 10px; border-radius: var(--r-md); font-size: 13px;
  background: rgb(154 137 251 / 0.14); color: var(--primary-light); border: 1px solid rgb(154 137 251 / 0.35);
}
#panel-head .ai-paused::before { content: "⏸ "; }
.narrowed { font-size: 12px; color: var(--primary); margin: 0 0 6px; }
.narrowed::before { content: "⌖ "; }

/* Event cards */
#results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
#results li {
  position: relative; background: var(--bg2); border-radius: var(--r-lg); box-shadow: var(--shadow1);
  padding: 12px 14px 12px 18px; margin-bottom: 8px; cursor: pointer; overflow: hidden;
  transition: background 0.15s, box-shadow 0.15s;
}
#results li::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--sev, var(--sev1)); }
#results li:hover { background: var(--bg4); box-shadow: var(--shadow3); }
#results li.selected { background: var(--bg4); box-shadow: inset 0 0 0 1px var(--primary), var(--shadow3); }
#results li.fresh { animation: fresh 2s ease-out; }
@keyframes fresh { from { background: rgb(154 137 251 / 0.3); } to { background: var(--bg2); } }

.row { display: flex; align-items: center; gap: 8px; }
.sev {
  flex: none; width: 22px; height: 22px; border-radius: 50%; color: var(--on-colour); font-weight: 700; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; background: var(--sev);
}
.cat { color: var(--text2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.title { font-weight: 700; font-size: 15px; margin: 6px 0 2px; }
.summary { margin: 0 0 8px; color: var(--text2); }

/* Chips (LUI Chip: radius md) */
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tag {
  font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: var(--r-md);
  background: var(--selected); color: var(--text);
}
.tag.ai { background: rgb(154 137 251 / 0.2); color: var(--primary-light); }
.tag.noai { background: var(--hover); color: var(--text2); }
.tag.prov { background: rgb(236 158 91 / 0.2); color: var(--warning); }
.tag.upcoming { background: rgb(94 148 212 / 0.2); color: #94BBEA; }
.tag.toggle { cursor: pointer; transition: box-shadow 0.15s, filter 0.15s; }
.tag.toggle::after { content: " ⇄"; opacity: 0.7; }
.tag.toggle:hover { box-shadow: inset 0 0 0 1px currentColor; filter: brightness(1.15); }
.tag.toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.meta { color: var(--text3); font-size: 12px; }

#coverage { margin: 0; padding: 10px 16px; font-size: 12px; color: var(--text2); border-top: 1px solid var(--divider); background: var(--bg1); }
.empty { color: var(--text2); padding: 32px 12px; text-align: center; }

/* Dialog (LUI Dialog: paper elevation, radius lg) */
dialog {
  border: 0; border-radius: var(--r-lg); padding: 24px; max-width: 480px;
  background: var(--bg3); color: var(--text); box-shadow: var(--shadow5);
}
dialog::backdrop { background: rgb(0 0 0 / 0.6); }
dialog h2 { margin: 0 0 8px; font-size: 20px; font-weight: 800; line-height: 1.6; }
dialog p { color: var(--text2); }
dialog pre { background: var(--bg0); color: var(--text); padding: 10px; border-radius: var(--r-md); font-size: 12px; overflow-x: auto; }
dialog input {
  width: 100%; font: inherit; color: var(--text); padding: 10px 12px; background: var(--bg1);
  border: 1px solid var(--divider); border-radius: var(--r-md);
}
#invite-input { font-size: 16px; }  /* 16 px: iOS Safari zooms into smaller fields */
dialog input:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
dialog .hint { color: var(--text3); font-size: 12px; }
dialog menu { display: flex; justify-content: flex-end; padding: 0; margin: 16px 0 0; }

/* Contained button (LUI Button: full radius, shadow 4) */
.primary {
  background: var(--primary); color: var(--on-colour); border: 0; border-radius: var(--r-full);
  padding: 8px 22px; font: inherit; font-weight: 500; cursor: pointer; box-shadow: var(--shadow4);
}
.primary:hover { background: var(--primary-dark); }

/* Sign-in and access */
.who { color: var(--text2); font-size: 13px; }
#key-dialog details { margin-top: 12px; }
#key-dialog summary { cursor: pointer; color: var(--text2); }
.problem {
  padding: 8px 12px; border-radius: var(--r-md); background: rgb(237 90 90 / 0.15); color: #F87C7C;
  border: 1px solid rgb(237 90 90 / 0.35);
}
.secondary {
  background: transparent; color: var(--primary); border: 1px solid rgb(154 137 251 / 0.5); border-radius: var(--r-full);
  padding: 7px 18px; font: inherit; font-weight: 500; cursor: pointer;
}
.secondary:hover { background: rgb(154 137 251 / 0.08); }
.secondary.small { padding: 4px 12px; font-size: 13px; }
.secondary:disabled { opacity: 0.5; cursor: default; }
.secondary.danger, .primary.danger { border-color: var(--error); color: var(--error); background: rgb(237 90 90 / 0.08); }
.primary.danger { background: var(--error); color: var(--on-colour); }
a.primary { display: inline-block; text-decoration: none; }
.icon-button {
  width: 36px; height: 36px; border: 0; border-radius: var(--r-full); background: transparent; color: var(--text2);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.icon-button:hover { background: var(--hover); color: var(--text); }

dialog.admin { width: min(920px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 48px); padding: 0; }
.admin-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; background: var(--bg3); border-bottom: 1px solid var(--divider);
}
.admin-head h2 { margin: 0; }
dialog.admin section { padding: 16px 24px 20px; }
dialog.admin section + section { border-top: 1px solid var(--divider); }
dialog.admin h3 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
dialog.admin h3 .count { color: var(--text3); font-weight: 400; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 12px; align-items: flex-end; }
.form-row > label:not(.check) { flex: 1 1 220px; display: flex; flex-direction: column; gap: 4px; color: var(--text2); font-size: 13px; }
dialog.admin input:not([type=checkbox]), dialog.admin select {
  width: 100%; font: inherit; font-size: 15px; color: var(--text); padding: 9px 12px; background: var(--bg1);
  border: 1px solid var(--divider); border-radius: var(--r-md);
}
dialog.admin input:focus-visible, dialog.admin select:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
label.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; padding: 9px 0; }
label.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.admin-warning {
  margin: 0 0 12px; padding: 12px 14px; border-radius: var(--r-md); background: rgb(236 158 91 / 0.14);
  border: 1px solid rgb(236 158 91 / 0.45); color: #F2B682; line-height: 1.5;
}
.admin-warning strong { color: var(--warning); }
.admin-warning label.check { display: flex; color: var(--text); padding-bottom: 0; }
.form-error { color: var(--error); margin: 0 0 8px; }
dialog.admin menu { margin: 4px 0 0; justify-content: flex-start; }
.invite-result p { color: var(--text2); }
.invite-result input { font-family: ui-monospace, monospace; font-size: 13px !important; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 4px; }
.copied { color: var(--success); font-size: 13px; }

.lic-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
dialog.admin .lic-toolbar input { flex: 1 1 220px; width: auto; }
dialog.admin .lic-toolbar select { flex: 0 1 auto; width: auto; }
.lic-shown { margin: 0 0 8px; color: var(--text2); font-size: 13px; }
.lic-shown:empty { display: none; }
.lic-none { color: var(--text2); padding: 12px 0; }
.lic-more { margin: 12px 0 0; justify-content: center; }
.lic-list { display: flex; flex-direction: column; gap: 8px; }
.lic {
  display: grid; grid-template-columns: minmax(160px, 1.3fr) auto minmax(200px, 2fr) auto; gap: 8px 16px;
  align-items: center; padding: 12px 14px; border-radius: var(--r-lg); background: var(--bg2);
}
.lic.blocked, .lic.expired { opacity: 0.7; }
.lic-name { font-weight: 700; }
.lic-email { color: var(--text2); font-size: 13px; word-break: break-all; }
.lic-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.tag.status-active { background: rgb(121 205 151 / 0.18); color: var(--success); }
.tag.status-blocked { background: rgb(237 90 90 / 0.18); color: #F87C7C; }
.tag.status-expired { background: var(--hover); color: var(--text2); }
.lic-facts { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--text2); font-size: 13px; }
.lic-fact:first-child { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.lic-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* A simulated position: amber, like its dot, over the top of the map. */
.sim-banner {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; max-width: calc(100% - 120px);
  padding: 6px 6px 6px 14px; border-radius: var(--r-full); font-size: 13px; color: var(--on-colour);
  background: #ECB95B; box-shadow: var(--shadow4);
}
.sim-text { font-weight: 700; }
.sim-banner .short { display: none; }
.sim-text::before { content: "◎ "; }
.sim-revert {
  border: 0; border-radius: var(--r-full); padding: 4px 12px; font: inherit; font-weight: 500; cursor: pointer;
  background: rgb(0 0 0 / 0.14); color: var(--on-colour);
}
.sim-revert:hover { background: rgb(0 0 0 / 0.24); }
.sim-dismiss {
  width: 26px; height: 26px; border: 0; border-radius: var(--r-full); background: transparent; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--on-colour);
}
.sim-dismiss:hover { background: rgb(0 0 0 / 0.14); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 20;
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: var(--r-md); background: var(--bg4); color: var(--text);
  box-shadow: var(--shadow5); font-size: 14px;
}

/* MapLibre controls and popups */
.maplibregl-popup-content {
  font: 13px/1.4 SecuritasPro, Arial, sans-serif; padding: 8px 12px; color: var(--text);
  background: var(--bg3); border-radius: var(--r-md); box-shadow: var(--shadow4);
}
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--bg3); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--bg3); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--bg3); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--bg3); }
.maplibregl-popup-close-button { color: var(--text2); }
.maplibregl-ctrl-group { background: var(--bg3); border-radius: var(--r-md); box-shadow: var(--shadow3) !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--divider); }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-scale { background: rgb(19 35 48 / 0.8); color: var(--text2); border-color: var(--text2); }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-attrib-inner { background: rgb(19 35 48 / 0.8) !important; color: var(--text2) !important; }
.maplibregl-ctrl-attrib a { color: var(--text2); }
.maplibregl-ctrl-attrib-button { filter: invert(1); }

/* The menu: every control behind one button in the bar, as a panel under it. */
.controls-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
  border: 0; border-radius: var(--r-full); background: transparent; color: var(--text); cursor: pointer;
}
.controls-toggle:hover, .controls-toggle[aria-expanded="true"] { background: var(--selected); }
.controls {
  display: none; position: absolute; top: calc(100% + 6px); right: 12px; width: 360px; z-index: 5;
  max-height: calc(100dvh - 80px); overflow-y: auto;
  flex-direction: column; align-items: stretch; gap: 14px; padding: 16px;
  background: var(--bg3); box-shadow: var(--shadow5); border-radius: var(--r-lg);
}
body.controls-open .controls { display: flex; }
.controls .segmented { align-self: stretch; }
.controls .segmented button { flex: 1; padding: 9px 12px; }
.controls .field { justify-content: space-between; }
.controls .field select { width: 58%; min-width: 0; text-overflow: ellipsis; padding-top: 8px; padding-bottom: 8px; }
.controls-footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--divider);
}
.controls-footer .who { margin-right: auto; }
.controls-footer .link { margin-left: 0; }
.controls-footer:not(:has(:not([hidden]))) { display: none; }
.grabber { display: none; }

/* --- Phones: full-screen map, controls behind a button, the list as a bottom sheet ------------ */
@media (max-width: 760px) {
  html, body { height: 100dvh; overflow: hidden; overscroll-behavior: none; }
  body { -webkit-tap-highlight-color: transparent; }

  .bar {
    gap: 8px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top, 0px));
    padding-left: calc(12px + env(safe-area-inset-left, 0px)); padding-right: calc(12px + env(safe-area-inset-right, 0px));
  }
  .brand { font-size: 17px; }
  .brand span { display: none; }
  /* The menu drops down under the bar as a full-width sheet. */
  .controls {
    top: 100%; left: 0; right: 0; width: auto; max-height: calc(100dvh - 64px); box-shadow: var(--shadow4);
    padding-left: calc(16px + env(safe-area-inset-left, 0px)); padding-right: calc(16px + env(safe-area-inset-right, 0px));
    border-radius: 0 0 var(--r-lg) var(--r-lg);
  }
  .controls .field select { padding-top: 9px; padding-bottom: 9px; font-size: 16px; }  /* 16 px: no iOS zoom */

  main { position: relative; }
  #map { position: absolute; inset: 0; }

  #panel {
    position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-width: none; z-index: 3;
    height: var(--sheet-h, 30dvh); border-left: 0; border-radius: var(--r-lg) var(--r-lg) 0 0;
    background: var(--bg1); box-shadow: 0 -4px 16px rgb(0 0 0 / 0.35);
    transition: height 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  #panel.dragging { transition: none; }
  .grabber {
    display: block; flex: none; height: 22px; cursor: grab; touch-action: none; position: relative;
  }
  .grabber::after {
    content: ""; position: absolute; left: 50%; top: 9px; width: 38px; height: 5px; margin-left: -19px;
    border-radius: var(--r-full); background: rgb(255 255 255 / 0.3);
  }
  #panel-head { padding: 0 16px 10px; border-bottom: 1px solid var(--divider); touch-action: none; cursor: grab; }
  #panel-head h1 { font-size: 17px; }
  #results { padding: 8px 10px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  #results li { padding: 12px 14px 12px 18px; }
  .tag { line-height: 24px; padding: 0 9px; }
  #coverage { display: none; }
  #results li.coverage-note {
    background: none; box-shadow: none; cursor: default; padding: 8px 4px 16px; font-size: 12px; color: var(--text3);
  }
  #results li.coverage-note::before { display: none; }

  /* MapLibre: pinch to zoom replaces the zoom buttons; the locate button stays, above the sheet. */
  .maplibregl-ctrl-top-left .maplibregl-ctrl-group:has(.maplibregl-ctrl-zoom-in) { display: none; }
  .maplibregl-ctrl-group button { width: 40px; height: 40px; }
  .maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { bottom: var(--sheet-h, 30dvh); transition: bottom 0.25s; }
  dialog { max-width: calc(100vw - 32px); }
  dialog.admin { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .admin-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  dialog.admin section { padding: 16px; }
  .lic { grid-template-columns: 1fr; }
  .lic-actions { justify-content: flex-start; }
  .toast { bottom: calc(var(--sheet-h, 30dvh) + 12px); }
  /* One line on a phone, in short words: "◎ Simulated: London [Real position] ×". */
  .sim-banner {
    top: 8px; left: 8px; right: 60px; transform: none; max-width: none; flex-wrap: nowrap; gap: 6px;
    padding: 4px 4px 4px 12px;
  }
  .sim-banner .long { display: none; }
  .sim-banner .short { display: inline; }
  .sim-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sim-revert { flex: none; padding: 4px 10px; white-space: nowrap; }
  .sim-dismiss { flex: none; }
}

/* The locate button's waiting and active icons keep MapLibre's own colours. */
.maplibregl-ctrl button.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon,
.maplibregl-ctrl button.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon { filter: none; }
