/* Expedition Planner Styles — Aperture22 */

:root {
  /* CSS-injected icon glyphs: the same paths as icons.js (check, where-you-stood, pending). */
  --a22-mask-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --a22-mask-pending: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0M12 7v5l3.5 2'/%3E%3C/svg%3E");
  --a22-img-check-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --a22-img-camera-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3.2l1.6-2.5h6.4L16.8 8H20a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1zM8.5 13a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0'/%3E%3C/svg%3E");
  /* Packing list checkbox dimensions */
  --packing-checkbox-width: 18px;
  --packing-checkbox-gap: 8px;
  /* Accent RGB components for rgba() usage in animations/transparent borders */
  --accent-fill-rgb: 224, 130, 26;
}
[data-theme="dark"] {
  --accent-fill-rgb: 212, 134, 42;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: var(--font-primary);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  min-height: 100vh;
}

/* Remove old header styles - now using shared navbar */

/* Main Layout */
.planner-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.auth-required {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-secondary);
}

.auth-required a {
  color: var(--color-text-primary);
  text-decoration: underline;
}

.planner-container {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 24px;
  align-items: start;
}

/* Left Panel: Form */
.planner-form-panel {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.planner-form-panel h2 {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  color: var(--color-text-primary);
  font-weight: 600;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.required {
  color: var(--color-error);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.875rem;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input[type="text"]::placeholder,
.form-group input[type="url"]::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-tertiary);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--color-text-primary);
  cursor: pointer;
  padding: 4px 0;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-fill);
}

/* Trip type checkboxes rendered as toggleable pills (matches the App's
   coaching focus button pattern). Browsers without :has() keep the plain
   checkbox layout above. */
@supports selector(:has(input:checked)) {
  .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .checkbox-group .checkbox-label {
    justify-content: center;
    padding: 7px 15px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-pill);
    transition: all 0.2s ease;
    user-select: none;
  }

  .checkbox-group .checkbox-label input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }

  .checkbox-group .checkbox-label:hover {
    color: var(--color-text-primary);
    background: var(--bg-subtle);
    border-color: var(--accent-fill);
  }

  .checkbox-group .checkbox-label:has(input:checked) {
    color: var(--accent-on-tint);
    background: var(--accent-light);
    border-color: var(--accent-fill-strong);
  }

  .checkbox-group .checkbox-label:has(input:focus-visible) {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
    border-color: var(--accent-fill);
  }
}

/* ── Keyboard focus ───────────────────────────────────────────────────────
   Every button family below shipped with no focus style at all, so keyboard
   focus was invisible across the whole planner. One ring, matching the
   canonical pill's :has(input:focus-visible) treatment above. Grouped rather
   than declared per-rule so the families cannot drift apart again. */
.shoot-type-btn:focus-visible,
.output-format-btn:focus-visible,
.venue-toggle-btn:focus-visible,
.ie-toggle-btn:focus-visible,
.pack-weight-btn:focus-visible,
.gear-mode-btn:focus-visible,
.gear-intent-summary:focus-visible,
.gear-intent-state-btn:focus-visible,
.provider-btn:focus-visible,
.subplanner-class-pill:focus-visible,
.subplanner-span-pill:focus-visible,
.subplanner-meal-pill:focus-visible,
.subplanner-mode-pill:focus-visible,
.subplanner-tile-btn:focus-visible,
.subplanner-maptype-btn:focus-visible,
.plan-nav-pill:focus-visible,
.status-btn:focus-visible,
.add-day-btn:focus-visible,
.preflight-btn:focus-visible,
.back-to-edit-btn:focus-visible,
.archived-toggle-btn:focus-visible,
.subplanner-place-search:focus-visible,
.subplanner-map-expand:focus-visible,
.subplanner-day-preview:focus-visible,
.subplanner-day-preview-stop:focus-visible,
.subplanner-day-preview-speed:focus-visible,
.generate-btn:focus-visible,
.preflight-modal-footer .btn-primary:focus-visible,
.preflight-modal-footer .btn-secondary:focus-visible,
.subplanner-actions .btn-primary:focus-visible,
.subplanner-actions .btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
  border-color: var(--accent-fill);
}

.export-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow), 0 1px 2px rgba(0, 0, 0, 0.04);
  border-color: var(--accent-fill);
}

/* Tabs carry their state in border-bottom, so the ring must not repaint the
   border. Destructive actions ring in the error tone — an accent ring on a
   delete reads as "selected". */
.plan-tab-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.delete-btn:focus-visible,
.day-remove-btn:focus-visible {
  outline: 2px solid var(--color-error);
  outline-offset: 2px;
}

.generate-btn {
  width: 100%;
  padding: 12px 16px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--accent-on);
  background: var(--accent-fill);
  border: 1px solid var(--accent-fill);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.generate-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.generate-btn:disabled {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.generate-btn.success {
  background: var(--color-success);
}

.generate-btn.success:hover {
  background: var(--color-success);
  filter: brightness(0.9);
}

@keyframes generatePulse {
  0%   { box-shadow: 0 0 0 0 rgba(75, 85, 99, 0); }
  50%  { box-shadow: 0 0 0 6px rgba(75, 85, 99, 0.18); }
  100% { box-shadow: 0 0 0 0 rgba(75, 85, 99, 0); }
}

.generate-btn.generating {
  animation: generatePulse 1.8s ease-in-out infinite;
}

/* Save Draft (2026-08-16) — the secondary half of the action pair: same
   metrics as Generate, outline treatment so it never competes with it. It
   is never gated on Pre-Flight (a draft may be incomplete by definition), so
   it carries no :disabled state beyond the in-flight save. */
.save-draft-btn {
  padding: 12px 16px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-heading);
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.save-draft-btn:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}

.save-draft-btn:disabled { opacity: 0.6; cursor: progress; }

.save-draft-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
  border-color: var(--accent-fill);
}

/* Start a new plan (plan-identity redesign, Requirement 2) — the deliberate
   sever. Quieter than Save Draft: it is a way out, not an action to invite. */
.new-plan-btn {
  padding: 12px 14px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.new-plan-btn[hidden] { display: none; }

.new-plan-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--border-input);
  color: var(--text-heading);
}

.new-plan-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
  border-color: var(--accent-fill);
}

.save-draft-btn.saved {
  color: var(--color-success);
  border-color: var(--color-success);
}

/* Autosave visibility (2026-08-17): the background save used to leave no
   trace at all, which is how a wrong write target went unnoticed. Same
   status-line treatment as #preflight-status — a full-width line above the
   button row, contributing no box while [hidden]. */
.draft-autosave-status {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.draft-autosave-status.is-saved { color: var(--color-success); }
.draft-autosave-status.is-suspended { color: var(--text-secondary); }
.draft-autosave-status.is-conflict { color: var(--color-text-primary); font-weight: 600; }
.draft-conflict-reopen {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent-primary);
  text-decoration: underline;
  cursor: pointer;
}

/* Right Panel: Output */
.planner-output-panel {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  min-height: 400px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.loading-state {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px auto;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state p {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.error-state {
  padding: 20px;
  background: rgba(193, 58, 37, 0.10);
  border: 1px solid rgba(193, 58, 37, 0.3);
  border-radius: 8px;
  color: var(--color-error);
}

/* Plan Display */
.plan-display {
  color: var(--color-text-primary);
}

.plan-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.plan-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Accordion Styles */
.planner-section-header {
  cursor: pointer;
  padding: 10px;
  font-weight: bold;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, border-color 0.2s;
}

.planner-section-header:hover {
  background: var(--bg-subtle);
  border-color: var(--color-border-input);
}

.planner-section-body {
  padding: 10px;
  animation: accordionReveal 0.25s ease;
}

/* Plays each time the section body is un-hidden (display toggles re-trigger animations) */
@keyframes accordionReveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none;
}

.plan-section h3 {
  margin: 0 0 16px 0;
  font-size: 1.25rem;
  color: var(--color-text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-section h4 {
  margin: 16px 0 8px 0;
  font-size: 1.125rem;
  color: var(--color-text-primary);
  font-weight: 600;
}

.plan-section p {
  margin: 0 0 12px 0;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.plan-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plan-list li {
  margin-bottom: 12px;
  padding-left: 24px;
  position: relative;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.plan-list li::before {
  content: "•";
  position: absolute;
  left: 8px;
  color: var(--color-text-tertiary);
  font-weight: bold;
}

.packing-item {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  transition: opacity 0.2s, border-color 0.2s;
}

.packing-item.packed {
  opacity: 0.6;
  border-color: var(--accent-fill);
}

.packing-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--packing-checkbox-gap);
  cursor: pointer;
  width: 100%;
}

.packing-checkbox {
  width: var(--packing-checkbox-width);
  height: var(--packing-checkbox-width);
  cursor: pointer;
  accent-color: var(--accent-fill);
  flex-shrink: 0;
}

.packing-item-header {
  display: flex;
  align-items: center;
  gap: var(--packing-checkbox-gap);
  margin-bottom: 4px;
}

.packing-item-name {
  font-weight: 600;
  color: var(--color-text-primary);
  transition: text-decoration 0.2s;
}

.packing-item.packed .packing-item-name {
  text-decoration: line-through;
}

.packing-item-reason {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-left: calc(var(--packing-checkbox-width) + var(--packing-checkbox-gap)); /* Checkbox width + gap */
}

.location-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  transition: opacity 0.2s, border-left 0.2s;
}

.location-card.completed {
  opacity: 0.6;
  border-left: 3px solid var(--accent-fill);
}

.location-header {
  margin-bottom: 12px;
}

.location-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.location-meta {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.shot-idea {
  background: var(--color-bg-surface);
  border-left: 3px solid var(--color-accent);
  padding: 12px;
  margin: 8px 0;
  border-radius: 4px;
}

.shot-idea-desc {
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.shot-idea-settings {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.shot-idea-tip {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-style: italic;
}
.shot-idea-text { display: contents; }
.shot-idea-revised { padding: 2px 8px; margin-left: -8px; margin-right: -8px; border-radius: var(--radius-lg); background: rgba(var(--accent-fill-rgb), 0.08); }
.shot-idea-revised-head { margin-bottom: 6px; }
.shot-orig-toggle {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 2px 6px; border: none; border-radius: var(--radius-lg);
  background: none; color: var(--accent-primary); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.shot-orig-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.shot-idea-original [data-shot-orig] { margin-top: 6px; }

.location-complete-btn {
  margin-top: 12px;
  width: 100%;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-heading);
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  font-family: inherit;
}

.location-complete-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}

.location-card.completed .location-complete-btn {
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}

/* Shot card done toggle — .location-complete-btn's pattern one level down,
   compact because it sits inside the card, not at its foot. */
.shot-done-toggle {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: inherit;
}

.shot-done-toggle:hover {
  background: var(--bg-subtle);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}

.shot-done-toggle.done {
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}

.warning {
  background: rgba(193, 58, 37, 0.10);
  border: 1px solid rgba(193, 58, 37, 0.3);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--color-error);
}

.itinerary-day {
  margin-bottom: 20px;
}

.schedule-item {
  background: var(--color-bg-secondary);
  border-left: 3px solid var(--color-accent);
  padding: 10px 12px;
  margin: 6px 0;
  border-radius: 4px;
  font-size: 0.875rem;
}

.schedule-time {
  font-weight: 600;
  color: var(--color-text-secondary);
}

.schedule-location {
  color: var(--color-text-primary);
  font-weight: 500;
}

.schedule-activity {
  color: var(--color-text-secondary);
}

.challenge-item {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.challenge-title {
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.challenge-why {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .planner-container {
    grid-template-columns: 1fr;
  }

  .planner-form-panel {
    position: static;
    max-height: none;
  }

  .checkbox-group {
    grid-template-columns: 1fr;
  }

  .planner-output-panel {
    padding: 20px;
  }
}

/* Scrollbar styling for webkit browsers */
.planner-form-panel::-webkit-scrollbar {
  width: 8px;
}

.planner-form-panel::-webkit-scrollbar-track {
  background: var(--bg-subtle);
  border-radius: 4px;
}

.planner-form-panel::-webkit-scrollbar-thumb {
  background: var(--color-border-input);
  border-radius: 4px;
}

.planner-form-panel::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-focus);
}

/* My Plans Section */
/* ── Demo showcase banner ─────────────────────────────────────────────────── */
/* display:flex beats the UA [hidden] rule, so the attribute needs its own
   rule (same pattern as every other [hidden] override in this file). */
.demo-plans-banner[hidden] { display: none; }
.demo-plans-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto 24px auto;
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg,
    rgba(var(--accent-fill-rgb), 0.16),
    rgba(var(--accent-fill-rgb), 0.06));
  border: 1px solid rgba(var(--accent-fill-rgb), 0.32);
}

.demo-plans-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--color-text-primary);
  font-size: 0.95rem;
}

.demo-plans-banner-text strong {
  font-weight: 600;
}

.demo-plans-banner-text span {
  color: var(--color-text-secondary);
  font-size: 0.88rem;
}

.demo-plans-banner-btn {
  flex-shrink: 0;
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--accent-fill);
  border: 1px solid var(--accent-fill);
  color: var(--accent-on);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.demo-plans-banner-btn:hover {
  filter: brightness(1.08);
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

@media (max-width: 600px) {
  .demo-plans-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .demo-plans-banner-btn {
    text-align: center;
  }
}

/* Locked action buttons in demo mode — keep visible but clearly inert */
button.demo-locked:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Session-expired state in My Plans ────────────────────────────────────── */
.plans-session-expired {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.plans-session-expired a,
.plans-session-expired-signin {
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: underline;
}

/* ── Recent Plans anchor (top-of-form shortcut) ───────────────────────────── */
.recent-plans-anchor {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(var(--accent-fill-rgb), 0.08);
  border: 1px solid rgba(var(--accent-fill-rgb), 0.22);
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.recent-plans-anchor:hover {
  background: rgba(var(--accent-fill-rgb), 0.14);
  border-color: rgba(var(--accent-fill-rgb), 0.38);
}

@keyframes recentAnchorPulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--accent-fill-rgb), 0);    background: rgba(var(--accent-fill-rgb), 0.08); }
  35%  { box-shadow: 0 0 0 6px rgba(var(--accent-fill-rgb), 0.2); background: rgba(var(--accent-fill-rgb), 0.2);  }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-fill-rgb), 0);    background: rgba(var(--accent-fill-rgb), 0.08); }
}

.recent-plans-anchor--pulse {
  animation: recentAnchorPulse 2s ease-in-out 1 forwards;
}

.my-plans-section {
  max-width: 1400px;
  margin: 40px auto 0 auto;
  padding: 0 20px;
}

.my-plans-section h2 {
  font-size: 1.75rem;
  color: var(--color-text-primary);
  font-weight: 600;
  margin-bottom: 24px;
}

.plans-loading,
.plans-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-secondary);
}

.plans-group {
  margin-bottom: 32px;
}

.plans-group h3 {
  font-size: 1.25rem;
  color: var(--color-text-primary);
  font-weight: 600;
  margin-bottom: 16px;
}

.plans-list {
  display: grid;
  gap: 16px;
}

.plan-card {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s ease;
}

.plan-card:hover {
  border-color: var(--color-border-input);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.plan-card.expanded:hover {
  transform: none;
  box-shadow: none;
}

.plan-card.expanded {
  cursor: default;
}

.plan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.plan-card-title {
  flex: 1;
}

.plan-card-title h4 {
  font-size: 1.125rem;
  color: var(--color-text-primary);
  font-weight: 600;
  margin: 0 0 4px 0;
}

.plan-card-meta {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
}

.plan-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.planned {
  background: rgba(46, 111, 191, 0.12);
  color: var(--color-info);
  border: 1px solid rgba(46, 111, 191, 0.3);
}

.status-badge.completed {
  background: var(--accent-light);
  color: var(--color-success);
  border: 1px solid rgba(var(--accent-fill-rgb), 0.3);
}

.status-badge.archived {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Sprint 2.5 Part 2, PR C.1 — 7-state lifecycle badges. Design-pass
   conformance (Build Step 18): in-progress states read as --color-info,
   matching the mid-lifecycle "in motion" language established elsewhere;
   terminal states (uploaded/completed) stay on the success/accent language
   above, archived/generating stay muted-neutral. */
.status-badge.packing,
.status-badge.en_route,
.status-badge.shooting,
.status-badge.editing {
  background: rgba(46, 111, 191, 0.12);
  color: var(--color-info);
  border: 1px solid rgba(46, 111, 191, 0.3);
}

.status-badge.uploaded {
  background: var(--accent-light);
  color: var(--color-success);
  border: 1px solid rgba(var(--accent-fill-rgb), 0.3);
}

.status-badge.generating {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Draft (2026-08-16) — pre-lifecycle like 'generating', but a draft is the
   user's own unfinished work rather than a machine state, so it reads in the
   warning language: visibly "not a plan yet" at a glance in My Plans. */
.status-badge.draft {
  background: rgba(180, 120, 20, 0.12);
  color: var(--color-warning, #92610a);
  border: 1px solid rgba(180, 120, 20, 0.35);
}

.plan-card.is-draft .plan-card-header { border-left: 3px solid rgba(180, 120, 20, 0.55); }

.continue-draft-btn {
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-on);
  background: var(--accent-fill);
  border: 1px solid var(--accent-fill);
  border-radius: 12px;
  cursor: pointer;
}

.continue-draft-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Card-level ✎ Edit (list-navigation redesign, Item 2) — the outline sibling
   of the filled "Continue editing": a draft's is the card's primary action,
   a generated plan's opens a question. */
.plan-card-edit-btn,
.plan-card-view-btn {
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.plan-card-edit-btn:hover:not(:disabled),
.plan-card-view-btn:hover {
  color: var(--accent-primary);
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
}
.plan-card-edit-btn:disabled { opacity: 0.55; cursor: default; }
.plan-card-edit-btn:focus-visible,
.plan-card-view-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
  border-color: var(--accent-fill);
}

.archived-plans-subgroup {
  margin-top: 12px;
}

.archived-plans-subgroup summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: 8px 0;
}

.archived-plans-subgroup .plan-card {
  margin-top: 12px;
}

.status-btn {
  padding: 6px 12px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-heading);
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.status-btn:hover {
  background: var(--bg-secondary);
  color: var(--accent-primary);
  border-color: var(--accent-fill);
}

.delete-btn {
  padding: 6px 10px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-error);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  line-height: 1;
}

.delete-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--color-error);
  color: var(--color-error);
}

.plan-card-content {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  /* Cards re-render on expand, so the animation replays each time content appears */
  animation: accordionReveal 0.25s ease;
}

.plan-card-content .plan-display {
  /* Reuse existing plan display styles */
}

.expand-icon {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  transition: transform 0.2s;
}

.plan-card.expanded .expand-icon {
  transform: rotate(180deg);
}

/* ── Unified pill language (V3 mockup pillStyle) ─────────────────────────
   ONE pill vocabulary for every selectable control on the planner form:
   8px 16px padding, 999px radius, 0.82rem/500, line-height 1.2; inactive =
   transparent bg + --color-border; hover = --bg-subtle + accent border;
   active/selected = --accent-fill-strong fill with --accent-on text (both
   tokens theme-switch, so dark mode needs no per-control override).
   Compact contexts (provider toggles, day-type, gear pre-select) use the
   mockup's smallPillStyle: 5px 12px, 0.74rem, same states. */

/* Shoot Type Toggle — single-select behavior unchanged (switchShootType
   still owns .active). */
.shoot-type-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shoot-type-btn {
  flex: 0 1 auto;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.shoot-type-btn:hover {
  color: var(--color-text-primary);
  background: var(--bg-subtle);
  border-color: var(--accent-fill);
}

.shoot-type-btn.active {
  color: var(--accent-on-tint);
  background: var(--accent-light);
  border-color: var(--accent-fill-strong);
}

/* Output Format Toggle — two-line pills (V3 mockup: pillStyle with a
   centered label + sublabel inside; the only pill with a second line). */
.output-format-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.output-format-btn {
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.output-format-btn:hover {
  color: var(--color-text-primary);
  background: var(--bg-subtle);
  border-color: var(--accent-fill);
}

.output-format-btn.active {
  color: var(--accent-on-tint);
  background: var(--accent-light);
  border-color: var(--accent-fill-strong);
}

.format-name {
  font-weight: 600;
  font-size: 0.82rem;
}

.format-subtitle {
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
  font-weight: 400;
  line-height: 1.3;
}

.output-format-btn.active .format-subtitle {
  color: var(--accent-on-tint);
}

@media (max-width: 480px) {
  .output-format-toggle {
    grid-template-columns: 1fr;
  }
}

/* Interior/Exterior toggle (Architecture focus — re-homed subject detail) —
   plain pill row matching the unified pill language. */
.ie-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Trip Type + Venue Context are distinct inputs (genre vs setting modifiers),
   stacked as full-width sections — each group's pills pack across the whole
   form width before wrapping. Tightened gap (vs the card's 22px) keeps the
   pair visually related. Extra class in the selector outranks the
   .planner-section-card .form-group margin rule. */
.planner-section-card .form-group.trip-type-group,
.trip-type-group {
  margin-bottom: 14px;
}

/* Subject-detail fields (re-homed from the retired Portrait/Architecture
   shoot types) appear between the subject pills and Venue Context — keep
   the cluster's tightened 14px rhythm instead of the 22px card default. */
.planner-section-card .form-group.subject-detail-group,
.subject-detail-group {
  margin-bottom: 14px;
}

/* Venue Context toggles (freeze list Item 3): compact wrapping pills (V3
   mockup) — each button is an independent non-exclusive modifier, not a
   single-select group. The two id'd .venue-toggle containers stay in the DOM
   (JS/verify contracts) but render display:contents so all four pills share
   one full-width wrapping row instead of splitting 2 + 2 across lines.
   (Architecture pill removed 2026-07-10 — subject consolidation.) */
.venue-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.venue-toggle {
  display: contents;
}

.ie-toggle-btn,
.venue-toggle-btn {
  flex: 0 1 auto;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.ie-toggle-btn:hover,
.venue-toggle-btn:hover {
  color: var(--color-text-primary);
  background: var(--bg-subtle);
  border-color: var(--accent-fill);
}

.ie-toggle-btn.active,
.venue-toggle-btn.active {
  color: var(--accent-on-tint);
  background: var(--accent-light);
  border-color: var(--accent-fill-strong);
}

/* Indoor/outdoor gate hint (master audit Phase 6, 2026-07-13) — reflects
   resolveShootEnvironment's decision next to the toggles that feed it. */
.venue-environment-hint,
.style-default-hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.venue-environment-hint:empty {
  display: none;
}

/* Time inputs */
.form-group input[type="time"],
.form-group input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.875rem;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input[type="time"]:focus,
.form-group input[type="date"]:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.pack-weight-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pack-weight-btn {
  flex: 0 1 auto;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.pack-weight-btn:hover {
  color: var(--color-text-primary);
  background: var(--bg-subtle);
  border-color: var(--accent-fill);
}

.pack-weight-btn.active {
  color: var(--accent-on-tint);
  background: var(--accent-light);
  border-color: var(--accent-fill-strong);
}

/* Gear selection mode (2026-08-26) — the mode pills borrow the pack-weight
   pill geometry so the two controls read as one decision, not two families.
   #pack-weight-group and #gear-intent-group are never visible at once. */
.gear-mode-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gear-mode-btn {
  flex: 0 1 auto;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.gear-mode-btn:hover {
  color: var(--color-text-primary);
  background: var(--bg-subtle);
  border-color: var(--accent-fill);
}

.gear-mode-btn.active {
  color: var(--accent-on-tint);
  background: var(--accent-light);
  border-color: var(--accent-fill-strong);
}

.gear-intent-panel {
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  overflow: hidden;
}

.gear-intent-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  color: var(--color-text-primary);
  background: none;
  border: 0;
  cursor: pointer;
}

.gear-intent-summary .section-indicator {
  font-size: 10px;
  color: var(--color-text-secondary);
}

.gear-intent-body {
  padding: 0 12px 12px;
}

.gear-intent-body.hidden {
  display: none;
}

.gear-intent-legend {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.gear-intent-category {
  margin-top: 12px;
}

.gear-intent-category:first-child {
  margin-top: 0;
}

.gear-intent-category-title {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.gear-intent-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--border-input);
}

.gear-intent-category-title + .gear-intent-row {
  border-top: 0;
}

.gear-intent-name {
  flex: 1 1 160px;
  min-width: 0;
  font-size: 13px;
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
}

.gear-intent-states {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.gear-intent-state-btn {
  padding: 4px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gear-intent-state-btn:hover {
  color: var(--color-text-primary);
  border-color: var(--accent-fill);
}

.gear-intent-state-btn.active {
  color: var(--accent-on-tint);
  background: var(--accent-light);
  border-color: var(--accent-fill-strong);
}

/* Only a LOCKED decision earns the accent. Maybe is the default every row
   starts at, so an accent there would make an untouched panel look as decided
   as a fully marked one — the eye should be able to find the two or three rows
   the user actually ruled on. */
.gear-intent-state-btn[data-gear-state="maybe"].active {
  color: var(--color-text-primary);
  background: var(--bg-subtle);
  border-color: var(--border-input);
}

.gear-intent-state-btn[data-gear-state="exclude"].active {
  color: var(--color-text-primary);
  background: var(--bg-subtle);
  border-color: var(--color-text-secondary);
  text-decoration: line-through;
}

.gear-intent-empty {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

/* Detailed Itinerary Section */
.detailed-itinerary-section {
  margin-top: 8px;
}

/* Day-plan heading row: label, then the Single Event Optional tag and its
   info pill sit on the same line (the label alone is display:block). */
.subplanner-label-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.subplanner-label-row label { margin-bottom: 0; }
.field-subtext {
  margin: 4px 0 16px 0;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.itinerary-days-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.day-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-input);
  border-radius: 8px;
  padding: 0;
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.day-card:hover {
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.day-card-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.day-card-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.day-card-stop-summary {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.day-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.day-card-edit-btn {
  padding: 4px 10px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-heading);
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.day-card-edit-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}

.day-number {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.day-card input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.8125rem;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 8px;
}

.day-card input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.day-card input[type="text"]::placeholder {
  color: var(--color-text-tertiary);
}

.day-stop-add {
  display: block;
  width: 100%;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px dashed var(--color-border-input);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.day-stop-add:hover:not(:disabled) {
  border-color: var(--accent-fill);
  color: var(--color-text-primary);
  background: var(--accent-light);
}

.day-stop-add:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.add-day-btn {
  width: 100%;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-heading);
  background: transparent;
  border: 1px dashed var(--border-input);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  font-family: inherit;
}

.add-day-btn:hover:not(:disabled) {
  border-color: var(--accent-fill);
  background: var(--bg-secondary);
  color: var(--accent-primary);
}

.add-day-btn:disabled {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.validation-message {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(193, 58, 37, 0.10);
  border: 1px solid rgba(193, 58, 37, 0.3);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--color-error);
}


/* Progressive Day-by-Day Animation Styles */
.day-section-wrapper {
  margin-bottom: 24px;
}

.day-section {
  padding: 20px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  border-left: 3px solid var(--color-accent);
}

.day-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
}

.day-schedule {
  margin-top: 20px;
  padding: 16px;
  background: var(--color-bg-surface);
  border-radius: 6px;
}

.day-schedule h4 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  color: var(--color-text-primary);
}

.schedule-notes {
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* ── Plan Navigation ─────────────────────────────────────────────────────── */

.plan-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 8px;
}

.plan-nav-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) var(--color-bg-primary);
}

.plan-nav-pills::-webkit-scrollbar {
  height: 6px;
}

.plan-nav-pills::-webkit-scrollbar-track {
  background: var(--color-bg-surface);
}

.plan-nav-pills::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.plan-nav-pills::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-input);
}

.plan-nav-pill {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.plan-nav-pill:hover {
  background: var(--color-border);
}

.plan-nav-pill.active {
  background: var(--color-border);
  color: var(--color-nav-active);
  border-color: var(--color-border-input);
}

[data-theme="dark"] .plan-nav-pill {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .plan-nav-pill:hover {
  background: var(--border);
}

[data-theme="dark"] .plan-nav-pill.active {
  background: var(--border);
  color: var(--text-heading);
  border-color: var(--accent-fill);
}

/* ── Day Notes ────────────────────────────────────────────────────────────── */

.day-notes-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.day-notes-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-notes-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.day-notes-textarea::placeholder {
  color: var(--color-text-tertiary);
}

.day-notes-textarea:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.day-notes-status {
  display: inline-block;
  font-size: 0.8rem;
  margin-top: 6px;
  font-weight: 500;
}

.day-notes-status.saving {
  color: var(--color-text-secondary);
}

.day-notes-status.saved {
  color: var(--color-success);
}

.day-notes-status.error {
  color: var(--color-error);
}

/* Mobile adjustments for navigation */
@media (max-width: 768px) {
  .plan-nav {
    padding: 8px 12px;
  }

  .plan-nav-pill {
    font-size: 0.8rem;
    padding: 5px 14px;
  }
}

/* ── Plan Export Toolbar ──────────────────────────────────────────────────── */

.export-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 20px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.export-toolbar-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.export-btn {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--border-input);
  background: transparent;
  color: var(--text-heading);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.export-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.export-btn[aria-expanded="true"] {
  background: var(--bg-secondary);
  border-color: var(--color-border-input);
  border-top: 2px solid var(--accent-fill);
  padding-top: 5px;
}

.export-caret {
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
  margin-left: 2px;
}

.export-menu {
  position: relative;
}

.export-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  padding: 6px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.export-dropdown[hidden] {
  display: none;
}

.export-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.export-option:hover {
  background: var(--bg-subtle);
  color: var(--color-nav-active);
}

[data-theme="dark"] .export-option:hover {
  background: var(--bg-secondary);
  color: var(--text-heading);
}

.export-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--accent-fill);
  color: var(--accent-on);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  /* above the plan-viewer overlay (1200) — exports now also fire from
     inside it, and the pop-up-blocked notice must stay visible there */
  z-index: 1300;
}

.export-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 768px) {
  .export-btn {
    font-size: 0.8rem;
    padding: 5px 14px;
  }
}

/* ── Photography Style Field ────────────────────────────────────────────── */

.style-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 8px 0 4px;
}

/* ── Reference Document Upload ─────────────────────────────────────────── */

.optional-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 6px;
}

.doc-upload-group .optional-tag {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  opacity: 0.7;
}

.doc-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  background: var(--color-bg-secondary);
  border: 1.5px dashed var(--color-border-input);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.doc-upload-zone:hover,
.doc-upload-zone:focus-visible,
.doc-upload-zone.dragover {
  border-color: var(--accent-fill);
  background: rgba(var(--accent-fill-rgb), 0.05);
  outline: none;
}

.doc-upload-icon {
  width: 28px;
  height: 28px;
  color: var(--color-text-tertiary);
  transition: color 0.2s;
}

.doc-upload-zone:hover .doc-upload-icon,
.doc-upload-zone.dragover .doc-upload-icon {
  color: var(--accent-primary);
}

.doc-upload-text {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.doc-upload-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

.doc-upload-browse {
  margin-top: 4px;
  padding: 6px 14px;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-heading);
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.doc-upload-browse:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}

.doc-upload-file[hidden] {
  display: none;
}

.doc-upload-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.doc-upload-file-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.doc-upload-filename {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-upload-status {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.doc-upload-status.processing::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border: 2px solid var(--color-border);
  border-top-color: var(--accent-fill);
  border-radius: 50%;
  vertical-align: -1px;
  animation: spin 0.8s linear infinite;
}

.doc-upload-status.ready {
  color: var(--color-success);
  font-weight: 500;
}

.doc-upload-status.ready::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  background: currentColor;
  -webkit-mask: var(--a22-mask-check) center / contain no-repeat;
  mask: var(--a22-mask-check) center / contain no-repeat;
  margin-right: 4px;
}

.doc-upload-error {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--color-error);
  line-height: 1.4;
}

.doc-extracted-summary {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--accent-primary);
  line-height: 1.4;
}

/* Teal glow on fields auto-filled from an uploaded document */
@keyframes docAutofillGlow {
  0%   { box-shadow: 0 0 0 0 rgba(var(--accent-fill-rgb), 0); border-color: var(--color-border-input); }
  30%  { box-shadow: 0 0 0 4px rgba(var(--accent-fill-rgb), 0.25); border-color: var(--accent-fill); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-fill-rgb), 0); border-color: var(--color-border-input); }
}

.doc-autofilled {
  animation: docAutofillGlow 1.6s ease-out;
}

@keyframes docAutofillLabelGlow {
  0%   { background: transparent; border-radius: 4px; }
  30%  { background: rgba(var(--accent-fill-rgb), 0.15); border-radius: 4px; }
  100% { background: transparent; border-radius: 4px; }
}

.doc-autofilled-label {
  animation: docAutofillLabelGlow 1.6s ease-out;
}

/* Subtle prompt shown above Generate when a document auto-fills enough to go */
.doc-ready-prompt {
  margin: 0 0 10px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-primary);
  text-align: center;
  background: rgba(var(--accent-fill-rgb), 0.08);
  border: 1px solid rgba(var(--accent-fill-rgb), 0.25);
  border-radius: 8px;
}

