:root {
  --bg:        #0d1015;
  --panel:     rgba(16, 20, 27, 0.88);
  --line:      rgba(255, 255, 255, 0.10);
  --text:      #e8ecf1;
  --muted:     rgba(232, 236, 241, 0.62);
  --accent:    #ff9f43;
  --accent-dk: #d9832f;
  --danger:    #e5544b;
  --radius:    12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* `hidden` always wins, even over classes that set display (e.g. .field). */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

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

/* ------------------------------------------------------------------ panel */

#panel {
  position: absolute;
  top: 14px; left: 14px; bottom: 88px;
  width: 322px;
  padding: 18px;
  overflow-y: auto;
  background: var(--panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  transition: transform 0.22s ease, opacity 0.22s ease;
  z-index: 3;
}
body.collapsed #panel { transform: translateX(calc(-100% - 20px)); opacity: 0; pointer-events: none; }

#panel header h1 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
#panel .sub { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }

#panel section { margin-top: 20px; }
#panel h2 {
  margin: 0 0 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted);
}
/* Phone, while the app loads: no menu yet (see the script in index.html). */
html.phone-boot #panel, html.phone-boot #transport, html.phone-boot #panel-toggle { visibility: hidden; }

#panel footer { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }

#controls.disabled { opacity: 0.38; pointer-events: none; }

.note { margin: 6px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.note a { color: var(--muted); }

/* ---------------------------------------------------------------- buttons */

button {
  font: inherit; cursor: pointer;
  border-radius: 9px; border: 1px solid var(--line);
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
button:hover { background: rgba(255, 255, 255, 0.12); }
button:active { transform: translateY(1px); }
button.primary {
  background: var(--accent); border-color: var(--accent); color: #17140f; font-weight: 650;
}
button.primary:hover { background: #ffae5e; }
button.wide { width: 100%; }
/* Keyboard focus: visible on every control, but not on mouse clicks. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="range"]:focus-visible { outline-offset: 6px; }

#panel-toggle {
  position: absolute; top: 14px; left: 14px; z-index: 4;
  width: 38px; height: 38px; padding: 0;
  background: var(--panel); backdrop-filter: blur(18px);
  display: none;
}
body.collapsed #panel-toggle { display: block; }


/* ------------------------------------------------------------- dropzone */

#dropzone { border-radius: 10px; transition: box-shadow 0.15s ease; }
#dropzone.over { box-shadow: 0 0 0 2px var(--accent); }
.route-name {
  margin-top: 10px; padding: 9px 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#dropzone.loaded .route-name { color: var(--text); font-weight: 600; }
.error {
  display: none; margin-top: 8px; padding: 9px 11px;
  border-radius: 8px; font-size: 12.5px;
  background: rgba(229, 84, 75, 0.15);
  border: 1px solid rgba(229, 84, 75, 0.45);
  color: #ffbdb8;
}

/* -------------------------------------------------------------- vehicles */

.vehicles { display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); gap: 8px; }
.vehicle {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 0; padding: 8px 6px; font-weight: 620; font-size: 13px; text-align: center;
}
.vehicle.active { border-color: var(--accent); background: rgba(255, 159, 67, 0.14); }
.vehicle .v-model {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; font-weight: 500; color: var(--muted);
}
.vehicle .v-model:empty { display: none; }
.field.off { opacity: 0.4; }                 /* e.g. Rotation with the Chase camera */

/* The model picker: drops down under the vehicle buttons (placed by app.js);
   on a phone it slides up from the bottom (see the phone section). */
#model-picker {
  position: fixed; z-index: 8;
  padding: 8px; overflow-y: auto;
  background: rgba(22, 27, 36, 0.97);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}
#model-backdrop { position: fixed; inset: 0; z-index: 7; background: rgba(0, 0, 0, 0.45); }
.mp-head { display: none; }
.mp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.mp-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 5px;
  min-width: 0; padding: 5px 5px 7px; border-radius: 10px; text-align: center;
}
.mp-card.on { border-color: var(--accent); background: rgba(255, 159, 67, 0.14); }
.mp-pic {
  display: block; aspect-ratio: 3 / 2; border-radius: 7px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 60%, #c9d0d8, #9ba5b0);
}
.mp-pic:not(.ready):not(.failed) { animation: mp-wait 1.1s ease-in-out infinite alternate; }
@keyframes mp-wait { from { opacity: 0.35; } to { opacity: 0.7; } }
.mp-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mp-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; font-weight: 600;
}

