/* ==========================================================================
   1. Smarter Dynamic Accent Variable Maps & Emoji Font Fallback Stack
   ========================================================================== */

.panel-deck,
.timeline-container,
.card-wrapper,
.card {
  font-family: var(--font-sans), "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* Expandable Card Scopes */
.card-flight-expandable {
  --card-accent: var(--accent-flight);
}

.card-transit-expandable {
  --card-accent: var(--accent-transit, #00e5a3);
}

.card-lodging-expandable {
  --card-accent: var(--accent-lodging);
}

.card-car-expandable {
  --card-accent: var(--accent-car);
}

.card-dining-expandable {
  --card-accent: var(--accent-dining);
}

/* Timeline Bullet Scopes */
.card-wrapper.flight {
  --bullet-accent: var(--accent-flight);
}

.card-wrapper.transit {
  --bullet-accent: var(--accent-transit, #00e5a3);
}

.card-wrapper.lodging {
  --bullet-accent: var(--accent-lodging);
}

.card-wrapper.car {
  --bullet-accent: var(--accent-car);
}

.card-wrapper.dining {
  --bullet-accent: var(--accent-dining);
}

.card-wrapper.activity {
  --bullet-accent: var(--accent-sandbox);
  --card-accent: var(--accent-sandbox);
}


/* Floating timeline controls (collapse/expand all, export guide, filter) &
   the filter popover overlay. */
.timeline-filter-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  /* flex-end (not space-between): the title fills the leading space via its
     own flex-grow when present, but once it's display:none in the sticky
     state (below) a lone flex child under space-between would snap to the
     start — flex-end keeps the buttons pinned to the right either way. */
  justify-content: flex-end;
  gap: 12px;
  margin: 6px 0 -23px 0;
  z-index: 25;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

/* Sits inline with the print/map/filter buttons, right above the first day
   header. Deliberately excluded from the scroll-up sticky state below (see
   .is-sticky-header rule) — the title should scroll away like the rest of
   the timeline, only the buttons persist. */
.timeline-trip-title {
  font-size: 23px;
  font-weight: 1000;
  line-height: 28px;
  height: 28px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.timeline-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Sticky on Scroll-Up State */
.timeline-filter-wrapper.is-sticky-header {
  position: sticky;
  top: 12px;
  z-index: 35;
  margin-bottom: -32px;
  pointer-events: none;
}

/* The title doesn't persist into the sticky bar — it already scrolled out
   of view by the time this state engages, and the bar's job at that point
   is just to keep the action buttons reachable. */
.timeline-filter-wrapper.is-sticky-header .timeline-trip-title {
  display: none;
}

.timeline-filter-wrapper.is-sticky-header .filter-icon-btn {
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border-focus);
}

.timeline-filter-wrapper.is-sticky-header .filter-popover-container {
  pointer-events: auto;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.timeline-filter-wrapper.is-sticky-header.sticky-hidden {
  transform: translateY(-50px);
  opacity: 0;
  pointer-events: none;
}

.timeline-filter-wrapper.is-sticky-header.sticky-visible {
  transform: translateY(0);
  opacity: 1;
}

.filter-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.filter-icon-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.filter-icon-btn.is-active-filter {
  border-color: var(--accent-flight, #00e5ff);
  color: var(--accent-flight, #00e5ff);
}

.filter-indicator-dot {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-flight, #00e5ff);
}

/* Collapse/Expand All Days icon (see #btn-collapse-all-days in app.js):
   the two icons are stacked and cross-faded with a quarter-turn, rather
   than swapped outright, so the button reads as one icon morphing between
   its two states instead of a hard cut. */
.collapse-icon-stack {
  position: relative;
  width: 16px;
  height: 16px;
}

.collapse-icon-stack svg {
  position: absolute;
  inset: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.icon-expand-all {
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
}

#btn-collapse-all-days.all-collapsed .icon-collapse-all {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}

#btn-collapse-all-days.all-collapsed .icon-expand-all {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.filter-icon-btn.is-active-filter .filter-indicator-dot {
  display: block;
}

.filter-popover-container {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 8px;
  gap: 6px;
  box-shadow: var(--shadow-premium);
  z-index: 30;
  flex-wrap: wrap;
  width: 280px;
}

.filter-popover-container.open {
  display: flex;
}

.filter-pill {
  background: var(--bg-core);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
  user-select: none;
  flex-shrink: 0;
}

.filter-pill:hover {
  background: var(--bg-surface);
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--bg-surface);
  border-color: var(--accent-flight, #00e5ff);
  color: var(--text-primary);
  box-shadow: 0 0 10px var(--accent-flight-glow, rgba(0, 229, 255, 0.2));
}

.card-wrapper.is-filtered-out {
  display: none !important;
}

.deck-scroll-wrapper {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
}

/* Vertical Timeline Track Line */
.timeline-container::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(180deg, var(--border-color) 0%, rgba(34, 39, 54, 0.1) 100%);
  z-index: 0;
}

/* Sticky Day Header */
.day-group {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Smooth expand/collapse: .day-content is a single-row grid whose row
   fraction animates between 1fr (natural height) and 0fr (collapsed), with
   the actual content nested one level deeper so it can be clipped via
   overflow:hidden without fighting the height animation itself. */
.day-content {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.28s ease, opacity 0.24s ease;
}

.day-content-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.day-group.collapsed .day-content {
  grid-template-rows: 0fr;
  opacity: 0;
}

.day-group.collapsed .day-content-inner {
  pointer-events: none;
}

.day-header {
  position: sticky;
  top: 0;
  background: var(--bg-core);
  padding: 8px 12px;
  margin-left: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 0 8px rgba(from var(--text-primary) r g b / 0.6);
  margin-bottom: 15px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.day-header-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.day-collapse-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, var(--text-secondary));
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.15s ease, color 0.15s ease;
  margin-left: auto;
  pointer-events: none;
  line-height: 1;
}

.day-header:hover .day-collapse-indicator {
  opacity: 1;
  color: var(--text-primary);
}

.day-group.collapsed .day-collapse-indicator {
  transform: rotate(-90deg);
}

.day-group.is-today .day-header {
  border-color: var(--accent-color, #3b82f6);
}

.today-badge {
  display: inline-block;
  background: var(--accent-color, #3b82f6);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  /* .day-header-left aligns its children to baseline (correct for the date/
     title text); this badge has no meaningful text baseline of its own, so
     baseline alignment left it sitting low. Center it against its siblings
     instead. vertical-align has no effect here since flex items ignore it. */
  align-self: center;
  letter-spacing: 0.05em;
}

.day-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.day-date {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-primary);
  opacity: 0.9;
}

/* Timeline Skeleton / Loading State */
.timeline-skeleton {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px 0;
  width: 100%;
}

.skeleton-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.skeleton-pill {
  height: 24px;
  width: 140px;
  border-radius: var(--border-radius-md, 8px);
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.05));
  animation: skeleton-pulse 1.5s infinite ease-in-out;
}

.skeleton-card {
  height: 90px;
  width: 100%;
  border-radius: var(--border-radius-lg, 12px);
  background: var(--bg-surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: skeleton-pulse 1.5s infinite ease-in-out;
}

.skeleton-line {
  height: 12px;
  border-radius: 4px;
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.08));
}

.skeleton-line.short {
  width: 40%;
}

.skeleton-line.medium {
  width: 70%;
}

.skeleton-line.long {
  width: 90%;
}

@keyframes skeleton-pulse {
  0% {
    opacity: 0.35;
  }

  50% {
    opacity: 0.75;
  }

  100% {
    opacity: 0.35;
  }
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.02));
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius-lg, 12px);
  margin: 20px auto;
  max-width: 480px;
  animation: emptyStateFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

