:root {
  --paper: hsl(var(--background));
  --ink: hsl(var(--foreground));
  --muted-ink: hsl(var(--muted-foreground));
  --lime: hsl(var(--primary));
  --line: hsl(var(--border));
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, system-ui, sans-serif;
  letter-spacing: -0.025em;
}
button,
input,
a {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #607c12;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.shell {
  max-width: 720px;
  margin: auto;
  padding: 0 28px;
}
.masthead {
  height: 98px;
  display: flex;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}
.brand {
  text-decoration: none;
  color: var(--ink);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -3px;
}
.brand span {
  color: #778d2c;
  font-size: 25px;
  margin-left: 4px;
  vertical-align: top;
}
.edition {
  font-size: 12px;
  font-weight: 600;
  flex: 1;
}
.edition span {
  display: block;
  color: var(--muted-ink);
  font-size: 8px;
  letter-spacing: 1.5px;
  margin-top: 5px;
}
.small-button {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: transparent;
  padding: 10px 17px;
  font-size: 12px;
}
.intro {
  padding: 40px 0 32px;
  position: relative;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.6px;
  font-weight: 700;
  color: #6c7660;
}
h1 {
  font-size: 48px;
  line-height: 1.22;
  letter-spacing: -2.5px;
  margin: 15px 0;
}
h2 {
  letter-spacing: -1px;
}
.intro p {
  position: absolute;
  right: 0;
  bottom: 33px;
  line-height: 1.9;
  font-size: 13px;
  color: var(--muted-ink);
}
.session {
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.session-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px;
  font-size: 12px;
}
.status {
  display: flex;
  align-items: center;
  gap: 7px;
}
.status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a7ab9e;
}
.status i.connected {
  background: #65a039;
  box-shadow: 0 0 0 4px #eff6e9;
}
.timer {
  color: var(--muted-ink);
  font-size: 12px;
}
.camera-stage {
  aspect-ratio: 4/3;
  background: #252b24;
  position: relative;
  overflow: hidden;
}
.camera-stage > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.camera-stage > video.mirrored {
  transform: scaleX(-1);
}
/* Digital zoom (--cam-zoom set by app.js). The clip-path is in the element's own space, so
   insetting by (1 - 1/zoom)/2 and then scaling by zoom lands exactly on the original frame box. */
.camera-stage > #local-video {
  transform: scale(var(--cam-zoom, 1));
  clip-path: inset(calc((1 - 1 / var(--cam-zoom, 1)) * 50%));
}
.camera-stage > #local-video.mirrored {
  transform: scale(calc(var(--cam-zoom, 1) * -1), var(--cam-zoom, 1));
}
/* "This one" tap (guide-ping.js): same colours as map markings — mine blue, the peer's orange. */
.guide-ping {
  --ping: #1d4ed8;
  position: absolute;
  z-index: 6;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  border: 3px solid var(--ping);
  box-shadow: 0 0 0 3px #fff, inset 0 0 0 3px #fff;
  pointer-events: none;
  animation: guide-ping 1.2s ease-out 2;
}
.guide-ping[data-who="peer"] {
  --ping: #ea580c;
}
.guide-ping::after {
  content: "";
  position: absolute;
  inset: 21px;
  border-radius: 50%;
  background: var(--ping);
  box-shadow: 0 0 0 2px #fff;
}
@keyframes guide-ping {
  from { transform: scale(0.4); opacity: 1; }
  70% { transform: scale(1); opacity: 1; }
  to { transform: scale(1.15); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .guide-ping { animation: none; }
}
/* As the small inset (peer is the main picture) the local video is not zoomable. */
.camera-stage[data-video-main="peer"] {
  --cam-zoom: 1 !important;
}
.session-active .camera-stage {
  touch-action: none; /* two-finger pinch must reach the page, not scroll or zoom it */
}
.camera-zoom-reset {
  position: absolute;
  bottom: 10px; /* the top edge carries the place-title and brand chips */
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  min-width: 52px;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid #ffffff55;
  border-radius: 999px;
  background: rgba(14, 22, 48, 0.66);
  color: white;
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.camera-wide {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 8;
  min-width: 52px;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid #ffffff55;
  border-radius: 999px;
  background: rgba(14, 22, 48, 0.66);
  color: white;
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.camera-wide[aria-pressed="true"] {
  background: #fff;
  color: #0e1630;
}
.camera-wide[hidden],
.camera-stage[data-video-main="peer"] .camera-wide {
  display: none;
}
.camera-zoom-reset[hidden],
.camera-stage[data-video-main="peer"] .camera-zoom-reset {
  display: none;
}
.camera-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  background: radial-gradient(ellipse at 65% 30%, #414a35, #252b24 65%);
  color: var(--paper);
}
.camera-symbol {
  font-size: 26px;
  color: var(--lime);
  border: 1px solid #67704d;
  border-radius: 50%;
  height: 56px;
  width: 56px;
  display: grid;
  place-items: center;
}
.camera-empty h2 {
  font-size: 26px;
  line-height: 1.4;
  font-weight: 500;
  margin: 18px 0 8px;
}
.camera-empty p {
  font-size: 12px;
  line-height: 1.8;
  color: #b6bdab;
  margin-bottom: 22px;
}
.primary {
  background: var(--lime);
  color: var(--ink);
  border: 0;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.video-top {
  position: absolute;
  top: 17px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  color: white;
  font-size: 12px;
  text-shadow: 0 1px 8px black;
}
.video-top span {
  background: #252b2470;
  padding: 7px 10px;
  border-radius: 20px;
}
.remote-wrap {
  position: absolute;
  width: 27%;
  aspect-ratio: 3/4;
  right: 16px;
  top: 55px;
  border: 2px solid #ffffffae;
  border-radius: 12px;
  overflow: hidden;
  background: #252b24;
}
.remote-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.remote-wrap > span {
  position: absolute;
  bottom: 7px;
  left: 7px;
  color: white;
  font-size: 8px;
  text-shadow: 0 1px 5px black;
}
.remote-wrap button {
  position: absolute;
  inset: auto 5px 20px;
  border: 0;
  padding: 8px;
  font-size: 12px;
}
.camera-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 9px;
}
.camera-controls button {
  background: #232822b5;
  color: white;
  border: 1px solid #ffffff25;
  border-radius: 14px;
  padding: 9px 15px;
  min-width: 62px;
  font-size: 23px;
  backdrop-filter: blur(10px);
}
.camera-controls span {
  display: block;
  font-size: 8px;
  margin-top: 3px;
}
.notice {
  padding: 13px 20px;
  color: #795129;
  background: #fff6e8;
  font-size: 12px;
  line-height: 1.6;
}
.network-note {
  padding: 10px 20px;
  background: #f7f8ef;
  color: #687248;
  font-size: 12px;
  line-height: 1.6;
}
.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 20px 0;
}
.map-header h2 {
  font-size: 20px;
  margin: 5px 0;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  cursor: pointer;
}
.toggle input {
  position: absolute;
  opacity: 0;
}
.toggle-track {
  height: 22px;
  width: 38px;
  border-radius: 20px;
  background: #dbded3;
  position: relative;
}
.toggle-track:before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 3px;
  left: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-track {
  background: #90ab3f;
}
.toggle input:checked + .toggle-track:before {
  transform: translateX(16px);
}
.toggle input:focus-visible + .toggle-track {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
  box-shadow: 0 0 0 5px hsl(var(--card));
}
.consent {
  font-size: 9px;
  line-height: 1.7;
  color: var(--muted-ink);
  padding: 0 20px;
  margin: 7px 0 15px;
}
.map-stage {
  height: 245px;
  position: relative;
  background: #edf0e7;
  margin: 0 20px;
  border-radius: 12px;
  overflow: hidden;
}
#map {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.map-tools {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.map-tools button[hidden] {
  display: none;
}
.map-tools button svg {
  display: block;
  margin: auto;
}
.map-tools button {
  width: 31px;
  height: 31px;
  background: white;
  border: 1px solid #dee1d7;
  border-radius: 7px;
  font-size: 19px;
}
.attribution {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #ffffffdf;
  padding: 3px 5px;
  color: #42503a;
  font-size: 8px;
  letter-spacing: 0;
}
.map-message {
  position: absolute;
  left: 12px;
  bottom: 23px;
  right: 48px;
  pointer-events: none;
  background: #ffffffed;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: #687248;
}
.coordinates {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 11px 20px 22px;
  font-size: 9px;
  color: #7f8478;
}
.coordinates > span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.coordinates strong {
  font-size: 9px;
  font-weight: 500;
  color: #3d4635;
}
.marker {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.marker.local {
  background: #1D4ED8;
}
.marker.peer {
  background: #6D28D9;
}
.card-action {
  padding: 20px;
  border-top: 1px solid var(--line);
  background: #fafbf5;
}
.card-action > label {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-action label span {
  color: #878e7b;
  font-size: 9px;
  font-weight: 400;
}
.card-action input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #d4d9c8;
  background: transparent;
  font-size: 15px;
  padding: 12px 0;
  margin-bottom: 18px;
  color: var(--ink);
  border-radius: 0;
}
.capture {
  width: 100%;
  border: 0;
  background: var(--lime);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 13px;
  font-size: 14px;
  font-weight: 700;
}
.capture-icon {
  font-size: 29px;
}
.capture > span:last-child {
  margin-left: auto;
  font-size: 23px;
}
.card-action > p {
  font-size: 9px;
  color: var(--muted-ink);
  text-align: center;
  margin: 10px 0 0;
}
footer {
  display: flex;
  justify-content: space-between;
  color: #8a907f;
  padding: 28px 0 35px;
  font-size: 9px;
}
footer > span:first-child {
  letter-spacing: 1.3px;
  font-size: 8px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 22px;
  max-width: 440px;
  width: calc(100% - 30px);
  padding: 24px;
  color: var(--ink);
  background: var(--paper);
  max-height: 92dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #17201899;
  backdrop-filter: blur(5px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-head button {
  border: 0;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  font-size: 25px;
  padding: 0 5px;
}
dialog h2 {
  font-size: 24px;
  margin: 12px 0;
}
dialog p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted-ink);
}
#qr {
  display: block;
  margin: 23px auto;
  border-radius: 12px;
}
#invite-url {
  width: 100%;
  font-size: 12px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}