/* ----------------------------------------------------------------- stats */

.stats {
  display: grid; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: 9px; overflow: hidden; margin-bottom: 14px;
}
.stats div {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 11px; background: rgba(20, 25, 33, 0.9);
}
.stats span { color: var(--muted); font-size: 12px; }
.stats b { font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- fields */

.field { display: block; margin-bottom: 12px; }
.field > span {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 5px; font-size: 12px; color: var(--muted);
}
.field > span b { color: var(--text); font-variant-numeric: tabular-nums; }
select {
  width: 100%; font: inherit; font-size: 13px;
  padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
select:disabled { opacity: 0.45; }
.field input[type="text"] {
  width: 100%; font: inherit; font-size: 13px;
  padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.field input[type="text"]:disabled { opacity: 0.45; }
.overlay-toggle { margin: 2px 0 10px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent); border: 2px solid #12151b; cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent); border: 2px solid #12151b; cursor: pointer;
}

/* ------------------------------------------------------------- transport */

#transport {
  position: absolute;
  left: 14px; right: 14px; bottom: 14px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--panel);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  z-index: 3;
}
#transport #play { min-width: 108px; }
#transport #restart { width: 42px; padding: 9px 0; text-align: center; font-size: 16px; }
#scrub { flex: 1; }


/* ------------------------------------------------------------- menu toggle */

.header-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
button.icon {
  width: 28px; height: 28px; padding: 0; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
}
button.icon:disabled { opacity: 0.3; cursor: default; }
#panel-toggle { font-size: 17px; }

/* ------------------------------------------------------------ route source */

.tabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 3px;
  margin-bottom: 12px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
}
.tab { border: 0; background: transparent; padding: 7px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tab.active { background: rgba(255, 255, 255, 0.12); color: var(--text); }
#source-gpx .note { margin-top: 8px; }

/* ----------------------------------------------------------------- planner */

.wps { display: flex; flex-direction: column; gap: 6px; }
.wp { position: relative; display: flex; align-items: center; gap: 7px; }
.wp input {
  flex: 1; min-width: 0; font: inherit; font-size: 12.5px;
  padding: 7px 9px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--text);
  outline: none;
}
.wp input:focus, .wp.active input { border-color: rgba(255, 159, 67, 0.7); }
.wp-tools { display: flex; gap: 3px; }
.wp-tools button.icon { width: 24px; height: 24px; font-size: 11px; }