@keyframes emptyStateFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.empty-state:hover {
  border-color: var(--border-focus);
}

.empty-icon {
  font-size: 44px;
  margin-bottom: 12px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.empty-state:hover .empty-icon {
  transform: scale(1.08);
}

.empty-state h3 {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  max-width: 320px;
  line-height: 1.5;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.btn-empty-cta {
  background: var(--accent-flight, #00e5ff);
  color: #0b0f19;
  border: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--border-radius-md, 8px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 229, 255, 0.25);
}

.btn-empty-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 229, 255, 0.35);
  opacity: 0.95;
}

.btn-empty-cta:active {
  transform: translateY(0);
}

/* ── "Nothing parsed yet" hint variant ──────────────────────────── */
.empty-state-hint {
  padding: 40px 28px;
}

.empty-hint-code {
  display: block;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, 'Courier New', monospace;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 14px;
  color: var(--accent-flight, #00e5ff);
  margin: 8px 0 16px;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.empty-hint-sub {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  margin-bottom: 16px !important;
}

.empty-trip-name-input {
  width: 100%;
  max-width: 280px;
  margin: 0 0 16px;
  text-align: center;
}

.empty-hint-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-empty-hint-ref {
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.btn-empty-hint-ref:hover {
  border-color: var(--border-focus);
  background: var(--bg-surface, rgba(255, 255, 255, 0.1));
  color: var(--text-primary);
}

.btn-empty-hint-subtle {
  background: transparent;
  color: var(--text-secondary);
}

/* Day Empty Container */
.day-empty-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin: 8px 0;
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.015));
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius-md, 8px);
  color: var(--text-muted);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.day-empty-container:hover {
  border-color: var(--border-focus);
  background: var(--editor-bg-high, rgba(255, 255, 255, 0.03));
}

.day-empty-icon {
  font-size: 16px;
  opacity: 0.6;
  margin-right: 8px;
}

.day-empty-text {
  font-size: 13px;
  flex: 1;
  color: var(--text-muted);
}