.dialog-actions > * {
  flex: 1;
}
.secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  padding: 13px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.fine {
  font-size: 9px !important;
  text-align: center;
}
.busy {
  opacity: 0.6;
  pointer-events: none;
}
@media (max-width: 520px) {
  .shell {
    padding: 0 18px;
  }
  .masthead {
    height: 79px;
    gap: 18px;
  }
  .brand {
    font-size: 35px;
  }
  .edition {
    font-size: 12px;
  }
  .intro {
    padding: 28px 0 22px;
  }
  h1 {
    font-size: 38px;
    margin: 12px 0;
  }
  .intro p {
    position: static;
    margin: 12px 0 0;
    font-size: 12px;
  }
  .eyebrow {
    font-size: 8px;
  }
  .session-heading {
    padding: 14px;
    font-size: 12px;
  }
  .timer {
    font-size: 9px;
  }
  .camera-stage {
    aspect-ratio: 1/1.02;
  }
  .camera-empty h2 {
    font-size: 24px;
  }
  .camera-empty p {
    font-size: 12px;
  }
  .map-header {
    padding: 19px 15px 0;
  }
  .consent {
    padding: 0 15px;
  }
  .map-stage {
    margin: 0 15px;
    height: 215px;
  }
  .coordinates {
    margin: 11px 15px 19px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .card-action {
    padding: 17px 15px;
  }
  .session {
    border-radius: 17px;
  }
  footer {
    font-size: 8px;
    gap: 12px;
  }
  .camera-controls button {
    padding: 8px 13px;
  }
  .remote-wrap {
    width: 29%;
    top: 53px;
    right: 12px;
  }
}

.text-button {
  border: 0;
  background: transparent;
  color: #d4dcc5;
  font-size: 12px;
  text-decoration: underline;
  padding: 10px;
}
.camera-empty input {
  background: #ffffff10;
  border: 1px solid #ffffff30;
  border-radius: 8px;
  color: white;
  padding: 9px 12px;
  max-width: 210px;
  font-size: 12px;
  margin-bottom: 10px;
}
.camera-empty input::placeholder {
  color: #b6bdab;
}
.full-button {
  width: 100%;
  margin-top: 12px;
}
.waiting-panel {
  display: flex;
  gap: 8px;
  padding: 12px 15px;
  align-items: center;
  background: #f1f5e7;
  font-size: 12px;
}
.waiting-panel > span {
  flex: 1;
}
.waiting-panel .small-button {
  padding: 7px 9px;
  font-size: 12px;
}
.ended-panel {
  padding: 22px;
  text-align: center;
}
.ended-panel h2 {
  font-size: 20px;
}
.ended-panel p {
  font-size: 12px;
  color: var(--muted-ink);
}
.ended-panel a {
  text-decoration: none;
}
.camera-stage.audio-only > video {
  visibility: hidden;
}
.camera-stage.audio-only:after {
  content: "음성으로 함께하는 중";
  position: absolute;
  top: 40%;
  left: 0;
  width: 100%;
  text-align: center;
  color: hsl(var(--primary));
  font-size: 20px;
  pointer-events: none;
}

/* Keep the live camera and map in one mobile view after explicit participation. */
.session-active .intro {
  display: none;
}
.session-active .session {
  margin-top: 16px;
}
@media (max-width: 520px) {
  .session-active .masthead {
    height: 60px;
  }
  .session-active .session {
    margin-top: 10px;
  }
  .session-active .camera-stage {
    aspect-ratio: 4 / 3;
  }
  .session-active .camera-controls {
    bottom: 10px;
    gap: 6px;
  }
  .session-active .camera-controls button {
    padding: 6px 10px;
    min-width: 55px;
    font-size: 19px;
  }
  .session-active .map-header {
    padding-top: 15px;
  }
  .session-active .camera-empty .camera-symbol {
    display: none;
  }
  .session-active .camera-empty h2 {
    font-size: 20px;
    margin: 8px 0;
  }
  .session-active .camera-empty p {
    margin: 0 12px 12px;
  }
}

/* Live viewport layout changes only the presentation, never the media tracks. */
.splitter,
.live-controls,
.compact-consent {
  display: none;
}
#session-details-content .card-action {
  border: 0;
  padding: 8px 0;
  background: transparent;
}
#session-details-content .coordinates {
  margin: 18px 0;
  flex-wrap: wrap;
}
#session-details-content .consent {
  padding: 0;
  font-size: 12px;
}
#session-details-content .network-note {
  padding: 10px 0;
  background: transparent;
  font-size: 12px;
}

body.split-active {
  height: 100dvh;
  height: var(--app-height, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
}
.split-active .shell {
  height: 100%;
  max-width: none;
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right))
    env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.split-active .masthead {
  height: 54px;
  min-height: 54px;
  border: 0;
  padding: 0 8px;
}
.split-active .brand {
  font-size: 31px;
}
.split-active .edition {
  font-size: 12px;
}
.split-active .intro,
.split-active .shell > footer {
  display: none;
}
.split-active .session {
  flex: 1;
  min-height: 0;
  margin: 0;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.split-active .session-heading {
  padding: 10px 12px;
  flex: none;
  min-height: 35px;
  order: 0;
  font-size: 12px;
}
.split-active #waiting-panel {
  order: 1;
  flex: none;
  padding: 5px 10px;
  font-size: 9px;
  min-height: 29px;
}
.split-active #waiting-panel .small-button {
  padding: 4px 8px;
  font-size: 9px;
}
.split-active #notice {
  order: 2;
  flex: none;
  font-size: 9px;
  line-height: 1.4;
  padding: 5px 10px;
  max-height: 36px;
  overflow: auto;
}
.split-active .live-workspace {
  order: 3;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.split-active .camera-stage {
  height: var(--camera-size, 45%);
  flex: 0 0 var(--camera-size, 45%);
  min-height: 0;
  aspect-ratio: auto;
}
.split-active .remote-wrap {
  height: min(62%, 140px);
  max-height: calc(100% - 48px);
  width: auto;
  aspect-ratio: 3/4;
  top: 40px;
  right: 10px;
}
.split-active .video-top {
  top: 9px;
  left: 12px;
  right: 12px;
}
.split-active .splitter {
  display: flex;
  flex: none;
  height: 30px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: row-resize;
  touch-action: none;
  user-select: none;
  background: #f5f6ed;
  border-block: 1px solid #dce2cd;
  color: #7b856b;
}
.splitter > span {
  width: 34px;
  height: 4px;
  border-radius: 6px;
  background: #9eab88;
}
.splitter small {
  font-size: 8px;
}
.splitter.dragging,
.splitter:focus-visible {
  background: #e5efc7;
}
.splitter:focus-visible {
  outline: 2px solid #71883a;
  outline-offset: -2px;
}
.split-active .map-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: white;
}
.split-active .map-header {
  flex: none;
  min-height: 37px;
  padding: 5px 12px;
  align-items: center;
}
.split-active .map-header .eyebrow {
  display: none;
}
.split-active .map-header h2 {
  font-size: 14px;
  margin: 0;
}
.split-active .map-stage {
  flex: 1;
  min-height: 0;
  height: auto;
  margin: 0 8px;
  border-radius: 8px;
}
.split-active .compact-consent {
  display: block;
  flex: none;
  margin: 0;
  padding: 4px 12px;
  font-size: 8px;
  line-height: 1.4;
  color: #757e67;
}
.split-active .attribution {
  font-size: 8px;
}
.split-active .map-tools {
  flex-direction: row;
}
.split-active .map-message {
  font-size: 9px;
  padding: 5px;
}
.split-active .live-controls {
  order: 4;
  display: flex;
  flex: none;
  gap: 6px;
  align-items: center;
  min-height: 66px;
  padding: 7px 9px;
  background: hsl(var(--card));
  border-top: 1px solid hsl(var(--border));
}
.split-active #camera-controls {
  position: static;
  transform: none;
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.split-active #camera-controls button {
  flex: 1;
  min-width: 0;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 0;
  padding: 6px 3px;
  border-radius: 10px;
  font-size: 20px;
}
.split-active #camera-controls span {
  font-size: 8px;
  white-space: nowrap;
}
.split-active #leave {
  background: hsl(var(--destructive)) !important;
  color: hsl(var(--destructive-foreground)) !important;
}
.split-active #capture {
  width: 49px;
  height: 49px;
  flex: none;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  gap: 0;
}
.split-active #capture > span:not(:first-child) {
  display: none;
}
.split-active #capture .capture-icon {
  font-size: 31px;
}
.split-active .details-button {
  flex: none;
  width: 36px;
  height: 44px;
  font-size: 12px;
  border: 0;
  background: transparent;
  color: hsl(var(--foreground));
  padding: 0;
}
.split-active .camera-empty .camera-symbol {
  display: none;
}
.split-active .camera-empty h2 {
  font-size: 16px;
  margin: 5px;
}
.split-active .camera-empty p {
  font-size: 9px;
  margin: 3px 10px 8px;
  line-height: 1.5;
}
.split-active .camera-empty .primary {
  padding: 9px 14px;
  font-size: 12px;
}
.split-active .camera-empty .text-button {
  padding: 6px;
  font-size: 9px;
}
@media (max-height: 500px) {
  .split-active .masthead {
    height: 36px;
    min-height: 36px;
  }
  .split-active .brand {
    font-size: 25px;
  }
  .split-active .edition span {
    display: none;
  }
  .split-active .session-heading {
    padding: 6px 10px;
    min-height: 27px;
  }
  .split-active .splitter {
    height: 24px;
  }
  .split-active .map-header {
    min-height: 29px;
    padding: 3px 10px;
  }
  .split-active .map-header h2 {
    font-size: 12px;
  }
  .split-active .live-controls {
    min-height: 52px;
    padding: 4px 8px;
  }
  .split-active #capture {
    height: 40px;
    width: 40px;
  }
  .split-active #camera-controls button {
    padding: 4px;
    font-size: 16px;
  }
  .split-active #camera-controls span {
    font-size: 7px;
  }
  .split-active .map-tools {
    top: 5px;
    right: 5px;
    gap: 1px;
  }
  .split-active .map-tools button {
    width: 24px;
    height: 24px;
    font-size: 16px;
  }
  .split-active .remote-wrap {
    top: 30px;
    max-height: calc(100% - 36px);
  }
  .split-active .compact-consent {
    padding: 2px 10px;
    font-size: 7px;
  }
}

/* Tablets and desktops use the same viewport with a left/right divider. */
.split-active.split-horizontal .live-workspace {
  flex-direction: row;
}
.split-active.split-horizontal .camera-stage {
  width: var(--camera-size, 45%);
  height: auto;
  flex: 0 0 var(--camera-size, 45%);
}
.split-active.split-horizontal .splitter {
  width: 30px;
  height: auto;
  flex: 0 0 30px;
  flex-direction: column;
  cursor: col-resize;
  border-block: 0;
  border-inline: 1px solid #dce2cd;
}
.split-horizontal .splitter > span {
  width: 4px;
  height: 34px;
}
.split-horizontal .splitter small {
  writing-mode: vertical-rl;
  letter-spacing: 1px;
}
.split-active.split-horizontal .map-panel {
  min-width: 0;
  height: 100%;
}
.split-active.split-horizontal .map-header {
  min-height: 48px;
  padding: 10px 15px;
}
.split-active.split-horizontal .compact-consent {
  font-size: 9px;
  padding: 8px 15px;
}
.split-active.split-horizontal .remote-wrap {
  height: min(30%, 180px);
  top: 45px;
  right: 15px;
}
.split-active.split-horizontal .live-controls {
  justify-content: center;
}
.split-active.split-horizontal #camera-controls {
  max-width: 420px;
}
.split-active.split-horizontal #capture {
  width: 170px;
  border-radius: 12px;
  padding: 7px 15px;
  gap: 9px;
}
.split-active.split-horizontal #capture > span:nth-child(2) {
  display: block;
  font-size: 12px;
}
.split-active.split-horizontal #capture small {
  display: none;
}
.split-active.split-horizontal .details-button {
  width: 55px;
}

/* Quiet, icon-first call controls; permission, errors and settings remain explicit. */
.intro,
.edition,
.shell > footer {
  display: none;
}
.masthead .brand {
  margin-right: auto;
}
.control-icon {
  display: block;
  flex: none;
  margin: auto;
}
.state-slash {
  display: none;
}
.is-off .state-slash {
  display: block;
}
.split-active .masthead {
  display: none;
}
.split-active .session-heading {
  min-height: 30px;
  padding: 7px 12px;
}
.split-active #status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.split-active .timer {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.1em;
}
.split-active #live-label,
.split-active .splitter small,
.split-active .map-header > div,
.split-active .compact-consent {
  display: none;
}
.split-active .map-header {
  justify-content: flex-end;
  min-height: 34px;
  padding: 4px 10px;
}
.split-active .toggle {
  gap: 8px;
}
.split-active .toggle .control-icon {
  width: 20px;
  height: 20px;
}
.split-active .location-label,
.split-active #camera-controls button > span,
.split-active #session-details > span,
.split-active #capture > span:not(:first-child),
.split-active #waiting-panel > span,
.split-active #waiting-panel button > span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  display: block;
}
.split-active #camera-controls button {
  height: 44px;
  padding: 10px;
  border-radius: 12px;
}
.split-active #camera-controls button.is-off {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.split-active .live-controls {
  min-height: 62px;
  padding: 7px 9px;
}
.split-active #session-details {
  height: 44px;
}
.split-active #session-details .control-icon {
  width: 22px;
  height: 22px;
}
.split-active #capture {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
}
.split-active #capture .control-icon {
  width: 32px;
  height: 32px;
}
.split-active #local-label {
  padding: 5px;
  background: #252b2470;
}
.split-active #local-label .control-icon {
  width: 14px;
  height: 14px;
}
.split-active .remote-wrap > span .control-icon {
  width: 13px;
  height: 13px;
}
.split-active #waiting-panel {
  justify-content: flex-end;
  min-height: 34px;
  padding: 3px 10px;
  background: transparent;
}
.split-active #waiting-panel button {
  width: 32px;
  height: 28px;
  padding: 4px;
  border: 0;
  background: #f1f4e9;
}
.split-active #waiting-panel .control-icon {
  width: 18px;
  height: 18px;
}
.split-active #waiting-panel:before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: auto;
  background: #a9b38e;
  border-radius: 50%;
  animation: waiting-pulse 1.5s ease-in-out infinite;
}
@keyframes waiting-pulse {
  50% {
    opacity: 0.25;
  }
}
@media (prefers-reduced-motion: reduce) {
  .split-active #waiting-panel:before {
    animation: none;
  }
}
.split-active.split-horizontal #capture {
  width: 48px;
}
.split-active.split-horizontal .map-header {
  min-height: 34px;
  padding: 4px 10px;
}
.split-active.split-horizontal .compact-consent {
  display: none;
}
.camera-stage.audio-only:after {
  content: "";
}
.session-ended .intro,
.session-ended #live-workspace,
.session-ended .session-heading,
.session-ended .card-action {
  display: none;
}
.session-ended .session {
  margin-top: 12px;
}
.session-ended .ended-panel {
  padding: 26px 20px;
}
@media (max-height: 500px) {
  .split-active .live-controls {
    min-height: 52px;
    padding: 4px 8px;
  }
  .split-active #camera-controls button {
    height: 40px;
    padding: 8px;
  }
  .split-active #capture {
    height: 40px;
    width: 40px;
  }
  .split-active .map-header,
  .split-active.split-horizontal .map-header {
    min-height: 30px;
  }
}
.split-active .map-message:not(.has-error) {
  font-size: 0;
  width: 14px;
  height: 14px;
  padding: 0;
  right: auto;
  bottom: 10px;
  background: transparent;
  border: 2px solid #c9d1ba;
  border-top-color: #788b57;
  border-radius: 50%;
  animation: map-spin 0.9s linear infinite;
}
@keyframes map-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .split-active .map-message:not(.has-error) {
    animation: none;
  }
}
.dialog-head .eyebrow {
  display: none;
}
.dialog-head {
  justify-content: flex-end;
}
.audio-indicator {
  display: none;
}
.camera-stage.audio-only .audio-indicator {
  display: grid;
  position: absolute;
  inset: 0;
  place-items: center;
  color: hsl(var(--brand-ivory));
}
.audio-indicator .control-icon {
  width: 42px;
  height: 42px;
}
.split-active.split-horizontal #capture {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  gap: 0;
}

