/* EARTH — js/pages/earth.js (prefix .ea-)
   Full-screen 3D view (design v2): satellite + terrain map, one liquid-glass top bar (back · title · 2D/3D),
   a column of glass round tools on the right, and a floating glass bottom card with the route legs/options
   and the fly-through player (or a place card).
   Phones landscape: the card becomes a left column so the map keeps the height it needs.
   iPad / desktop: the card floats bottom-left. The map gets camera padding for whatever is covered. */

.ea-root {
  --ea-gap: var(--sp-3);
  --ea-top-h: 56px;
  --ea-btn: 40px;
  --ea-shade: rgba(16, 14, 40, .3);                     /* map-art shadow: slider thumb, vehicle puck */
  --ea-thumb-shadow: 0 1px 4px var(--ea-shade);
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-2);
  color: var(--ink);
}
@media (pointer: coarse) { .ea-root { --ea-btn: 44px; } }
.ea-map { position: absolute; inset: 0; z-index: 0; }
.ea-ico { flex: 0 0 auto; color: var(--ink-3); }

/* ---------- liquid glass surfaces ---------- */
.ea-top, .ea-g3d-bar, .ea-panel, .ea-fab, .ea-zoom, .ea-g3d-status {
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge), var(--shadow-glass);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ea-top, .ea-g3d-bar, .ea-panel, .ea-fab, .ea-zoom, .ea-g3d-status { background: var(--surface); }
}

/* ---------- glass round buttons ---------- */
.ea-fab {
  position: relative;
  flex: 0 0 auto;
  display: inline-grid; place-items: center;
  width: var(--ea-btn); height: var(--ea-btn); min-width: var(--ea-btn);
  padding: 0; margin: 0;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  transition: transform 120ms var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.ea-fab:hover { color: var(--primary); }
.ea-fab:active { transform: scale(.93); }
.ea-fab:focus-visible { border-radius: 50%; box-shadow: var(--glass-edge), var(--shadow-glass), var(--focus-ring); }
.ea-fab[aria-pressed="true"] { color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 82%, transparent); }
.ea-fab[disabled] { opacity: .45; pointer-events: none; }
.ea-fab svg { width: 20px; height: 20px; }
.ea-fab-badge {
  position: absolute; left: 50%; bottom: -7px;
  transform: translateX(-50%);
  min-width: 26px; padding: 1px 5px;
  white-space: nowrap;
  border-radius: var(--r-pill);
  background: var(--primary); color: var(--ink-inverse);
  box-shadow: 0 0 0 2px var(--surface);
  font-size: 10.5px; font-weight: 700; line-height: 1.35; text-align: center;
}

.ea-fab:has(> .ea-fab-badge) { margin-bottom: 5px; }