.dot, .wp-marker {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 11px; font-weight: 700; color: #fff; flex: none;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.dot.start, .wp-marker.start { background: #2ecc71; }
.dot.stop,  .wp-marker.stop  { background: #ff9f43; }
.dot.end,   .wp-marker.end   { background: #e74c3c; }
.wp-marker { width: 26px; height: 26px; font-size: 12.5px; cursor: grab; }
.wp-marker:active { cursor: grabbing; }
/* MapLibre sets the marker's opacity inline (for markers behind terrain), which
   beats a plain rule: hide with visibility, and !important, while a ride plays
   or exports. */
body.playing .wp-marker, body.exporting .wp-marker { visibility: hidden !important; pointer-events: none; }

.results {
  display: none; position: absolute; z-index: 10; left: 27px; right: 0; top: calc(100% + 3px);
  max-height: 220px; overflow-y: auto;
  background: #1a1f28; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.results.open { display: block; }
.result {
  display: block; width: 100%; text-align: left; border: 0; border-radius: 0;
  padding: 8px 10px; font-size: 12px; background: transparent; color: var(--text);
}
.result + .result { border-top: 1px solid var(--line); }
.result:hover, .result.hl { background: rgba(255, 255, 255, 0.08); }
.result.muted { color: var(--muted); cursor: default; }

.add-stop { margin-top: 8px; padding: 7px 10px; font-size: 12.5px; }
.check { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12.5px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }

/* ---------------------------------------------------------------- export */

.ratios { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.ratio {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px; font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums;
}
.ratio small { font-size: 9.5px; font-weight: 500; color: var(--muted); }
.ratio.active { border-color: var(--accent); background: rgba(255, 159, 67, 0.14); }

#export-stage {
  display: none; position: fixed; inset: 0; z-index: 5;
  background: rgba(6, 8, 11, 0.88);
}
body.exporting #export-stage { display: block; }

/* While exporting, the map itself becomes the video frame: JS sets its exact
   size and a visual-only scale so it fits on screen. */
body.exporting #map {
  position: fixed; left: 50%; top: calc(50% - 30px); right: auto; bottom: auto;
  z-index: 6; pointer-events: none;
  transform-origin: center center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}
body.exporting #panel, body.exporting #transport, body.exporting #panel-toggle { visibility: hidden; }
/* map buttons/scale/attribution are page overlays, not in the video: hide them in the preview */
body.exporting #map .maplibregl-control-container { display: none; }

#export-bar {
  display: none; position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 7;
  align-items: center; gap: 14px; width: min(640px, calc(100vw - 32px));
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  font-size: 12.5px; font-variant-numeric: tabular-nums;
}
body.exporting #export-bar { display: flex; }
#export-status { white-space: nowrap; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#export-stop { flex: none; }
.export-progress { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.export-progress i { display: block; height: 100%; width: 0; background: var(--accent); }
#export-time { color: var(--muted); white-space: nowrap; }

/* ---------------------------------------------------------------- mobile */


.maplibregl-ctrl-attrib { font-size: 10.5px; }

/* ================================================================ phone
   phone.js adds body.phone on narrow screens (and phones held sideways).
   Everything below applies only then; the desktop layout above is unchanged. */

/* Phone-only controls never show on desktop, whatever display their other
   classes (.seg, .chips) give them. */
body:not(.phone) .phone-only { display: none !important; }
#play .txt { margin-left: 0.5em; }
.ratio .use { display: none; }

/* Shared by the phone's tabs and choices. */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  padding: 2px; border-radius: 10px; background: rgba(255, 255, 255, 0.07);
}
.seg button {
  height: 34px; padding: 0 6px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px;
}
.seg button.on { background: rgba(255, 255, 255, 0.16); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; height: 40px; padding: 0 14px; border-radius: 20px;
  font-weight: 600; font-size: 13.5px;
}
.chips button.on { border-color: var(--accent); background: rgba(255, 159, 67, 0.18); }

body.phone .phone-only { display: revert; }
body.phone .seg.phone-only { display: grid; }
body.phone .chips.phone-only { display: flex; }
body.phone #transport, body.phone #panel-toggle,
body.phone #panel header, body.phone #route-name, body.phone .shortcuts,
body.phone #camera, body.phone #style, body.phone #source-gpx .note,
body.phone .maplibregl-ctrl-top-right, body.phone .maplibregl-ctrl-bottom-right,
body.phone .maplibregl-ctrl-bottom-left { display: none; }
body.phone { -webkit-text-size-adjust: 100%; }

/* "⤢ Route" — frame the whole route. */
.map-pill {
  position: absolute; z-index: 2; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 10px);
  height: 40px; padding: 0 14px; border-radius: 20px;
  background: var(--panel); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font-weight: 600; font-size: 14px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
body.phone.exporting .map-pill { display: none; }

/* ---- the sheet */
body.phone #panel {
  left: 0; right: 0; top: auto; bottom: 0; width: auto;
  padding: 0; display: flex; flex-direction: column; overflow: hidden;
  border: 0; border-top: 1px solid var(--line); border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
  transform: translateY(var(--y, 0px)); transition: none; opacity: 1;
}
/* Typing: phone.js fits the sheet above the on-screen keyboard. */
body.phone #panel { position: fixed; }
body.phone.typing #sheet-top, body.phone.typing .map-pill { display: none; }
body.phone.typing #panel { bottom: auto; transform: none; transition: none; border-radius: 18px 18px 0 0; }
body.phone.typing .panel-body { margin-bottom: 0; padding-bottom: 50vh; }   /* room to bring any field to the top */
body.phone #panel.sheet-animating { transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.25, 1); }
body.phone .panel-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
  /* The sheet is full height and slid down by --y; end the scrolling area at
     the bottom of the screen, not below it, so every setting can be reached. */
  margin-bottom: var(--y, 0px);
}
body.sheet-collapsed .panel-body { visibility: hidden; }