/* Continuous video/map surface: the separator is an overlay, never a gutter. */
.split-active .live-workspace {
  position: relative;
}
.split-active .map-panel {
  position: relative;
}
.split-active .map-stage {
  margin: 0;
  border-radius: 0;
  min-width: 0;
}
.split-active .map-header,
.split-active.split-horizontal .map-header {
  position: absolute;
  z-index: 4;
  top: 20px;
  left: 20px;
  right: auto;
  min-height: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
}
.split-active .toggle {
  height: 44px;
  gap: 8px;
  border-radius: 12px;
  padding: 0 2px;
  background: #fffffff0;
  box-shadow: 0 1px 6px #25311e18;
}
.split-active .map-tools {
  top: 20px;
  right: 12px;
  gap: 3px;
}
.split-active .map-tools button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fffffff0;
  font-size: 20px;
  box-shadow: 0 1px 6px #25311e18;
}
.split-active .attribution {
  font-size: 9px;
  line-height: 1.2;
  padding: 3px 5px;
  background: #ffffffed;
}
.split-active .splitter,
.split-active.split-horizontal .splitter {
  position: absolute;
  z-index: 5;
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  outline: none;
  gap: 0;
}
.split-active.split-vertical .splitter {
  top: var(--camera-size, 45%);
  left: 0;
  right: 0;
  width: 100%;
  height: 32px;
  transform: translateY(-50%);
  cursor: row-resize;
}
.split-active.split-horizontal .splitter {
  top: 0;
  bottom: 0;
  left: var(--camera-size, 45%);
  width: 32px;
  height: 100%;
  transform: translateX(-50%);
  cursor: col-resize;
}
.split-active .splitter > span {
  opacity: 0;
  background: #f7f9ef;
  border: 1px solid #53644380;
  box-shadow: 0 1px 7px #10200d50;
  transition: opacity 0.15s ease;
  position: relative;
  z-index: 1;
}
.split-active .splitter:before {
  content: "";
  position: absolute;
  opacity: 0;
  background: #ffffffbf;
  box-shadow: 0 0 2px #18231060;
  transition: opacity 0.15s ease;
}
.split-active.split-vertical .splitter:before {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}
.split-active.split-horizontal .splitter:before {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}
.split-active .splitter.dragging,
.split-active .splitter:focus-visible {
  background: transparent;
  outline: none;
}
.split-active .splitter.dragging > span,
.split-active .splitter:focus-visible > span,
.split-active .splitter.dragging:before,
.split-active .splitter:focus-visible:before {
  opacity: 1;
}
.split-active .splitter:focus-visible > span {
  border-color: #6c862b;
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2);
}
@media (hover: hover) and (pointer: fine) and (not (any-pointer: coarse)) {
  .split-active .splitter:hover > span,
  .split-active .splitter:hover:before {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .split-active .splitter > span,
  .split-active .splitter:before {
    transition: none;
  }
}
.split-active .live-controls {
  min-height: 64px;
  padding: 7px 9px;
}
.split-active #camera-controls button {
  height: 44px;
  padding: 10px;
}
.split-active #session-details {
  width: 44px;
  height: 44px;
}
.split-active #capture,
.split-active.split-horizontal #capture {
  width: 48px;
  height: 48px;
}
.split-active #waiting-panel button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.map-view-switch {
  display: none;
}
.split-active .map-view-switch {
  display: flex;
  position: absolute;
  z-index: 4;
  left: 12px;
  bottom: 24px;
  gap: 3px;
}
.split-active .map-view-switch button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #dbe1d2;
  border-radius: 12px;
  background: #fffffff0;
  color: #435039;
  box-shadow: 0 1px 6px #25311e18;
  cursor: pointer;
}
.split-active .map-view-switch button[aria-pressed="true"] {
  background: hsl(var(--primary));
  border-color: hsl(var(--border));
  color: hsl(var(--primary-foreground));
}
.split-active .map-view-switch button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
@media (max-height: 400px) {
  .split-active.split-vertical .map-view-switch {
    bottom: 8px;
  }
}

/* Short, wide phone maps keep every 44px control in a single overlay row. */
@media (max-height: 400px) and (min-width: 520px) {
  .split-active.split-vertical .map-view-switch {
    top: 20px;
    bottom: auto;
    left: 12px;
  }
  .split-active.split-vertical .map-header {
    top: 20px;
    left: 174px;
  }
}

/* Status belongs on the video surface, with no reserved header row. */
.split-active .session-heading {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 12px;
  right: 12px;
  min-height: 0;
  height: 20px;
  padding: 0;
  background: transparent;
  color: white;
  pointer-events: none;
}
.split-active .session-heading .status {
  height: 20px;
  padding: 5px;
  background: #1d281ca8;
  border-radius: 20px;
}
.split-active .session-heading .timer {
  display: block;
  min-width: 44px;
  height: 20px;
  padding: 3px 8px;
  border-radius: 20px;
  color: #fff;
  background: #1d281ca8;
  font-size: 12px;
  line-height: 14px;
}
.split-active #local-label {
  display: none;
}

/* Keep the functional entry header compact before joining. */
body:not(.split-active) .masthead {
  height: 56px;
  gap: 16px;
}
body:not(.split-active) .masthead .brand {
  font-size: 30px;
}
@media (max-width: 767px) {
  body:not(.split-active) .masthead {
    height: 48px;
  }
}

/* Waiting actions also float on the video, without another external toolbar. */
.split-active #waiting-panel {
  position: absolute;
  z-index: 4;
  top: 40px;
  right: 12px;
  left: auto;
  width: auto;
  min-height: 44px;
  height: 44px;
  padding: 0;
  gap: 6px;
  background: transparent;
}
.split-active #waiting-panel:before {
  display: none;
}
.split-active.split-horizontal #waiting-panel {
  right: 20px;
}
.split-active #waiting-panel button {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  box-shadow: 0 1px 6px #25311e18;
}
#capture[aria-busy="true"] .capture-icon {
  animation: waiting-pulse 1s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  #capture[aria-busy="true"] .capture-icon {
    animation: none;
  }
}
#capture {
  position: relative;
}
#capture[aria-busy="true"]:after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid hsl(var(--primary-foreground) / 0.35);
  border-top-color: hsl(var(--primary-foreground));
  border-radius: 50%;
  animation: map-spin 0.9s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  #capture[aria-busy="true"]:after {
    animation: none;
  }
}

/* Quiet map icons keep full touch targets without large visible tiles. */
.split-active .map-tools button,
.split-active .map-view-switch button {
  position: relative;
  isolation: isolate;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 18px;
  color: hsl(var(--card-foreground));
  display: grid;
  place-items: center;
}
.split-active .map-tools button:focus-visible,
.split-active .map-view-switch button:focus-visible {
  box-shadow: 0 0 0 7px hsl(var(--card));
}
.split-active .map-tools button:before,
.split-active .map-view-switch button:before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 30px;
  height: 30px;
  top: 7px;
  left: 7px;
  border: 1px solid hsl(var(--border));
  border-radius: 9px;
  background: hsl(var(--card));
  box-shadow: 0 1px 5px #25311e18;
}
.split-active .map-view-switch button[aria-pressed="true"] {
  background: transparent;
}
.split-active .map-view-switch button[aria-pressed="true"]:before {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
.split-active .map-view-switch .control-icon {
  width: 17px;
  height: 17px;
}
.split-active .toggle {
  position: relative;
  isolation: isolate;
  gap: 6px;
  padding: 0 6px;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  color: hsl(var(--card-foreground));
}
.split-active .toggle:after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 7px 0;
  border: 1px solid hsl(var(--border));
  border-radius: 9px;
  background: hsl(var(--card));
  box-shadow: 0 1px 5px #25311e18;
}
.split-active .toggle .control-icon {
  width: 17px;
  height: 17px;
}
.split-active .toggle-track {
  width: 30px;
  height: 18px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--foreground) / 0.65);
}
.split-active .toggle-track:before {
  width: 12px;
  height: 12px;
  background: hsl(var(--foreground));
}
.split-active .toggle input:checked + .toggle-track {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
.split-active .toggle input:checked + .toggle-track:before {
  transform: translateX(12px);
  background: hsl(var(--primary-foreground));
}
@media (hover: hover) and (pointer: fine) and (not (any-pointer: coarse)) {
  .split-active[data-ui-mode="desktop"] .map-tools,
  .split-active[data-ui-mode="desktop"] .map-view-switch,
  .split-active[data-ui-mode="desktop"] .map-header {
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease;
  }
  .split-active[data-ui-mode="desktop"] .map-panel:hover .map-tools,
  .split-active[data-ui-mode="desktop"] .map-panel:hover .map-view-switch,
  .split-active[data-ui-mode="desktop"] .map-panel:hover .map-header,
  .split-active[data-ui-mode="desktop"] .map-panel:focus-within .map-tools,
  .split-active[data-ui-mode="desktop"]
    .map-panel:focus-within
    .map-view-switch,
  .split-active[data-ui-mode="desktop"] .map-panel:focus-within .map-header {
    opacity: 1;
    pointer-events: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .split-active .map-tools,
  .split-active .map-view-switch,
  .split-active .map-header {
    transition: none;
  }
}

/* Responsive call presentation: a single JS mode drives every active layout. */
.split-active[data-ui-mode="mobile"] .live-workspace {
  flex-direction: column;
}
.split-active[data-ui-mode="tablet"] .live-workspace,
.split-active[data-ui-mode="desktop"] .live-workspace {
  flex-direction: row;
}
.split-active .live-controls {
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  min-height: 64px;
}
.split-active #camera-controls {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  max-width: none;
}
.split-active #camera-controls[hidden] {
  display: none;
}
.split-active #camera-controls button,
.split-active #session-details,
.split-active #capture {
  flex: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
}
.split-active #capture {
  width: 48px;
  height: 48px;
}
.split-active[data-ui-mode="desktop"] .live-controls {
  gap: 12px;
  min-height: 68px;
}
.split-active[data-ui-mode="mobile"] .live-controls {
  gap: 6px;
  padding-inline: 8px;
}
.split-active[data-ui-mode="mobile"] #camera-controls {
  gap: 6px;
}
.split-active[data-ui-mode="tablet"] .live-controls {
  gap: 12px;
  min-height: 72px;
}
.split-active #local-video {
  object-fit: cover;
  background: #171b17;
}
.split-active .remote-wrap {
  top: 40px;
  right: 24px;
  width: clamp(88px, 26%, 170px);
  height: min(28%, 140px);
  max-height: calc(100% - 56px);
}
.split-active[data-ui-mode="mobile"] .remote-wrap {
  width: clamp(80px, 25%, 120px);
  height: min(30%, 110px);
  right: 12px;
  top: 36px;
  max-height: calc(100% - 58px);
}
.split-active[data-ui-mode="desktop"] .remote-wrap {
  width: clamp(120px, 25%, 190px);
  height: min(26%, 160px);
}
.split-active .remote-wrap video {
  object-fit: cover;
  background: #171b17;
}
.video-swap {
  position: absolute;
  z-index: 7;
  top: 40px;
  left: 12px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid #ffffff44;
  border-radius: 12px;
  background: #202820b8;
  color: white;
}
.video-swap[hidden] {
  display: none;
}
.split-active[data-video-main="peer"] #remote-wrap,
.split-active .camera-stage[data-video-main="peer"] #remote-wrap {
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: auto;
  z-index: 1;
}
.split-active .camera-stage[data-video-main="peer"] #local-video {
  position: absolute;
  top: 40px;
  right: 24px;
  left: auto;
  bottom: auto;
  width: clamp(88px, 26%, 170px);
  height: min(28%, 140px);
  max-height: calc(100% - 56px);
  z-index: 3;
  border: 1px solid #ffffff99;
  border-radius: 10px;
  box-shadow: 0 2px 12px #0004;
}
.split-active[data-ui-mode="mobile"]
  .camera-stage[data-video-main="peer"]
  #local-video {
  width: clamp(80px, 25%, 120px);
  height: min(30%, 110px);
  top: 36px;
  right: 12px;
  max-height: calc(100% - 58px);
}
.split-active[data-ui-mode="desktop"]
  .camera-stage[data-video-main="peer"]
  #local-video {
  width: clamp(120px, 25%, 190px);
  height: min(26%, 160px);
}
.split-active .camera-stage[data-video-main="peer"] #remote-wrap > span {
  display: none;
}
.split-active.split-horizontal #waiting-panel {
  right: 24px;
}
@media (any-pointer: coarse) {
  .split-active.split-vertical .splitter {
    height: 44px;
  }
  .split-active.split-horizontal .splitter {
    width: 44px;
  }
  .split-active.split-horizontal .map-header {
    left: 24px;
  }
}
@media (any-pointer: coarse) and (max-height: 400px) and (min-width: 520px) {
  .split-active[data-ui-mode="mobile"] .map-header {
    left: 174px;
  }
}