/* Gear pre-select on Shot Cards (freeze list Item 4). Pills reuse the exact
   toggleable-pill visuals from .checkbox-group .checkbox-label (Trip type
   checkboxes) above, laid out as an inline flex-wrap row so they fit inside
   a shot card instead of the form's 2-column grid. */
.gear-preselect {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
}

.gear-preselect-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.gear-preselect-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Size-step only: the container also carries .checkbox-group, so fill, border,
   radius, weight, hover, checked and focus all come from the canonical pill
   rule above — this drops it to the compact in-card step. */
@supports selector(:has(input:checked)) {
  .gear-preselect-pills .checkbox-label {
    padding: 5px 12px;
    font-size: 0.74rem;
  }
}

.gear-preselect-empty {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.gear-preselect-empty a {
  color: var(--accent-primary);
  text-decoration: underline;
  font-weight: 600;
}

.gear-preselect-show-all {
  display: inline-block;
  margin-top: 4px;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

.gear-preselect-status {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

.gear-preselect-status.error {
  color: var(--color-error, #dc2626);
}

/* ── Multi-Day Date Range Picker ──────────────────────────────────────────── */

.date-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-range-row input[type="date"] {
  flex: 1;
  min-width: 0;
}

.date-range-sep {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
}

.date-range-summary {
  margin: 6px 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.multi-day-detected-note {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--accent-primary);
  line-height: 1.4;
}

/* Amber past-dates note with the planner's teal accent */
.past-dates-note {
  margin: 8px 0 0;
  padding: 8px 12px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--color-warning);
  background: rgba(169, 106, 11, 0.12);
  border: none;
  border-left: 3px solid var(--accent-fill);
  border-radius: 6px;
}

/* Amber beta note: multi-day 7-day cap notice */
.multi-day-beta-note {
  margin: 8px 0 0; padding: 8px 12px;
  font-size: 0.8rem; line-height: 1.4;
  color: var(--color-warning); background: rgba(169, 106, 11, 0.12);
  border: none; border-left: 3px solid var(--accent-fill);
  border-radius: 6px;
}

/* Phase 11a fix 2 (2026-07-14): generation progress banner — visible inside
   plan-display itself from the moment the intro renders (spinner disappears)
   through finalize, so the plan never looks finished while two stages are
   still running. Removed outright once finalize genuinely completes. */
.plan-generation-progress {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-primary);
  background: rgba(var(--accent-fill-rgb), 0.08);
  border: 1px solid rgba(var(--accent-fill-rgb), 0.25);
  border-left: 3px solid var(--accent-fill-strong);
  border-radius: 6px;
}
.plan-generation-progress-spinner {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(var(--accent-fill-rgb), 0.30);
  border-top-color: var(--accent-fill-strong);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.plan-generation-progress-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
.plan-generation-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  font-size: 0.78rem;
  color: var(--text-secondary, var(--text-primary));
}
.plan-generation-progress-meta > :empty { display: none; }
/* Completion stages, never a measured share of a day: saved = solid fill,
   active = outline + pulse, pending = muted, stopped = dashed outline.
   State is also carried by outline and text, not colour alone. */
.plan-generation-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}
.plan-generation-step {
  flex: 1 1 26px;
  min-width: 26px;
  max-width: 64px;
  box-sizing: border-box;
  padding: 2px 4px;
  font-size: 0.7rem;
  line-height: 1.3;
  text-align: center;
  border: 2px solid transparent;
  border-radius: 4px;
  background: rgba(var(--accent-fill-rgb), 0.10);
  color: var(--text-secondary);
}
.plan-generation-step--finishing { flex: 2 1 64px; max-width: 96px; }
.plan-generation-step[data-state="saved"] {
  background: var(--accent-fill-strong);
  color: var(--accent-on, #1a1a1a);
}
.plan-generation-step[data-state="active"],
.plan-generation-step[data-state="stopped"] {
  border-color: var(--accent-fill-strong);
  color: var(--text-primary);
  font-weight: 600;
}
.plan-generation-step[data-state="active"] { animation: plan-generation-pulse 1.4s ease-in-out infinite; }
.plan-generation-step[data-state="stopped"] { border-style: dashed; }
@keyframes plan-generation-pulse {
  0%, 100% { background: rgba(var(--accent-fill-rgb), 0.12); }
  50% { background: rgba(var(--accent-fill-rgb), 0.45); }
}
.plan-generation-progress-note { font-size: 0.72rem; color: var(--text-secondary); }
.plan-generation-progress.is-stopped .plan-generation-progress-spinner,
.plan-generation-progress.is-stopped .plan-generation-progress-clock { display: none; }
@media (prefers-reduced-motion: reduce) {
  .plan-generation-progress-spinner { animation: none; }
  .plan-generation-step[data-state="active"] { animation: none; background: rgba(var(--accent-fill-rgb), 0.30); }
}

/* Guidance banner — shown at top of plan when preflight pins were moved */
.planner-guidance-banner {
  margin: 0 0 16px;
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: rgba(var(--accent-fill-rgb), 0.08);
  border: 1px solid rgba(var(--accent-fill-rgb), 0.25);
  border-left: 3px solid var(--accent-fill-strong);
  border-radius: 6px;
}

/* ── Shot Maps (Leaflet) ──────────────────────────────────────────────────── */

.shot-map-wrap {
  position: relative;
  z-index: 0;
  margin: 14px 0 16px;
  touch-action: none;
}

.shot-map {
  height: 300px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  background: var(--color-bg-secondary);
  /* Contain Leaflet's internal pane z-indexes so sticky nav stays on top */
  position: relative;
  z-index: 0;
  transition: height 0.2s ease;
}

.shot-map-wrap.expanded .shot-map {
  height: 520px;
}

.shot-map-expand {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  /* sized to match the seam pills stacked directly beneath it */
  padding: 4px 11px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  /* opaque per the mock's map-chrome rule — map controls are not glass */
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background 0.2s, border-color 0.2s;
}

.shot-map-expand:hover {
  background: var(--bg-card);
  border-color: var(--accent-fill);
}

/* The Street View panel is inset:0 INSIDE .shot-map, whose z-index:0 above
   makes it a stacking context — trapping the panel's z-index:1100. This
   z-index:1 sibling therefore paints over the panel's ✕ and swallows the
   close click (clicking ✕ expanded the map instead). Nothing to expand while
   Street View covers the map anyway. */
.shot-map-wrap:has(.street-view-panel) .shot-map-expand { display: none; }

/* Numbered teardrop pins — teal for shooter position, amber for subject */
.shot-map-popup {
  font-family: var(--font-primary);
  font-size: 0.85rem;
}

.shot-map-popup .smp-title {
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.shot-map-popup .smp-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.shot-map-popup .smp-nav {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: none;
}

/* Map legend: explains pin colors. Bottom-left, clear of the top-left zoom
   buttons. Frosted white panel matching the expand button; collapses to a
   "Legend" pill on small screens. */
.shot-map-legend {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-family: var(--font-primary);
}

.shot-map-legend .sml-toggle {
  display: none;
  width: 100%;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: var(--color-text-primary);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.shot-map-legend .sml-items {
  padding: 7px 10px;
}

.shot-map-legend .sml-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: nowrap;
}

.shot-map-legend .sml-swatch {
  flex-shrink: 0;
}

.shot-map-legend .sml-shooter {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-fill);
}

.shot-map-legend .sml-subject {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
}

.shot-map-legend .sml-line {
  width: 16px;
  height: 0;
  border-top: 2px dashed #64748b;
}

.shot-map-legend .sml-anchor {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 3px solid var(--accent-fill);
  background: var(--accent-light);
}

/* Map overlays (legend + Leaflet popups) sit on light map tiles regardless of
   page theme, so their text must always be dark to stay readable. Not themed. */
.shot-map-legend .sml-toggle,
.shot-map-legend .sml-row,
.shot-map-popup .smp-title,
.shot-map-popup .smp-detail,
.leaflet-popup-content {
  color: #333333 !important;
}

/* Keep the Navigate link visibly a link (accent) on the white popup. */
.shot-map-popup .smp-nav {
  color: var(--accent-primary) !important;
}

@media (max-width: 768px) {
  .shot-map {
    height: 240px;
  }

  .shot-map-wrap.expanded .shot-map {
    height: 420px;
  }

  /* Collapse the legend to a pill; tapping it reveals the rows */
  .shot-map-legend {
    border-radius: 16px;
  }

  .shot-map-legend .sml-toggle {
    display: block;
  }

  .shot-map-legend .sml-items {
    display: none;
  }

  .shot-map-legend.open .sml-items {
    display: block;
    padding-top: 0;
  }
}

/* Navigate-by-name fallback shown when shot GPS fails validation */
.shot-map-fallback {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 14px 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg-secondary);
}

.shot-map-fallback a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-primary);
  text-decoration: none;
}

.shot-map-fallback a:hover {
  text-decoration: underline;
}

.shot-map-fallback span {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}

/* ── Frosted Glass Fallback ───────────────────────────────────────────────── */

/* Solid backgrounds for browsers without backdrop-filter support */
@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .planner-form-panel,
  .planner-output-panel,
  .plan-card,
  .plan-nav,
  .export-dropdown {
    background: var(--color-bg-primary);
  }
}

/* ── Inline Plan Editing ──────────────────────────────────────────────────── */

.plan-edit-btn {
  padding: 4px 10px;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-heading);
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

/* Per-shot edit/resynth is a discoverable feature, not a hover easter egg —
   dimmed by default (not opacity:0) so it doesn't require an accidental
   mouseover to find. Placed ahead of the hover/focus block below so those
   rules still win the cascade at equal specificity. */
.shot-idea .plan-edit-btn {
  opacity: .45;
}

.planner-section-header .plan-edit-btn {
  margin-left: auto;
}

.planner-section-header:hover .plan-edit-btn,
.shot-idea:hover .plan-edit-btn,
.day-schedule:hover .plan-edit-btn,
.plan-edit-btn:focus-visible {
  opacity: 1;
}

.plan-edit-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}

/* Touch devices have no hover — keep edit buttons always visible. Repeats
   the .shot-idea selector so it out-specifies the dimmed-by-default rule
   above (both are 2-class selectors; without this it would lose on
   equal specificity to source order). */
@media (hover: none) {
  .plan-edit-btn,
  .shot-idea .plan-edit-btn {
    opacity: 1;
  }
}

.shot-idea {
  position: relative;
}

.shot-idea .plan-edit-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
}

.shot-idea .shot-idea-desc {
  padding-right: 40px;
}

.day-schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0 8px;
}

.day-schedule-header h4 {
  margin: 0;
}

.plan-edit-area {
  border: 1px solid rgba(var(--accent-fill-rgb), 0.45);
  background: rgba(var(--accent-fill-rgb), 0.05);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-edit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-edit-field span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
}

.plan-edit-field input,
.plan-edit-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.plan-edit-field textarea {
  resize: vertical;
}

.plan-edit-field input:focus,
.plan-edit-field textarea:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.plan-edit-hint {
  font-size: 0.78rem;
  color: var(--color-text-tertiary);
}

.plan-edit-status {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.plan-edit-status.error {
  color: var(--color-error);
}

.plan-edit-actions {
  display: flex;
  gap: 8px;
}

.plan-edit-save,
.plan-edit-cancel,
.plan-edit-resynth {
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.plan-edit-save {
  flex: 1;
  background: var(--accent-fill-strong);
  border: 1px solid var(--accent-fill-strong);
  color: var(--accent-on);
}

.plan-edit-save:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.plan-edit-cancel {
  flex: 1;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  color: var(--color-text-secondary);
}

.plan-edit-cancel:hover {
  background: var(--bg-subtle);
}

.plan-edit-resynth {
  width: 100%;
  background: var(--color-bg-surface);
  border: 1px dashed rgba(var(--accent-fill-rgb), 0.6);
  color: var(--accent-primary);
}

.plan-edit-resynth:hover {
  background: rgba(var(--accent-fill-rgb), 0.08);
}

.plan-edit-save:disabled,
.plan-edit-cancel:disabled,
.plan-edit-resynth:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Lens dropdown in the shot editor */

.plan-edit-lens-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-edit-lens-select {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.plan-edit-lens-select:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.plan-edit-focal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.plan-edit-focal[hidden] {
  display: none;
}

/* Override the full-width edit-input rule for the small inline focal box */
.plan-edit-field .plan-edit-focal-input {
  width: 64px;
  padding: 8px 6px;
  text-align: center;
}

.plan-edit-field .plan-edit-lens-custom {
  margin-top: 6px;
}

.plan-edit-field .plan-edit-lens-custom[hidden] {
  display: none;
}

/* ── Dark Mode Overrides ──────────────────────────────────────────────────── */

[data-theme="dark"] .planner-form-panel,
[data-theme="dark"] .planner-output-panel {
  background: rgba(26, 26, 26, 0.92);
  border-color: var(--border);
}

/* Every pill's active state theme-switches through
   --accent-fill-strong/--accent-on, so dark mode only adjusts hover.
   :not(.active) keeps the accent fill from being washed out mid-hover. */
[data-theme="dark"] .shoot-type-btn:hover:not(.active),
[data-theme="dark"] .venue-toggle-btn:hover:not(.active),
[data-theme="dark"] .output-format-btn:hover:not(.active),
[data-theme="dark"] .ie-toggle-btn:hover:not(.active),
[data-theme="dark"] .pack-weight-btn:hover:not(.active),
[data-theme="dark"] .gear-mode-btn:hover:not(.active),
[data-theme="dark"] .gear-intent-state-btn:hover:not(.active),
[data-theme="dark"] .provider-btn:hover:not(:disabled):not(.active),
[data-theme="dark"] .subplanner-class-pill:hover:not(.active),
[data-theme="dark"] .subplanner-span-pill:hover:not(.active),
[data-theme="dark"] .subplanner-meal-pill:hover:not(.active),
[data-theme="dark"] .subplanner-mode-pill:hover:not(.active),
[data-theme="dark"] .subject-duration-btn:hover:not(.active),
[data-theme="dark"] .subject-style-chip:hover:not(.active),
[data-theme="dark"] .plan-edit-cancel:hover,
[data-theme="dark"] .location-complete-btn:hover {
  background: var(--bg-secondary);
}

[data-theme="dark"] .delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .error-state,
[data-theme="dark"] .validation-message {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--color-error, #f87171);
}

[data-theme="dark"] .shot-map-expand:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
}

[data-theme="dark"] .shot-map-popup .smp-nav {
  color: var(--accent-primary);
}

[data-theme="dark"] .plan-edit-area {
  background: rgba(var(--accent-fill-rgb), 0.05);
}

[data-theme="dark"] .plan-edit-cancel {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-theme="dark"] .past-dates-note,
[data-theme="dark"] .multi-day-beta-note {
  background: rgba(251, 191, 36, 0.12);
  border-left-color: var(--accent-fill);
  color: var(--color-warning);
}

[data-theme="dark"] .shot-map-fallback a {
  color: var(--accent-primary);
}

[data-theme="dark"] .plan-edit-save:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

[data-theme="dark"] .plan-edit-resynth {
  background: var(--bg-secondary);
  color: var(--accent-primary);
}

[data-theme="dark"] .doc-upload-browse:hover {
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}

[data-theme="dark"] .doc-upload-status.ready {
  color: var(--color-success);
}

[data-theme="dark"] .status-badge.planned {
  background: rgba(91, 155, 232, 0.15);
  color: var(--color-info);
  border-color: rgba(91, 155, 232, 0.3);
}

[data-theme="dark"] .status-badge.archived {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .status-badge.packing,
[data-theme="dark"] .status-badge.en_route,
[data-theme="dark"] .status-badge.shooting,
[data-theme="dark"] .status-badge.editing {
  background: rgba(91, 155, 232, 0.15);
  color: var(--color-info);
  border-color: rgba(91, 155, 232, 0.3);
}

[data-theme="dark"] .status-badge.draft {
  background: rgba(230, 170, 60, 0.15);
  color: #E8B04A;
  border-color: rgba(230, 170, 60, 0.35);
}

[data-theme="dark"] .status-badge.generating {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .status-btn:hover {
  background: var(--bg-secondary);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--bg-input, #2A2A2A);
  border-color: var(--border-input);
  color: var(--text-primary);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-secondary);
}

[data-theme="dark"] .day-card {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .plan-card {
  background: var(--bg-card);
  border-color: var(--border);
}

/* Dark mode Leaflet map: keep tiles light but frame the map with dark border */
[data-theme="dark"] .shot-map {
  border-color: var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  [data-theme="dark"] .planner-form-panel,
  [data-theme="dark"] .planner-output-panel {
    background: var(--bg-secondary);
  }
}

/* ── Pre-Flight Location Check (P1) ───────────────────────────────────────── */
.preflight-btn {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 10px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-heading);
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.preflight-btn:hover:not(:disabled) { background: var(--bg-secondary); border-color: var(--accent-fill); color: var(--accent-primary); }
.preflight-btn:disabled { background: var(--bg-subtle); border-color: var(--border); color: var(--text-secondary); cursor: not-allowed; }
.preflight-btn.preflight-complete {
  color: var(--accent-on);
  background: var(--color-success);
  border-color: var(--color-success);
}
/* Map-provider toggle (Google build PR-2) — same pill language as the
   shoot-type toggle, compacted to sit above the Pre-Flight row. */
.provider-toggle-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.provider-toggle-row[hidden] { display: none; }
.provider-toggle-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}
.provider-toggle {
  display: flex;
  gap: 6px;
}
.provider-btn {
  padding: 5px 12px;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.provider-btn:hover:not(:disabled) {
  color: var(--color-text-primary);
  background: var(--bg-subtle);
  border-color: var(--accent-fill);
}
.provider-btn.active {
  color: var(--accent-on);
  background: var(--accent-fill-strong);
  border-color: var(--accent-fill-strong);
}
.provider-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* .provider-btn is shared by two unrelated decisions: the Standard/Google map
   source (solid — it reads as live map state, matching the on-map toolbars) and
   the positions-mode choice, which is an ordinary form selector and so takes
   the canonical tinted treatment at the compact step. Scoped off the container
   both call sites already emit, so no markup change. */
.positions-mode-toggle .provider-btn {
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--bg-input);
  border-color: var(--border-input);
  border-radius: var(--radius-pill);
}
.positions-mode-toggle .provider-btn:hover:not(:disabled) {
  color: var(--color-text-primary);
  background: var(--bg-subtle);
  border-color: var(--accent-fill);
}
.positions-mode-toggle .provider-btn.active {
  color: var(--accent-on-tint);
  background: var(--accent-light);
  border-color: var(--accent-fill-strong);
}
.provider-hint {
  font-size: 11px;
  color: var(--color-text-secondary);
}
.positions-cap-hint {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin: 4px 0 0;
}
.provider-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 6px;
}
.deep-planning-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 6px;
}
.plan-reference-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.preflight-btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.preflight-btn-row .preflight-btn {
  flex: 1;
  width: auto;
  margin-bottom: 0;
}

.preflight-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.preflight-modal[hidden] { display: none; }
.preflight-modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, 0.60); }
.preflight-modal-content {
  position: relative;
  z-index: 1;
  width: min(940px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.preflight-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); background: var(--bg-card); }
.preflight-modal-header h2 { margin: 0; font-size: 1.15rem; color: var(--text-heading); }
.preflight-modal-body { display: flex; flex: 1; min-height: 0; background: var(--bg-card); }
.preflight-map { flex: 1 1 60%; min-height: 360px; transition: min-height 0.2s ease; }
.preflight-map-wrap { flex: 1 1 60%; display: flex; }
.preflight-map-wrap .preflight-map { flex: 1 1 auto; }
.map-expandable.expanded .preflight-map { min-height: 620px; }
.preflight-pin-list { flex: 0 0 38%; max-width: 320px; padding: 16px 18px; border-left: 1px solid var(--border); overflow-y: auto; background: var(--bg-card); }
.preflight-pin-list h3 { margin: 0 0 10px; font-size: 0.95rem; color: var(--text-heading); }
.preflight-pin-list ul { list-style: none; margin: 0 0 14px; padding: 0; }
.preflight-pin-empty { font-size: 0.85rem; color: var(--text-secondary); padding: 8px 0; }
.preflight-pin-item { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.preflight-pin-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
/* Journey origin rows swap the color dot for the 🏠 glyph (audit Q1) */
.preflight-pin-dot-origin { width: auto; height: auto; border-radius: 0; font-size: 12px; line-height: 1; background: none; }
/* Break A (Phase 2, 2026-07-13): standing-position rows swap the color dot
   for the 🧍 glyph and indent under their parent stop — the list already
   groups them (buildCandidates pushes each position right after its stop). */
.preflight-pin-dot-standing { width: auto; height: auto; border-radius: 0; font-size: 11px; line-height: 1; background: none; }
.preflight-pin-item-standing { margin-left: 16px; padding-left: 8px; border-left: 2px solid var(--color-success); }
/* Phase 11a fix 1 (2026-07-14): subject (📷) rows swap the color dot for the
   camera glyph and indent under their parent stop one notch lighter than
   standing positions — subject sits above standing in the hierarchy. */
.preflight-pin-dot-subject { width: auto; height: auto; border-radius: 0; font-size: 11px; line-height: 1; background: none; }
.preflight-pin-item-subject { margin-left: 10px; padding-left: 8px; border-left: 2px solid var(--accent-fill-strong); }
.preflight-pin-label { font-weight: 700; color: var(--accent-primary); cursor: pointer; }
.preflight-pin-label:hover { color: var(--accent-primary); }
.preflight-pin-label-input { font-weight: 700; font-size: 0.85rem; width: 52px; padding: 1px 4px; border: 1px solid var(--color-accent); border-radius: 4px; background: var(--bg-input); color: var(--text-heading); }
.preflight-pin-name { color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preflight-pin-coords { color: var(--text-secondary); font-size: 0.75rem; width: 100%; padding-left: 16px; }
.preflight-pin-notlocated-hint { color: var(--text-secondary); font-size: 0.75rem; font-style: italic; width: 100%; padding-left: 16px; }

/* F5 — geocode confidence badge on each pin row */
.preflight-pin-confidence {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  cursor: help;
}
.preflight-pin-confidence-venue { color: var(--color-success); background: rgba(34, 197, 94, 0.10); border: 1px solid rgba(34, 197, 94, 0.35); }
.preflight-pin-confidence-city { color: var(--color-warning); background: rgba(245, 158, 11, 0.10); border: 1px solid rgba(245, 158, 11, 0.40); }
.preflight-pin-confidence-cache { color: var(--text-secondary); background: var(--bg-secondary); border: 1px solid var(--border); }
.preflight-pin-confidence-none { color: var(--color-error); background: rgba(239, 68, 68, 0.10); border: 1px solid rgba(239, 68, 68, 0.40); }

.preflight-pin-name-editable { cursor: pointer; }
.preflight-pin-name-editable:hover { text-decoration: underline dotted; }
.preflight-pin-coords-editable { cursor: pointer; }
.preflight-pin-coords-editable:hover { text-decoration: underline dotted; }
.preflight-pin-name-input { flex: 1; min-width: 0; padding: 1px 6px; border: 1px solid var(--color-accent); border-radius: 4px; background: var(--bg-input); color: var(--text-heading); font-size: 0.85rem; }
.preflight-pin-coords-input { width: 100%; padding: 2px 6px; border: 1px solid var(--color-accent); border-radius: 4px; background: var(--bg-input); color: var(--text-heading); font-size: 0.75rem; box-sizing: border-box; }
.preflight-input-invalid { border-color: var(--color-warning) !important; }
.preflight-unpinned-note { margin: 0 0 8px; font-size: 0.8rem; color: var(--color-warning); }
.preflight-coord-hint { width: 100%; padding-left: 16px; font-size: 0.7rem; color: var(--color-warning); }

/* Search button per pin row */
.preflight-pin-search-btn { flex: 0 0 auto; background: transparent; border: 1px solid transparent; font-size: 1rem; line-height: 1; cursor: pointer; color: var(--text-secondary); padding: 2px 4px; border-radius: 4px; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.preflight-pin-search-btn:hover { background: var(--bg-secondary); border-color: var(--accent-fill); color: var(--text-primary); }

/* Inline search row inside a pin <li> */
.preflight-search-row { width: 100%; padding: 6px 0 2px; }
.preflight-search-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.8125rem;
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-heading);
  font-family: inherit;
  box-sizing: border-box;
}
.preflight-search-input:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }

/* Add-from-search row below the + Add Pin button */
.preflight-search-add-btn {
  width: 100%; margin-top: 6px; padding: 7px 10px;
  font-size: .875rem; font-weight: 600; border: 1px dashed var(--border-input);
  border-radius: 8px; background: transparent; color: var(--text-heading);
  cursor: pointer; font-family: inherit; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.preflight-search-add-btn:hover:not(:disabled) { background: var(--bg-secondary); color: var(--accent-primary); border-color: var(--accent-fill); }
.preflight-search-add-btn:disabled { background: var(--bg-subtle); border-color: var(--border); color: var(--text-secondary); cursor: not-allowed; }
.preflight-search-add-row { margin-top: 6px; }

/* Floating results dropdown (position:fixed, appended to body) */
.preflight-search-results {
  position: fixed;
  z-index: 1100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
}
.preflight-search-result-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.preflight-search-result-row:last-child { border-bottom: none; }
.preflight-search-result-row:hover { background: var(--bg-secondary); }
.preflight-search-result-name { font-size: 0.85rem; font-weight: 600; color: var(--text-heading); }
.preflight-search-result-full { font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preflight-search-empty { padding: 10px 12px; font-size: 0.82rem; color: var(--text-secondary); }
.preflight-search-broaden { padding: 2px 12px 10px; font-size: 0.78rem; color: var(--accent-primary); cursor: pointer; background: none; border: none; font-family: inherit; }
.preflight-search-broaden:hover { text-decoration: underline; }
.preflight-search-broaden:disabled { opacity: 0.5; cursor: not-allowed; text-decoration: none; }
.preflight-pin-try-harder { display: block; width: 100%; padding-left: 16px; text-align: left; }
.preflight-pin-remove { margin-left: auto; flex: 0 0 auto; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px 4px; border-radius: 4px; }
.preflight-pin-remove:hover { color: var(--color-error, #ef4444); background: rgba(239, 68, 68, 0.08); }
#preflight-add-pin-btn {
  width: 100%; padding: 8px; font-size: 0.85rem;
  border: 1px dashed var(--border-hover); border-radius: 8px;
  background: var(--bg-primary); color: var(--text-secondary); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#preflight-add-pin-btn:hover:not(:disabled) { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--color-accent); }
#preflight-add-pin-btn:disabled { opacity: 0.5; cursor: not-allowed; }
#preflight-add-pin-btn.preflight-add-armed { background: var(--accent-light); color: var(--accent-primary); border-color: var(--color-accent); border-style: solid; }
.preflight-modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg-card); }
.preflight-modal-footer .btn-secondary { padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border-input); background: transparent; color: var(--text-heading); font-size: .875rem; font-weight: 600; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.preflight-modal-footer .btn-secondary:hover { background: var(--bg-secondary); border-color: var(--accent-fill); color: var(--accent-primary); }
.preflight-modal-footer .btn-primary { padding: 10px 18px; border-radius: 8px; border: 1px solid var(--accent-fill); background: var(--accent-fill); color: var(--accent-on); font-size: .875rem; font-weight: 600; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.preflight-modal-footer .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
/* Pre-Flight markers converged onto journeyPinIcon (2026-08-13); the last
   bespoke survivor, the floating label chip, retired 2026-08-14 when pins
   gained the builder's numbered bubbles — names live in the linked pin list. */

/* Day-by-day navigation (2026-08-13): pill strip under the modal header —
   one selected day filters BOTH the map and the list; hidden on 1-day
   plans. Pills reuse the shared classification-pill spec (class set in JS —
   naming it here would trip the button-consistency suite's rule scanner). */
.preflight-day-nav { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 20px 0; }
.preflight-day-nav[hidden] { display: none; }
.preflight-day-pill { display: inline-flex; align-items: center; gap: 6px; }
.preflight-day-pill-dot, .preflight-day-header-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }

/* On-map day key: fixed light chrome like every other map overlay (popups,
   provider toolbar) — it sits on light tiles in both themes. Display-only:
   pointer-events none so armed Add-Pin clicks pass straight through. */
.preflight-map-legend {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 800;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  max-width: 62%;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  font-size: 11px;
  font-weight: 600;
  color: #333333;
  line-height: 1.4;
  pointer-events: none;
}
.preflight-map-legend-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.preflight-map-legend-item.preflight-map-legend-dimmed { opacity: 0.35; }
.preflight-map-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.preflight-day-header { display: flex; align-items: center; gap: 6px; padding: 10px 0 4px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }

/* dark mode overrides for values that can't be expressed as CSS vars */
[data-theme="dark"] .preflight-modal-backdrop { background: rgba(0, 0, 0, 0.70); }
[data-theme="dark"] .preflight-pin-remove:hover { background: rgba(248, 113, 113, 0.12); }
[data-theme="dark"] #preflight-add-pin-btn.preflight-add-armed { background: rgba(212, 134, 42, 0.12); }

/* ── Sub-planner stop rows (V3 Phase 2) ──────────────────────────────────────
   The Day Editor modal was retired in Phase 2; the .day-editor-stop-* rules
   below survive because the inline sub-planner reuses the stop-row markup. */
/* v4: the row is a transparent wrapper (leg connector + stop card); the
   card carries the surface so the connector reads as space between cards. */
.day-editor-stop-row {
  background: transparent;
  border: none;
}
.subplanner-stop-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 8px;
  overflow: hidden;
}

.day-editor-stop-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
}

.day-editor-stop-handle {
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
  padding: 0 2px;
}

.day-editor-stop-handle:active { cursor: grabbing; }

.day-editor-stop-dragging {
  opacity: 0.42;
  transform: scale(0.98);
  transition: opacity 0.15s, transform 0.15s;
}

.day-editor-stop-drop-before {
  border-top: 2px solid var(--accent-fill) !important;
  border-radius: 8px 8px 8px 8px;
}
.day-editor-stop-drop-after {
  border-bottom: 2px solid var(--accent-fill) !important;
  border-radius: 8px 8px 8px 8px;
}

@media (max-width: 600px) {
  .day-editor-stop-handle { min-width: 44px; text-align: center; font-size: 1rem; }
}

.day-editor-stop-name {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.8125rem;
  color: var(--color-text-primary);
  background: transparent;
  border: none;
  font-family: inherit;
}

.day-editor-stop-name:focus { outline: none; }
.day-editor-stop-name::placeholder { color: var(--color-text-tertiary); }

/* Progressive disclosure: details panel below the name row */
.day-editor-stop-details {
  border-top: 1px solid var(--color-border);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-bg-secondary);
}