/* compass needle (CSS, rotated with the map bearing) */
.ea-needle { position: relative; display: block; width: 12px; height: 26px; transition: transform 120ms linear; }
.ea-needle > i { position: absolute; left: 0; right: 0; height: 50%; }
.ea-needle-n { top: 0; background: var(--danger); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ea-needle-s { bottom: 0; background: var(--ink-4); clip-path: polygon(0 0, 100% 0, 50% 100%); }

/* ---------- top bar: one glass capsule (back · title · 2D/3D) ---------- */
.ea-top, .ea-g3d-bar {
  position: absolute; z-index: 3;
  top: calc(var(--ea-gap) + var(--safe-top));
  left: max(var(--ea-gap), var(--safe-left));
  right: max(var(--ea-gap), var(--safe-right));
  display: flex; align-items: center; gap: var(--sp-2);
  min-width: 0; min-height: var(--ea-top-h);
  padding: 6px;
  border-radius: var(--r-pill);
}
/* the back / close button sits inside the bar: no second layer of glass */
.ea-top .ea-fab, .ea-g3d-bar .ea-fab {
  border-color: transparent; box-shadow: none;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.ea-top .ea-fab:focus-visible, .ea-g3d-bar .ea-fab:focus-visible { box-shadow: var(--focus-ring); }
.ea-title {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 10px;
}
.ea-title .ico-tile { width: 34px; height: 34px; border-radius: 11px; }
.ea-title-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ea-title h1, .ea-title h2 {
  font-family: var(--font-display); font-size: var(--fs-md); font-weight: 700; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  overflow-wrap: normal;
}
.ea-sub { font-size: var(--fs-xs); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }

/* 2D / 3D: iOS segmented control on glass */
.ea-dim {
  flex: 0 0 auto;
  display: flex; gap: 2px; padding: 3px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.ea-dim button {
  min-width: 42px; min-height: 36px; padding: 0 10px;
  border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--ink-2);
  font-family: var(--font-num); font-weight: 700; font-size: var(--fs-sm);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.ea-dim button[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-1); }
.ea-dim button:focus-visible { border-radius: var(--r-pill); }
@media (pointer: coarse) {
  .ea-dim button { min-height: 44px; min-width: 44px; }
}

/* ---------- right tool column ---------- */
.ea-side {
  position: absolute; z-index: 2;
  top: calc(var(--ea-gap) * 2 + var(--safe-top) + var(--ea-top-h));
  right: max(var(--ea-gap), var(--safe-right));
  display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-2);
  max-height: calc(100% - var(--ea-top-h) - 3 * var(--ea-gap) - var(--safe-top));
}
.ea-zoom { display: flex; flex-direction: column; border-radius: var(--r-pill); overflow: hidden; }
.ea-zoom .ea-fab {
  width: calc(var(--ea-btn) - 2px); min-width: 0;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.ea-zoom .ea-fab:active { transform: none; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.ea-zoom .ea-fab:focus-visible { border-radius: var(--r-pill); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent); }
.ea-zoom .ea-fab + .ea-fab::before { content: ""; position: absolute; top: 0; left: 9px; right: 9px; height: 1px; background: var(--line-strong); }
@media (pointer: coarse) { .ea-zoom { display: none; } }

/* ---------- floating glass bottom card ---------- */
.ea-panel {
  position: absolute; z-index: 4;
  left: max(var(--ea-gap), var(--safe-left));
  right: max(var(--ea-gap), var(--safe-right));
  bottom: calc(var(--ea-gap) + var(--safe-bottom));
  max-height: min(60%, 520px);
  display: flex; flex-direction: column;
  min-width: 0;
  border-radius: var(--r-xl);
  overflow: hidden;
}
@media (max-height: 700px) { .ea-panel { max-height: 54%; } }
.ea-grab { display: none; }
.ea-panel-in {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4) var(--sp-4);
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.ea-panel-in:empty { display: none; }
/* with a pinned footer the scrolling part needs less bottom room */
.ea-panel:has(.ea-panel-foot:not([hidden])) .ea-panel-in { padding-bottom: var(--sp-3); }
.ea-panel-foot {
  flex: 0 0 auto;
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  border-top: 1px solid var(--line);
  container: eafoot / inline-size;
}
.ea-root.is-playing .ea-panel-foot { border-top: 0; }
.ea-root.is-playing .ea-panel-in { padding: var(--sp-3) var(--sp-4) 0; }
.ea-root.is-playing .ea-panel-in:not(:has(.ea-status:not(:empty))) { display: none; }

/* leg chips (base .chip) */
.ea-legs {
  display: flex; gap: var(--sp-2);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--sp-4)); padding: 2px var(--sp-4);
  scroll-padding-inline: var(--sp-4);
  min-width: 0; flex: 0 0 auto;
}
.ea-legs::-webkit-scrollbar { display: none; }
.chip.ea-leg { max-width: 230px; gap: 6px; }
.ea-leg-no { flex: 0 0 auto; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); }
.ea-leg[aria-pressed="true"] .ea-leg-no { color: inherit; opacity: .75; }
.ea-leg-ico { display: inline-grid; place-items: center; flex: 0 0 auto; color: var(--leg, var(--ink-2)); }
.ea-leg-ico svg { width: 15px; height: 15px; }
.ea-leg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* route option cards (solid white, like the planner's route cards) */
.ea-opts {
  display: flex; gap: var(--sp-2);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--sp-4)); padding: 2px var(--sp-4) 6px;
  scroll-padding-inline: var(--sp-4);
  min-width: 0; flex: 0 0 auto;
}
.ea-opts::-webkit-scrollbar { display: none; }
.ea-opt {
  position: relative;
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  width: clamp(156px, 44vw, 204px);
  min-height: 44px;
  margin: 0; padding: 12px 12px 12px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 100ms var(--ease);
}
.ea-opt:active { transform: scale(.98); }
.ea-opt:focus-visible { border-radius: var(--r-md); box-shadow: var(--focus-ring), var(--shadow-1); }
.ea-opt:hover { border-color: var(--line-strong); }
.ea-opt[aria-checked="true"] {
  border-color: transparent;
  background: color-mix(in srgb, var(--primary-soft) 58%, var(--surface));
  box-shadow: inset 0 0 0 1.5px var(--primary), var(--shadow-1);
}
.ea-opt[aria-checked="true"]:focus-visible { box-shadow: inset 0 0 0 1.5px var(--primary), var(--focus-ring); }
/* accent strip in the line's colour on the map (like the planner's route cards) */
.ea-opt-strip {
  position: absolute; left: 10px; top: 12px; bottom: 12px;
  width: 4px; border-radius: 4px;
  background: var(--ea-line, var(--route-alt));
}
.ea-opt.is-est .ea-opt-strip { background: repeating-linear-gradient(180deg, var(--ea-line, var(--route-alt)) 0 6px, transparent 6px 10px); }
.ea-opt-top { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.ea-opt-ico { display: inline-grid; place-items: center; flex: 0 0 auto; margin-top: 1px; color: var(--ink-2); }
.ea-opt[aria-checked="true"] .ea-opt-ico { color: var(--primary); }
.ea-opt-ico svg { width: 16px; height: 16px; }
.ea-opt-label {
  flex: 1 1 auto; min-width: 0;
  font-weight: 700; font-size: var(--fs-sm); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.ea-opt-radio {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: transparent;
}
.ea-opt[aria-checked="true"] .ea-opt-radio { background: var(--primary); border-color: var(--primary); color: var(--ink-inverse); }
.ea-opt-radio svg { width: 11px; height: 11px; }
.ea-opt-dur {
  font-family: var(--font-num); font-weight: 700; font-size: var(--fs-lg); line-height: 1.3;
  letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
.ea-opt[aria-checked="true"] .ea-opt-dur { color: var(--primary); }
.ea-opt-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.ea-opt-dist { font-size: var(--fs-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ea-opt .badge { flex: 0 0 auto; }

/* whole-trip / single-leg summary */
.ea-summary { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ea-sum-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.ea-sum-dur { font-family: var(--font-num); font-weight: 700; font-size: var(--fs-xl); line-height: 1.25; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ea-sum-meta { font-size: var(--fs-sm); color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.ea-sum-note { font-size: var(--fs-xs); color: var(--ink-3); }

/* "use this route" row */
.ea-use {
  display: flex; align-items: center; gap: var(--sp-2) var(--sp-3);
  min-width: 0; flex-wrap: wrap;
  padding: 10px 10px 10px 14px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--primary-soft) 70%, transparent);
}
.ea-use[hidden] { display: none; }
.ea-use.is-ok { background: color-mix(in srgb, var(--mint-soft) 75%, transparent); padding: 8px 12px; }
.ea-use-text { flex: 1 1 160px; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.ea-use-text b { color: var(--ink); font-weight: 700; }
.ea-use.is-ok .ea-ico { color: var(--mint); }
.ea-use .btn { flex: 0 0 auto; }

.ea-status {
  display: flex; align-items: center; gap: var(--sp-2);
  min-width: 0;
  font-size: var(--fs-xs); color: var(--ink-2);
  overflow-wrap: anywhere;
}
.ea-status .spinner { width: 16px; height: 16px; border-width: 2px; }
.ea-status a { font-weight: 700; white-space: nowrap; }
.ea-status:empty { display: none; }

/* Google 3D: a soft button, only when a Google key is set (no hint at all without one) */
.ea-g3d-btn.btn { align-self: flex-start; max-width: 100%; }
.ea-alert { align-items: center; }
.ea-alert > svg { color: var(--warn); }

/* ---------- player ---------- */
.ea-player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "play scrub" "ctrls ctrls";
  align-items: center;
  gap: var(--sp-3) var(--sp-3);
  min-width: 0;
}
@container eafoot (min-width: 520px) {
  .ea-player { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "play scrub ctrls"; }
  .ea-ctrl-label { display: none; }
}
.ea-play {
  grid-area: play;
  display: grid; place-items: center;
  width: 52px; height: 52px;
  margin: 0; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--grad-brand); color: var(--ink-inverse);
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  transition: transform 120ms var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur);
}
.ea-play svg { width: 22px; height: 22px; }
.ea-play:not(.is-playing) svg { transform: translateX(1px); } /* optical centre of the triangle */
.ea-play:active { transform: scale(.94); }
.ea-play:focus-visible { border-radius: 50%; box-shadow: var(--shadow-btn), var(--focus-ring); }
.ea-play[disabled] { opacity: .4; box-shadow: none; }
.ea-scrub { grid-area: scrub; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ea-ctrls { grid-area: ctrls; display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.ea-ctrl-label { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); flex: 0 0 auto; }
.segmented.ea-speed { flex: 0 0 auto; padding: 3px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--ink) 7%, transparent); overflow: visible; }
.segmented.ea-speed button { min-height: 32px; min-width: 42px; padding: 4px 10px; border-radius: var(--r-pill); font-family: var(--font-num); }
.segmented.ea-speed button[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-1); }
.ea-restart.btn { margin-left: auto; color: var(--ink-2); }
@media (pointer: coarse) { .segmented.ea-speed button { min-height: 44px; min-width: 44px; } }

/* scrubber: thin track, violet → blue fill, white iOS thumb */
.ea-range {
  --ea-p: 0%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
.ea-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--primary), var(--blue)) 0 0 / var(--ea-p) 100% no-repeat, color-mix(in srgb, var(--ink) 12%, transparent);
}
.ea-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-top: -7px;
  border: 0; border-radius: 50%;
  background: var(--ink-inverse);
  box-shadow: var(--ea-thumb-shadow), 0 0 0 .5px var(--line-strong);
}
.ea-range::-moz-range-track { height: 6px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--ink) 12%, transparent); }
.ea-range::-moz-range-progress { height: 6px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--primary), var(--blue)); }
.ea-range::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--ink-inverse); box-shadow: var(--ea-thumb-shadow); }
.ea-range:focus-visible { outline: none; box-shadow: none; }
.ea-range:focus-visible::-webkit-slider-thumb { box-shadow: var(--ea-thumb-shadow), var(--focus-ring); }
.ea-range:focus-visible::-moz-range-thumb { box-shadow: var(--ea-thumb-shadow), var(--focus-ring); }
.ea-range:disabled { cursor: default; }
@media (pointer: coarse) { .ea-range { height: 36px; } }
.ea-read {
  display: flex; align-items: baseline; gap: var(--sp-2);
  min-width: 0;
  font-size: var(--fs-xs); color: var(--ink-2);
}
.ea-road { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 5px; font-weight: 700; color: var(--ink); }
.ea-road > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ea-road .ea-ico { color: var(--primary); }
.ea-km { flex: 0 0 auto; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* place card */
.ea-place-head { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.ea-place-head h2 { font-size: var(--fs-lg); overflow-wrap: anywhere; }
.ea-place-head .li-body { min-width: 0; flex: 1 1 auto; }
.ea-coords { font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ea-acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); min-width: 0; }
.ea-acts .btn { flex: 1 1 auto; min-width: 0; }
.ea-acts .btn[aria-pressed="true"] { background: var(--primary); color: var(--ink-inverse); }

.ea-empty { padding: var(--sp-3) var(--sp-2); gap: var(--sp-2); }
.ea-empty .row { justify-content: center; }
.ea-inline-ico { display: inline-flex; vertical-align: -3px; }
.ea-inline-ico .ea-ico { color: var(--primary); }

/* while the tour plays only the player stays — the map gets the room */
.ea-root.is-playing .ea-legs,
.ea-root.is-playing [data-slot="opts"],
.ea-root.is-playing .ea-use,
.ea-root.is-playing [data-slot="gnote"] { display: none; }

/* ---------- vehicle puck ---------- */
.ea-puck { width: 40px; height: 40px; pointer-events: none; }
.ea-puck-in {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary), 0 4px 14px var(--ea-shade);
}
.ea-puck-in svg { width: 20px; height: 20px; }
.ea-puck-in::after {
  content: ""; position: absolute; inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: .5;
  animation: ea-ping 1.8s var(--ease) infinite;
}