/* Wide call controls belong to the video pane; phones retain their bottom dock. */
.split-active[data-ui-mode="tablet"] .session,
.split-active[data-ui-mode="desktop"] .session {
  position: relative;
}
.split-active[data-ui-mode="tablet"] #live-controls,
.split-active[data-ui-mode="desktop"] #live-controls {
  position: absolute;
  z-index: 8;
  left: 0;
  bottom: 0;
  width: var(--camera-size, 48%);
  min-height: 64px;
  height: 64px;
  padding: 8px 12px;
  gap: 8px;
  background: transparent;
  border: 0;
  pointer-events: none;
}
.split-active[data-ui-mode="tablet"] #live-controls:before,
.split-active[data-ui-mode="desktop"] #live-controls:before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: calc(100% - 16px);
  max-width: 332px;
  height: 56px;
  border-radius: 16px;
  background: #1c241cd9;
}
.split-active[data-ui-mode="tablet"] #live-controls > *,
.split-active[data-ui-mode="desktop"] #live-controls > * {
  pointer-events: auto;
}
.split-active #remote-wrap[role="button"] {
  cursor: pointer;
}
.split-active #remote-wrap:focus-visible {
  outline: 3px solid hsl(var(--primary));
  outline-offset: -3px;
}
@media (any-pointer: coarse) {
  .split-active .map-tools,
  .split-active .map-header,
  .split-active.split-horizontal .map-header {
    top: 24px;
  }
  .split-active[data-ui-mode="mobile"] .map-view-switch {
    bottom: 24px;
  }
}
@media (any-pointer: coarse) and (max-height: 400px) and (min-width: 520px) {
  .split-active[data-ui-mode="mobile"] .map-view-switch {
    top: 24px;
    bottom: auto;
  }
}

#main-video-placeholder {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #c0c9b8;
  pointer-events: none;
}
#main-video-placeholder[hidden] {
  display: none;
}
.split-active .camera-stage[data-peer-video="off"] #remote-video {
  opacity: 0;
}
.split-active .camera-stage[data-peer-video="off"] #remote-wrap {
  background: #242d25;
}

.split-active .camera-stage[data-local-video="off"] #local-video {
  opacity: 0;
}

/* Keep every wide-toolbar and map target outside the separator's hit strip. */
.split-active.split-horizontal .map-view-switch {
  left: 24px;
}
.split-active[data-ui-mode="tablet"] #live-controls,
.split-active[data-ui-mode="desktop"] #live-controls {
  padding-right: 24px;
}

/* Settings stays legible on the wide video toolbar. */
.split-active[data-ui-mode="tablet"] #session-details,
.split-active[data-ui-mode="desktop"] #session-details {
  color: hsl(var(--brand-ivory));
}

/* Smaller modes keep map controls discoverable for every input device. */
.split-active:is([data-ui-mode="mobile"], [data-ui-mode="tablet"])
  :is(.map-tools, .map-view-switch, .map-header) {
  opacity: 1;
  pointer-events: auto;
}

/* Standalone scene cards use camera and local-only optional location. */
.scene-only #mute,
.scene-only #waiting-panel,
.scene-only #invite,
.scene-only #network-note,
.scene-only .session-heading {
  display: none !important;
}
.scene-only:not(.scene-has-map) #map {
  visibility: hidden;
}
.scene-only:not(.scene-has-map) #map-message {
  display: none;
}
.scene-only:not(.scene-has-map) .attribution {
  display: none;
}

.scene-preparing
  #camera-empty
  > :is(input, button, a):not(#scene-mode):not(#scene-cancel) {
  display: none;
}

.scene-only #map-view-peer,
.scene-only #map-view-both {
  display: none;
}

#reopen-scene-card {
  min-height: 44px;
}

/* Permission-free entry is content-sized; live video geometry begins only after participation. */
body:not(.session-active):not(.session-ended) .shell {
  max-width: 640px;
  padding: 0 20px;
}
body:not(.session-active):not(.session-ended) .session {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
body:not(.session-active):not(.session-ended)
  :is(
    #live-workspace,
    #session-heading,
    .card-action,
    #live-controls,
    #network-note
  ) {
  display: none;
}
#entry-panel {
  padding: 40px 0 max(32px, env(safe-area-inset-bottom));
}
#entry-panel .entry-content {
  position: static;
  inset: auto;
  min-height: 0;
  height: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
#entry-panel h2 {
  font-size: 24px;
  margin: 0;
  grid-column: 1 / -1;
}
#entry-panel p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 16px;
  grid-column: 1 / -1;
  color: var(--muted-ink);
}
#entry-panel :is(button, a, input, summary) {
  min-height: 48px;
  font-size: 16px;
  border-radius: 6px;
}
#entry-panel #create-room {
  grid-column: 1;
  grid-row: 3;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
#entry-panel #scene-mode {
  grid-column: 2;
  grid-row: 3;
}
#entry-panel #invite-options {
  grid-column: 1 / -1;
  grid-row: 4;
}
#entry-panel summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--muted-ink);
  font-size: 14px;
}
#entry-panel #host-name {
  width: 100%;
  max-width: none;
  background: hsl(var(--card));
  border-color: var(--line);
  color: var(--ink);
  font-size: 16px;
}
#entry-panel #reopen-scene-card {
  grid-column: 1 / -1;
}
#entry-panel
  :is(
    #enter,
    #audio-only,
    #decline,
    #retry-invitation,
    #new-invitation,
    #scene-cancel
  ) {
  grid-column: 1 / -1;
}
#entry-panel .primary {
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
}
body:not(.split-active) .masthead {
  height: 56px;
  border-bottom: 1px solid var(--line);
}
body:not(.split-active) .masthead .brand {
  font-size: 22px;
  letter-spacing: -0.04em;
}
body:not(.split-active) #invite {
  display: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline-color: hsl(var(--ring));
}
@media (max-width: 767px) {
  #entry-panel .entry-content {
    grid-template-columns: 1fr;
  }
  #entry-panel #create-room {
    grid-column: 1;
    grid-row: 3;
  }
  #entry-panel #scene-mode {
    grid-column: 1;
    grid-row: 4;
  }
  #entry-panel #invite-options {
    grid-row: 5;
  }
}

/* Shared Habitus surfaces and compact initial choice hierarchy. */
body[data-entry-kind="landing"] #entry-panel .entry-content :is(h2, p) {
  display: none;
}
body[data-entry-kind="landing"].scene-preparing #entry-panel .scene-location-disclosure {
  display: block;
}
#entry-panel .entry-content {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-start;
}
#entry-panel
  :is(
    h2,
    p,
    #invite-options,
    #reopen-scene-card,
    #enter,
    #audio-only,
    #decline,
    #retry-invitation,
    #new-invitation,
    #scene-cancel
  ) {
  width: 100%;
}
#entry-panel :is(#create-room, #scene-mode) {
  width: calc(50% - 6px);
}
#entry-panel #create-room {
  order: 1;
}
#entry-panel #scene-mode {
  order: 2;
}
#entry-panel #invite-options {
  order: 3;
}
#entry-panel #reopen-scene-card {
  order: 4;
}
#entry-panel
  :is(
    #enter,
    #audio-only,
    #decline,
    #retry-invitation,
    #new-invitation,
    #scene-cancel
  ) {
  order: 5;
}
.scene-preparing #invite-options {
  display: none;
}
.primary,
.capture {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.secondary {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.map-view-switch button[aria-pressed="true"] {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}
.toggle-track {
  background: hsl(var(--muted));
}
.toggle input:checked + .toggle-track {
  background: hsl(var(--primary));
}
dialog {
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border-color: hsl(var(--border));
}
#details-dialog,
#invite-dialog {
  border-radius: 8px;
}
@media (max-width: 767px) {
  #entry-panel :is(#create-room, #scene-mode) {
    width: 100%;
  }
}

/* A scene shows the live picture edge to edge. The card crop is marked on top of it: the
   overlay is the crop rectangle (it may extend past the stage) and its shadow dims the rest. */
#scene-frame-overlay {
  display: none;
}
.scene-only #camera-panel #local-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scene-only #scene-frame-overlay {
  display: block;
  position: absolute;
  left: var(--scene-frame-left, 0px);
  top: var(--scene-frame-top, 0px);
  width: var(--scene-frame-width, 100%);
  height: var(--scene-frame-height, 100%);
  pointer-events: none;
  z-index: 6;
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.42), inset 0 0 0 1px rgb(255 255 255 / 0.55);
}
#scene-frame-title {
  color: white;
  background: rgba(14, 22, 48, 0.66);
  border-radius: var(--scene-title-radius);
  padding: var(--scene-title-pad-y) var(--scene-title-pad-x);
  font-size: var(--scene-title-font);
  font-weight: 600;
  line-height: 1;
}
#scene-frame-title {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--scene-title-font) !important;
}
.scene-only .video-top {
  display: none;
}

/* Location recovery is separate from map-tile loading and never blocks controls. */
.location-status {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 80px;
  max-width: 360px;
  padding: 7px 9px;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
}
.map-stage:has(#location-status:not([hidden])) .map-message {
  bottom: 126px;
}

/* Short landscape maps put their controls on the top row. */
@media (max-height: 400px) and (min-width: 520px) {
  .location-status {
    bottom: 26px;
  }
  .map-stage:has(#location-status:not([hidden])) .map-message {
    bottom: 72px;
  }
}

