:root {
  /* The app's colors: the map's one slate for every panel, its darker field, the buttons' edge,
     white text, the labels' grey, the dials' light blue. */
  --bg: #101010; --panel: #2b3640; --field: #222b33; --edge: #56687a; --text: #ffffff; --muted: #8a8a8a;
  --accent: #4fc3f7; --on-accent: #0b1a22; --chosen: rgba(79, 195, 247, 0.16);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* (hidden stays hidden, whatever display a rule sets) */
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, Segoe UI, sans-serif; color: var(--text); background: var(--bg); }
body { display: flex; }

#side { width: var(--side-w, 330px); flex: none; min-width: 240px; max-width: 70vw; height: 100%; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--edge); padding: 16px; }
#side .head { display: flex; align-items: center; justify-content: flex-start; margin: 0 0 14px; }   /* (the page switch, then the buttons after it; the account menu at the far right) */
#side h1 { font-size: 20px; margin: 0; letter-spacing: 0.04em; }
#settingsBtn { border: 1px solid var(--edge); background: var(--field); border-radius: 10px; width: 40px; height: 36px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; }
#settingsBtn:hover { color: var(--text); }
.headBtns { display: flex; align-items: center; gap: 8px; }
/* A link that looks like the app's buttons (the Sky page's way in, and its way back): one rounded rectangle. */
.topBtn { display: flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--edge); background: var(--field); color: var(--text);
  border-radius: 10px; text-decoration: none; font-size: 14px; font-weight: 600; cursor: pointer; box-sizing: border-box; }
.topBtn:hover { border-color: var(--accent); }

/* Settings: a sheet over the map. */
#settingsPanel { position: absolute; inset: 0; background: rgba(0,0,0,0.25); display: flex; align-items: flex-start; justify-content: center; padding-top: 70px; z-index: 5; }
#settingsPanel .sheet { width: 460px; max-width: calc(100% - 32px); background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; padding: 14px 20px 20px; box-shadow: 0 6px 24px rgba(0,0,0,0.2); }
.sheetHead { display: flex; align-items: center; justify-content: space-between; }
.sheetHead h2 { font-size: 18px; margin: 0; }
.sheetHead button { border: 0; background: none; font-size: 24px; color: var(--muted); cursor: pointer; padding: 0 6px; }
#settingsPanel h3 { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; margin: 18px 0 6px; }
.setRow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.setRow.col { flex-direction: column; align-items: stretch; gap: 6px; }
.setRow input[type=range] { width: 100%; accent-color: var(--accent); }
.setRow .group { box-shadow: none; }
.setRow[hidden] { display: none; }
/* The truck's paint: the factory colors as swatches, then any color. */
.open { display: block; text-align: center; padding: 10px; border-radius: 10px; background: var(--accent); color: var(--on-accent); cursor: pointer; font-weight: 600; }
/* The two kinds of file, each its own section. */
.section { margin-top: 18px; border-top: 1px solid var(--edge); padding-top: 12px; }
.section h2 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 4px 8px; color: var(--text); }
.section .count { color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; margin-left: 4px; }
#trips { margin-top: 4px; }

/* The trips' calendar: a day with trips can be picked (only its trips listed). */
#calendar { border: 1px solid var(--edge); border-radius: 10px; padding: 8px; margin-bottom: 6px; }
.calHead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.calHead span { font-weight: 600; font-size: 14px; }
.calHead button { border: 1px solid var(--edge); background: var(--field); color: var(--text); border-radius: 8px; width: 32px; height: 28px; cursor: pointer; font-size: 16px; }
#calGrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 13px; }
#calGrid .wd { color: var(--muted); font-size: 11px; padding: 2px 0; }
#calGrid .d { padding: 5px 0; border-radius: 8px; color: #5c6670; }
/* A day with trips: white on the field shade, ringed in the edge; picked: the light blue. */
#calGrid .d.has { color: var(--text); font-weight: 600; cursor: pointer; background: var(--field); box-shadow: inset 0 0 0 1px var(--edge); }
#calGrid .d.has:hover { background: var(--chosen); box-shadow: inset 0 0 0 1px var(--accent); }
#calGrid .d.picked { background: var(--accent); color: var(--on-accent); }
#calFilter { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--muted); }
#calFilter button { border: 1px solid var(--edge); background: var(--field); color: var(--text); border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 13px; }
.trip { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.trip:hover { background: rgba(255, 255, 255, 0.06); }
.trip.on { background: var(--chosen); border-color: var(--accent); }
.trip .t { flex: 1; min-width: 0; }
.trip .skw { position: relative; flex: none; }
.trip .sk { width: 72px; height: 52px; flex: none; }
.trip .skw img.pump { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; }
.trip .sk canvas { display: block; }
.pairbox { margin: 4px 0; padding: 2px 4px 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--edge); }
.pairhead { font-size: 13px; color: var(--muted); padding: 6px 8px 2px; }
.trip .t1 { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; } /* (a name shows in full: on one line when the panel is wide enough, else wrapped) */
.trip .t2 { font-size: 13px; color: var(--muted); }
.trip .pick { width: 18px; height: 18px; margin: 0 2px; cursor: pointer; accent-color: var(--accent); flex: none; }
.trip .x { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.day { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; margin: 14px 4px 4px; text-transform: uppercase; }

#main { position: relative; flex: 1; height: 100%; }
#map { position: absolute; inset: 0; }
#map2, #map3, #map4 { position: absolute; border-left: 2px solid var(--edge); }
#map2[hidden], #map3[hidden], #map4[hidden] { display: none; }
/* Two trips: side by side. Three: in thirds. Four: two by two. */
#main.maps2 #map { inset: 0 50% 0 0; }
#main.maps2 #map2 { inset: 0 0 0 50%; }
#main.maps3 #map { inset: 0 66.667% 0 0; }
#main.maps3 #map2 { inset: 0 33.333% 0 33.333%; }
#main.maps3 #map3 { inset: 0 0 0 66.667%; }
#main.maps4 #map { inset: 0 50% 50% 0; }
#main.maps4 #map2 { inset: 0 0 50% 50%; }
#main.maps4 #map3 { inset: 50% 50% 0 0; border-left: 0; border-top: 2px solid var(--edge); }
#main.maps4 #map4 { inset: 50% 0 0 50%; border-top: 2px solid var(--edge); }
#pill #splitLink.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
/* A trip's name and when, at the bottom of its map (separate maps). */
.mapTag { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 3; max-width: calc(100% - 200px); box-sizing: border-box; padding: 6px 16px; display: flex; align-items: center; gap: 8px;
  background: var(--panel); color: var(--text); border: 1px solid var(--edge); border-radius: 20px; font-size: 14px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.15); pointer-events: none; }
.mapTag i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.mapTag b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.mapTag span { color: var(--muted); }
.mapTag em { font-size: 18px; line-height: 1; }

#pill { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); background: var(--panel); color: var(--text); border: 1px solid var(--edge);
  border-radius: 14px; padding: 0 8px 0 22px; height: 56px; display: flex; align-items: center; gap: 14px; font-size: 17px; box-shadow: 0 2px 10px rgba(0,0,0,0.12); white-space: nowrap; }