.day-editor-stop-details label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.day-editor-stop-details label span {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.subplanner-stop-gps-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.day-editor-stop-gps {
  width: 100%;
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.8125rem;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.day-editor-stop-gps:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.day-editor-stop-gps::placeholder { color: var(--color-text-tertiary); }

/* Stop "Place on map" — same secondary-button/armed vocabulary as
   .subplanner-origin-arm / .event-position-add so the click-the-map
   affordance reads consistently everywhere it appears. */
.subplanner-stop-arm {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-text-secondary);
  background: var(--color-bg-surface);
  border: 1px dashed var(--color-border-input);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.subplanner-stop-arm:hover {
  border-color: var(--color-border-focus);
  background: var(--color-bg-secondary);
}
.subplanner-stop-arm.armed {
  color: var(--accent-on);
  background: var(--accent-fill-strong);
  border-color: var(--accent-fill-strong);
  border-style: solid;
}

.day-editor-stop-gps-indicator {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.3;
}

.day-editor-stop-gps-indicator.gps-detected { color: var(--color-success); }
.day-editor-stop-gps-indicator.gps-warning  { color: var(--color-warning); font-weight: 500; }


@media (max-width: 600px) {
  .day-editor-stop-details { padding: 8px 10px; }
}

[data-theme="dark"] .subplanner-stop-card { border-color: var(--border); }
[data-theme="dark"] .day-editor-stop-details { background: var(--bg-secondary); border-color: var(--border); }
@media (max-width: 640px) {
  .preflight-modal-body { flex-direction: column; }
  .preflight-pin-list { max-width: none; flex-basis: auto; border-left: none; border-top: 1px solid var(--border); }
  .preflight-map { min-height: 240px; }
}

/* ── GPS Coords Input (p2a.8.1) ───────────────────────────────────────────── */
.gps-coords-tip {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.gps-coords-indicator {
  margin: 4px 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  font-weight: 600;
}
.gps-coords-indicator.gps-detected {
  color: var(--color-success);
}
.gps-coords-indicator.gps-warning {
  color: var(--color-warning);
  font-weight: 500;
}
@media (max-width: 480px) {
  .gps-coords-tip { display: none; }
}

.destination-readout { margin: 0; line-height: 1.4; }
.destination-readout-source { font-size: 0.75rem; color: var(--text-secondary); }

/* ── Contextual Info Pills ─────────────────────────────────────────────── */
.info-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: help;
  vertical-align: middle;
  border-radius: 50%;
  line-height: 1;
}
.info-pill:hover,
.info-pill:focus-visible {
  color: var(--accent-primary);
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
.info-pill-icon {
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.info-pop {
  position: fixed;
  max-width: 240px;
  padding: 8px 10px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.75rem;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
  z-index: 9999;
}
.info-pop[hidden] { display: none; }
.info-pill[hidden] { display: none; }
[data-theme="dark"] .info-pop {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* Pre-Flight workflow status */
.preflight-status {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.preflight-status.is-confirmed { color: var(--color-success); }
.preflight-status.is-stale { color: var(--color-warning); }
.preflight-status[hidden] { display: none; }

/* ── Disclaimer / safety banners ─────────────────────────────────────────── */
.plan-safety-banner {
  background: rgba(169, 106, 11, 0.12);
  border-left: 3px solid var(--color-warning);
  padding: 12px 16px;
  margin: 12px 0 20px;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
}
[data-theme="dark"] .plan-safety-banner {
  background: rgba(251, 191, 36, 0.12);
}

/* Trip name header — leads the generated output when the user named the
   trip (restored 2026-07-11). Token-driven: both themes for free. */
.plan-title-header {
  margin: 14px 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-heading, var(--text-primary));
}

.shot-card-baseline-note {
  display: block;
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--text-muted, #6B7280);
  font-style: italic;
}
[data-theme="dark"] .shot-card-baseline-note {
  color: var(--text-secondary);
}

.preflight-safety-note {
  flex: 1 1 100%;
  margin: 8px 0 12px;
  padding: 8px 10px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-secondary);
  background: var(--bg-subtle, #F9FAFB);
  border-radius: 4px;
}
[data-theme="dark"] .preflight-safety-note {
  background: rgba(255, 255, 255, 0.04);
}

.doc-upload-privacy {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--text-secondary);
  background: var(--bg-subtle, #F9FAFB);
  border-radius: 4px;
}
[data-theme="dark"] .doc-upload-privacy {
  background: rgba(255, 255, 255, 0.04);
}

.preflight-pin-tips {
  position: relative;
  z-index: 100;
  flex: 1 1 100%;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 4px;
  padding: 8px 10px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-secondary);
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 4px;
}
.preflight-pin-tips[open] {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.preflight-pin-tips summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
}
.preflight-pin-tips ul {
  margin-top: 6px;
  padding-left: 18px;
}
.preflight-pin-tips li {
  margin: 2px 0;
}
[data-theme="dark"] .preflight-pin-tips {
  background: var(--bg-card);
  border-color: rgba(255, 255, 255, 0.1);
}

/* The companion bubble sits fixed at right: 24px (width 64px), expanding to
   right: 32px on wide viewports. At mid-range widths (~1025–1344px) where the
   footer content nearly fills the viewport, the bubble's left edge overlaps the
   theme-toggle label while the icon still clears it. Push the toggle left so
   both icon and label are always outside the bubble's footprint. */
@media (min-width: 769px) {
  .shared-footer .theme-toggle {
    margin-right: 80px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   Planner V3 — Phase 1: Layout + Information Architecture
   Single-column IA, numbered section cards, Active Plans strip, sticky
   action bar, form/output view swap. Tokens only — no hard-coded accent.
   ══════════════════════════════════════════════════════════════════════════ */

/* Single column: the container stops being a two-panel grid */
.planner-container.planner-v3 {
  display: block;
  max-width: 1000px;
  margin: 0 auto;
}

/* Form/output view swap (driven by .view-output from planner.js) */
.planner-v3:not(.view-output) .planner-output-panel { display: none; }
.planner-v3.view-output .planner-form-panel { display: none; }

/* ══════════════════════════════════════════════════════════════════════════
   Step 19 — Chunk 0/5: app-shell layout (body.planner-shell — now PERMANENT)
   ──────────────────────────────────────────────────────────────────────────
   Chunk 5 (2026-07-24) made the two-pane shell universal: the class is applied
   unconditionally (planner.html) and the single-column fallback scaffold
   (#planner-left-col{display:contents} / #planner-right-panel{display:none})
   is gone — the body.planner-shell rules below own the layout outright.

   The planner is a two-pane app surface. Single-scroll model: the grid no
   longer pins its own viewport-height row with each pane scrolling internally
   — that produced three competing scroll contexts (page, left col, right
   panel) and nested scroll-chaining jank. The grid now sizes to content (the
   tall left form defines the row height), the whole document is the one scroll
   context, and the right panel is position:sticky so the map stays pinned
   under the navbar while the form scrolls past it — see the per-rule notes
   below. All colours are theme tokens, so dark mode is automatic.
   ══════════════════════════════════════════════════════════════════════════ */

/* App-shell body: normal document flow — the earlier no-scroll design
   (height:100vh/overflow:hidden/flex column, footer suppressed, navbar
   forced position:relative) was reversed once the right panel grew content
   worth footer-adjacent scrolling to (My Plans, generated-plan tabs). The
   navbar's own base rule (position:sticky; top:0;) is correct again now
   that the page scrolls, so nothing needs overriding here any more. */
body.planner-shell .planner-main {
  max-width: none; margin: 0; padding: 0;
}

/* Two-pane grid: fixed 560px form track + fluid right panel. */
body.planner-shell #planner-interface {
  /* No height / grid-template-rows here any more — the grid sizes to
     content. The left column's tall form is by far the taller of the two
     items, so it defines the row (and page) height; the right panel is
     capped + sticky (below) rather than stretched to match. This is what
     makes the grid's containing block taller than the viewport, which is
     what lets position:sticky on the right panel actually engage. */
  display: grid;
  /* Responsive left track. The mock is 560px fixed, but that only works on a
     wide viewport — at ~760px a fixed 560px leaves the map a ~160px sliver.
     clamp() keeps the mock's 560px on wide screens (where 50vw > 560) but
     never lets the form exceed half the viewport, so the map always keeps a
     usable share as the window narrows, with a 360px floor so the form stays
     legible. 1440→560/880, 1280→560/720, 1024→512/512, 760→380/380. */
  grid-template-columns: clamp(360px, 50vw, 560px) 1fr;
  max-width: none; margin: 0;
}
/* Below ~680px even a 360/320 split is too cramped for a two-pane workspace —
   stack to a single column so the form is full-width and the map sits beneath
   it (still visible, still interactive), rather than squeezing both. */
/* Responsive single-column stack — see the media block AFTER the base panel
   placement rules below (it must come later in source order to win the cascade
   over #planner-left-col / #planner-right-panel grid-column + the map view's
   position:sticky, which are equal-specificity and would otherwise override). */

/* Left track: the form column's surface (mock). Grows to content height and
   scrolls with the page — no internal scroll box any more. */
body.planner-shell #planner-left-col {
  grid-row: 1; grid-column: 1;
  display: flex; flex-direction: column;
  padding: 22px 28px;
  border-right: 1px solid var(--border);
  background: var(--bg-card);
}

/* Right track: sticky map column. Pins under the navbar while the taller
   left form scrolls the page past it, releasing near the bottom as the
   footer comes up (expected — the containing block is the grid row, which
   ends where the row ends). Capped to viewport height (minus the navbar) so
   the map fills it without stretching the row itself: an explicit height on
   a grid item wins over stretch, so this cap doesn't feed back into the
   row's own (content-based) height above. No overflow-y and no containment
   here — this hosts the position:fixed fullscreen map toggle, which a
   containing-block-establishing property (paint containment included)
   would trap. */
body.planner-shell #planner-right-panel {
  grid-row: 1; grid-column: 2;
  display: flex; flex-direction: column;
  background: var(--bg-secondary);
}

/* Per-view height model. Map view: sticky + fixed viewport height so the map
   stays pinned while the (taller) form scrolls the page past it. The map
   content fills exactly this height, so nothing overflows. Sticky is safe for
   the position:fixed fullscreen map — sticky does NOT establish a containing
   block for fixed descendants (unlike transform/filter/contain), so it still
   escapes to the viewport. */
body.planner-shell #planner-right-panel[data-view="map"],
body.planner-shell #planner-right-panel[data-view="pins"] {
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
}
/* Plan / plans views can be taller than the viewport. Static + content height
   so the panel contributes its REAL height to the grid row (row = max of form
   and plan); the footer then flows below the taller column instead of the
   plan bleeding over it. A fixed-height sticky box here would clip to the
   viewport and paint its overflow (overflow:visible) over the footer — the
   bug this fixes. No fullscreen-map concern: that lives in the map view, which
   is display:none here, and the plan view's shot maps expand in-flow. */
body.planner-shell #planner-right-panel[data-view="plan"],
body.planner-shell #planner-right-panel[data-view="plans"] {
  position: static;
  top: auto;
  height: auto;
}

/* Below ~680px, stack to a single column: the form full-width with the map
   beneath it (still visible/interactive) rather than squeezing both into a
   cramped two-pane. Placed AFTER the base panel rules on purpose — it overrides
   their grid-column + the map view's position:sticky, which are equal
   specificity, so source order is what makes these win. */
@media (max-width: 680px) {
  /* minmax(0, …), not 1fr. `1fr` is `minmax(auto, 1fr)`, and a track's `auto`
     minimum is its item's MIN-CONTENT — which no amount of min-width:0 further
     down can lower, because the constraint is on the grid item itself. The day
     card's summary line is white-space:nowrap (correctly — it truncates with
     an ellipsis), so its 243px of text propagated all the way up as a floor:
     the single column resolved to 446px inside a 390px phone, the whole page
     scrolled sideways, and the map's right edge — with the sun dial on it —
     sat off-screen. Letting the track shrink to the viewport is what finally
     lets that ellipsis do its job. */
  body.planner-shell #planner-interface { grid-template-columns: minmax(0, 1fr); }
  body.planner-shell #planner-left-col { grid-column: 1; grid-row: 1; min-width: 0; }
  body.planner-shell #planner-right-panel { grid-column: 1; grid-row: 2; min-width: 0; }
  body.planner-shell #planner-right-panel[data-view="map"],
  body.planner-shell #planner-right-panel[data-view="pins"] {
    position: static; height: 60vh; top: auto;
  }
}

/* All Plans starts as a sibling of the interface (document-scroll model) —
   in the shell it would sit below the grid and squeeze the panes, so it's
   suppressed at its original position. It is now reparented (via JS,
   mountRightPanelViews) into the right panel's 'plans' view, where the
   more specific override further down (.right-panel-view-plans
   #my-plans-section) restores it. */
body.planner-shell #my-plans-section { display: none; }

/* ── Step 19 — Chunk 1: the sub-planner building map moves into the
   persistent right panel (flag ON only; flag OFF keeps the map inline in the
   card, styled by the ".subplanner-map-wrap" sticky-panel rules further down).
   The wrap mounts once and is re-pointed per expand, so it needs to fill the
   panel rather than sit as a sticky column inside the card's own layout. ── */
body.planner-shell #planner-right-panel .subplanner-map-wrap:not(.map-fullscreen) { top: 0; }
body.planner-shell #planner-right-panel .subplanner-map-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  height: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
}
body.planner-shell #planner-right-panel .subplanner-map-wrap .subplanner-map {
  flex: 1;
  min-height: 0;
  height: auto;
  /* Explicit neutral fill so a pre-tile / slow-CDN map reads as a neutral
     "loading" surface. Leaflet's own .leaflet-container paints near-black
     (~#1f1f1f) in dark before tiles arrive, which looked like the page had
     blanked; force a mid-grey in both themes instead. */
  background: #e6e6e6;
}
[data-theme="dark"] body.planner-shell #planner-right-panel .subplanner-map-wrap .subplanner-map {
  background: #3a3a3a;
}
/* The fullscreen toggle still needs to escape the panel entirely — restore
   fixed positioning (higher specificity than the static rule above). */
body.planner-shell #planner-right-panel .subplanner-map-wrap.map-fullscreen {
  position: fixed;
  /* And release the height:100% above. With top, bottom AND height all set,
     the box is over-constrained and `bottom` is the one CSS drops — so the
     fullscreen map was laid out at a full 100vh starting 76px down the
     viewport, hanging its last 76px (its bottom edge, and anything docked
     against it) off the bottom of the screen. `auto` hands the sizing back to
     the inset below, which is what was meant to govern here all along. */
  height: auto;
}
/* The card's own journey builder loses its map column under the flag (the
   wrap lives in the right panel instead) — collapse to one column so the
   builder doesn't leave a reserved, empty second track. */
body.planner-shell .subplanner-journey { grid-template-columns: 1fr; }

/* ── Page header ── */
.planner-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.planner-page-accent {
  margin: 0 0 4px;
  color: var(--accent-primary);
  font-size: 0.95rem;
}
/* Mirrors the app workspace's .toolbar-tutorial-btn exactly (app.css:58/84) so
   the Watch Tutorial affordance reads identically across App and Planner:
   6px rounded-rect (not a pill), 8px 12px padding, .875rem, amber-tint outline
   (0.08 alpha, not --accent-light 0.14, for AA contrast — same note as app.css). */
.tutorial-pill,
body:not(.planner-focus) .planner-focus-toggle,
.planner-page-actions-row #a22-bw-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--accent-fill);
  background: rgba(var(--accent-fill-rgb), 0.08);
  color: var(--accent-primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.tutorial-pill:hover,
body:not(.planner-focus) .planner-focus-toggle:hover,
.planner-page-actions-row #a22-bw-pill:hover {
  background: rgba(var(--accent-fill-rgb), 0.16);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}
[data-theme="dark"] .tutorial-pill,
[data-theme="dark"] body:not(.planner-focus) .planner-focus-toggle,
[data-theme="dark"] .planner-page-actions-row #a22-bw-pill {
  background: rgba(var(--accent-fill-rgb), 0.12);
  color: var(--accent-fill);
}
[data-theme="dark"] .tutorial-pill:hover,
[data-theme="dark"] body:not(.planner-focus) .planner-focus-toggle:hover,
[data-theme="dark"] .planner-page-actions-row #a22-bw-pill:hover {
  background: rgba(var(--accent-fill-rgb), 0.22);
}
.tutorial-pill[hidden] { display: none; }
/* The row's three buttons share .tutorial-pill's chrome (grouped above);
   the beta widget's injected pill keeps its own letter-spacing, 12px glyph
   and hover ring, so those are normalised here. */
.planner-page-actions-row #a22-bw-pill { letter-spacing: normal; }
.planner-page-actions-row #a22-bw-pill svg { width: 11px; height: 11px; }
.planner-page-actions-row #a22-bw-pill:hover { box-shadow: none; }
/* Watch Tutorial · Beta Feedback · App Mode share the row under the subtitle.
   space-between pins Watch Tutorial left and App Mode right and centers the
   pill between them; the slot is display:contents so it contributes no flex
   item while empty. The header-text flex item must fill the header or the
   row shrink-wraps to its buttons. */
.planner-page-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
  margin-top: 16px;
}
.planner-beta-feedback-slot { display: contents; }
.planner-page-header-text { flex: 1 1 auto; }

/* ── Title actions + Focus Mode controls (2026-09-04) ──────────────────────
   .planner-title-actions is the Planner's .top-toolbar-group: it holds App
   Mode at the right end of the actions row. #planner-focus-toggle mirrors app.html's #app-mode-toggle
   exactly — app.css:58 base (1px --border, 6px radius, --bg-card, .875rem
   600, 8px 12px), app.css:273 hover, app.css:310 engaged fill, app.css:3813
   dark base — so a user who knows App Mode reads this control instantly. The
   engaged state keys off body.planner-focus, the single source of truth, not
   off the button's own attribute. */
.planner-title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.planner-focus-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1;
  padding: 8px 12px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.planner-focus-toggle:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}
[data-theme="dark"] .planner-focus-toggle {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-heading);
}
body.planner-focus .planner-focus-toggle {
  background: var(--accent-fill-strong);
  color: var(--accent-on);
  border-color: var(--accent-fill-strong);
}
/* Below 680px the workspace stacks and the phone layout is out of scope —
   the control hides. */
@media (max-width: 680px) {
  body:not(.planner-focus) .planner-focus-toggle { display: none; }
}

/* ── Active Plans strip — collapsed by default into a slim header row ── */
.active-plans-strip { margin-bottom: 20px; }
.active-plans-strip-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.active-plans-strip-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
}
.active-plans-toggle {
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 0;
  font: inherit;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.active-plans-toggle:hover { background: var(--bg-glass); border-color: var(--accent-fill); color: var(--text-primary); }
.active-plans-count {
  font-weight: 600;
  color: var(--text-secondary);
}
.active-plans-caret {
  font-size: 0.8em;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}
.active-plans-toggle[aria-expanded="true"] .active-plans-caret {
  transform: rotate(90deg);
}
.active-plans-body { margin-top: 12px; }
.active-plans-body[hidden] { display: none; }
/* The anchor becomes the strip's "View all plans ↓" link */
.planner-v3 .recent-plans-anchor {
  display: inline-block;
  width: auto;
  margin-bottom: 0;
  padding: 6px 12px;
  font-size: 0.85rem;
}
.planner-v3 .recent-plans-anchor[hidden] { display: none; }
.active-plans-cards {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.active-plan-card {
  flex: 0 0 auto;
  min-width: 260px;
  max-width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}
.active-plan-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.active-plan-status {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--accent-primary);
  white-space: nowrap;
}
.active-plan-dates {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: right;
}
.active-plan-title {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.3;
}
.active-plan-open {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.active-plan-open:hover { text-decoration: underline; }
.active-plans-empty {
  padding: 16px 20px;
  border: 1px dashed var(--border-input);
  border-radius: 14px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.active-plans-empty a { color: var(--accent-primary); }

/* ── Form panel becomes a transparent wrapper; section cards carry surfaces ── */
.planner-v3 .planner-form-panel {
  position: static;
  max-height: none;
  overflow: visible;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme="dark"] .planner-v3 .planner-form-panel {
  background: transparent;
  border: none;
}

.planner-section-card {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .planner-v3 .planner-section-card {
  background: rgba(26, 26, 26, 0.92);
  border-color: var(--border);
}
@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .planner-section-card { background: var(--bg-card); }
  [data-theme="dark"] .planner-v3 .planner-section-card { background: var(--bg-secondary); }
}

.planner-section-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-primary);
}
.planner-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.planner-card-header .planner-section-title { margin-bottom: 0; }
.planner-card-header { margin-bottom: 16px; }
#section-quickstart .planner-card-header { margin-bottom: 0; }
.planner-section-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Wraps the remaining Section 4 card (Photography Style moved into Section 2
   as a trip-level default — Phase 5 planner-style rework, 2026-08-10); single
   column now that there's only one card, kept as a grid for spacing parity. */
.planner-section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 28px;
}
.planner-section-grid .planner-section-card { margin-bottom: 0; }

/* ── Progressive sections (2026-09-08) ──────────────────────────────────────
   Accordion wrappers over the existing input groups (see the .planner-acc
   comment in planner.html). Same collapse language as Quickstart / Active
   Plans: body.hidden + aria-expanded + a rotating caret, no height animation.
   Header is a 3-column grid — status · title · caret — with the summary on
   its own row under the title, so a long summary wraps instead of fighting
   the caret for width. Hairline separators only; the card supplies the
   surface. */
.planner-acc { border-top: 1px solid var(--border); }
.planner-acc-heading { margin: 0; }
.planner-acc-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  grid-template-areas: "status title caret" ". summary caret";
  column-gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 10px 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
  font: inherit;
  color: var(--text-primary);
  cursor: pointer;
}
.planner-acc-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.planner-acc-status {
  grid-area: status;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--color-success);
  text-align: center;
}
.planner-acc-status:empty { visibility: hidden; }
.planner-acc-title {
  grid-area: title;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}
.planner-acc-caret {
  grid-area: caret;
  font-size: 0.8em;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}
.planner-acc.is-open .planner-acc-caret { transform: rotate(90deg); }
.planner-acc-summary {
  grid-area: summary;
  min-width: 0;
  margin-top: 2px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.planner-acc.is-open .planner-acc-summary { display: none; }
.planner-acc-body { padding: 4px 0 8px; }
.planner-acc-body[hidden] { display: none; }
/* Gear card: its own header is the accordion header — the card title keeps
   its size/colour, minus the 16px bottom margin the standalone h3 carried. */
.planner-acc-title.planner-section-title { margin: 0; }
#section-gear-detail .planner-acc-toggle { padding: 0; }
#section-gear-detail .planner-acc-body { padding: 16px 0 0; }
/* The day-by-day plan stays a standing block between the When & Where and
   Notes rows — same hairline so the column reads as one rhythm. */
.planner-acc + #detailed-itinerary-section { border-top: 1px solid var(--border); padding-top: 14px; }
@media (prefers-reduced-motion: reduce) {
  .planner-acc-caret { transition: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Step 19 — Chunk 2: left-column card restyle (flag: body.planner-shell)
   ──────────────────────────────────────────────────────────────────────────
   Flag OFF: none of these rules match — the base .planner-section-card /
   .planner-section-grid rules above (glass, 16px radius, 24px/28px padding,
   side-by-side 3/4) stay exactly as shipped. Flag ON: flat cards, no blur, no
   shadow, matching design-mocks/design_handoff_aperture22_beta/
   "Planner Redesign.dc.html" — plus sections 3/4 stack full-width since the
   shell's left track is a fixed 560px, not a viewport-width column, so the
   860px collapse media query never fires there.
   ══════════════════════════════════════════════════════════════════════════ */

/* 2A — flat cards */
body.planner-shell .planner-section-card {
  background: var(--bg-card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: var(--radius-xl);
  padding: 14px;
  margin-bottom: 18px;
  box-shadow: none;
}
/* Base dark-mode override (.planner-v3 .planner-section-card) outranks the
   rule above on specificity alone (three classes vs. two) — restate it here
   with an extra selector segment so the flat background wins in dark too. */
[data-theme="dark"] body.planner-shell .planner-section-card {
  background: var(--bg-card);
}

/* Quickstart (section 1) is the one card whose padding lives on its inner
   header/body rows instead of the card itself in the mock — card padding
   goes to zero, header row and body carry it instead. */
body.planner-shell #section-quickstart .planner-card-header { justify-content: flex-start; gap: 6px; padding-bottom: 10px; }
body.planner-shell #section-quickstart .quickstart-body {
  margin-top: 0;
  padding: 2px 0 14px;
}

/* 2B — Section 4's card gets the shell's tighter gap/margin instead of the
   base spacing. */
body.planner-shell .planner-section-grid {
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

/* Session posture strip (list-navigation redesign, Item 3b) — the top-of-column
   notice that shows when the Builder holds a session. Not shell-gated (the
   posture is true either way); plain [hidden] toggling. */
.planner-session-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.planner-session-bar[hidden] { display: none; }
.planner-plan-identity {
  position: sticky;
  top: var(--nav-height);
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.planner-plan-identity[hidden] { display: none; }
/* Row 1: ‹ · title and meta · ⋯. Row 2 (.planner-plan-actions) wraps below. */
#planner-all-plans-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-secondary);
}
/* Top-aligned, not centred: a two-line title must not push ⋯ down over its
   menu, which opens at a fixed 48px. */
#planner-all-plans-btn,
.planner-plan-menu-btn { align-self: flex-start; }
#planner-all-plans-btn[hidden] { display: none; }
#planner-all-plans-btn:hover { color: var(--text-heading); background: transparent; border-color: var(--border-hover); }
.planner-plan-heading { flex: 1; min-width: 0; }
.planner-plan-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-heading);
}
.planner-plan-title-row { display: flex; align-items: flex-start; gap: 4px; }
.planner-plan-rename-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: -3px;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.planner-plan-rename-btn[hidden] { display: none; }
.planner-plan-rename-btn:hover { color: var(--text-heading); }
.planner-plan-rename-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.planner-plan-rename { display: none; }
.planner-plan-identity.is-renaming .planner-plan-title-row,
.planner-plan-identity.is-renaming .planner-plan-meta { display: none; }
.planner-plan-identity.is-renaming .planner-plan-rename { display: block; }
.planner-plan-title-input {
  box-sizing: border-box;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--accent-fill);
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  box-shadow: 0 0 0 3px var(--accent-glow);
  color: var(--text-heading);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  outline: none;
}
.planner-plan-rename-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.planner-plan-rename-save,
.planner-plan-rename-cancel {
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.planner-plan-rename-save { border: none; background: var(--accent-fill); color: var(--accent-on); font-weight: 600; }
.planner-plan-rename-save:hover { background: var(--accent-hover); }
.planner-plan-rename-cancel { border: 1px solid var(--border-input); background: transparent; color: var(--text-primary); }
.planner-plan-rename-hint { font-size: 12px; color: var(--text-muted); }
.planner-plan-rename-error { margin: 6px 0 0; font-size: 12px; color: var(--color-error); }
.planner-plan-rename-error[hidden] { display: none; }
.planner-plan-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
}
/* The row's status is a coloured label, not a pill; JS rewrites its text and
   class, so the icon is a ::before. The id outranks the dark-theme pill rules. */
#planner-plan-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 0;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--accent-on-tint);
}
#planner-plan-status::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--accent-fill);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 38 38'%3E%3Ccircle cx='19' cy='19' r='17' fill='none' stroke='%23000' stroke-width='3'/%3E%3Cpath d='M19 9.5 27.2 14.2v9.6L19 28.5l-8.2-4.7v-9.6z'/%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 38 38'%3E%3Ccircle cx='19' cy='19' r='17' fill='none' stroke='%23000' stroke-width='3'/%3E%3Cpath d='M19 9.5 27.2 14.2v9.6L19 28.5l-8.2-4.7v-9.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
#planner-plan-status.draft,
#planner-plan-status.generating { color: var(--text-secondary); }
#planner-plan-status.generating::before { background: currentColor; }
#planner-plan-status.draft::before {
  background: currentColor;
  -webkit-mask-image: var(--a22-mask-pending);
  mask-image: var(--a22-mask-pending);
}
.planner-plan-lineage {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.planner-plan-lineage::before { content: "/"; margin-right: 6px; color: var(--text-muted); }
.planner-plan-lineage[hidden] { display: none; }
.planner-plan-actions {
  display: flex;
  flex: 1 0 100%;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 2px;
}
/* With Edit as new draft in ⋯, a generating plan in Review has nothing for
   row 2; the empty row would still take its gap. */
.planner-plan-actions:not(:has(> :not([hidden], #planner-review-edit-btn))) { display: none; }
.planner-save-chip {
  flex: none;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: default;
}
.planner-save-chip.not-saving { color: var(--accent-primary); border-color: var(--accent-fill); }
.planner-save-chip[hidden] { display: none; }
.planner-plan-menu-btn {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}
.planner-plan-menu-btn:hover,
.planner-plan-menu-btn[aria-expanded="true"] { border-color: var(--accent-fill); color: var(--accent-primary); }
.planner-plan-menu-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.planner-plan-menu {
  position: absolute;
  top: 48px;
  right: 8px;
  z-index: 1100;
  width: 230px;
  padding: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
}
.planner-plan-menu[hidden] { display: none; }
.planner-plan-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}
.planner-plan-menu button[hidden] { display: none; }
.planner-plan-menu button svg { flex: none; }
.planner-plan-menu button:hover,
.planner-plan-menu button:focus-visible { outline: none; background: var(--accent-light); }
.planner-plan-menu [data-plan-menu="copy"] { color: var(--accent-primary); font-weight: 700; }
.planner-plan-menu [aria-checked="true"]::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  background: currentColor;
  -webkit-mask: var(--a22-mask-check) center / contain no-repeat;
  mask: var(--a22-mask-check) center / contain no-repeat;
  margin-left: 4px;
  color: var(--accent-primary);
}
.planner-plan-menu hr { margin: 6px 4px; border: none; border-top: 1px solid var(--border); }
@media (max-width: 600px) {
  .planner-plan-lineage { display: none; }
  .planner-plan-actions { flex-wrap: wrap; }
  .planner-plan-actions .planner-edit-mode-toggle { min-width: 160px; }
}
/* Start a new plan's guide (JS: syncPlanGuide): the stop halo's crisp ring. */
[data-guide-next] { border-radius: var(--radius-xl); box-shadow: 0 0 0 2px var(--accent-primary), 0 0 0 6px var(--accent-light); }
:is(.planner-acc, #detailed-itinerary-section)[data-guide-next] { padding-left: 10px; padding-right: 10px; margin-left: -10px; margin-right: -10px; }
.planner-guide-hint {
  width: fit-content;
  margin: 0 0 8px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
  background: var(--accent-light);
  color: var(--accent-on-tint);
}
.planner-guide-hint[hidden] { display: none; }
.planner-acc > .planner-guide-hint { margin-left: 26px; }
.planner-sticky-bar > .planner-guide-hint { flex-basis: 100%; margin: 0; }
/* Nothing open: heading, instructions, the tutorial row, Start a new plan,
   then Active Plans, no Builder (JS: syncPlanIdentity). Text keeps its
   natural width; the controls share the column's full width. CSS order
   only: .planner-start's two children join the header's column. */
.planner-start { display: none; }
#planner-interface[data-builder="start"] .planner-form-panel { display: none; }
#planner-interface[data-builder="start"] .planner-page-header-text { display: flex; flex-direction: column; align-items: flex-start; }
#planner-interface[data-builder="start"] :is(.planner-start, .planner-title-actions) { display: contents; }
.planner-start-text { order: 1; margin: 4px 0 0; max-width: 44ch; font-size: 0.9rem; line-height: 1.55; color: var(--text-secondary); }
#planner-interface[data-builder="start"] .planner-page-actions-row { order: 2; align-self: stretch; }
#planner-interface[data-builder="start"] .planner-page-actions-row :is(#tutorial-pill, .planner-beta-feedback-slot > *, #planner-focus-toggle) { flex: 1 1 0; justify-content: center; }
#planner-start-btn { order: 3; align-self: stretch; margin-top: 16px; padding: 14px 18px; font-size: 1rem; }
#planner-interface[data-builder="start"] .active-plans-cards { flex-direction: column; }
#planner-interface[data-builder="start"] .active-plan-card { min-width: 0; max-width: none; }
@media (min-width: 681px) {
  body.planner-shell #planner-interface[data-builder="start"] #planner-left-col { min-height: calc(100vh - var(--nav-height)); }
}
/* Starting-view art: Fagradalsfjall contours (ÍslandsDEM, CC BY 4.0 — credit
   in terms.html#credits), left column only, never the map. Two alpha masks so
   the lines take --topo-line and the one index contour --topo-index at 5×.
   The fade keeps the preview's stops (6% → 35% → full) but runs top-down in px:
   the column's text spans its full width, so a %-placed ellipse let the index
   line cross the heading at 390. isolation keeps the z-index:-1 layers above
   the column's own --bg-card. A ?planId=…&view=viewer open leaves the start
   state underneath the full-screen Viewer, hence the plan-viewer-open guard. */
#planner-interface[data-builder="start"] #planner-left-col { position: relative; isolation: isolate; }
body:not(.plan-viewer-open) #planner-interface[data-builder="start"] #planner-left-col::before,
body:not(.plan-viewer-open) #planner-interface[data-builder="start"] #planner-left-col::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  --topo-fade: linear-gradient(rgb(0 0 0 / 0.06) 340px, rgb(0 0 0 / 0.35) 460px, black 600px);
  -webkit-mask: var(--topo-art) center / cover no-repeat, var(--topo-fade);
  -webkit-mask-composite: source-in;
  mask: var(--topo-art) center / cover no-repeat, var(--topo-fade);
  mask-composite: intersect;
}
#planner-interface[data-builder="start"] #planner-left-col::before {
  --topo-art: url(/img/topo/iceland-c.svg);
  background: var(--topo-line);
  opacity: var(--topo-art-o);
}
#planner-interface[data-builder="start"] #planner-left-col::after {
  --topo-art: url(/img/topo/iceland-c-index.svg);
  background: var(--topo-index);
  opacity: calc(var(--topo-art-o) * 5);
}
@media print {
  #planner-interface[data-builder="start"] #planner-left-col::before,
  #planner-interface[data-builder="start"] #planner-left-col::after { display: none; }
}
/* A plan's row is the only header while it is open (JS: syncPlanIdentity). */
#planner-interface.plan-open .planner-page-header,
#planner-interface.plan-open:not(.plan-live) #active-plans-strip { display: none; }
/* A jump to a Review day lands below the stuck row (top: var(--nav-height)). */
#planner-interface[data-edit-mode="review"] .day-card {
  scroll-margin-top: calc(var(--nav-height) + var(--plan-row-h, 0px) + 8px);
}
body.planner-shell #planner-interface.plan-open #planner-left-col { padding-top: 8px; }
.plan-card-lineage { color: var(--text-secondary); font-style: italic; }
.planner-session-bar-text {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
}
.planner-session-new-btn {
  flex: none;
  padding: 5px 12px;
  font-size: 0.74rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.planner-session-new-btn:hover {
  color: var(--accent-primary);
  background: var(--bg-card);
  border-color: var(--accent-fill);
}
.planner-session-new-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
  border-color: var(--accent-fill);
}
/* Edit as new draft lives in the ⋯ menu; the menu's copy action still
   .click()s this button, and JS still syncs its hidden/disabled state. */