.scene-location-disclosure {
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  line-height: 1.5;
}
body[data-entry-kind="invitation"] .scene-location-disclosure {
  display: none;
}
/* Adjacent zoom targets share one compact surface. */
.map-tools,
.split-active .map-tools {
  right: 8px;
  gap: 0;
  flex-direction: row;
  border: 1px solid hsl(var(--border));
  border-radius: 9px;
  background: hsl(var(--card));
  overflow: hidden;
}
.map-tools button,
.split-active .map-tools button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.split-active .map-tools button:before {
  content: none;
}
#zoom-out {
  border-left: 1px solid hsl(var(--border));
}
.map-tools button:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: -3px;
}

.call-location-disclosure {
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  line-height: 1.5;
}

#card-retry {
  width: 100%;
  min-height: 44px;
  margin: 4px 0;
}

/* The two annotation tools stay visible above the map on every layout. */
.map-markup-tools {
  position: absolute;
  z-index: 5;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  border: 1px solid hsl(var(--border));
  border-radius: 9px;
  background: hsl(var(--card));
  overflow: hidden;
}
.map-markup-tools button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: hsl(var(--foreground));
  transition: background 150ms, color 150ms;
  padding: 0;
}
.map-markup-tools button + button { border-left: 1px solid hsl(var(--border)); }
.map-markup-tools button[aria-pressed="true"] { background: hsl(var(--secondary)); color: hsl(var(--primary)); }
.map-markup-tools button:hover:not(:disabled) { background: hsl(var(--muted)); }
.map-markup-tools button:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: -3px; }
#map:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: -3px; }
/* The visible countdown lives in the shutter button; this is only the live region. */
.capture-countdown {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.capture-countdown[hidden] { display: none; }

#map-markup-help {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The hero drawing itself is shared: see hero-motion.css. Here it only follows the entry state. */
#entry-panel .hero-motion { max-width: 420px; margin: 0 auto 20px; }
body:not([data-entry-kind="landing"]) #entry-panel .hero-motion { display: none; }

/* Map overlays: the view switch is one surface like the zoom and markup groups. */
.split-active .map-view-switch {
  gap: 0;
  border: 1px solid hsl(var(--border));
  border-radius: 9px;
  background: hsl(var(--card));
  overflow: hidden;
}
.split-active .map-view-switch button {
  border-radius: 0;
}
.split-active .map-view-switch button:before {
  content: none;
}
.split-active .map-view-switch button + button {
  border-left: 1px solid hsl(var(--border));
}
.split-active .map-view-switch button[aria-pressed="true"] {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.split-active .map-view-switch button:focus-visible {
  box-shadow: none;
  outline: 2px solid hsl(var(--ring));
  outline-offset: -3px;
}

/* Drawing tools sit on the zoom group's row in every mode (same top as .map-tools). */
.split-active .map-markup-tools {
  top: 20px;
}
@media (max-height: 500px) {
  .split-active .map-markup-tools {
    top: 5px;
  }
}
@media (any-pointer: coarse) {
  .split-active .map-markup-tools {
    top: 24px;
  }
}

/* Phones: drawing tools and zoom share one row below the splitter's 44px hit strip. */
.split-active[data-ui-mode="mobile"] .map-markup-tools,
.split-active[data-ui-mode="mobile"] .map-tools {
  top: 24px;
}
.split-active[data-ui-mode="mobile"] .map-tools {
  right: 8px;
}

/* Portrait phones keep the map visible: compact surfaces (36px buttons, 38px
   groups) whose touch targets still reach 44px through an invisible ::after, a
   12px inset, drawing tools left / zoom right, the view switch above the credit
   line, and no view switch while alone and centered (app.js sets .is-idle). */
@media (max-width: 519px) {
  .split-active[data-ui-mode="mobile"]
    :is(.map-markup-tools, .map-tools, .map-view-switch) {
    overflow: visible;
    border-radius: 8px;
    box-shadow: 0 1px 4px #25311e26;
  }
  .split-active[data-ui-mode="mobile"]
    :is(.map-markup-tools, .map-tools, .map-view-switch)
    button {
    position: relative;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
  .split-active[data-ui-mode="mobile"]
    :is(.map-markup-tools, .map-tools, .map-view-switch)
    button::after {
    content: "";
    position: absolute;
    inset: -4px;
  }
  /* The 1px divider sits outside the padding box the ::after is measured from. */
  .split-active[data-ui-mode="mobile"]
    :is(.map-markup-tools, .map-tools, .map-view-switch)
    button
    + button::after {
    left: -5px;
  }
  .split-active[data-ui-mode="mobile"]
    :is(.map-markup-tools, .map-tools, .map-view-switch)
    button:first-child {
    border-radius: 7px 0 0 7px;
  }
  .split-active[data-ui-mode="mobile"]
    :is(.map-markup-tools, .map-tools, .map-view-switch)
    button:last-child {
    border-radius: 0 7px 7px 0;
  }
  .split-active[data-ui-mode="mobile"] :is(.map-markup-tools, .map-view-switch) svg {
    width: 20px;
    height: 20px;
  }
  .split-active[data-ui-mode="mobile"] .map-tools button {
    font-size: 20px;
  }
  .split-active[data-ui-mode="mobile"] .map-markup-tools,
  .split-active[data-ui-mode="mobile"] .map-tools {
    top: 28px;
  }
  .split-active[data-ui-mode="mobile"] .map-markup-tools {
    left: 12px;
    transform: none;
  }
  .split-active[data-ui-mode="mobile"] .map-tools {
    right: 12px;
  }
  .split-active[data-ui-mode="mobile"] .map-view-switch {
    left: 12px;
    bottom: 28px;
  }
  .split-active[data-ui-mode="mobile"] .map-view-switch.is-idle {
    display: none;
  }
}

/* Phone dock by role: [camera flip, camera, mic] — [capture] — [leave, settings].
   The invisible ::after keeps both sides the same width so capture sits centered;
   it is the first thing to give way on narrow screens. */
.split-active[data-ui-mode="mobile"] #live-controls {
  justify-content: flex-start;
  gap: 4px;
  padding-inline: 8px;
}
.split-active[data-ui-mode="mobile"] #camera-controls:not([hidden]) {
  display: contents;
}
.split-active[data-ui-mode="mobile"] #live-controls::after {
  content: "";
  order: 5;
  flex: 0 1000 44px;
  min-width: 0;
  height: 44px;
}
.split-active[data-ui-mode="mobile"] #switch-camera {
  order: 1;
}
.split-active[data-ui-mode="mobile"] #camera-toggle {
  order: 2;
}
.split-active[data-ui-mode="mobile"] #mute {
  order: 3;
}
.split-active[data-ui-mode="mobile"] #capture {
  order: 4;
  margin-inline: auto;
}
.split-active[data-ui-mode="mobile"] #leave {
  order: 6;
}
.split-active[data-ui-mode="mobile"] #session-details {
  order: 7;
}
@media (max-width: 340px) {
  .split-active[data-ui-mode="mobile"] #live-controls {
    gap: 2px;
  }
}
@media (max-width: 299px) {
  .split-active[data-ui-mode="mobile"] #live-controls {
    padding-inline: 4px;
  }
  .split-active[data-ui-mode="mobile"] #live-controls::after {
    min-width: 12px;
  }
  .split-active[data-ui-mode="mobile"] #capture {
    width: 44px;
    height: 44px;
  }
  .split-active[data-ui-mode="mobile"] :is(#camera-controls button, #session-details) {
    flex: 0 1 44px;
    min-width: 0;
  }
}

/* ---- UX audit round (2026-10-04) ---- */

/* Camera stage: the live picture always fills the stage (cover), so there are no empty bars. */
.camera-stage { isolation: isolate; }
.split-active #local-video,
.split-active .remote-wrap video,
.scene-only #camera-panel #local-video { background: #171b17; }

/* Countdown: the number sits inside the shutter button; the view only gets a quiet frame pulse. */
#capture .capture-count { display: none; }
#capture[data-count] .capture-count {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
#capture[data-count] .capture-icon { animation: none; }
#capture[data-count] .capture-icon svg { display: none; }
#camera-panel[data-counting]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  border: 3px solid rgb(255 255 255 / 0.85);
  pointer-events: none;
  animation: capture-frame-pulse 1s ease-in-out infinite;
}
.scene-only #camera-panel[data-counting] #scene-frame-overlay {
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.42), inset 0 0 0 3px rgb(255 255 255 / 0.9);
}
@keyframes capture-frame-pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
  #camera-panel[data-counting]::after { animation: none; }
}

/* Secondary text actions were still dark-theme pale green on the light page. */
#entry-panel .text-button {
  color: var(--muted-ink);
  font-size: 14px;
  text-underline-offset: 3px;
}

/* Entering the live view eases in instead of cutting. */
@keyframes session-in {
  from { opacity: 0; transform: translateY(10px) scale(0.992); }
  to { opacity: 1; transform: none; }
}
.split-active .session { animation: session-in 280ms cubic-bezier(0.22, 0.8, 0.3, 1) both; }
@keyframes layout-switch { from { opacity: 0.35; } to { opacity: 1; } }
.split-active .live-workspace.is-switching { animation: layout-switch 220ms ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .split-active .session,
  .split-active .live-workspace.is-switching { animation: none; }
}

/* Camera preparing: keep the landing composition and show progress on the button itself. */
.scene-preparing #scene-mode:disabled { position: relative; }
.scene-preparing #scene-mode:disabled::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 10px;
  vertical-align: -2px;
  border: 2px solid hsl(var(--muted-foreground) / 0.35);
  border-top-color: hsl(var(--foreground));
  border-radius: 50%;
  animation: map-spin 0.9s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .scene-preparing #scene-mode:disabled::after { animation: none; }
}

/* Ended screen: infrastructure notes are not for the visitor. */
.session-ended .network-note { display: none; }

/* Phone on its side: video | map | vertical button rail along the right edge. */
body.split-active[data-rail="on"] .session { padding-right: 64px; }
body.split-active[data-rail="on"] #live-controls {
  left: auto;
  right: 0;
  top: 0;
  bottom: 0;
  width: 64px;
  height: auto;
  min-height: 0;
  padding: 8px 0;
  gap: 8px;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  background: hsl(var(--card));
  border-left: 1px solid hsl(var(--border));
  border-radius: 0;
}
body.split-active[data-rail="on"] #live-controls:before { content: none; }
body.split-active[data-rail="on"] #camera-controls { display: contents; }
body.split-active[data-rail="on"] #camera-controls[hidden] { display: none; }
body.split-active[data-rail="on"] #switch-camera { order: 1; }
body.split-active[data-rail="on"] #camera-toggle { order: 2; }
body.split-active[data-rail="on"] #mute { order: 3; }
body.split-active[data-rail="on"] #capture { order: 4; margin-block: auto; }
body.split-active[data-rail="on"] #leave { order: 5; }
body.split-active[data-rail="on"] #session-details { order: 6; color: hsl(var(--foreground)); }

/* Very short landscape (small phones, toolbars, page zoom): six buttons still fit the rail. */
@media (max-height: 339px) {
  body.split-active[data-rail="on"] #live-controls { gap: 6px; padding: 6px 0; }
  body.split-active[data-rail="on"] #camera-controls button,
  body.split-active[data-rail="on"] #session-details {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 7px;
  }
  body.split-active[data-rail="on"] #capture {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 8px;
  }
  body.split-active[data-rail="on"] #capture[data-count] .capture-count { font-size: 18px; }
}

/* Landscape rail: the map pane is narrow, so the drawing tools sit at the left (clear of the
   splitter strip) and the zoom group at the right instead of both crowding the centre. */
body.split-active[data-rail="on"] .map-markup-tools {
  left: 24px;
  transform: none;
}

/* Phones (portrait stack up to 519px, and the landscape rail): the drawing tools and the zoom
   group sit higher on the map with visible 44px buttons, so the drawn target is the touch target.
   They also stack above the splitter's invisible drag strip, so the
   top of each button is never swallowed by it. */