#pill button { height: 40px; border-radius: 10px; border: 1px solid var(--edge); background: var(--field); color: var(--text); padding: 0 16px; cursor: pointer; font-size: 14px; }
#pill label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
#pill label input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
#details { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); width: 420px; max-height: calc(100% - 330px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; padding: 12px 18px 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.15); font-size: 14px; }
#details h3 { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; margin: 12px 0 4px; }
#details .row { display: flex; justify-content: space-between; padding: 3px 0; }
#details .row span:first-child { color: var(--muted); }
/* A trip's details and its route report, a tab each (as the app's). */
#details .dTabs { display: flex; gap: 6px; margin: 0 0 4px -14px; }
#details .dTabs button { height: 36px; padding: 0 14px; border: 0; border-radius: 18px; background: none; color: var(--muted);
  font: inherit; font-size: 12px; letter-spacing: 0.1em; cursor: pointer; }
#details .dTabs button.on { background: var(--field); color: var(--text); font-weight: 600; }

/* The map details' pictures (the app's tiles), before their names. */
#layers button { display: flex; align-items: center; gap: 7px; }
#layers .tileIcon { width: 26px; height: 26px; border-radius: 6px; flex: none; }
/* The map type, top left, under its label. */
#mapType { position: absolute; top: 16px; left: 16px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.ctlLabel { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.7); padding-left: 2px; }
.group { display: flex; background: var(--panel); border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.group button { border: 0; background: none; padding: 9px 12px; font-size: 13px; cursor: pointer; color: var(--text); }
.group button + button { border-left: 1px solid var(--edge); }
.group button.on { background: var(--accent); color: var(--on-accent); }
/* The agencies shaded: a swatch of each one's color, checked or not. */
#agencies { flex-wrap: wrap; max-width: 420px; justify-content: flex-end; }
#agencies button { display: flex; align-items: center; gap: 6px; }
#agencies button.on { background: var(--chosen); color: var(--text); }
#agencies .sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.35); opacity: 0.35; }
#agencies button.on .sw { opacity: 1; }
.landPop { display: flex; align-items: center; gap: 8px; }
.landPop .sw { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.35); flex: none; }
.trailPop b { display: block; margin-bottom: 4px; }
.trailPop div { color: var(--muted); font-size: 13px; }
.firePop b { display: block; margin-bottom: 4px; }
.firePop div { color: var(--muted); font-size: 13px; }
.trailPop b + b { margin-top: 6px; }
.wxPop div { white-space: pre-line; }
.fcPopup .maplibregl-popup-content { max-width: none; } /* (its hours table: wider than other popups' 320 px) */
.fcPop .landPop:empty { display: none; }
.fcPop .landPop { margin-bottom: 6px; }
.fcStrip { border-collapse: collapse; margin: 6px 0 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.fcStrip th { text-align: left; font-weight: normal; color: var(--muted); padding: 2px 10px 2px 0; border-right: 1px solid var(--edge); white-space: nowrap; }
.fcStrip td { text-align: center; min-width: 44px; padding: 2px 4px; white-space: nowrap; }
.fcStrip td.fcHour { color: var(--muted); font-size: 12px; }
.fcStrip td.fcMuted { color: var(--muted); }
.fcStrip td.fcLikely { color: #4fc3f7; font-weight: 600; }
.fcStrip td.fcThunder { color: #fdd835; font-weight: 600; }
.fcStrip td.fcGusty { color: #ffa726; font-weight: 600; }
.fcPop .fcDays div { color: var(--text); font-size: 13px; margin: 2px 0; }
.fcPop .fcName { display: inline-block; min-width: 120px; font-weight: 600; }
.fcPop .fcFoot { margin-top: 6px; font-size: 12px; }
.fcPop .fcAlerts { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--edge); }

#bottom { position: absolute; left: 16px; right: 16px; bottom: 20px; margin: 0 auto; max-width: 980px; background: var(--panel); color: var(--text);
  border: 2px solid #4d4d4d; border-radius: 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.15); overflow: hidden; }
/* The replay row, as the app's ReplayPanel: play, the trip's clock over the time played, the bar, the speeds, stop. */
#replay { display: flex; align-items: center; padding: 6px 8px 6px 10px; }
#replay button { border: 0; background: none; color: #fff; cursor: pointer; font: inherit; padding: 0; }
#play { width: 64px; height: 64px; font-size: 26px; flex: none; }
#times { width: 110px; flex: none; padding: 0 8px 0 4px; }
#clock { font-size: 18px; color: #fff; }
#elapsed { font-size: 13px; color: #8a8a8a; font-variant-numeric: tabular-nums; }
#seek { flex: 1; min-width: 0; height: 56px; margin: 0 8px 0 0; }
#speeds { display: flex; flex: none; margin-left: 8px; padding: 3px; border: 1px solid #5a5a5a; border-radius: 10px; }
#speeds button { width: 54px; height: 48px; font-size: 17px; border-radius: 8px; }
#speeds button.on { background: #4fc3f7; color: #000; }
#stopBtn { width: 56px; height: 56px; font-size: 22px; flex: none; }
#stopBtn.idle { visibility: hidden; }
/* The elevation in its own darker block (the app's field shade), apart from the replay row. */
#profile { display: block; width: calc(100% - 16px); height: 130px; margin: 4px 8px 8px; border-radius: 10px; background: var(--field); cursor: ew-resize; touch-action: none; }

/* Trips filtered by a word (their titles, their marks). */
#tripFilter { width: 100%; height: 36px; margin: 6px 0 4px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--edge);
  background: var(--field); color: var(--text); font: inherit; font-size: 14px; }
/* Trips compared: the table (each trip's column in its color, the best in a row marked), the
   same route's picker, and the chart along the route. */
#details .cTable { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
#details .cTable th { text-align: right; font-weight: 600; padding: 4px 0 8px 12px; color: var(--c); white-space: nowrap; }
#details .cTable td { padding: 3px 0 3px 12px; text-align: right; white-space: nowrap; }
#details .cTable td:first-child { text-align: left; color: var(--muted); padding-left: 0; }
#details .cTable td.best { color: #81c784; font-weight: 600; }
#details .cTable .cDot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 6px; }
#details .share.s0 { color: #43a047; } #details .share.s1 { color: #fdd835; } #details .share.s2 { color: #e53935; }
#details.wide { width: min(760px, calc(100% - 32px)); }
#sameRoute { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); width: 420px; max-height: calc(100% - 330px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; padding: 12px 18px 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.15); font-size: 14px; }
#sameRoute h3 { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; margin: 4px 0 8px; font-weight: 600; }
#sameRoute label { display: flex; gap: 10px; align-items: center; padding: 6px 0; cursor: pointer; }
#sameRoute label.off { opacity: 0.45; cursor: default; }
#sameRoute .srWhen { flex: 1; }
#sameRoute .srWhat { color: var(--muted); }
#sameRoute .srGo { margin-top: 10px; height: 38px; width: 100%; border-radius: 19px; border: 0; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; cursor: pointer; }
#sameRoute .srGo:disabled { opacity: 0.4; cursor: default; }

#toast { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); background: #323232; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; }
#toast .toastBtn { border: 0; border-radius: 6px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; padding: 8px 14px; cursor: pointer; }
#toast .toastX { border: 0; background: none; color: #fff; font: inherit; font-size: 16px; margin-left: 8px; cursor: pointer; }

.maplibregl-popup-content { font-size: 14px; max-width: 320px; }
.markPop b { display: block; margin-bottom: 4px; }
.markPop img { width: 100%; border-radius: 6px; margin-top: 6px; cursor: zoom-in; }
/* Sync from Google Drive: under Open, the same look. */
button.open { width: 100%; border: 0; margin-top: 8px; font: inherit; font-weight: 600; }
button.open:disabled { opacity: 0.6; cursor: default; }
/* Marks edited here: the right-click menu, the form, and a mark's Edit / Delete. */
.ctxPopup .maplibregl-popup-content { padding: 4px; }
.ctxPopup .maplibregl-popup-tip { display: none; }
.ctxMenu button { display: block; width: 100%; padding: 8px 14px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
.ctxMenu button:hover { background: rgba(0, 0, 0, 0.07); }
.markForm { display: flex; flex-direction: column; gap: 8px; min-width: 260px; }
.formPhotos { display: flex; flex-wrap: wrap; gap: 6px; }
.formPhotos span { position: relative; }
.formPhotos img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.formPhotos button { position: absolute; top: 2px; right: 2px; border: 0; border-radius: 50%; width: 20px; height: 20px; background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer; line-height: 18px; padding: 0; }
.formAdd { color: var(--accent); cursor: pointer; }
.markActions { display: flex; gap: 8px; margin-top: 8px; }
.markPending { margin-top: 6px; color: #ffd27a; font-size: 13px; }
/* The bottom panel's fold bar: a grip; folded, the bar alone says what's in it. */
#bottomFold { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; color: #6a6a6a; font: inherit; font-size: 13px; }
#bottomFold .grip { width: 40px; height: 4px; border-radius: 2px; background: #5a5a5a; }
#bottomFold:hover .grip { background: var(--muted); }
#bottomFold .foldText { display: none; }
#bottom.folded #bottomFold { height: 32px; }
#bottom.folded #bottomFold .grip { display: none; }
#bottom.folded #bottomFold .foldText { display: inline; }
#bottom.folded #bottomFold .foldText::before { content: '▴ '; }
#bottom.folded #replay, #bottom.folded #profile { display: none; }
/* A mark's card, as the app's (MarkCard): the map's slate, its field color, the kind chips, the
   photos' box, Move and Delete. */
#markCard { position: fixed; left: 0; top: 0; width: 560px; /* (the app's 560 dp) */ max-width: calc(100vw - 32px); z-index: 50; /* (over every other control) */
  background: #2b3640; border: 2px solid #4d4d4d; border-radius: 14px; padding: 10px 10px 12px 14px; color: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); font-size: 15px; }
#markCard .mcHead { display: flex; align-items: center; gap: 10px; }
#markCard .mcTexts { flex: 1; min-width: 0; }
#markCard .mcSub { color: #8a8a8a; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#markCard .mcTrip { display: block; max-width: 100%; padding: 2px 0 0; border: 0; background: none; color: #64b5f6; font: inherit; font-size: 13px;
  text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
#markCard .mcTrip:hover { text-decoration: underline; }
#markCard .mcTrip[hidden] { display: none; }
#markCard .mcClose { width: 48px; height: 48px; border: 0; background: none; color: #fff; font-size: 20px; cursor: pointer; }
/* The kind: the chosen one's button beside ✕, its list dropped down under it (one per line). */
#markCard .mcKindBox { position: relative; flex: none; }
#markCard .mcHead .mcName { flex: 1; min-width: 0; resize: none; }
#markCard .mcTexts { margin: 6px 0 0 2px; }
#markCard .mcKinds { position: absolute; left: 0; top: calc(100% + 4px); z-index: 2; display: flex; flex-direction: column; gap: 4px; padding: 6px;
  min-width: 180px; background: #2b3640; border: 1px solid #56687a; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,0.4); }
#markCard .mcKinds .mcChip { width: 100%; justify-content: flex-start; gap: 8px; height: 40px; }
#markCard .mcChip { display: flex; align-items: center; gap: 4px; flex: none; height: 44px; padding: 0 10px 0 8px; border-radius: 10px;
  border: 1px solid #56687a; background: transparent; color: #fff; font: inherit; font-size: 14px; cursor: pointer; }
#markCard .mcChip.on { background: var(--c); border: 2px solid var(--c); color: #000; }
#markCard .mcChip:disabled { cursor: default; opacity: 0.7; }
#markCard .mcGlyph canvas { width: 18px; height: 18px; display: block; }
/* The name (in the head row, all the room up to ✕) and the notes (under it, the card's width), as the app's. */
#markCard .mcName, #markCard .mcNote { min-width: 0; box-sizing: border-box; padding: 10px 12px; border: 0; border-radius: 10px;
  background: #222b33; color: #fff; font: inherit; font-size: 16px; resize: vertical; display: block; }
#markCard .mcNote { width: 100%; margin-top: 10px; } /* (the card's width, under the name's row) */
#markCard .mcName::placeholder, #markCard .mcNote::placeholder { color: #8a8a8a; }
#markCard .mcPhotos { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding: 10px; border-radius: 10px; background: #222b33; }
#markCard .mcPhotos a { position: relative; flex: none; }
#markCard .mcPhotos img, #markCard .mcNoPhoto { width: 112px; height: 112px; object-fit: cover; border-radius: 8px; display: block; }
#markCard .mcAdd { flex: none; width: 112px; height: 112px; box-sizing: border-box; border: 1px solid #56687a; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 13px; text-align: center; cursor: pointer; line-height: 1.2; }
#markCard .mcAdd b { font-size: 26px; font-weight: 400; }
#markCard .mcAdd.busy { pointer-events: none; }
#markCard .mcAddText { display: contents; }
/* Uploading: a ring filling for the whole batch (--p, 0–360deg), which one and how far inside. */
#markCard .mcRing { width: 74px; height: 74px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(#4fc3f7 var(--p, 0deg), #3a4652 0); }
#markCard .mcRing > span { width: 62px; height: 62px; border-radius: 50%; background: #222b33; display: flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1.25; color: #fff; }
/* At the bottom, the photos (as large as the room allows) and beside them, right, Move above Delete,
   as tall as the photos' box (as the app's). */
#markCard .mcBottom { display: flex; gap: 8px; margin-top: 10px; align-items: stretch; }
#markCard .mcBottom .mcPhotos { flex: 1; min-width: 0; margin-top: 0; }
#markCard .mcActions { display: flex; flex-direction: column; gap: 8px; width: 112px; flex: none; }
#markCard .mcActions button { flex: 1; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid #56687a; background: none; font: inherit; font-size: 15px; cursor: pointer; }
#markCard .mcDelete { color: #ef5350; }
#markCard .mcMove { color: #fff; }
/* Moving a mark: the bar over the map's top (the map panned under the reticle meanwhile). */
#moveBar { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 32px); box-sizing: border-box; background: var(--panel); border: 2px solid var(--edge); border-radius: 12px;
  padding: 8px 8px 8px 16px; color: var(--text); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); font-size: 15px; }
#moveBar[hidden] { display: none; }
#moveBar span { flex: 1; min-width: 0; }
#moveBar button { flex: none; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--edge); background: none; color: var(--text); font: inherit; cursor: pointer; }
#moveBar .mbPlace { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (max-width: 640px) { #moveBar { left: 16px; right: 104px; transform: none; } } /* (clear of the crosshair button) */
#markCard .mcHint { margin-top: 8px; color: #ffd27a; font-size: 13px; }
/* The layers button and its popover, as the app's: the button on a see-through blue panel (the
   map detail that's on beside it), the popover in the map's slate with tiles, chips and switches. */
/* (The map detail that's on: its tile under the layers button, what the map's showing.) */
#layersPanel { position: absolute; top: 16px; left: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 3; }
#layersRow { display: flex; gap: 10px; }
#layersBtn, #activeTile { width: 56px; height: 56px; border-radius: 10px; border: 1px solid #56687a; background: #2b3640; color: #4fc3f7;
  display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; position: relative; overflow: hidden; }
#activeTile { padding: 3px; }
#activeTile img { width: 100%; height: 100%; border-radius: 7px; display: block; }
#activeTile .car { display: none; position: absolute; inset: 0; margin: auto; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(30, 30, 30, 0.8); align-items: center; justify-content: center; }
#activeTile.hidden img { filter: grayscale(1); opacity: 0.45; }
#activeTile.hidden .car { display: flex; }
#layersPop { position: absolute; top: 16px; left: 100px; width: 470px; max-height: calc(100% - 140px); overflow-y: auto; z-index: 6;
  background: #2b3640; border: 2px solid #56687a; border-radius: 12px; padding: 10px 8px 8px; color: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); scrollbar-width: none; }
#layersPop .popHead { color: #8a8a8a; font-size: 13px; letter-spacing: 0.1em; padding: 6px 12px 6px; }
#layersPop .typeHead { display: flex; align-items: center; justify-content: space-between; padding-right: 10px; }
#layersPop .iconGroup button { padding: 6px 11px; display: flex; align-items: center; }
#layersPop .iconGroup svg { display: block; }
#layersPop .detailsHead { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; }
#layersPop .tileRow { display: flex; gap: 6px; padding: 0 0 4px 8px; }
#layersPop #layers { overflow-x: auto; scrollbar-width: none; } /* (the details scroll sideways: the temperature tile comes last) */
#layersPop .tileRow button { flex: none; }
#layersPop .tileRow button { width: 84px; padding: 4px 0; border: 0; background: none; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; font: inherit; font-size: 13px; }
#layersPop .tileRow img { width: 72px; height: 72px; border-radius: 12px; box-sizing: border-box; border: 1px solid #56687a; display: block; }
#layersPop .tileRow span { padding-top: 5px; text-align: center; line-height: 1.2; }
#layersPop .tileRow button.on img { border: 3px solid #4fc3f7; }
#layersPop .tileRow button.on span { color: #4fc3f7; }
#layersPop .chipRow { display: flex; gap: 6px; padding: 4px 10px; flex-wrap: wrap; }
#layersPop .chipRow button { flex: 1; min-width: 80px; height: 40px; border-radius: 10px; border: 1px solid #56687a; background: none; color: #fff; font: inherit; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
#layersPop .chipRow button.on { border: 2px solid #4fc3f7; background: rgba(79, 195, 247, 0.16); }
#layersPop #agencies .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
#layersPop .swRow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; padding: 0 4px; }
#layersPop button.sw { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 6px 0 8px; border: 0; background: none;
  color: #8a8a8a; font: inherit; font-size: 13px; letter-spacing: 0.1em; cursor: pointer; text-align: left; }
/* The switch's track and thumb (Material's). */
#layersPop button.sw::after { content: ''; flex: none; width: 40px; height: 22px; border-radius: 11px; border: 2px solid #8a8a8a; box-sizing: border-box;
  background: radial-gradient(circle 7px at 10px 50%, #8a8a8a 98%, transparent 100%) no-repeat; transition: background-position 0.15s; }
#layersPop button.sw.on::after { border-color: #4fc3f7; background: #4fc3f7 radial-gradient(circle 8px at 26px 50%, #0d2a36 98%, transparent 100%) no-repeat; }

/* The app's colors on the rest: fields, selects and the map's own popups and controls. */
input, select, textarea { color: var(--text); }
select { background: var(--field); color: var(--text); border-color: var(--edge); }
#replay input[type=range], .setRow input[type=range] { accent-color: var(--accent); }
.maplibregl-popup-content { background: var(--panel); color: var(--text); border: 1px solid var(--edge); border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.maplibregl-popup-close-button { color: var(--text); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--panel); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--panel); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--panel); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--panel); }
.ctxMenu button { color: var(--text); }
.ctxMenu button:hover { background: rgba(255, 255, 255, 0.08); }
.maplibregl-ctrl-group { background: var(--panel); border: 1px solid var(--edge); }
.maplibregl-ctrl-group button + button { border-top-color: var(--edge); }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { background: rgba(43, 54, 64, 0.8) !important; color: var(--muted); }
.maplibregl-ctrl-attrib a { color: var(--muted); }
/* The switch rows: full width, each label left, its switch lined up at the right of its half. */
#layersPop .swRow { width: 100%; }
#layersPop .swRow.one { grid-template-columns: 1fr; }
#layersPop button.sw { width: 100%; min-width: 0; }
/* The packs in the list: shown, not picked (the layers popover switches them). */
.trip.pack { cursor: default; }
.trip.pack:hover { background: none; }
/* The coordinates, top right (the app's right-hand column): the crosshair button on the see-through
   panel, its popover to its left; open, the reticle on the map's middle. */