#planner-review-edit-btn { display: none; }

/* ── Plan-edit mode toggle (2026-08-25 editing-toggle consolidation) ───────
   The one control that switches between the two ways of editing a generated
   plan. It lives in the session strip because that strip already states what
   this Builder is holding and is pinned above the form on every load. It
   replaces #back-to-edit-btn and the right panel's one-directional back
   button — one switch, both directions. */
.planner-edit-mode-toggle {
  display: inline-flex;
  flex: 1;
  gap: 2px;
  box-sizing: border-box;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-lg);
  background: transparent;
}
.planner-edit-mode-toggle[hidden] { display: none; }
.planner-edit-mode-btn {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.planner-edit-mode-btn:hover:not(.active) { color: var(--text-primary); }
.planner-edit-mode-btn.active {
  background: var(--accent-light);
  color: var(--accent-on-tint);
  font-weight: 600;
}
[data-full-plan-view]::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--switch-icon) center / contain no-repeat;
  mask: var(--switch-icon) center / contain no-repeat;
}
[data-full-plan-view="map"] { --switch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linejoin='round'%3E%3Cpath d='M1.5 3.8 5.5 2.2l5 1.8 4-1.6v9.8l-4 1.6-5-1.8-4 1.6zM5.5 2.2V12M10.5 4v9.8'/%3E%3C/svg%3E"); }
[data-full-plan-view="plan"] { --switch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 4h8M6 8h8M6 12h8' stroke='%23000' stroke-width='1.4' stroke-linecap='round'/%3E%3Ccircle cx='2.8' cy='4' r='1'/%3E%3Ccircle cx='2.8' cy='8' r='1'/%3E%3Ccircle cx='2.8' cy='12' r='1'/%3E%3C/svg%3E"); }
.planner-edit-mode-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.planner-edit-mode-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* 2D — left-column top-to-bottom order (loop-first: Active Plans surfaces
   before the Quickstart/Trip-Basics form). #planner-left-col's direct
   children (header, #active-plans-strip, #planner-session-bar,
   .planner-form-panel) are true flex siblings under the Chunk 0 shell rule
   (body.planner-shell #planner-left-col { display: flex; flex-direction:
   column; }), so `order` alone reaches the target without touching markup —
   Quickstart already precedes Trip Basics inside .planner-form-panel. */
body.planner-shell .planner-page-header { order: 0; }
body.planner-shell #active-plans-strip { order: 1; }
body.planner-shell .planner-plan-identity,
body.planner-shell .planner-session-bar { order: 2; }
body.planner-shell .planner-form-panel { order: 3; }

/* ── Section 1 · Optional Quickstart ── */
.section-info-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;   /* glyph badge in a 20px circle — 1rem overflows */
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.section-info-btn:hover { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--accent-fill); }
/* Shell only: rest state was transparent-bordered (discoverable only on
   hover) — same 1px width as hover so the colour swap causes no layout
   shift, using the app's standard input-border token so dark mode follows
   automatically. Scoped so flag-OFF geometry (already shipped) is untouched. */
body.planner-shell .section-info-btn { border-color: var(--color-border-input); }
body.planner-shell .section-info-btn:hover { border-color: var(--accent-fill); }
.quickstart-toggle {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.quickstart-toggle:hover { background: var(--bg-glass); border-color: var(--accent-fill); color: var(--text-primary); }
.quickstart-toggle.is-expanded { color: var(--text-secondary); }
/* Same caret language as the progressive sections: the glyph carries the
   open/closed state, the accessible name carries the words. */
.quickstart-caret {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.8em;
  transition: transform 0.2s ease;
}
.quickstart-toggle.is-expanded .quickstart-caret { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
  .quickstart-caret { transition: none; }
}
.quickstart-info-panel {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.quickstart-body { margin-top: 18px; }
.quickstart-body .form-group:last-child { margin-bottom: 0; }

/* ── Sticky action bar ── */
/* Action bar sits inline at the natural end of the form and scrolls with it.
   (Was position:sticky bottom:16px — floated over the form in both the
   single-column planner and the app-shell; removed by request. This overrides
   the mock, which pins it to the left column.) */
.planner-sticky-bar-wrap {
  margin-top: 28px;
}
.planner-sticky-bar {
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
[data-theme="dark"] .planner-sticky-bar {
  background: var(--bg-secondary);
}
.planner-sticky-spacer { flex: 1; min-width: 8px; }
.planner-v3 .preflight-btn-row {
  margin-bottom: 0;
  flex: 0 1 auto;
}
.planner-v3 .preflight-btn-row .preflight-btn {
  flex: 0 1 auto;
  width: auto;
  margin-bottom: 0;
  padding: 10px 16px;
  font-size: 0.9rem;
}
.planner-v3 .preflight-status {
  margin: 0;
  font-size: 0.8rem;
}
.preflight-status.is-gate-hint { color: var(--text-secondary); }
.planner-v3 .generate-btn,
.planner-v3 .save-draft-btn {
  width: auto;
  padding: 10px 22px;
  font-size: 0.95rem;
  white-space: nowrap;
}
/* Keep the Generate button clear of the fixed Companion bubble */
@media (max-width: 1180px) {
  .planner-sticky-bar-wrap { margin-right: 84px; }
}
@media (max-width: 640px) {
  .planner-sticky-bar-wrap { margin-right: 0; }
  .planner-sticky-bar { gap: 10px; }
  .planner-v3 .generate-btn { flex: 1 1 100%; }
}

/* ── Step 19 — Chunk 4: action-bar regroup (flag: body.planner-shell) ──────
   Base .planner-sticky-bar is one wrapping flex row: [Pre-Flight+info] ·
   [status] · [spacer] · [Generate] — the spacer shoves Generate to the far
   edge, leaving the ⓘ, the "Lock in locations…" gate hint, and the two
   buttons reading as disconnected pieces on the shell's narrower left-
   column track. Reflowed via flex-wrap + order, no markup change (matches
   design-mocks/.../Planner Redesign.dc.html:556-571's status-line-above-
   button-row spec): #preflight-status is forced full-width via
   flex-basis:100% so flex-wrap breaks it onto its own line above; the old
   spacer is dropped; Pre-Flight (grows, keeps its attached ⓘ) and Generate
   (fixed width, unchanged) land together as a grouped pair on the row
   below. When the status line is [hidden] (default gated state) it
   contributes no box, so only the button pair renders. */
body.planner-shell #preflight-status {
  order: 0;
  flex: 1 1 100%;
  margin: 0;
}
/* Item 3a (list-navigation redesign), second half: flex:1 1 auto was right
   for a two-item pair, but there are four items now and Pre-Flight plus the
   three session actions never fit one ~500px line — the wrap fell wherever
   the widths happened to land, pairing Pre-Flight with whatever followed and
   orphaning the rest. The gate gets its own full line; the three session
   actions then land together on the row beneath it, in order. */
body.planner-shell .preflight-btn-row {
  order: 1;
  flex: 1 1 100%;
}
/* The base app (.planner-v3 .preflight-btn-row .preflight-btn, unscoped)
   pins the button itself to flex:0 1 auto — content-width, non-growing —
   which is correct for the pre-shell single-column layout but leaves the
   button undersized once its row is stretched to fill the shell's action
   pair. Restore grow so it fills the row per the mock's flex:1 spec. */
body.planner-shell .preflight-btn-row .preflight-btn {
  flex: 1 1 auto;
}
body.planner-shell .planner-sticky-spacer { display: none; }
body.planner-shell #draft-autosave-status {
  order: 0;
  flex: 1 1 100%;
}
/* Item 3a (list-navigation redesign): "Start a new plan" shipped with no
   order at all, so it inherited order:0 and wrapped up onto the status line
   with #preflight-status and #draft-autosave-status — reading as a
   Pre-Flight control rather than a session one. It belongs with the other
   two session-level actions, ahead of them: leave, save, generate. */
body.planner-shell #planner-new-plan-btn {
  order: 2;
  flex: 0 0 auto;
}
body.planner-shell #planner-save-draft-btn {
  order: 3;
  flex: 0 0 auto;
}
body.planner-shell #planner-generate-btn {
  order: 4;
  flex: 0 0 auto;
}
/* Outline treatment per the mock — the softer text-primary label color (was
   text-heading); background/hover/disabled states are unchanged from the base
   .preflight-btn, which now carries the shared 1px border. */
body.planner-shell .preflight-btn {
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════════════════════
   Step 19 — right-panel view-swap + generated-plan output as tabs
   (flag: body.planner-shell)
   ──────────────────────────────────────────────────────────────────────────
   #planner-right-panel hosts three sibling views (JS: mountRightPanelViews /
   setRightPanelView, keyed off its own [data-view] attribute) — exactly one
   visible at a time: 'map' (the Chunk 1 building map, default), 'plans'
   (#my-plans-section, reparented in), 'plan' (.planner-output-panel,
   reparented in — its #plan-display is where the tabbed generated-plan view
   below actually renders). Flag OFF: mountRightPanelViews() no-ops and this
   markup is never created, so every rule here is inert. ══════════════════ */
body.planner-shell #planner-right-panel .right-panel-view { display: none; }
body.planner-shell #planner-right-panel[data-view="map"] .right-panel-view-map {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}
body.planner-shell #planner-right-panel[data-view="plans"] .right-panel-view-plans,
body.planner-shell #planner-right-panel[data-view="pins"] .right-panel-view-plans,
body.planner-shell #planner-right-panel[data-view="plan"] .right-panel-view-plan {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 22px 28px;
}

/* All Plans, reparented into the plans view. Chunk 0/1's suppression rule
   (body.planner-shell #my-plans-section { display: none; }, above) predates
   this move and still runs first in the cascade — this is more specific
   (an extra class ancestor) so it wins without !important. Drop the
   page-scroll-era max-width/centering now that it's a right-panel view. */
body.planner-shell .right-panel-view-plans #my-plans-section {
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* The generated-plan output, reparented into the plan view — strip its
   floating-card chrome (background/border/shadow/padding), the same way the
   base .planner-v3 .planner-form-panel rule already strips the form panel's:
   the right panel itself is the surface now. */
body.planner-shell .right-panel-view-plan .planner-output-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  min-height: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ── Mode 2: editing the generated plan (JS: setPlanEditMode → the
   data-edit-mode attribute on #planner-interface) ──────────────────────────
   The generated plan gets the whole shell: the form track collapses and the
   output panel — which is already the right panel's 'plan' view, so the map
   is already gone — runs full-width beneath the session strip that carries
   the toggle back. This is the same map-disappears/content-shows transition
   live generation drives (setPlannerView('output') → setRightPanelView
   ('plan')); this only widens the track it lands in. Scoped to .view-output
   so a transient form render mid-switch never lands in this layout, which is
   also what makes the two modes mutually exclusive by construction. */
body.planner-shell #planner-interface[data-edit-mode="generated"].view-output {
  grid-template-columns: minmax(0, 1fr);
  row-gap: 0;
}
body.planner-shell #planner-interface[data-edit-mode="generated"].view-output #planner-left-col {
  grid-column: 1; grid-row: 1;
  min-width: 0;
  border-right: none;
  padding-bottom: 0;
}
body.planner-shell #planner-interface[data-edit-mode="generated"].view-output #planner-right-panel {
  grid-column: 1; grid-row: 2;
  min-width: 0;
}
/* The Builder column goes; the plan row stays, with ← All plans. */
body.planner-shell #planner-interface[data-edit-mode="generated"].view-output .planner-form-panel {
  display: none;
}
/* ── Review: a generated plan's setup, read-only (JS: applyReviewLock) ─────
   Structural controls are removed rather than greyed — a greyed add button
   reads as a broken editor. Locked fields and pills keep full strength so the
   chosen values read as content. */
#planner-interface[data-edit-mode="review"] :is(
  #section-quickstart, .planner-sticky-bar-wrap, #add-day-btn, .day-remove-btn,
  .subplanner-save, .subplanner-add-row, .transit-day-add-stop,
  .day-editor-stop-remove, .day-editor-stop-handle, .subplanner-stop-move,
  .subplanner-stop-marker-btn, .subplanner-stop-arm, .subplanner-place-search,
  .subplanner-scout-search, .subplanner-origin-arm, .subplanner-origin-chain-chip,
  .subplanner-origin-gps-name-hint, .subplanner-end-same-chip, .subplanner-end-origin,
  .subplanner-end-returns-clear, .subjects-actions-row, .positions-actions-row,
  .positions-mode-row, .event-subject-remove, .event-subject-move,
  .event-position-remove, .event-position-move, .event-position-plot,
  .event-subject-plot, .event-position-ai-fill, .event-subject-dial-btn,
  .event-subject-style-clear, .research-block, .subplanner-pin-popup-actions) {
  display: none;
}
/* Review shows a stop's subjects and positions as headings over their shot cards, nothing else from setup (JS: renderReviewShotCards) */
#planner-interface[data-edit-mode="review"] .subplanner-stop-expanded > :not(.review-shot-list, .subplanner-shoot-only),
#planner-interface[data-edit-mode="review"] .subplanner-shoot-fields > :not(.stop-subjects-block, .stop-positions-block) { display: none; }
.review-shot-slot { margin: 2px 0; }
.review-shot-list .plan-viewer-shot-row { padding-left: 6px; }
/* JS: syncShotDone. inline-block keeps the line-through off the tick. */
.review-shot-done .plan-viewer-shot-label { color: var(--text-muted); text-decoration: line-through; }
.review-shot-done .plan-viewer-shot-label::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  background: currentColor;
  -webkit-mask: var(--a22-mask-check) center / contain no-repeat;
  mask: var(--a22-mask-check) center / contain no-repeat;
  margin-right: 4px;
  color: var(--accent-primary);
}
/* JS: renderReviewAiStops */
.review-ai-stop { margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: var(--radius-md); }
.review-ai-stop-head { display: flex; align-items: baseline; gap: 8px; font-weight: 600; color: var(--text-primary); }
/* Single Event: the venue, its subjects and positions as headings over their shots; no setup */
#planner-interface[data-edit-mode="review"] :is(
  .subplanner-origin-card:has(.subplanner-venue-slot) .subplanner-origin-gps-label, #gps-indicator-event-venue,
  .event-subject-label-count, .event-subject-fields, .event-subject-duration, .event-subject-style,
  .event-subject-noplot, .event-positions-toggle-all, .event-position-toggle, .event-position-no-pin, .event-position-fields) {
  display: none;
}
#planner-interface[data-edit-mode="review"] .event-position-row > .review-shot-list { display: block; }
#planner-interface[data-edit-mode="review"] .review-pin-dim { opacity: 0.4; }
#planner-interface[data-edit-mode="review"] .review-pin-glow .journey-pin-body {
  box-shadow: 0 0 0 3px var(--accent-fill), 0 0 14px 6px rgba(224, 130, 26, 0.55);
  animation: reviewPinPulse 0.9s ease-out 1;
}
@keyframes reviewPinPulse {
  0% { box-shadow: 0 0 0 0 var(--accent-fill), 0 0 0 0 rgba(224, 130, 26, 0); }
  50% { box-shadow: 0 0 0 8px var(--accent-fill), 0 0 26px 12px rgba(224, 130, 26, 0.8); }
}
@media (prefers-reduced-motion: reduce) {
  #planner-interface[data-edit-mode="review"] .review-pin-glow .journey-pin-body { animation: none; }
}
.review-shot-slot[data-lat] { cursor: pointer; }
/* JS: fullPlanReveal. A timer clears it, so no animation is needed to show it. */
#plan-display .full-plan-nav-flash { box-shadow: 0 0 0 2px var(--accent-fill); border-radius: var(--radius-md); }
#planner-interface[data-edit-mode="review"] [data-review-inert] .subplanner-stop-expand { display: none; }
#planner-interface[data-edit-mode="review"] [data-review-inert] .subplanner-stop-badge { pointer-events: none; cursor: default; }
/* A stop with shot cards: a crisp ring (no blur, unlike the map pin glow) and
   a count chip. The chip hangs below the badge: the handle beside it is hidden
   in Review and the stop number sits 8px to its right. */
#planner-interface[data-edit-mode="review"] .subplanner-stop-badge[data-review-shots] {
  --review-ring: 0 0 0 2px var(--accent-primary);
  position: relative;
  box-shadow: var(--review-ring);
}
#planner-interface[data-edit-mode="review"] .review-shot-count {
  --review-ring: 0 0 0 2px var(--bg-primary), 0 0 0 3.5px var(--accent-primary);
  box-shadow: var(--review-ring);
}
#planner-interface[data-edit-mode="review"] .subplanner-stop-badge[data-review-shots]::after,
#planner-interface[data-edit-mode="review"] .review-shot-count {
  padding: 0 4px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 13px;
  white-space: nowrap;
  background: var(--accent-fill);
  color: var(--accent-on);
}
#planner-interface[data-edit-mode="review"] .subplanner-stop-badge[data-review-shots]::after {
  content: attr(data-review-shots);
  padding-left: 18px;
  background-image: var(--a22-img-camera-dark);
  background-repeat: no-repeat;
  background-position: 4px center;
  background-size: 11px;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -3px);
  box-shadow: 0 0 0 1px var(--bg-primary);
  pointer-events: none;
}
.review-ai-stop-head .review-shot-count { align-self: center; }
.review-stop-pulse :is(.subplanner-stop-badge[data-review-shots], .review-shot-count) {
  animation: reviewStopPulse 0.9s ease-out 1;
}
@keyframes reviewStopPulse {
  50% { box-shadow: var(--review-ring), 0 0 0 7px var(--accent-light); }
}
@media (prefers-reduced-motion: reduce) {
  .review-stop-pulse :is(.subplanner-stop-badge[data-review-shots], .review-shot-count) { animation: none; }
}

/* Review: days first, then one Trip setup row the rest of the setup folds
   under (JS: syncReviewTripSetup). CSS order only — the DOM is unchanged. */
.review-trip-setup { display: none; }
#planner-interface[data-edit-mode="review"] #section-trip-basics { display: flex; flex-direction: column; }
#planner-interface[data-edit-mode="review"] #section-trip-basics > * { order: 2; }
#planner-interface[data-edit-mode="review"] #section-trip-basics > #detailed-itinerary-section { order: 0; border-top: 0; padding-top: 0; }
#planner-interface[data-edit-mode="review"] :is(#section-trip-basics > .planner-card-header, .subplanner-label-row, #subplanner-subtext) { display: none; }
#planner-interface[data-edit-mode="review"] #planner-form:has(#review-trip-setup[aria-expanded="false"]) :is(#section-trip-basics > .planner-acc, .planner-section-grid) { display: none; }
#planner-interface[data-edit-mode="review"] #section-trip-basics > .review-trip-setup {
  order: 1;
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  text-align: left;
  font: inherit;
  color: var(--text-secondary);
  cursor: pointer;
}
.review-trip-setup-title { font-size: 0.875rem; font-weight: 600; }
.review-trip-setup-caret { display: inline-block; transition: transform 0.2s ease; }
.review-trip-setup[aria-expanded="true"] .review-trip-setup-caret { transform: rotate(90deg); }
.review-trip-setup-summary { font-size: 0.8125rem; overflow-wrap: anywhere; }
.review-trip-setup-summary:empty,
.review-trip-setup[aria-expanded="true"] .review-trip-setup-summary { display: none; }
.review-trip-setup:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); border-radius: 8px; }
@media (prefers-reduced-motion: reduce) {
  .review-trip-setup-caret { transition: none; }
}

#planner-interface[data-edit-mode="review"] [data-review-locked]:disabled {
  opacity: 1;
  cursor: default;
}
#planner-interface[data-edit-mode="review"] [data-review-locked]:read-only {
  cursor: default;
}
/* Review's Full plan: the tabbed output, read beside the setup. Its write
   controls and View plan go; it scrolls on its own, as the map does, so it starts beside
   wherever the setup is scrolled. */
#planner-interface[data-edit-mode="review"] #plan-display :is(.plan-edit-btn, .location-complete-btn, .gear-preselect, .plan-viewer-launch) {
  display: none;
}
/* Each tab is its own page: no day pills, no folds, no heading the tab name
   already says. Screen readers still hear the heading; the Day-by-Day bar
   goes. Mode 2 re-renders on entry and keeps all three. */
#planner-interface[data-edit-mode="review"] #plan-display :is(.plan-nav, .plan-section > .planner-section-header[data-section="itinerary"], .plan-section > .planner-section-header .section-indicator) {
  display: none;
}
#planner-interface[data-edit-mode="review"] #plan-display .plan-section > .planner-section-header {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
#planner-interface[data-edit-mode="review"] #plan-display .plan-section > .planner-section-body {
  display: block; animation: none;
}
/* A day opens on its map, sized and framed like the Overview's; its title
   follows. The badge row stays only while Google draws road routes. */
#planner-interface[data-edit-mode="review"] #plan-display .journey-map-wrap { margin: 0 0 16px; border-color: var(--color-border); border-radius: 12px; isolation: isolate; }
#planner-interface[data-edit-mode="review"] #plan-display .journey-map-header h4,
#planner-interface[data-edit-mode="review"] #plan-display .journey-map-header:not(:has(.journey-map-routed-badge:not([hidden]))) { display: none; }
#planner-interface[data-edit-mode="review"] #plan-display .journey-map { height: 280px; }
@media (max-width: 680px) { #planner-interface[data-edit-mode="review"] #plan-display .journey-map { height: 200px; } }
body.planner-shell #planner-interface[data-edit-mode="review"] #planner-right-panel[data-view="plan"] {
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}
@media (max-width: 680px) {
  body.planner-shell #planner-interface[data-edit-mode="review"] #planner-right-panel[data-view="plan"] {
    position: static; height: auto; overflow-y: visible;
  }
}

/* The shell keeps the form always visible in the left column — only the
   OUTPUT swaps into the right panel — so the base single-column-IA rule that
   hides the form panel while #planner-interface.view-output is set (Phase 1,
   never edited directly per ground rules) must not apply here. The extra ID
   gives this override higher specificity regardless of source order. */
body.planner-shell #planner-interface.view-output .planner-form-panel {
  display: block;
}

/* ── generated-plan output as tabs ──
   Tab mode is gated by .plan-tabs-active on the .plan-display root. Without
   it (progressive generation streaming) the bar hides and every panel stays
   visible — the flat pre-tab look until finalize (planner.js: activatePlanTabs). */
body.planner-shell .plan-display .plan-tabs { display: none; }
body.planner-shell .plan-display.plan-tabs-active .plan-tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin: 12px 0;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-secondary);
}
/* The page scrolls here, under the sticky site navbar. */
@media (max-width: 680px) {
  body.planner-shell .plan-display.plan-tabs-active .plan-tabs { top: var(--nav-height); }
}
body.planner-shell .plan-tab-btn {
  padding: 9px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
body.planner-shell .plan-tab-btn:hover { color: var(--text-primary); }
body.planner-shell .plan-tab-btn.active {
  color: var(--text-heading);
  border-bottom-color: var(--accent-fill);
}
body.planner-shell .plan-display.plan-tabs-active .plan-tab-panel { display: none; }
body.planner-shell .plan-display.plan-tabs-active .plan-tab-panel.active { display: block; }

/* Per-tab My Notes (device-local) */
body.planner-shell .plan-tab-notes {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 14px 0 4px;
}
body.planner-shell .plan-tab-notes-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
body.planner-shell .plan-tab-notes-textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  box-sizing: border-box;
  resize: vertical;
  line-height: 1.5;
  font-family: inherit;
}
body.planner-shell .plan-tab-notes-status {
  font-size: 0.72rem;
  color: var(--text-muted);
  min-height: 1em;
}

/* buildPlanDayJumpNavHtml reuses .plan-nav's day-only-pill markup inside the
   Day-by-Day tab panel — its base rule's own position:sticky (unscoped,
   z-index:100) would otherwise stack on top of the ALSO-sticky .plan-tabs
   bar (z-index:5) at the same top:0 of the same scroll container. Drop the
   sticky behavior under the shell; the day-jump pills still read fine as an
   ordinary row at the top of the panel. */
body.planner-shell .plan-tab-panel .plan-nav {
  position: static;
  top: auto;
  z-index: auto;
}

/* ── Output view ── */
.back-to-edit-btn {
  margin-bottom: 16px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-input);
  background: transparent;
  color: var(--text-heading);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.back-to-edit-btn:hover { background: var(--bg-secondary); color: var(--accent-primary); border-color: var(--accent-fill); }

/* ── All Plans header ── */
.my-plans-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.my-plans-header h2 { margin-bottom: 0; }
.archived-toggle-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-input);
  background: transparent;
  color: var(--text-heading);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.archived-toggle-btn:hover { background: var(--bg-secondary); border-color: var(--accent-fill); color: var(--accent-primary); }
.archived-toggle-btn[hidden] { display: none; }

/* ── Plans status filter (list-navigation redesign, Item 1) ────────────────
   Sits between the All Plans header and the Upcoming/Past groups. Same pill
   language as .provider-btn — this is a view switch, not a lifecycle action,
   so it deliberately does NOT borrow .status-btn's look. */
.plans-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: -12px 0 20px;
}
.plans-filter[hidden] { display: none; }
.plans-filter-btn {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.plans-filter-btn:hover {
  color: var(--accent-primary);
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
}
.plans-filter-btn.active {
  color: var(--accent-on);
  background: var(--accent-fill-strong);
  border-color: var(--accent-fill-strong);
}
.plans-filter-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
  border-color: var(--accent-fill);
}
.plans-filter-count {
  opacity: 0.7;
  font-weight: 500;
  margin-left: 2px;
}
.plans-filter-empty {
  margin: 0 0 16px;
  padding: 18px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.plans-filter-empty[hidden] { display: none; }

/* V3 breathing room: section cards space their field groups a touch wider */
.planner-section-card .form-group { margin-bottom: 22px; }
.planner-section-card .form-group:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   Planner V3 — Phase 2: Universal Per-Day Sub-Planner
   Inline accordion inside each .day-card. Tokens only — no hard-coded accent.
   ═══════════════════════════════════════════════════════════════════════════ */

.day-card-expanded { border-color: var(--accent-fill); }

.day-card-subplanner {
  border-top: 1px solid var(--border);
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-card);
}
.day-card-subplanner[hidden] { display: none; }

/* Parent-level day fields: general area / date / time window */
.subplanner-day-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
/* Phase 11a fix 3 (2026-07-14): Single Event hides this block — its own
   [hidden] override, matching .day-card-subplanner[hidden] above, since the
   display:grid rule would otherwise beat the plain [hidden] UA rule. */
.subplanner-day-fields[hidden] { display: none; }
@media (min-width: 720px) {
  .subplanner-day-fields { grid-template-columns: 1.4fr 1fr 1.2fr; }
}

.subplanner-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.subplanner-field > span {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.subplanner-field input[type="text"],
.subplanner-field input[type="date"],
.subplanner-field input[type="time"] {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.85rem;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 8px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 0;
}
.subplanner-field input:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.subplanner-stops h4,
.subplanner-notes h4 {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.subplanner-stops[hidden] { display: none; }

.subplanner-stops-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.subplanner-stop-number {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  white-space: nowrap;
  cursor: pointer;
}

/* Classification pills — single-select, small teal-family pills (PR #561 vocabulary).
   Travel-mode pills (journey legs, 2026-07-10) share the identical spec. */
.subplanner-class-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 8px 8px;
}
.subplanner-class-pill,
.subplanner-span-pill,
.subplanner-meal-pill,
.subplanner-mode-pill {
  padding: 4px 11px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.subplanner-class-pill:hover,
.subplanner-span-pill:hover,
.subplanner-meal-pill:hover,
.subplanner-mode-pill:hover {
  color: var(--color-text-primary);
  background: var(--bg-subtle);
  border-color: var(--accent-fill);
}
.subplanner-class-pill.active,
.subplanner-span-pill.active,
.subplanner-meal-pill.active,
.subplanner-mode-pill.active {
  background: var(--accent-light);
  border-color: var(--accent-fill-strong);
  color: var(--accent-on-tint);
}

/* Multi-day transit span control — lives on the transit stop, since that stop
   IS where the journey lands. Hidden on every other purpose. */
.subplanner-transit-span[hidden] { display: none; }

/* Meal subtype control — lives on the food stop only ("Which meal?").
   Hidden on every other purpose, fully optional on food. */
.subplanner-meal-subtype[hidden] { display: none; }
.subplanner-span-row { align-items: center; padding-bottom: 4px; }
.subplanner-span-input {
  width: 4.5rem;
  padding: 3px 8px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-primary);
  background: var(--bg-input);
  border: 1px solid var(--accent-fill);
  border-radius: var(--radius-pill);
}
.subplanner-span-input[hidden] { display: none; }
.subplanner-span-note {
  margin: 0;
  padding: 0 8px 8px;
  font-size: 0.68rem;
  color: var(--text-secondary);
}
.subplanner-span-note[hidden] { display: none; }

/* In Transit day card — a real, numbered trip day spent aboard a multi-day
   leg. Deliberately minimal: which journey, and somewhere to jot a note. */
.day-card-in-transit {
  border-style: dashed;
  opacity: 0.94;
}
.day-card-transit-badge {
  padding: 2px 8px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-primary);
  background: var(--accent-light);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.day-card-in-transit .day-card-compact { cursor: default; }
.day-card-transit-body { padding: 0 12px 12px; }
.day-card-transit-body .transit-day-note {
  width: 100%;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--color-text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-input, 8px);
  resize: vertical;
}
.transit-day-add-stop {
  margin-top: 8px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--accent-light);
  border: 1px dashed var(--accent-fill);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: filter 0.15s;
}
.transit-day-add-stop:hover { filter: brightness(0.96); }
[data-theme="dark"] .day-card-in-transit { background: var(--bg-card); }

/* Journey stop card (v4, 2026-07-11): compact header line + folded detail
   panel. Labels stack above full-width place rows. */
.subplanner-leg-header { display: flex; align-items: center; gap: 8px; }
.subplanner-leg-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 8px 8px;
}
.subplanner-leg-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.subplanner-place-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* display:flex above overrides the bare [hidden] attribute, so restore it —
   Single Event hides its whole place-row (input + search) since the venue is
   entered once in Trip Basics (D4). Only SE gets the attribute; scope-safe. */
.subplanner-place-row[hidden] { display: none; }
.subplanner-place-row input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 0.8125rem;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
  font-family: inherit;
}
.subplanner-place-row input:focus {
  outline: none;
  border-color: var(--accent-fill);
}
/* Top-level Venue field + its search-to-pin button (Single Event, restored
   after D4 moved the capability off the hidden event card). */
.event-venue-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.event-venue-search-row input {
  flex: 1;
  min-width: 0;
}
.subplanner-place-search {
  flex-shrink: 0;
  padding: 6px 9px;
  font-size: 1rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.subplanner-place-search:hover { background: var(--bg-secondary); border-color: var(--accent-fill); color: var(--text-primary); }
.subplanner-pin-status {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.subplanner-pin-status.pinned { color: var(--color-success); }
/* Plotted from a departure point, not confirmed — reads quieter than either */
.subplanner-pin-status.provisional {
  color: var(--text-secondary);
  font-style: italic;
}
.subplanner-pin-popup-note {
  display: block;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-secondary);
}
.subplanner-mode-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 0 8px 40px;
}
.subplanner-mode-picker[hidden] { display: none; }
.subplanner-shoot-only {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subplanner-shoot-only[hidden] { display: none; }
.subplanner-shoot-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subplanner-shoot-fields[hidden] { display: none; }
/* Progressive disclosure (Area 1): the affordance that reveals the
   collapsed shoot fields on a non-photo stop (hotel/transit/food) */
.subplanner-shoot-collapse-toggle {
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-surface);
  border: 1px dashed var(--color-border-input);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  align-self: flex-start;
}
.subplanner-shoot-collapse-toggle[hidden] { display: none; }
.subplanner-shoot-collapse-toggle:hover {
  border-color: var(--color-border-focus);
  background: var(--color-bg-secondary);
}

/* Origin card — "Starting from", once per day (v4). The first link in the
   chain; the provider row stays directly above the journey (Q2). */
.subplanner-origin-card {
  background: var(--bg-card, var(--bg-primary));
  border: 1px solid var(--accent-fill);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
}
.subplanner-origin-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.subplanner-origin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
  background: var(--bg-elevated, var(--bg-secondary));
  border: 2px solid var(--accent-fill);
  border-radius: 50%;
  flex-shrink: 0;
}
/* Multi-day / day-shoot render the badge as a button — the origin type
   picker trigger (same gesture as the stop purpose badge). Event scope
   keeps the static span. */