body.split-active[data-rail="on"] :is(.map-markup-tools, .map-tools) { top: 14px; z-index: 6; overflow: visible; border-radius: 8px; box-shadow: 0 1px 4px #25311e26; }
body.split-active[data-rail="on"] :is(.map-markup-tools, .map-tools) button { position: relative; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border-radius: 0; }
body.split-active[data-rail="on"] :is(.map-markup-tools, .map-tools) button:first-child { border-radius: 7px 0 0 7px; }
body.split-active[data-rail="on"] :is(.map-markup-tools, .map-tools) button:last-child { border-radius: 0 7px 7px 0; }
body.split-active[data-rail="on"] :is(.map-markup-tools, .map-tools) svg { width: 18px; height: 18px; }
body.split-active[data-rail="on"] .map-tools button { font-size: 18px; }
body.split-active[data-rail="on"] .map-tools { right: 12px; }
@media (max-width: 519px) {
  .split-active[data-ui-mode="mobile"] :is(.map-markup-tools, .map-tools) { top: 14px; z-index: 6; overflow: visible; border-radius: 8px; box-shadow: 0 1px 4px #25311e26; }
  .split-active[data-ui-mode="mobile"] :is(.map-markup-tools, .map-tools) button { position: relative; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border-radius: 0; }
  .split-active[data-ui-mode="mobile"] :is(.map-markup-tools, .map-tools) button:first-child { border-radius: 7px 0 0 7px; }
  .split-active[data-ui-mode="mobile"] :is(.map-markup-tools, .map-tools) button:last-child { border-radius: 0 7px 7px 0; }
  .split-active[data-ui-mode="mobile"] :is(.map-markup-tools, .map-tools) svg { width: 18px; height: 18px; }
  .split-active[data-ui-mode="mobile"] .map-tools button { font-size: 18px; }
  .split-active[data-ui-mode="mobile"] .map-markup-tools { left: 12px; transform: none; }
  .split-active[data-ui-mode="mobile"] .map-tools { right: 12px; }
}

/* ---- Scene dock and title dropdown (2026-10-05) ----
   In a scene the card shutter is the centre of the bottom row and rises out of it over the
   map; the camera-off and settings buttons are gone. The title chip on the picture is the way
   into the title, the location notice and the coordinates. Calls keep their existing dock. */
.scene-only #camera-toggle,
.scene-only #session-details { display: none !important; }
.leave-close-icon { display: none; }
.scene-only #leave .leave-hangup-icon { display: none; }
.scene-only #leave .leave-close-icon { display: block; }
.scene-only #leave {
  background: hsl(var(--secondary)) !important;
  color: hsl(var(--secondary-foreground)) !important;
}

/* The chip stays a faithful preview of the card title; the pen beside it is only the way in. */
.scene-only #scene-title-button {
  position: absolute;
  left: var(--scene-chip-left, 0px);
  top: var(--scene-chip-top, 0px);
  max-width: var(--scene-chip-room, 100%);
  display: flex;
  align-items: center;
  gap: calc(var(--scene-title-font, 14px) * 0.45);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: white;
  font: inherit;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
}
.scene-only #scene-title-button::before { content: ""; position: absolute; inset: -14px -10px; }
.scene-title-pen {
  flex: none;
  display: grid;
  place-items: center;
  width: calc(var(--scene-title-font, 14px) * 1.7);
  height: calc(var(--scene-title-font, 14px) * 1.7);
  border-radius: 50%;
  background: rgba(14, 22, 48, 0.66);
  color: white;
}
.scene-title-pen svg { width: 58%; height: 58%; }
#scene-title-button:focus-visible { outline: none; }
#scene-title-button:focus-visible :is(#scene-frame-title, .scene-title-pen) { box-shadow: 0 0 0 3px white; }
.scene-only #camera-panel[data-counting] #scene-title-button { pointer-events: none; }
/* One pill: the title and the pen are a single 36px tap target with the pen inside on the right,
   instead of a small square-cornered label with a separate round button beside it. */
.scene-only #scene-title-button {
  min-height: 36px;
  gap: 6px;
  padding: 4px 4px 4px 14px;
  border-radius: 999px;
  background: rgba(14, 22, 48, 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.scene-only #scene-title-button::before { inset: -6px -4px; }
.scene-only #scene-frame-title {
  padding: 0;
  background: none;
  border-radius: 0;
  font-size: max(15px, var(--scene-title-font, 15px)) !important;
  line-height: 1.2;
}
.scene-only .scene-title-pen {
  width: 28px;
  height: 28px;
  background: rgb(255 255 255 / 0.16);
}
.scene-only .scene-title-pen svg { width: 15px; height: 15px; }
#scene-title-button:focus-visible { box-shadow: 0 0 0 3px white; }
#scene-title-button:focus-visible :is(#scene-frame-title, .scene-title-pen) { box-shadow: none; }

/* The shutter: larger, ringed in the card colour, centred, overlapping the map above it. */
body.scene-only:not([data-rail="on"]) #capture {
  position: absolute;
  left: 50%;
  top: -34px;
  transform: translateX(-50%);
  width: 76px;
  height: 76px;
  min-width: 76px;
  min-height: 76px;
  padding: 0;
  z-index: 3;
  border: 4px solid hsl(var(--card));
  box-shadow: 0 0 0 1.5px hsl(var(--primary)), 0 10px 22px -6px hsl(var(--primary) / 0.5);
}
body.scene-only:not([data-rail="on"]) #capture .control-icon { width: 38px; height: 38px; }
/* Phone: the three buttons share one centre line inside a 64px row, so the shutter no longer
   covers the bottom of the map and the map gets the height the taller row used to take. */
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]) #live-controls {
  position: relative;
  z-index: 7;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  gap: 0;
  min-height: 64px;
  height: 64px;
  padding: 0 16px;
}
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]) #live-controls::after { content: none; }
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]) #switch-camera { grid-column: 1; grid-row: 1; }
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]) #leave { grid-column: 3; grid-row: 1; }
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]) #capture {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-width: 3px;
}
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]) #capture .control-icon { width: 30px; height: 30px; }
body.scene-only:not([data-rail="on"]) #camera-controls:not([hidden]) { display: contents; }
body.scene-only:not([data-rail="on"]) #camera-controls button {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  flex: none;
}
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]) :is(#camera-controls button, #leave) {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}
/* Wide layouts: the pill stays centred on the video pane, like the call dock, so dragging the
   video | map divider never moves the buttons. The shutter rises out of the pill over the picture. */
body.scene-only:is([data-ui-mode="tablet"], [data-ui-mode="desktop"]):not([data-rail="on"]) #live-controls {
  min-height: 56px;
  height: 56px;
  bottom: 18px;
  padding: 0;
  display: grid;
  grid-template-columns: 140px 140px;
  justify-content: center;
  align-items: center;
  justify-items: center;
  gap: 0;
}
body.scene-only:is([data-ui-mode="tablet"], [data-ui-mode="desktop"]):not([data-rail="on"]) #live-controls:before {
  bottom: 0;
  width: 280px;
  max-width: calc(100% - 16px);
  height: 56px;
  border-radius: 28px;
}
body.scene-only:is([data-ui-mode="tablet"], [data-ui-mode="desktop"]):not([data-rail="on"]) #capture { top: -10px; }
body.scene-only:is([data-ui-mode="tablet"], [data-ui-mode="desktop"]):not([data-rail="on"]) #switch-camera { grid-column: 1; grid-row: 1; }
body.scene-only:is([data-ui-mode="tablet"], [data-ui-mode="desktop"]):not([data-rail="on"]) #leave { grid-column: 2; grid-row: 1; }

/* Title dropdown: the settings sheet, hung under the title chip instead of centred. */
#details-dialog.is-dropdown {
  position: fixed;
  inset: auto;
  margin: 0;
  left: var(--drop-left, 12px);
  top: var(--drop-top, 64px);
  width: min(340px, calc(100vw - 16px));
  max-height: var(--drop-room, 60dvh);
  padding: 12px 16px 16px;
  border-radius: 14px;
  box-shadow: 0 18px 40px -12px rgb(10 16 32 / 0.45);
}
#details-dialog.is-dropdown::backdrop { background: rgb(0 0 0 / 0.18); backdrop-filter: none; }
#details-dialog.is-dropdown .dialog-head { position: absolute; top: 8px; right: 8px; z-index: 1; }
#details-dialog.is-dropdown .dialog-head .eyebrow,
#details-dialog.is-dropdown h2,
#details-dialog.is-dropdown #session-details-content .card-action label span { display: none; }
#details-dialog.is-dropdown #session-details-content .card-action { padding-top: 6px; }
#details-dialog.is-dropdown #place-label { margin-top: 8px; }
.scene-only #session-details-content .coordinates > span:nth-child(2) { display: none; }

/* Answering by link: one screen of three rows that share the height, so nothing can overlap.
   Top row (close, the sender's note, ⋯), the map taking whatever is left, bottom row (tools and
   the answer field with its send button). The received photo is a small window inside the map
   row; a tap enlarges it over the map and a tap again puts it back. */
.reply-card { overflow: hidden; background: hsl(var(--card)); }
.reply-card .session {
  position: fixed !important;
  inset: var(--rx-y, 0px) 0 auto 0 !important;
  z-index: 20;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: var(--rx-h, 100dvh) !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
}
.reply-card .session > * { min-width: 0; }
.reply-card .session > :not(#rx-top):not(#live-workspace):not(#rx-bar):not(#notice) { display: none !important; }
.reply-card #rx-top { grid-row: 1; }
.reply-card #live-workspace {
  grid-row: 2;
  position: relative !important;
  display: block !important;
  inset: auto !important;
  height: auto !important;
  min-height: 0;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  overflow: hidden;
  background: hsl(var(--muted));
}
.reply-card #rx-bar { grid-row: 3; }
.reply-card #splitter { display: none !important; }
.reply-card #notice {
  position: absolute;
  z-index: 30;
  top: calc(env(safe-area-inset-top, 0px) + 44px);
  left: 8px;
  right: 8px;
  border-radius: 12px;
}
.reply-card #notice[hidden] { display: none; }
.reply-card #map-panel {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}
.reply-card #map-panel > :not(.map-stage) { display: none !important; }
.reply-card .map-stage {
  position: absolute !important;
  inset: 0;
  height: auto !important;
  margin: 0 !important;
  border-radius: 0 !important;
}
.reply-card :is(.map-markup-tools, .map-tools, .map-view-switch, .location-status, .weather-badge) { display: none !important; }

/* The photo window. */
.reply-card #camera-panel {
  position: absolute !important;
  z-index: 3;
  inset: auto auto 8px 8px !important;
  width: auto !important;
  height: 38% !important;
  max-height: 150px;
  aspect-ratio: 4 / 3;
  margin: 0 !important;
  border: 2px solid hsl(var(--card)) !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  cursor: zoom-in;
  background: hsl(var(--muted));
}
/* reply-view.js moves the window to another corner when it would sit on a marker. The right-hand
   bottom corner leaves a strip for the map credit. */
.reply-card #camera-panel[data-corner="br"] { inset: auto 8px 26px auto !important; }
.reply-card #camera-panel[data-corner="tl"] { inset: 8px auto auto 8px !important; }
.reply-card #camera-panel[data-corner="tr"] { inset: 8px 8px auto auto !important; }
/* Enlarged, it leaves a strip below for the map credit. */
.reply-card #camera-panel.is-big {
  inset: 8px 8px 28px !important;
  height: auto !important;
  max-height: none;
  aspect-ratio: auto;
  cursor: zoom-out;
}
.reply-card #camera-panel:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.reply-card #camera-panel > :not(#reply-photo):not(#reply-photo-bg) { display: none !important; }
.reply-photo,
.reply-photo-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.reply-photo { object-fit: cover; }
.reply-card #camera-panel.is-big .reply-photo { object-fit: contain; }
/* Enlarged, the photo's letterbox is filled with a tiny blurred copy of itself. */
.reply-photo-bg {
  display: none;
  object-fit: cover;
  filter: blur(28px) saturate(1.15) brightness(0.62);
  transform: scale(1.15);
}
.reply-card #camera-panel.is-big .reply-photo-bg { display: block; }
@media (orientation: landscape) {
  .reply-typing #camera-panel { display: none; }
}

/* Every control is a 44px square hit area (the visible disc is drawn smaller, inside it), and the
   rows are sized for that, so neighbours never share a touch point. */