#rightPanel { position: absolute; top: 16px; right: 16px; z-index: 3; align-items: flex-end; }
#rightPanel { display: flex; flex-direction: column; gap: 8px; }
#searchBtn { width: 56px; height: 56px; border-radius: 10px; border: 1px solid var(--edge); background: var(--panel); padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; }
#searchBtn.on { border: 2px solid var(--accent); }
#searchPop { position: absolute; top: 16px; left: 100px; z-index: 6; width: 380px; max-width: calc(100vw - 140px); max-height: calc(100% - 32px);
  display: flex; flex-direction: column; background: var(--panel); border: 2px solid var(--edge); border-radius: 12px; padding: 10px;
  color: var(--text); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
#searchInput { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--edge); background: var(--field); color: var(--text); font: inherit; font-size: 16px; }
#searchResults { overflow-y: auto; margin-top: 6px; }
#searchResults .sHead { color: var(--muted); font-size: 12px; letter-spacing: 0.1em; padding: 10px 4px 4px; }
#searchResults .sNote { color: var(--muted); font-size: 13px; padding: 6px 4px; }
#searchResults .sRow { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--text);
  text-align: left; font: inherit; padding: 7px 6px; border-radius: 8px; cursor: pointer; }
#searchResults .sRow:hover { background: rgba(255, 255, 255, 0.07); }
#searchResults .sRow canvas, #searchResults .sRow .sPlace { width: 22px; height: 22px; flex: none; }
#searchResults .sRow .sPlace { border-radius: 50%; background: #ef5350; box-shadow: inset 0 0 0 6px #2b3640; }
#searchResults .sT1 { font-size: 15px; }
#searchResults .sT2 { color: var(--muted); font-size: 12px; }
  border-radius: 12px; padding: 6px 18px 10px 16px; color: var(--text); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