/* ---------- Google Photorealistic 3D overlay ---------- */
.ea-g3d { position: absolute; inset: 0; z-index: 6; background: var(--bg-2); }
.ea-g3d-canvas { position: absolute; inset: 0; }
.ea-g3d-canvas .cesium-widget, .ea-g3d-canvas .cesium-viewer { width: 100%; height: 100%; }
.ea-g3d-canvas .cesium-widget-credits { font-size: 10px; max-width: calc(100% - 16px); overflow-wrap: anywhere; }
.ea-g3d-bar { z-index: 2; }
.ea-g3d-status {
  position: absolute; z-index: 2;
  left: 50%; bottom: calc(var(--sp-6) + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--sp-2);
  max-width: calc(100% - 2 * var(--sp-4));
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 700;
  overflow-wrap: anywhere;
}
.ea-g3d-status:empty { display: none; }
.ea-g3d-status .spinner { width: 18px; height: 18px; border-width: 2px; }

/* ---------- phones in landscape: card becomes a left column ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  .ea-root { --ea-gap: var(--sp-2); --ea-top-h: 52px; }
  .ea-top { padding: 4px; }
  .ea-panel {
    top: calc(var(--ea-gap) * 2 + var(--safe-top) + var(--ea-top-h));
    right: auto; bottom: var(--ea-gap);
    width: min(340px, 48vw);
    max-height: none;
    border-radius: var(--r-lg);
  }
  .ea-panel-in { padding: var(--sp-3); gap: var(--sp-2); }
  .ea-panel-foot { padding: var(--sp-2) var(--sp-3) var(--sp-3); }
  .ea-legs, .ea-opts { margin-inline: calc(-1 * var(--sp-3)); padding-inline: var(--sp-3); scroll-padding-inline: var(--sp-3); }
  .ea-opt { width: clamp(140px, 20vw, 172px); padding: 10px 10px 10px 20px; }
  .ea-opt-strip { left: 9px; top: 10px; bottom: 10px; }
  .ea-root.is-playing .ea-panel { top: auto; }
  .ea-play { width: 46px; height: 46px; }
  .ea-side { gap: 6px; }
  .ea-top { right: auto; width: min(560px, calc(100% - 2 * var(--ea-gap) - var(--ea-btn) - var(--ea-gap))); }
}

/* ---------- tablets / desktop: floating card bottom-left ---------- */
@media (min-width: 700px) and (min-height: 521px) {
  .ea-root { --ea-gap: var(--sp-4); }
  .ea-panel {
    right: auto;
    width: min(440px, calc(100% - 2 * var(--ea-gap) - 60px));
    max-height: min(58%, 560px);
  }
  .ea-top, .ea-g3d-bar { right: auto; width: min(560px, calc(100% - 2 * var(--ea-gap))); }
  .ea-title h1 { font-size: var(--fs-lg); }
  .ea-opt { width: 188px; }
}

@keyframes ea-ping { 0% { transform: scale(.9); opacity: .55; } 80%, 100% { transform: scale(1.45); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ea-puck-in::after { animation: none; }
}