.rx-top[hidden],
.rx-bar[hidden],
.rx-left[hidden],
.rx-note-open[hidden],
.rx-menu[hidden],
.rx-count[hidden] { display: none !important; }
.rx-top,
.rx-bar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  background: hsl(var(--card));
}
/* Top row. */
.rx-top {
  box-sizing: border-box;
  height: calc(44px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(4px, env(safe-area-inset-right, 0px)) 0 max(4px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid hsl(var(--border));
}
.rx-ib,
.rx-send,
.rx-note {
  position: relative;
  isolation: isolate;
  padding: 0;
  border: 0;
  background: transparent;
  color: hsl(var(--foreground));
}
/* The visible shape sits behind the icon or text inside the 44px box. */
.rx-ib::before,
.rx-send::before,
.rx-note::before {
  content: "";
  position: absolute;
  z-index: -1;
  background: transparent;
}
.rx-ib,
.rx-send {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.rx-ib::before { inset: 4px; border-radius: 50%; }
.rx-ib:active::before,
.rx-ib.on::before { background: hsl(var(--muted)); }
.rx-ib.sel { color: hsl(var(--primary-foreground)); }
.rx-ib.sel::before { background: hsl(var(--primary)); }
.rx-ib:focus-visible,
.rx-send:focus-visible,
.rx-note:focus-visible { outline-offset: -3px; }
.rx-note {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  font-size: 14px;
  line-height: 44px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rx-note::before { inset: 6px 0; border-radius: 16px; background: hsl(var(--muted)); }
.rx-note.empty,
.rx-note:disabled { opacity: 1; cursor: default; }
.rx-note.empty::before,
.rx-note:disabled::before { background: transparent; }
.rx-left {
  flex: none;
  padding: 2px 8px;
  border: 1px solid #9f1239;
  border-radius: 999px;
  color: #9f1239;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
@media (prefers-color-scheme: dark) {
  .rx-left { border-color: #fda4af; color: #fda4af; }
}
.rx-note-open,
.rx-menu {
  position: absolute;
  z-index: 6;
  top: calc(100% + 2px);
  margin: 0;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 6px 18px rgba(14, 22, 48, 0.18);
}
/* The sender's line, in full: the card allows 80 characters, which is up to five lines on a phone. */
.rx-note-open {
  left: 48px;
  right: 48px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}
@media (max-width: 560px) {
  .rx-note-open { left: 8px; right: 8px; }
}
.rx-menu {
  right: 6px;
  min-width: 170px;
  padding: 4px;
  border-radius: 14px;
}
.rx-menu-item,
.rx-menu-info {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
}
.rx-menu-item { min-height: 44px; color: hsl(var(--foreground)); text-decoration: none; cursor: pointer; }
.rx-menu-item:hover { background: hsl(var(--muted)); }
.rx-menu-info { min-height: 36px; color: hsl(var(--muted-foreground)); font-size: 12.5px; }

/* Bottom row. */
.rx-bar {
  box-sizing: border-box;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
  border-top: 1px solid hsl(var(--border));
}
.reply-typing .rx-bar { height: 56px; padding-bottom: 0; }
.rx-tools { display: flex; flex: none; }
/* On the narrowest phones the undo button only takes room once there is something to undo, so the
   empty field can still read in full. */
@media (max-width: 339px) {
  #rx-tool-undo:disabled { display: none; }
}
/* Typing: the field takes the whole row. The tools have nothing to do while the keyboard is up. */
.reply-typing .rx-tools { display: none; }
.rx-draw-circle,
.rx-draw-arrow { display: none; }
#rx-tool-draw[data-tool="circle"] .rx-draw-pencil,
#rx-tool-draw[data-tool="arrow"] .rx-draw-pencil { display: none; }
#rx-tool-draw[data-tool="circle"] .rx-draw-circle,
#rx-tool-draw[data-tool="arrow"] .rx-draw-arrow { display: block; }
.rx-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 0 0 0 14px;
  border: 1px solid hsl(var(--border));
  border-radius: 22px;
  background: hsl(var(--background));
}
.rx-field:focus-within { border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2); }
.rx-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: hsl(var(--foreground));
  text-overflow: ellipsis;
  /* 16px keeps iOS from zooming the page when the field is focused. */
  font-size: 16px;
}
.rx-field input::placeholder { color: hsl(var(--muted-foreground)); }
.rx-count { flex: none; color: hsl(var(--muted-foreground)); font-size: 11px; white-space: nowrap; }
.rx-send { margin-right: -1px; color: hsl(var(--primary-foreground)); }
.rx-send::before { inset: 6px; border-radius: 50%; background: hsl(var(--primary)); }
.rx-send.off { color: hsl(var(--muted-foreground)); }
.rx-send.off::before { background: hsl(var(--muted)); }
.rx-send[aria-busy="true"] { opacity: 0.6; }
.reply-typing .rx-note-open { display: none; }

/* A card link is loading: a quiet dark screen instead of the bare entry panel. Lifted when the
   card opens (body.reply-card) or when the visit falls back to the landing (expired, failed). */
html[data-entry="reply"] body:not(.reply-card) {
  background: #171b17;
}
html[data-entry="reply"] body:not(.reply-card) > :not(script):not(#notice) {
  visibility: hidden;
}
html[data-entry="reply"] body:not(.reply-card)::after {
  content: "";
  position: fixed;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #d9f99d;
  animation: reply-loading 0.9s linear infinite;
}
@keyframes reply-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  html[data-entry="reply"] body:not(.reply-card)::after { animation: none; }
}
/* Own-location weather is map context, outside the camera and exported card. */
.weather-badge { display: none; }
.scene-only:not(.reply-card) .map-stage { container: map-weather / size; }
.scene-only:not(.reply-card) .weather-badge {
  display: flex;
  align-items: center;
  position: absolute;
  z-index: 4;
  left: 12px;
  bottom: 8px;
  width: max-content;
  min-width: 68px;
  height: 28px;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 4px hsl(var(--foreground) / 0.08);
  pointer-events: none;
  line-height: 18px;
}
.weather-badge svg { flex: 0 0 16px; color: hsl(var(--muted-foreground)); }
.weather-badge strong { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; white-space: nowrap; }
.weather-badge:not([data-state="ready"]) { color: hsl(var(--muted-foreground)); }
.weather-badge[data-state="pending"] [data-weather-icon],
.weather-badge[data-state="pending"] [data-weather-temp] {
  display: block; flex: 0 0 auto; border-radius: 999px; background: hsl(var(--muted));
  animation: weather-skeleton 1.2s ease-in-out infinite alternate;
}
.weather-badge[data-state="pending"] [data-weather-icon] { width: 16px; height: 16px; }
.weather-badge[data-state="pending"] [data-weather-temp] { width: 32px; height: 10px; }
@keyframes weather-skeleton { to { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .weather-badge[data-state="pending"] * { animation: none; } }
.attribution { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 2px 7px; max-width: calc(100% - 24px); }
.attribution a { color: inherit; text-decoration: none; }
.attribution a:hover { text-decoration: underline; }
.attribution a:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; border-radius: 2px; }
.attribution [data-weather-credit] { display: none; font-size: 10px; }
.scene-only:not(.reply-card) .attribution [data-weather-credit]:not([hidden]) { display: inline; }
.scene-only:not(.reply-card) .attribution {
  flex-direction: column;
  align-items: flex-end;
  right: 12px;
  bottom: 8px;
  /* Map width minus the left gutter (12), the widest weather badge (84), an 8px gap and the right gutter (12). */
  max-width: min(calc(50% - 50px), calc(100% - 116px));
  gap: 0;
  padding: 0;
  text-align: right;
  white-space: nowrap;
}
/* Keep the small context badge by the map edge, with the re-center control above it. */
.scene-only:not(.reply-card) .map-stage:has(.weather-badge:not([hidden])) .map-view-switch { left: 12px; bottom: 48px; }
.scene-only:not(.reply-card) .map-stage:has(.weather-badge:not([hidden])) .location-status { bottom: 98px; }
.scene-only:not(.reply-card) .map-stage:has(.weather-badge:not([hidden])):has(#location-status:not([hidden])) .map-message { bottom: 144px; }
@container map-weather (max-height: 180px) {
  .scene-only:not(.reply-card) .map-stage:has(.weather-badge:not([hidden])) .map-view-switch { top: 14px; bottom: auto; left: 94px; }
  .scene-only:not(.reply-card) .map-stage:has(.weather-badge:not([hidden])) .map-view-switch button { width: 32px; height: 32px; min-width: 32px; min-height: 32px; }
  .scene-only:not(.reply-card) .map-stage:has(.weather-badge:not([hidden])) .location-status { bottom: 42px; }
}

/* Explicit nearby-place reading: camera-area editing and DOM-only map chrome. */
.wiki-place-panel {
  /* Only as tall as its content; a long nearby list scrolls inside the camera area. */
  position: absolute; inset: 0 0 auto; max-height: 100%; overflow: auto; overscroll-behavior: contain; z-index: 18; min-width: 0; min-height: 0;
  display: grid; grid-template-rows: auto minmax(0, auto); gap: 6px;
  border-bottom: 1px solid hsl(var(--border)); box-shadow: 0 4px 12px hsl(var(--foreground) / .08);
  padding: 12px 16px; background: hsl(var(--card)); color: hsl(var(--card-foreground));
}
.wiki-panel-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; gap: 8px; }
.wiki-panel-head h2 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; }
.wiki-place-panel button { border: 0; background: transparent; color: hsl(var(--foreground)); border-radius: 6px; font-size: 12px; min-height: 36px; }
.wiki-place-panel .wiki-close, .wiki-place-chip .wiki-close { flex: none; width: 32px; min-width: 32px; padding: 0; font-size: 21px; color: hsl(var(--muted-foreground)); }
#wiki-edit-content { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; }
#wiki-edit-content label { font-size: 11px; color: hsl(var(--muted-foreground)); }
#wiki-input-slot { min-width: 0; }
#wiki-input-slot #place-label { width: 100%; margin: 0; height: 38px; padding: 7px 10px; font-size: 16px; border: 1px solid hsl(var(--input)); border-radius: 6px; background: hsl(var(--background)); color: hsl(var(--foreground)); }
.wiki-edit-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wiki-place-panel #wiki-find-nearby { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid hsl(var(--border)); border-radius: 8px; color: hsl(var(--primary)); font-weight: 500; }
.wiki-place-panel #wiki-find-nearby::before { content: ""; flex: none; width: 15px; height: 15px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11.5a7 7 0 0 1 14 0C19 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11.5a7 7 0 0 1 14 0C19 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.wiki-place-panel #wiki-name-done { padding: 6px 16px; border-radius: 8px; font-weight: 500; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
#wiki-nearby-content { overflow: auto; min-height: 0; overscroll-behavior: contain; }
#wiki-nearby-status { font-size: 12px; color: hsl(var(--muted-foreground)); margin: 4px 0 8px; }
#wiki-nearby-status:empty { display: none; }
.wiki-place-result { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; padding: 9px 0; min-height: 44px !important; text-align: left; border-top: 1px solid hsl(var(--border)) !important; border-radius: 0 !important; }
.wiki-place-result > span:first-child { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.wiki-place-distance { flex: none; font-size: 11px; font-variant-numeric: tabular-nums; color: hsl(var(--muted-foreground)); }
#wiki-nearby-back { color: hsl(var(--muted-foreground)); padding: 6px 0; margin-top: 4px; font-size: 12px; }
.wiki-place-pin { position: absolute; z-index: 5; transform: translate(-50%, -80%); display: grid; place-items: center; width: 40px; height: 40px; min-width: 40px; padding: 8px; border: 0; background: transparent; color: hsl(var(--primary)); touch-action: manipulation; }
.wiki-place-pin svg { overflow: visible; fill: hsl(var(--card)); filter: drop-shadow(0 1px 2px hsl(var(--foreground) / .22)); }
.wiki-place-chip { position: absolute; z-index: 6; display: flex; align-items: center; gap: 5px; height: 36px; padding: 0 2px 0 9px; border: 1px solid hsl(var(--border)); border-radius: 6px; background: hsl(var(--card)); color: hsl(var(--card-foreground)); box-shadow: 0 1px 4px hsl(var(--foreground) / .07); }
.wiki-place-chip strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; }
.wiki-place-chip button { flex: none; border: 0; border-radius: 4px; padding: 0 3px; min-height: 32px; background: transparent; color: hsl(var(--primary)); font-size: 11px; white-space: nowrap; }
.wiki-place-chip .wiki-close { width: 25px; min-width: 25px; font-size: 18px; }
#wiki-article-dialog { width: min(400px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 18px 20px; overflow: auto; overscroll-behavior: contain; border: 1px solid hsl(var(--border)); border-radius: 12px; }
#wiki-article-dialog::backdrop { background: hsl(var(--foreground) / .32); }
#wiki-article-dialog .dialog-head { margin-bottom: 20px; font-size: 12px; color: hsl(var(--muted-foreground)); }
#wiki-article-dialog h2 { margin: 0 0 12px; font-size: 24px; overflow-wrap: anywhere; }
#wiki-article-extract { font-size: 14px; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
#wiki-article-extract:empty { display: none; }
#wiki-article-status { font-size: 13px; color: hsl(var(--muted-foreground)); }
.wiki-article-credits { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 16px 0; font-size: 11px; }
.wiki-article-credits a { color: hsl(var(--primary)); text-underline-offset: 3px; overflow-wrap: anywhere; }
#wiki-adopt-name { margin-top: 12px; font-size: 13px; }
.wiki-article-back { display: block; margin: 6px auto 0; min-height: 38px; padding: 5px 12px; border: 0; border-radius: 6px; background: transparent; color: hsl(var(--muted-foreground)); font-size: 12px; }
@media (pointer: coarse) {
  .wiki-panel-head { min-height: 36px; }
  .wiki-place-panel { padding: 6px 12px; gap: 4px; }
  .wiki-place-panel button { min-height: 44px; }
  .wiki-place-panel .wiki-close { width: 44px; min-width: 44px; }
  .wiki-place-pin { width: 44px; height: 44px; }
  .wiki-place-chip { height: 44px; }
  .wiki-place-chip button { min-height: 42px; }
  .wiki-place-chip .wiki-close { width: 44px; min-width: 44px; }
  #wiki-article-dialog .dialog-head button { min-width: 44px; min-height: 44px; border-radius: 6px; }
  .wiki-article-back { min-height: 44px; }
  .wiki-article-credits a { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-height: 420px) { .wiki-place-panel { padding-top: 4px; padding-bottom: 4px; } #wiki-edit-content label { display: none; } .wiki-panel-head { min-height: 28px; } #wiki-article-dialog { padding: 12px 16px; } #wiki-article-dialog .dialog-head { margin-bottom: 8px; } }

.wiki-place-leader { position: absolute; z-index: 4; height: 1px; background: hsl(var(--primary)); transform-origin: 0 50%; pointer-events: none; }

/* Planner embed (html[data-embed="planner"], ~515x203 / 600x240): a compact cockpit. The dock,
   shutter, chip and map tools shrink so the camera keeps >=70% of its pane and the map tools stop
   colliding on a ~220px-wide map. Zoom +/- hides here (wheel/pinch still zoom). Standalone app untouched. */
html[data-embed="planner"] body.scene-only:not([data-rail="on"]) #live-controls {
  position: absolute !important;
  left: 0; bottom: 6px !important; top: auto;
  width: var(--camera-size, 57%) !important;
  min-height: 40px !important; height: 40px !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: 56px 52px 56px !important;
  justify-content: center !important;
  align-items: center !important;
  justify-items: center !important;
  gap: 0 !important;
  background: transparent !important;
  border: 0 !important;
  z-index: 7;
}
html[data-embed="planner"] body.scene-only:not([data-rail="on"]) #live-controls::before {
  content: "" !important;
  left: 50% !important; right: auto !important; bottom: 0 !important; top: auto !important;
  transform: translateX(-50%) !important;
  width: 164px !important; max-width: calc(100% - 12px) !important;
  height: 40px !important; border-radius: 20px !important;
}
html[data-embed="planner"] body.scene-only:not([data-rail="on"]) #live-controls::after { content: none !important; }
html[data-embed="planner"] body.scene-only:not([data-rail="on"]) #switch-camera { grid-column: 1 !important; grid-row: 1 !important; }
html[data-embed="planner"] body.scene-only:not([data-rail="on"]) #capture {
  position: relative !important; left: auto !important; top: auto !important; transform: none !important;
  grid-column: 2 !important; grid-row: 1 !important; margin: 0 !important;
  width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important;
  border-width: 3px !important;
}
html[data-embed="planner"] body.scene-only:not([data-rail="on"]) #capture .control-icon { width: 22px !important; height: 22px !important; }
html[data-embed="planner"] body.scene-only:not([data-rail="on"]) #leave { grid-column: 3 !important; grid-row: 1 !important; }
html[data-embed="planner"] body.scene-only:not([data-rail="on"]) :is(#camera-controls button, #leave) {
  width: 32px !important; height: 32px !important; min-width: 32px !important; min-height: 32px !important;
}
html[data-embed="planner"] body.scene-only:not([data-rail="on"]) :is(#camera-controls button, #leave) .control-icon { width: 18px !important; height: 18px !important; }
/* Place-name chip */
html[data-embed="planner"] .scene-only #scene-title-button { min-height: 28px !important; padding: 2px 2px 2px 10px !important; max-width: calc(100% - 16px); }
html[data-embed="planner"] .scene-only #scene-frame-title { font-size: 13px !important; }
html[data-embed="planner"] .scene-only .scene-title-pen { width: 24px !important; height: 24px !important; min-width: 24px !important; }
html[data-embed="planner"] .scene-only .scene-title-pen svg { width: 14px; height: 14px; }
/* Map side */
html[data-embed="planner"] body.split-active .map-tools:has(#zoom-in) #zoom-in,
html[data-embed="planner"] body.split-active #zoom-out { display: none !important; }
html[data-embed="planner"] body.split-active .map-tools { top: 6px !important; right: 6px !important; gap: 4px !important; padding: 0 !important; }
html[data-embed="planner"] body.split-active .map-markup-tools {
  top: 6px !important; left: 6px !important; right: auto !important; transform: none !important; gap: 0 !important; padding: 0 !important;
}
html[data-embed="planner"] body.split-active :is(.map-tools, .map-markup-tools) button,
html[data-embed="planner"] body.split-active .map-view-switch button {
  width: 30px !important; height: 30px !important; min-width: 30px !important; min-height: 30px !important; padding: 0 !important;
}
html[data-embed="planner"] body.split-active :is(.map-tools, .map-markup-tools, .map-view-switch) svg { width: 16px !important; height: 16px !important; }
html[data-embed="planner"] body.split-active .map-view-switch { min-height: 0 !important; padding: 0 !important; }
html[data-embed="planner"] .scene-only:not(.reply-card) .weather-badge {
  left: 6px !important; bottom: 6px !important; min-width: 0 !important; height: 24px !important; padding: 2px 6px !important; gap: 3px !important;
}
html[data-embed="planner"] .weather-badge svg { flex-basis: 12px !important; width: 12px; height: 12px; }
html[data-embed="planner"] .weather-badge strong { font-size: 12px !important; }
html[data-embed="planner"] .scene-only:not(.reply-card) .attribution { right: 6px !important; bottom: 4px !important; }

/* ---- Scene redesign (2026-10-29, docs/mockups/2026-10-29-maptalk-scene-redesign.html) ----
   Everything that floats over the picture or the map is the same glass; the map keeps one corner for buttons
   (a vertical rail on the right); the moment's weather rides in the title chip; the crop is shown by its corners. */
.scene-only {
  --scene-glass: rgb(18 18 22 / 0.72);
  --scene-glass-ink: #f3f0e8;
}
/* The crop: four corner marks instead of a hairline round the whole frame (which read as a broken border). */
.scene-only #scene-frame-overlay {
  --corner: rgb(255 255 255 / 0.85);
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.42);
  background:
    linear-gradient(var(--corner), var(--corner)) left top / 18px 2px no-repeat,
    linear-gradient(var(--corner), var(--corner)) left top / 2px 18px no-repeat,
    linear-gradient(var(--corner), var(--corner)) right top / 18px 2px no-repeat,
    linear-gradient(var(--corner), var(--corner)) right top / 2px 18px no-repeat,
    linear-gradient(var(--corner), var(--corner)) left bottom / 18px 2px no-repeat,
    linear-gradient(var(--corner), var(--corner)) left bottom / 2px 18px no-repeat,
    linear-gradient(var(--corner), var(--corner)) right bottom / 18px 2px no-repeat,
    linear-gradient(var(--corner), var(--corner)) right bottom / 2px 18px no-repeat;
}
/* Glass for the title chip, the 0.5× lens and the mailbox pill on the picture. */
.scene-only #scene-title-button,
.scene-only .camera-wide:not([aria-pressed="true"]),
.scene-only:not(.reply-card) .place-near:not([hidden]) {
  border-color: transparent;
  background: var(--scene-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--scene-glass-ink);
}
/* The weather of the moment, inside the title chip after a thin divider (it is not drawn on the picture itself). */
.scene-only:not(.reply-card) #scene-title-button .weather-badge:not([hidden]) {
  position: static;
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 4px;
  width: auto;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0 2px 0 8px;
  border: 0;
  border-left: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: rgb(255 255 255 / 0.86);
  line-height: 1.2;
}
.scene-only #scene-title-button .weather-badge[hidden] { display: none; }
.scene-only #scene-title-button .weather-badge svg { flex: 0 0 14px; width: 14px; height: 14px; color: inherit; }
.scene-only #scene-title-button .weather-badge strong { font-size: 13.5px; font-weight: 600; }
.scene-only #scene-title-button .weather-badge[data-state="pending"] :is([data-weather-icon], [data-weather-temp]) { background: rgb(255 255 255 / 0.2); }
.scene-only #scene-title-button .weather-badge:not([data-state="ready"]) { color: rgb(255 255 255 / 0.6); }
/* The pen toggle exists only where its tools fold away (the phone scene below). */
#map-markup-toggle { display: none; }

