:root {
  /* the app's dark theme (ui/theme in the Android app) */
  --bg: #12161d; --panel: #1f2530; --hi: #2a3140; --line: #343c4c; --text: #f1f3f6; --dim: #9aa3b2;
  --teal: #2ec4b6; --amber: #f4a261; --red: #e63946; --green: #52b788; --violet: #8b7fd6;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
button, select, input { font: inherit; color: inherit; }
.dim { color: var(--dim); }
.err { color: #ff6b75; min-height: 1.4em; margin: 6px 0 0; }

/* ---------------- login */
.login { min-height: 100%; display: grid; place-items: start center; padding: 40px 16px; }
.login-card { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.login h1 { margin: 0 0 4px; font-size: 22px; }
.login h2 { font-size: 15px; margin: 22px 0 4px; }
.login label { display: block; margin: 10px 0; color: var(--dim); }
.login input { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.login form button { margin-top: 6px; padding: 8px 18px; border: 0; border-radius: 8px; background: var(--teal); color: #072a27; font-weight: 700; cursor: pointer; }
.demo-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.demo-list button { text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--hi); cursor: pointer; }
.demo-list button small { color: var(--dim); display: block; }

/* ---------------- page */
.app { height: 100%; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); flex: 0 0 auto; flex-wrap: wrap; }
.brand { color: var(--teal); }
.top select { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); max-width: 60vw; }
.grow { flex: 1; }
.link { background: none; border: 0; color: var(--teal); cursor: pointer; text-decoration: none; padding: 0; }
.who { color: var(--dim); font-size: 13px; }
.main { flex: 1 1 auto; display: flex; min-height: 0; position: relative; }
.mapwrap { flex: 1 1 auto; position: relative; min-width: 0; }
#map { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }   /* not `inset`: phones with a web view older than Chrome 87 */
.tools { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 3; pointer-events: none; }
.tools > * { pointer-events: auto; }
.tools select { background: rgba(31,37,48,.95); border: 1px solid #3a4252; border-radius: 16px; padding: 5px 10px; max-width: 220px; }
.chip { background: rgba(31,37,48,.92); border: 1px solid #3a4252; border-radius: 16px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.chip.on { background: #3b3554; border-color: var(--violet); }
.chip.rtl { margin-left: auto; color: var(--amber); border-color: #7a5a36; }
.chip { display: inline-flex; align-items: center; gap: 5px; }
.chip svg { width: 15px; height: 15px; flex: 0 0 auto; }
.chip.rtl { font-weight: 700; letter-spacing: .5px; }
#bMarks[data-set="rover"] svg { color: #FF9F1C; }
.legend { position: absolute; top: 52px; left: 10px; width: 240px; background: rgba(31,37,48,.96); border: 1px solid #3a4252; border-radius: 12px; padding: 8px 10px; z-index: 4; font-size: 12.5px; }
.legend div { margin: 3px 0; }
.sw { display: inline-block; width: 16px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 7px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 7px; }
.toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); background: #000d; color: #fff; padding: 8px 14px; border-radius: 14px; font-size: 13px; z-index: 6; opacity: 0; transition: opacity .3s; pointer-events: none; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* side panel (PC) */
.panel { flex: 0 0 380px; display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); min-height: 0; }
.grab { display: none; }
.sum { padding: 10px 14px 8px; display: flex; gap: 8px; align-items: center; }
.sum .t { flex: 1; min-width: 0; }
.sum .t b { display: block; font-size: 15px; }
.sum .t span { color: var(--dim); font-size: 12px; display: block; }
.pill { border-radius: 12px; padding: 3px 9px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pill.ok { background: rgba(82,183,136,.2); color: var(--green); }
.pill.warn { background: rgba(244,162,97,.2); color: var(--amber); }
.pill.err { background: rgba(230,57,70,.22); color: #ff6b75; }
.tabs { display: flex; gap: 4px; padding: 0 10px; }
.tab { padding: 6px 11px; border-radius: 10px 10px 0 0; color: var(--dim); cursor: pointer; font-size: 13px; background: none; border: 0; }
.tab.on { color: var(--text); background: var(--hi); }
.body { overflow-y: auto; padding: 8px 14px 14px; background: var(--hi); flex: 1 1 auto; min-height: 0; }
.row { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.row.click { cursor: pointer; }
.row.sel { background: rgba(255,255,255,.07); }
.row:last-child { border-bottom: 0; }
.row .m { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row .m small { color: var(--dim); display: block; }
.zsw { width: 18px; height: 4px; border-radius: 2px; flex: 0 0 auto; }
.badge { font-size: 11px; border-radius: 9px; padding: 1px 7px; white-space: nowrap; }
.badge.same { background: rgba(82,183,136,.2); color: var(--green); }
.badge.differs { background: rgba(244,162,97,.2); color: var(--amber); }
.badge.missing { background: rgba(230,57,70,.2); color: #ff8a92; }
.badge.none { background: rgba(154,163,178,.15); color: var(--dim); }
.btn { background: transparent; border: 1px solid #556076; border-radius: 14px; padding: 3px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.btn.on { border-color: #BDB2FF; color: #BDB2FF; }
.sec { margin: 14px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--dim); }
.note { color: var(--dim); font-size: 12.5px; margin: 6px 0; }
body:not(.eng) .eng-only { display: none; }

/* ---------------- the job */
.live { background: var(--hi); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 6px 0 4px; }
.lvh { display: flex; align-items: center; gap: 8px; }
.lvh .dim { margin-left: auto; font-size: 13px; }
.livedot { width: 10px; height: 10px; border-radius: 50%; background: #5a6375; flex: 0 0 auto; }
.livedot.on { background: #34c759; box-shadow: 0 0 0 0 rgba(52,199,89,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52,199,89,0); } 100% { box-shadow: 0 0 0 0 rgba(52,199,89,0); } }
.bar { height: 8px; border-radius: 4px; background: #3a4252; margin: 9px 0 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #34c759; }
.lvrow { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.kp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 9px 0; text-align: center; font-weight: 600; font-size: 13px; }
.kp small { display: block; color: var(--dim); font-weight: 400; font-size: 11px; }
.log { font-size: 12px; margin-top: 3px; }
.lvb { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.row.sel { background: rgba(46,196,182,.08); }

/* phone / the app's WebView: bottom sheet, no page header (the app's own title bar is above) */
@media (max-width: 760px) {
  .panel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; max-height: 46%; border-left: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 14px rgba(0,0,0,.35); transition: max-height .2s; }
  .panel.min { max-height: 62px; }
  .grab { display: grid; height: 16px; place-items: center; cursor: pointer; flex: 0 0 auto; }
  .grab::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: #5a6375; }
  .sum { padding-top: 2px; }
  .toast { bottom: calc(46% + 12px); }
  .tools { flex-wrap: nowrap; gap: 5px; }
  .tools select { max-width: 36vw; min-width: 0; flex: 0 1 auto; }
  .chip { padding: 0; width: 34px; height: 32px; justify-content: center; flex: 0 0 auto; }
  .chip .lbl { display: none; }
  .chip svg { width: 18px; height: 18px; }
  .chip.rtl { width: auto; padding: 0 11px; }
  .tools select { max-width: 30vw; }
    #pName { display: none; }
}
body.embed .top { display: none; }
