:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --blue: #2563eb;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Pin the app to the real screen edges. As an iPhone Home Screen app (with
   the translucent status bar) iOS computes height:100% short — by about the
   status bar's height — leaving an empty strip under the button bar. A fixed
   body spans the whole screen, under the home indicator too; the button bar
   already pads itself clear of that with safe-area-inset-bottom. */
body {
  position: fixed;
  inset: 0;
  height: auto;
}

#hud {
  display: flex;
  align-items: center;
  gap: 16px;
  /* Respect the notch / home indicator: installed as a PWA the page runs
     full-bleed under the status bar, which pushed the right-hand buttons off
     the screen where they could not be tapped at all. */
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
  background: var(--panel);
  border-bottom: 1px solid #334155;
  flex: 0 0 auto;
  /* Never let the bar grow taller than its content or clip it. */
  min-height: 0;
}
.hud-item { font-size: 14px; color: var(--muted); }
.hud-item .value { color: var(--text); font-weight: 600; }
/* Right-aligned group of status/command buttons. */
.hud-rest {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  /* On a phone the status buttons can exceed the width available. Let the
     group shrink and scroll sideways rather than overflow off-screen, and keep
     each button from being squashed to nothing. */
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hud-rest::-webkit-scrollbar { display: none; }
.hud-rest > * { flex: 0 0 auto; }
.hud-stat { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
/* Hosted: the LuLuMate logo at the far left, to the customer's account (client portal). */
/* The LuLuMate logo: the full logo, in the same box as the Settings button beside it (34 x 32, 12 px corners). */
.hud-logo { display: inline-flex; flex: none; width: 34px; height: 32px; border-radius: var(--p-r, 12px); overflow: hidden;
  transition: transform 140ms ease, opacity 140ms ease; }
.hud-logo[hidden] { display: none; }
.hud-logo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.hud-logo:hover { opacity: 0.88; }
.hud-logo:active { transform: scale(0.94); }
.hud-stat .value { color: var(--text); font-weight: 600; }
/* Two-line stat: the mower's value on top, the Pi's own reading beneath in small type. */
.hud-stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.hud-stat .hud-sub { font-size: 9px; font-weight: 500; letter-spacing: 0.02em; }
/* Connection icon tint: green when linked, red when lost. */
#connBtn.connected { color: #4ade80; }
#connBtn.disconnected { color: #f87171; }
/* Battery icon is drawn sideways in the sprite; stand it upright with the
   terminal at the top (rotate(90deg) put the nub at the bottom). */
#batteryBtn .ic { transform: rotate(-90deg); }
/* Charging: swap in an upright lightning bolt (the rotate above would spin it
   sideways) and tint it green so it reads as "on the dock". */
#batteryBtn.charging .ic { transform: none; color: #4ade80; }
/* Mower-state icon tints. */
#stateBtn.state-mowing { color: #4ade80; }
#stateBtn.state-paused { color: #fbbf24; }
#stateBtn.state-charging { color: #60a5fa; }
#stateBtn.state-error { color: #f87171; }
#stateBtn.state-idle { color: var(--text); }

/* When disconnected the controls lose weight; the notice banner already
   explains that the mower may still be moving. */
body.disconnected #controls { opacity: 0.55; }
body.disconnected #hud button { opacity: 0.75; }

/* Inline SVG icons — small, inherit the text colour. */
.ic {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  vertical-align: -0.15em;
}

.badge {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: #fff;
  font-weight: 600;
}
.badge.green { background: var(--green); }
.badge.red { background: var(--red); }

#stage {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
}

#map {
  position: absolute;
  inset: 0;
  background: #0b1220;
}

/* Lawn-only view (no base tiles): a warm cream/beige canvas so the green mowing
 * zones read clearly instead of sitting on the dark app background. */
#map.no-basemap {
  background: #faf3e3;
}

/* Joystick */
#joystick {
  position: absolute;
  left: 20px;
  bottom: 20px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.9);
  border: 2px solid #475569;
  touch-action: none;
  user-select: none;
  z-index: 1000;
}
#stick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
}

#controls {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  /* Clear the home indicator when installed as a PWA, or the bottom row of
     buttons sits underneath it. */
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
  background: var(--panel);
  border-top: 1px solid #334155;
  flex-wrap: wrap;
}
#controls button {
  flex: 1 1 auto;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: #334155;
  border: 1px solid #475569;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
#controls button:hover { background: #475569; }
#controls button:disabled { opacity: 0.5; cursor: default; }
#controls button.stop-btn { background: var(--amber); border-color: var(--amber); color: #fff; }
#controls button.stop-btn:hover { background: #b45309; }

#notice {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 1200;
}
.hidden { display: none; }

/* Map overlay badge shown when there is no live RTK/GPS fix. */
.pos-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

/* Alignment banner shown when the map is unlocked in calibration mode: the
   background can be dragged while the lawn overlay stays pinned, and the user
   locks once the real property sits underneath it. */