#reticle { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none; z-index: 2; }
#reticle svg { display: block; }

/* The photo viewer (as the app's): the photo on black, the bar above, the EXIF details panel on the
   right (folded: the bar's Details opens it). */
#viewer { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; }
#viewer .vwStage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
#viewer.vwOpen .vwStage { right: 480px; }
#viewer .vwStage img { max-width: 100%; max-height: 100%; object-fit: contain; }
#viewer .vwBar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 16px;
  background: linear-gradient(rgba(0,0,0,0.67), rgba(0,0,0,0)); font-size: 17px; text-shadow: 0 1px 4px #000; }
#viewer.vwOpen .vwBar { right: 480px; }
#viewer .vwCaption { flex: 1; }
#viewer .vwBar button { border: 0; background: none; color: #fff; font: inherit; cursor: pointer; height: 56px; padding: 0 18px; }
#viewer .vwBar .vwClose { font-size: 26px; width: 56px; padding: 0; }
#viewer .vwBar .vwPano { color: #4fc3f7; font-weight: 600; }
#viewer .vwPanoStage { position: absolute; inset: 0; z-index: 3; background: #000; }
#viewer .vwPanoView { position: absolute; inset: 0; }
#viewer .vwPanoClose { position: absolute; top: 12px; right: 12px; z-index: 4; height: 48px; padding: 0 18px; border: 0; border-radius: 24px;
  background: rgba(0,0,0,0.6); color: #fff; font: inherit; font-size: 15px; cursor: pointer; }