button.subplanner-origin-badge {
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
button.subplanner-origin-badge:hover {
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.subplanner-origin-type-picker { padding: 0 0 8px 34px; }
.subplanner-origin-type-picker[hidden] { display: none; }
.subplanner-origin-head .subplanner-leg-label { color: var(--accent-primary); }
.subplanner-origin-head .subplanner-origin-center { cursor: pointer; }
.subplanner-origin-pin-status { margin-left: auto; }
.subplanner-origin-chain-chip {
  padding: 3px 9px;
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--accent-light);
  border: none;
  border-radius: 999px;
  cursor: default;
  white-space: nowrap;
  font-family: inherit;
}
.subplanner-origin-chain-chip.unchained { opacity: 0.75; cursor: pointer; }
.subplanner-origin-chain-chip.unchained:hover { filter: brightness(0.96); }
/* Estimated arrival: the chip is the one-tap way to accept it, so it has to
   read as a control rather than a label. */
.subplanner-origin-chain-chip.confirmable {
  cursor: pointer;
  border: 1px dashed var(--accent-fill);
}
.subplanner-origin-chain-chip.confirmable:hover {
  background: var(--accent-fill);
  color: var(--accent-on);
  border-style: solid;
}
.subplanner-origin-chain-chip[hidden] { display: none; }
.subplanner-origin-card .subplanner-place-row input { font-size: 0.85rem; font-weight: 600; }
/* Origin GPS — editable coords for the main pin (two-way with pin drag),
   same field vocabulary as the per-stop GPS input */
.subplanner-origin-gps-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.subplanner-origin-gps-label > span {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.subplanner-origin-gps-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.subplanner-origin-gps {
  width: 100%;
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.8125rem;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.subplanner-origin-gps:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
/* Origin "Place on map" — armed one-shot drop, same secondary-button/armed
   vocabulary as .event-position-add so the click-the-map affordance reads
   consistently everywhere it appears. */
.subplanner-origin-arm {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-text-secondary);
  background: var(--color-bg-surface);
  border: 1px dashed var(--color-border-input);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.subplanner-origin-arm:hover {
  border-color: var(--color-border-focus);
  background: var(--color-bg-secondary);
}
.subplanner-origin-arm.armed {
  color: var(--accent-on);
  background: var(--accent-fill-strong);
  border-color: var(--accent-fill-strong);
  border-style: solid;
}
.subplanner-origin-gps-name-hint {
  margin: 4px 0 0;
  font-size: 0.7rem;
  color: var(--color-warning);
  line-height: 1.4;
}
.subplanner-origin-gps-name-hint-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent-fill);
  text-decoration: underline;
  cursor: pointer;
}
.subplanner-journey-hint {
  margin: 0 0 10px;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

/* End node (branch 1.2): the day's closing card — same anatomy as the origin
   card (it shares .subplanner-origin-head for the header row) but a dashed
   edge marks it as the day's close, not another waypoint. */
.subplanner-end-card {
  background: var(--bg-card, var(--bg-primary));
  border: 1px dashed var(--accent-fill);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
}
.subplanner-end-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
  background: var(--bg-elevated, var(--bg-secondary));
  border: 2px dashed var(--accent-fill);
  border-radius: 50%;
  flex-shrink: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.subplanner-end-badge:hover { box-shadow: 0 0 0 3px var(--accent-glow); }
.subplanner-end-pin-status { margin-left: auto; }
/* ⤵ Same as last stop — the chain-chip recipe, always clickable */
.subplanner-end-same-chip {
  padding: 3px 9px;
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--accent-light);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.subplanner-end-same-chip:hover { filter: brightness(0.96); }
.subplanner-end-same-chip[hidden] { display: none; }
.subplanner-end-type-picker { padding: 0 0 8px 34px; }
.subplanner-end-type-picker[hidden] { display: none; }
.subplanner-end-returns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.subplanner-end-returns[hidden] { display: none; }
.subplanner-end-returns-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
}
.subplanner-end-returns-clear { margin-left: auto; }
.subplanner-end-place-row[hidden] { display: none; }
/* Span state: the End is derived from a transit stop above, so the card
   reports the journey instead of offering a second place to type it. */
.subplanner-end-span {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.subplanner-end-span[hidden] { display: none; }
.subplanner-end-span-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
}
.subplanner-end-span-hint {
  font-size: 0.68rem;
  color: var(--text-secondary);
}
.subplanner-end-card .subplanner-place-row input { font-size: 0.85rem; font-weight: 600; }
.subplanner-end-arrive-label { margin-top: 6px; }
.subplanner-end-arrive-label[hidden] { display: none; }
.subplanner-origin-depart-label { margin-top: 6px; }
.subplanner-depart-hint {
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 9px;
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--accent-light);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  opacity: 0.85;
}
.subplanner-depart-hint:hover { opacity: 1; filter: brightness(0.96); }

/* Map leg chrome: midpoint mode chip. Motion is narrated by the CSS dash
   animation on the leg paths (see the journey-leg block below) — the old
   traveling-dot rAF loop is deliberately gone (it kept the page busy). */
.subplanner-leg-icon-wrap { background: none; border: none; }
.subplanner-leg-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  color: var(--leg-icon-color);
}
.subplanner-leg-icon.leg-icon-drive { --leg-icon-color: var(--accent-fill); }
.subplanner-leg-icon.leg-icon-hike  { --leg-icon-color: var(--chip-teal); }
.subplanner-leg-icon.leg-icon-cycle { --leg-icon-color: var(--chip-cyan); }
.subplanner-leg-icon.leg-icon-walk  { --leg-icon-color: var(--color-success); }
.subplanner-leg-icon.leg-icon-fly   { --leg-icon-color: var(--chip-purple); }
.subplanner-leg-icon.leg-icon-bus   { --leg-icon-color: var(--chip-orange); }
.subplanner-leg-icon.leg-icon-taxi  { --leg-icon-color: var(--chip-gold); }
.subplanner-leg-icon.leg-icon-ferry { --leg-icon-color: var(--color-info); }
.subplanner-leg-icon.leg-icon-boat  { --leg-icon-color: var(--chip-pink); }
.subplanner-leg-icon.leg-icon-metro { --leg-icon-color: var(--chip-indigo); }
.subplanner-leg-icon.leg-icon-train { --leg-icon-color: var(--chip-brown); }