/* Phone scene: one vertical rail at the top right of the map (+, −, the pen); circle and arrow open beside the pen. */
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]):not(.reply-card) .map-tools {
  top: 12px;
  right: 12px;
  left: auto;
  bottom: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--scene-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.22);
}
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]):not(.reply-card) .map-tools button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent;
  color: var(--scene-glass-ink);
  font-size: 22px;
  line-height: 1;
}
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]):not(.reply-card) .map-tools button[hidden] { display: none; }
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]):not(.reply-card) .map-tools button + button { border-top: 1px solid rgb(255 255 255 / 0.1) !important; }
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]):not(.reply-card) #map-markup-toggle { display: grid; }
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]):not(.reply-card) #map-markup-toggle[aria-expanded="true"] { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]):not(.reply-card) #map-markup-toggle:disabled { opacity: 0.45; }
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]):not(.reply-card) .map-markup-tools:not(.is-open) { display: none !important; }
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]):not(.reply-card) .map-markup-tools.is-open {
  top: 100px; /* level with the pen: the rail's 12px top plus two 44px buttons */
  right: 64px;
  left: auto;
  bottom: auto;
  transform: none;
  display: flex;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: none;
  box-shadow: none;
}
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]):not(.reply-card) .map-markup-tools.is-open button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 14px !important;
  background: var(--scene-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--scene-glass-ink);
}
body.scene-only[data-ui-mode="mobile"]:not([data-rail="on"]):not(.reply-card) .map-markup-tools.is-open button[aria-pressed="true"] {
  color: hsl(var(--primary));
  box-shadow: inset 0 0 0 2px hsl(var(--primary));
}
/* Sources stay, but quietly: no white block on the dark screen. Without the weather badge they fit on one line. */
.scene-only:not(.reply-card) .attribution {
  flex-direction: row;
  align-items: baseline;
  gap: 0 6px;
  right: 8px;
  bottom: 6px;
  max-width: calc(100% - 16px);
  padding: 1px 5px;
  border-radius: 4px;
  background: rgb(255 255 255 / 0.55);
  color: rgb(30 30 30 / 0.7);
  font-size: 9.5px;
  line-height: 1.4;
}
.scene-only:not(.reply-card) .attribution [data-weather-credit]:not([hidden]) { font-size: inherit; }
/* The shutter: a white ring round a filled centre, no glyph inside (the countdown number still shows there). */
body.scene-only:not([data-rail="on"]) #capture {
  border: 4px solid #fff !important;
  background: hsl(var(--primary));
  box-shadow: inset 0 0 0 3px hsl(var(--card)), 0 0 0 1px rgb(0 0 0 / 0.35), 0 8px 20px -8px hsl(var(--primary) / 0.6);
}
body.scene-only:not([data-rail="on"]) #capture .control-icon { display: none; }