/* A panorama's thumbnail: its badge. */
.panoBadge { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,0.65); color: #4fc3f7; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; pointer-events: none; }
#viewer.vwOpen .vwDetails { display: none; }
#viewer .vwPrev, #viewer .vwNext { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 96px; border: 0; border-radius: 12px;
  background: rgba(0,0,0,0.35); color: #fff; font-size: 44px; cursor: pointer; }
#viewer .vwPrev { left: 12px; }
#viewer .vwNext { right: 12px; }
#viewer.vwOpen .vwNext { right: 492px; }
#viewer .vwPanel { display: none; text-align: left; position: absolute; top: 0; right: 0; bottom: 0; width: 480px; box-sizing: border-box; background: rgba(43, 54, 64, 0.94);
  flex-direction: column; }
#viewer.vwOpen .vwPanel { display: flex; }
#viewer .vwHead { display: flex; align-items: center; height: 64px; flex: none; padding: 0 8px 0 20px; cursor: pointer; }
#viewer .vwHead b { flex: 1; font-size: 18px; }
#viewer .vwFold { border: 0; background: none; color: #fff; font-size: 30px; width: 56px; height: 56px; cursor: pointer; }
#viewer .vwBody { overflow-y: auto; padding: 4px 20px 24px; user-select: text; }
#viewer .vwBody h4 { margin: 18px 0 6px; font-size: 13px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: #9aa7b2; }
#viewer .vwRow { display: flex; justify-content: flex-start; text-align: left; gap: 12px; padding: 3px 0; font-size: 15px; }
#viewer .vwRow span:first-child { flex: none; width: 170px; color: #9aa7b2; }
#viewer .vwRow span:last-child { flex: 1; overflow-wrap: anywhere; }
#viewer .vwAll { display: block; text-align: left; margin: 22px 0 8px; padding: 0; border: 0; background: none; color: #64b5f6; font: inherit; font-size: 15px; cursor: pointer; }
#viewer .vwNone { color: #9aa7b2; font-size: 15px; margin-top: 18px; }

/* Directions: where the search opens (the search, open meanwhile, under them). */
#dirPanel { position: absolute; top: 16px; right: 100px; z-index: 7; width: 380px; max-width: calc(100vw - 140px); box-sizing: border-box;
  background: var(--panel); border: 2px solid var(--edge); border-radius: 12px; padding: 10px 12px 12px; color: var(--text); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
#dirPanel .popHead { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; letter-spacing: 0.1em; }
#dirClose { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 2px 4px; }
#dirClose:hover { color: var(--text); }
#dirPanel .dirRow { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
#dirPanel .dirDot { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-sizing: border-box; }
#dirPanel .dirDot.from { background: #43a047; }
#dirPanel .dirDot.to { background: #ef5350; }
#dirFrom { flex: 1; min-width: 0; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--edge); background: var(--field); color: var(--text); font: inherit; font-size: 15px; }
#dirTo { flex: 1; min-width: 0; padding: 4px 2px; }
#dirTo b { display: block; font-weight: 600; }
#dirTo div { color: var(--muted); font-size: 13px; }
#dirResults { max-height: 300px; overflow-y: auto; margin-left: 24px; }
#dirResults .sRow { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--text);
  text-align: left; font: inherit; padding: 7px 6px; border-radius: 8px; cursor: pointer; }
#dirResults .sRow:hover { background: rgba(255, 255, 255, 0.07); }
#dirResults .sRow canvas, #dirResults .sRow .sPlace { width: 22px; height: 22px; flex: none; }
#dirResults .sRow .sPlace { border-radius: 50%; background: #ef5350; box-shadow: inset 0 0 0 6px #2b3640; }
#dirResults .sNote { color: var(--muted); font-size: 13px; padding: 6px 4px; }
#dirSummary { margin-top: 10px; font-size: 15px; white-space: pre-line; }
#dirSummary:empty { display: none; }
#dirSummary.err { color: #ef9a9a; }
#dirEngine { width: 100%; height: 36px; margin-top: 10px; border-radius: 10px; border: 1px solid var(--edge); background: none; color: var(--text); font: inherit; padding: 0 8px; }
#dirEngine option { background: var(--panel); }
#dirPanel .dirActions { display: flex; gap: 8px; margin-top: 10px; }
#dirPanel .dirActions button { flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--edge); background: none; color: var(--text); font: inherit; cursor: pointer; }
#dirPanel .dirActions #dirSend { border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; }
#dirPanel .dirActions button:disabled { opacity: 0.45; cursor: default; }

/* The route report: a card over the map (as the app's). */
#report { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; }
#report .rpCard { width: 720px; max-width: calc(100vw - 32px); max-height: calc(100vh - 64px); display: flex; flex-direction: column; text-align: left;
  background: var(--panel); border: 2px solid var(--edge); border-radius: 16px; color: var(--text); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