.subplanner-stop-time {
  width: 130px;
  padding: 6px 8px;
  font-size: 0.8125rem;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
  font-family: inherit;
}
.subplanner-stop-time:focus,
.subplanner-stop-details:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.subplanner-stop-details {
  width: 100%;
  min-height: 48px;
  padding: 6px 8px;
  font-size: 0.8125rem;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.subplanner-stop-details::placeholder { color: var(--color-text-tertiary); }

.subplanner-day-notes {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  font-size: 0.875rem;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 8px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.subplanner-day-notes:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Save / Cancel — user-owned safety controls alongside auto-save */
.subplanner-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.subplanner-autosave-note {
  margin-right: auto;
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.subplanner-actions .btn-secondary {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-input);
  background: transparent;
  color: var(--text-heading);
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  font-family: inherit;
}
.subplanner-actions .btn-secondary:hover { background: var(--bg-secondary); border-color: var(--accent-fill); color: var(--accent-primary); }
.subplanner-actions .btn-primary {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent-fill);
  background: var(--accent-fill);
  color: var(--accent-on);
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  font-family: inherit;
}
.subplanner-actions .btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Dark theme: token-driven; only surfaces needing explicit overrides */

@media (max-width: 600px) {
  .day-card-subplanner { padding: 12px 10px 14px; }
  .subplanner-class-row { padding: 0 6px 8px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Planner V3 — Phase 2b: Per-Day Map · Stop Search
   ═══════════════════════════════════════════════════════════════════════════ */

/* Per-stop location search button — sits between the name input and × */
.subplanner-stop-search {
  flex-shrink: 0;
  padding: 4px 7px;
  font-size: 0.85rem;
  line-height: 1;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.subplanner-stop-search:hover { background: var(--accent-glow); }

/* Per-day map (mock: 220px Leaflet/OSM). Pin-drop is armed via the Add pin
   button — crosshair + accent ring signal the armed state; default cursor
   stays Leaflet's pan grab. */
.subplanner-map-wrap { margin-top: 10px; }
.subplanner-map-wrap h4 {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.subplanner-map-wrap .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.subplanner-map-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.subplanner-map-header h4 { margin: 0; }
/* Scout search (map-compass 2026-07) rides beside the title, separate from
   .subplanner-map-tools; margin-left: auto on the tools cluster (below)
   keeps it flush right exactly as the old justify-content: space-between
   did when the header only had two children. */
.subplanner-scout-search {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  /* Trimmed from 220px (2026-08-10): "Add Pin" widened the tools cluster
     enough to push it onto a second row at the shell's panel width — this
     claws back the room the flex-wrap header needs to keep both groups on
     one line, without touching the tools cluster's own touch targets. */
  max-width: 165px;
}
.subplanner-scout-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-elevated, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: 999px;
}
.subplanner-scout-input::placeholder { color: var(--text-secondary); }
.subplanner-scout-input:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.subplanner-scout-btn { flex-shrink: 0; }
.subplanner-street-view {
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.subplanner-street-view:hover {
  color: var(--color-text-primary);
  background: var(--bg-subtle);
  border-color: var(--accent-fill);
}
.subplanner-map {
  height: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
}
.subplanner-map.pin-armed {
  cursor: crosshair;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
/* Street View probe armed (any map): the next click drops the probe pin. */
.leaflet-container.sv-probe-armed,
.sv-probe-armed .leaflet-interactive { cursor: crosshair; }
.leaflet-popup-content .sv-probe-status { margin: 0 0 6px; font-size: 0.8rem; }
.subplanner-map-hint {
  margin: 6px 0 0;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Pin popup (Rename / Remove). Leaflet popup chrome is always light
   regardless of page theme (see the map-overlay rule above), so these are
   deliberately unthemed dark-on-white. */
.subplanner-pin-popup {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.subplanner-pin-popup:not(.subplanner-pin-popup-compact) {
  align-items: center;
  text-align: center;
}
.subplanner-pin-popup:not(.subplanner-pin-popup-compact) .subplanner-pin-popup-actions {
  justify-content: center;
}
.subplanner-pin-popup-name {
  overflow-wrap: anywhere;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333333;
}
/* Geocode provenance in the pin popup — "matched: <feature> (OSM)". Popup
   chrome is unthemed dark-on-white like the name above it. */
.subplanner-pin-popup-provenance {
  font-size: 0.7rem;
  color: #555555;
  font-style: italic;
}
.subplanner-pin-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.subplanner-pin-rename,
.subplanner-pin-street-view,
.subplanner-pin-remove {
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-input);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.subplanner-pin-rename:hover, .subplanner-pin-street-view:hover { background: #f2f2f2; }
.subplanner-pin-remove { color: #b3261e; border-color: #e0b4b0; }
.subplanner-pin-remove:hover { background: #fdf1f0; }

/* Compact subject-pin popup (2026-09-01): a horizontal icon row instead of
   the wide title+text-button card — small enough not to collide with the
   Day Overview panel, and gets the Sun Dial out from behind a dismiss-first
   click. The name span stays in the DOM (see buildSubjectPinPopup) for the
   Street View injector's label lookup, but is never shown. */
.subplanner-pin-popup-compact {
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.subplanner-pin-popup-compact .subplanner-pin-popup-actions { gap: 4px; }
.subplanner-pin-popup-compact .subplanner-pin-sundial,
.subplanner-pin-popup-compact .subplanner-pin-rename,
.subplanner-pin-popup-compact .subplanner-pin-remove,
.subplanner-pin-popup-compact .subplanner-pin-close,
.subplanner-pin-popup-compact .subplanner-pin-street-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1;
  border-radius: 50%;
}
.subplanner-pin-sundial {
  color: #b3691e;
  background: var(--bg-card);
  border: 1px solid var(--border-input);
  cursor: pointer;
  font-family: inherit;
}
.subplanner-pin-popup-compact .subplanner-pin-sundial:hover { background: #fdf3e6; }
/* Dismiss, not an action: same compact circle as its neighbours so it reads
   as one row, but the muted treatment the other neutral actions use — never
   Leaflet's oversized default close chrome, which this popup dropped in the
   2026-09-01 redesign and is not getting back. */
/* Sun traffic-light popup line (Phase 7) — same unthemed dark-on-white rule
   as the rest of this popup (fixed hex, not --color-success/warning/error:
   the dark-theme pastels would wash out on this always-light chrome). */
.subplanner-pin-popup-sun-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #333333;
}
.subplanner-sun-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.subplanner-pin-popup-sun-caveat {
  font-size: 0.68rem;
  color: #777777;
  font-style: italic;
}

/* Open-sky disclaimer caption under the map — page-themed (normal flow, not
   Leaflet popup chrome), shown only when a 🧍 actually got a real reading. */
.subplanner-sun-hint {
  margin: 4px 0 0;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

[data-theme="dark"] .subplanner-map { background: var(--bg-secondary); }

@media (max-width: 600px) {
  .subplanner-map { height: 180px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Planner v4 — Journey builder (2026-07-11)
   Origin card → chained stop cards with method connectors, side-by-side with
   a sticky live map. Leg motion is CSS dash animation ONLY (no rAF loops).
   ═══════════════════════════════════════════════════════════════════════════ */

/* Side-by-side: builder left, sticky map right */
.subplanner-journey {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 44%);
  gap: 16px;
  align-items: start;
}
.subplanner-journey-builder { min-width: 0; }
.subplanner-add-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.subplanner-end-origin {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px dashed var(--color-border-input);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.subplanner-end-origin:hover { border-color: var(--border-hover); color: var(--text-primary); }
.subplanner-end-origin[hidden] { display: none; }

/* Leg connector — method BETWEEN stops */
.subplanner-leg-connector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 4px 12px;
  min-height: 34px;
}
.subplanner-leg-rail {
  width: 2px;
  align-self: stretch;
  min-height: 26px;
  background: var(--color-border-input);
  border-radius: 2px;
  flex-shrink: 0;
}
.subplanner-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle, var(--bg-secondary));
  border: 1px solid var(--color-border-input);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.subplanner-mode-chip:hover { border-color: var(--border-hover); color: var(--text-primary); }
.subplanner-leg-estimate {
  font-size: 0.74rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.subplanner-leg-estimate[hidden] { display: none; }

/* Time-conflict warning (detect-and-warn only, never auto-reorder). Sized to
   match .subplanner-leg-estimate — it stands in for that chip when a
   conflict exists, so swapping between the two must not jump the layout. */
.subplanner-time-conflict-chip {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--color-warning);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.subplanner-time-conflict-chip[hidden] { display: none; }

/* Approach-leg estimate. Deliberately mirrors .subplanner-leg-estimate above:
   the chain connector's estimate and the last mile's are the same statement,
   so they must read the same. */
.event-position-estimate {
  font-size: 0.74rem;
  color: var(--text-secondary);
  white-space: nowrap;
  margin-left: 6px;
  align-self: center;
}
.event-position-estimate[hidden] { display: none; }

/* Stop card header chrome */
.subplanner-stop-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 0.75rem;
  font-family: inherit;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 1px var(--border);
  flex-shrink: 0;
  cursor: pointer;
}
.subplanner-stop-badge:hover {
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.subplanner-ends-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-primary);
  background: var(--accent-light);
  border: 1px solid var(--accent-fill);
  border-radius: 999px;
  white-space: nowrap;
}
.subplanner-ends-badge[hidden] { display: none; }
.subplanner-stop-expanded[hidden] { display: none; }

/* Sticky map panel */
.subplanner-map-wrap {
  position: sticky;
  top: 76px;
  margin-top: 0;
  background: var(--bg-card, var(--bg-primary));
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Floats over the map canvas like the All Plans map: left clears Leaflet's zoom control, right clears the sun compass. z-index sits above the Street View panel (1100) so the pin icon stays reachable. */
.subplanner-map-wrap .subplanner-map-header {
  position: absolute;
  top: 12px;
  left: 56px;
  right: 130px;
  z-index: 1150;
  margin: 0;
  flex-wrap: wrap;
  pointer-events: none;
}
.subplanner-map-wrap .subplanner-map-header > * { pointer-events: auto; }
/* nowrap would let a cluster wider than the header overflow right, under the sun compass; wrapping keeps every control inside the header's compass-clear box. */
.subplanner-map-wrap .subplanner-map-tools { flex-wrap: wrap; justify-content: flex-end; }
.subplanner-map-header :is(.subplanner-scout-input, .subplanner-scout-btn, .subplanner-tile-btn, .subplanner-maptype-btn) {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.subplanner-map-wrap:has(.subplanner-map > .street-view-panel) .street-view-head { padding-top: 46px; }
.subplanner-map-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin-left: auto;
}
/* One optical row. These controls come from four separate rules with four
   different padding/font-size pairs — 40 / 30 / 27 / 26px — which reads as
   ragged, and drifts further apart as font-size or zoom changes from device to
   device. The shared height is pinned HERE, scoped to the map header, rather
   than in each control's own rule: .subplanner-place-search is reused by the
   origin, stop and subject search buttons on five other surfaces, and
   .subplanner-tile-btn by the provider toggles, all of which keep their own
   sizing. */
.subplanner-map-header .subplanner-scout-input,
.subplanner-map-header .subplanner-scout-btn,
.subplanner-map-header .subplanner-tile-btn,
.subplanner-map-header .subplanner-maptype-btn {
  height: 30px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
}
/* Buttons centre their glyph inside that fixed height; the input is left as a
   normal text field so it keeps its own baseline.
   :not([hidden]) is load-bearing, not decoration — `hidden` is enforced only by
   the UA sheet's `[hidden] { display: none }`, which ANY author display wins
   against. Without it this rule un-hides the tier-gated Street View button,
   which then widens the tools cluster enough to wrap the whole header onto a
   second row at tablet widths. */
.subplanner-map-header .subplanner-scout-btn:not([hidden]),
.subplanner-map-header .subplanner-tile-btn:not([hidden]),
.subplanner-map-header .subplanner-maptype-btn:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.subplanner-map {
  height: 380px;
  border: none;
  border-radius: 0;
}
.subplanner-tile-toggle, .subplanner-maptype-toggle { display: flex; gap: 3px; }
.subplanner-tile-toggle[hidden], .subplanner-maptype-toggle[hidden] { display: none; }
/* Shared provider seam toolbar (Pre-Flight / shot map / journey map) — rides
   inside the map as a Leaflet topright control. Pill styles: shared.css. */
/* Above the Street View panel (z 1100) so the person stays clickable to close it; the stacked column starts below the panel's header row, so the panel's ✕ is not covered. */
.leaflet-top:has(.map-provider-tools) { z-index: 1200; }
.subplanner-maptype-btn svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.subplanner-map-header .subplanner-maptype-btn { width: 30px; padding-left: 0; padding-right: 0; }
.subplanner-map-header .subplanner-maptype-btn svg { width: 20px; height: 20px; }
/* Shot map + Pre-Flight: the expand button sits absolutely at top:10/right:10
   — the exact corner the seam toolbar rides in as a Leaflet topright control,
   whose pane (z-index 1000) painted the Standard/Google toggle over the
   button. Start the toolbar column below the button instead. Three classes on
   purpose: leaflet.css loads AFTER this file, so a 2-class selector would
   lose the margin back to .leaflet-top .leaflet-control's 10px. */
.shot-map-wrap .leaflet-top .map-provider-tools,
.preflight-map-wrap .leaflet-top .map-provider-tools {
  margin-top: 48px;
}
.subplanner-tile-btn, .subplanner-maptype-btn {
  padding: 4px 11px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.subplanner-tile-btn.active, .subplanner-maptype-btn.active {
  background: var(--accent-fill-strong);
  border-color: var(--accent-fill-strong);
  color: var(--accent-on);
}
.subplanner-tile-btn:hover, .subplanner-maptype-btn:hover {
  border-color: var(--accent-fill);
  transition: border-color 0.2s ease;
}
.subplanner-map-header .subplanner-scout-btn:not(:hover) {
  background: var(--color-bg-surface);
  border-color: var(--color-border-input);
}
.subplanner-street-view { padding-left: 7px; padding-right: 7px; }
.subplanner-street-view svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.subplanner-street-view.active {
  background: var(--accent-fill-strong);
  border-color: var(--accent-fill-strong);
  color: var(--accent-on);
}
.subplanner-map-expand,
.subplanner-day-preview,
.subplanner-day-preview-stop,
.subplanner-day-preview-speed {
  padding: 4px 11px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.subplanner-map-expand:hover,
.subplanner-day-preview:hover,
.subplanner-day-preview-stop:hover,
.subplanner-day-preview-speed:hover { border-color: var(--accent-fill); color: var(--accent-primary); }
/* Icon-only map controls: square at the row's 30px height. Active playback
   wears the Standard/Google toggle's selected state. */
:is(.subplanner-day-preview, .subplanner-day-preview-stop, .subplanner-map-expand) svg { width: 14px; height: 14px; display: block; fill: currentColor; }
.subplanner-map-expand svg.map-icon-stroke { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.subplanner-day-preview:is([data-state="playing"], [data-state="paused"]) {
  background: var(--accent-fill-strong);
  border-color: var(--accent-fill-strong);
  color: var(--accent-on);
}
/* Builder map controls that left the toolbar (2026-10-15). Both ride INSIDE
   the map element so they track the map's own box (fullscreen included), and
   both lift above the Street View panel (1100) like the header does. The stack
   sits under Leaflet's zoom bar and wears its look; the playback pill is
   bottom-centre, hidden while the sun dial's bottom panel covers that edge. */
.subplanner-map-lstack {
  position: absolute;
  top: 82px;
  left: 10px;
  z-index: 1150;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  background-clip: padding-box;
}
.subplanner-map-lstack :is(.subplanner-street-view, .subplanner-map-expand) {
  width: 30px;
  height: 30px;
  padding: 0;
  color: #000;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  align-items: center;
  justify-content: center;
}
.subplanner-map-lstack :is(.subplanner-street-view, .subplanner-map-expand):not([hidden]) { display: flex; }
.subplanner-map-lstack .subplanner-street-view:not([hidden]) { border-bottom: 1px solid #ccc; }
.subplanner-map-lstack :is(.subplanner-street-view, .subplanner-map-expand):hover { background: #f4f4f4; color: #000; }
.subplanner-map-lstack .subplanner-street-view.active { background: var(--accent-fill-strong); color: var(--accent-on); }
.subplanner-map-lstack svg { width: 16px; height: 16px; display: block; }
.subplanner-map-lstack .subplanner-street-view svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.subplanner-map-wrap.map-fullscreen .subplanner-map-lstack .subplanner-map-expand { order: 0; background: #fff; box-shadow: none; }
.subplanner-playback {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 1150;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--color-border-input);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}
.subplanner-playback :is(.subplanner-day-preview, .subplanner-day-preview-stop) { width: 30px; height: 30px; padding: 0; border-radius: 50%; }
.subplanner-playback :is(.subplanner-day-preview, .subplanner-day-preview-stop):not([hidden]) { display: inline-flex; align-items: center; justify-content: center; }
.subplanner-playback .subplanner-day-preview-speed { min-width: 36px; height: 30px; padding: 0 6px; border-radius: 15px; font-variant-numeric: tabular-nums; }
.subplanner-playback-count { font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); padding: 0 2px; }
.subplanner-playback-count[hidden] { display: none; }
.subplanner-map.subject-dial-sheet-open > .subplanner-playback { display: none; }
/* "Legend & tips" opener — a bottom-left Leaflet control on the map itself,
   the one free corner (zoom top-left, sun dial top-right, attribution
   bottom-right). Same shape as .shot-map-legend's bottomleft pill, but OPAQUE
   rather than glass: this map carries the map-control readability rule since it
   renders over satellite tiles. A labelled button, not a bare chevron — the
   toolbar chevron this replaced was undiscoverable. */
.subplanner-legend-open-wrap { margin: 0 0 10px 10px; }
.subplanner-legend-open {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-primary);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.subplanner-legend-open:hover { border-color: var(--accent-fill); color: var(--accent-primary); }
/* Exactly one control is visible at a time: the opener while collapsed, the ×
   inside the notes while expanded. Both fall out of the same wrap-level class,
   so there is no second piece of state to keep in sync. */
.subplanner-map-wrap .subplanner-legend-open-wrap { display: none; }
.subplanner-map-wrap.map-notes-collapsed .subplanner-legend-open-wrap { display: block; }
/* Google underlay only: its on-tile logo owns the same corner (66×26, 5px
   inset), so lift the opener clear of it. OSM keeps the tight 10px. */
.subplanner-map-wrap:has(.google-maps-underlay) .subplanner-legend-open-wrap { margin-bottom: 40px; }

/* The notes' own header carries the close control, so you shut the panel from
   the panel — not from a button back up in the toolbar. Always rendered, even
   in single-event scope where the legend row itself is removed. */
.subplanner-notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px 0;
}
.subplanner-notes-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
/* Collapsible under-map notes (legend + pin tips + open-sky caption).
   display:contents rather than a real box: the wrap is a column flex container
   and these three were flex items before the group existed, so contents keeps
   the EXPANDED layout byte-identical — a grouping div would have made them one
   item and shifted the spacing. Collapsing is a wrap-level class, a separate
   axis from .subplanner-sun-hint's own [hidden] honesty flag, which this must
   never touch. */
.subplanner-map-notes { display: contents; }
.subplanner-map-wrap.map-notes-collapsed .subplanner-map-notes { display: none; }
.subplanner-map-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px 2px;
}
.subplanner-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--text-secondary);
}
/* Approach/sight-line legend (subject-sightline 2026-08-05): shown on BOTH
   scopes — standing positions and their approach legs exist in single-event
   too, unlike .subplanner-map-legend's travel-mode row (multi-stop only). A
   distinct class, not a shared token with .subplanner-map-legend: that class
   is removed wholesale on event scope by syncSubplannerMapWrapChrome, and
   this legend must survive that scope switch. */
.subplanner-approach-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px 2px;
}
.subplanner-approach-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--text-secondary);
}
.subplanner-map-wrap .subplanner-map-hint { padding: 0 12px 10px; margin-top: 6px; }
/* Sun Dial explanation (2026-09-08), relocated here from a floating map card
   that needed its own dismiss control, Escape rung and double-click-swallow
   window just to stay out of the way — never requested, and gone now. The
   wrapper adds only the top spacing this rhythm already uses elsewhere in
   the panel (.subplanner-map-legend / .subplanner-approach-legend both use
   the same 8px); the label reuses .subplanner-leg-label verbatim (the origin/
   leg header's own micro-label) and the paragraph reuses .subplanner-map-hint
   verbatim, so no new heading language and no new spacing token. */
.subplanner-notes-sundial { padding-top: 8px; }
.subplanner-notes-sundial .subplanner-leg-label { display: block; padding: 0 12px; }

/* Sun Dial (map-sun-dial 2026-07, replaces the map-compass rose): TOPRIGHT
   Leaflet control, the one free corner (zoom top-left, expand/provider toolbar
   in the header above, transport legend below). Opaque chrome per the
   map-control rule — not glass like the legend — since it must stay readable
   over any tile set, satellite included; the "glass" here is the border +
   shadow treatment, never a see-through background.

   The whole component lives INSIDE its map on purpose: #planner-right-panel
   (subplanner) and the viewer's own map panel are both position:sticky and
   therefore a stacking context nothing inside them can escape — the same
   trap that made the fullscreen map's exit button unclickable. Expanding it
   used to mean sliding a leftward panel out of THIS control; single-surface
   2026-08-31 replaced that with the shared subject-dial sheet (a bottom
   sheet, mounted separately per map — see subjectDialChromeHtml) and this
   face is now its open/close toggle rather than a panel of its own. */
.sun-compass {
  margin: 16px;
  position: relative;
  font-family: var(--font-primary);
  --sun-dial-key: var(--text-secondary);
  --sun-dial-wash: transparent;
}
/* Live phase state: the sun's altitude AT THE SET TIME drives the whole
   palette, so scrubbing the time input walks the dial through the day. Both
   boundaries are SunCalc's own (+6° golden, -6° civil twilight). */
.sun-dial[data-state="day"]    { --sun-dial-key: var(--text-primary); }
.sun-dial[data-state="golden"] { --sun-dial-key: var(--accent-on-tint); --sun-dial-wash: var(--accent-light); }
.sun-dial[data-state="blue"]   { --sun-dial-key: var(--chip-indigo); --sun-dial-wash: color-mix(in srgb, var(--chip-indigo) 14%, transparent); }
.sun-dial[data-state="night"]  { --sun-dial-key: var(--text-secondary); }

.sun-dial-face {
  position: relative;
  display: block;
  width: 108px;
  height: 108px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: border-color 0.45s ease, box-shadow 0.2s ease;
}
.sun-dial[data-state="golden"] .sun-dial-face,
.sun-dial[data-state="blue"] .sun-dial-face { border-color: var(--sun-dial-key); }
.sun-dial-face:hover:not(:disabled) { box-shadow: 0 3px 14px rgba(0, 0, 0, 0.26); }
/* Unavailable (multilocation-anchor 2026-09-04): the day has no shoot
   location or origin with coordinates, so there is nothing to read — same
   dimmed/not-allowed vocabulary as the map's other disabled controls. */
.sun-dial-face:disabled { opacity: 0.5; cursor: not-allowed; }
.sun-dial-face:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
/* The phase wash rides a pseudo-element so the face's own background stays
   opaque underneath it — a translucent tint straight onto the tiles would
   break the map-control readability rule. */
.sun-dial-face::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: var(--sun-dial-wash);
  transition: background-color 0.45s ease;
  pointer-events: none;
}
.sun-dial-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.sun-dial-tick { stroke: var(--border); stroke-width: 1; }
.sun-dial-tick-major { stroke: var(--text-secondary); stroke-width: 1.4; }
.sun-dial-card {
  fill: var(--text-secondary);
  font-size: 7px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: var(--font-primary);
}
.sun-dial-card-n { fill: var(--text-primary); }

.sun-dial-arc {
  fill: none;
  stroke: url(#sunDialArcGrad);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.85;
  transform: rotate(var(--sun-dial-arc-rot, 0deg));
  transform-box: view-box;
  transform-origin: 54px 54px;
}
/* Twilight at the arc's ends, daylight through the middle — the gradient IS
   the day, so the ring reads without the panel open. */
.sun-dial-arc-stop-edge { stop-color: var(--chip-indigo); }
.sun-dial-arc-stop-mid { stop-color: var(--accent-fill); }

.sun-dial-sun,
.sun-dial-shadow {
  transform-box: view-box;
  transform-origin: 54px 54px;
  transition: transform 0.45s ease;
}
.sun-dial-sun { transform: rotate(var(--sun-dial-az, 0deg)); }
.sun-dial-shadow { transform: rotate(calc(var(--sun-dial-az, 0deg) + 180deg)); }
.sun-dial-dot { fill: var(--accent-fill); transition: fill 0.45s ease; }
.sun-dial-ray {
  stroke: var(--accent-fill);
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0.75;
  transition: stroke 0.45s ease;
}
.sun-dial-halo {
  fill: var(--accent-fill);
  transform-box: view-box;
  transform-origin: 54px 6.5px;
  animation: sunDialHalo 2.8s ease-in-out infinite;
  transition: fill 0.45s ease;
}
@keyframes sunDialHalo {
  0%, 100% { transform: scale(0.82); opacity: 0.16; }
  50%      { transform: scale(1.12); opacity: 0.32; }
}
.sun-dial[data-state="blue"] .sun-dial-dot,
.sun-dial[data-state="blue"] .sun-dial-halo { fill: var(--chip-indigo); }
.sun-dial[data-state="blue"] .sun-dial-ray { stroke: var(--chip-indigo); }
/* Below the horizon there is no direct light: hollow the sun, kill the halo. */
.sun-dial[data-state="night"] .sun-dial-dot { fill: none; stroke: var(--text-secondary); stroke-width: 1.2; }
.sun-dial[data-state="night"] .sun-dial-ray { stroke: var(--text-secondary); opacity: 0.5; }
.sun-dial[data-state="night"] .sun-dial-halo { display: none; }
.sun-dial-shadow-dot { fill: var(--text-secondary); opacity: 0.55; }
.sun-dial-shadow-ray { stroke: var(--text-secondary); stroke-width: 1.4; stroke-dasharray: 2 2; opacity: 0.5; }

.sun-dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}
.sun-dial-alt {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.sun-dial-phase {
  max-width: 52px;
  font-size: 0.54rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  color: var(--sun-dial-key);
  transition: color 0.45s ease;
}

/* Day Overview — a compact flyout of the control itself (corrective
   2026-09-01: revived from the pre-single-surface panel, since the round
   face is the ONE persistent corner element and never swaps for anything —
   defect 1). Slides LEFT, never right — right is the map edge, and anything
   that leaves the map hits the sticky stacking ceiling above. */
.sun-dial-panel {
  position: absolute;
  top: var(--sun-dial-top, 0);
  right: calc(100% + 8px);
  width: var(--sun-dial-max-w, 220px);
  max-height: var(--sun-dial-max-h, 320px);
  overflow-y: auto;
  padding: 10px 12px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}
.sun-dial-open .sun-dial-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s;
}
/* Three-step cycle (2026-09-01): .sun-dial-open is now a shared "something
   is open" ring that can stay lit for the subject sheet while Day Overview
   itself is closed. This panel's own show/hide has to follow its own
   aria-hidden, not just the shared class — same specificity as the rule
   above, so source order (after it) is what makes this one win when both
   could apply. */
.sun-dial-panel[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.sun-dial-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.sun-dial-panel-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sun-dial-key);
  transition: color 0.45s ease;
}
.sun-dial-panel-hint {
  margin: 0 0 6px;
  font-size: 0.66rem;
  line-height: 1.35;
  color: var(--text-secondary);
}
.sun-dial-panel-hint[hidden] { display: none; }
/* Which location the day facts are for (shown only when the day has more
   than one), and the ≥100 km spread note under it (multilocation-anchor
   2026-09-04). Same type scale as the hint above. */
.sun-dial-panel-anchor {
  margin: 0 0 6px;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.sun-dial-panel-anchor-note {
  margin: 0 0 6px;
  font-size: 0.66rem;
  line-height: 1.35;
  color: var(--text-secondary);
}
.sun-dial-panel-anchor[hidden],
.sun-dial-panel-anchor-note[hidden] { display: none; }
.sun-dial-panel-moment {
  margin: 0 0 6px;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.sun-dial-panel-moment[hidden] { display: none; }
.sun-dial-rows { margin: 0; display: flex; flex-direction: column; gap: 5px; }
.sun-dial-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.sun-dial-row[hidden] { display: none; }
.sun-dial-row dt { font-size: 0.66rem; color: var(--text-secondary); white-space: nowrap; }
.sun-dial-row dd {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  text-align: right;
  color: var(--text-primary);
  white-space: pre-line;
  font-variant-numeric: tabular-nums;
}
/* The in-card map is 220px tall (180px on phones) against the shell's 380px —
   shrink the face there so the dial never eats the map it annotates. */
@media (max-width: 640px) {
  .sun-compass { margin: 10px; }
  .sun-dial-face { width: 84px; height: 84px; }
  .sun-dial-alt { font-size: 0.85rem; }
  .sun-dial-phase { max-width: 44px; font-size: 0.48rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sun-dial-halo { animation: none; opacity: 0.22; }
  .sun-dial-face,
  .sun-dial-face::before,
  .sun-dial-sun,
  .sun-dial-shadow,
  .sun-dial-dot,
  .sun-dial-ray,
  .sun-dial-halo,
  .sun-dial-phase,
  .sun-dial-panel,
  .sun-dial-panel-title { transition: none; }
}

/* Fullscreen map (v4 expand) */
.subplanner-map-wrap.map-fullscreen {
  position: fixed;
  /* Clears the sticky navbar. z-index:1100 does NOT beat the navbar's 1000:
     the wrap sits inside #planner-right-panel, so its z-index is confined to
     that ancestor stacking context and the panel paints under the nav. The
     map header — and therefore the ONLY way out of fullscreen — landed in the
     navbar's band and was physically unclickable. Insetting below it is the
     robust fix; it needs no stacking-context surgery. */
  inset: calc(var(--nav-height, 64px) + 12px) 16px 16px;
  z-index: 1100;
  border-radius: 12px;
  box-shadow: var(--shadow-lg, 0 24px 80px rgba(0, 0, 0, 0.3));
}
.subplanner-map-wrap.map-fullscreen .subplanner-map {
  height: auto;
  flex: 1;
  min-height: 320px;
}
/* Fullscreen is the one place the cluster is allowed to fragment. Everywhere
   else nowrap is right — it keeps the buttons one unbreakable unit that the
   header can drop cleanly to a second row. But with every tier-gated tool
   visible the cluster is 441px wide, and a phone-width fullscreen header has
   374px: nowrap there does not keep the cluster tidy, it pushes whichever
   button is last straight off the screen. Wrapping keeps all of them
   reachable, which matters more than the cluster staying on one line. */
.subplanner-map-wrap.map-fullscreen .subplanner-map-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* Prominent, but IN FLOW. This was position:absolute top/right with z-index:2,
   which lifted it out of the toolbar — the remaining tools then slid right into
   the vacated space and landed underneath it, so "Add a pin" was covered and
   unclickable for the whole time the map was expanded (41x20px overlap, on
   every viewport from 1440 down to 390).

   Absolute positioning was never what made the exit reachable: the trap
   ee31044 fixed was the WRAP painting under the sticky navbar, and the inset
   above is what solves that. The header sits inside that inset box, fully
   visible and clickable, so this button only has to stand OUT — which the
   raised surface, amber border and shadow do without leaving the flex row. */
.subplanner-map-wrap.map-fullscreen .subplanner-map-expand {
  /* First in the cluster, not last. .subplanner-map-tools is flex-wrap:nowrap
     by contract (it must never fragment), so on a narrow viewport with every
     tier-gated tool visible the cluster is wider than the header — 441px of
     buttons in 374px — and overflows. Whatever sits LAST in that overflow goes
     off-screen, and when that was the collapse control the map became a trap
     again at 430px. Ordering it first means overflow can only ever push the
     optional tools out of reach, never the way out. */
  order: -1;
  background: var(--bg-elevated);
  border-color: var(--accent-fill);
  box-shadow: var(--shadow-md);
}

/* Journey legs — SVG paths drawn by Leaflet, animated by CSS dash flow.
   The ONLY moving parts are these keyframes: no rAF, page goes idle. */
@keyframes journeyLegFlow { to { stroke-dashoffset: -64; } }
.journey-leg { fill: none; stroke-linecap: round; }
/* 4s cycle (was 1.5s) — founder ask 2026-07-11: under half the original speed */
.journey-leg-anim { animation: journeyLegFlow 4s linear infinite; }
/* Casing under every non-drive leg (see addJourneyLegLayers). Dash pattern
   comes from the polyline option and mirrors the mode's own; approach legs
   take the same 3 4 override as .journey-leg-approach below, and the casing
   animates on the same keyframes so rim and stroke flow together. */
.journey-casing { fill: none; stroke-linecap: round; stroke: var(--bg-elevated); stroke-width: 6; opacity: 0.85; }
.journey-casing-anim { animation: journeyLegFlow 4s linear infinite; }
.journey-casing-approach { stroke-dasharray: 3 4; }
.journey-leg-drive      { stroke: var(--accent-fill); stroke-width: 5; opacity: 0.75; }
.journey-leg-drive-flow { stroke: #ffffff; stroke-width: 2; stroke-dasharray: 3 18; opacity: 0.9; }
.journey-leg-hike       { stroke: var(--chip-teal); stroke-width: 3.5; stroke-dasharray: 2 9; }
.journey-leg-cycle      { stroke: var(--chip-cyan); stroke-width: 3.5; stroke-dasharray: 10 8; }
.journey-leg-walk       { stroke: var(--color-success); stroke-width: 3; stroke-dasharray: 1 7; }
.journey-leg-fly        { stroke: var(--chip-purple); stroke-width: 2.5; stroke-dasharray: 7 9; }
.journey-leg-bus        { stroke: var(--chip-orange); stroke-width: 3.5; stroke-dasharray: 12 6; }
.journey-leg-taxi       { stroke: var(--chip-gold); stroke-width: 3; stroke-dasharray: 6 4; }
.journey-leg-ferry      { stroke: var(--color-info); stroke-width: 3; stroke-dasharray: 9 7; }
/* Boat: --chip-pink is a PIN colour (meetup), never a leg colour, so nothing
   collides; the shorter dash reads as a smaller craft than the ferry's 9 7. */
.journey-leg-boat       { stroke: var(--chip-pink); stroke-width: 3; stroke-dasharray: 4 5; }
/* Metro: long dashes read as tunnel/track sections — distinct from bus's 12 6. */
.journey-leg-metro      { stroke: var(--chip-indigo); stroke-width: 3.5; stroke-dasharray: 14 4; }
/* Train: extra-long dashes read as carriages — longer stride than metro's
   14 4. Brown is the 11th leg colour, minted for it (see shared.css). */
.journey-leg-train      { stroke: var(--chip-brown); stroke-width: 3.5; stroke-dasharray: 18 6; }
.journey-leg-unset      { stroke: var(--chip-neutral, #9ca3af); stroke-width: 2; stroke-dasharray: 6 8; }
/* Approach legs — the last mile from a stop to one of its standing positions.
   Keeps the mode's COLOUR (it is that kind of travel) but takes its own dash:
   an approach spans tens of pixels where a chain leg spans hundreds, and the
   mode dashes are tuned for the latter — walk's `1 7` disintegrates into a
   few invisible specks over 60px. A denser dash is what makes it read as a
   tributary at short length; going thinner/dimmer instead just made it vanish.
   Must stay after the mode rules: equal specificity, so source order wins. */
.journey-leg-approach   { stroke-width: 3; opacity: 0.85; stroke-dasharray: 3 4; }
/* Road-flow chrome says "highway" — meaningless on a walk from the car park. */
.journey-leg-approach.journey-leg-drive-flow { display: none; }
/* Sight-line (subject-sightline 2026-08-05; restyled 2026-08-05): position →
   its subject, drawn ALONGSIDE the approach leg above, never in place of it.
   Dash-dot — the only 4-value dasharray on the map — reads as an aiming line,
   distinct from the approach leg's fine 3 4 dash and every travel leg.
   Unanimated (no journey-leg-anim): it isn't a route anyone moves along.
   --color-info: every --chip-* token is already spoken for by a leg or a
   purpose pin (see the --chip-indigo comment in shared.css); the semantic
   info blue is muted, theme-aware, and unclaimed on the map — far from the
   green walk/approach, and separated from metro's indigo by hue, pattern,
   and animation. */
.journey-leg-sightline  { stroke: var(--color-info); stroke-width: 2; opacity: 0.9; stroke-dasharray: 9 4 1.5 4; }
/* Builder trip view: each day's legs wear that day's colour; below the detail
   zoom (TRIP_DETAIL_ZOOM in planner.js) times, mode icons, walk-ins and sight-lines hide. */
.journey-leg.journey-leg-day { stroke: var(--leg-day-color); }
.plans-trip-far .journey-pin-time,
.plans-trip-far .subplanner-leg-icon-wrap,
.plans-trip-far .journey-leg-approach,
.plans-trip-far .journey-casing-approach,
.plans-trip-far .journey-leg-sightline { display: none; }
@media (prefers-reduced-motion: reduce) {
  .journey-leg-anim, .journey-casing-anim { animation: none; }
}

/* Purpose pins — teardrop + emoji + number bubble */
@keyframes journeyPinIn {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.journey-pin-wrap { background: none; border: none; }
.journey-pin {
  position: relative;
  width: 30px;
  animation: journeyPinIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}
.journey-pin-body {
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.journey-pin-glyph {
  transform: rotate(45deg);
  display: inline-flex;
}
/* Where-you-stood / subject: the Analyze pin — 32px white circle, 3px role ring. */
.journey-pin.journey-pin-ringed { width: 32px; }
.journey-pin.journey-pin-ringed .journey-pin-body {
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transform: none;
  background: white;
  border: 3px solid var(--color-success);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.journey-pin.journey-pin-ringed.journey-pin-ring-subject .journey-pin-body { border-color: var(--accent-fill); }
.journey-pin.journey-pin-ringed .journey-pin-glyph { transform: none; color: rgb(58, 52, 42); }
.journey-pin-ringed .journey-pin-num { top: -6px; right: -6px; }
.journey-pin-ringed .journey-pin-body.day-preview-halo { animation: dayPreviewRingHalo 0.7s ease-in-out; }
.journey-pin-ringed .journey-pin-body.day-preview-subject { animation: dayPreviewRingSubject 1.2s ease-in-out infinite; }
@keyframes dayPreviewRingHalo {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); box-shadow: 0 0 0 10px rgba(224, 130, 26, 0.45), 0 0 22px 8px rgba(224, 130, 26, 0.9); }
}
@keyframes dayPreviewRingSubject {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(30, 142, 126, 0.7); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 9px rgba(30, 142, 126, 0.25), 0 0 16px 6px rgba(30, 142, 126, 0.6); }
}
.journey-pin-num {
  position: absolute;
  top: -6px;
  right: -2px;
  min-width: 15px;
  height: 15px;
  padding: 0 2px;
  border-radius: 8px;
  background: var(--bg-elevated, #ffffff);
  border: 1px solid var(--color-border-input);
  color: var(--text-primary);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-primary, inherit);
}
@media (prefers-reduced-motion: reduce) {
  .journey-pin { animation: none; }
}

/* Two-tier pins: 🧍 standing-position CHILDREN render ~15% smaller than
   their parent location pin so they read as satellites; a PENDING pin
   (dropped, not yet classified) is the dashed neutral variant. Colors ride
   CSS vars, so both themes stay distinct without overrides. */
.journey-pin-child { width: 25px; }
.journey-pin-child .journey-pin-body { width: 23px; height: 23px; }
.journey-pin-child .journey-pin-num { top: -5px; right: -3px; }
/* Day Preview halo — the discipline pulse's orange ring and 1.3 scale, on the
   inner body (it carries the teardrop's -45deg, so the keyframes keep it). */
.journey-pin-body.day-preview-halo { animation: dayPreviewHalo 0.7s ease-in-out; }
/* The subject keeps one steady teal pulse for as long as the preview is at its
   stop; the orange halo above is the transient one, a position at a time. */
.journey-pin-body.day-preview-subject { animation: dayPreviewSubject 1.2s ease-in-out infinite; }
@keyframes dayPreviewSubject {
  0%, 100% { transform: rotate(-45deg) scale(1); box-shadow: 0 0 0 0 rgba(30, 142, 126, 0.7); }
  50% { transform: rotate(-45deg) scale(1.15); box-shadow: 0 0 0 9px rgba(30, 142, 126, 0.25), 0 0 16px 6px rgba(30, 142, 126, 0.6); }
}
.journey-leg-sightline.day-preview-link { opacity: 0.5; }
@keyframes dayPreviewHalo {
  0%, 100% { transform: rotate(-45deg) scale(1); }
  50% { transform: rotate(-45deg) scale(1.3); box-shadow: 0 0 0 10px rgba(224, 130, 26, 0.45), 0 0 22px 8px rgba(224, 130, 26, 0.9); }
}
@media (prefers-reduced-motion: reduce) {
  .journey-pin-body.day-preview-halo { animation: none; box-shadow: 0 0 0 6px rgba(224, 130, 26, 0.6); }
  .journey-pin-body.day-preview-subject { animation: none; box-shadow: 0 0 0 6px rgba(30, 142, 126, 0.6); }
  .journey-pin-ringed .journey-pin-body.day-preview-halo { animation: none; box-shadow: 0 0 0 6px rgba(224, 130, 26, 0.6); }
  .journey-pin-ringed .journey-pin-body.day-preview-subject { animation: none; box-shadow: 0 0 0 6px rgba(30, 142, 126, 0.6); }
}
.journey-pin-pending .journey-pin-body { border-style: dashed; border-color: var(--accent-fill); }

/* Scout search (map-compass 2026-07): dashed ring reads as temporary/
   ephemeral, distinct from every plotted plan pin above (teal/amber/purple/
   blue/green solid rings) — the pin never writes plan data, so it never
   looks like one. */
.journey-pin-scout .journey-pin-body { border-style: dashed; border-color: rgba(255, 255, 255, 0.95); }

/* Sun traffic-light (Phase 7, master audit 2026-07-13): a static ray glyph
   nested inside the 🧍 body, showing where light comes from at the planned
   time. Fixed warm color (not a theme var) — it represents sunlight, not UI
   state, and must read against OSM map tiles in either theme. Static only
   (no rAF) — a single CSS rotate() set once at render, never animated. */
.sun-ray-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}
.sun-ray-line {
  position: absolute;
  bottom: 0;
  left: -1.5px;
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: linear-gradient(to top, #ffc94a, rgba(255, 201, 74, 0));
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
}

/* Grandparent (area) pin — largest tier, hierarchy foundation (Phase 3),
   live-rendered starting Phase 4 once 📷 frees up for the subject pin. */
.journey-pin-grandparent { width: 35px; }
.journey-pin-grandparent .journey-pin-body { width: 33px; height: 33px; }
.journey-pin-grandparent .journey-pin-num { top: -7px; right: -3px; }

/* Generated-plan journey map (route-at-Generate output) */
.journey-map-wrap {
  margin: 10px 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card, var(--bg-primary));
}
.journey-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.journey-map-header h4 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.journey-map-routed-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--accent-light);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.journey-map { height: 300px; }

/* Dark theme */
[data-theme="dark"] .subplanner-origin-card { background: var(--bg-card); }
[data-theme="dark"] .subplanner-end-card { background: var(--bg-card); }
[data-theme="dark"] .subplanner-mode-chip { background: var(--bg-secondary); }
[data-theme="dark"] .subplanner-map-wrap { background: var(--bg-card); }
[data-theme="dark"] .journey-map-wrap { background: var(--bg-card); }

/* Stack builder over map on narrow screens; map loses stickiness */
@media (max-width: 900px) {
  .subplanner-journey { grid-template-columns: 1fr; }
  .subplanner-map-wrap { position: relative; top: auto; }
  .subplanner-map { height: 260px; }
}

/* ── Standing Positions component (PR 2b → per-place since Prompt 2) ──────
   Multiple "where you'll stand" points within ONE photo place — the Event
   location card (.event-positions-block, folded in 2026-07-12), or a photo
   stop's shoot-only panel (.stop-positions-block).
   Not stops: no travel legs, no connectors — a numbered list of standing
   spots that also pin (🧍, numbered) around their place on the map. The
   mode pills reuse the shipped .provider-toggle/.provider-btn vocabulary. */
.stop-positions-block,
.event-positions-block {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border);
}
.event-positions-block {
  margin-top: 14px;
}
.stop-positions-block .stop-positions-title,
.event-positions-block .stop-positions-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.positions-mode-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.event-positions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.event-position-row {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--color-bg-surface);
}
/* Nested subject→position authoring (hierarchy audit item 2b, flag-gated).
   Each subject card embeds its OWN Standing-positions sub-section: a small
   heading, its position rows, and its own add-controls — so every position is
   created against a known parent instead of a shared, last-added default. */
.event-subject-positions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border);
}
.event-subject-positions-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
.event-positions-toggle-all {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.event-positions-toggle-all:hover { color: var(--color-text-primary); text-decoration: underline; }
.event-positions-toggle-all:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.event-subject-positions-actions {
  margin-top: 8px;
}
/* Compact secondary re-parent control (nested authoring). Not the primary
   parent-setter — positions are born owned — so it's a small, quiet button
   that reveals the other subjects on click. */
.event-position-move {
  margin-top: 8px;
}
.event-position-move-btn {
  padding: 2px 6px;
  font-size: 1rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.event-position-move-btn:hover { color: var(--text-primary); background: var(--bg-secondary); border-color: var(--accent-fill); }
.event-position-move-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.event-position-move-to {
  padding: 3px 8px;
  font-size: 11.5px;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
}
.event-position-move-to:hover { border-color: var(--accent-fill-strong); }
/* Cross-day stop move — same quiet secondary control as the position
   re-parent above, sitting at the foot of the stop's expanded panel so it
   reads as an escape hatch rather than a primary action. */
.subplanner-stop-move {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}
.subplanner-stop-move-btn { font-size: 11.5px; border-radius: 8px; }
/* A day that cannot take the stop still shows, captioned with the reason —
   an empty menu would read as "there is nowhere to move this to". */
.subplanner-stop-move-to:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  border-style: dashed;
}
.subplanner-stop-move-to:disabled:hover { border-color: var(--color-border); }
.event-positions-group-empty {
  padding: 8px 12px;
  font-size: 11.5px;
  font-style: italic;
  color: var(--color-text-secondary);
  opacity: 0.85;
}
.event-position-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.event-position-number {
  flex: none;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-on);
  background: var(--accent-fill-strong);
  border-radius: 50%;
  cursor: pointer;
}
.event-position-head .event-position-grow {
  flex: 1;
  min-width: 0;
}
/* Auto-growing suggestion text (grid replicated-content pattern): the
   wrapper's hidden ::after mirrors the textarea's value, so the cell — and
   with it the textarea stretched over the same grid area — is always as tall
   as the FULL text. Pure layout, no JS measurement: sizes correctly even when
   the row renders inside a folded stop panel. ::after and textarea MUST share
   font/padding/border metrics or the mirror lies. */
.event-position-grow {
  display: grid;
}
.event-position-grow::after {
  content: attr(data-replicated-value) " ";
  visibility: hidden;
}
.event-position-grow::after,
.event-position-grow > textarea {
  grid-area: 1 / 1 / 2 / 2;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.event-position-grow > textarea {
  resize: none;
  overflow: hidden;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border-color: var(--color-border-input);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.event-position-grow > textarea:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.event-position-grow > textarea::placeholder {
  color: var(--color-text-tertiary);
}
.event-position-no-pin { flex: none; align-self: center; padding: 1px 6px; border-radius: 999px; font-size: 0.7rem; color: var(--color-warning); background: rgba(169, 106, 11, 0.12); }
.event-position-toggle {
  flex: none;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.event-position-toggle:hover { color: var(--color-text-primary); background: var(--bg-subtle); }
.event-position-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.event-position-row.is-collapsed > :not(.event-position-head) { display: none; }
.event-position-row.is-collapsed { padding: 5px 12px; }
.event-position-row.is-collapsed .event-position-head { margin-bottom: 0; }
.event-position-row.is-collapsed .event-position-grow::after,
.event-position-row.is-collapsed .event-position-grow > textarea { min-height: 0; padding: 3px 8px; }
@media (prefers-reduced-motion: reduce) {
}
.event-position-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}
.event-position-fields label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--color-text-secondary);
}
/* Approach-mode picker: four pills never fit a half-width grid column, so the
   field spans the full row. Pills themselves reuse .subplanner-mode-pill —
   including its dark-theme rules — so there is no second control to theme. */
.event-position-approach {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.event-position-fields label:has(.event-position-approach) { grid-column: 1 / -1; }
.event-position-fields input,
.event-position-fields select {
  width: 100%;
  font-size: 0.8rem;
  padding: 6px 8px;
}
/* Phase 5 re-home (master audit, 2026-07-13): "Belongs to" subject picker,
   shown only once the place has a subject — see the .event-position-fields
   grid it sits inside. */
.event-position-subject {
  font-family: inherit;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
}
/* Citation wraps in full — a clipped source link is an uncheckable citation */
.event-position-citation {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--color-text-secondary);
}
.event-position-citation a {
  color: var(--accent-primary);
  text-decoration: none;
  min-width: 0;
  overflow-wrap: anywhere;
}
.event-position-citation a:hover { text-decoration: underline; }
.positions-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.event-position-add {
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-surface);
  border: 1px dashed var(--color-border-input);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.positions-suggest-btn {
  padding: 8px 14px;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-heading);
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.event-position-add:hover:not(:disabled) {
  border-color: var(--color-border-focus);
  background: var(--color-bg-secondary);
}
.positions-suggest-btn:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}
/* "Add a pin" armed: mirrors the map button's armed state — this block owns
   the next map click */
.event-position-add.armed {
  color: var(--accent-on);
  background: var(--accent-fill-strong);
  border-color: var(--accent-fill-strong);
  border-style: solid;
}
.event-position-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Secondary manual-entry path — quiet next to the pin-drop primary */
.event-position-add-manual {
  padding: 8px 6px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.event-position-add-manual:hover:not(:disabled) { color: var(--accent-primary); border-color: var(--accent-fill); }
.event-position-add-manual:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.positions-suggest-btn:disabled {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-secondary);
  cursor: not-allowed;
}
.positions-suggest-status {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--color-text-secondary);
}
.positions-suggest-status.positions-suggest-error { color: var(--chip-amber, #b45309); }
/* Geocode provenance on a plotted suggestion row — reuses the Pre-Flight
   trust-pill look (F5 vocabulary), so "why is this pin here" reads the same
   everywhere. The pill wraps because matched feature names run long. */
.event-position-provenance {
  display: flex;
  margin-top: 6px;
  min-width: 0;
}
.event-position-provenance .preflight-pin-confidence {
  white-space: normal;
  line-height: 1.4;
}
/* Per-subject AI-fill (2026-08-13): a persistent accent-tinted button beside
   the two manual add paths — clearly the AI one, never mistakable for the
   pin-drop primary. Disabled-forever (3 manual positions placed) reads as
   retired, not broken: flat, no hover, no pointer. */
.event-position-ai-fill {
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent-primary);
  background: transparent;
  border: 1px solid var(--accent-fill);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.event-position-ai-fill:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--accent-fill-strong);
}
.event-position-ai-fill:disabled {
  color: var(--color-text-secondary);
  border-color: var(--color-border-input);
  border-style: dashed;
  opacity: 0.6;
  cursor: not-allowed;
}
/* AI-filled row marker — the only thing separating a filled row from a typed
   one (no citation, coords offset from the user's own pin). */
.event-position-ai-mark {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--color-text-secondary);
}
.event-position-ai-mark.event-position-ai-text-tag {
  display: inline;
  margin: 0 0 0 6px;
}
/* Leave-behind confirm — same chrome vocabulary as the Pre-Flight modal,
   at hint scale. */
.ai-fill-leave-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; }
.ai-fill-leave-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, 0.60); }
.ai-fill-leave-card {
  position: relative;
  z-index: 1;
  width: min(460px, 92vw);
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
.ai-fill-leave-card h3 { margin: 0 0 10px; font-size: 1.05rem; color: var(--text-heading); }
.ai-fill-leave-body { margin: 0 0 14px; font-size: 0.9rem; line-height: 1.5; color: var(--color-text-secondary); }
.ai-fill-leave-close {
  position: absolute;
  top: 10px; right: 12px;
}
.ai-fill-leave-dismiss {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.ai-fill-leave-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.ai-fill-leave-fill,
.ai-fill-leave-continue {
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.ai-fill-leave-fill {
  color: var(--accent-on);
  background: var(--accent-fill-strong);
  border: 1px solid var(--accent-fill-strong);
}
.ai-fill-leave-continue {
  color: var(--text-heading);
  background: transparent;
  border: 1px solid var(--border-input);
}
.ai-fill-leave-continue:hover { border-color: var(--accent-fill); color: var(--accent-primary); }
[data-theme="dark"] .ai-fill-leave-backdrop { background: rgba(0, 0, 0, 0.70); }

/* Honest fallback under an unplotted suggestion: own up + offer the
   row-targeted pin drop ("Plot it yourself" arms the map's one-shot drop
   for THIS row). */
.event-position-noplot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--color-text-secondary);
}
.event-position-plot {
  flex: none;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-surface);
  border: 1px dashed var(--color-border-input);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.event-position-plot:hover:not(:disabled) {
  border-color: var(--color-border-focus);
  background: var(--color-bg-secondary);
}
.event-position-plot.armed {
  color: var(--accent-on);
  background: var(--accent-fill-strong);
  border-color: var(--accent-fill-strong);
  border-style: solid;
}
[data-theme="dark"] .event-position-row { background: var(--bg-card); }

@media (max-width: 640px) {
  .event-position-fields { grid-template-columns: 1fr; }
}

/* ── Subject tier component (master audit Phase 4, 2026-07-13) ───────────
   The NEW parent tier between the grandparent (area/stop location) and
   standing positions (children): what's actually photographed. Deliberately
   its own class names (not shared with .event-position-*) — the positions
   component's JS queries `.stop-positions-block` / `.event-position-row` by
   class, and this block mounts as a SIBLING inside the same stop panel, so
   reusing those names would make positions' own selectors ambiguous. */
.stop-subjects-block,
.event-subjects-block {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border);
}
.event-subjects-block {
  margin-top: 14px;
}
.event-subject-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.event-subject-row {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--color-bg-surface);
}
/* Nested authoring: a subject row is a CONTAINER card holding its GPS/match
   row and its embedded Standing-positions sub-section. The embedded position
   rows sit on the card's surface — drop their own border tint so the card
   reads as one unit rather than boxes-in-boxes. */
.event-subject-list.subjects-nested .event-subject-positions-list .event-position-row {
  background: var(--color-bg-surface);
}
.event-subject-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.event-subject-number {
  flex: none;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-on);
  background: var(--accent-fill-strong);
  border-radius: 50%;
  cursor: pointer;
}
.event-subject-label {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  padding: 6px 8px;
}
/* Subject reorder (2026-08-17): one hairline-joined ↑/↓ pair, sitting
   between the label and the remove ×. Sized to the remove button so the
   header row keeps its single 24px control line. */
.event-subject-move {
  flex: none;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}
.event-subject-move-btn {
  width: 22px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  line-height: 1;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
}
.event-subject-move-btn + .event-subject-move-btn {
  border-left: 1px solid var(--color-border);
}
.event-subject-move-btn:hover:not(:disabled) {
  color: var(--color-text-primary);
  background: var(--bg-subtle);
}
.event-subject-move-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.event-subject-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px 8px;
}
.event-subject-fields label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--color-text-secondary);
}
.event-subject-fields input {
  width: 100%;
  font-size: 0.8rem;
  padding: 6px 8px;
}
/* Time-conflict warning (detect-and-warn only, never auto-reorder) — flags
   a subject whose time contradicts its ↑/↓ position among its siblings. */
.event-subject-time-conflict {
  display: block;
  margin-top: -2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-warning);
}
.event-subject-time-conflict[hidden] { display: none; }
/* Phase 6: per-subject time budget + style override chips */
.event-subject-duration,
.event-subject-style {
  margin-top: 8px;
}
.event-subject-duration-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--color-text-secondary);
}
/* Style override inherit/override status row (2026-08-10 clarity fix) --
   default reads as "inheriting the trip style", not a second empty picker. */
.event-subject-style-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.event-subject-style-status {
  font-size: 11px;
  color: var(--color-text-secondary);
}
.event-subject-style-status.overridden {
  color: var(--accent-fill-strong);
  font-weight: 600;
}
.event-subject-style-toggle,
.event-subject-style-clear {
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-fill-strong);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}
.event-subject-style-toggle:hover,
.event-subject-style-clear:hover {
  color: var(--accent-on-tint);
}
.event-subject-duration-chips,
.event-subject-style-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.event-subject-style-chips[hidden] {
  display: none;
}
.subject-duration-btn,
.subject-style-chip {
  flex: 0 1 auto;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.subject-duration-btn:hover,
.subject-style-chip:hover {
  color: var(--color-text-primary);
  background: var(--bg-subtle);
  border-color: var(--accent-fill);
}
.subject-duration-btn.active,
.subject-style-chip.active {
  color: var(--accent-on-tint);
  background: var(--accent-light);
  border-color: var(--accent-fill-strong);
}
.subject-duration-custom {
  width: 90px;
  margin-top: 6px;
  font-size: 0.8rem;
  padding: 5px 8px;
}
.subject-duration-custom.committed {
  color: var(--accent-on-tint);
  background: var(--accent-light);
  border-color: var(--accent-fill-strong);
}
.event-subject-provenance {
  display: flex;
  margin-top: 6px;
  min-width: 0;
}
.event-subject-provenance .preflight-pin-confidence {
  white-space: normal;
  line-height: 1.4;
}
.event-subject-noplot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--color-text-secondary);
}
.event-subject-plot {
  flex: none;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-surface);
  border: 1px dashed var(--color-border-input);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.event-subject-plot:hover:not(:disabled) {
  border-color: var(--color-border-focus);
  background: var(--color-bg-secondary);
}
/* Phase 5 re-home (master audit, 2026-07-13): read-only summary of this
   subject's standing positions — grandparent → subject → standing, top to
   bottom in one place. Editing stays single-sourced in the Standing
   Positions list below (via each row's "Belongs to" picker). */
.event-subject-standing-summary {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}
.event-subject-standing-summary-empty {
  font-style: italic;
  opacity: 0.85;
}
.event-subject-plot.armed {
  color: var(--accent-on);
  background: var(--accent-fill-strong);
  border-color: var(--accent-fill-strong);
  border-style: solid;
}
.subjects-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
/* display:flex beats the UA [hidden] rule — indoor gate (Phase 6) hides this
   row (exhibits aren't found via the named-feature search cascade), same
   pattern as every other [hidden] override in this file. */
.subjects-actions-row[hidden] { display: none; }
.subject-search-input {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  padding: 8px 10px;
}
/* Search button is the compact .subplanner-place-search icon (location-field
   parity, 2026-07-16) — only the vertical rhythm is equalized here. */