.btn-day-empty-add {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--border-radius-sm, 6px);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn-day-empty-add:hover {
  border-color: var(--accent-flight, #00e5ff);
  color: var(--accent-flight, #00e5ff);
  background: rgba(0, 229, 255, 0.08);
  transform: translateY(-1px);
}

.btn-day-empty-add:active {
  transform: translateY(0);
}


/* ==========================================================================
   3. Visual Components (Cards & Bullets)
   ========================================================================== */
@keyframes cardScaleIn {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.card-wrapper {
  display: flex;
  gap: 16px;
  position: relative;
  animation: cardScaleIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.no-entry-animations .card-wrapper {
  animation: none !important;
}

.card-wrapper:nth-child(1) {
  animation-delay: 0.04s;
}

.card-wrapper:nth-child(2) {
  animation-delay: 0.08s;
}

.card-wrapper:nth-child(3) {
  animation-delay: 0.12s;
}

.card-wrapper:nth-child(4) {
  animation-delay: 0.16s;
}

.card-wrapper:nth-child(5) {
  animation-delay: 0.2s;
}

.card-wrapper:nth-child(n+6) {
  animation-delay: 0.24s;
}

/* Dynamic Timeline Bullets */
.card-bullet {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bullet-accent, var(--border-color));
  border: 3px fill var(--bg-core);
  margin-top: 24px;
  margin-left: 15px;
  z-index: 2;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--bg-core), 0 0 8px var(--bullet-accent, transparent);
  transition: var(--transition-smooth);
}

/* Card Base Structure */
.card {
  flex-grow: 1;
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  box-shadow: var(--shadow-premium);
  display: grid;
  gap: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform, box-shadow;
}

/* Expandable components styling setup */
.card-flight-expandable,
.card-transit-expandable,
.card-lodging-expandable,
.card-car-expandable,
.card-dining-expandable,
.card-activity-expandable {
  cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid rgba(from var(--border-color) r g b / 0.9);
  border-radius: 10px;
  padding: 14px 18px;
  font-family: monospace;
}

/* Static activity card */
.card-activity-static {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 18px;
  font-family: monospace;
}

/* Dynamically styled expanded states */
.card-flight-expandable.expanded,
.card-transit-expandable.expanded,
.card-lodging-expandable.expanded,
.card-car-expandable.expanded,
.card-dining-expandable.expanded,
.card-activity-expandable.expanded {
  border-color: var(--card-accent, var(--border-focus));
  background: rgba(from var(--card-accent, var(--border-focus)) r g b / 0.05);
}

/* Hover/Active states only apply to interactive/expandable cards when collapsed */
.card-flight-expandable:not(.expanded):hover,
.card-transit-expandable:not(.expanded):hover,
.card-lodging-expandable:not(.expanded):hover,
.card-car-expandable:not(.expanded):hover,
.card-dining-expandable:not(.expanded):hover,
.card-activity-expandable:not(.expanded):hover {
  transform: translate3d(0, -2px, 0);
  border-color: var(--border-focus);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.card-flight-expandable:not(.expanded):active,
.card-transit-expandable:not(.expanded):active,
.card-lodging-expandable:not(.expanded):active,
.card-car-expandable:not(.expanded):active,
.card-dining-expandable:not(.expanded):active,
.card-activity-expandable:not(.expanded):active {
  transform: translate3d(0, 0, 0);
  transition: transform 0.08s ease;
}

.card-activity .card {
  gap: 0;
}

.card-activity-ideas {
  margin-top: 15px;
}

/* Card Wrappers bottom margin spacing */
.card-wrapper.flight,
.card-wrapper.transit,
.card-wrapper.lodging,
.card-wrapper.car,
.card-wrapper.dining {
  width: 100%;
  margin-bottom: 12px;
}

/* Interactive elements inside active cards should block hover contractions */
.card button,
.card a {
  transform: none !important;
}


/* ==========================================================================
   4. Flight Details Component Styles
   ========================================================================== */
.flight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.flight-header-route-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flight-cities-label {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1.25;
}

.flight-sub-route-code {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  color: var(--card-accent, var(--accent-flight));
  letter-spacing: 0.5px;
  margin-top: 2px;
  opacity: 0.9;
}

.flight-duration-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: bold;
}

/* Flight Expanded Drawer structure */
.flight-expanded-drawer {
  display: block;
  block-size: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
  overflow: hidden;
  opacity: 0;
  transition: block-size 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    margin-top 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    padding-top 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    border-color 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.card.expanded .flight-expanded-drawer {
  block-size: auto;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  opacity: 1;
}

.flight-drawer-gates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 12px;
  font-size: 11px;
  text-align: center;
}

.flight-drawer-gate-tile {
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.flight-tile-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: bold;
}

.flight-tile-value {
  font-size: 14px;
  font-weight: 900;
  margin-top: 2px;
}

.flight-tile-value.gate-arr {
  color: var(--text-primary);
}

.flight-tile-value.baggage {
  color: var(--text-primary);
}

.flight-drawer-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 12px;
}

/* Support for 1-column layouts in details grid if far out */
.flight-drawer-details-grid.single-col {
  grid-template-columns: 1fr;
}

.flight-drawer-detail-row {
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flight-detail-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.flight-detail-value.status-eta {
  color: #10b981;
}

.flight-drawer-airport-link-tile {
  grid-column: span 2;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.flight-drawer-details-grid.single-col .flight-drawer-airport-link-tile {
  grid-column: span 1;
}

.flight-airport-link-inner {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: inherit;
}

.flight-airport-text-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.flight-airport-sub {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.flight-airport-name {
  color: var(--text-primary);
  font-weight: bold;
  font-size: 14px;
  white-space: normal;
}

.flight-airport-address {
  color: rgba(from var(--text-primary, #000) r g b / 0.75);
  font-weight: normal;
  font-size: 12px;
  white-space: normal;
  margin-top: 3px;
}

.flight-airport-link-arrow {
  color: var(--text-primary);
  font-size: 14px;
  margin-left: 12px;
  flex-shrink: 0;
}

.flight-drawer-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  font-size: 11px;
}

.btn-sync-flight {
  flex: 1;
  padding: 6px;
  border-radius: 4px;
  font-size: 10px;
}

.btn-flight-google,
.btn-copy-conf {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(from var(--text-primary) r g b / 0.2);
  color: var(--text-primary);
  border-radius: 4px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: bold;
  font-size: 10px;
  padding: 4px 0;
}

.btn-copy-conf {
  /* padding: 4px 10px;
  font-size: 12px; */
}

.flight-recommendation-bar {
  background: rgba(0, 229, 255, 0.04);
  border-bottom: 1px solid rgba(0, 229, 255, 0.12);
  padding: 6px 18px;
  font-size: 11px;
  color: var(--accent-flight, #00e5ff);
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
}

.flight-recommendation-bar strong {
  color: var(--text-primary, #ffffff);
  white-space: nowrap;
}

/* Align badge layouts consistently */
.transit-header-route-badge,
.flight-header-route-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.transit-sub-route-code {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  color: var(--card-accent, var(--accent-transit, #00e5a3));
  letter-spacing: 0.5px;
  margin-top: 2px;
  opacity: 0.9;
}

.tz-jump-badge,
.transit-tz-badge {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 12px;
  background: var(--card-accent-glow, var(--accent-transit-glow, rgba(0, 229, 163, 0.15)));
  color: var(--card-accent, var(--accent-transit, #00e5a3));
  border: 1px solid var(--card-accent, var(--accent-transit, #00e5a3));
  display: inline-flex;
  align-items: center;
  line-height: 1.3;
}

.transit-badge-stack {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.transit-pill-badge {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 229, 163, 0.08);
  color: var(--accent-transit, #00e5a3);
  border: 1px solid rgba(0, 229, 163, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.transit-pill-platform,
.badge-platform {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.transit-pill-seat,
.badge-seat {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.transit-pill-headway {
  background: rgba(0, 229, 163, 0.12);
  border-color: rgba(0, 229, 163, 0.3);
  color: var(--accent-transit, #00e5a3);
}

.transit-duration-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

.transit-drawer-stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.transit-station-tile {
  background: var(--bg-surface, #12141c);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.transit-station-caption {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.transit-station-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.transit-station-address {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.transit-drawer-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  font-size: 11px;
  flex-wrap: wrap;
}

.btn-transit-directions,
.btn-transit-schedule {
  flex: 1;
  min-width: 130px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(from var(--text-primary) r g b / 0.2);
  color: var(--text-primary);
  border-radius: 4px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: bold;
  font-size: 11px;
  padding: 6px 10px;
  transition: var(--transition-smooth);
}

.btn-transit-directions:hover,
.btn-transit-schedule:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-transit, #00e5a3);
  color: var(--accent-transit, #00e5a3);
}

.flight-pill-badge {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.05);
  color: var(--accent-flight, #00e5ff);
  border: 1px solid rgba(0, 229, 255, 0.15);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* ==========================================================================
   5. Tokenized Standard Deck Card Styles (Formerly Lodging/Car/Dining)
   ========================================================================== */
/* Core structural tokens map to your global variables */
.card-deck-item {
  --deck-accent-color: var(--card-accent, var(--text-primary));
  --deck-badge-bg: rgba(from var(--card-accent, #f59e0b) r g b / 0.1);
  --deck-badge-border: rgba(from var(--card-accent, #f59e0b) r g b / 0.25);
  --deck-badge-text: var(--card-accent, #f59e0b);
}

.deck-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.deck-item-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  max-width: 65%;
}

.deck-item-title-label {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

/* Small-caps kicker for the "Ideas" group header, distinct from a normal
   card title. Uses --text-secondary rather than the .deck-item-title-label
   color rules above/below, since those are tuned for --text-primary contrast. */
.ideas-group-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.deck-item-subtitle-label {
  font-size: 14px;
  color: var(--deck-accent-color);
  white-space: normal;
  line-height: 1.2;
  opacity: 0.85;
}

.deck-item-subtitle-street {
  font-size: 14px;
  font-weight: 800;
}

.deck-item-subtitle-region {
  font-size: 12px;
  font-weight: 400;
}

.deck-item-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.deck-item-meta-col {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.deck-item-meta-caption {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--deck-accent-color);
  font-weight: bold;
}

/* Expanded Drawer Layouts */
.deck-item-expanded-drawer {
  display: block;
  block-size: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
  overflow: hidden;
  opacity: 0;
  transition: block-size 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    margin-top 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    padding-top 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    border-top-color 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.card.expanded .deck-item-expanded-drawer {
  block-size: auto;
  margin-top: 14px;
  padding-top: 14px;
  opacity: 1;
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

.deck-item-drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 11px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 12px;
}

.deck-item-tile {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 12px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.deck-item-tile-caption {
  color: rgba(from var(--text-primary, #000) r g b / 0.8);
  font-weight: 500;
  font-size: 10px;
  text-transform: uppercase;
}

.btn-copy-deck-conf {
  width: 100%;
  font-size: 13px;
  font-weight: 900;
  color: var(--text-muted);
  text-align: center;
  font-family: monospace;
  letter-spacing: 0.5px;
  margin-top: 2px;
  justify-content: center;
  padding: 6px 8px;
  box-sizing: border-box;
  /* This is a <button>, but reads as inline text — it never had a
     background/border reset, so it fell back to the browser's native
     button chrome. Themes that force light text on cards (e.g. Roadtrip's
     `.card *` white-text rule) made that native light background collide
     with white text and go unreadable. */
  background: none;
  border: none;
}

.deck-item-directions-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  margin-bottom: 4px;
}

.deck-item-address-text {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
  line-height: 1.4;
  word-break: break-word;
}


.btn-deck-sync {
  padding: 2px 6px;
  align-self: flex-start;
  font-size: 10px;
  margin-top: 2px;
}

.deck-item-dial-wrapper {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-deck-dial {
  flex: 1;
  background: var(--deck-badge-bg);
  border: 1px solid var(--deck-badge-border);
  color: var(--deck-badge-text);
  border-radius: 6px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  font-size: 12px;
  font-weight: bold;
}

.deck-item-custom-links {
  display: flex;
  gap: 8px;
  width: 100%;
}

.btn-deck-custom-link {
  flex: 1;
  background: var(--card-accent, var(--text-primary));
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.btn-deck-custom-link:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Structural Layout Modifications for Context-Specific Uses */
.deck-item-note-box {
  background: rgba(0, 0, 0, 0.15);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.02);
  font-size: 11px;
  color: var(--deck-accent-color);
  text-align: left;
  margin-bottom: 12px;
  line-height: 1.4;
}

.deck-item-note-header {
  color: var(--card-accent);
  font-weight: 500;
  margin-left: 4px;
}

.deck-item-note-text {
  font-size: 12px;
  color: var(--text-primary);
  white-space: pre-wrap;
  display: inline-block;
  vertical-align: top;
}

.deck-item-cost-box {
  background: rgba(0, 0, 0, 0.15);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.02);
  font-size: 11px;
  color: var(--deck-accent-color);
  text-align: left;
  margin-bottom: 12px;
  line-height: 1.4;
}

/* Dev-mode-only elements & preview badges (e.g. Notes view, "Drive to ..." leg estimates) —
   always rendered, hidden unless developer mode (Alt+Shift+D) is on, so toggling it
   shows/hides them instantly without a re-render. */
.dev-only-badge,
.dev-only {
  display: none;
}

body.dev-mode-active .dev-only-badge {
  display: block;
}

body.dev-mode-active button.dev-only,
body.dev-mode-active .dev-only {
  display: inline-flex;
}

.deck-item-cost-header {
  color: var(--card-accent);
  font-weight: 500;
  margin-left: 4px;
}

.deck-item-cost-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.venue-enrich-slot {
  margin-bottom: 12px;
}

.venue-enrich-loading,
.venue-enrich-error,
.venue-enrich-empty {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.7;
  padding: 4px 0;
}

.venue-enrich-results {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
  align-items: stretch;
}

.venue-closed-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  border-radius: 5px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  font-size: 11px;
  font-weight: 600;
  color: #ef4444;
  line-height: 1.4;
}

.venue-closed-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 11px;
  font-weight: 700;
  color: #ef4444;
  line-height: 1.3;
  width: fit-content;
}

.card.card-venue-closed {
  border-color: rgba(239, 68, 68, 0.35);
}

.venue-enrich-category {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-bottom: 4px;
}

/* Fixed 50/50 split, not content-hugging — an `auto` contact column looked
   unmoored, floating wherever its text happened to end rather than sitting
   at a fixed, predictable edge. Either side can also be the only one
   present; grid just leaves the other column's cell empty. */
.venue-enrich-hours {
  grid-column: 1;
}

.venue-enrich-contact {
  grid-column: 2;
  display: flex;
  flex-direction: column;
}

.venue-enrich-contact-rows {
  display: grid;
  grid-auto-rows: 1fr;
  flex: 1;
}

.venue-enrich-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
}

.venue-enrich-row a,
a.venue-enrich-row {
  color: var(--card-accent);
  text-decoration: none;
}

.venue-enrich-row a:hover,
a.venue-enrich-row:hover {
  text-decoration: underline;
}

/* Phone/website/Tripadvisor (whichever are present) each get an equal
   share of the contact column's height (see grid-auto-rows above),
   centered within it — a large, predictable tap target rather than
   several lines crowded close together. */
a.venue-enrich-tap {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
}

a.venue-enrich-tap:hover {
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.venue-enrich-icon {
  flex-shrink: 0;
  display: inline-flex;
  width: 13px;
  height: 13px;
  color: currentColor;
  opacity: 0.8;
}

.venue-enrich-icon svg {
  width: 100%;
  height: 100%;
}

.venue-enrich-hours-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.venue-hours-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.venue-hours-open {
  color: #10b981;
}

.venue-hours-closed {
  color: #f59e0b;
}

.venue-hours-day {
  color: var(--text-primary);
  line-height: 1.4;
}

/* ==========================================================================
   6. Mobile Overrides for Standard Deck Components
   ========================================================================== */
@media (max-width: 768px) {
  .deck-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .deck-item-header-left,
  .flight-duration-label {
    max-width: 100%;
  }

  .deck-item-header-right {
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
  }

  .deck-item-meta-col {
    text-align: left;
  }

  .deck-item-drawer-grid {
    grid-template-columns: 1fr;
  }

  .timeline-trip-title {
    font-size: 20px;
    font-weight: 700;
  }
}


/* ==========================================================================
   8. Activity Sandbox Component Styles
   ========================================================================== */
.activity-list-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item-wrapper {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
}

.activity-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.activity-item-wrapper.expandable .activity-item-header {
  cursor: pointer;
}

.activity-text-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.activity-text-name {
  font-weight: 500;
}

.activity-time-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.activity-item-details-drawer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  block-size: 0;
  margin-top: 0;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 8px;
  width: 100%;
  overflow: hidden;
  opacity: 0;
  transition: block-size 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    margin-top 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    padding 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    border-color 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.activity-item-wrapper.expanded .activity-item-details-drawer {
  block-size: auto;
  margin-top: 10px;
  padding: 12px 14px;
  border-color: rgba(255, 255, 255, 0.08);
  opacity: 1;
}

.activity-map-link {
  font-size: 11px;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.activity-note-text {
  font-size: 11px;
  color: var(--text-secondary);
}

.activity-links-row {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.activity-custom-link {
  font-size: 11px;
  color: var(--card-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sandbox-dot-offset {
  margin-top: 6px;
}

/* Unstructured Activity Sandbox List in Sidebar */
.sandbox-container {
  margin-top: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sandbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sandbox-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sandbox-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.sandbox-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sandbox-item {
  padding: 10px 4px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  transition: var(--transition-smooth);
}

.sandbox-item:last-child {
  border-bottom: none;
}

.sandbox-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
}

.sandbox-details-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  block-size: 0;
  margin-top: 0;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 8px;
  width: 100%;
  overflow: hidden;
  opacity: 0;
  transition: block-size 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    margin-top 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    padding 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    border-color 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.sandbox-item.expanded .sandbox-details-wrapper {
  block-size: auto;
  margin-top: 10px;
  padding: 12px 14px;
  border-color: rgba(255, 255, 255, 0.08);
  opacity: 1;
}

.activity-actions,
.sandbox-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
}

.btn-add-itinerary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
  color: var(--accent-sandbox);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-add-itinerary:hover {
  background: rgba(0, 230, 118, 0.2);
  border-color: var(--accent-sandbox);
  transform: translateY(-1px);
}

.btn-add-itinerary svg {
  stroke: var(--accent-sandbox);
}


.sandbox-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-sandbox);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--accent-sandbox);
}

.sandbox-item-layout {
  display: flex;
  flex-direction: column;
}

.sandbox-name-text {
  font-weight: 500;
}

.sandbox-map-link {
  font-size: 11px;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sandbox-note-text {
  font-size: 11px;
  color: var(--text-muted);
}

.sandbox-links-row {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.sandbox-custom-link {
  font-size: 11px;
  color: var(--card-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


/* ==========================================================================
   9. Daily Weather Banner component styling
   ========================================================================== */
.day-weather-banner {
  margin: 0 0 -5px 0;
}

.weather-expandable-card {
  cursor: pointer;
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-family: monospace;
  transition: all 0.25s ease;
  overflow: hidden;
  padding: 14px 18px;
  margin-bottom: 8px;
}

.weather-expandable-card.expanded {
  background: var(--bg-surface-elevated, #161b26);
  border-color: rgba(255, 255, 255, 0.2);
}

.weather-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.weather-card-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.weather-card-emoji {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.weather-card-title {
  font-weight: 900;
  color: var(--text-primary);
  font-size: 14px;
  letter-spacing: 0.75px;
  text-transform: uppercase;
}

.weather-card-subtitle {
  font-size: 12px;
  color: var(--text-secondary, #f3f4f6);
  font-weight: bold;
  margin-top: 2px;
}

.weather-card-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.weather-card-temp-range {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.weather-card-temp-max {
  color: #f59e0b;
}

.weather-card-temp-divider {
  color: rgba(from var(--text-primary) r g b / 0.8);
  font-size: 14px;
  font-weight: normal;
  margin: 0 -0.2rem 0 -0.5rem;
}

.weather-card-temp-min {
  color: #60a5fa;
}

.weather-expanded-drawer {
  display: block;
  block-size: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
  overflow: hidden;
  opacity: 0;
  transition: block-size 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    margin-top 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    padding-top 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    border-color 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.weather-expandable-card.expanded .weather-expanded-drawer {
  block-size: auto;
  margin-top: 18px;
  padding-top: 16px;
  border-top-color: rgba(255, 255, 255, 0.15);
  opacity: 1;
}

.weather-expanded-title {
  font-size: 11px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-left: 8px;
}

.weather-expanded-hourly-row {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 18px;
}

.weather-hourly-tile {
  flex: 1;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.weather-hourly-label {
  font-size: 12px;
  color: rgba(from var(--text-primary) r g b / 0.8);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.weather-hourly-emoji {
  font-size: 22px;
  margin: 4px 0;
  line-height: 1;
}

.weather-hourly-temp {
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
}

.weather-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  font-size: 12px;
  color: #ffffff;
  font-weight: bold;
}

.weather-metric-tile {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}

.weather-metric-name {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 11px;
}

.weather-metric-val.humidity {
  color: #60a5fa;
}

.weather-metric-val.uv {
  color: #f59e0b;
}

.weather-metric-val.precip {
  color: #3b82f6;
}

.weather-aqi-unavailable {
  color: var(--text-muted, #a1a1aa);
  font-weight: 500;
}

.weather-unavailable-box {
  border-radius: 8px;
  font-family: monospace;
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #a1a1aa;
  font-size: 12px;
}

.weather-unavailable-title {
  font-weight: bold;
  color: rgba(255, 255, 255, 0.5);
}

.weather-unavailable-text {
  margin-top: 2px;
}


/* ==========================================================================
   10. Warnings and Alerts
   ========================================================================== */
.card.card-warning {
  border: 1px solid var(--accent-dining);
  box-shadow: 0 0 10px rgba(255, 61, 0, 0.15), var(--shadow-premium);
}


/* ==========================================================================
   11. Mobile Overrides for Timeline Components (@media block)
   ========================================================================== */
@media (max-width: 768px) {
  .card-flight {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .flight-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .flight-header-left {
    max-width: 100%;
  }

  .flight-header-right {
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
  }

  .flight-time-col {
    text-align: left;
  }

  .flight-duration-label {
    text-align: left;
  }

  .flight-drawer-gates-grid {
    grid-template-columns: 1fr;
  }

  .flight-drawer-details-grid {
    grid-template-columns: 1fr;
  }

  .venue-enrich-results {
    grid-template-columns: 1fr;
  }

  .venue-enrich-contact {
    grid-column: 1;
    grid-auto-rows: auto;
    gap: 4px;
    padding-top: 6px;
    margin-top: 2px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
  }

  a.venue-enrich-tap {
    padding: 10px;
  }

  @media (min-width: 333px) {
    .flight-drawer-gates-grid {
      grid-template-columns: 1fr 1fr;
    }
  }

  .flight-drawer-airport-link-tile {
    grid-column: span 1;
  }

  /* Gutters and Timeline Track adjustments for mobile */
  .deck-scroll-wrapper {
    padding: 12px;
  }

  .timeline-container::before {
    left: 8px;
  }

  .card-bullet {
    margin-left: 3px;
  }

  .card-wrapper {
    gap: 12px;
  }

  /* Tighten card paddings and layout */
  .card {
    padding: 12px 14px;
    gap: 8px;
  }

  /* Header separator tightness */
  .deck-item-header-right,
  .flight-header-right {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 8px;
    margin-top: 4px;
  }

  /* Prevent weather temperature range split */
  .weather-card-temp-range {
    white-space: nowrap;
  }

  .weather-card-header-right {
    flex-shrink: 0;
  }

  /* Wrap custom external links and dial buttons on mobile */
  .deck-item-custom-links {
    flex-wrap: wrap;
  }

  .btn-deck-custom-link {
    flex: 1 1 calc(50% - 4px);
    min-width: 110px;
  }

  .day-group {
    gap: 5px;
  }

  .day-header {
    padding: 10px 12px;
  }

  .day-header-left {
    flex-wrap: nowrap;
    column-gap: 10px;
  }

  .day-date,
  .day-title {
    font-size: 14px;
  }

  /* Sticky filter wrapper positioning on mobile: sits right over the day headers below the live HUD */
  .timeline-filter-wrapper.is-sticky-header {
    position: sticky !important;
    top: calc(var(--mobile-hud-height, 125px) + var(--sandbox-banner-height, 0px) + var(--announcement-banner-height, 0px) + 8px) !important;
    z-index: 1250 !important;
    margin-bottom: -32px;
    padding-right: 4px;
  }

  body.hud-scrolled .timeline-filter-wrapper.is-sticky-header {
    top: calc(var(--mobile-hud-compact, 48px) + var(--sandbox-banner-height, 0px) + var(--announcement-banner-height, 0px) + 8px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {

  .flight-expanded-drawer,
  .deck-item-expanded-drawer,
  .activity-item-details-drawer,
  .sandbox-details-wrapper,
  .weather-expanded-drawer {
    transition: none !important;
  }
}

/* ==========================================================================
   Transit Alert — Tight Connection Warning Banner
   ========================================================================== */

.transit-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 4px 32px;
  padding: 8px 10px 8px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.28);
  font-size: 12px;
  font-weight: 500;
  color: #f59e0b;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.28s ease, transform 0.28s ease;
  grid-column: 1 / -1;
}

.transit-alert-text {
  flex: 1;
  line-height: 1.4;
}

.transit-alert-dismiss {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.transit-alert-dismiss:hover {
  background: rgba(245, 158, 11, 0.24);
  transform: scale(1.1);
}

/* Dismiss exit animation (class added by JS) */
.transit-alert-dismissing {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

/* Destination card highlight */
.card-warning {
  border-color: rgba(245, 158, 11, 0.32) !important;
}

/* Inline badge injected inside destination card after dismiss */
.transit-alert-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  margin-bottom: 8px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  font-size: 11px;
  font-weight: 500;
  color: #f59e0b;
  line-height: 1.4;
}

/* ==========================================================================
   Master-Detail Selection & 3-Tier Card Hierarchy Styles
   ========================================================================== */

/* Tier 1 (Anchor): Highest Visual Weight for Time, Title, and Badges */
.deck-item-title-label,
.flight-cities-label {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  line-height: 1.25;
}

.deck-item-meta-value {
  font-weight: 800;
  font-size: 14px;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.deck-item-meta-caption,
.flight-pill-badge,
.card-custom-emoji-badge {
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Tier 2 (Attributes): Muted Secondary Details Scale */
.deck-item-subtitle-label,
.deck-item-subtitle-street,
.deck-item-subtitle-region,
.flight-airport-address,
.flight-airport-name,
.flight-sub-route-code,
.flight-duration-label,
.deck-item-note-text,
.activity-note-text,
.deck-item-tile-caption {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
  letter-spacing: 0;
}

/* Tier 3 (Actions): Hidden by Default, Smooth Hover/Selected/Editing Reveal */
.flight-drawer-actions,
.transit-drawer-actions,
.activity-actions,
.sandbox-actions,
.btn-copy-deck-conf,
.btn-sync-flight,
.btn-deck-sync,
.btn-deck-dial,
.btn-deck-custom-link,
.btn-flight-google,
.btn-transit-directions,
.btn-transit-schedule,
.btn-add-itinerary {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
}

.card:hover .flight-drawer-actions,
.card:hover .transit-drawer-actions,
.card:hover .activity-actions,
.card:hover .sandbox-actions,
.card:hover .btn-copy-deck-conf,
.card:hover .btn-sync-flight,
.card:hover .btn-deck-sync,
.card:hover .btn-deck-dial,
.card:hover .btn-deck-custom-link,
.card:hover .btn-flight-google,
.card:hover .btn-transit-directions,
.card:hover .btn-transit-schedule,
.card:hover .btn-add-itinerary,
.card.selected .flight-drawer-actions,
.card.selected .transit-drawer-actions,
.card.selected .activity-actions,
.card.selected .sandbox-actions,
.card.selected .btn-copy-deck-conf,
.card.selected .btn-sync-flight,
.card.selected .btn-deck-sync,
.card.selected .btn-deck-dial,
.card.selected .btn-deck-custom-link,
.card.selected .btn-flight-google,
.card.selected .btn-transit-directions,
.card.selected .btn-transit-schedule,
.card.selected .btn-add-itinerary,
.card.editing .flight-drawer-actions,
.card.editing .transit-drawer-actions,
.card.editing .activity-actions,
.card.editing .sandbox-actions,
.card.editing .btn-copy-deck-conf,
.card.editing .btn-sync-flight,
.card.editing .btn-deck-sync,
.card.editing .btn-deck-dial,
.card.editing .btn-deck-custom-link,
.card.editing .btn-flight-google,
.card.editing .btn-transit-directions,
.card.editing .btn-transit-schedule,
.card.editing .btn-add-itinerary,
.card-deck-item.expanded .flight-drawer-actions,
.card-deck-item.expanded .transit-drawer-actions,
.card-deck-item.expanded .btn-copy-deck-conf,
.card-deck-item.expanded .btn-sync-flight,
.card-deck-item.expanded .btn-deck-sync,
.card-deck-item.expanded .btn-deck-dial,
.card-deck-item.expanded .btn-deck-custom-link,
.card-deck-item.expanded .btn-flight-google,
.card-deck-item.expanded .btn-transit-directions,
.card-deck-item.expanded .btn-transit-schedule {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Master-Detail Selection Sync & Active Editing State Styles for Right Canvas Cards */
.card.selected,
.card.editing,
.timeline-day.selected {
  border-color: var(--card-accent, var(--accent-flight, #00e5ff)) !important;
  background: rgba(from var(--card-accent, var(--accent-flight, #00e5ff)) r g b / 0.08) !important;
  box-shadow: 0 0 0 2px var(--card-accent, var(--accent-flight, #00e5ff)), 0 8px 24px rgba(0, 0, 0, 0.35) !important;
  transform: translateY(-1px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.card.selected::before,
.card.editing::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--card-accent, var(--accent-flight, #00e5ff));
  border-top-left-radius: var(--border-radius-lg, 10px);
  border-bottom-left-radius: var(--border-radius-lg, 10px);
}