.activity-map-form { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; margin-top: 24px; }
.activity-map-form .calc-field { margin: 0; min-width: 160px; }
.activity-coordinate-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; flex: 0 1 216px; min-width: 192px; }
.activity-map-form .activity-coordinate-field { min-width: 0; max-width: none; }
.activity-map-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.activity-map-toolbar label, .activity-map-toolbar output { font-size: 14px; }
.activity-map-toolbar input { accent-color: var(--primary); max-width: 180px; }
.activity-map-scroll { max-height: 600px; background: #e7e3d3; }
.activity-map-scroll .map-stage { line-height: 0; }
.activity-map-range { position: absolute; border: 3px solid #ef3029; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 80%); background: rgb(239 48 41 / 8%); z-index: 2; pointer-events: none; }
.activity-map-form button:disabled { color: var(--secondary); background: var(--border); }
@media (max-width: 767px) { .activity-map-form .calc-field { flex: 1 1 100%; min-width: 0; max-width: none; } .activity-map-form > button { flex: 1; } .activity-map-scroll { max-height: 480px; } }

#activity-map-highlight { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.activity-map-experience { position: absolute; background: rgb(185 24 32 / 38%); pointer-events: none; z-index: 1; }
.activity-map-scroll .map-marker { z-index: 3; }
.activity-highlight-control { margin-top: 20px; }
.activity-switch { display: inline-flex; gap: 10px; align-items: center; min-height: 44px; padding: 4px 0; border: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.activity-switch-track { display: inline-flex; align-items: center; width: 44px; height: 26px; padding: 3px; border: 1px solid var(--control-border, #64856d); border-radius: 20px; background: #e3e9d8; flex: none; }
.activity-switch-track span { width: 18px; height: 18px; border-radius: 50%; background: #506960; }
.activity-switch[aria-checked="true"] .activity-switch-track { background: var(--primary); }
.activity-switch[aria-checked="true"] .activity-switch-track span { margin-left: auto; background: #fffefa; }
.activity-switch:disabled { opacity: .6; cursor: default; }
.activity-switch-note { font-size: 14px; color: var(--secondary, #516354); }
#activity-highlight-status { font-size: 14px; color: var(--secondary, #516354); }
@media (max-width: 767px) { .activity-coordinate-group { flex: 1 1 100%; min-width: 0; } }

.ghost-live { margin-block: 14px 20px; padding: 10px 14px; border-radius: 6px; background: var(--recognition, #e1eef0); }
.ghost-live summary { cursor: pointer; font-weight: 700; }
.ghost-live p { margin: 10px 0; }
.ghost-live-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ghost-preview { position: relative; width: fit-content; max-width: 100%; padding: 0; border: 0; background: #202c29; }
.ghost-preview video { display: block; width: auto; height: auto; max-width: 100%; max-height: 320px; }
.ghost-preview-label { position: absolute; inset: auto 6px 6px auto; border-radius: 4px; padding: 2px 8px; background: #202c29; color: #fffefa; font-size: 13px; }
.ghost-selection { position: absolute; outline: 2px solid #ffce70; outline-offset: -2px; background: rgb(255 206 112 / 15%); pointer-events: none; }

body[data-activity-map="ghost"] .activity-map-form { gap: 8px 12px; margin-top: 12px; }
body[data-activity-map="ghost"] #activity-loading:empty,
#activity-highlight-status:empty,
#ghost-live-status:empty { margin: 0; }
.ghost-coordinate-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; margin-block: 8px 4px; }
.ghost-coordinate-status p { margin: 0; font-size: 14px; }
.ghost-coordinate-status #activity-message { font-weight: 500; }
.ghost-map-tools { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; }
.ghost-map-tools .activity-highlight-control,
.ghost-map-tools .activity-map-toolbar { margin: 0; }
.ghost-map-tools + #activity-highlight-status:not(:empty) { margin-block: 2px 6px; }
.ghost-live { margin-block: 10px 12px; padding: 8px 12px; }
.ghost-live summary { min-height: 36px; padding-block: 5px; }
.ghost-live-content { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 20px; }
.ghost-live-controls { flex: 1 1 228px; min-width: 0; }
.ghost-live-controls p { margin: 4px 0 8px; }
.ghost-live-actions { gap: 6px 8px; }
.ghost-preview { flex: 0 0 auto; max-width: min(100%, 420px); }
.ghost-preview video { max-height: 240px; }
.ghost-picker {
  width: min(1200px, calc(100vw - 24px)); max-width: none;
  max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
  padding: 14px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); background: var(--surface);
}
.ghost-picker::backdrop { background: #192b28c9; }
.ghost-picker-heading, .ghost-picker-tools { display: flex; align-items: center; gap: 8px 12px; }
.ghost-picker-heading { justify-content: space-between; }
.ghost-picker-heading h2 { margin: 0; font-size: 21px; }
.ghost-picker-heading button { flex: none; }
.ghost-picker-tools { flex-wrap: wrap; margin-top: 8px; }
.ghost-picker-tools select { padding: 6px 8px; min-height: 44px; border: 1px solid var(--control-border); border-radius: 5px; background: var(--surface); color: var(--text); font: inherit; }
.ghost-picker-tools button[aria-pressed="true"] { color: var(--primary); background: var(--active); }
.ghost-picker #ghost-picker-status { margin: 6px 0 8px; font-size: 14px; }
.ghost-picker-stage {
  height: min(68vh, 740px); overflow: auto; overscroll-behavior: contain;
  scrollbar-color: var(--control-border) #202c29; background: #202c29;
  touch-action: none; user-select: none;
}
.ghost-picker-stage[data-ready] { cursor: crosshair; }
.ghost-picker-stage[data-pan] { cursor: grab; }
.ghost-picker-stage[data-pan][data-dragging] { cursor: grabbing; }
.ghost-picker-canvas { display: grid; place-items: center; width: max-content; height: max-content; min-width: 100%; min-height: 100%; }
.ghost-picker-frame { position: relative; overflow: hidden; }
.ghost-picker-frame video { display: block; width: 100%; height: 100%; pointer-events: none; }
body[data-activity-map="ghost"] .activity-map-scroll { margin-top: 4px; }
@media (max-width: 767px) {
  .ghost-preview { max-width: 100%; }
  .ghost-live summary { min-height: 44px; }
  .ghost-live-controls { flex-basis: 100%; }
  .ghost-picker { padding: 10px; }
  .ghost-picker-stage { height: min(62vh, 65dvh); }
}