.subject-search-btn { padding: 8px 10px; }
.event-subject-add {
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-surface);
  border: 1px dashed var(--color-border-input);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.event-subject-add:hover:not(:disabled) {
  border-color: var(--color-border-focus);
  background: var(--color-bg-secondary);
}
.event-subject-add.armed {
  color: var(--accent-on);
  background: var(--accent-fill-strong);
  border-color: var(--accent-fill-strong);
  border-style: solid;
}
.event-subject-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.event-subject-add-manual {
  padding: 8px 6px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.event-subject-add-manual:hover:not(:disabled) { color: var(--accent-primary); border-color: var(--accent-fill); }
.event-subject-add-manual:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.subject-search-status {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--color-text-secondary);
}
.subject-search-status.positions-suggest-error { color: var(--chip-amber, #b45309); }
/* Honest-fallback outcome (2026-07-16): the "added without a pin" line must
   read as a result, not vanish as fine print. */
.subject-search-status.subject-status-strong {
  color: var(--chip-amber, #b45309);
  font-weight: 600;
}
/* Pin↔field link + outcome visibility: the row matching an opened pin popup
   (or a just-added subject) flashes so an off-screen commit never reads as
   "nothing happened". Ring/glow accent only — never the solid armed fill. */
.field-link-flash {
  animation: field-link-flash 1.6s ease-out;
}
@keyframes field-link-flash {
  0%   { box-shadow: 0 0 0 2px var(--accent-fill); }
  100% { box-shadow: 0 0 0 2px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .field-link-flash,
  .doc-autofilled,
  .doc-autofilled-label { animation: none; }
}
[data-theme="dark"] .event-subject-row { background: var(--bg-card); }

@media (max-width: 640px) {
  .subjects-actions-row { flex-wrap: wrap; }
  .subject-search-input { flex-basis: 100%; }
}

/* ── Tavily research panel (master audit Phase 8, 2026-07-13) ────────────
   Per-place "ask a question about this spot" panel — mounts as a sibling of
   .stop-positions-block / .event-positions-block (own class names for the
   same reason the subject tier gets its own: bindResearchBlock queries
   .research-* by class and must never collide with the positions/subjects
   selectors it sits beside). Minimizing hides only .research-block-body —
   the header stays as the "small affordance" the founder asked for, and
   nothing inside is destroyed, so expanding shows the last search intact. */
.research-block {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border);
}
#event-research-group {
  margin-top: 14px;
}
.research-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.research-title-text {
  font-size: 0.85rem;
  font-weight: 600;
}
.research-minimize-btn {
  flex: none;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.research-minimize-btn:hover { color: var(--text-primary); background: var(--bg-secondary); border-color: var(--accent-fill); }
.research-block-body {
  margin-top: 8px;
}
.research-query-input {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 8px 10px;
  margin-top: 6px;
  resize: vertical;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.research-query-input:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.research-query-input::placeholder { color: var(--color-text-tertiary); }
.research-actions-row { margin-top: 8px; }
.research-search-btn {
  padding: 8px 14px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-heading);
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  font-family: inherit;
}
.research-search-btn:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}
.research-search-btn:disabled { background: var(--bg-subtle); border-color: var(--border); color: var(--text-secondary); cursor: not-allowed; }
.research-reset-btn {
  padding: 8px 6px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-heading);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.research-reset-btn:hover { background: var(--bg-secondary); border-color: var(--accent-fill); color: var(--accent-primary); }
.research-status {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--color-text-secondary);
}
.research-status.research-status-error { color: var(--chip-amber, #b45309); }
.research-summary {
  margin: 10px 0 0;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--color-text-primary);
  background: var(--bg-subtle);
  border-radius: 8px;
}
.research-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.research-result-item {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--color-bg-surface);
}
.research-result-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-primary);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.research-result-title:hover { text-decoration: underline; }
.research-result-snippet {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
}
.research-result-source {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--color-text-tertiary);
}
[data-theme="dark"] .research-result-item { background: var(--bg-card); }
[data-theme="dark"] .research-summary { background: var(--bg-card); }

@media (max-width: 640px) {
  .research-block-header { flex-wrap: wrap; }
}

/* ══ Plan Viewer — Phase 1 (2026-07-31) ═══════════════════════════════════
   Map-first read-only viewer of a generated plan (design handoff
   design-mocks/design_handoff_plan_viewer). Full-screen overlay so the
   planner page layout is untouched. All colors via shared.css tokens —
   both themes come for free. Navigator children carry flex-shrink:0
   (handoff gotcha: overflow:hidden cards in a max-height flex column
   otherwise crush to zero height). */

.plan-viewer-launch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}
.plan-viewer-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent-fill);
  background: var(--accent-light);
  color: var(--accent-on-tint);
  font-family: var(--font-primary);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}
.plan-viewer-open-btn:hover { background: var(--accent-fill); color: var(--accent-on); }
.plan-viewer-launch-hint { font-size: 0.74rem; color: var(--text-muted); }

.plan-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow-y: auto;
}
body.plan-viewer-open { overflow: hidden; }

.plan-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding: 18px 28px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}
.plan-viewer-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.plan-viewer-badges {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}
.plan-viewer-viewing-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: var(--accent-light);
  color: var(--accent-on-tint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.plan-viewer-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.plan-viewer-title-block { min-width: 0; }
.plan-viewer-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-viewer-subtitle { margin: 2px 0 0; color: var(--text-secondary); font-size: 0.82rem; }
.plan-viewer-status { color: var(--color-success); font-weight: 600; }
.plan-viewer-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.plan-viewer-count-chips { display: flex; gap: 8px; }
.plan-viewer-count-chip {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.plan-viewer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-input);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.plan-viewer-btn:hover { border-color: var(--border-hover); }
.plan-viewer-btn-primary {
  border: none;
  background: var(--accent-fill-strong);
  color: var(--accent-on);
  font-weight: 700;
}
.plan-viewer-btn-primary:hover { background: var(--accent-hover); border: none; }

.plan-viewer-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 22px;
  align-items: stretch;
  padding: 20px 28px;
  min-height: 0;
  max-width: 1800px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.plan-viewer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}
.plan-viewer-nav > * { flex-shrink: 0; }

.plan-viewer-tabs {
  display: flex;
  gap: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.plan-viewer-tab {
  flex: 1;
  padding: 6px 4px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: 0.74rem;
  font-weight: 500;
  background: transparent;
  color: var(--text-secondary);
  white-space: nowrap;
}
.plan-viewer-tab.active {
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-heading);
  box-shadow: var(--shadow-sm);
}

.plan-viewer-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.plan-viewer-day-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-primary);
  text-align: left;
}
.plan-viewer-day-card.selected .plan-viewer-day-row { background: var(--accent-light); }
.plan-viewer-day-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.plan-viewer-day-main { flex: 1; min-width: 0; }
.plan-viewer-day-kicker {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.7;
}
.plan-viewer-day-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-viewer-day-meta { font-size: 0.72rem; opacity: 0.65; white-space: nowrap; }
.plan-viewer-day-open {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px 10px 14px;
}

.plan-viewer-origin-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 6px;
}
.plan-viewer-origin-chip {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.plan-viewer-origin-name {
  flex: 1;
  min-width: 0;
  font-size: 0.76rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-viewer-stop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px;
  border-radius: var(--radius-lg);
}
.plan-viewer-mode-icon {
  width: 26px;
  text-align: center;
  flex-shrink: 0;
  display: inline-flex;
  justify-content: center;
  color: var(--text-muted);
}
.plan-viewer-stop-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 700;
  flex-shrink: 0;
}
.plan-viewer-stop-nopin {
  background: var(--bg-subtle);
  border: 1.5px dashed var(--border-input);
  color: var(--text-muted);
}
.plan-viewer-stop-main { flex: 1; min-width: 0; }
.plan-viewer-stop-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-viewer-stop-sub { display: block; font-size: 0.68rem; color: var(--text-muted); }
.plan-viewer-row-time { font-size: 0.66rem; color: var(--text-muted); white-space: nowrap; }
.plan-viewer-approx { color: var(--text-muted); font-weight: 700; margin-right: 1px; cursor: help; }

.plan-viewer-shot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px 3px 34px;
}
.plan-viewer-shot-glyph {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  flex-shrink: 0;
}
.plan-viewer-shot-label {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-viewer-single-note {
  padding: 11px 13px;
  background: var(--bg-subtle);
  border: 1px dashed var(--border-input);
  border-radius: var(--radius-lg);
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.plan-viewer-single-note strong { color: var(--text-heading); }
.plan-viewer-empty-note {
  margin: 4px 0;
  padding: 11px 13px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.plan-viewer-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 13px 14px;
}

/* ── Plan Viewer — Field Notes tab (2026-08-03) ─────────────────────────
   The re-hosted export actions: .export-option keeps the document
   delegation contract, this scope restyles it from dropdown row to full
   inline button; the toolbar chrome is neutralized (the panel card is
   already the card). */
.plan-viewer-export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: none;
}
.plan-viewer-export-actions .plan-viewer-export-btn {
  border: 1px solid var(--border-input);
  border-radius: 8px;
  padding: 9px 12px;
  text-align: center;
  font-weight: 600;
  color: var(--text-heading);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  white-space: normal;
}
.plan-viewer-export-actions .plan-viewer-export-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}
/* the notes block sits in its own panel card — the old in-card divider
   chrome (top border + spacing) doesn't apply here */
.plan-viewer-fieldnotes-day .day-notes-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.plan-viewer-escape-row { display: flex; gap: 8px; padding-bottom: 8px; }
.plan-viewer-escape-row .plan-viewer-btn { flex: 1; justify-content: center; }

.plan-viewer-map-panel {
  position: relative;
  min-height: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  /* Stacking containment: without this, Leaflet's own pane/control z-indexes
     (up to 1000+ in leaflet.css) have no boundary here and leak upward to
     compete directly against sibling modals in #plan-viewer-overlay instead
     of staying capped inside the map box. */
  isolation: isolate;
}
.plan-viewer-map { position: absolute; inset: 0; }
.plan-viewer-map-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 500;
  max-width: 320px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

@media (max-width: 960px) {
  .plan-viewer-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(320px, 45vh) auto;
  }
  .plan-viewer-map-panel { order: -1; min-height: 320px; }
  .plan-viewer-nav { overflow-y: visible; }
}

/* hidden must win over the flex display above — without this the closed
   overlay keeps intercepting every pointer event on the page. */
.plan-viewer-overlay[hidden] { display: none; }

/* ── Plan Viewer — Phase 2: zoom pyramid (trip ↔ day ↔ shot) ──────────── */

.plan-viewer-map-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  min-width: 0;
}
.plan-viewer-map-col .plan-viewer-map-panel { flex: 1; }

.plan-viewer-crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding: 7px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.plan-viewer-crumb {
  border: none;
  background: transparent;
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent-on-tint);
  cursor: pointer;
}
button.plan-viewer-crumb:hover { background: var(--accent-light); }
.plan-viewer-crumb-current { color: var(--text-heading); font-weight: 700; cursor: default; }
.plan-viewer-crumb-sep { color: var(--text-muted); font-size: 0.72rem; }

/* ── Plan Viewer — chrome layout (2026-07-31): map header row ─────────────
   Design placement: crumbs left / provider toolbar right in ONE bordered
   row above the map (the toolbar comes OFF the map surface). The head takes
   over the crumbs bar's card chrome; flex-wrap drops the toolbar to its own
   line at narrow widths instead of crowding the breadcrumb. */
.plan-viewer-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.plan-viewer-map-head .plan-viewer-crumbs {
  padding: 2px 0;
  background: none;
  border: none;
  border-radius: 0;
  min-width: 0;
}
.plan-viewer-map-toolbar { display: flex; justify-content: flex-end; margin-left: auto; }
/* The relocated seam toolbar keeps its leaflet-control class — float and
   corner-stack margins must not leak into the header row. Horizontal and
   compact here; every other surface keeps the stock on-map column. */
.plan-viewer-map-toolbar .map-provider-tools {
  float: none;
  clear: none;
  margin: 0;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.plan-viewer-allday-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-primary);
  text-align: left;
}
.plan-viewer-allday-row:hover { border-color: var(--border-hover); }
.plan-viewer-allday-row.selected {
  background: var(--accent-light);
  border-color: var(--accent-fill);
}
.plan-viewer-allday-icon { font-size: 1rem; flex-shrink: 0; }

/* Clickable stop/shot rows are buttons now — same visual row as Phase 1 */
button.plan-viewer-stop-row,
button.plan-viewer-shot-row {
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  font-family: var(--font-primary);
  text-align: left;
  cursor: pointer;
}
button.plan-viewer-stop-row:hover,
button.plan-viewer-shot-row:hover { background: var(--bg-subtle); }
.plan-viewer-shot-row { border-radius: var(--radius-lg); }
.plan-viewer-shot-row.selected,
button.plan-viewer-shot-row.selected:hover { background: var(--accent-light); }
.plan-viewer-shot-row.selected .plan-viewer-shot-label {
  color: var(--accent-on-tint);
  font-weight: 650;
}
/* Review's Full plan: Map's selection is kept for the return trip, not shown. */
#planner-interface.view-output .review-shot-row.selected { background: transparent; }
#planner-interface.view-output .review-shot-row.selected:hover { background: var(--bg-subtle); }
#planner-interface.view-output .review-shot-row.selected .plan-viewer-shot-label {
  color: var(--text-primary);
  font-weight: inherit;
}

/* Trip-zoom map glyphs */
.plan-viewer-trip-dot-wrap,
.plan-viewer-trip-origin-wrap,
.plan-viewer-sibling-shot-wrap { background: none; border: none; }
.plan-viewer-trip-dot {
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.plan-viewer-trip-origin {
  width: 20px;
  height: 20px;
  box-sizing: border-box;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1.5px solid var(--accent-fill);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
}
.plan-viewer-sibling-shot {
  width: 22px;
  height: 22px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--color-success);
  opacity: 0.45;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}
.plan-viewer-sibling-shot:hover { opacity: 0.85; }

/* Matched pins: a success ring on the pin body (never the icon transform)
   plus a ✓ chip, for shots with a confirmed photo. */
.pv-matched .journey-pin .journey-pin-body,
.pv-matched .plan-viewer-sibling-shot {
  box-shadow: 0 0 0 3px var(--color-success), 0 3px 8px rgba(0, 0, 0, 0.35);
}
.pv-matched .plan-viewer-sibling-shot { opacity: 0.9; }
.pv-matched .journey-pin::after,
.pv-matched .plan-viewer-sibling-shot::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-success) var(--a22-img-check-white) center / 10px no-repeat;
}
.pv-matched .plan-viewer-sibling-shot { position: relative; }

.plan-viewer-match {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.plan-viewer-match-thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-success);
  background: var(--bg-elevated);
  cursor: pointer;
}
.plan-viewer-match-thumb img { width: 100%; height: 100%; object-fit: cover; }
.plan-viewer-match-thumb[aria-pressed="true"] { outline: 3px solid var(--color-success); outline-offset: 2px; }
.plan-viewer-match-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--color-success);
}
.plan-viewer-match-strip { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.plan-viewer-match-strip[hidden] { display: none; }

/* Shot card (navigator detail pane, shot zoom) */
.plan-viewer-shot-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-fill);
  border-radius: var(--radius-xl);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-viewer-shot-card-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.4;
}
.plan-viewer-shot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.plan-viewer-shot-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plan-viewer-shot-cell-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.plan-viewer-shot-cell-value {
  font-size: 0.78rem;
  color: var(--text-primary);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.plan-viewer-shot-tip {
  padding: 9px 11px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* The shot card floats on the map (JS: pvRenderShotFloat): docked under the
   sun dial (10px inset + 108px dial + 10px), above markers and popups (≤700)
   and below Leaflet's controls (1000), so the dial's Day Overview panel opens
   over it. The bottom 96px stays clear of the PIC avatar. */
.plan-viewer-shot-float {
  position: absolute;
  top: 128px;
  right: 10px;
  z-index: 1010; /* above Leaflet's control corner (1000), so the sun dial popup can't cover the card */
  width: 360px;
  max-height: max(220px, calc(100% - 128px - 96px));
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
/* The float is the panel: it carries the border and background, and clips the scroll bar to its rounded edge. */
.plan-viewer-shot-float:not(.plan-viewer-shot-float-min) {
  border: 1px solid var(--accent-fill); background: var(--bg-card); overflow: hidden;
}
.plan-viewer-shot-float[hidden] { display: none; }
.plan-viewer-shot-float-scroll {
  flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.plan-viewer-shot-float:not(.plan-viewer-shot-float-min) .plan-viewer-shot-card { border: none; border-radius: 0; background: transparent; }
/* Card-coloured and shadowless, so it only keeps scrolled text from running under the buttons. */
.plan-viewer-shot-float-tools { position: absolute; top: 8px; right: 14px; z-index: 3; display: flex; gap: 6px; padding: 2px; border-radius: 999px; background: var(--bg-card); }
.plan-viewer-shot-card-title:focus:not(:focus-visible) { outline: none; }
.plan-viewer-shot-float .plan-viewer-shot-card-head { padding-right: 70px; }
@media (pointer: coarse) { .plan-viewer-shot-float .plan-viewer-shot-card-head { padding-right: 104px; } }
.plan-viewer-shot-float .plan-viewer-shot-card-title { padding-right: 0; }
.plan-viewer-shot-float .plan-viewer-edit-panel .plan-viewer-shot-card-title { padding-right: 70px; }
.plan-viewer-shot-pill:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.plan-viewer-shot-float-min {
  width: auto;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 5px;
  background: var(--bg-card);
  border: 1px solid var(--accent-fill);
  border-radius: 999px;
}
.plan-viewer-shot-float-min .plan-viewer-shot-float-btn { width: 24px; height: 24px; border-radius: 999px; }
.plan-viewer-shot-pill {
  max-width: 260px;
  padding: 3px 6px 3px 8px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-heading);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
/* Narrow: a bottom sheet across the map, over the legend and the Day
   Preview player (1150) until minimised. */
@media (max-width: 799px) {
  .plan-viewer-shot-float {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 1160;
    width: auto;
    max-height: 62%;
  }
  .plan-viewer-shot-float-min { left: 50%; right: auto; bottom: 30px; transform: translateX(-50%); }
}

@media (max-width: 960px) {
  /* Phase 1's order:-1 hoisted the map panel to the top of the GRID; the
     panel now lives inside .plan-viewer-map-col, where that same rule would
     hoist the map ABOVE its breadcrumb strip — restore the intended order. */
  .plan-viewer-map-col { order: -1; }
  .plan-viewer-map-panel { order: 0; }
}

/* ── Plan Viewer Phase 3: on-map pills + sun ──────────────────────────────
   Pills clone the canonical OPAQUE map-chrome pill (.subplanner-legend-open)
   — solid var(--bg-card), never glass: they render over satellite tiles and
   carry the map-control readability rule. */
.plan-viewer-map-pill {
  position: absolute;
  left: 0;
  top: 15px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-primary);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  white-space: nowrap;
  pointer-events: auto;
}
.plan-viewer-map-pill-main { color: var(--text-primary); font-weight: 700; }
.plan-viewer-map-pill-drill { cursor: pointer; }
.plan-viewer-map-pill-drill:hover { border-color: var(--accent-fill); }
.plan-viewer-map-pill-drill:hover .plan-viewer-map-pill-main { color: var(--accent-primary); }
.plan-viewer-map-pill-edit {
  border: none;
  background: none;
  padding: 0 2px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
}
.plan-viewer-map-pill-edit[hidden] { display: none; }

/* Sun chip on shot rows/card + the gated light dot. */
.plan-viewer-sun-chip {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-secondary);
  white-space: nowrap;
}
.plan-viewer-needs-detail {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--color-warning);
  padding: 1px 7px;
  border: 1px solid var(--color-warning);
  border-radius: 999px;
  white-space: nowrap;
}
.plan-viewer-light-dot {
  flex-shrink: 0;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  vertical-align: middle;
}
.plan-viewer-map-pill .plan-viewer-light-dot { margin-left: 2px; }
.plan-viewer-link-dot {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  color: var(--color-success);
}
.plan-viewer-link-dot::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  padding: 3px 8px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}
.plan-viewer-link-dot:hover::after,
.plan-viewer-shot-row:focus-visible .plan-viewer-link-dot::after { opacity: 1; }

/* ── Plan Viewer Phase 4: plan-type states + collapsible legend + walkthrough ── */

/* Legend panel — opaque map chrome (var(--bg-card), never glass): it opens
   over satellite tiles, same readability rule as the pill it extends. Sits
   in the bottomleft stack the reused control lands in, above the sun dial. */
.plan-viewer-legend-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 10px 12px;
  margin: 0 0 8px 10px;
  max-width: 250px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.plan-viewer-legend-panel[hidden] { display: none; }
.plan-viewer-legend-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.plan-viewer-legend-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.plan-viewer-legend-row svg { flex-shrink: 0; }
.plan-viewer-legend-swatch { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.plan-viewer-legend-swatch-pin { border-radius: 50%; }
.plan-viewer-legend-glyph { width: 16px; text-align: center; flex-shrink: 0; }
.plan-viewer-legend-hint { margin-top: 6px; font-size: 0.7rem; color: var(--text-muted); }

/* Walkthrough modal — layered inside the viewer overlay (Escape peels it
   before the viewer). Video is a PLACEHOLDER box, not a link: the film
   isn't recorded yet (same posture as the planner's tutorial pill). */
.plan-viewer-walkthrough {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  padding: 20px;
}
.plan-viewer-walkthrough[hidden] { display: none; }
.plan-viewer-walkthrough-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 540px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px 22px;
}
.plan-viewer-walkthrough-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.plan-viewer-walkthrough-head h3 { margin: 0; font-size: 1.05rem; color: var(--text-primary); }
.plan-viewer-walkthrough-video {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 12px;
  border: 1.5px dashed var(--border-input);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.plan-viewer-walkthrough-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.plan-viewer-walkthrough-steps strong { color: var(--text-primary); }

/* ── Plan Viewer Phase 5: manual editing ──────────────────────────────────
   The edit panel wears the shot-card body with an accent edge (an edit is a
   mode, not a new surface); the save flash floats over the map panel. */
.plan-viewer-map-pill-edit:not([hidden]) { cursor: pointer; }
.plan-viewer-map-pill-edit:not([hidden]):hover { color: var(--accent-primary); }
.plan-viewer-edit-panel {
  border-color: var(--accent-fill);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-viewer-edit-hint {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-secondary);
}
.plan-viewer-edit-field { display: flex; flex-direction: column; gap: 4px; }
.plan-viewer-edit-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.plan-viewer-edit-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  color: var(--text-primary);
}
.plan-viewer-edit-input:focus { outline: none; border-color: var(--accent-fill); }
.plan-viewer-edit-textarea { resize: vertical; min-height: 56px; }
.plan-viewer-edit-fixed { font-size: 0.78rem; color: var(--text-secondary); }
.plan-viewer-edit-namenote {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.plan-viewer-edit-namelink {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent-on-tint);
  cursor: pointer;
}
.plan-viewer-edit-namelink:hover { text-decoration: underline; }
.plan-viewer-edit-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-viewer-edit-status { font-size: 0.72rem; color: var(--text-secondary); }
.plan-viewer-edit-status-error { color: var(--color-error, #dc2626); }

/* ── Adjust to reality (shot-card 'before' deviation) ─────────────────── */
/* Nothing on the card is sticky: the title, buttons, chip and toggle scroll away with the
   content, so scrolling down gives the text the whole card. Only the close and minimise
   buttons (.plan-viewer-shot-float-tools, outside the scroll area) stay put. */
.plan-viewer-shot-card-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.plan-viewer-showing { font-size: 0.74rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.plan-viewer-adjusted-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.68rem; font-weight: 700; color: var(--color-success); white-space: nowrap;
}
.plan-viewer-adjusted-chip[hidden] { display: none; }
.shot-idea .shot-done-toggle { margin-right: 8px; }
.shot-idea .plan-viewer-adjust-start { margin: 8px 8px 0 0; vertical-align: top; }
.shot-idea .plan-viewer-adjusted-chip { margin-top: 8px; }
.plan-viewer-shot-card-head .plan-viewer-shot-card-title { flex: 1 1 auto; min-width: 0; }
.plan-viewer-adjust-start { padding: 5px 10px; font-size: 0.76rem; }
.plan-viewer-adjust-start:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.plan-viewer-adjust { display: flex; flex-direction: column; gap: 8px; }
.plan-viewer-adjust-active {
  padding: 10px;
  border: 1px solid var(--accent-fill);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
.plan-viewer-adjust-summary {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-success);
}
.plan-viewer-adjust-summary svg { flex: none; margin-top: 2px; }
.plan-viewer-adjust-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-viewer-adjust .plan-viewer-btn:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }

/* ── Adjust to reality: revised card, Planned | Revised | Compare ───────── */
.plan-viewer-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.plan-viewer-version-bar { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.plan-viewer-revised-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 100px; background: var(--accent-light); color: var(--accent-on-tint);
  font-size: 0.74rem; font-weight: 600; white-space: nowrap;
}
.plan-viewer-version-btn {
  min-height: 34px; padding: 0 16px; border: none; border-radius: 100px;
  background: transparent; color: var(--text-secondary);
  font: 500 0.8rem/1 inherit; font-family: inherit; cursor: pointer;
}
.plan-viewer-version-btn[aria-pressed="true"] {
  background: var(--bg-card); color: var(--text-heading); font-weight: 600;
  box-shadow: 0 1px 3px rgba(40, 32, 18, 0.15);
}
.plan-viewer-version-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.plan-viewer-pins-toggle {
  position: absolute; top: 10px; left: 56px; z-index: 1100; display: flex; gap: 2px; padding: 3px;
  border: 1px solid var(--border); border-radius: 100px; background: var(--bg-card); box-shadow: var(--shadow-md);
}
.plan-viewer-pins-toggle .plan-viewer-version-btn { min-height: 28px; padding: 0 12px; font-size: 0.75rem; }
.plan-viewer-pins-toggle .plan-viewer-version-btn[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent-on); box-shadow: none; }
.plan-viewer-shot-cell-revised { padding: 6px 8px; margin: -6px -8px; border-radius: var(--radius-lg); background: rgba(var(--accent-fill-rgb), 0.08); }
.plan-viewer-revised-dot { display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--accent-fill); vertical-align: middle; }
.plan-viewer-tip-stale { display: block; margin-top: 4px; font-size: 0.7rem; font-weight: 600; color: var(--accent-on-tint); }
.plan-viewer-move-btn {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 8px;
  border: 1px solid var(--border-input); border-radius: 100px; background: var(--bg-card); color: var(--text-secondary);
  font: 600 0.68rem/1.4 inherit; font-family: inherit; text-transform: none; letter-spacing: 0; cursor: pointer;
}
.plan-viewer-move-btn:hover { border-color: var(--accent-fill); color: var(--text-primary); }
.plan-viewer-move-btn[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-on); }
.plan-viewer-move-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.plan-viewer-map-armed, .plan-viewer-map-armed .leaflet-grab { cursor: crosshair; }
.plan-viewer-back-to[hidden], .plan-viewer-close[hidden] { display: none; }
.plan-viewer-back-to { border-color: var(--accent-fill); }
.plan-viewer-notice-backdrop {
  position: fixed; inset: 0; z-index: 2600; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(20, 16, 10, 0.45);
}
.plan-viewer-notice {
  position: relative; box-sizing: border-box; width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px;
  padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-md);
}
.plan-viewer-notice p { margin: 0; padding-right: 28px; font-size: 0.9rem; line-height: 1.5; }
.plan-viewer-notice-x { position: absolute; top: 8px; right: 8px; }
.plan-viewer-notice-check { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-secondary); }
.plan-viewer-notice-check input { width: 18px; height: 18px; accent-color: var(--accent-fill); }
.plan-viewer-notice .plan-viewer-btn:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.plan-viewer-text-form { display: flex; flex-direction: column; gap: 8px; }
.plan-viewer-compare-line {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 12px; padding: 7px 0;
  border-bottom: 1px solid var(--bg-subtle); font-size: 0.78rem; line-height: 1.5; overflow-wrap: anywhere;
}
.plan-viewer-compare-line em { color: var(--text-muted); font-style: normal; }
.plan-viewer-saved-line { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.72rem; color: var(--text-secondary); }
.plan-viewer-start-over-confirm {
  display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 10px 12px;
  border: 1px solid var(--border-input); border-radius: var(--radius-lg); background: var(--bg-elevated);
  font-size: 0.78rem; line-height: 1.5; color: var(--text-primary);
}
.plan-viewer-start-over-confirm p { margin: 0; }
.plan-viewer-lens-notice { display: flex; align-items: center; gap: 5px; margin: 4px 0 0; font-size: 0.72rem; line-height: 1.4; font-weight: 500; color: var(--text-secondary); }
.plan-viewer-rewrite-note { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 10px 12px; border: 1px solid var(--accent-fill); border-radius: var(--radius-lg); background: var(--accent-light); font-size: 0.78rem; line-height: 1.5; color: var(--accent-on-tint); font-weight: 600; }
.plan-viewer-rewrite-note p { display: flex; align-items: center; gap: 6px; margin: 0; }
@keyframes pv-rewrite-flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 25% { box-shadow: 0 0 0 4px var(--accent-glow); } }
@media (prefers-reduced-motion: no-preference) { .plan-viewer-rewrite-flash { animation: pv-rewrite-flash 1.5s ease-out; } }
.plan-viewer-note-line { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 0.72rem; line-height: 1.5; color: var(--text-secondary); }
.plan-viewer-shot-float:has([data-pv-compare]) { width: min(580px, calc(100% - 20px)); }
.plan-viewer-compare { display: flex; flex-direction: column; font-size: 0.78rem; line-height: 1.5; }
.plan-viewer-compare-row {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px;
  padding: 8px 0; border-bottom: 1px solid var(--bg-subtle); overflow-wrap: anywhere;
}
.plan-viewer-compare-head { padding-top: 0; border-bottom-color: var(--border); font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); }
.plan-viewer-compare-revised-head { color: var(--accent-on-tint); }
.plan-viewer-compare-label { font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); }
.plan-viewer-compare-revised { color: var(--text-heading); }
.plan-viewer-compare del { padding: 1px 3px; border-radius: 3px; background: var(--bg-subtle); color: var(--text-secondary); }
.plan-viewer-compare ins { padding: 1px 3px; border-radius: 3px; background: rgba(var(--accent-fill-rgb), 0.18); color: var(--accent-on-tint); text-decoration: none; }
.plan-viewer-tie-line-faded { stroke-opacity: 0.3; }
.plan-viewer-sight-adjusted { stroke-linecap: round; }
.plan-viewer-unchanged-wrap { background: none; border: none; }
.plan-viewer-adjusted-pin-chip { background: var(--accent-light); border-color: transparent; color: var(--accent-on-tint); }
.plan-viewer-unchanged-chip {
  display: inline-block; transform: translate(-50%, 20px); padding: 1px 7px;
  border: 1px solid var(--border); border-radius: 100px; background: var(--bg-card); color: var(--text-secondary);
  font-size: 0.66rem; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 3px rgba(40, 32, 18, 0.15);
}
.pv-ghost-pin { opacity: 0.6; }
.review-pin-faint { opacity: 0.25; }
.pv-ghost-pin .journey-pin-body { border-style: dashed !important; background: rgba(255, 255, 255, 0.7) !important; }
.plan-viewer-moved-line { stroke: var(--color-success); stroke-linecap: round; }
.plan-viewer-moved-label-wrap { background: none; border: none; }
.plan-viewer-moved-label {
  display: inline-block; transform: translate(-50%, -50%); padding: 2px 8px;
  border: 1px solid var(--border); border-radius: 100px; background: var(--bg-card); color: var(--text-primary);
  font-size: 0.72rem; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-sm, 0 1px 3px rgba(40, 32, 18, 0.15));
}
@media (max-width: 680px) {
  .plan-viewer-body { grid-template-columns: minmax(0, 1fr); }
  .subplanner-map .plan-viewer-pins-toggle { top: 54px; }
  .plan-viewer-version-btn { min-height: 40px; font-size: 0.88rem; }
  .plan-viewer-adjust .plan-viewer-btn, .plan-viewer-notice .plan-viewer-btn { min-height: 44px; }
  .plan-viewer-move-btn { min-height: 32px; padding: 4px 12px; font-size: 0.78rem; }
}

/* ── Regenerate (Step 3) ──────────────────────────────────────────────── */
.plan-viewer-regen-status {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.plan-viewer-regenerate-btn:disabled { opacity: 0.6; cursor: default; }
.plan-viewer-day-rerun { align-self: flex-start; margin-top: 4px; }

.plan-viewer-save-flash {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  z-index: 1100; /* above Leaflet panes and the provider underlay */
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--accent-fill);
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.plan-viewer-save-flash-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Edit-a-generated-plan choice (plan-identity redesign, Requirement 4) ──
   Replaces the silent clone. Two options, neither preselected. */
.plan-edit-choice-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.plan-edit-choice-modal[hidden] { display: none; }
.plan-edit-choice-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, 0.60); }
.plan-edit-choice-content {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.28);
}
.plan-edit-choice-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.plan-edit-choice-header h2 { margin: 0; font-size: 1.1rem; color: var(--text-heading); }
.plan-edit-choice-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
/* Two steps share this class — the hidden one must actually be gone, and
   display:flex above outranks the [hidden] UA rule. */
.plan-edit-choice-body[hidden] { display: none; }
.plan-edit-choice-intro { margin: 0 0 2px; font-size: .875rem; color: var(--text-secondary); line-height: 1.5; }
.plan-edit-choice-intro strong { color: var(--text-heading); }
.plan-edit-choice-option {
  display: flex; flex-direction: column; gap: 5px;
  text-align: left; width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-input);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.plan-edit-choice-option:hover,
.plan-edit-choice-option:focus-visible { background: var(--bg-secondary); border-color: var(--accent-fill); outline: none; }
.plan-edit-choice-option[disabled] { opacity: .55; cursor: progress; }
.plan-edit-choice-option-title { font-size: .9rem; font-weight: 600; color: var(--text-heading); }
.plan-edit-choice-option-detail { font-size: .8rem; line-height: 1.5; color: var(--text-secondary); }
.plan-edit-choice-option-detail strong { color: var(--text-primary); }