#sheet-top .grab { padding: 8px 0 4px; display: grid; place-items: center; touch-action: none; cursor: grab; }
#sheet-top .grab i { width: 38px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.28); }
.sheet-head { padding: 2px 16px 10px; touch-action: none; }
.sheet-row { display: flex; align-items: center; gap: 12px; }
.sheet-meta { flex: 1; min-width: 0; }
.sheet-name { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-sub { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.slot-scrub { margin-top: 8px; }
.sheet-tabs { margin: 0 16px 8px; }

body.phone #play {
  width: 48px; height: 48px; min-width: 0; padding: 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px;
}
body.phone #play .txt { display: none; }
body.phone #restart { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 17px; }
body.phone #scrub { width: 100%; }

/* One group of settings per tab. */
body.phone #panel[data-tab="route"]  [data-group]:not([data-group="route"]),
body.phone #panel[data-tab="ride"]   [data-group]:not([data-group="ride"]),
body.phone #panel[data-tab="view"]   [data-group]:not([data-group="view"]),
body.phone #panel[data-tab="export"] [data-group]:not([data-group="export"]),
body.phone #panel[data-tab="route"] #controls { display: none; }
body.phone #panel section { margin-top: 10px; }
body.phone #controls h2 { display: none; }
body.phone #panel footer { margin-top: 16px; padding-top: 10px; }

/* Touch sizes: 44 pt targets, big slider knobs, 16px text inputs (smaller
   makes iOS zoom the page on focus). */
body.phone .field { margin-bottom: 6px; padding: 6px 0; }
body.phone .field > span { font-size: 14px; }
body.phone input[type="range"] { height: 32px; background: transparent; }
/* Settings sliders move only when you drag the knob: a touch on the track
   passes through to the sheet, so it scrolls instead of changing the value. */
body.phone .panel-body input[type="range"] { pointer-events: none; }
body.phone .panel-body input[type="range"]::-webkit-slider-thumb { pointer-events: auto; }
body.phone .panel-body input[type="range"]::-moz-range-thumb { pointer-events: auto; }
body.phone input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); }
body.phone input[type="range"]::-webkit-slider-thumb {
  width: 28px; height: 28px; margin-top: -12px; border: 0; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
body.phone input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border: 0; background: #fff; }
body.phone #scrub::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -7px; background: var(--accent); }
body.phone button.primary.wide { height: 48px; }
body.phone .tab { height: 38px; }
body.phone .vehicle { min-height: 48px; }
body.phone #model-picker {
  left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 78vh;
  border-radius: 18px 18px 0 0; border-bottom: 0;
  padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px));
}
body.phone .mp-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 2px 12px; font-size: 16px;
}
body.phone .mp-head .icon { width: 36px; height: 36px; border-radius: 18px; }
body.phone .mp-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
body.phone .mp-name { white-space: normal; line-height: 1.25; }   /* "Commercial plane" on two lines */
body.phone .ratio { min-height: 48px; }
body.phone .check { min-height: 44px; }
body.phone .check input { width: 22px; height: 22px; }
body.phone .field input[type="text"], body.phone .wp input { font-size: 16px; height: 44px; }
body.phone .wp-tools button.icon { width: 32px; height: 32px; font-size: 13px; }
body.phone .ratio .res { display: none; }
body.phone .ratio .use { display: block; }

/* ---- focus while adjusting: holding a slider shows just that slider, so
   you can watch the map change underneath. */
body.phone #panel.focusing {
  background: transparent; border-color: transparent; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.phone #panel.focusing * { visibility: hidden; }
body.phone #panel.focusing .field.focused,
body.phone #panel.focusing .field.focused * { visibility: visible; }
body.phone #panel.focusing .field.focused {
  position: relative; border-radius: 16px; padding: 8px 14px; margin: 0 -14px;
  background: var(--panel); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* ---- sideways: too short for a bottom sheet, so a panel on the left. */
body.phone-land #panel {
  left: calc(env(safe-area-inset-left, 0px) + 8px); right: auto; top: 8px; bottom: 8px;
  width: 340px; height: auto; transform: none;
  border: 1px solid var(--line); border-radius: 18px;
}
body.phone-land #sheet-top .grab { display: none; }
body.phone-land .panel-body { margin-bottom: 0; }
body.phone-land .sheet-head { padding-top: 12px; }

/* ---- export on a phone */
body.phone #export-bar { width: calc(100vw - 24px); bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); }