#report .rpHead { display: flex; align-items: center; padding: 8px 8px 0 24px; }
#report .rpHead b { flex: 1; font-size: 20px; }
#report .rpHead button { border: 0; background: none; color: #fff; font-size: 22px; width: 52px; height: 52px; cursor: pointer; }
#report .rpScroll { overflow-y: auto; padding: 0 24px 24px; }
/* The report itself (in the window, or the trip details' tab): when leaving, its date and time
   each a pill (the settings' outlined buttons), then arriving. */
.rp .rpTimes { display: flex; align-items: center; gap: 8px; color: #9aa7b2; font-size: 15px; flex-wrap: wrap; }
.rp .rpTimes > span:first-child { margin-right: 4px; }
.rp .rpDay, .rp .rpTime { background: transparent; color: var(--text); border: 1px solid var(--edge); border-radius: 20px; height: 40px;
  padding: 0 14px; font: inherit; color-scheme: dark; cursor: pointer; }
.rp .rpSpace { flex: 1; }
.rp .rpAgain { border: 0; background: none; color: #fff; font-size: 22px; width: 44px; height: 44px; cursor: pointer; }
.rp .rpArrive { color: #9aa7b2; font-size: 15px; margin-top: 6px; }
.rp h4 { margin: 20px 0 6px; font-size: 13px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: #9aa7b2; }
.rp p { margin: 3px 0; font-size: 15px; }
.rp .rpSum { font-size: 17px; font-weight: 600; margin-top: 12px; }
.rp .rpMuted, .rp .rpNote { color: #9aa7b2; }
.rp .rpNote { font-size: 13px; }
.rp .rpSevere { color: #ef5350; }
.rp .rpItem { display: block; width: 100%; text-align: left; margin-top: 6px; padding: 8px 12px; border: 0; border-radius: 10px;
  background: var(--field); color: var(--text); font: inherit; cursor: pointer; }
.rp .rpItem:hover { background: #2a3540; }
.rp .rpItem b { display: block; font-size: 16px; }
.rp .rpItem span { display: block; color: #9aa7b2; font-size: 14px; }



/* Sign in: over the whole page until someone is signed in (signin.js). */
#signin { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 16px; }
#signinForm { width: 360px; max-width: 100%; background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
#signinForm h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: 0.04em; }
#signinForm p { margin: 0; font-size: 14px; color: var(--muted); }
#signinForm input { font: inherit; font-size: 16px; color: var(--text); background: var(--field); border: 1px solid var(--edge); border-radius: 10px; padding: 11px 12px; width: 100%; }
#signinForm input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
#loginFields, #changeFields { display: flex; flex-direction: column; gap: 12px; }
#signinButton { font: inherit; font-size: 16px; font-weight: 600; border: 0; border-radius: 10px; padding: 11px; cursor: pointer; background: var(--accent); color: var(--on-accent); }
#signinButton:disabled { opacity: 0.6; cursor: default; }
#signinNote { min-height: 1.2em; color: #ff8a80 !important; }
#who { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -6px 0 12px; font-size: 13px; color: var(--muted); }
#whoName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#signOutBtn { font: inherit; font-size: 12px; color: var(--muted); background: none; border: 1px solid var(--edge); border-radius: 8px; padding: 3px 10px; cursor: pointer; }
#signOutBtn:hover { color: var(--text); }
.whoButtons { display: flex; gap: 6px; flex: none; }
#shareBtn { font: inherit; font-size: 12px; color: var(--muted); background: none; border: 1px solid var(--edge); border-radius: 8px; padding: 3px 10px; cursor: pointer; }
#shareBtn:hover { color: var(--text); }
#shareDialog, #devDialog, #pwDialog { background: var(--panel); color: var(--text); border: 1px solid var(--edge); border-radius: 14px; padding: 16px 20px 18px; width: 380px; max-width: calc(100% - 32px); }
#shareDialog::backdrop, #devDialog::backdrop, #pwDialog::backdrop { background: rgba(0, 0, 0, 0.45); }
#shareDialog h3, #devDialog h3, #pwDialog h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.shareRow { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 15px; cursor: pointer; }
.shareRow input { width: 18px; height: 18px; accent-color: var(--accent); }
.shareName { flex: 1; }
.shareNote { font-size: 12px; color: var(--muted); }
.shareHint { font-size: 12px; color: var(--muted); margin: 10px 0 12px; }
#shareDialog form { text-align: right; }
#shareDialog form button { font: inherit; font-size: 14px; color: var(--text); background: var(--field); border: 1px solid var(--edge); border-radius: 8px; padding: 5px 16px; cursor: pointer; }

/* The compass button (under Layers) and the HUD button / readouts (top right), as the app's. */
#compassBtn, #hudBtn { width: 56px; height: 56px; border-radius: 10px; border: 2px solid var(--edge); background: var(--panel); padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
#compassBtn.turning { border: 2px dashed var(--accent); }
#compassBtn.forward { border: 2px solid var(--accent); }
#compassNeedle { transition: transform 0.15s linear; }
#hudBtn { border-width: 1px; }
#hudBox { display: flex; flex-direction: column; align-items: flex-end; }
#hudCards { display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.hudCard { display: flex; align-items: flex-start; background: rgba(43, 54, 64, 0.62); border-radius: 14px; padding: 8px 22px 10px 20px; }
.hudLabel { color: #d0dce6; font-size: 16px; font-weight: 700; letter-spacing: 0.1em; min-width: 78px; margin-top: 10px; text-shadow: 0 0 2px rgba(0, 0, 0, 0.9); }
.hudCard b { color: #fff; font-size: 32px; font-weight: 400; font-variant-numeric: tabular-nums; text-shadow: 0 0 2px rgba(0, 0, 0, 0.8); }

/* The side panel's drag handle: a thin bar between it and the map. */
#sideHandle { flex: none; width: 7px; margin-left: -4px; cursor: col-resize; z-index: 4; background: transparent; touch-action: none; }
#sideHandle:hover, #sideHandle.dragging { background: var(--accent); opacity: 0.55; }
body.resizing { user-select: none; cursor: col-resize; }

/* A photo on a mark's card: its remove button, in the corner. */
#markCard .mcPhotoX { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 13px; line-height: 24px; text-align: center; opacity: 0; transition: opacity 0.12s; }
#markCard .mcPhotos a:hover .mcPhotoX, #markCard .mcPhotoX:focus { opacity: 1; }
@media (hover: none) { #markCard .mcPhotoX { opacity: 1; } }

/* A phone: the replay is the app's compact player only (play, the speeds, stop): no clock, bar, elevation or fold bar. */
@media (max-width: 640px), (max-height: 520px) and (pointer: coarse) {
  #bottom { left: 8px; right: 8px; max-width: none; }
  #times, #seek, #profile, #bottomFold { display: none; }
  #bottom.folded #replay { display: flex; }
  #replay { justify-content: space-between; padding: 4px 6px; }
  #play { width: 56px; height: 56px; }
  #speeds { margin-left: 0; }
  #speeds button { width: 46px; height: 44px; font-size: 16px; }
  #stopBtn { width: 48px; height: 48px; }
}

#pill #pillClose { width: 40px; padding: 0; border: 0; background: none; font-size: 20px; }

/* No map detail chosen: the player has no graph section. */
#bottom.noGraph #profile { display: none; }

/* The measure tool's bar, top middle (the app's tool bar). */
#measureBar { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 12px; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 14px; padding: 8px 10px 8px 18px; box-shadow: 0 2px 10px rgba(0,0,0,0.25); white-space: nowrap; }
#measureBar b { color: var(--muted); font-size: 13px; letter-spacing: 0.1em; font-weight: 600; }
#measureResult { min-width: 190px; font-size: 16px; }
#measureBar button { height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--edge); background: var(--field); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
#measureBar button:disabled { opacity: 0.4; cursor: default; }
#measureDone { background: var(--accent); color: var(--on-accent); border-color: transparent; }

/* The title is the page switch: this page's name lit, the other page one click away (one rounded rectangle in two parts). */
#side h1.modeSwitch { display: flex; align-items: stretch; height: 36px; font-size: 15px; letter-spacing: 0.04em; border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; background: var(--field); }
.modeSwitch .cur, .modeSwitch a, .modeSwitch button { display: flex; align-items: center; padding: 0 14px; font-weight: 700; white-space: nowrap; }
.modeSwitch .cur { background: var(--accent); color: var(--on-accent); }
.modeSwitch a { color: var(--muted); text-decoration: none; cursor: pointer; font-weight: 600; }
.modeSwitch a:hover, .modeSwitch button:hover { color: var(--text); background: var(--chosen); }
.modeSwitch button { border: 0; border-left: 1px solid var(--edge); border-radius: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }

/* The Accounts link in the signed-in row (admins only). */
.whoLink { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--edge); border-radius: 8px; background: var(--field); color: var(--text);
  font-size: 13px; text-decoration: none; cursor: pointer; }
.whoLink:hover { border-color: var(--accent); }

/* The side panel folds away (Cmd/Ctrl+B): a tab on its edge, at the screen's edge once it is folded. */
#sideToggle { position: fixed; top: 50%; transform: translateY(-50%); left: 330px; z-index: 6; width: 22px; height: 44px; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid var(--edge); border-left: 0; border-radius: 0 10px 10px 0; background: var(--panel); color: var(--muted); box-shadow: 2px 1px 6px rgba(0, 0, 0, 0.3); }
#sideToggle:hover { color: var(--text); border-color: var(--accent); }
#sideToggle svg { transition: transform 0.15s; }
body.sideCollapsed #side, body.sideCollapsed #sideHandle { display: none; }
body.sideCollapsed #sideToggle svg { transform: rotate(180deg); }

/* Driving stats (statspage.js): a sheet like Settings, with the choices in a row and four cards. */
#statsPanel { position: absolute; inset: 0; background: rgba(0,0,0,0.25); display: flex; align-items: flex-start; justify-content: center; padding-top: 70px; z-index: 5; }
#statsPanel .sheet { width: 640px; max-width: calc(100% - 32px); background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; padding: 14px 20px 20px; box-shadow: 0 6px 24px rgba(0,0,0,0.2); }
.statsRow { display: flex; gap: 8px; margin-top: 14px; }
.statsRow button, .statsRow input[type=date] { flex: 1 1 0; min-width: 0; height: 40px; font: inherit; font-size: 14px; color: var(--text); background: var(--field); border: 1px solid var(--edge); border-radius: 10px; padding: 0 8px; cursor: pointer; }
.statsRow button:hover, .statsRow input:hover { border-color: var(--accent); }
.statsRow button.on, .statsRow input.on { border: 2px solid var(--accent); background: var(--chosen); }
.statsRow label { flex: 1 1 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.statsRow.dates label input { flex: 1; }
#statsNote { min-height: 18px; margin: 10px 2px 0; color: var(--muted); font-size: 13px; }
.statsCards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.statsCard { background: var(--field); border: 1px solid var(--edge); border-radius: 12px; padding: 16px 18px; }
.statsCard h4 { margin: 0; font-size: 12px; letter-spacing: 0.1em; color: var(--accent); }
.statsCard b { display: block; margin-top: 8px; font-size: 32px; font-weight: 700; }
.statsCard span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
@media (max-width: 560px) { .statsCards { grid-template-columns: 1fr; } .statsRow { flex-wrap: wrap; } .statsRow button { flex: 1 1 30%; } }

/* The map's mode (light or dark) in the layers popover: two equal halves. */
.modeGroup { margin: 4px 0 10px; box-shadow: none; }
.modeGroup button { flex: 1 1 0; padding: 10px 12px; font-size: 14px; }

/* Sky's views under the page switch: Map | Patterns | Show, three equal parts, the one shown lit. */
#skyModes { display: flex; height: 36px; margin: 0 0 12px; border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; background: var(--field); font-size: 14px; }
#skyModes > * { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; padding: 0; }
#skyModes > * + * { border-left: 1px solid var(--edge); }
#skyModes > :not(.cur):hover { color: var(--text); background: var(--chosen); }
#skyModes > .cur { background: var(--accent); color: var(--on-accent); font-weight: 700; cursor: default; }

/* The account menu, on the page switch's line (the right end): a person button; opened, who is signed in, Accounts (admins), Sharing and Sign out. */
#side .head { gap: 8px; }
#who.userMenu { position: relative; display: block; margin: 0 0 0 auto; padding: 0; font-size: 14px; flex: none; }
#side .head #who.userMenu { margin-left: auto; }
#whoToggle { display: flex; align-items: center; justify-content: center; width: 40px; height: 36px; padding: 0; border: 1px solid var(--edge); border-radius: 10px; background: var(--field); color: var(--muted); cursor: pointer; }
#whoToggle:hover, #whoToggle[aria-expanded="true"] { color: var(--text); border-color: var(--accent); }
#whoMenu { position: absolute; right: 0; top: 42px; z-index: 30; min-width: 190px; padding: 6px; border: 1px solid var(--edge); border-radius: 12px; background: var(--panel); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
#whoMenu .whoHead { padding: 6px 10px 8px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--edge); margin-bottom: 4px; }
#whoMenu .whoHead b { color: var(--text); font-weight: 600; }
#whoMenu .whoItem { display: flex; align-items: center; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; box-sizing: border-box; }
#whoMenu .whoItem:hover { background: var(--chosen); }
#whoMenu [hidden] { display: none !important; }

#hudTires { font-size: 20px; white-space: pre; line-height: 1.2; margin-top: 4px; }

.devRow { cursor: default; flex-wrap: wrap; }
.devRow button, .pwButtons button { font: inherit; font-size: 14px; color: var(--text); background: var(--field); border: 1px solid var(--edge); border-radius: 8px; padding: 5px 14px; cursor: pointer; }
.pwRow { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.pwRow input { font: inherit; font-size: 15px; color: var(--text); background: var(--field); border: 1px solid var(--edge); border-radius: 8px; padding: 7px 10px; }
.pwButtons { display: flex; justify-content: flex-end; gap: 8px; }

/* The one menu at the right of the left panel's top line (three dots): Settings and the page's other tools, then the account's. */
#whoToggle { width: 40px; }
#whoMenu .whoItem svg { flex: none; margin-right: 10px; color: var(--muted); }
#whoMenu .whoItem:hover svg { color: var(--text); }
#whoMenu .whoRule { height: 1px; background: var(--edge); margin: 4px 6px; }
#whoMenu #settingsBtn, #whoMenu #statsBtn, #whoMenu #skySettingsBtn { width: 100%; height: 36px; border: 0; background: none; color: var(--text); justify-content: flex-start; display: flex; }

/* Accounts or Sightings over the map, in the map's own place (js/panel.js): a bar with the title and a close button, then the page in a frame. */
#panelOverlay { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--bg); }
#panelOverlay .panelBar { display: flex; align-items: center; justify-content: space-between; height: 52px; flex: none; padding: 0 12px 0 20px; background: var(--panel); border-bottom: 1px solid var(--edge); }
#panelOverlay .panelTitle { font-size: 18px; letter-spacing: 0.04em; }
#panelOverlay .panelClose { width: 40px; height: 36px; border: 1px solid var(--edge); border-radius: 10px; background: var(--field); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
#panelOverlay .panelClose:hover { border-color: var(--accent); }
#panelOverlay .panelFrame { flex: 1; width: 100%; border: 0; background: var(--bg); }

/* The menu's two parts: what everyone has, then the admin's own, labeled and set apart (shown to admins only). */
#whoMenu .whoSection { padding: 4px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--accent); }
#whoMenu #whoAdmin { margin: 0 -6px; padding: 0 6px 2px; background: rgba(79, 195, 247, 0.07); }
#whoMenu #whoAdmin .whoRule { margin-top: 0; }

/* "Signed in as Name ›": the menu's top line opens the account settings. */
#whoMenu .whoHead { display: flex; align-items: center; width: 100%; background: none; font: inherit; font-size: 12px; text-align: left; text-decoration: none; cursor: pointer; }
#whoMenu a.whoHead:hover { color: var(--text); background: var(--chosen); }
#whoMenu .whoHead .chev { margin-left: auto; font-size: 18px; line-height: 1; }
#pwDialog h4 { margin: 14px 0 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.acInfo { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; margin: 0; font-size: 14px; }
.acInfo dt { color: var(--muted); } .acInfo dd { margin: 0; }
.pwButtons button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }

#pwDialog { width: 440px; max-height: calc(100% - 32px); overflow-y: auto; }
#pwDialog .devRow { padding: 6px 0; }

#whoMenu .whoHead b { font-size: 14px; }
#whoMenu .whoHead .whoSub { margin-left: 0.4em; }   /* ("Tiger (Account Settings)": the line is a flex row, which drops a plain space) */

/* The menu has words only. */
#whoMenu .whoItem svg { display: none; }

/* Settings and Driving stats as pages, in the map's own place (as Accounts and Sightings are): a bar with the title and a close button, then the page's own controls in a column. */
#settingsPanel, #statsPanel { display: block; padding: 0; background: var(--bg); overflow-y: auto; z-index: 40; }
#settingsPanel .sheet, #statsPanel .sheet { width: auto; max-width: none; background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 0 0 48px; }
#settingsPanel .sheetHead, #statsPanel .sheetHead { position: sticky; top: 0; z-index: 2; height: 52px; padding: 0 12px 0 20px; background: var(--panel); border-bottom: 1px solid var(--edge); margin-bottom: 8px; }
#settingsPanel .sheetHead h2, #statsPanel .sheetHead h2 { font-size: 18px; letter-spacing: 0.04em; }
#settingsPanel .sheetHead button, #statsPanel .sheetHead button { width: 40px; height: 36px; border: 1px solid var(--edge); border-radius: 10px; background: var(--field); color: var(--text); font-size: 24px; line-height: 1; padding: 0; }
#settingsPanel .sheetHead button:hover, #statsPanel .sheetHead button:hover { border-color: var(--accent); }
#settingsPanel .sheet > :not(.sheetHead), #statsPanel .sheet > :not(.sheetHead) { width: min(720px, calc(100% - 40px)); margin-left: auto; margin-right: auto; }
#sharePanelBody { width: min(720px, calc(100% - 40px)); margin: 0 auto; padding: 16px 0 48px; }
#panelOverlay .panelBody { flex: 1; overflow-y: auto; }
.shareTitle { margin: 0 0 10px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
#sharePanelBody .shareRow { padding: 12px 0; border-bottom: 1px solid rgba(86, 104, 122, 0.35); }

/* Every drop down: the browser's own arrow sits hard against the right edge and runs out of the rounded border, so the arrow is drawn here, with room for it (and the text stops short of it). */
select:not([multiple]) {
  appearance: none !important; -webkit-appearance: none !important;
  padding-right: 36px !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1.5 1.5 7 7l5.5-5.5' fill='none' stroke='%23b6c3cf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
  background-repeat: no-repeat !important; background-position: right 13px center !important; background-size: 14px 9px !important;
  text-overflow: ellipsis; cursor: pointer;
}
select:not([multiple]):disabled { cursor: default; opacity: 0.5; }
/* A note under a heading wraps inside its card instead of running out of it. */
.note { overflow-wrap: anywhere; }

/* ---- Settings, tidied: each part (Units, Colors, Map, Notices…) a card in one centered column; a row is its label at the left and its control at the right; a slider's row is the label above and a value beside it. */
#settingsPanel .sheet > .setCard { background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; padding: 6px 18px 8px; margin-top: 14px; }
#settingsPanel .sheet > .setCard[hidden] { display: none; }
#settingsPanel .setCard h3 { margin: 0; padding: 14px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); }
#settingsPanel .setRow { padding: 12px 0; min-height: 52px; border-top: 1px solid rgba(86, 104, 122, 0.35); font-size: 15px; }
#settingsPanel .setCard h3 + .setRow { border-top: 0; }
#settingsPanel .setRow > span { flex: 1; min-width: 0; line-height: 1.3; }
#settingsPanel .setRow b { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
#settingsPanel .setRow.col { align-items: stretch; gap: 10px; }
#settingsPanel .setRow.col > span { flex: none; }
#settingsPanel .setRow input[type=range] { height: 28px; margin: 0; cursor: pointer; }
/* The choices of a row (miles / kilometers…) as one segmented control: equal heights, one border, the chosen one in the light blue. */
#settingsPanel .group { display: inline-flex; flex: none; border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; background: var(--field); }
#settingsPanel .group button { height: 36px; min-width: 64px; padding: 0 14px; border: 0; border-left: 1px solid var(--edge); border-radius: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
#settingsPanel .group button:first-child { border-left: 0; }
#settingsPanel .group button:hover { color: var(--text); }
#settingsPanel .group button.on { background: var(--accent); color: var(--on-accent); }
@media (max-width: 560px) { #settingsPanel .setRow:not(.col) { flex-wrap: wrap; } #settingsPanel .group { max-width: 100%; overflow-x: auto; } }