/* ── The two outcomes are no longer equally weighted (2026-08-25) ──────────
   Forking into a new plan is the expected one: it is a real panel with the
   rename step and the only filled button in the dialog. Converting this
   plan's own row is a text link into a second, heavier step — visually
   secondary because it is the one that touches the only copy. */
.plan-edit-choice-option-default {
  cursor: default;
  border-color: var(--accent-fill);
  background: var(--bg-secondary);
  gap: 10px;
}
.plan-edit-choice-option-default:hover { background: var(--bg-secondary); }
.plan-edit-choice-rename { display: flex; flex-direction: column; gap: 4px; }
.plan-edit-choice-rename[hidden] { display: none; }
.plan-edit-choice-rename-label { font-size: .78rem; font-weight: 600; color: var(--text-heading); }
.plan-edit-choice-rename-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-family: inherit;
  font-size: .85rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 8px;
}
.plan-edit-choice-rename-input:focus-visible {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.plan-edit-choice-rename-hint { font-size: .74rem; line-height: 1.45; color: var(--text-muted); }
.plan-edit-choice-go {
  align-self: flex-start;
  padding: 9px 16px;
  border: 1px solid var(--accent-fill);
  border-radius: 8px;
  background: var(--accent-fill);
  color: var(--accent-on);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.plan-edit-choice-go[disabled] { opacity: .55; cursor: progress; }
.plan-edit-choice-secondary {
  align-self: flex-start;
  padding: 4px 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.plan-edit-choice-secondary:hover { color: var(--color-error); }
.plan-edit-choice-secondary[disabled] { opacity: .55; cursor: progress; }
.plan-edit-choice-secondary[data-linked-lock] { cursor: not-allowed; text-decoration: line-through; }
.plan-edit-choice-secondary[data-linked-lock]:hover { color: var(--text-secondary); }
.plan-edit-choice-linked-note {
  margin: -6px 0 0;
  font-size: .78rem;
  line-height: 1.45;
  color: var(--text-secondary);
}
.plan-edit-choice-linked-note[hidden] { display: none; }

/* The heavier confirmation. This step is the only route to the action that
   converts the ONLY copy of a generated plan, and its button stays inert
   until the acknowledgement is ticked — reaching the step is not consent. */
.plan-edit-choice-danger[hidden] { display: none; }
.plan-edit-choice-danger-lead {
  margin: 0;
  font-size: .875rem;
  line-height: 1.5;
  color: var(--color-error);
  font-weight: 600;
}
.plan-edit-choice-danger-lead strong { color: var(--color-error); }
.plan-edit-choice-ack {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  background: var(--bg-secondary);
  font-size: .8rem;
  line-height: 1.45;
  color: var(--text-primary);
  cursor: pointer;
}
.plan-edit-choice-ack input { margin-top: 2px; flex: none; }
.plan-edit-choice-danger-actions { display: flex; justify-content: space-between; gap: 10px; }
.plan-edit-choice-danger-actions .btn-secondary {
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border-input);
  background: transparent; color: var(--text-heading);
  font-family: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.plan-edit-choice-danger-go {
  padding: 9px 16px;
  border: 1px solid var(--color-error);
  border-radius: 8px;
  background: transparent;
  color: var(--color-error);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.plan-edit-choice-danger-go:hover:not([disabled]) { background: var(--color-error); color: var(--bg-card); }
.plan-edit-choice-danger-go[disabled] { opacity: .45; cursor: not-allowed; }
.plan-edit-choice-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 16px; }
.plan-edit-choice-footer .btn-secondary { padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border-input); background: transparent; color: var(--text-heading); font-size: .85rem; font-weight: 600; cursor: pointer; }
.plan-edit-choice-footer .btn-secondary:hover { background: var(--bg-secondary); border-color: var(--accent-fill); color: var(--accent-primary); }

/* Subject free-text intent + the character counters (2026-08-27, hard rule 8).
   The 80-char label cap used to bite silently — maxLength just stopped taking
   keystrokes — so intent typed into the label lost its tail with nothing to
   show for it. Both counters stay hidden until the cap is close, then appear;
   at the cap the label counter also points at where the text actually belongs. */
.event-subject-intent {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 6px 8px;
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.event-subject-intent:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.event-subject-intent::placeholder { color: var(--color-text-tertiary); }
.event-subject-label-count,
.event-subject-intent-count {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--color-text-tertiary);
}
.event-subject-label-count { margin-left: 30px; }
.event-subject-label-count.at-cap,
.event-subject-intent-count.at-cap {
  color: var(--color-warning);
  font-weight: 600;
}
.event-subject-label-count[hidden],
.event-subject-intent-count[hidden] { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   Subject Sun Dial (feat/subject-sun-dial, 2026-08-28)

   A dial anchored to a subject's own coordinate on the sub-planner map, plus
   a right-docked panel for setting that subject's time by light instead of by
   number. Everything below is chrome over the map; the only new colour
   vocabulary is the light-quality ramp (--subject-dial-light, set from JS),
   which is intrinsic to the feature — every other value is a design token.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Opener, in the subject row's own Time field. */
.event-subject-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.event-subject-time-row .event-subject-time { flex: 1; min-width: 0; }
.event-subject-dial-btn {
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-input);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.event-subject-dial-btn:hover:not(:disabled) {
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}
.event-subject-dial-btn.active {
  background: var(--accent-light);
  border-color: var(--accent-fill);
  color: var(--accent-on-tint);
}
.event-subject-dial-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.event-subject-dial-btn:focus-visible {
  outline: 2px solid var(--accent-fill);
  outline-offset: 2px;
}

/* HH:MM beside a subject pin. Absolutely positioned so the divIcon's own
   30x35 box — and therefore every marker anchor already shipped — is
   unchanged whether or not the chip is present. */
.journey-pin-time {
  position: absolute;
  left: calc(100% + 4px);
  top: 4px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}
/* Which pin the open dial is actually reading. Without this every timed
   subject looks identical and the sheet's readout has no anchor on the map. */
.journey-pin-time-active {
  background: var(--accent-fill-strong);
  border-color: var(--accent-fill-strong);
  color: var(--accent-on);
}

/* ── Dial ink. Theme-scoped here rather than branched in JS, so the SVG can
      just reference the variables and the render path stays theme-blind. ── */
.subject-dial-host,
.subject-dial-chrome {
  --subject-dial-ink: rgba(70, 60, 45, 0.45);
  --subject-dial-ink-faint: rgba(70, 60, 45, 0.2);
  --subject-dial-text: #4A4133;
  --subject-dial-path: rgba(120, 95, 50, 0.5);
  --subject-dial-shadow-ink: #2B2A33;
  --subject-dial-cone: #6F6299;
  --subject-dial-sun-ring: #FFFFFF;
}
[data-theme="dark"] .subject-dial-host,
[data-theme="dark"] .subject-dial-chrome {
  --subject-dial-ink: rgba(230, 214, 190, 0.5);
  --subject-dial-ink-faint: rgba(230, 214, 190, 0.22);
  --subject-dial-text: #E8DCC8;
  --subject-dial-path: rgba(245, 180, 78, 0.55);
  --subject-dial-shadow-ink: #04050A;
  --subject-dial-cone: #E6E6FA;
  --subject-dial-sun-ring: #14100D;
}
/* --subject-dial-light is written by JS onto the .leaflet-container so both
   roots inherit ONE live value. */

/* The OVERLAY host: above Leaflet's marker pane, below its popup pane, and
   below its controls — it is map ink, and the map must stay draggable through
   it. The card/sheet/note that used to live here are CHROME and moved to
   .subject-dial-chrome: a positioned z-index makes this box a stacking
   context, so their own z-index:810 was sealed inside a box that Leaflet's
   control layer (.leaflet-top/.leaflet-bottom, z-index 1000) painted straight
   over — the compass covering the corner card, the legend covering the note. */
.subject-dial-host { position: absolute; inset: 0; pointer-events: none; z-index: 690; }
.subject-dial-host > * { pointer-events: auto; }

/* The CHROME layer: one notch above Leaflet's controls, because the sheet has
   to be able to cover the attribution it displaces. Never eats a click it
   isn't given — the map stays draggable everywhere the sheet is not. */
.subject-dial-chrome {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1001;
}
.subject-dial-chrome > * { pointer-events: auto; }
.subject-dial-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* The overlay sits above Leaflet's panes but below its controls, and never
   eats a click — the map underneath must stay draggable through it. */
.subject-dial-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.subject-dial-layer[hidden] { display: none; }
.subject-dial-overlay {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.subject-dial-overlay svg { width: 100%; height: 100%; overflow: visible; display: block; }
.subject-dial-rim { stroke: var(--subject-dial-ink); }
.subject-dial-ring { stroke: var(--subject-dial-ink-faint); }
.subject-dial-cardinals { fill: var(--subject-dial-text); font-weight: 700; font-family: var(--font-primary); }
.subject-dial-path { stroke: var(--subject-dial-path); }
.subject-dial-cone { fill: var(--subject-dial-cone); }
.subject-dial-shadow-line { stroke: var(--subject-dial-shadow-ink); }
.subject-dial-shadow-stop { stop-color: var(--subject-dial-shadow-ink); }
.subject-dial-sun { stroke: var(--subject-dial-sun-ring); }
[data-dial-el="warm0"],
[data-dial-el="warm1"],
[data-dial-el="warm2"] { stop-color: var(--subject-dial-light, #F5B44E); }
/* At a whole-trip zoom the true 260 m rim is a couple of pixels, so the
   render floors it — dashed, to say plainly that this one is legibility, not
   scale. */
.subject-dial-overlay-floored .subject-dial-rim { stroke-dasharray: 5 5; }

/* ── ONE persistent corner control (defect 1, corrective 2026-09-01) ────────

   .sun-compass is always the round dial face — closed, Day Overview open,
   subject context open, or subject sheet docked. It never swaps to a card,
   never hides, never unmounts. A ring is the only visual difference when a
   panel is open, on box-shadow (not border-color) so it never fights the
   phase palette's own border (golden/blue set border-color on this same
   element). Applied whenever EITHER panel is open — the compact Day
   Overview panel or the subject sheet — for one consistent "expanded"
   signal. */
.sun-compass.sun-dial-open .sun-dial-face { box-shadow: 0 0 0 2px var(--accent-fill), 0 2px 10px rgba(0, 0, 0, 0.18); }

/* ── Docked sheet ──────────────────────────────────────────────────────────

   A bottom sheet spanning the map's width, not a 330px full-height right
   drawer. The content wants width, not height: the slider is one 1440-minute
   axis, and the handoff's own Known Risks flag its precision — "1440 minutes
   across ~280px is roughly 5 minutes per pixel". Full-width on the shell map
   is ~810px of track, about 1.8 min/px, which retires that risk instead of
   carrying it. Everything below the time row is an auto-fit grid, so the same
   sheet reads as three columns on a wide map and one on a narrow one.

   Height is a single clamp reused verbatim by the .leaflet-bottom lift below;
   both resolve their percentage against .leaflet-container, so the controls
   ride exactly on the sheet's top edge with no JS measurement to keep in
   sync. */
.subject-dial-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(60%, clamp(180px, 46%, 306px));
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-lg, 0 -12px 40px rgba(0, 0, 0, 0.28));
}
.subject-dial-sheet[hidden] { display: none; }
/* Map controls move WITH the sheet rather than being covered by it — the
   standard bottom-sheet + map rule. One declaration lifts both bottom
   corners: "Legend & tips" (bottomleft) and the attribution (bottomright). */
.leaflet-container.subject-dial-sheet-open .leaflet-bottom {
  bottom: min(60%, clamp(180px, 46%, 306px));
  transition: bottom 0.2s ease;
}

.subject-dial-sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
}
.subject-dial-sheet-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.subject-dial-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
/* The subject selector. Same dropdown language as the export toolbar
   (.export-menu / .export-btn[aria-expanded] / .export-dropdown[hidden]):
   a caret-bearing trigger, a hidden panel anchored under it, dismissed by a
   click anywhere else. The rows inside are the shipped Subjects rail,
   unchanged — this replaces the rail's PRESENTATION, not the rail. */
.subject-dial-picker { position: relative; display: flex; min-width: 0; }
.subject-dial-picker-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.subject-dial-picker-btn:hover { border-color: var(--accent-fill); }
.subject-dial-picker-btn:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.subject-dial-picker-btn[aria-expanded="true"] { border-color: var(--accent-fill); background: var(--accent-light); }
.subject-dial-picker-letter {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary);
}
.subject-dial-picker-caret {
  flex: none;
  font-size: 0.8em;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}
.subject-dial-picker-btn[aria-expanded="true"] .subject-dial-picker-caret { transform: rotate(90deg); }
.subject-dial-subject {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subject-dial-picker-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 3;
  min-width: max(220px, 100%);
  max-width: min(340px, 80vw);
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.18));
}
.subject-dial-picker-menu[hidden] { display: none; }
.subject-dial-sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 9px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* The time row: readout locked to the left, the track taking every remaining
   pixel. This is the whole point of the sheet — the track is the control the
   user spends their time in, and width IS its precision. */
.subject-dial-sheet-time {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
}
.subject-dial-track-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
/* The three-column auto-fit grid is retired with the markup it laid out
   (compact console, 2026-09-06): every block below the time row is now full
   width and ordered by task, so the same sheet reads the same way at 1440px
   and on an iPad instead of reflowing its priorities with the map's width. */
.subject-dial-clock {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--subject-dial-light, #F5B44E);
}
.subject-dial-state {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.subject-dial-state-live { color: var(--color-warning); }
.subject-dial-state-set { color: var(--color-success); }

/* flex:none is load-bearing — as a flex child in a column this collapses to
   nothing the moment the panel body is short. */
.subject-dial-track {
  position: relative;
  height: 34px;
  flex: none;
  border-radius: 8px;
  border: 1px solid var(--border-input);
  overflow: hidden;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
}
.subject-dial-track:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 3px; }
.subject-dial-grad { position: absolute; inset: 0; }
.subject-dial-hair {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.55);
}
.subject-dial-hair[hidden] { display: none; }
.subject-dial-blocks { position: absolute; inset: 0; }
.subject-dial-block {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  border-left: 1px solid rgba(255, 255, 255, 0.5);
  border-right: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding-left: 2px;
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.subject-dial-block-clash {
  background: rgba(248, 113, 113, 0.55);
  border-left-color: rgba(248, 113, 113, 0.95);
  border-right-color: rgba(248, 113, 113, 0.95);
}
.subject-dial-own {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 3px;
}
.subject-dial-committed {
  position: absolute;
  bottom: 3px;
  width: 2px;
  height: 8px;
  background: #000000;
  opacity: 0.8;
}
.subject-dial-committed[hidden] { display: none; }
.subject-dial-handle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 4px;
  margin-left: -2px;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 14px var(--subject-dial-light, #F5B44E);
  pointer-events: none;
}
.subject-dial-handle-wide { width: 6px; margin-left: -3px; }
.subject-dial-legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* The rail's own card is retired with the sheet column it sat in — the
   picker menu is its surface now. Its head (SUBJECTS + the overlap verdict)
   travels with the rows it summarises. */
.subject-dial-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.subject-dial-verdict { font-weight: 600; letter-spacing: 0; text-transform: none; }
.subject-dial-verdict-clear { color: var(--color-success); }
.subject-dial-verdict-clash { color: var(--color-error); }
/* Real <button>s, not divs: these are the only subject switcher on screen
   once the sheet is open, so they need the keyboard and the role for free. */
.subject-dial-tl-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin: 0;
  padding: 4px 6px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.subject-dial-tl-row:hover:not(.subject-dial-tl-active) {
  background: var(--bg-secondary);
  border-color: var(--border-hover, var(--border));
}
.subject-dial-tl-row:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.subject-dial-tl-active { cursor: default; }
.subject-dial-tl-active {
  background: var(--accent-light);
  border-color: var(--accent-fill);
  font-weight: 600;
}
.subject-dial-tl-clash { border-color: rgba(248, 113, 113, 0.45); }
.subject-dial-tl-letter { width: 12px; font-size: 11px; font-weight: 700; color: var(--accent-primary); }
.subject-dial-tl-name {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subject-dial-tl-span { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.subject-dial-tl-active .subject-dial-tl-name,
.subject-dial-tl-active .subject-dial-tl-span { color: var(--text-heading); }
.subject-dial-tl-clash .subject-dial-tl-letter,
.subject-dial-tl-clash .subject-dial-tl-name,
.subject-dial-tl-clash .subject-dial-tl-span { color: var(--color-error); }
/* Row 0 in every rail, always the same sentinel row — set apart from the
   subject list it sits above rather than blending into it. */
.subject-dial-tl-day { margin-bottom: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.subject-dial-tl-day .subject-dial-tl-letter { font-size: 13px; }

.subject-dial-chips { display: flex; gap: 5px; flex-wrap: wrap; flex: none; }
.subject-dial-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-input);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.subject-dial-chip:hover { border-color: var(--accent-fill); color: var(--accent-primary); }
.subject-dial-chip:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.subject-dial-chip-play {
  border-color: var(--accent-fill);
  background: var(--accent-light);
  color: var(--accent-on-tint);
  font-weight: 600;
}

/* Current light — one quiet block, not a card. The phase, the three
   readings the photographer is deciding on, and the phase copy's own first
   sentence; the rest of that same copy sits behind the site's More/Fewer
   control (reveal.js:675). No border, no tint: the sheet already is the
   surface, and boxing every section is what made the old panel loud. */
.subject-dial-summary { display: flex; flex-direction: column; gap: 2px; flex: none; }
.subject-dial-summary-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-heading);
}
.subject-dial-summary-phase {
  font-family: var(--font-primary);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-on-tint);
}
.subject-dial-summary-sep { color: var(--text-muted); }
.subject-dial-summary-body { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--text-secondary); }
.subject-dial-more {
  margin-left: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--accent-primary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.subject-dial-more[hidden] { display: none; }
.subject-dial-more:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.subject-dial-phase-body {
  margin: 4px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.subject-dial-phase-body[hidden] { display: none; }

.subject-dial-rows { display: flex; flex-direction: column; gap: 5px; margin: 0; font-size: 11.5px; }
.subject-dial-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.subject-dial-row dt { color: var(--text-muted); }
.subject-dial-row dd { margin: 0; font-family: var(--font-mono); color: var(--text-heading); }
.subject-dial-facing { display: flex; align-items: center; gap: 5px; }
.subject-dial-facing span { min-width: 58px; text-align: right; }
.subject-dial-step {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--border-input);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.subject-dial-step:hover { border-color: var(--accent-fill); color: var(--accent-primary); }
.subject-dial-step:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }

/* Progressive disclosure. The Planner accordion's interaction language
   (.planner-acc, planner.css:4464) at the sheet's scale: hairline separator,
   caret ▾ rotating 180° on open, aria-expanded on a real heading button,
   focus ring from the same token. Dial-scoped names because .planner-acc is
   bound to the FORM's one-open-at-a-time controller and to the Playwright
   sections helper, neither of which should reach into a map overlay. */
.subject-dial-disc { border-top: 1px solid var(--border); flex: none; }
.subject-dial-disc-heading { margin: 0; }
.subject-dial-disc-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
  padding: 5px 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
  font: inherit;
  color: var(--text-primary);
  cursor: pointer;
}
.subject-dial-disc-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.subject-dial-disc-title { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.subject-dial-disc-caret {
  font-size: 0.8em;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}
.subject-dial-disc.is-open .subject-dial-disc-caret { transform: rotate(90deg); }
.subject-dial-disc-body { display: flex; flex-direction: column; gap: 9px; padding: 2px 0 8px; }
.subject-dial-disc-body[hidden] { display: none; }

.subject-dial-toggles {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.subject-dial-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
}
.subject-dial-switch:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 3px; }
.subject-dial-switch-pill {
  position: relative;
  flex: none;
  width: 30px;
  height: 17px;
  border-radius: 999px;
  background: var(--border-input);
  box-shadow: inset 13px 0 0 0 rgba(255, 255, 255, 0.55);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.subject-dial-switch[aria-pressed="true"] .subject-dial-switch-pill {
  background: var(--accent-fill-strong);
  box-shadow: inset -13px 0 0 0 rgba(255, 255, 255, 0.9);
}

.subject-dial-disclaimer {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}
.subject-dial-conflict {
  margin: 0;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.subject-dial-conflict[hidden] { display: none; }
/* Every block subjectDialSetContextVisibility toggles between the subject and
   Day Overview contexts (single-surface 2026-08-31) declares its own
   `display`, which beats the UA [hidden] default at equal specificity — the
   same trap .subject-dial-conflict[hidden] above already worked around. */
.subject-dial-sheet-time[hidden],
.subject-dial-chips[hidden],
.subject-dial-rows[hidden],
.subject-dial-summary[hidden],
.subject-dial-disc[hidden],
.subject-dial-toggles[hidden],
.subject-dial-sheet-foot[hidden] { display: none; }

.subject-dial-sheet-foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 7px 16px;
  border-top: 1px solid var(--border);
}
.subject-dial-revert {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-input);
  background: transparent;
  color: var(--text-heading);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.subject-dial-revert:hover { border-color: var(--accent-fill); color: var(--accent-primary); }
.subject-dial-commit {
  flex: none;
  min-width: 190px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent-fill);
  background: var(--accent-fill-strong);
  color: var(--accent-on);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.subject-dial-commit-set {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #ffffff;
}
.subject-dial-commit:disabled { opacity: 0.5; cursor: not-allowed; }
.subject-dial-revert:focus-visible,
.subject-dial-commit:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
/* CSS keyframes, not a rAF loop — the house rule on these maps. */
@keyframes subjectDialStamp {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.subject-dial-stamp { animation: subjectDialStamp 0.42s ease; }

@media (prefers-reduced-motion: reduce) {
  .subject-dial-stamp { animation: none; }
  .subject-dial-switch-pill { transition: none; }
  .subject-dial-picker-caret,
  .subject-dial-disc-caret { transition: none; }
}

/* Narrow viewports: the sheet is allowed more of the map because the
   auto-fit grid has collapsed to one column. */
@media (max-width: 640px) {
  .subject-dial-sheet { height: 62%; }
  .leaflet-container.subject-dial-sheet-open .leaflet-bottom { bottom: 62%; }
  .subject-dial-sheet-time { flex-wrap: wrap; gap: 8px; }
  .subject-dial-clock { font-size: 22px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Planner Focus Mode (2026-09-04) — body.planner-focus
   ──────────────────────────────────────────────────────────────────────────
   The Planner's counterpart of App Mode (app.css:2251): site header and
   footer step out and the map takes the released height. NOT App Mode's
   body lock — the form is far taller than any viewport, so the document
   keeps scrolling normally: no position:fixed, no overflow:hidden, no fixed
   viewport height on body, and no entry/exit transition (the Leaflet
   re-measure in planner.js runs on a fixed timer and needs settled layout).

   --nav-height is the one lever: the sticky right panel (top/height above)
   and the fullscreen map inset (6760) already derive from it, so zeroing it
   here moves the map to the viewport top and drops the fullscreen inset from
   76px to 12px without touching either rule. The chrome itself hides in
   shared.css beside the App Mode rules (body.planner-focus .shared-navbar /
   .shared-footer). Everything else — heading, Trip Basics, day cards,
   sub-planner, sun dial, Companion, Plan Viewer, modals — stays exactly as it
   is. Nothing persists: a reload always lands in normal mode.
   ══════════════════════════════════════════════════════════════════════════ */
body.planner-focus { --nav-height: 0px; }

/* Beta feedback pill lives in the navbar (beta-widget.js mounts it beside the
   logo) so it goes with the header; its body-level panel/popover follow. The
   Companion is deliberately NOT here — it stays usable in the mode. */
body.planner-focus #a22-bw-pill,
body.planner-focus #a22-bw-panel,
body.planner-focus #a22-info-pop { display: none; }

/* The inline sticky-wrap rule (6224) hardcodes top:76px = 64px nav + 12px;
   with the nav gone it must follow the zero-height header state. */
body.planner-focus .subplanner-map-wrap { top: calc(var(--nav-height) + 12px); }

/* Responsive column balance. Hiding the header adds height but no width:
   at 1024×768 the map was still 488px. The base track is
   clamp(360px, 50vw, 560px); in the mode the tablet band gives the form a
   smaller share of the viewport — 40vw, same 360px floor — so the map gains
   real width without the form dropping below the width the base rule
   already accepts as legible. Bounded ABOVE at 1180px on purpose: from 1181
   up, 50vw ≥ 560 and the base clamp already resolves to the 560px mock, so
   the desktop balance is untouched; bounded BELOW at 681px so the stacked
   phone layout (the 680px block above) is never re-split.
     1024 → 410 / 590 (was 512 / 488)   820 → 360 / 436 (was 410 / 386)
      768 → 360 / 384 (was 384 / 360) */
@media (min-width: 681px) and (max-width: 1180px) {
  body.planner-focus #planner-interface { grid-template-columns: clamp(360px, 40vw, 560px) 1fr; }
}

.leaflet-popup-content-wrapper {
  background: #FDFBF7;
  border: 1px solid #E3DCCD;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(40, 32, 18, 0.18);
}
.leaflet-popup-tip {
  background: #FDFBF7;
  box-shadow: 0 2px 10px rgba(40, 32, 18, 0.12);
}
.leaflet-popup-content:not(:has(.subplanner-pin-popup-compact, .day-preview-popup)) {
  width: 320px !important;
  max-width: min(320px, calc(100vw - 32px));
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
/* Playback stop card: name + time · shots, nothing else. Rides the popup
   chrome above (cream, 10px radius, soft shadow); only the inner spacing and
   width shrink. */
.leaflet-popup-content:has(.day-preview-popup) { margin: 7px 11px; }
.day-preview-popup { display: flex; flex-direction: column; gap: 1px; max-width: 220px; line-height: 1.3; font-family: inherit; text-align: center; }
.day-preview-popup-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font-size: 0.8rem; font-weight: 600; color: #333333; }
.day-preview-popup-meta { font-size: 0.7rem; color: #555555; font-variant-numeric: tabular-nums; }
.subplanner-pin-street-view { color: #2E6FBF; border-color: #B9D0EE; background: #F3F7FD; }
.subplanner-pin-street-view:hover { background: #E6EFFB; }

/* All Plans world map — one pin per trip. isolation keeps Leaflet's panes
   (z-index up to 700) beneath the sticky chrome and modals. */
.plans-world-map-wrap { margin: 0 0 20px; }
.plans-world-map {
  height: 260px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}
.plans-world-map-wrap[hidden], .plans-world-map-note[hidden] { display: none; }
/* Full plan / Mode 2 Overview tab: short, so the overview text shows under it. */
.overview-trip-map-wrap { position: relative; margin: 0 0 16px; }
.overview-trip-map {
  height: 280px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-card, var(--bg-primary));
}
@media (max-width: 680px) { .overview-trip-map { height: 200px; } }
.overview-trip-map-open {
  position: absolute; top: 10px; right: 10px; z-index: 800;
  padding: 5px 12px; font: inherit; font-size: 0.8rem; font-weight: 600;
  color: var(--color-text-primary); background: var(--bg-card); border: 1px solid var(--color-border);
  border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); cursor: pointer;
}
.overview-trip-map-open:hover { border-color: var(--accent-fill); }
/* Standard | Google starts under Open in Map, which holds the corner. Three classes: leaflet.css loads after this file. */
.overview-trip-map-wrap:has(.overview-trip-map-open) .leaflet-top .map-provider-tools { margin-top: 44px; }
/* Floats over the map canvas: left clears Leaflet's zoom control, right clears "View all plans". Children re-enable pointer events so the gaps still pan the map. */
.plans-world-map-header { position: absolute; top: 12px; left: 56px; right: 150px; z-index: 800; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.plans-world-map-header > * { pointer-events: auto; }
.plans-world-map-search { display: flex; align-items: center; gap: 4px; flex: 0 1 220px; min-width: 0; }
.plans-world-map-header .plan-viewer-map-toolbar { margin-left: auto; flex: 0 0 auto; }
.plans-world-map-header .map-provider-tools { flex-wrap: nowrap; }
.plans-world-map-header .subplanner-place-search { background: var(--bg-card); border-color: var(--border-input); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
/* Group pin's plan count: sits in the -45deg body, so the body's left edge is
   the pin's lower left — opposite the photo badge (top right). */
.plans-pin-count {
  position: absolute; left: -10px; top: 50%; transform: translateY(-50%) rotate(45deg);
  min-width: 15px; height: 15px; padding: 0 3px; box-sizing: border-box; border-radius: 8px;
  background: var(--text-primary); color: var(--bg-elevated); border: 1px solid var(--bg-elevated);
  font-size: 9px; font-weight: 700; line-height: 13px; text-align: center; font-family: var(--font-primary, inherit);
}
/* Group pin's plan list. Popup chrome is always cream, so fixed colours. */
.leaflet-popup-content:has(.plans-pin-pill) { width: auto !important; margin: 6px; }
.plans-pin-pill { display: flex; flex-direction: column; gap: 2px; width: max-content; min-width: 200px; max-width: min(280px, calc(100vw - 48px)); }
.plans-pin-pill-row { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 0.82rem; color: #333333; text-align: left; cursor: pointer; }
.plans-pin-pill-row:hover { background: #F1ECE1; }
.plans-pin-pill-row:focus-visible { outline: 2px solid #2E6FBF; outline-offset: -2px; }
.plans-pin-pill-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plans-pin-pill-chip { flex: none; padding: 2px 8px; border-radius: 999px; font-size: 0.68rem; font-weight: 600; background: #E8F0FA; color: #2E5F9E; }
.plans-pin-pill-chip.is-draft { background: #FBEFD9; color: #8A5A00; }
.plans-pin-pill-matched { flex: none; font-size: 0.72rem; color: #555555; font-variant-numeric: tabular-nums; }

/* Pins-only landing view: the same #my-plans-section and the same map element
   as All Plans (one pin implementation), with everything but the map hidden
   and the map sized to the panel. */
.plans-view-switch-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font: inherit;
  font-size: 0.82rem;
  color: var(--color-text-primary);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
}
.plans-world-map-wrap { position: relative; }
.plans-list-btn { position: absolute; top: 12px; right: 12px; z-index: 800; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
body.planner-shell #planner-right-panel[data-view="pins"] { display: flex; flex-direction: column; }
body.planner-shell #planner-right-panel[data-view="pins"] .right-panel-view-plans { flex: 1; min-height: 0; padding: 12px; display: flex; flex-direction: column; }
body.planner-shell #planner-right-panel[data-view="pins"] #my-plans-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.planner-shell #planner-right-panel[data-view="pins"] #my-plans-section > :not(#plans-world-map-wrap) { display: none; }
body.planner-shell #planner-right-panel[data-view="pins"] .plans-world-map-wrap { flex: 1; min-height: 0; margin: 0; display: flex; flex-direction: column; }
body.planner-shell #planner-right-panel[data-view="pins"] .plans-world-map { flex: 1; height: auto; min-height: 320px; }
body.planner-shell #planner-right-panel[data-view="pins"] .plans-world-map-note { position: absolute; left: 12px; bottom: 12px; z-index: 800; margin: 0; padding: 4px 10px; border-radius: 8px; background: var(--color-surface, #fff); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15); }
body.planner-shell #planner-right-panel[data-view="pins"] .plans-list-btn { display: inline-flex; }
body.planner-shell #planner-right-panel[data-view="plans"] #my-plans-section:has(#plans-world-map-wrap:not([hidden])) .plans-pins-back-btn { display: inline-flex; }
.my-plans-header .plans-pins-back-btn { margin-left: auto; }
.plans-world-map-note {
  margin: 8px 2px 0;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* Trip marker — the stop that stands for the trip on the All Plans map.
   Same pill as "Ends here"; the pin button is the quiet secondary control the
   Move-to-Day footer already uses. */
.subplanner-marker-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-primary);
  background: var(--accent-light);
  border: 1px solid var(--accent-fill);
  border-radius: 999px;
  white-space: nowrap;
}
.subplanner-marker-badge[hidden] { display: none; }
.subplanner-stop-marker { margin-top: 10px; }
.subplanner-stop-marker-btn { font-size: 11.5px; border-radius: 8px; }
.subplanner-stop-marker-btn[aria-pressed="true"] {
  color: var(--accent-primary);
  border-color: var(--accent-fill);
}

/* Shared-chevron direction helpers (the chevron points right by default). */
.a22-chev-down { transform: rotate(90deg); }
.a22-chev-up { transform: rotate(-90deg); }
.a22-chev-back { transform: rotate(180deg); }

.plan-viewer-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Leaflet zoom: the shared control look (white, warm grey glyph, hover tint). */
.leaflet-bar a,
.leaflet-bar a:hover {
  color: var(--text-secondary);
  background: var(--bg-elevated);
  font-weight: 500;
}
.leaflet-bar a:hover { background: var(--bg-secondary); color: var(--text-primary); }