.calib-badge {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 950;
  background: rgba(13, 21, 40, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: var(--p-text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  width: max-content;
  max-width: calc(100vw - 24px);
  text-align: center;
}
.calib-badge.hidden { display: none; }
/* "Aligning", with the blue of the switched-on padlock as its dot. */
.calib-badge > span:first-child { color: var(--p-text-2); font-weight: 500; }
.calib-badge > span:first-child::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%;
  background: #3b82f6; vertical-align: 1px;
}
/* Lawn size, while aligning: − / + draw the lawn smaller or bigger (display only),
   the buttons like the map's own. */
.calib-size { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; white-space: nowrap; color: var(--p-text-2); font-weight: 500; }
.calib-size b { min-width: 3.2em; color: var(--p-text); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.calib-size button {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(148, 163, 184, 0.24);
  background: #1a2641; color: var(--p-text); font-size: 18px; font-weight: 600; line-height: 1;
  cursor: pointer; padding: 0; flex: none;
}
.calib-size button:hover:not(:disabled) { background: #22304f; }
.calib-size button:active:not(:disabled) { transform: scale(0.94); }
.calib-size button:disabled { opacity: 0.4; cursor: default; }

/* Map view controls: centre on the mapped area + lock the view position. */
#mapControls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#mapControls button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid #475569;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#mapControls button:hover { background: #475569; }
#mapControls .ic { width: 18px; height: 18px; }
#mapControls #lockMapBtn.locked { color: #fbbf24; border-color: #fbbf24; }

/* Mower map marker */
.mower-icon {
  background: transparent;
  border: none;
}
/* (1.157.0) a spot mow out of Wi-Fi range: the picture stands at the last known position, greyed */
body.mower-away .mower-icon { filter: grayscale(1); opacity: .55; }

/* The mower's picture inside its marker, turned by the heading about the point the mower
   reports (its rear axle: map.js sets transform-origin to that point). No transition on the
   turn: the heading is set every frame from the drawn pose (1.156.0), and an ease on top of
   that left the nose behind in every turn. The drop shadow lifts it off the street and the
   darker aerial tiles. */
.mower-heading {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center;
}
.mower-heading svg {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
/* The mower seen from above (front at the top), in place of the arrow. */
.mower-heading img {
  width: 25px;
  height: 34px;
  display: block;
  pointer-events: none;
}

/* Permanent centred label for each mowing zone's name (Mammotion-app style).
   No pointer/box, just text with a shadow so it reads over the OSM tiles. */
.area-label {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #e2e8f0;
  font-weight: 600;
  font-size: 12px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  pointer-events: none;
}
.area-label::before { display: none; }

/* Settings button (header) */
#settingsBtn {
  background: #334155;
  border: 1px solid #475569;
  color: var(--text);
  border-radius: 8px;
  /* Same box as the schedules button and the HUD chips beside it. */
  padding: 6px 9px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
}
#settingsBtn:hover { background: #475569; }

/* Settings modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
}
/* Must come after `.modal` so it wins on specificity order. */
.modal.hidden { display: none; }

/* Camera panel */
#cameraBtn { background: #334155; border-color: #475569; }
.camera-panel {
  position: fixed;
  /* Just below the header (its height is measured live: two rows plus the
     notch on a phone), so the camera never covers the top menu. */
  top: calc(var(--hud-bottom, 48px) + 8px);
  right: 16px;
  width: min(360px, calc(100vw - 32px));
  height: 240px;
  min-width: 240px;
  min-height: 160px;
  background: var(--panel);
  border: 1px solid #334155;
  border-radius: 12px;
  overflow: hidden;
  z-index: 1100;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}
.camera-panel.hidden { display: none; }
/* Double-clicking the camera header grows the window to a fitted size (set
   inline so it stays draggable); this just raises it above the map layers. */
.camera-panel.maximized { z-index: 1400; }
.camera-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid #334155;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.camera-head:active { cursor: grabbing; }
.camera-head select, .camera-head button { cursor: pointer; }
.camera-panel.dragging { user-select: none; }
.camera-head select {
  flex: 1;
  background: #0f172a;
  color: var(--text);
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
}
/* Right-aligned group holding the reconnect + close buttons, so the close stays
   pinned to the camera window's right edge even when the camera-select dropdown
   is hidden. */
.camera-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
/* Camera window buttons (light / refresh / close) match the main window's HUD
   and command buttons: dark slate background, border, rounded corners, sized to
   fit the thinner header bar. */
.camera-icon-btn {
  background: #334155;
  border: 1px solid #475569;
  color: var(--text);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 26px;
}
.camera-icon-btn:hover { background: #475569; }
.camera-icon-btn .ic { width: 14px; height: 14px; }
/* Close button: a plain text X sized to sit level with the 14px icons beside it. */
#cameraClose { font-size: 15px; font-weight: 400; line-height: 1; }
/* Headlamp toggle: same button at rest; fills amber (like the old HUD light
   button) while the light is on. */
.camera-actions #lightBtn.active {
  background: #fbbf24;
  border-color: #fbbf24;
  color: #0f172a;
}
.camera-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #000;
}
#cameraVideo, #cameraCanvas, #cameraMjpeg { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Both cameras side by side (the "2" button): the usual picture left, the second camera right. */
.camera-stage.dual > #cameraVideo, .camera-stage.dual > #cameraCanvas, .camera-stage.dual > #cameraMjpeg { width: 50% !important; }
.camera-second { position: absolute; top: 0; right: 0; width: 50%; height: 100%; object-fit: cover; z-index: 2;
  background: #000; border-left: 2px solid #0f172a; }
.camera-second[hidden], .camera-second-msg[hidden] { display: none; }
/* (1.158.495) the right camera takes the whole picture, filled like the left */
.camera-stage.right-cam > #cameraVideo, .camera-stage.right-cam > #cameraCanvas, .camera-stage.right-cam > #cameraMjpeg { visibility: hidden; }
.camera-stage.right-cam > .camera-second { width: 100%; object-fit: cover; background: #000; }
.camera-stage.right-cam > .camera-second-msg { right: 50%; }
.camera-second-msg { position: absolute; top: 50%; right: 25%; transform: translate(50%, -50%); z-index: 3; max-width: 45%;
  padding: 6px 10px; border-radius: 8px; background: rgba(15, 23, 42, .85); color: #e2e8f0; font: 600 12px system-ui, sans-serif; text-align: center; }
.cam2-btn, .cam-maps-btn { position: relative; }
/* The views menu (camViewsBtn): the Ai boxes and the two maps, one switch each, over the top right of the picture. */
.cam-views-menu { position: absolute; top: 6px; right: 6px; z-index: 20; display: flex; flex-direction: column; gap: 10px;
  width: min(250px, calc(100% - 12px)); max-height: calc(100% - 12px); overflow-y: auto; padding: 10px 12px; border-radius: 10px;
  background: var(--panel); color: var(--text); border: 1px solid #475569; box-shadow: 0 6px 20px rgba(0, 0, 0, .45); }
.cam-views-menu[hidden] { display: none; }
.cam-views-menu .spot-switch { color: var(--text); }
.cv-text { display: flex; flex-direction: column; min-width: 0; }
.cv-text b { font-size: 13px; }
.cv-text .sub { font-size: 11px; color: var(--muted); font-weight: 400; }
.cam2-btn .cam2-n, .cam-maps-btn .cam2-n { position: absolute; right: 2px; bottom: 0; font: 700 10px system-ui, sans-serif; }
.cam2-btn.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.camera-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 5;
  touch-action: none;
}
.camera-resize::before {
  content: '';
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  border-radius: 0 0 2px 0;
  opacity: 0.7;
}
.camera-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  background: rgba(0, 0, 0, 0.6);
}
.modal-card {
  position: relative;
  background: var(--panel);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px 24px;
  width: min(460px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-card h2 { margin: 0 0 4px; font-size: 18px; }
.modal-card .hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin: 0 0 4px;
  padding: 8px;
  background: rgba(37, 99, 235, 0.12);
  border-radius: 8px;
}
.modal-card label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--muted);
  gap: 4px;
}
.modal-card label.check {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.modal-card input, .modal-card select {
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 14px;
}
.modal-card input:focus, .modal-card select:focus { outline: none; border-color: var(--blue); }
.modal-card .row { display: flex; gap: 12px; }
.modal-card .row label { flex: 1; }
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.modal-actions button {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
}
.modal-actions button.secondary {
  background: #334155;
  border-color: #475569;
  color: var(--text);
  flex: 0 0 auto;
}
.modal-msg { font-size: 13px; min-height: 18px; }
.modal-msg.ok { color: #4ade80; }
.modal-msg.err { color: #f87171; }
/* Window feedback ("Saved.", "Failed: …") sits in the title row: the title on
   the left, the message to its right on one line. It never covers the title.
   (1.158.922) One that doesn't fit there goes on a line of its own under the
   title, in full - never cut short (polish.css .long, app.js headMsgsInFull). */
.title-row { display: flex; align-items: center; gap: 12px; min-height: 34px; }
.title-row h2 { flex: none; margin: 0; }
#plansMsg, #cuttingMsg, #settingsMsg {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: #0f172a;
  border: 1px solid #334155;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
}
#plansMsg.ok, #cuttingMsg.ok, #settingsMsg.ok { border-color: #14532d; }
#plansMsg.err, #cuttingMsg.err, #settingsMsg.err { border-color: #7f1d1d; }
#plansMsg:empty, #cuttingMsg:empty, #settingsMsg:empty { display: none !important; }

/* --- HUD network / light indicators --- */
.hud-stat { font-size: 13px; }
.hud-stat .ok { color: #4ade80; font-weight: 600; }
.hud-stat .loc-vio { color: #fbbf24; font-weight: 600; }
.hud-stat .dim { color: var(--muted); }
.hud-stat .bad { color: #f87171; font-weight: 600; }
.kv-v.loc-ok { color: #4ade80; font-weight: 600; }
.kv-v.loc-warn { color: #f87171; font-weight: 600; }
#schedulesBtn, .hud-stat {
  background: #334155;
  border: 1px solid #475569;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  /* Uniform height so every HUD icon is the same size and sits on the same line. */
  height: 32px;
}
#schedulesBtn:hover, .hud-stat:hover { background: #475569; }
/* In-progress state for the light toggle: flash the bulb while the request runs. */
@keyframes bulb-flash { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }
#lightBtn.loading .ic { animation: bulb-flash 0.6s ease-in-out infinite; }
#lightBtn.loading { opacity: 0.75; cursor: default; }

/* Extra controls that aren't mower commands. */
#syncMapBtn { background: #334155; border-color: #475569; }

/* --- Scheduled jobs modal --- */
.modal-wide { width: min(660px, 94vw); }
.plans-list {
  max-height: 38vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plans-empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}
.plan-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0f172a;
  border: 1px solid #334155;
  border-left: 3px solid #475569;
  border-radius: 8px;
  padding: 10px 12px;
}
.plan-row.enabled { border-left-color: var(--green); }
.plan-name { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.plan-days { display: block; font-size: 12px; color: var(--blue); font-weight: 500; margin-top: 2px; }
.plan-meta { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.plan-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.plan-actions button {
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 12px;
  cursor: pointer;
  background: #334155;
  color: var(--text);
  border: 1px solid #475569;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.plan-actions button svg { width: 15px; height: 15px; }
.plan-actions button:hover { background: #475569; }
.plan-actions .plan-toggle.on { background: var(--green); border-color: var(--green); color: #fff; }
.plan-actions .plan-toggle.off { background: #334155; }
.plan-actions .plan-edit:hover { background: var(--blue); border-color: var(--blue); color: #fff; }

.plans-form { margin-top: 16px; border-top: 1px solid #334155; padding-top: 14px; }
.form-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.form-head h3 { margin: 0; font-size: 15px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 12px;
}
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form-grid label.span-3 { grid-column: span 3; }
.plans-form input {
  width: 100%;
  height: 38px;
  box-sizing: border-box;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
  font-family: inherit;
}
.plans-form input:focus { outline: none; border-color: var(--blue); }
.plans-form input[type="time"],
.plans-form input[type="number"] { font-variant-numeric: tabular-nums; }
.week-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  margin-top: 12px;
  margin-bottom: 18px;
}
.week-label { font-weight: 600; margin-right: 2px; }
.day-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
}
.day-pill input { display: none; }
.day-pill:has(input:checked) {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* --- Device info modal --- */
/* Content stays scrollable but the scrollbar is hidden, per the user's request. */
.info-body {
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.info-body::-webkit-scrollbar { display: none; }
#infoModal .modal-card { scrollbar-width: none; -ms-overflow-style: none; }
#infoModal .modal-card::-webkit-scrollbar { display: none; }
.info-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 0; }
/* Each info section is its own subtle card so the data reads as grouped blocks
   rather than a wall of slightly-separated rows. */
.info-group {
  background: rgba(100, 116, 139, 0.08);
  border: 1px solid rgba(100, 116, 139, 0.18);
  border-radius: 10px;
  padding: 12px 14px;
}
.info-group h3 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
/* Key/value rows: a hairline between rows, and a right-aligned value with
   tabular numerals so figures line up neatly down the column. */
.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 5px 0;
  font-size: 13px;
}
.kv + .kv { border-top: 1px solid rgba(100, 116, 139, 0.16); }
.kv-k { color: var(--muted); font-size: 12px; }
.kv-v { color: var(--text); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }


/* Cutting controls — live adjustments to the running mow. */
.modal-note { margin: -4px 0 14px; font-size: 13px; color: var(--muted); }
.slider-row { display: block; margin: 14px 0; }
.slider-row .slider-label { display: block; margin-bottom: 6px; font-size: 14px; }
.slider-row .slider-label b { color: #e2e8f0; font-variant-numeric: tabular-nums; }
.slider-row input[type=range] { width: 100%; accent-color: #2563eb; }
#cuttingBtn { background: #334155; border-color: #475569; }
.slider-row .slider-range { float: right; color: var(--muted); font-size: 12px; }
.slider-row.unavailable { opacity: 0.45; }
.slider-row.unavailable input[type=range] { cursor: not-allowed; }

/* Installed as a PWA the joystick takes a large bite out of a phone screen, so
   shrink it there. Safe to resize: setStick() measures the pad's actual radius
   at use time, so the stick-to-speed mapping follows the element rather than a
   hardcoded size.

   display-mode: standalone covers both Android and iOS installs. */
@media (display-mode: standalone) {
  #joystick {
    width: 104px;
    height: 104px;
    left: 14px;
    /* Keep clear of the home indicator. */
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
  #stick {
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
  }
}
/* A cutting value the mower has not reported — shown as -- rather than a
   fabricated default. */
.slider-row .slider-label b.unknown { color: var(--muted); font-weight: 500; }

/* Rotate the phone and the camera takes the whole screen — edge to edge, no
   panel chrome, no letterboxing. The header floats over the video instead of
   taking a strip off the top, so the close/refresh/lamp buttons stay reachable.

   Constrained to coarse pointers so rotating a desktop browser window does not
   hijack the layout. !important is needed because the drag and resize handlers
   set width/height/left/top inline on the panel, and those would otherwise win.

   Insets are deliberately NOT applied: "fill the screen" means exactly that.
   The floating header is inset instead, so the controls clear the notch while
   the video still runs under it. */
@media (orientation: landscape) and (pointer: coarse) {
  .camera-panel:not(.hidden) {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #000;
    z-index: 1500;
  }
  /* Header floats above the video rather than consuming a row. */
  .camera-panel:not(.hidden) .camera-head {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    border-bottom: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
    color: #e2e8f0;
    padding: calc(6px + env(safe-area-inset-top, 0px))
             calc(10px + env(safe-area-inset-right, 0px))
             14px
             calc(10px + env(safe-area-inset-left, 0px));
  }
  .camera-panel:not(.hidden) .camera-stage {
    position: absolute;
    inset: 0;
    background: #000;
  }
  /* cover, not contain: contain letterboxes a 4:3 feed on a 16:9 phone, which
     is the black border we are trying to get rid of. This crops instead. */
  .camera-panel:not(.hidden) #cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  /* The grip is meaningless at full screen. */
  .camera-panel:not(.hidden) .camera-resize { display: none; }
}

/* The joystick is hidden unless the mower can actually be driven, so the
   control is never offered when pushing it would do nothing. */
#joystick.unavailable { display: none; }

/* --- Schedule editor: sections and area chips --- */
.form-section { margin: 14px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #60a5fa; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: #1e293b; border: 1px solid #334155; font-size: 13px; cursor: pointer; }
.chip-row label:has(input:checked) { background: #1d4ed8; border-color: #3b82f6; }
.chip-row input { accent-color: #60a5fa; }
.form-grid select { width: 100%; }
.plan-meta2 { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
#cutDetect { width: 100%; margin-top: 6px; }
.chip-row input[type=checkbox] { width: auto; height: auto; margin: 0; padding: 0; flex: none; }
/* Conditional fields (weekly days, custom angle) — beat .week-row/.form-grid display rules. */
.plans-form .hidden { display: none !important; }

/* --- HUD icons that show their level: lit bars / battery fill, coloured by strength --- */
.ic.lvl .bar { opacity: 0.25; transition: opacity .3s; }
.ic.lvl .bar.on { opacity: 1; }
.ic.lvl .bat-fill { transition: width .4s; }
.ic.lvl.good { color: #4ade80; }
.ic.lvl.mid { color: #fbbf24; }
.ic.lvl.low { color: #f87171; }
.ic.lvl.none { color: var(--muted); }
.ic.lvl .bat-bolt { display: none; }
#batteryBtn.charging .ic.lvl .bat-bolt { display: inline; }

/* --- Settings: account & users --- */
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 8px; }
.acct-pw summary { cursor: pointer; color: #60a5fa; font-size: 13px; margin: 4px 0 8px; }
.users-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.user-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #0f172a; border: 1px solid #334155; border-radius: 9px; }
.user-row .u-name { flex: 1; font-weight: 600; }
.user-row .u-role { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: #334155; color: #cbd5e1; }
.user-row .u-role.admin { background: #1d4ed8; color: #fff; }
.user-row button { padding: 4px 8px; font-size: 12px; }
/* Wi-Fi and 4G bars are always blue; strength shows as how many are lit. */
#wifiIcon.lvl:not(.none), #modemIcon.lvl:not(.none) { color: #60a5fa; }

/* ================= Settings sheet (mobile-first) ================= */
.settings-sheet { width: min(520px, 94vw); gap: 12px; overflow-x: hidden; box-sizing: border-box; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-close { background: none; border: 0; color: var(--muted); font-size: 28px; line-height: 1; padding: 0 4px; cursor: pointer; }
.tabs { display: flex; gap: 4px; padding: 4px; background: #0f172a; border-radius: 10px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .tab { flex: 1 0 auto; white-space: nowrap; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.tabs .tab.active { background: #334155; color: #fff; }
.tab-panel { display: flex; flex-direction: column; gap: 12px; }
.set-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; }
.set-card h3 { margin: 0; font-size: 14px; color: #e2e8f0; }
.set-card .sub, .settings-sheet .sub { color: #64748b; font-weight: 400; }
.sub-note { margin: -4px 0 0; font-size: 12px; color: #94a3b8; line-height: 1.4; }
.settings-sheet input, .settings-sheet select { width: 100%; box-sizing: border-box; font-size: 16px; padding: 10px 12px; }
.settings-sheet .row { gap: 10px; }
.btn { border: 0; border-radius: 9px; padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer; color: #e2e8f0; background: #334155; }
.btn:disabled { opacity: .55; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-ghost { background: transparent; border: 1px solid #475569; }
.btn-danger { background: transparent; border: 1px solid #7f1d1d; color: #fca5a5; }
.btn-sm { padding: 7px 10px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 13px; font-size: 15px; }
/* Who's signed in: avatar + full name (a long email wraps, never cut off) on the
   first line, the buttons sharing the line below. */
.who-card { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 12px; }
.who-text { flex: 1 1 calc(100% - 52px); min-width: 0; }
.who-name { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.who-card > .btn { flex: 1 1 0; justify-content: center; }
.who-role { font-size: 12px; color: #94a3b8; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; background: #1d4ed8; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; text-transform: uppercase; }
.users-list { display: flex; flex-direction: column; gap: 8px; }
.user-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; }
.user-top { display: flex; align-items: center; gap: 10px; }
.user-top .u-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.user-top .you { font-weight: 400; color: #64748b; font-size: 12px; }
.u-role { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #334155; color: #cbd5e1; }
.u-role.admin { background: #1d4ed8; color: #fff; }
.user-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.user-actions .btn { flex: 1 1 auto; }
@media (max-width: 600px) {
  #settingsModal { align-items: flex-end; }
  .settings-sheet { width: 100vw; max-width: 100vw; max-height: 92vh; border-radius: 16px 16px 0 0; border-bottom: 0;
    padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); }
  .settings-sheet .row { flex-direction: column; }
}

/* The hidden attribute always wins over component display rules. */
[hidden] { display: none !important; }

/* ================= Header chips: one consistent style ================= */
.hud-stat .hud-stack { gap: 1px; }
.hud-stat .v { color: #f1f5f9; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
/* (1.158.6) the small line under each value too: "20 sats" / "21 sats" are different widths in this font, and the whole
   row of chips - laid out from the right - moved a few pixels left and right each time the count flipped (twice a second) */
.hud-stat .hud-sub { font-variant-numeric: tabular-nums; }
.hud-stat .v.warn { color: #fbbf24; }
.hud-stat .v.bad { color: #f87171; }
.hud-stat .v.off { color: #64748b; }
.hud-stat .hud-sub { color: #94a3b8; font-size: 9.5px; font-weight: 500; letter-spacing: .02em; }
.hud-stat .hud-sub.warn { color: #fbbf24; }
.hud-stat .hud-sub.bad { color: #f87171; }
.hud-stat .hud-sub.off { color: #64748b; }
/* (1.158.326) the link chip on an lmmow mower: two equal lines, each with its own light - LuLuMate server, Mammotion cloud */
#bleStat .lm-short { display: none; }   /* (1.158.337) "LLM" on phones (the 700 px block below) */
#bleStat.link-dual .v, #bleStat.link-dual .hud-sub { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  letter-spacing: .01em; color: var(--p-text-2, #cbd5e1); }
.link-lamp { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--p-text-3, #64748b); }
.link-lamp.ok { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, .7); }
.link-lamp.warn { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, .7); }
.link-lamp.bad { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, .7); }
/* Every chip icon is the same blue; a chip with no data greys its icon. */
.hud-stat .ic, .hud-stat .ic.lvl.good, .hud-stat .ic.lvl.mid, .hud-stat .ic.lvl.low,
#wifiIcon.lvl:not(.none), #modemIcon.lvl:not(.none) { color: #60a5fa; }
.hud-stat .ic.lvl.none, .hud-stat.chip-off .ic { color: #64748b; }

/* ================= Header on phones: two tidy rows ================= */
/* Row 1: connection, mower state … schedules, settings.
   Row 2: the five status chips, equal width, filling the line. */
@media (max-width: 700px) {
  #hud { flex-wrap: wrap; row-gap: 8px; column-gap: 8px; padding-bottom: 8px; }
  #hud .hud-rest { display: contents; }
  #hud::after { content: ''; flex-basis: 100%; order: 5; height: 0; }
  #connBtn { order: 1; }
  #stateBtn { order: 2; }
  #schedulesBtn { order: 3; margin-left: auto; }
  #settingsBtn { order: 4; }
  /* Rain delay: only its icon, beside the calendar. Pressing it says what is going on and when it resumes. */
  #rainStat { order: 3; margin-left: auto; flex: none; justify-content: center; width: 34px; height: 32px; padding: 0; }
  #rainStat .v { display: none; }
  #quietStat { order: 3; margin-left: auto; flex: none; justify-content: center; width: 34px; height: 32px; padding: 0; }
  #quietStat .v { display: none; }
  #quietStat:not([hidden]) ~ #rainStat, #quietStat:not([hidden]) ~ #schedulesBtn { margin-left: 0; }
  #rainStat:not([hidden]) ~ #schedulesBtn { margin-left: 0; }
  #batteryBtn, #wifiStat, #bleStat, #modemStat, #gpsStat {
    order: 10; flex: 1 1 0; min-width: 0; justify-content: center;
    height: 40px; padding: 4px 3px; gap: 3px;
  }
  /* Five chips share one row, so the text scales with the screen: full size
     on bigger phones, a touch smaller on narrow ones — never cut off. */
  #batteryBtn .ic, #wifiStat .ic, #bleStat .ic, #modemStat .ic, #gpsStat .ic { width: 14px; height: 14px; flex: none; }
  .hud-stat .v { font-size: clamp(11.5px, 3.4vw, 13px); }
  .hud-stat .hud-sub { font-size: clamp(7.5px, 2.2vw, 9px); letter-spacing: 0; }
  .hud-stat .hud-stack { min-width: 0; }
  .hud-stat .hud-stack > * { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  #bleStat.link-dual .v, #bleStat.link-dual .hud-sub { font-size: clamp(9px, 2.6vw, 11px); gap: 4px; }
  #bleStat .lm-long { display: none; }
  #bleStat .lm-short { display: inline; }
}
/* (1.158.922) The smallest phones (320 px wide: the first iPhone SE, or Display Zoom on a small iPhone): a little less room
   between and inside the chips, so "100%" and "Standby" fit whole - they were cut short there. */
@media (max-width: 340px) {
  #hud { column-gap: 4px; }
  #batteryBtn, #wifiStat, #bleStat, #modemStat, #gpsStat { padding: 4px 1px; gap: 2px; }
}

/* Bottom-left resize grip (mirror of the bottom-right one). */
.camera-resize.left { right: auto; left: 0; cursor: nesw-resize; }
.camera-resize.left::before { right: auto; left: 3px; border-right: 0; border-left: 2px solid var(--muted); border-radius: 0 0 0 2px; }

/* Planned wake-up from low-power idle: informational, not an alarm. */
#notice.waking { background: #1e40af; border-color: #3b82f6; }


/* ================= Phones: one scrollable row of buttons ================= */
/* A single horizontally-scrolling strip instead of three wrapped rows, so the
   map gets the height back. Swipe sideways for the rest; the fade at the edge
   hints there is more. */
@media (max-width: 700px) {
  #controls {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-top: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
            mask-image: linear-gradient(to right, #000 88%, transparent);
  }
  #controls::-webkit-scrollbar { display: none; }
  #controls button {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 9px 12px;
    min-height: 40px;
  }
}


/* ================= Window footers: one rule everywhere ================= */
/* Main action on the left filling the row; Close always on the right at a
   fixed width. The order property enforces it whatever the markup order is. */
.modal-actions { justify-content: flex-end; flex-wrap: wrap; }     /* (three buttons on a phone: none cut off) */
.modal-actions > button { order: 1; flex: 1 1 auto; }
/* Close: same size, same place (bottom-right) in every window and tab —
   never stretched, whether or not there is a main action beside it. */
.modal-actions > button.secondary { order: 2; flex: 0 0 112px; }

/* ================= Settings: identical frame on every tab ================= */
/* The sheet keeps one height whatever tab is open: header, tabs and footer
   stay put and only the tab body scrolls. */
.settings-sheet { height: min(680px, 90vh); overflow: hidden; }
.settings-sheet .tab-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.settings-sheet .modal-msg:empty { display: none; }
.settings-sheet .modal-actions { margin-top: 0; padding-top: 12px; border-top: 1px solid #1e293b; }
@media (max-width: 600px) { .settings-sheet { height: 88vh; max-height: 88vh; } }

/* One button system inside the sheet: every row action is the same outlined
   36px button; the one main action per card is the full-width blue button,
   the same height as the footer buttons. */
.settings-sheet .btn { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 8px;
  background: transparent; border: 1px solid #475569; color: #e2e8f0; }
.settings-sheet .btn:hover:not(:disabled) { background: #1e293b; }
.settings-sheet .btn-danger { border-color: #7f1d1d; color: #fca5a5; }
.settings-sheet .btn-danger:hover:not(:disabled) { background: rgba(127, 29, 29, .25); }
.settings-sheet .btn-primary { height: 42px; width: 100%; font-size: 14px; background: #2563eb; border-color: #2563eb; color: #fff; }
.settings-sheet .btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.settings-sheet .btn:disabled { opacity: .4; cursor: not-allowed; }
.settings-sheet .modal-actions > button { height: 42px; min-height: 42px; }
/* Every user card has the same three equal buttons. */
.user-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.user-actions .btn { min-width: 0; padding: 0 6px; }
.user-actions .btn { height: auto; min-height: 36px; padding: 4px 6px; white-space: normal; line-height: 1.2; overflow-wrap: anywhere; font-size: 12.5px; }

/* ================= Schedules: list view / editor view ================= */
.sched-sheet { height: min(760px, 90vh); overflow: hidden; }
.sched-sheet .plans-list, .sched-sheet .plans-form { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
.sched-sheet .plans-form { margin-top: 0; border-top: 0; padding-top: 0; }
.sched-sheet .plans-form > .form-section:first-of-type { margin-top: 12px; }
.sched-sheet .modal-msg:empty { display: none; }
.sched-sheet .modal-actions { margin-top: 0; padding-top: 12px; border-top: 1px solid #1e293b; }
.sched-sheet .modal-actions > button { height: 42px; min-height: 42px; }
/* Area chips: the whole pill is the checkbox. */
.modal-card .chip-row label { flex-direction: row; padding: 8px 14px; font-size: 14px; color: var(--text); }
.chip-row input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.chip-row label { position: relative; }
.chip-row label:has(input:focus-visible) { outline: 2px solid #60a5fa; }
/* Uniform row buttons: 36px squares, toggle a little wider. */
.plan-actions button { height: 36px; min-width: 36px; justify-content: center; padding: 0 8px; }
.plan-actions .plan-toggle { min-width: 44px; }
@media (max-width: 600px) {
  #scheduleModal { align-items: flex-end; padding: 0; }
  .sched-sheet { width: 100vw; max-width: 100vw; height: 88vh; max-height: 88vh; border-radius: 16px 16px 0 0; border-bottom: 0;
    padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); box-sizing: border-box; }
  .plan-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .plan-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid label.span-3 { grid-column: 1 / -1; }
}

/* ================= Activity log + toasts ================= */
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; margin-left: 6px; flex: none;
  box-shadow: 0 0 0 2px #0f172a; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); top: 64px; z-index: 1550;
  display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 12px;
  background: #0f172aee; border: 1px solid #334155; color: #e2e8f0; font-size: 13.5px; line-height: 1.35;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); cursor: pointer; backdrop-filter: blur(6px);
  animation: toast-in .18s ease-out; }
.toast.out { opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.toast .lvl, .act-row .lvl { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: #64748b; }
.lvl.ok { background: #22c55e; } .lvl.info { background: #3b82f6; } .lvl.warn { background: #f59e0b; } .lvl.error { background: #ef4444; }
.toast.error { border-color: #7f1d1d; } .toast.warn { border-color: #78350f; }

.activity-sheet { width: min(560px, 94vw); height: min(680px, 90vh); overflow: hidden; }
.activity-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 6px; }
.act-row { display: flex; gap: 10px; padding: 10px 12px; background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; }
.act-row .txt { flex: 1; min-width: 0; font-size: 13.5px; color: #e2e8f0; overflow-wrap: anywhere; }
.act-row .meta { display: block; margin-top: 2px; font-size: 11.5px; color: #64748b; }
.act-row.error { border-color: #450a0a; } .act-row.warn { border-color: #451a03; }
.activity-empty { color: var(--muted); text-align: center; padding: 30px 10px; font-size: 13px; }
.activity-sheet .modal-actions { margin-top: 0; padding-top: 12px; border-top: 1px solid #1e293b; }
.activity-sheet .modal-actions > button { height: 42px; min-height: 42px; }
@media (max-width: 600px) {
  #activityModal { align-items: flex-end; padding: 0; }
  .activity-sheet { width: 100vw; max-width: 100vw; height: 88vh; max-height: 88vh; border-radius: 16px 16px 0 0; border-bottom: 0;
    padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); box-sizing: border-box; }
}

/* ================= Layering: joystick always on top of the camera ============
   camera window 1100 / maximized 1400 / full-screen 1500
   < joystick 1510 < toasts 1550 < windows (modals) 1600.
   So whenever driving is possible the stick stays usable over the video,
   however big the camera is, while a window still covers everything. */
#joystick { z-index: 1510; }
.modal { z-index: 1600; }
/* Full-screen camera (phone on its side) covers the button bar too, so pin the
   stick to the screen's bottom-left corner instead of the map's. */
@media (orientation: landscape) and (pointer: coarse) {
  body:has(.camera-panel:not(.hidden)) #joystick {
    position: fixed;
    left: calc(16px + env(safe-area-inset-left, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    background: rgba(15, 23, 42, 0.55);
  }
}
.sheet-head .title-row { flex: 1 1 auto; min-width: 0; }

/* Settings → Log */
.settings-sheet .log-panel { overflow: hidden; }
.log-panel .activity-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.seg { display: inline-flex; align-self: flex-start; gap: 2px; padding: 3px; background: #0f172a; border: 1px solid #1e293b; border-radius: 999px; }
.seg-btn { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.seg-btn.active { background: #334155; color: #fff; }
.camera-panel:not(.hidden) #cameraCanvas, .camera-panel:not(.hidden) #cameraMjpeg { width: 100%; height: 100%; object-fit: cover; }

/* Full-screen hint over the video (rotate → "Tap for full screen"). */
.camera-fs-hint { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 3; padding: 8px 14px; border-radius: 999px; background: rgba(15, 23, 42, .78); color: #e2e8f0;
  font-size: 13px; font-weight: 600; pointer-events: none; width: max-content; max-width: 92%; box-sizing: border-box; text-align: center; }
/* In browser full screen the camera panel covers everything, phone or desktop. */
:fullscreen .camera-panel:not(.hidden), :-webkit-full-screen .camera-panel:not(.hidden) {
  position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100vh !important; height: 100dvh !important;
  max-width: none !important; max-height: none !important; border: 0 !important; border-radius: 0 !important; z-index: 1500; background: #000; }
:fullscreen .camera-panel:not(.hidden) .camera-resize, :-webkit-full-screen .camera-panel:not(.hidden) .camera-resize { display: none; }

/* ================= Schedule editor on phones: no sideways scrolling =========
   Grid columns default to "at least as wide as their content", and iPhone
   Safari gives date/time inputs a large built-in minimum width — together they
   pushed the form wider than the screen. Columns may shrink to zero, every
   field fills (and never exceeds) its column, and the editor can't scroll
   sideways at all. */
.form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid > label { min-width: 0; }
.plans-form input, .plans-form select { min-width: 0; max-width: 100%; box-sizing: border-box; }
.plans-form input[type="date"], .plans-form input[type="time"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0;
}
.plans-form input::-webkit-date-and-time-value { text-align: left; }
.sched-sheet, .sched-sheet .plans-form { overflow-x: hidden; }
.chip-row { max-width: 100%; }
.week-row { flex-wrap: wrap; max-width: 100%; }
@media (max-width: 600px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
/* Single action buttons inside a settings card sit left, natural width. */
.set-card > .btn { align-self: flex-start; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.settings-sheet a.btn { display: inline-flex; align-items: center; text-decoration: none; }

/* ================= Alerts in the header (replaces floating toasts) ======== */
.hud-msg { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px;
  /* Shrinks long before the status chips do, so they never get squeezed. */
  flex: 0 100 auto; min-width: 0; max-width: min(46vw, 560px);
  background: #1e293b; border: 1px solid #334155; border-radius: 8px; color: #e2e8f0;
  font-size: 13px; font-weight: 500; cursor: pointer; }
.hud-msg .hud-msg-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-msg .lvl { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #64748b; margin: 0; }
.hud-msg.error { border-color: #7f1d1d; background: #2a1215; }
.hud-msg.warn { border-color: #78350f; background: #2a1d0e; }
.hud-msg.ok { border-color: #14532d; }
.hud-msg.in { animation: hud-msg-in .25s ease-out; }
@keyframes hud-msg-in { from { opacity: 0; transform: translateY(-3px); } }
@media (max-width: 700px) {
  /* Phone: the alert sits at the bottom of the screen, just above the button
     bar (JS measures the bar and, when the joystick is showing, starts the
     alert to its right so it never lands under your thumb while driving).
     Up to two lines, so a message can be read rather than cut to "…". */
  #hudMsg {
    position: fixed; z-index: 1520;
    left: 12px; right: 12px; bottom: 76px;
    height: auto; min-height: 40px; padding: 8px 12px;
    max-width: none; font-size: 13.5px; line-height: 1.3;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  }
  #hudMsg .hud-msg-text {
    white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  @keyframes hud-msg-in { from { opacity: 0; transform: translateY(6px); } }
}


/* ================= In-app confirmation window ================= */
#askModal { z-index: 1700; }  /* above other windows it's opened from */
.ask-card { width: min(420px, 92vw); gap: 12px; }
.ask-text { margin: 0; color: #cbd5e1; font-size: 14px; line-height: 1.45; white-space: pre-line; }
.ask-card input { width: 100%; font-size: 16px; padding: 10px 12px; }
/* (1.158.438) New features popup (whatsnew.json): one card per feature, its "Show me" under the words */
#whatsNewModal { z-index: 1650; }  /* above Settings (Show Recent New Features), under the confirmation window */
.wn-list { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; }
.wn-item { display: grid; gap: 6px; justify-items: start; padding: 10px 12px; border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35); }
.wn-list .wn-item:only-child { padding: 0; border: 0; }
.wn-item p { margin: 0; color: #cbd5e1; font-size: 14px; line-height: 1.45; }
/* Choices in the ask dialog (e.g. what a saved shape is) */
.ask-choices { display: grid; gap: 8px; }
.ask-card .ask-choice { display: flex !important; flex-direction: row !important; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border-radius: 12px; cursor: pointer; border: 1px solid rgba(148, 163, 184, 0.35); text-align: left; }
.ask-choice:has(input:checked) { border-color: #22c55e; background: rgba(34, 197, 94, 0.08); }
.ask-card .ask-choice input[type=radio], .ask-card .ask-choice input[type=radio]:focus {
  -webkit-appearance: none !important; appearance: none !important; width: 20px !important; height: 20px !important;
  min-height: 0 !important; margin: 1px 0 0 !important; padding: 0 !important; flex: none; border-radius: 50% !important;
  border: 2px solid #94a3b8 !important; background: transparent !important; box-shadow: none !important; outline: none !important; }
/* the dot is part of the background, so a theme's focus ring or field colour can't hide it */
.ask-card .ask-choice input[type=radio]:checked, .ask-card .ask-choice input[type=radio]:checked:focus {
  border-color: #16a34a !important; background: radial-gradient(circle, #16a34a 0 4.5px, transparent 5.5px) !important; }
.ask-card .ask-choice input[type=radio]:focus-visible { box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.3) !important; }
.ask-choice b { display: block; font-size: 14.5px; }
.ask-choice .sub { display: block; font-size: 12.5px; opacity: 0.75; margin-top: 2px; }
.ask-msg { min-height: 0; font-size: 13px; color: #f87171; }
.ask-msg:empty { display: none; }
.modal-actions > button.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.modal-actions > button.danger:hover { background: #b91c1c; }

/* ================= Manual mowing: blades button above the joystick ======== */
.blade-btn {
  position: absolute; z-index: 1510;
  left: 42px; bottom: 172px;                 /* centred over the 140 px joystick */
  width: 96px; height: 40px; border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(30, 41, 59, 0.92); border: 2px solid #475569; color: #e2e8f0;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.blade-btn .ic { width: 16px; height: 16px; }
.blade-btn:disabled { opacity: .45; cursor: not-allowed; }
.blade-btn.on { background: #dc2626; border-color: #fecaca; color: #fff; animation: blade-pulse 1.2s steps(4) infinite; }
@keyframes blade-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .7); } 50% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); } }
@media (display-mode: standalone) {
  .blade-btn { left: 18px; bottom: calc(130px + env(safe-area-inset-bottom, 0px)); }  /* over the 104 px stick */
}

/* Weak satellite fix (RTK float / GPS only): amber, stays until the fix is good. */
.pos-badge.warn { background: rgba(217, 119, 6, 0.94); color: #fff; }

/* ================= Pi CPU graph in the header (desktop only) ============= */
.cpu-stat { gap: 6px; }
.cpu-stat canvas { width: 60px; height: 22px; display: block; }
@media (max-width: 700px), (pointer: coarse) {
  .cpu-stat { display: none !important; }
}

/* Stations on the map: round, fixed-size badges (charging station, RTK base). */
.station-marker {
  display: flex; align-items: center; justify-content: center;
  background: #0f172a; border: 2px solid; border-radius: 50%;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); box-sizing: border-box;
}
.station-marker svg { width: 62%; height: 62%; }
.dock-marker { border-color: #facc15; }
/* The charging station: the Mammotion app's dock marker, no badge or shadow. */
.dock-img-marker { background: transparent; border: none; }
.dock-img-marker img { width: 100%; height: 100%; display: block; pointer-events: none; }
.dock-img-marker .dock-rot { width: 100%; height: 100%; transform-origin: center; }
.dock-marker svg { fill: #facc15; }
.rtk-marker { border-color: #c084fc; }
.rtk-marker svg { stroke: #c084fc; }
.rtk-marker svg .fill { fill: #c084fc; stroke: none; }

/* Manual mowing row in the Cutting window. */
.blade-row .blade-start {
  width: 100%; height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 8px; border: 1px solid #dc2626; background: transparent; color: #fca5a5;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.blade-row .blade-start .ic { width: 16px; height: 16px; }
.blade-row .blade-start.on { background: #dc2626; color: #fff; animation: blade-pulse 1.2s steps(4) infinite; }
.blade-row .blade-start:disabled { opacity: .45; cursor: not-allowed; animation: none; }

/* Settings → Autonomy */
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.settings-sheet .check-row input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; padding: 0; }
/* The general ".modal-card label" stacks things vertically — keep a checkbox
   on the same line as its text. */
.modal-card label.check-row { flex-direction: row; align-items: flex-start; font-size: 14px; color: var(--text); gap: 10px; }
.modal-card label.check-row .sub { font-size: 13px; }
.settings-sheet p.sub { margin: 0; font-size: 13px; line-height: 1.4; }
.ai-result { display: flex; flex-direction: column; gap: 8px; }
.ai-result img { width: 100%; border-radius: 8px; border: 1px solid #1e293b; }
.ai-result p { margin: 0; font-size: 13px; line-height: 1.45; color: #cbd5e1; }
.ai-result p.err { color: #fca5a5; }

/* ================= Spot mowing panel (over the map, map stays usable) ===== */
.spot-panel {
  position: absolute; z-index: 1450; left: 50%; transform: translateX(-50%);
  bottom: 12px; width: min(420px, calc(100% - 24px)); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: rgba(15, 23, 42, 0.96); border: 1px solid #334155; border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.spot-panel.hidden { display: none; }
/* Never taller than the screen: what doesn't fit scrolls inside the window
   (a moved window gets a max-height for the room below it, see spotPlace). */
.spot-panel { max-height: calc(100% - 24px); overflow-y: auto; overscroll-behavior: contain; }
.spot-panel > * { flex-shrink: 0; }
.spot-panel h2 { margin: 0; font-size: 17px; }
.spot-head { display: flex; align-items: center; gap: 10px; }
.spot-head .modal-msg { margin-left: auto; }
.spot-state { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #334155; color: #cbd5e1; }
.spot-state.ready { background: rgba(37, 99, 235, .25); color: #93c5fd; }
.spot-state.mowing { background: rgba(34, 197, 94, .2); color: #86efac; }
.spot-state.stopped { background: rgba(245, 158, 11, .2); color: #fcd34d; }
.spot-state.done { background: rgba(34, 197, 94, .2); color: #86efac; }
/* (1.158.989) the colour styles set every .spot-state grey, so Mowing in the Mow window's header wasn't green (owner:
   "just having 1 Mowing in green at the top"): its state's colour wins over them, in dark and light styles alike */
html .spot-head .spot-state.mowing, html .spot-head .spot-state.done { background: rgba(34, 197, 94, .2); color: #86efac; }
html .spot-head .spot-state.stopped { background: rgba(245, 158, 11, .2); color: #fcd34d; }
html.theme-light .spot-head .spot-state.mowing, html.theme-light .spot-head .spot-state.done { background: rgba(22, 163, 74, .14); color: #15803d; }
html.theme-light .spot-head .spot-state.stopped { background: rgba(217, 119, 6, .14); color: #b45309; }
.spot-alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px;
  background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .35); }
.spot-alert[hidden] { display: none; }
.spot-alert .ic { width: 18px; height: 18px; flex: 0 0 18px; color: #fbbf24; margin-top: 1px; }
.spot-alert div { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; line-height: 1.4; color: #fde68a; }
.spot-alert b { color: #fcd34d; }
.spot-alert .spot-alert-act { align-self: flex-start; margin-top: 6px; }
.spot-alert .spot-alert-act[hidden] { display: none; }
.spot-alert.ok { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .35); }
.spot-alert.ok .ic, .spot-alert.ok b { color: #86efac; }
.spot-alert.ok div { color: #bbf7d0; }
.spot-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.spot-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spot-settings[hidden] { display: none; }
.spot-slider { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #94a3b8; }
.spot-slider b { color: #e2e8f0; font-variant-numeric: tabular-nums; }
.spot-slider input[type=range] { width: 100%; accent-color: #2563eb; }
.spot-slider.unavailable { opacity: .5; }
.spot-slider.spot-wide { grid-column: 1 / -1; }
.spot-slider input:disabled { opacity: .55; }
/* The settings box lists the mow shapes placed (a spot, a line, a no-go zone / line), so one can be picked
   without hunting for it on the map - the dot shows its kind (owner, 2026-10-20: "put the shapes under the
   settings for each, spot, nogo"). */
.spot-nogo-list[hidden] { display: none; }
/* The shapes placed: tiles like the pickers above, each with its own outline in its kind's colour (--k). */
.spot-nogo-item svg polygon, .spot-nogo-item svg polyline { stroke: var(--k); }
.spot-nogo-item svg polygon { fill: color-mix(in srgb, var(--k) 22%, transparent); }
.spot-nogo-item svg polyline { stroke-width: 2.4; }
.spot-patterns .spot-nogo-item[aria-checked="true"] { border-color: var(--k); background: color-mix(in srgb, var(--k) 16%, transparent); }
.spot-stats[hidden] { display: none; }
.spot-stats span { padding: 3px 9px; border-radius: 6px; background: #1e293b; border: 1px solid #334155; font-size: 12.5px; color: #e2e8f0; }
.spot-tools button { display: inline-flex; align-items: center; gap: 5px; }
.spot-tools .ic { width: 14px; height: 14px; }
#spotStart { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#spotStart .ic { width: 16px; height: 16px; }
.spot-info { margin: 0; font-size: 12.5px; line-height: 1.4; color: #94a3b8; }
.spot-info:empty { display: none; }
.spot-tools { display: flex; gap: 8px; }
.spot-progress { height: 8px; background: #1e293b; border-radius: 4px; overflow: hidden; }
.spot-progress > div { height: 100%; width: 0; background: #22c55e; transition: width .4s; }
.spot-panel .modal-actions { margin-top: 0; }
.spot-panel .modal-actions button.secondary { width: 112px; flex: 0 0 112px; }
.modal-actions button.danger { background: #dc2626; border-color: #dc2626; }
.modal-actions button:disabled { opacity: .45; cursor: not-allowed; }
.spot-vertex { cursor: move; touch-action: none; }
.spot-vertex { background: #f59e0b; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.spot-nogo .spot-vertex { background: #ef4444; }
.spot-nogo .spot-side { border-color: #ef4444; }
.spot-vertex.mini { border-width: 1.5px; box-shadow: 0 1px 2px rgba(0,0,0,.45); }
.spot-vertex.mini.off { display: none; }
/* The middle of each side: drag it to move just that side. */
.spot-side { pointer-events: none !important; background: #fff; border: 2px solid #f59e0b; border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.4); }
#map.spot-drawing { cursor: crosshair; }
/* Over the spot shape: resize across a side, move inside (set by map.js). Also
   over lawn polygons under it, which otherwise show their own pointer. */
#map.spot-cur-ew, #map.spot-cur-ew .leaflet-interactive { cursor: ew-resize !important; }
#map.spot-cur-ns, #map.spot-cur-ns .leaflet-interactive { cursor: ns-resize !important; }
#map.spot-cur-nwse, #map.spot-cur-nwse .leaflet-interactive { cursor: nwse-resize !important; }
#map.spot-cur-nesw, #map.spot-cur-nesw .leaflet-interactive { cursor: nesw-resize !important; }
#map.spot-cur-move, #map.spot-cur-move .leaflet-interactive { cursor: move !important; }
#map.spot-cur-rotate, #map.spot-cur-rotate .leaflet-interactive { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 1 0-2.34 5.66' stroke='%23fff' stroke-width='4.5'/%3E%3Cpath d='M20 4v7h-7' stroke='%23fff' stroke-width='4.5'/%3E%3Cpath d='M20 11a8 8 0 1 0-2.34 5.66' stroke='%23111827' stroke-width='2'/%3E%3Cpath d='M20 4v7h-7' stroke='%23111827' stroke-width='2'/%3E%3C/svg%3E") 12 12, alias !important; }
#mapControls button.active { background: #f59e0b; border-color: #fde68a; color: #0f172a; }

.rec-img { width: 100%; border-radius: 10px; border: 1px solid #1e293b; }

/* Spot-mow ruler: edge lengths at the midpoints. */
.spot-len { width: 0; height: 0; }
.spot-len span, .area-len span { position: absolute; white-space: nowrap; pointer-events: none;
  font-size: 10px; font-weight: 600; letter-spacing: .01em; line-height: 1; }
.spot-len span { color: rgba(254, 240, 138, .95); }
.area-len span { color: rgba(255, 255, 255, .75); font-weight: 500; }
/* Blade height + speed while mowing, under the zoom buttons. */
.mow-info { background: rgba(15, 23, 42, 0.78); color: #e2e8f0; border-radius: 6px; padding: 3px 7px;
  font-size: 12px; line-height: 1.35; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.mow-info[hidden] { display: none; }
.mow-info b { color: #fff; font-weight: 700; }
.mow-info .mi-k { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; opacity: .75; }
.mow-info .mi-sep { margin: 0 4px; opacity: .6; }

/* Drag the spot-mow shape by its inside. */
.spot-poly { cursor: move; }
.spot-poly { stroke-width: 3px; }
#map.spot-drawing { touch-action: none; }
/* Side lengths on the mapped lawn areas: each where its number fits beside its side (1.159.51, map.js declutterLengths;
   hidden ones keep their size so they can be measured again). */
.area-len { width: 0; height: 0; }
.area-len.len-hidden { visibility: hidden; }
/* (1.158.500) a guide line's watermark label: tiny and faint, on the line */
.guide-label { width: 0; height: 0; }
.guide-label span { position: absolute; white-space: nowrap; pointer-events: none; font-size: 8px; font-weight: 600;
  letter-spacing: .06em; line-height: 1; color: rgba(255, 255, 255, .5); text-shadow: 0 0 2px rgba(46, 16, 101, .6); }
/* (1.158.588) Spot Mow: a piece of an area its virtual walls cut off - tap to mow that piece instead */
.spot-piece-pick { width: 0; height: 0; }
.spot-piece-pick button { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font: inherit;
  font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35);
  background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); cursor: pointer; }


/* Spot-mow rotate handle. */

/* ================= Learn Dock panel (camera + joystick stay usable) ======= */
.learn-panel {
  position: absolute; z-index: 1450; left: 50%; transform: translateX(-50%);
  bottom: 12px; width: min(460px, calc(100% - 24px)); box-sizing: border-box;
  max-height: calc(100% - 24px);
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: rgba(15, 23, 42, 0.96); border: 1px solid #334155; border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.learn-panel.hidden { display: none; }
.learn-panel h2 { margin: 0; font-size: 17px; }
.learn-geo { margin: 0; font-size: 13.5px; line-height: 1.4; color: #cbd5e1; }
.learn-geo b { color: #e2e8f0; }
/* The AI's answer in full: wraps and scrolls instead of being cut off. */
.learn-ai {
  white-space: pre-wrap; overflow-wrap: anywhere; overflow-y: auto;
  min-height: 64px; max-height: 32vh; flex: 1 1 auto;
  font-size: 13.5px; line-height: 1.45; color: #e2e8f0;
  background: #0b1220; border: 1px solid #1e293b; border-radius: 10px; padding: 10px 12px;
}
.learn-ai.busy { color: #94a3b8; }
.learn-pics { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; flex: 0 0 auto; }
.learn-panel > .title-row, .learn-geo, .learn-panel .modal-actions { flex: 0 0 auto; }
.learn-pics:empty { display: none; }
.learn-pic { position: relative; flex: 0 0 auto; }
.learn-pic img { width: 84px; height: 63px; object-fit: cover; border-radius: 8px; border: 1px solid #334155; display: block; }
.learn-pic span { display: block; font-size: 10.5px; color: #94a3b8; max-width: 84px; overflow-wrap: anywhere; }
.learn-pic button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(15, 23, 42, 0.85); color: #fca5a5; font-size: 13px; line-height: 22px; padding: 0; cursor: pointer; }
.learn-panel .modal-actions { margin-top: 0; }
.learn-panel .modal-actions button.secondary { flex: 0 0 auto; }
/* Phone: between the camera window (top) and the joystick (bottom-left). */
@media (max-width: 700px) {
  .learn-panel { left: 8px; right: 8px; width: auto; transform: none;
    bottom: 176px; max-height: 50vh; }
  .learn-ai { max-height: 24vh; min-height: 90px; }
}
@media (max-width: 700px) and (display-mode: standalone) {
  .learn-panel { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); }
}

/* Learn Dock: correcting the AI on the last picture. */
.learn-panel { overflow-y: auto; }
.learn-panel > * { flex-shrink: 0; }
.learn-fix { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #1e293b; padding-top: 10px; }
.learn-fix[hidden] { display: none; }
.learn-fix-title { margin: 0; font-size: 13px; color: #94a3b8; }
.learn-shot { position: relative; align-self: flex-start; max-width: 100%; cursor: crosshair; }
.learn-shot img { display: block; width: 100%; max-width: 360px; border-radius: 8px; border: 1px solid #334155; }
.learn-mark { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  border: 3px solid #f59e0b; box-shadow: 0 0 0 2px rgba(0,0,0,.6); pointer-events: none; }
.learn-mark[hidden] { display: none; }
.learn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.learn-chips button { padding: 6px 10px; border-radius: 999px; border: 1px solid #334155; background: #0b1220;
  color: #cbd5e1; font-size: 12.5px; cursor: pointer; }
.learn-chips button.on { background: #f59e0b; border-color: #fde68a; color: #0f172a; font-weight: 600; }
.learn-fix input[type=text] { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px;
  border: 1px solid #334155; background: #0b1220; color: #e2e8f0; font-size: 14px; }
@media (max-width: 700px) { .learn-shot img { max-width: 100%; } }
#mapControls button[hidden] { display: none; }

.learn-fix-empty { margin: 0; font-size: 13px; color: #94a3b8; }
.learn-fix.empty .learn-shot, .learn-fix.empty .learn-chips, .learn-fix.empty input, .learn-fix.empty #learnFixSave,
.learn-fix.empty #learnFixTitle { display: none; }
.learn-fix:not(.empty) .learn-fix-empty { display: none; }
.learn-pic img { cursor: pointer; }
.learn-pic.sel img { border-color: #f59e0b; box-shadow: 0 0 0 2px #f59e0b; }

/* ===== Learn Dock v2: tabs, live view, picture browser ===== */
.learn-tabs { display: flex; gap: 6px; flex: 0 0 auto; }
.learn-tabs button { flex: 1; padding: 7px 10px; border-radius: 8px; border: 1px solid #334155;
  background: #0b1220; color: #cbd5e1; font-size: 13.5px; cursor: pointer; }
.learn-tabs button.on { background: #1e3a8a; border-color: #3b82f6; color: #fff; font-weight: 600; }
.learn-page { display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; }
.learn-page[hidden] { display: none; }
.learn-live { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3;
  border: 1px solid #334155; }
.learn-live img { width: 100%; height: 100%; object-fit: contain; display: block; }
.learn-live span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 13px; pointer-events: none; }
.learn-live.on span { display: none; }
.learn-ai.small { min-height: 0; max-height: 18vh; font-size: 12.5px; }
.learn-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.learn-nav button { padding: 7px 12px; border-radius: 8px; border: 1px solid #334155; background: #0b1220;
  color: #e2e8f0; font-size: 13.5px; cursor: pointer; }
.learn-nav button:disabled { opacity: .4; }
.learn-nav span { font-size: 13px; color: #cbd5e1; }
.learn-shot { position: relative; width: 100%; cursor: crosshair; }
.learn-shot img { display: block; width: 100%; max-width: none; border-radius: 8px; border: 1px solid #334155; }
.learn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.learn-row .btn { flex: 1 1 auto; }
.learn-row .danger-btn { background: #7f1d1d; border-color: #b91c1c; color: #fecaca; }
.learn-panel.pics-tab #learnSave, .learn-panel.pics-tab #learnAsk { display: none; }
@media (max-width: 700px) { .learn-panel { max-height: 62vh; } }
#learnNote { width: 100%; box-sizing: border-box; padding: 9px 11px; border-radius: 8px;
  border: 1px solid #334155; background: #0b1220; color: #e2e8f0; font-size: 14px; }
#learnPicBody { display: flex; flex-direction: column; gap: 8px; }
#learnPicBody[hidden] { display: none; }

/* Learn Dock: move (drag the title) and resize (bottom-right corner). */
.learn-drag { cursor: move; touch-action: none; user-select: none; }
.learn-resize { position: absolute; right: 2px; bottom: 2px; width: 22px; height: 22px; cursor: nwse-resize;
  touch-action: none; z-index: 2;
  background: linear-gradient(135deg, transparent 50%, #64748b 50%, #64748b 60%, transparent 60%, transparent 70%, #64748b 70%, #64748b 80%, transparent 80%); }
.learn-panel.placed { transform: none; bottom: auto; right: auto; }
.learn-panel.placed .learn-ai { max-height: none; }
.learn-panel.placed .learn-page { flex: 1 1 auto; min-height: 0; }

/* Learn Dock: buttons pinned at the bottom, content scrolls above them. */
.learn-panel { overflow: hidden; }
.learn-panel > .learn-page { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.learn-panel > .learn-page[hidden] { display: none; }
.learn-panel > .modal-actions, .learn-panel > .learn-pic-actions { flex: 0 0 auto; }
.learn-panel.pics-tab > .modal-actions { display: none; }
.learn-pic-actions[hidden] { display: none; }
.learn-pic-actions { display: flex; gap: 6px; flex-wrap: nowrap; }
.learn-pic-actions .btn { flex: 1 1 0; min-width: 0; padding: 9px 6px; white-space: nowrap; font-size: 13.5px; }
@media (max-width: 700px) { .learn-panel { max-height: 64vh; } }

#learnPicAi { white-space: pre-wrap; }

/* Learn Dock: fixed-height panel, pages fit it exactly (no scrollbar). */
.learn-panel { height: min(700px, calc(100% - 24px)); }
@media (max-width: 700px) { .learn-panel { height: 64vh; max-height: calc(100% - 190px); } }
.learn-panel > .learn-page { overflow: hidden; display: flex; flex-direction: column; gap: 8px; }
.learn-panel .learn-live { flex: 1 1 auto; min-height: 90px; aspect-ratio: auto; }
.learn-panel .learn-live img { object-fit: contain; }
#learnAi, #learnPicAi { flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; }
#learnAi { max-height: 32%; }
#learnPicAi { max-height: 22%; }
#learnAi::-webkit-scrollbar, #learnPicAi::-webkit-scrollbar { display: none; }
#learnPicBody { flex: 1 1 auto; min-height: 0; overflow: hidden; }
#learnPicBody > * { flex-shrink: 0; }
#learnPicBody > .learn-shot { flex: 1 1 auto; min-height: 80px; width: 100%; display: flex; align-items: center; justify-content: center; }
#learnPicBody > #learnPicAi { flex-shrink: 1; }
.learn-shot-inner { position: relative; }
.learn-shot-inner img { display: block; width: 100%; height: 100%; max-width: none; border-radius: 8px; border: 1px solid #334155; }
#learnPicInfo { font-size: 12.5px; }

#learnFront { flex-wrap: nowrap; gap: 5px; }
#learnFront button { flex: 1 1 0; min-width: 0; padding: 6px 4px; font-size: 12px; white-space: normal; line-height: 1.2; overflow-wrap: anywhere; }
#learnPicBody { gap: 6px; }
#learnPicBody > .learn-shot { min-height: 60px; }
#learnPicAi { min-height: 0; padding: 6px 10px; }
.learn-nav button { padding: 5px 10px; }

/* AI Find Dock / recovery running: banner across the top of the map. */
.rec-banner {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 960;
  display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100% - 90px));
  background: var(--acc, #2563eb); color: #fff; padding: 6px 6px 6px 12px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.rec-banner.hidden { display: none; }
/* On a phone the camera window covers the top of the map (and it opens by itself
   during a recovery), so the banner moves to the bottom while it's open. */
@media (max-width: 700px) {
  body:has(#cameraPanel:not(.hidden)) .rec-banner { top: auto; bottom: 14px; }
}
.rec-banner.ask { background: rgba(217, 119, 6, 0.95); }
.rec-banner.ok { background: rgba(22, 163, 74, 0.94); }
.rec-banner.bad { background: rgba(220, 38, 38, 0.94); }
.rec-banner .rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; flex: none;
  animation: recPulse 1.2s ease-in-out infinite; }
.rec-banner.ok .rec-dot, .rec-banner.bad .rec-dot { animation: none; }
@keyframes recPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.3; transform: scale(0.6); } }
.rec-banner .rec-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.rec-banner .rec-text b { font-size: 12px; letter-spacing: 0.02em; }
.rec-banner .rec-text span { overflow-wrap: anywhere; }   /* (1.158.922) in full, never cut short */
.rec-banner button { flex: none; background: #fff; color: #b91c1c; border: 0; border-radius: 7px;
  padding: 7px 12px; font-weight: 700; font-size: 13px; cursor: pointer; }
.rec-banner button[hidden] { display: none; }
#stage.rec-on .pos-badge { top: calc(20px + var(--rec-h, 44px)); }   /* (1.158.922) under the banner, however tall its message makes it */
#mapControls button.active { background: var(--acc, #2563eb); color: #fff; animation: recGlow 1.6s ease-in-out infinite; }
@keyframes recGlow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--acc, #2563eb) 70%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
#stage.rec-on ~ #notice, body:has(#stage.rec-on) #notice { margin-top: calc(20px + var(--rec-h, 44px)); }
#mapControls button.on { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Dock detector (trained on the owner's labels) in Learn Dock. */
.learn-det { position: absolute; border: 2px solid #22c55e; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); pointer-events: none; }
.learn-det[hidden] { display: none; }
.learn-det-line { color: #94a3b8; }
.learn-det-line.hit { color: #4ade80; }
#learnSite { width: 100%; box-sizing: border-box; flex: none; font-size: 13px; }
.learn-guide { flex: none; font-size: 13px; color: #cbd5e1; }
.learn-guide summary { cursor: pointer; padding: 2px 0; }
#learnGuide { width: 100%; box-sizing: border-box; margin-top: 6px; font-size: 13px; line-height: 1.4; resize: vertical; }
.rec-banner .rec-text small { font-size: 11.5px; opacity: .9; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rec-banner .rec-text small[hidden] { display: none; }
.rec-banner .rec-text small { -webkit-line-clamp: unset; display: block; white-space: normal; }   /* tapped open: all of it */
.rec-banner.has-see .rec-text { cursor: pointer; }

.learn-site-photo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
.learn-site-photo img { width: 100%; max-height: 180px; object-fit: contain; border-radius: 8px; background: #0f172a; }
.learn-site-photo .small { font-size: 12px; color: #94a3b8; }

#cameraMjpeg[hidden] { display: none; }

.camera-quality { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 6px; font-size: 12px;
  background: rgba(15, 23, 42, 0.75); color: #fbbf24; pointer-events: none; z-index: 2; }
.camera-quality[hidden] { display: none; }
/* (1.158.130) the codec and the pictures' way (local / remote), small in the lower right corner */
.camera-badge { position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; border-radius: 5px; font-size: 11px;
  line-height: 1.3; letter-spacing: 0.02em; background: rgba(15, 23, 42, 0.55); color: rgba(255, 255, 255, 0.85);
  pointer-events: none; z-index: 2; font-variant-numeric: tabular-nums; }
.camera-badge[hidden] { display: none; }

.learn-mark.nogo { border-color: #ef4444; border-radius: 4px; }
.learn-det.nogo { border-color: #ef4444; border-style: dashed; }
.learn-pic-actions .nogo-btn { background: #7c2d12; color: #fed7aa; }
.learn-det-line.nogo-hit { color: #fca5a5; }

/* Learn Dock feedback */
.learn-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #cbd5e1; flex: none;
  background: #0f172a; border: 1px solid #1e293b; border-radius: 8px; padding: 5px 8px; }
.learn-status span { flex: 1 1 auto; min-width: 0; }
.learn-status.busy span::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -1px; background: #a5b4fc; -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222.4%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22/%3E%3Cpolyline%20points%3D%2212%207%2012%2012%2015%2014%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222.4%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22/%3E%3Cpolyline%20points%3D%2212%207%2012%2012%2015%2014%22/%3E%3C/svg%3E") center / contain no-repeat; }
.learn-mini-btn { flex: none; padding: 4px 10px; border-radius: 6px; border: 1px solid #334155; background: #1e293b;
  color: #e2e8f0; font-size: 12px; cursor: pointer; }
.learn-mini-btn:disabled { opacity: .5; }
.learn-legend { margin: 0; font-size: 11.5px; color: #94a3b8; display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; flex: none; }
.learn-legend span { display: inline-block; width: 11px; height: 11px; box-sizing: border-box; margin-left: 6px; }
.learn-legend span:first-child { margin-left: 0; }
.lg-mark { border: 2px solid #f59e0b; border-radius: 50%; }
.lg-det { border: 2px solid #22c55e; border-radius: 2px; }
.lg-nogo { border: 2px dashed #ef4444; border-radius: 2px; }
.learn-steps { list-style: none; margin: 0; padding: 6px 8px; flex: none; font-size: 13px; line-height: 1.45;
  background: #0f172a; border: 1px solid #1e293b; border-radius: 8px; }
.learn-steps[hidden] { display: none; }
.learn-steps li { padding: 1px 0 1px 22px; position: relative; color: #cbd5e1; }
.learn-steps li::before { content: ""; position: absolute; left: 1px; top: 4px; width: 14px; height: 14px; }
.learn-steps li.run::before { background: #a5b4fc; -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222.4%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22/%3E%3Cpolyline%20points%3D%2212%207%2012%2012%2015%2014%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222.4%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22/%3E%3Cpolyline%20points%3D%2212%207%2012%2012%2015%2014%22/%3E%3C/svg%3E") center / contain no-repeat; animation: lt-pulse 1.2s ease-in-out infinite; }
@keyframes lt-pulse { 50% { opacity: .35; } }
.learn-steps li.ok::before { background: #22c55e; -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%2220%206%209%2017%204%2012%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%2220%206%209%2017%204%2012%22/%3E%3C/svg%3E") center / contain no-repeat; }
.learn-steps li.warn::before { background: #f59e0b; -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222.4%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M10.3%203.9L1.8%2018a2%202%200%200%200%201.7%203h17a2%202%200%200%200%201.7-3L13.7%203.9a2%202%200%200%200-3.4%200z%22/%3E%3Cline%20x1%3D%2212%22%20y1%3D%229%22%20x2%3D%2212%22%20y2%3D%2213%22/%3E%3Cline%20x1%3D%2212%22%20y1%3D%2217%22%20x2%3D%2212.01%22%20y2%3D%2217%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222.4%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M10.3%203.9L1.8%2018a2%202%200%200%200%201.7%203h17a2%202%200%200%200%201.7-3L13.7%203.9a2%202%200%200%200-3.4%200z%22/%3E%3Cline%20x1%3D%2212%22%20y1%3D%229%22%20x2%3D%2212%22%20y2%3D%2213%22/%3E%3Cline%20x1%3D%2212%22%20y1%3D%2217%22%20x2%3D%2212.01%22%20y2%3D%2217%22/%3E%3C/svg%3E") center / contain no-repeat; }
.learn-steps li.bad::before { background: #ef4444; -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cline%20x1%3D%2218%22%20y1%3D%226%22%20x2%3D%226%22%20y2%3D%2218%22/%3E%3Cline%20x1%3D%226%22%20y1%3D%226%22%20x2%3D%2218%22%20y2%3D%2218%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cline%20x1%3D%2218%22%20y1%3D%226%22%20x2%3D%226%22%20y2%3D%2218%22/%3E%3Cline%20x1%3D%226%22%20y1%3D%226%22%20x2%3D%2218%22%20y2%3D%2218%22/%3E%3C/svg%3E") center / contain no-repeat; }
.learn-steps li.ok { color: #dcfce7; }
.learn-steps li.warn { color: #fde68a; }
.learn-steps li.bad { color: #fecaca; }
.learn-steps li.head { padding-left: 0; font-weight: 600; color: #e2e8f0; }
.learn-steps li.head::before { content: none; }
.learn-live-box { position: absolute; border: 3px solid #22c55e; border-radius: 4px; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6); transition: all .25s ease; z-index: 1; }
.learn-live-box.nogo { border-color: #ef4444; border-style: dashed; }
.learn-live-box[hidden] { display: none; }
.learn-live-box::after { content: "DOCK"; position: absolute; left: -3px; top: -20px; font: 700 11px system-ui, sans-serif;
  font-style: normal; color: #052e16; background: #22c55e; padding: 1px 5px; border-radius: 3px; }
.learn-live-box.nogo::after { content: "NO-GO"; color: #fff; background: #ef4444; }
@keyframes learn-flash { 0% { box-shadow: 0 0 0 3px #22c55e; } 100% { box-shadow: 0 0 0 0 transparent; } }
.learn-shot-inner.flash { animation: learn-flash 1s ease-out; border-radius: 8px; }

/* Detector training progress */
.learn-train { flex: none; background: #1e1b4b; border: 1px solid #6366f1; border-radius: 10px; padding: 8px 10px;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .25); }
.learn-train[hidden] { display: none; }
.lt-top { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #e0e7ff; }
.lt-top span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.lt-top b { font-size: 16px; color: #fff; font-variant-numeric: tabular-nums; }
.lt-spin { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 3px solid rgba(165, 180, 252, .35);
  border-top-color: #a5b4fc; animation: lt-spin .8s linear infinite; }
@keyframes lt-spin { to { transform: rotate(360deg); } }
.lt-bar { margin-top: 7px; height: 10px; border-radius: 6px; background: #312e81; overflow: hidden; position: relative; }
.lt-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 6px; transition: width .4s ease;
  background: repeating-linear-gradient(45deg, #818cf8 0 10px, #a5b4fc 10px 20px); background-size: 28px 28px;
  animation: lt-stripes 1s linear infinite; }
.lt-bar.indet i { width: 35% !important; animation: lt-stripes 1s linear infinite, lt-slide 1.4s ease-in-out infinite; }
@keyframes lt-stripes { to { background-position: 28px 0; } }
@keyframes lt-slide { 0% { left: -35%; } 100% { left: 100%; } }
.lt-sub { margin-top: 5px; font-size: 12px; color: #c7d2fe; }
.learn-train.done { background: #052e16; border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
.learn-train.done .lt-spin { border: 0; animation: none; }
.learn-train.done .lt-spin { background: #4ade80; -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%2220%206%209%2017%204%2012%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%2220%206%209%2017%204%2012%22/%3E%3C/svg%3E") center / contain no-repeat; }
.learn-train.done .lt-bar i { background: #22c55e; animation: none; }

/* Learn Dock picture buttons */
.learn-pic-actions { flex-wrap: wrap !important; }
.learn-hint { flex: 1 0 100%; margin: 0 0 2px; font-size: 12.5px; color: #cbd5e1; text-align: center; }
.learn-pic-actions .dock-btn { background: #14532d; color: #dcfce7; }
.learn-pic-actions .btn.ready { box-shadow: 0 0 0 2px #fbbf24; animation: learn-ready 1.2s ease-in-out infinite; }
@keyframes learn-ready { 50% { box-shadow: 0 0 0 4px rgba(251, 191, 36, .35); } }
.learn-sub { margin: 0; font-size: 12px; color: #94a3b8; flex: none; }
.learn-pic-actions .btn { flex: 1 1 30%; }
#learnNote { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; font-size: 13px; line-height: 1.35; flex: none; }
.learn-arrows { flex-wrap: nowrap; gap: 4px; flex: none; }
.learn-arrows button { flex: 1 1 0; min-width: 0; padding: 4px 0; border-radius: 8px; font-size: 20px; line-height: 1.1; }
.learn-arrows button:nth-child(6) { margin-left: 8px; }
#learnFrontWords { color: #fbbf24; font-weight: 600; }
.learn-pic-actions .live-btn { background: #1e3a8a; color: #dbeafe; }
.learn-pic-actions .live-btn[hidden], .learn-pic-actions .btn[hidden] { display: none; }
.learn-live img { cursor: crosshair; }

/* Learn Dock SVG icons */
.learn-panel .btn .ic, .learn-panel .modal-actions button .ic { width: 16px; height: 16px; margin-right: 5px; vertical-align: -3px; }
.learn-arrows button .farrow { width: 20px; height: 20px; margin: 0; vertical-align: middle; }
.learn-arrows button { display: flex; align-items: center; justify-content: center; padding: 5px 0; }
#learnFrontWords .ic { width: 15px; height: 15px; vertical-align: -3px; margin-right: 3px; }
.learn-det.own { border: 2px dashed #94a3b8; box-shadow: none; }
.lg-own { border: 2px dashed #94a3b8; border-radius: 2px; }

/* Learn Dock: empty list / picture that won't load */
.learn-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 28px 16px; color: #94a3b8; font-size: 13.5px; line-height: 1.45; flex: 1 1 auto; }
.learn-empty[hidden] { display: none; }
.learn-empty b { color: #e2e8f0; font-size: 15px; }
.learn-empty span { max-width: 360px; }
.learn-empty-ic { width: 56px; height: 56px; color: #475569; }
.learn-missing { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 16px; text-align: center; color: #94a3b8; font-size: 13px; background: #0f172a; border-radius: 8px; border: 1px solid #334155; }
.learn-missing[hidden] { display: none; }
.learn-missing svg { width: 44px; height: 44px; color: #475569; }
.learn-note-state { margin: -4px 0 0; min-height: 14px; font-size: 11.5px; color: #94a3b8; flex: none; }
.learn-note-state.ok { color: #4ade80; }
.learn-note-state.bad { color: #f87171; }

/* Undock: auto / manual choice */
.undock-card { display: flex; flex-direction: column; gap: 10px; }
.undock-choice { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 12px;
  border: 1px solid #334155; background: #0f172a; color: #e2e8f0; cursor: pointer; }
.undock-choice:hover:not(:disabled) { border-color: #3b82f6; }
.undock-choice:disabled { opacity: .45; cursor: not-allowed; }
.undock-choice .ic { width: 26px; height: 26px; flex: none; color: #93c5fd; }
.undock-choice b { display: block; font-size: 15px; }
.undock-choice small { display: block; font-size: 12.5px; color: #94a3b8; line-height: 1.35; margin-top: 2px; }
.undock-note { margin: 0; font-size: 12.5px; color: #fbbf24; min-height: 0; }
.undock-note:empty { display: none; }
.undock-choice.on { border-color: #22c55e; box-shadow: inset 0 0 0 1px #22c55e; }   /* (1.158.368) the network in force */
.net-note-ok { color: #86efac; }
/* (1.158.370) a switch on its way: the chosen choice pulses, a spinner + what the mower does now; a tick / "!" at the end */
.undock-choice.pending { border-color: #3b82f6; animation: net-pulse 1.2s ease-in-out infinite; }
.undock-choice.pending:disabled { opacity: 1; cursor: progress; }
@keyframes net-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, .55); } 50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); } }
.net-progress { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px;
  background: rgba(59, 130, 246, .14); }
.net-progress[hidden] { display: none; }
.net-progress b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.net-progress small { display: block; font-size: 12.5px; color: #94a3b8; line-height: 1.35; margin-top: 2px; }
.net-progress small:empty { display: none; }
.net-spin { width: 18px; height: 18px; flex: none; margin-top: 1px; border-radius: 50%; border: 3px solid rgba(147, 197, 253, .35);
  border-top-color: #93c5fd; animation: lt-spin .8s linear infinite; box-sizing: border-box; display: grid; place-items: center;
  font: 700 12px/1 system-ui, sans-serif; }
.net-progress.ok { background: rgba(34, 197, 94, .16); }
.net-progress.fail { background: rgba(245, 158, 11, .16); }
.net-progress.ok .net-spin { animation: none; border: none; background: #22c55e; color: #fff; }
.net-progress.fail .net-spin { animation: none; border: none; background: #f59e0b; color: #fff; }
.net-progress.ok .net-spin::after { content: "\2713"; }
.net-progress.fail .net-spin::after { content: "!"; }
.learn-live.avoid { box-shadow: inset 0 0 0 4px #ef4444; }
.learn-live-avoid { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 2; padding: 3px 10px;
  border-radius: 6px; background: #ef4444; color: #fff; font: 700 12px system-ui, sans-serif; letter-spacing: .04em; pointer-events: none; }
.learn-live-avoid[hidden] { display: none; }

/* Learn Dock overlays on the main camera window. */
.camera-stage .learn-live-box, .camera-stage .learn-live-avoid { z-index: 3; }
.camera-stage.avoid { box-shadow: inset 0 0 0 4px #ef4444; }
.camera-stage.avoid::after { content: ""; position: absolute; inset: 0; border: 4px solid #ef4444; pointer-events: none; z-index: 3; }

.overlay-toggle { opacity: 0.55; }
.overlay-toggle.active { opacity: 1; color: #22c55e; }



/* Mowing map in the corner of the camera window (turns with the mower). */
/* (1.158.55) The same glass panel, head and key as the obstacle map below (.cam-vision), on the right. */
.cam-vision.cam-mini-box { left: auto; right: 10px; }
.cam-mini-box:has(> canvas[hidden]) { display: none; }
.cam-mini { display: block; width: var(--cw); height: calc(var(--cw) * 124 / 244); border-radius: 9px; cursor: pointer;
  background: rgba(2, 6, 23, .28); box-shadow: inset 0 0 0 1px rgba(226, 232, 240, .10); }
.cam-mini[hidden] { display: none; }
.cam-vision .cam-vision-head { max-width: var(--cw); }
.cam-mini-box .k-route { background: #3b82f6; }
.cam-mini-box .k-done { background: #22c55e; }
.cam-mini-scale { margin-left: auto; color: rgba(226, 232, 240, .7); font-weight: 500; }

/* The mower's own obstacle map, top left while it mows: an overlay on the camera picture (owner, 2026-10-12:
   "redesign this to look better as an overlay, also make it translucent but not too much"). A glass panel -
   the picture shows through a little, blurred - with the map drawn soft-edged on it; where the mower sees
   nothing the panel is left as it is. */
.cam-vision { position: absolute; left: 10px; top: 10px; z-index: 4; padding: 7px 8px 7px; border-radius: 14px;
  background: rgba(15, 23, 42, .62); border: 1px solid rgba(226, 232, 240, .22);
  -webkit-backdrop-filter: blur(9px) saturate(1.15); backdrop-filter: blur(9px) saturate(1.15);
  box-shadow: 0 6px 18px rgba(0,0,0,.35); color: #e2e8f0; font: 600 11px system-ui, sans-serif; }
.cam-vision[hidden] { display: none; }
/* (1.158.842, owner: "move the debug to the top right of the camera view") below the mowing map when that shows there */
.cam-vision.cam-debug { top: 10px; bottom: auto; left: auto; right: 10px; width: 270px; max-width: calc(100% - 20px); max-height: calc(100% - 20px); overflow: auto; font-weight: 500; }
.cam-mini-box:has(> canvas:not([hidden])) ~ .cam-vision.cam-debug { top: calc(var(--cw) * 124 / 244 + 90px); max-height: calc(100% - var(--cw) * 124 / 244 - 100px); }
.ask-img { display: block; width: 100%; max-height: 45vh; object-fit: contain; border-radius: 10px; margin: 0 0 12px; background: #000; }
.cam-debug .cam-vision-head { max-width: none; }
.cam-debug-doing { font-size: 15px; font-weight: 700; margin: 0 2px 5px; color: #4ade80; }
.cam-debug-doing.warn { color: #fbbf24; }
.cam-debug-doing.bad { color: #f87171; }
.cam-debug-grid { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; margin: 0 2px; }
.cam-debug-grid b { font-weight: 700; color: #f8fafc; text-align: right; font-variant-numeric: tabular-nums; }
/* (1.158.868) a category's title, in the panel's own head style with a line above it */
.cam-debug-sec { grid-column: 1 / -1; margin: 6px 0 2px; padding-top: 5px; border-top: 1px solid rgba(226, 232, 240, .2);
  letter-spacing: .02em; text-transform: uppercase; font-size: 10px; font-weight: 600; color: rgba(226, 232, 240, .78); }
.cam-debug-grid b.bad { color: #f87171; }
.cam-debug-moves { margin: 0 2px; max-height: 136px; overflow: hidden; font-size: 10px; line-height: 1.3; color: rgba(226, 232, 240, .82); }
.cam-debug-moves div { margin-bottom: 2px; }
.cam-vision-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 2px 5px;
  letter-spacing: .02em; text-transform: uppercase; font-size: 10px; color: rgba(226, 232, 240, .78); }
.cam-vision-what { text-transform: none; letter-spacing: 0; font-size: 11px; color: #f8fafc; }
.cam-vision-what.warn { color: #fbbf24; }
.cam-vision-pic { display: block; width: var(--cw); height: calc(var(--cw) * 124 / 244); border-radius: 9px;
  background: rgba(2, 6, 23, .28); box-shadow: inset 0 0 0 1px rgba(226, 232, 240, .10); }
.cam-vision-key { display: flex; flex-wrap: wrap; max-width: var(--cw); gap: 3px 10px; margin: 6px 2px 0; color: rgba(226, 232, 240, .92); }
.cam-vision-key span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.cam-vision-key span[hidden] { display: none; }
.cam-vision-key i { flex: none; width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(15, 23, 42, .5); }
.cam-vision-key .k-grass { background: rgb(134, 239, 172); }
.cam-vision-key .k-obst { background: rgb(251, 146, 60); }
.cam-vision-key .k-veg { background: rgb(163, 190, 60); }
.cam-vision-key .k-other { background: rgb(232, 121, 249); }
/* (1.158.62, owner: "can you make these the same size") The obstacle map and the mowing map are one size: 244 px
   wide in a wide camera window, and in a narrower one each takes half the window's width, so they never overlap. */
/* (1.158.709, owner: "follow the theme", "make sure all box overlays are the same size ... the borders are different too")
   The Detected and Mowing map panels: one frame in the theme's colours, the same rows at the same heights - the title and
   the legend always on one line each, whatever is in them. */
.cam-vision { background: rgba(15, 23, 42, .62); background: color-mix(in srgb, var(--p-surface-1, #1e293b) 82%, transparent);
  border-color: var(--p-line-strong, rgba(226, 232, 240, .22)); color: var(--p-text, #e2e8f0); }
.cam-vision .cam-vision-head { flex-wrap: nowrap; white-space: nowrap; height: auto; min-height: 15px; line-height: 15px; color: var(--p-text-2, rgba(226, 232, 240, .78)); }
.cam-vision .cam-vision-head span:first-child { flex: none; }
.cam-vision .cam-vision-what { min-width: 0; white-space: normal; overflow-wrap: anywhere; color: var(--p-text, #f8fafc); }   /* (1.158.922) never cut short */
.cam-vision .cam-vision-what.warn { color: #fbbf24; }
html.theme-light .cam-vision .cam-vision-what.warn { color: #b45309; }
.cam-vision .cam-vision-key { flex-wrap: nowrap; align-items: center; height: 20px; overflow: hidden; color: var(--p-text-2, rgba(226, 232, 240, .92)); }
.cam-vision .cam-vision-key span { flex: none; }
.cam-vision .cam-vision-key i { flex: none; }
.cam-vision .cam-vision-key .cam-mini-scale { flex: 0 1 auto; min-width: 0; overflow: hidden; color: var(--p-text-3, rgba(226, 232, 240, .7)); }   /* (the scale gives way first) */
.cam-vision .cam-vision-key:has(span[data-k="other"]:not([hidden])) span[data-k="grass"] { display: none; }   /* (no room for all four) */
.cam-mini, .cam-vision-pic { background: color-mix(in srgb, var(--p-bg, #0f172a) 72%, transparent); box-shadow: inset 0 0 0 1px var(--p-line, rgba(226, 232, 240, .10)); }
html.theme-light #camVision:not(.depth) .cam-vision-pic { background: rgba(2, 6, 23, .78); }   /* (Flat's map is drawn for a dark ground) */
#camVision.depth .k-grass { background: var(--p-accent, rgb(45, 212, 191)); }
#camVision.depth .k-obst { background: rgb(251, 113, 133); }
#camVision.depth .k-veg { background: rgb(74, 222, 128); }
.cam-look-btn { flex: none; margin-left: auto; height: 18px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--p-accent, #22d3ee);
  background: color-mix(in srgb, var(--p-accent, #22d3ee) 16%, transparent); color: var(--p-text, #e2e8f0); font: 700 10px/16px system-ui, sans-serif; cursor: pointer; }
.cam-look-btn[hidden] { display: none; }
.cam-look-btn.active { background: var(--p-accent, #22d3ee); color: #fff; }
.cam-look-btn .cam-n-arrow { display: inline-block; width: 0; height: 0; margin-right: 3px; vertical-align: 1px; border: solid transparent; border-width: 0 3.5px 7px;
  border-bottom-color: currentColor; border-radius: 0; box-shadow: none; }
.cv-look { display: flex; flex-direction: column; gap: 5px; color: var(--text); }
.cv-look b { font-size: 13px; }
.cv-look-btns { display: flex; gap: 4px; }
.cv-look-btns button { flex: 1; min-height: 30px; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--muted); background: transparent; color: var(--text); font: 600 12px system-ui, sans-serif; cursor: pointer; }
.cv-look-btns button.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.cam-vision { --cw: 244px; width: var(--cw); box-sizing: content-box; }
.camera-stage { container-type: inline-size; }
@container (max-width: 560px) {
  .cam-vision { --cw: calc(50cqw - 31px); padding: 6px; }
  .cam-vision-key { font-size: 10px; }
  .cam-vision .cam-vision-key { gap: 3px 5px; }
  .cam-vision .cam-vision-key .cam-mini-scale { display: none; }   /* (the Mowing map's button must fit: 1.158.710) */
  .cam-vision .cam-look-btn { padding: 0 6px; }
  .cam-vision .cam-vision-key span[data-k="grass"] { display: none; }   /* (no room on a phone: the rest and the button first) */
  /* (all three things at once, too: their dots alone - the map names them - rather than words cut in half) */
  .cam-vision .cam-vision-key:has(span[data-k="obst"]:not([hidden])):has(span[data-k="veg"]:not([hidden])):has(span[data-k="other"]:not([hidden])) span { font-size: 0; gap: 0; }
}
/* (1.158.874, 876) A panel popped out of the camera window: free of its clip, moved and sized by hand (app.js camPopOut). */
:is(#camVision, #camMiniBox, #camDebug) { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
:is(#camVision, #camDebug):not(.popped) { cursor: zoom-in; }
:is(#camVision, #camMiniBox, #camDebug).popped:not([hidden]) { position: fixed; z-index: 1401; right: auto; display: flex; flex-direction: column; box-sizing: border-box; --cw: 100%; max-width: none; max-height: none; padding: 8px 10px; touch-action: none; cursor: move; }
#camMiniBox.popped:has(> canvas[hidden]) { display: none; }   /* (nothing to show: as in the camera window) */
body:has(#cameraPanel.hidden) :is(#camVision, #camMiniBox, #camDebug).popped { display: none; }   /* (the camera window closed: they go with it, and come back with it) */
.cam-vision.popped :is(.cam-vision-pic, .cam-mini) { flex: 1 1 0; width: 100%; height: 0; min-height: 0; }
.cam-vision.popped .cam-vision-head { flex: none; height: 24px; line-height: 24px; align-items: center; font-size: 12px; }
.cam-vision.popped .cam-vision-what { margin-left: auto; font-size: 12px; }
.cam-vision.popped .cam-vision-key { flex: none; padding: 0 18px; box-sizing: border-box; }
.cam-vision-unpop { flex: none; width: 24px; height: 24px; padding: 0; border-radius: 6px; border: 1px solid var(--p-line, rgba(226, 232, 240, .3)); background: transparent; color: inherit; font: 700 12px/22px system-ui, sans-serif; cursor: pointer; }
.cam-vision-unpop[hidden], .cam-pop-grip[hidden] { display: none; }
.cam-pop-grip.camera-resize { width: 26px; height: 26px; }
@media (hover: hover) {   /* (as the camera window's: its corners show when the pointer is over it) */
  .cam-vision.popped:hover .camera-resize::before { opacity: .45; }
  .cam-vision.popped .camera-resize:hover::before { opacity: .95; }
}
.cam-debug-body { display: contents; }
#camDebug.popped:not([hidden]) { overflow: hidden; touch-action: pan-y; cursor: auto; -webkit-user-select: text; user-select: text; }
#camDebug.popped .cam-vision-head { touch-action: none; cursor: move; -webkit-user-select: none; user-select: none; }
#camDebug.popped .cam-debug-body { display: block; flex: 1 1 0; min-height: 0; overflow: auto; padding-bottom: 14px; }
#camDebug.popped .cam-debug-moves { max-height: none; }
.learn-do-now { margin-top: 6px; padding: 8px 14px; border-radius: 8px; border: 0; background: #16a34a; color: #fff;
  font: 700 14px system-ui, sans-serif; cursor: pointer; }
.learn-do-now[hidden] { display: none; }
.learn-do-now:disabled { opacity: .6; cursor: default; }

/* AI Training: how the mower reads a note, and the note help. */
.learn-note-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 4px; }
.learn-note-parse { flex: 1; margin: 0; font-size: 12.5px; line-height: 1.4; color: #94a3b8; min-height: 1em; }
.learn-note-parse b { color: #86efac; font-weight: 600; }
.learn-note-parse.none { color: #fbbf24; }
.learn-help-btn { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid #475569; background: #1e293b;
  color: #e2e8f0; font: 700 12px system-ui, sans-serif; cursor: pointer; padding: 0; }
.learn-help-btn.on { background: #2563eb; border-color: #2563eb; }
.learn-note-help { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: #0f172a; border: 1px solid #334155;
  font-size: 12.5px; line-height: 1.45; color: #cbd5e1; }
.learn-note-help[hidden] { display: none; }
.learn-note-help table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.learn-note-help td { padding: 3px 6px 3px 0; vertical-align: top; border-top: 1px solid #1e293b; }
.learn-note-help td:first-child { white-space: nowrap; color: #e2e8f0; font-weight: 600; width: 1%; }
.learn-note-help p { margin: 6px 0 0; }
.settings-sheet #sm-spacing { max-width: 140px; }

/* The printed dock tag, where the camera sees it. */
.learn-live-box.tagbox { border-color: #3b82f6; border-style: solid; }
.learn-live-box.tagbox::after { content: attr(data-label); color: #fff; background: #2563eb; white-space: nowrap; }
.settings-sheet #rec-tag-stage { max-width: 140px; }

/* Start options (tap areas → Start): the schedule editor's task settings, one-off. */
.mowstart-warn { margin: 0; font-size: 12px; color: #fbbf24; }
#ms-angle-wrap.hidden { display: none; }

/* Markers drawn at real size: their size eases with the map's zoom animation
   (Leaflet zooms in 0.25 s with this curve) instead of jumping at the end. */
.leaflet-marker-icon.map-scaled,
.leaflet-marker-icon.map-scaled img {
  transition: width 0.25s cubic-bezier(0, 0, 0.25, 1), height 0.25s cubic-bezier(0, 0, 0.25, 1),
    margin 0.25s cubic-bezier(0, 0, 0.25, 1);
}
.leaflet-marker-icon.map-scaled .mower-heading {
  transition: width 0.25s cubic-bezier(0, 0, 0.25, 1), height 0.25s cubic-bezier(0, 0, 0.25, 1);
}

/* Mower tread animation (map.js sets each side's speed from the mower's real
   motion: forward runs the treads up the drawing, reverse down, and a turn on
   the spot runs the two sides opposite ways). Paused keeps their position. */
.mower-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mower-svg .tread { animation: mower-tread 1s steps(4) infinite paused; }   /* in steps: see polish.css, p-breathe */
.mower-svg .side-l .tread {
  animation-duration: var(--tl-s, 1s); animation-direction: var(--tl-dir, normal); animation-play-state: var(--tl-play, paused);
}
.mower-svg .side-r .tread {
  animation-duration: var(--tr-s, 1s); animation-direction: var(--tr-dir, normal); animation-play-state: var(--tr-play, paused);
}
@keyframes mower-tread { from { transform: translateY(0); } to { transform: translateY(-2.2px); } }
@media (prefers-reduced-motion: reduce) { .mower-svg .tread { animation: none; } }

/* Spot mow: "Return to dock when done" switch (full width under the sliders). */
/* position: relative keeps the hidden checkbox inside its own switch. Without it the checkbox is placed
   against the window's frame (.modal-card / .spot-panel), not the list that scrolls inside it: it stays
   behind below the frame's edge, and when it gets the focus the browser scrolls the frame itself to reach
   it - header and tabs gone, Close a third of the way down (owner, 2026-10-11, Settings - Display). */
.spot-switch { position: relative; grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #e2e8f0; cursor: pointer; user-select: none; }
.spot-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.spot-switch .knob { position: relative; flex: none; width: 38px; height: 22px; border-radius: 11px; background: #334155; border: 1px solid #475569; transition: background .15s, border-color .15s; }
.spot-switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #e2e8f0; transition: transform .15s; }
.spot-switch input:checked + .knob { background: #2563eb; border-color: #2563eb; }
.spot-switch input:checked + .knob::after { transform: translateX(16px); }
.spot-switch input:focus-visible + .knob { outline: 2px solid #93c5fd; outline-offset: 2px; }

/* Spot mow pattern picker: small cards, the chosen one outlined blue. */
.spot-patterns { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
/* (1.158.405) five fills: one row of five */
/* (1.158.923, owner, of the schedule's Pattern tiles in two rows: "put these all in one line") the schedule's copy of the
   Mow window's settings too - its ids are sc-<id> (scBuild), so a rule by id has to name both */
#spotPatterns, #sc-spotPatterns { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.spot-patterns button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px 6px;
  border-radius: 10px; border: 1px solid #334155; background: #0f172a; color: #cbd5e1; font-size: 11.5px; cursor: pointer; }
.spot-patterns button svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.spot-patterns button[aria-checked="true"] { border-color: #3b82f6; background: #172554; color: #f8fafc; }
.spot-patterns button:disabled { opacity: .5; cursor: not-allowed; }
.spot-shapes { grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 2px 0 10px; }
.spot-shapes button { padding: 5px 2px 4px; font-size: 11.5px; }
.spot-shapes button svg { width: 24px; height: 24px; }
.spot-slider.hidden-by-pattern, .spot-slider.hidden { display: none; }

/* Settings: Alerts / Health (extras.js). */
.set-note { margin: 0; font-size: 13px; color: #cbd5e1; line-height: 1.45; }
.set-note.sub { color: #94a3b8; font-size: 12px; }
.set-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.set-row .inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #94a3b8; flex-wrap: wrap; min-width: 0; }
.set-row .inline select { max-width: 100%; }   /* (1.158.922) under its label when there's no room beside it - never past the card */
.set-row .inline input { width: 70px; }
.set-checks { display: flex; flex-direction: column; gap: 8px; }
.set-checks label, .set-toggle { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: #e2e8f0; cursor: pointer; }
.set-checks input, .set-toggle input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: #2563eb; }
.set-list { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #cbd5e1; }
.set-list .item { display: flex; justify-content: space-between; gap: 8px; padding: 7px 9px; border-radius: 8px; background: #1e293b; }
.set-list .item .when { color: #94a3b8; white-space: nowrap; }
.set-list .item > span:first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.set-list .item > button { flex: 0 0 auto; align-self: center; }
.set-list .item > span .when { white-space: normal; }
.set-list .item .tok-when { display: block; margin-top: 2px; }
.set-list .item .tok-when > span { white-space: nowrap; }
.set-list .item.error { border-left: 3px solid #ef4444; }
.set-list .item.warn { border-left: 3px solid #f59e0b; }
.hl-big { font-size: 14px; color: #cbd5e1; }
.hl-big b { font-size: 22px; color: #f8fafc; }
.hl-bar { height: 8px; border-radius: 4px; background: #1e293b; overflow: hidden; }
.hl-bar div { height: 100%; width: 0; background: #22c55e; transition: width .3s; }
.hl-bar div.due { background: #ef4444; }
.hl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.hl-grid div { padding: 8px 10px; border-radius: 8px; background: #1e293b; font-size: 12px; color: #94a3b8; }
.hl-grid b { display: block; font-size: 18px; color: #f8fafc; }
.hl-battery { width: 100%; height: 120px; background: #1e293b; border-radius: 8px; }

/* Obstacle pins and the map Layers menu (extras.js). */
.obst-pin span { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  font: 700 14px/1 system-ui, sans-serif; color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.obst-bump span { background: #f59e0b; }
.obst-stuck span { background: #dc2626; }
.obst-marked span { background: #7c3aed; }
.obst-avoid span { background: #ef4444; }
.obst-seen span { background: #0ea5e9; }      /* where it went round something the mower saw: a mark only */
/* (1.158.653) a pin that knows what was there shows it as its picture (map.js PIN_PIC) - a bigger badge for the emoji */
.obst-what span { width: 26px; height: 26px; font: 15px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", system-ui, sans-serif; }
.obst-pop-when { color: var(--muted, #94a3b8); font-size: 12px; }
.obst-pop { font-size: 13px; line-height: 1.5; min-width: 200px; }
.obst-pop span { color: #475569; }
.obst-pop button { margin-top: 6px; }
.obst-pop button { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
#map.picking, #map.picking .leaflet-interactive { cursor: crosshair !important; }
/* (1.158.444) placing a patrol stop: a map pin, its tip on the spot */
#map.picking-pin, #map.picking-pin .leaflet-interactive { cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2228%22%20height%3D%2236%22%20viewBox%3D%220%200%2028%2036%22%3E%3Cpath%20d%3D%22M14%2035C14%2035%203%2021%203%2013a11%2011%200%200%201%2022%200c0%208-11%2022-11%2022z%22%20fill%3D%22%230ea5e9%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22/%3E%3Ccircle%20cx%3D%2214%22%20cy%3D%2213%22%20r%3D%224%22%20fill%3D%22%23fff%22/%3E%3C/svg%3E") 14 35, crosshair !important; }
/* (1.158.453) ... and where a stop can't go: a red pin with a bar */
#map.picking-pin.picking-bad, #map.picking-pin.picking-bad .leaflet-interactive { cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2228%22%20height%3D%2236%22%20viewBox%3D%220%200%2028%2036%22%3E%3Cpath%20d%3D%22M14%2035C14%2035%203%2021%203%2013a11%2011%200%200%201%2022%200c0%208-11%2022-11%2022z%22%20fill%3D%22%23ef4444%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22/%3E%3Ccircle%20cx%3D%2214%22%20cy%3D%2213%22%20r%3D%225.5%22%20fill%3D%22%23fff%22/%3E%3Cpath%20d%3D%22M10.2%2016.8%20L17.8%209.2%22%20stroke%3D%22%23ef4444%22%20stroke-width%3D%222.4%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E") 14 35, not-allowed !important; }
/* (1.158.448) choosing which way a patrol stop's picture looks: a small camera, not the + */
#map.picking-aim, #map.picking-aim .leaflet-interactive { cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2230%22%20height%3D%2230%22%20viewBox%3D%220%200%2030%2030%22%3E%3Crect%20x%3D%224%22%20y%3D%229%22%20width%3D%2222%22%20height%3D%2215%22%20rx%3D%223%22%20fill%3D%22%230ea5e9%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22/%3E%3Cpath%20d%3D%22M10%209%20L12%205.5%20H18%20L20%209%22%20fill%3D%22%230ea5e9%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20stroke-linejoin%3D%22round%22/%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2216.5%22%20r%3D%224.2%22%20fill%3D%22%23fff%22/%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2216.5%22%20r%3D%222.2%22%20fill%3D%22%230ea5e9%22/%3E%3C/svg%3E") 15 16, pointer !important; }
.layers-menu { position: absolute; z-index: 1100; right: 60px; top: 70px; width: 240px; padding: 12px; border-radius: 12px;
  background: #0f172a; border: 1px solid #334155; box-shadow: 0 8px 24px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 10px; color: #e2e8f0; font-size: 13.5px; }
.layers-menu[hidden] { display: none; }
.layers-menu h4 { margin: 0; font-size: 13px; color: #94a3b8; font-weight: 600; }
.layers-menu label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.layers-menu input[type=checkbox] { width: 17px; height: 17px; accent-color: #2563eb; }
.layers-menu select { margin-left: auto; }
.layers-menu .legend { display: flex; gap: 4px; font-size: 11px; color: #94a3b8; flex-wrap: wrap; }
.layers-menu .legend i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-right: 3px; vertical-align: middle; }
.layers-menu button { padding: 7px 10px; border-radius: 8px; border: 1px solid #334155; background: #1e293b; color: #e2e8f0; cursor: pointer; }
.layers-menu .hint { font-size: 12px; color: #fbbf24; }

/* Spot mow: Area / Line switch, saved spots, queue, schedules. */
.spot-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #0f172a; border-radius: 10px; }
.spot-modes button { padding: 7px 6px; border: 0; border-radius: 7px; background: transparent; color: #94a3b8; font-weight: 600; font-size: 13px; cursor: pointer; }
.spot-modes button[aria-checked="true"] { background: #334155; color: #fff; }
.spot-modes button:disabled { opacity: .5; cursor: not-allowed; }
.spot-saved { border: 1px solid #1e293b; border-radius: 10px; padding: 6px 10px; background: #0b1220; }
.spot-saved summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #cbd5e1; padding: 4px 0; }
.spot-saved[open] { display: flex; flex-direction: column; gap: 8px; }
.spot-saved-list { display: flex; flex-direction: column; gap: 6px; }
.spot-saved-list .row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; background: #1e293b; font-size: 13px; }
.spot-saved-list .row .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.spot-saved-list .row .sub { color: #94a3b8; font-size: 11.5px; }
.spot-saved-list .row button { padding: 4px 8px; font-size: 12px; border-radius: 6px; border: 1px solid #334155; background: #0f172a; color: #e2e8f0; cursor: pointer; }
.spot-saved-list .row button.del { border-color: #7f1d1d; color: #fca5a5; }
/* A row with more buttons (an area waiting for its check lap): the name on its own line, the buttons below. */
.spot-saved-list .row.wide { flex-wrap: wrap; }
.spot-saved-list .row.wide .name { flex-basis: 100%; white-space: normal; }
.spot-saved-list .row.wide button:first-of-type { margin-left: auto; }
.spot-queue, .sq-sched { display: flex; flex-direction: column; gap: 6px; }
.sq-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #cbd5e1; }
.sq-head button { margin-left: auto; }
.sq-status { font-size: 12.5px; color: #fbbf24; }
.sq-form { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 8px; background: #111827; }
.sq-form input[type=text] { width: 100%; }
.sq-days { display: flex; gap: 4px; flex-wrap: wrap; }
.sq-days label { padding: 4px 8px; border-radius: 6px; border: 1px solid #334155; font-size: 12px; cursor: pointer; }
.sq-days input { display: none; }
.sq-days label:has(input:checked) { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

/* System tab (extras.js). */
.tok-show { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 8px; background: #172554; }
.tok-show code { word-break: break-all; font-size: 12.5px; color: #f8fafc; }
.tok-help summary { cursor: pointer; font-size: 13px; color: #93c5fd; }
/* (1.158.393) Home Assistant: the integration's download and its three steps, under the token list */
/* (1.158.395, owner: "this dont look good, add padding") one padded panel: the intro as plain text in it (not the
   settings' tinted note box), the button and the steps spaced evenly */
.tok-ha { margin: 14px 0 8px; padding: 16px 18px; border-radius: 12px; background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.16); display: flex; flex-direction: column; gap: 14px; }
#settingsModal .set-card .tok-ha p.set-note:not([id]) { margin: 0; padding: 0; background: none; font-size: 13px; }
.tok-ha .set-row { margin: 0; }
.tok-ha a.btn { text-decoration: none; }
.tok-ha ol { margin: 0; padding: 0 0 0 20px; display: grid; gap: 8px; line-height: 1.5; }
.tok-ha-yaml { width: 100%; box-sizing: border-box; font: 12px/1.4 ui-monospace, Menlo, monospace; }
.tok-ha code { font-size: 12px; background: #1e293b; padding: 1px 5px; border-radius: 4px; }
.tok-help code { font-size: 12px; background: #1e293b; padding: 1px 4px; border-radius: 4px; }
.set-note code { overflow-wrap: anywhere; }
.tok-help pre { font-size: 11.5px; background: #020617; color: #cbd5e1; padding: 8px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }   /* (1.158.922) long lines wrap on screen, never cut off - a copy keeps them whole */
.set-list .item a { color: #93c5fd; }
#sy-tok-name { flex: 1; min-width: 140px; }

/* An alert that arrived while the app was open (extras.js). */
.push-banner { position: fixed; z-index: 3000; top: calc(var(--hud-bottom, 56px) + 8px); left: 50%; transform: translateX(-50%);
  width: min(420px, 92vw); display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px;
  background: #1e293b; border: 1px solid #3b82f6; box-shadow: 0 10px 30px rgba(0,0,0,.5); color: #e2e8f0; font-size: 13.5px; cursor: pointer; }
.push-banner b { color: #fff; }

/* No scrollbars anywhere: everything still scrolls by finger, wheel or trackpad. */
html, body, * { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* The licence banner (free trial / limited mode) in the theme's own colours, like the alignment bar: a glass panel,
   a coloured dot for what it's about, and the action as the green go button. */
#licBanner, #licBanner.ok, #licBanner.bad, #licBanner.ask { background: rgba(13, 21, 40, 0.82); color: var(--p-text);
  border: 1px solid rgba(148, 163, 184, 0.24); padding: 8px 8px 8px 14px; border-radius: 14px; gap: 12px; }
#licBanner::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; flex: none; }
#licBanner.ok::before { background: #22c55e; }
#licBanner.bad::before { background: #ef4444; }
#licBanner .rec-text b { color: var(--p-text); font-size: 12.5px; }
#licBanner .rec-text span { color: var(--p-text-2); }
#licBanner button { background: #16a34a; color: #fff; border-radius: 10px; padding: 8px 14px; display: inline-flex; align-items: center; gap: 6px; }

/* Ai Recover's bar: the licence banner's design (owner) - the glass panel in the theme's colours, a dot for
   how it's going (blue, pulsing: working; amber: needs you; green: done; red: failed), the title over its
   line, and Stop as the red button. */
#recBanner, #recBanner.ok, #recBanner.bad, #recBanner.ask { background: rgba(13, 21, 40, 0.82); color: var(--p-text);
  border: 1px solid rgba(148, 163, 184, 0.24); padding: 8px 8px 8px 14px; border-radius: 14px; gap: 12px; }
#recBanner .rec-dot { width: 9px; height: 9px; background: #3b82f6; }
#recBanner.ask .rec-dot { background: #f59e0b; }
#recBanner.ok .rec-dot { background: #22c55e; }
#recBanner.bad .rec-dot { background: #ef4444; }
#recBanner .rec-text b { color: var(--p-text); font-size: 12.5px; }
#recBanner .rec-text span, #recBanner .rec-text small { color: var(--p-text-2); }
#recBanner button { background: linear-gradient(180deg, #f05252, #d62f2f); color: #fff; border: 1px solid rgba(252, 165, 165, 0.45);
  border-radius: 10px; padding: 8px 14px; display: inline-flex; align-items: center; gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 6px 18px rgba(220, 38, 38, 0.3); }
#recBanner button .ic { width: 14px; height: 14px; }

/* Saved shapes: what each is (LuLuMate area / not checked yet / no-go zone) */
.zone-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 1px 7px; border-radius: 99px;
  background: rgba(34, 197, 94, 0.18); color: #4ade80; vertical-align: 1px; }
.zone-badge.unchecked { background: rgba(234, 179, 8, 0.22); color: #facc15; }
.zone-badge.nogo { background: rgba(239, 68, 68, 0.18); color: #f87171; }
html.theme-light .zone-badge { color: #15803d; }
html.theme-light .zone-badge.unchecked { color: #a16207; }
html.theme-light .zone-badge.nogo { color: #b91c1c; }

/* LuLuMate schedules in the Schedules list: their own (blue) tint, so they stand apart from the mower's tasks. */
.zone-badge.lm { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
html.theme-light .zone-badge.lm { color: #0369a1; }
.plans-list .plan-row.lm-row { background: rgba(14, 165, 233, 0.08) !important; border-color: rgba(14, 165, 233, 0.4) !important;
  box-shadow: inset 4px 0 0 #0ea5e9; }
.plans-list .plan-row.lm-row .plan-days { color: #0284c7; }
html:not(.theme-light) .plans-list .plan-row.lm-row .plan-days { color: #38bdf8; }
/* A no-go zone in the schedule's area list: shown, not pickable. */
#lm-areas label.lm-nogo { opacity: 0.7; cursor: not-allowed; }
/* A badge on a picked (dark) area chip: light on dark so it stays readable. */
#lm-areas label:has(input:checked) .zone-badge, #pl-zones label:has(input:checked) .zone-badge { background: rgba(255, 255, 255, 0.22); color: #fff; }
/* Editing a shape: just past its line a tap adds a point there - a "+" cursor says so (owner, 2026-10-08). */
#map.spot-cur-add, #map.spot-cur-add .leaflet-interactive { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8' fill='%23ffffff' stroke='%23ffffff' stroke-width='4'/%3E%3Ccircle cx='12' cy='12' r='8' fill='%23f59e0b' stroke='%23111827' stroke-width='1.6'/%3E%3Cpath d='M12 8v8M8 12h8' stroke='%23111827' stroke-width='2.2'/%3E%3C/svg%3E") 12 12, copy !important; }

#driveMapBar, #driveMapBar.ask { background: rgba(13, 21, 40, 0.86); color: var(--p-text); border: 1px solid rgba(148, 163, 184, 0.24);
  padding: 8px; border-radius: 14px; flex-wrap: wrap; justify-content: center; gap: 8px 10px; width: min(560px, calc(100% - 32px)); max-width: none; box-sizing: border-box; }
#driveMapBar .rec-dot { width: 9px; height: 9px; background: #f59e0b; margin-left: 6px; }
#driveMapBar.ask .rec-dot { background: #ef4444; animation: none; }
#driveMapBar .rec-text { flex: 1 1 200px; }
#driveMapBar .rec-text b { color: var(--p-text); font-size: 12.5px; }
#driveMapBar .rec-text span { color: var(--p-text-2); }
#driveMapBar.ask .rec-text span { color: #fbbf24; }
#driveMapBar .drive-bar-btns { display: flex; gap: 6px; flex: none; flex-wrap: nowrap; }
#driveMapBar button { display: inline-flex; align-items: center; gap: 5px; background: rgba(148, 163, 184, 0.18); color: var(--p-text);
  border: 1px solid rgba(148, 163, 184, 0.3); border-radius: 10px; padding: 8px 11px; white-space: nowrap; }
#driveMapBar button .ic { width: 14px; height: 14px; }
#driveMapBar button.go { background: #16a34a; color: #fff; border-color: #16a34a; }
#driveMapBar button:disabled { opacity: .45; }
body.drive-mapping #spotPanel { display: none !important; }
.spot-drive-row { display: flex; gap: 8px; margin: 8px 0 2px; }
.spot-drive-row[hidden] { display: none; }
.spot-drive-row button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; min-height: 38px; padding: 8px 12px; border-radius: 10px; }
.spot-drive-row button[hidden] { display: none; }
.spot-drive-row button .ic { width: 15px; height: 15px; flex: none; }
#driveMapBar .rec-text small.drive-ble { color: var(--p-text-2); font-size: 11.5px; }
#driveMapBar .rec-text small.drive-ble.on { color: #60a5fa; }
#driveMapBar .rec-text small.drive-ble[hidden] { display: none; }
#driveMapBar { top: auto; bottom: 14px; }
@media (max-width: 700px) {
  #driveMapBar { bottom: calc(84px + var(--alerts-h, 0px)); }
  body:has(#cameraPanel:not(.hidden)) #driveMapBar { top: auto; bottom: calc(84px + var(--alerts-h, 0px)); }
}
