/* Hi-fi AI Planner */
.view-hifi {
  position: relative;
  isolation: isolate;
}

.hifi-layout {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.hifi-shell {
  display: grid;
  gap: 18px;
}

.view-hifi .hifi-hero {
  position: relative;
  overflow: hidden;
  margin-top: 20px;
  padding: 0;
  border-radius: 28px;
  border: 1px solid rgba(11, 95, 197, 0.12);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(239, 246, 255, 0.78) 48%,
    rgba(236, 253, 245, 0.72) 100%
  );
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 22px 50px rgba(11, 95, 197, 0.1);
}

.hifi-hero-glow {
  position: absolute;
  inset: -40% -20% auto auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(16, 185, 129, 0.22) 0%,
    rgba(11, 95, 197, 0.12) 42%,
    transparent 70%
  );
  pointer-events: none;
}

.hifi-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 22px 20px;
}

.hifi-hero-head h2 {
  margin: 8px 0 0;
  font-size: clamp(1.45rem, 2.8vw, 1.85rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hifi-hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0b5fc5;
  background: rgba(219, 234, 254, 0.9);
  border: 1px solid rgba(11, 95, 197, 0.18);
}

.hifi-hero-lead {
  margin: 0;
  max-width: 58ch;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted, #475569);
}

.hifi-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hifi-composer-kicker {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hifi-journey-row {
  display: grid;
  grid-template-columns:
    minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(128px, 0.85fr)
    minmax(128px, 0.85fr);
  gap: 12px;
  align-items: end;
}

.hifi-journey-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hifi-journey-input,
.hifi-journey-notes {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 11px 12px;
  font: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--hifi-input-bg, rgba(255, 255, 255, 0.88));
  box-shadow: inset 0 1px 0
    var(--hifi-input-highlight, rgba(255, 255, 255, 0.9));
}

.hifi-journey-field--date .checkout-date-field {
  width: 100%;
  min-width: 0;
}

.hifi-journey-field--date .hifi-journey-input.checkout-date-input,
.hifi-journey-field--date .checkout-date-picker-btn {
  min-height: 44px;
  background: var(--hifi-input-bg, rgba(255, 255, 255, 0.88));
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: inset 0 1px 0
    var(--hifi-input-highlight, rgba(255, 255, 255, 0.9));
}

.hifi-journey-field--date .checkout-date-picker-btn {
  color: #1b4fbf;
}

.hifi-journey-field--date .hifi-journey-input.checkout-date-input:focus {
  border-color: rgba(11, 95, 197, 0.42);
  box-shadow:
    0 0 0 3px rgba(11, 95, 197, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.hifi-journey-input:focus,
.hifi-journey-notes:focus {
  outline: none;
  border-color: rgba(11, 95, 197, 0.42);
  box-shadow:
    0 0 0 3px rgba(11, 95, 197, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.hifi-journey-notes {
  min-height: 56px;
  resize: vertical;
}

.hifi-journey-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
}

.hifi-label-optional {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.75;
}

.hifi-composer-actions {
  display: flex;
  justify-content: flex-end;
}

.hifi-composer.is-busy .hifi-journey-input,
.hifi-composer.is-busy .hifi-journey-notes {
  opacity: 0.72;
}

.hifi-composer-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}

.hifi-composer-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 8px;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 10px 28px rgba(15, 23, 42, 0.06);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.hifi-composer-input-wrap:focus-within {
  border-color: rgba(11, 95, 197, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 0 4px rgba(11, 95, 197, 0.1),
    0 14px 32px rgba(11, 95, 197, 0.1);
}

.hifi-composer.is-busy .hifi-composer-input-wrap {
  opacity: 0.72;
}

.hifi-composer-input {
  flex: 1;
  min-height: 52px;
  max-height: 140px;
  resize: none;
  border: 0;
  padding: 10px 12px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  background: transparent;
}

.hifi-composer-input:focus {
  outline: none;
}

.hifi-composer-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 96px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #0b5fc5 0%, #2563eb 52%, #10b981 100%);
  box-shadow: 0 10px 24px rgba(11, 95, 197, 0.32);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.hifi-composer-go:hover:not(:disabled) {
  transform: translateY(-1px);
}

.hifi-composer-go:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.hifi-composer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hifi-composer-chip {
  border-radius: 999px;
  border: 1px solid var(--hifi-chip-border, rgba(15, 23, 42, 0.1));
  background: var(--hifi-chip-bg, rgba(255, 255, 255, 0.75));
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 13px;
  cursor: pointer;
}

.hifi-composer-chip:hover {
  border-color: rgba(11, 95, 197, 0.32);
  background: var(--hifi-chip-bg-hover, rgba(239, 246, 255, 0.95));
}

.hifi-composer-status {
  margin: 0;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.hifi-composer-status--live {
  color: #047857;
  background: rgba(209, 250, 229, 0.9);
  border-color: rgba(5, 150, 105, 0.2);
}

.hifi-composer-status--error {
  color: #b91c1c;
  background: rgba(254, 226, 226, 0.95);
  border-color: rgba(239, 68, 68, 0.22);
}

.hifi-composer-status--loading {
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.95);
  border-color: rgba(37, 99, 235, 0.2);
}

.hifi-timeline-mount {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.hifi-empty {
  padding: 20px;
  border-radius: 16px;
  border: 1px dashed var(--hifi-empty-border, rgba(15, 23, 42, 0.15));
  color: var(--text-muted, #64748b);
  background: var(--hifi-empty-bg, rgba(255, 255, 255, 0.35));
}

.hifi-timeline-modern {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hifi-timeline-hero {
  padding: 18px 20px;
}

.hifi-timeline-hero h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
}

.hifi-timeline-window {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(11, 95, 197, 0.9);
}

.hifi-timeline-disclaimer {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.hifi-timeline-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-left: 4px;
}

.hifi-timeline-rail::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    rgba(11, 95, 197, 0.45),
    rgba(16, 185, 129, 0.35)
  );
  opacity: 0.55;
}

.hifi-day-group {
  position: relative;
  padding-left: 36px;
}

.hifi-day-marker {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-left: -36px;
}

.hifi-day-dot {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 6px;
  margin-left: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b5fc5, #10b981);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9);
}

.hifi-day-marker-text h3 {
  margin: 0;
  font-size: 1.08rem;
}

.hifi-day-date {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.hifi-day-events {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hifi-event {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
}

.hifi-event-spine {
  display: flex;
  justify-content: center;
  padding-top: 22px;
}

.hifi-event-node {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(11, 95, 197, 0.5);
}

.hifi-event-card {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.hifi-event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(11, 95, 197, 0.1);
}

.hifi-event-media {
  position: relative;
  min-height: 120px;
  background: linear-gradient(145deg, #1e3a5f, #0f766e);
}

.hifi-event-media img {
  width: 100%;
  height: 100%;
  min-height: 120px;
  object-fit: cover;
  display: block;
}

.hifi-event-credit {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
  background: rgba(15, 23, 42, 0.55);
}

.hifi-event-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hifi-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hifi-event-time {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}

.hifi-event-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.hifi-event-title {
  margin: 0;
  font-size: 1.02rem;
}

.hifi-event-notes {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted, #64748b);
}

.hifi-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.hifi-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.hifi-action-btn--flight {
  color: #fff;
  background: linear-gradient(135deg, #0b5fc5, #10b981);
}

.hifi-action-btn--stay {
  color: #5b21b6;
  background: linear-gradient(180deg, #faf5ff, #ede9fe);
  border-color: rgba(124, 58, 237, 0.25);
}

.hifi-action-btn--food {
  color: #9a3412;
  background: linear-gradient(180deg, #fff7ed, #ffedd5);
}

.hifi-action-btn--map {
  color: #0f4c81;
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
}

.hifi-timeline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hifi-secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hifi-about h3,
.hifi-active h3 {
  margin: 0;
}

.hifi-about p {
  margin: 10px 0 0;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
}

.hifi-active-subtitle {
  margin: 4px 0 0;
  color: var(--hifi-ai-muted, #64748b);
}

.hifi-active-list {
  margin-top: 12px;
}

.hifi-plan-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.hifi-plan-grid::-webkit-scrollbar {
  height: 6px;
}

.hifi-plan-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.35);
}

.hifi-plan-grid--loading {
  pointer-events: none;
}

.hifi-plan-empty {
  display: grid;
  gap: 6px;
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px dashed rgba(126, 151, 193, 0.28);
  background: rgba(255, 255, 255, 0.42);
}

.hifi-plan-card {
  position: relative;
  flex: 0 0 min(240px, 78vw);
  max-width: 260px;
  scroll-snap-align: start;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(126, 151, 193, 0.2);
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 14px 28px rgba(15, 23, 42, 0.08);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.hifi-plan-card:hover {
  transform: translateY(-2px);
  border-color: rgba(11, 95, 197, 0.28);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

.hifi-plan-card.is-active {
  border-color: rgba(11, 95, 197, 0.55);
  box-shadow:
    0 0 0 3px rgba(11, 95, 197, 0.14),
    0 18px 36px rgba(15, 23, 42, 0.12);
}

.hifi-plan-card-open {
  display: grid;
  grid-template-rows: 1fr auto;
  width: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.hifi-plan-card-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  min-height: 220px;
  overflow: hidden;
  isolation: isolate;
}

.hifi-plan-card-cover--gradient {
  background: radial-gradient(
      120% 90% at 100% 0%,
      rgba(255, 255, 255, 0.22) 0%,
      transparent 55%
    ),
    linear-gradient(
      165deg,
      var(--cover-from, #3b82f6) 0%,
      var(--cover-to, #1e3a5f) 100%
    );
}

.hifi-plan-card-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

.hifi-plan-card-cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 15, 30, 0.08) 0%,
    rgba(8, 15, 30, 0.2) 42%,
    rgba(8, 15, 30, 0.78) 100%
  );
}

.hifi-plan-card-cover-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 48px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.hifi-plan-card-flag {
  display: block;
  width: 34px;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 14px rgba(8, 15, 30, 0.28);
}

.hifi-plan-card-flag img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hifi-plan-card-chip {
  margin-left: auto;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f8fafc;
  background: rgba(8, 15, 30, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
}

.hifi-plan-card-cover-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: grid;
  gap: 6px;
  padding: 16px 12px 14px;
  color: #f8fafc;
}

.hifi-plan-card-destination {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.9;
}

.hifi-plan-card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: balance;
}

.hifi-plan-card-bar {
  display: grid;
  gap: 3px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(126, 151, 193, 0.14);
  background: rgba(255, 255, 255, 0.94);
}

.hifi-plan-card-dates {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink, #0f172a);
}

.hifi-plan-card-updated {
  font-size: 0.72rem;
  color: var(--hifi-ai-muted, #64748b);
}

.hifi-plan-card-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(8, 15, 30, 0.42);
  color: #f8fafc;
  font-size: 1.2rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.hifi-plan-card-delete:hover {
  background: rgba(185, 28, 28, 0.82);
  transform: scale(1.04);
}

.hifi-plan-card--skeleton {
  pointer-events: none;
  border-color: rgba(126, 151, 193, 0.14);
  box-shadow: none;
}

.hifi-plan-card-cover--skeleton {
  background: linear-gradient(
    110deg,
    rgba(226, 232, 240, 0.55) 8%,
    rgba(248, 250, 252, 0.95) 18%,
    rgba(226, 232, 240, 0.55) 33%
  );
  background-size: 220% 100%;
  animation: hifiPlanShimmer 1.35s ease-in-out infinite;
}

.hifi-plan-card-skeleton-line {
  display: block;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(
    110deg,
    rgba(226, 232, 240, 0.55) 8%,
    rgba(248, 250, 252, 0.95) 18%,
    rgba(226, 232, 240, 0.55) 33%
  );
  background-size: 220% 100%;
  animation: hifiPlanShimmer 1.35s ease-in-out infinite;
}

.hifi-plan-card-skeleton-line--short {
  width: 62%;
}

@keyframes hifiPlanShimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -40% 0;
  }
}

.hifi-plan-card-open:focus-visible {
  outline: 3px solid rgba(11, 95, 197, 0.55);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .hifi-plan-card {
    transition: none;
  }

  .hifi-plan-card:hover {
    transform: none;
  }

  .hifi-plan-card-cover--skeleton,
  .hifi-plan-card-skeleton-line {
    animation: none;
  }
}

:root[data-theme='dark'] .view-hifi {
  --hifi-input-bg: rgba(8, 16, 32, 0.92);
  --hifi-input-highlight: rgba(255, 255, 255, 0.04);
  --hifi-chip-bg: rgba(12, 22, 42, 0.9);
  --hifi-chip-bg-hover: rgba(20, 36, 68, 0.95);
  --hifi-chip-border: rgba(148, 163, 184, 0.28);
  --hifi-empty-bg: rgba(10, 18, 34, 0.72);
  --hifi-empty-border: rgba(148, 163, 184, 0.16);
}

:root[data-theme='dark'] .view-hifi .hifi-hero {
  background: linear-gradient(
    145deg,
    rgba(12, 20, 38, 0.96) 0%,
    rgba(10, 24, 48, 0.92) 52%,
    rgba(8, 28, 40, 0.9) 100%
  );
  border-color: rgba(96, 165, 250, 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 22px 50px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .hifi-hero-badge {
  color: #93c5fd;
  background: rgba(30, 58, 138, 0.55);
  border-color: rgba(96, 165, 250, 0.35);
}

:root[data-theme='dark'] .hifi-composer-kicker,
:root[data-theme='dark'] .hifi-hero-head h2,
:root[data-theme='dark'] .hifi-timeline-hero h2,
:root[data-theme='dark'] .hifi-event-title {
  color: #f1f5f9;
}

:root[data-theme='dark'] .hifi-composer-label,
:root[data-theme='dark'] .hifi-event-time {
  color: rgba(203, 213, 225, 0.82);
}

:root[data-theme='dark'] .hifi-journey-input,
:root[data-theme='dark'] .hifi-journey-notes {
  color: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.24);
}

:root[data-theme='dark'] .hifi-journey-input:focus,
:root[data-theme='dark'] .hifi-journey-notes:focus {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme='dark']
  .hifi-journey-field--date
  .hifi-journey-input.checkout-date-input,
:root[data-theme='dark'] .hifi-journey-field--date .checkout-date-picker-btn {
  color: #e2e8f0;
  background: var(--hifi-input-bg);
  border-color: var(--hifi-input-border, rgba(148, 163, 184, 0.22));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme='dark'] .hifi-journey-field--date .checkout-date-picker-btn {
  color: #93c5fd;
}

:root[data-theme='dark'] .hifi-composer-chip {
  color: #e2e8f0;
  background: var(--hifi-chip-bg);
  border-color: var(--hifi-chip-border);
}

:root[data-theme='dark'] .hifi-composer-chip:hover {
  background: var(--hifi-chip-bg-hover);
  border-color: rgba(96, 165, 250, 0.38);
}

:root[data-theme='dark'] .hifi-event-card,
:root[data-theme='dark'] .hifi-plan-card,
:root[data-theme='dark'] .hifi-timeline-hero.panel {
  background: rgba(12, 20, 38, 0.88);
  border-color: rgba(148, 163, 184, 0.2);
}

:root[data-theme='dark'] .hifi-plan-card:hover,
:root[data-theme='dark'] .hifi-plan-card.is-active {
  border-color: rgba(96, 165, 250, 0.38);
}

:root[data-theme='dark'] .hifi-plan-card-bar {
  background: rgba(10, 18, 34, 0.96);
  border-top-color: rgba(148, 163, 184, 0.16);
}

:root[data-theme='dark'] .hifi-plan-card-dates {
  color: #f1f5f9;
}

:root[data-theme='dark'] .hifi-plan-empty {
  background: rgba(12, 22, 40, 0.72);
  border-color: rgba(148, 163, 184, 0.2);
}

:root[data-theme='dark'] .hifi-plan-card-cover--skeleton,
:root[data-theme='dark'] .hifi-plan-card-skeleton-line {
  background: linear-gradient(
    110deg,
    rgba(30, 41, 59, 0.72) 8%,
    rgba(51, 65, 85, 0.92) 18%,
    rgba(30, 41, 59, 0.72) 33%
  );
  background-size: 220% 100%;
}

:root[data-theme='dark'] .hifi-event-notes,
:root[data-theme='dark'] .hifi-timeline-disclaimer,
:root[data-theme='dark'] .hifi-timeline-window,
:root[data-theme='dark'] .hifi-about p,
:root[data-theme='dark'] .hifi-empty {
  color: rgba(203, 213, 225, 0.78);
  background: var(--hifi-empty-bg);
  border-color: var(--hifi-empty-border);
}

:root[data-theme='dark'] .hifi-event-badge {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(148, 163, 184, 0.28);
}

:root[data-theme='dark'] .hifi-action-btn--map {
  color: #bfdbfe;
  background: linear-gradient(
    180deg,
    rgba(30, 41, 59, 0.95),
    rgba(15, 23, 42, 0.95)
  );
  border-color: rgba(148, 163, 184, 0.28);
}

:root[data-theme='dark'] .hifi-action-btn--food {
  color: #fdba74;
  background: linear-gradient(
    180deg,
    rgba(67, 32, 12, 0.85),
    rgba(41, 24, 12, 0.95)
  );
  border-color: rgba(251, 146, 60, 0.28);
}

:root[data-theme='dark'] .hifi-action-btn--stay {
  color: #ddd6fe;
  background: linear-gradient(
    180deg,
    rgba(46, 30, 78, 0.85),
    rgba(30, 22, 52, 0.95)
  );
  border-color: rgba(167, 139, 250, 0.28);
}

:root[data-theme='dark'] .hifi-event-node {
  background: #0f172a;
  border-color: rgba(96, 165, 250, 0.65);
}

:root[data-theme='dark'] .hifi-day-dot {
  background: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18);
}

:root[data-theme='dark'] .hifi-journey-suggestions.suggestions {
  background: rgba(10, 18, 34, 0.98);
  border-color: rgba(148, 163, 184, 0.24);
}

:root[data-theme='dark'] .hifi-journey-suggestions .suggestion {
  color: #e2e8f0;
}

:root[data-theme='dark'] .hifi-journey-suggestions .suggestion:hover,
:root[data-theme='dark']
  .hifi-journey-suggestions
  .suggestion[aria-selected='true'] {
  background: rgba(30, 58, 95, 0.65);
}

:root[data-theme='dark'] .hifi-composer-input-wrap {
  background: rgba(14, 24, 46, 0.88);
  border-color: rgba(148, 163, 184, 0.22);
}

:root[data-theme='dark'] .hifi-composer-input {
  color: #f2f6ff;
}

@media (max-width: 900px) {
  .hifi-secondary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hifi-hero-inner {
    padding: 18px 16px 16px;
  }

  .hifi-journey-row {
    grid-template-columns: 1fr 1fr;
  }

  .hifi-journey-field--date {
    grid-column: span 1;
  }

  .hifi-composer-input-wrap {
    flex-direction: column;
  }

  .hifi-composer-go {
    width: 100%;
    min-height: 48px;
  }

  .hifi-event-card {
    grid-template-columns: 1fr;
  }

  .hifi-event {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .hifi-day-group {
    padding-left: 28px;
  }

  .hifi-day-marker {
    margin-left: -28px;
  }
}

/* Hi-fi AI Planner rebuild */
.view-hifi {
  --hifi-ai-bg: #f6f9fc;
  --hifi-ai-ink: #121826;
  --hifi-ai-muted: #637083;
  --hifi-ai-line: rgba(22, 37, 60, 0.1);
  --hifi-ai-blue: #1269e2;
  --hifi-ai-teal: #11a783;
  --hifi-ai-amber: #c77713;
  --hifi-ai-violet: #6554c0;
  --hifi-ai-surface: rgba(255, 255, 255, 0.86);
  --hifi-ai-soft: rgba(232, 241, 252, 0.8);
  color: var(--hifi-ai-ink);
  max-width: 100%;
  overflow-x: hidden;
  padding-top: 24px;
}

.hifi-layout {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  min-width: 0;
  overflow-x: clip;
}

.hifi-shell {
  gap: 16px;
  min-width: 0;
}

.hifi-shell > * {
  min-width: 0;
  max-width: 100%;
}

.hifi-studio {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  border-radius: 26px;
  border: 1px solid rgba(18, 105, 226, 0.14);
  background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.94),
      rgba(239, 248, 255, 0.82)
    ),
    linear-gradient(90deg, rgba(17, 167, 131, 0.1), rgba(101, 84, 192, 0.08));
  box-shadow: 0 24px 70px rgba(28, 47, 76, 0.12);
}

.hifi-studio::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
      rgba(18, 105, 226, 0.055) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(18, 105, 226, 0.055) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
}

.hifi-composer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 14px;
  min-width: 0;
  padding: 14px;
}

.hifi-command-panel,
.hifi-trip-brief,
.hifi-timeline-hero,
.hifi-about,
.hifi-active {
  border: 1px solid rgba(22, 37, 60, 0.1);
  background: var(--hifi-ai-surface);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 18px 44px rgba(29, 46, 72, 0.08);
  backdrop-filter: blur(18px);
}

.hifi-command-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  padding: 20px;
  border-radius: 22px;
}

.hifi-command-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.hifi-command-header h2 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(2rem, 3.6vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hifi-command-header p {
  margin: 14px 0 0;
  max-width: 60ch;
  color: var(--hifi-ai-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.hifi-agent-orb {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: white;
  background: radial-gradient(
      circle at 28% 25%,
      rgba(255, 255, 255, 0.9),
      transparent 26%
    ),
    conic-gradient(from 110deg, #1269e2, #11a783, #6554c0, #1269e2);
  box-shadow: 0 18px 40px rgba(18, 105, 226, 0.26);
}

.hifi-agent-orb span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-top-color: rgba(255, 255, 255, 0.28);
  animation: hifiSpin 1.8s linear infinite;
}

.hifi-composer:not(.is-busy) .hifi-agent-orb span {
  animation-play-state: paused;
}

.hifi-prompt-box {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(18, 105, 226, 0.16);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.94),
    rgba(248, 252, 255, 0.9)
  );
}

.hifi-prompt-label,
.hifi-trip-brief-head span,
.hifi-composer-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #526176;
}

.hifi-prompt-input {
  width: 100%;
  min-height: 104px;
  border: 0;
  resize: vertical;
  background: transparent;
  color: var(--hifi-ai-ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.48;
}

.hifi-prompt-input:focus {
  outline: none;
}

.hifi-command-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hifi-composer-chips,
.hifi-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hifi-composer-chip,
.hifi-ai-actions button {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(22, 37, 60, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: #233044;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  padding: 7px 12px;
  cursor: pointer;
}

.hifi-ai-actions button:hover,
.hifi-composer-chip:hover {
  border-color: rgba(18, 105, 226, 0.34);
  background: rgba(236, 246, 255, 0.96);
}

.hifi-composer-go {
  min-height: 44px;
  min-width: 132px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1269e2, #11a783);
  box-shadow: 0 16px 32px rgba(18, 105, 226, 0.26);
}

.hifi-planner-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.hifi-planner-steps span {
  position: relative;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(22, 37, 60, 0.1);
  color: var(--hifi-ai-muted);
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.76rem;
  font-weight: 800;
}

.hifi-planner-steps span.is-active,
.hifi-planner-steps span.is-done {
  color: #0f513f;
  border-color: rgba(17, 167, 131, 0.24);
  background: rgba(221, 251, 243, 0.82);
}

.hifi-trip-brief {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  border-radius: 22px;
}

.hifi-trip-brief-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hifi-trip-brief-head strong {
  color: #0f6956;
  font-size: 0.92rem;
}

.hifi-journey-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hifi-journey-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hifi-journey-field--date {
  min-width: 0;
}

.hifi-journey-input,
.hifi-journey-notes {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(22, 37, 60, 0.11);
  background: rgba(255, 255, 255, 0.82);
  color: var(--hifi-ai-ink);
  font: inherit;
  font-size: 0.95rem;
  padding: 11px 12px;
  box-shadow: none;
}

.hifi-journey-notes {
  min-height: 96px;
  resize: vertical;
}

.hifi-journey-input:focus,
.hifi-journey-notes:focus {
  outline: none;
  border-color: rgba(18, 105, 226, 0.42);
  box-shadow: 0 0 0 4px rgba(18, 105, 226, 0.1);
}

.hifi-journey-suggestions {
  position: absolute;
  inset: calc(100% + 5px) 0 auto;
  z-index: 45;
}

.hifi-composer-status {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
}

.hifi-timeline-mount {
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-margin-top: 118px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.hifi-empty {
  display: grid;
  gap: 6px;
  min-height: 120px;
  padding: 24px;
  border-radius: 22px;
  border: 1px dashed rgba(18, 105, 226, 0.22);
  color: #526176;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.78),
    rgba(236, 246, 255, 0.66)
  );
}

.hifi-empty strong {
  color: var(--hifi-ai-ink);
  font-size: 1.02rem;
}

.hifi-timeline-modern {
  gap: 14px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.hifi-timeline {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.hifi-timeline-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 20px;
  border-radius: 24px;
  min-width: 0;
}

.hifi-timeline-hero > div:first-child {
  min-width: 0;
}

.hifi-timeline-hero h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hifi-timeline-window {
  margin: 7px 0 0;
  color: #1269e2;
}

.hifi-timeline-disclaimer {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--hifi-ai-muted);
  font-size: 0.84rem;
}

.hifi-plan-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hifi-plan-metrics span {
  display: grid;
  min-width: 84px;
  padding: 9px 11px;
  border-radius: 16px;
  color: #526176;
  background: rgba(243, 248, 255, 0.9);
  border: 1px solid rgba(18, 105, 226, 0.1);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hifi-plan-metrics strong {
  color: var(--hifi-ai-ink);
  font-size: 1rem;
  text-transform: none;
}

.hifi-day-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: 2px 0 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.hifi-day-tab {
  flex: 0 0 auto;
  width: clamp(148px, 16vw, 188px);
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(22, 37, 60, 0.1);
  background: rgba(255, 255, 255, 0.78);
  scroll-snap-align: start;
}

.hifi-day-tab span {
  color: var(--hifi-ai-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hifi-day-tab strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.hifi-timeline-rail {
  display: grid;
  gap: 16px;
  padding: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.hifi-timeline-rail::before {
  content: none;
}

.hifi-day-group {
  scroll-margin-top: 138px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(22, 37, 60, 0.1);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 44px rgba(29, 46, 72, 0.06);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.hifi-day-marker {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  min-width: 0;
}

.hifi-day-marker > div {
  min-width: 0;
}

.hifi-day-marker h3 {
  margin: 2px 0 0;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hifi-day-kicker {
  color: var(--hifi-ai-teal);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hifi-day-date {
  padding: 7px 10px;
  border-radius: 999px;
  color: #526176;
  background: rgba(246, 249, 252, 0.88);
  border: 1px solid rgba(22, 37, 60, 0.08);
  font-size: 0.78rem;
  font-weight: 750;
}

.hifi-day-events {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.hifi-event {
  display: block;
}

.hifi-event-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(0, 150px);
  align-items: stretch;
  min-height: 116px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(22, 37, 60, 0.08);
  background: #fff;
  box-shadow: none;
}

.hifi-event-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(29, 46, 72, 0.08);
}

.hifi-event-index {
  display: grid;
  place-items: start center;
  padding-top: 18px;
  color: #8090a4;
  background: linear-gradient(180deg, rgba(246, 249, 252, 0.92), #fff);
  border-right: 1px solid rgba(22, 37, 60, 0.07);
  font-size: 0.78rem;
  font-weight: 850;
}

.hifi-event-body {
  padding: 16px;
  gap: 7px;
  min-width: 0;
}

.hifi-event-meta {
  gap: 8px;
}

.hifi-event-time {
  color: #47566a;
  font-size: 0.76rem;
}

.hifi-event-badge {
  border: 0;
  color: #0f513f;
  background: rgba(221, 251, 243, 0.9);
}

.hifi-type-food .hifi-event-badge {
  color: #834711;
  background: rgba(255, 241, 217, 0.92);
}

.hifi-type-hotel .hifi-event-badge {
  color: #49399b;
  background: rgba(238, 234, 255, 0.95);
}

.hifi-type-transit .hifi-event-badge,
.hifi-type-flight_arrival .hifi-event-badge,
.hifi-type-flight_departure .hifi-event-badge {
  color: #0b529f;
  background: rgba(225, 240, 255, 0.95);
}

.hifi-event-title {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hifi-event-notes {
  color: #526176;
  font-size: 0.86rem;
}

.hifi-event-media {
  min-height: 116px;
  background: linear-gradient(135deg, #e9f5ff, #dff8f1);
}

.hifi-event-media img {
  min-height: 116px;
}

.hifi-event-media--empty {
  display: grid;
  place-items: center;
}

.hifi-event-media-fallback {
  color: #1269e2;
  font-weight: 850;
  font-size: 1.25rem;
}

.hifi-event-actions {
  margin-top: 3px;
}

.hifi-action-btn {
  min-height: 34px;
  border-radius: 999px;
  box-shadow: none;
}

.hifi-action-btn svg {
  width: 16px;
  height: 16px;
}

.hifi-timeline-actions {
  position: sticky;
  top: calc(var(--site-header-offset, 88px) + 8px);
  z-index: 40;
  width: min(100%, fit-content);
  max-width: 100%;
  margin: 0 auto 12px;
  box-sizing: border-box;
  scroll-margin-top: 118px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 9px;
  border-radius: 999px;
  border: 1px solid rgba(22, 37, 60, 0.1);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 22px 50px rgba(28, 47, 76, 0.14);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.hifi-timeline-actions.hidden {
  display: none;
}

.hifi-timeline-actions .primary {
  background: linear-gradient(135deg, #1269e2, #11a783);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(18, 105, 226, 0.28);
}

.hifi-timeline-actions .secondary {
  background: rgba(255, 255, 255, 0.96);
  color: #13203d;
  border-color: rgba(22, 37, 60, 0.14);
}

.hifi-timeline-actions .secondary:not(:disabled):hover {
  background: #f3f8ff;
  border-color: rgba(18, 105, 226, 0.28);
  color: #0b3f7a;
}

.hifi-timeline-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.hifi-secondary-grid {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.hifi-about,
.hifi-active {
  border-radius: 22px;
  padding: 18px;
}

.hifi-about h3,
.hifi-active h3 {
  font-size: 1rem;
}

.hifi-about p {
  color: var(--hifi-ai-muted);
}

@media (max-width: 720px) {
  .hifi-plan-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    overflow: visible;
    scroll-snap-type: none;
  }

  .hifi-plan-card {
    flex: none;
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .hifi-plan-card-cover {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .hifi-plan-card-cover-top {
    right: 56px;
  }

  .hifi-plan-card-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 10px;
  }

  .hifi-plan-card-delete {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .hifi-plan-card-dates {
    font-size: 0.875rem;
  }

  .hifi-plan-card-updated {
    font-size: 0.78rem;
  }

  .hifi-plan-card-title {
    -webkit-line-clamp: 2;
  }
}

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

:root[data-theme='dark'] .view-hifi {
  --hifi-ai-bg: #08111f;
  --hifi-ai-ink: #f1f6ff;
  --hifi-ai-muted: #a8b5c8;
  --hifi-ai-line: rgba(148, 163, 184, 0.18);
  --hifi-ai-surface: rgba(13, 24, 43, 0.88);
  --hifi-ai-soft: rgba(16, 34, 58, 0.8);
}

:root[data-theme='dark'] .hifi-studio {
  background: linear-gradient(
      135deg,
      rgba(11, 21, 38, 0.96),
      rgba(10, 31, 48, 0.9)
    ),
    linear-gradient(90deg, rgba(17, 167, 131, 0.11), rgba(101, 84, 192, 0.12));
  border-color: rgba(96, 165, 250, 0.2);
}

:root[data-theme='dark'] .hifi-command-panel,
:root[data-theme='dark'] .hifi-trip-brief,
:root[data-theme='dark'] .hifi-timeline-hero,
:root[data-theme='dark'] .hifi-day-group,
:root[data-theme='dark'] .hifi-about,
:root[data-theme='dark'] .hifi-active {
  background: rgba(11, 21, 38, 0.82);
  border-color: rgba(148, 163, 184, 0.18);
}

:root[data-theme='dark'] .hifi-prompt-box,
:root[data-theme='dark'] .hifi-journey-input,
:root[data-theme='dark'] .hifi-journey-notes,
:root[data-theme='dark'] .hifi-composer-chip,
:root[data-theme='dark'] .hifi-ai-actions button,
:root[data-theme='dark'] .hifi-day-tab,
:root[data-theme='dark'] .hifi-event-card,
:root[data-theme='dark'] .hifi-timeline-actions {
  color: var(--hifi-ai-ink);
  background: rgba(12, 22, 40, 0.94);
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

:root[data-theme='dark'] .hifi-timeline-actions .primary {
  background: linear-gradient(135deg, #3b82f6, #14b8a6);
  color: #f8fbff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
}

:root[data-theme='dark'] .hifi-timeline-actions .secondary {
  background: rgba(24, 40, 68, 0.96);
  color: #e8f2ff;
  border-color: rgba(148, 163, 184, 0.32);
}

:root[data-theme='dark']
  .hifi-timeline-actions
  .secondary:not(:disabled):hover {
  background: rgba(34, 54, 88, 0.98);
  border-color: rgba(96, 165, 250, 0.45);
  color: #fff;
}

:root[data-theme='dark'] .hifi-prompt-input {
  color: var(--hifi-ai-ink);
}

:root[data-theme='dark'] .hifi-event-index,
:root[data-theme='dark'] .hifi-event-media,
:root[data-theme='dark'] .hifi-day-date,
:root[data-theme='dark'] .hifi-plan-metrics span,
:root[data-theme='dark'] .hifi-empty {
  background: rgba(16, 34, 58, 0.78);
  border-color: rgba(148, 163, 184, 0.16);
}

@media (max-width: 1180px) {
  .hifi-composer {
    grid-template-columns: 1fr;
  }

  .hifi-command-panel {
    min-height: 0;
  }

  .hifi-trip-brief .hifi-journey-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .hifi-trip-brief .hifi-journey-row {
    grid-template-columns: 1fr 1fr;
  }

  .hifi-event-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .hifi-event-media {
    grid-column: 1 / -1;
    min-height: 180px;
  }

  .hifi-secondary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hifi-studio {
    border-radius: 20px;
  }

  .hifi-composer {
    padding: 10px;
  }

  .hifi-command-panel,
  .hifi-trip-brief {
    padding: 16px;
    border-radius: 18px;
  }

  .hifi-command-header {
    grid-template-columns: 1fr;
  }

  .hifi-agent-orb {
    display: none;
  }

  .hifi-command-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .hifi-composer-go {
    width: 100%;
  }

  .hifi-planner-steps,
  .hifi-journey-row,
  .hifi-timeline-hero {
    grid-template-columns: 1fr;
  }

  .hifi-plan-metrics {
    justify-content: stretch;
  }

  .hifi-plan-metrics span {
    min-width: 0;
    flex: 1;
  }

  .hifi-day-group {
    padding: 14px;
    border-radius: 18px;
  }

  .hifi-day-marker {
    flex-direction: column;
    gap: 8px;
  }

  .hifi-event-card {
    grid-template-columns: 1fr;
  }

  .hifi-event-index {
    display: none;
  }

  .hifi-timeline-actions {
    width: 100%;
    border-radius: 18px;
  }
}

/* Hi-fi chat interface */
.view-hifi {
  padding-top: 24px;
}

.hifi-chat-layout {
  max-width: 1280px;
}

.hifi-chat-shell {
  display: grid;
  gap: 14px;
}

.hifi-chat-studio {
  position: relative;
  width: min(100%, 960px);
  height: min(760px, calc(100dvh - 152px));
  min-height: 560px;
  max-height: calc(100dvh - 152px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(22, 37, 60, 0.1);
  box-shadow: 0 24px 70px rgba(28, 47, 76, 0.12);
}

.hifi-chat-studio::before {
  content: none;
}

.hifi-chat-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  position: relative;
  min-width: 0;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(22, 37, 60, 0.08);
  background: rgba(255, 255, 255, 0.76);
}

.hifi-chat-top-trailing {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.hifi-chat-top-status {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  max-width: min(320px, calc(100% - 400px));
  margin: 0;
  padding: 6px 14px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.hifi-chat-top-status.hidden {
  display: none;
}

.hifi-chat-agent {
  display: flex;
  align-items: center;
  gap: 12px;
  grid-column: 1;
  min-width: 0;
}

.hifi-chat-agent .hifi-agent-orb {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(18, 105, 226, 0.2);
}

.hifi-chat-agent .hifi-agent-orb span {
  width: 20px;
  height: 20px;
}

.hifi-chat-agent h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.1;
}

.hifi-chat-agent p {
  margin: 3px 0 0;
  color: #637083;
  font-size: 0.84rem;
}

.hifi-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #eef3f8;
  border: 1px solid rgba(22, 37, 60, 0.08);
}

.hifi-mode-toggle button {
  border: 0;
  border-radius: 999px;
  min-height: 32px;
  padding: 0 14px;
  color: #526176;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
}

.hifi-mode-toggle button.active {
  color: #fff;
  background: linear-gradient(135deg, #1269e2, #11a783);
  box-shadow: 0 10px 24px rgba(18, 105, 226, 0.18);
}

.hifi-chat-session-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hifi-session-button {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(22, 37, 60, 0.1);
  background: #fff;
  color: #172033;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
}

.hifi-session-button--wide {
  min-width: 78px;
}

.hifi-session-button:hover {
  border-color: rgba(18, 105, 226, 0.24);
  color: #0b63ce;
}

.hifi-session-button:disabled,
.hifi-session-button.is-disabled {
  cursor: not-allowed;
  color: #7a8799;
  background: #f4f7fb;
  border-color: rgba(22, 37, 60, 0.08);
  opacity: 0.78;
}

.hifi-chat-history-panel {
  position: absolute;
  top: 72px;
  right: 18px;
  z-index: 35;
  width: min(340px, calc(100% - 36px));
  max-height: min(420px, calc(100% - 96px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(22, 37, 60, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 60px rgba(28, 47, 76, 0.18);
  backdrop-filter: blur(16px);
}

.hifi-chat-history-panel.hidden {
  display: none;
}

.hifi-chat-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(22, 37, 60, 0.08);
}

.hifi-chat-history-head button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #eef3f8;
  color: #172033;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.hifi-chat-history-list {
  display: grid;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  scrollbar-width: none;
}

.hifi-chat-history-list::-webkit-scrollbar {
  display: none;
}

.hifi-chat-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 7px;
  align-items: stretch;
}

.hifi-chat-history-item {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(22, 37, 60, 0.08);
  border-radius: 14px;
  background: #f8fbff;
  color: #172033;
  text-align: left;
  cursor: pointer;
}

.hifi-chat-history-delete {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 58px;
  border: 1px solid rgba(22, 37, 60, 0.08);
  border-radius: 14px;
  background: #fff;
  color: #7a8799;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
}

.hifi-chat-history-delete:hover {
  border-color: rgba(220, 38, 38, 0.24);
  color: #b42318;
  background: #fff7f6;
}

.hifi-chat-history-item strong,
.hifi-chat-history-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hifi-chat-history-item span,
.hifi-chat-history-empty {
  color: #637083;
  font-size: 0.78rem;
}

.hifi-chat-history-row.active .hifi-chat-history-item {
  border-color: rgba(18, 105, 226, 0.28);
  background: #eef5ff;
}

.hifi-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 18px;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.hifi-chat-messages::-webkit-scrollbar {
  display: none;
}

.hifi-chat-message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  max-width: 760px;
}

.hifi-chat-message--user {
  align-self: flex-end;
  grid-template-columns: minmax(0, 1fr) 38px;
}

.hifi-chat-message--user .hifi-chat-avatar {
  grid-column: 2;
  grid-row: 1;
  background: #13203d;
}

.hifi-chat-message--user .hifi-chat-bubble {
  grid-column: 1;
  grid-row: 1;
  background: #eef5ff;
}

.hifi-chat-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #1269e2, #11a783);
  font-size: 0.72rem;
  font-weight: 850;
}

.hifi-chat-bubble {
  min-width: 0;
  padding: 13px 15px;
  border-radius: 18px;
  background: #f7fafc;
  border: 1px solid rgba(22, 37, 60, 0.08);
}

.hifi-chat-title {
  display: block;
  margin-bottom: 5px;
}

.hifi-chat-bubble p {
  margin: 0;
  color: #526176;
  line-height: 1.55;
}

.hifi-chat-bubble p + p {
  margin-top: 8px;
}

.hifi-chat-bubble p strong,
.hifi-chat-list strong {
  display: inline;
  margin: 0;
  color: #172033;
  font-weight: 900;
}

.hifi-chat-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #526176;
  line-height: 1.55;
}

.hifi-chat-list li + li {
  margin-top: 6px;
}

.hifi-typing-dots {
  display: inline-flex;
  gap: 5px;
  margin-top: 9px;
  vertical-align: middle;
}

.hifi-typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #1276e8;
  opacity: 0.35;
  animation: hifiTypingDot 1.05s ease-in-out infinite;
}

.hifi-typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.hifi-typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes hifiTypingDot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-3px);
    opacity: 0.9;
  }
}

.hifi-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hifi-chat-action {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(22, 37, 60, 0.12);
  border-radius: 999px;
  background: #fff;
  color: #172033;
  font-weight: 850;
  cursor: pointer;
}

.hifi-chat-action--primary {
  border-color: transparent;
  background: linear-gradient(135deg, #1688f3, #0ca58c);
  color: #fff;
  box-shadow: 0 14px 26px rgba(18, 105, 226, 0.18);
}

.hifi-chat-action:hover {
  transform: translateY(-1px);
}

.hifi-chat-message--loading .hifi-chat-bubble {
  background: #eef8ff;
  border-color: rgba(18, 105, 226, 0.16);
}

.hifi-chat-message--error .hifi-chat-bubble {
  background: #fff1f1;
  border-color: rgba(239, 68, 68, 0.18);
}

.hifi-chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
  padding: 14px;
  border-top: 1px solid rgba(22, 37, 60, 0.08);
  background: rgba(255, 255, 255, 0.88);
}

.hifi-chat-composer .hifi-prompt-box {
  min-width: 0;
  padding: 0;
  border-radius: 18px;
  border-color: rgba(22, 37, 60, 0.12);
  background: #fff;
}

.hifi-chat-composer .hifi-prompt-input {
  min-height: 52px;
  max-height: 150px;
  padding: 15px 16px;
  overflow-y: auto;
  resize: none;
  scrollbar-width: none;
}

.hifi-chat-composer .hifi-prompt-input::-webkit-scrollbar {
  display: none;
}

.hifi-chat-composer .hifi-composer-go {
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 18px;
}

.hifi-chat-composer .hifi-composer-go__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.hifi-context-panel {
  grid-column: 1 / -1;
  display: block;
  padding: 0;
  border-radius: 18px;
  background: #f8fbff;
}

.hifi-context-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.hifi-context-panel summary::-webkit-details-marker {
  display: none;
}

.hifi-context-panel summary span {
  color: #526176;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hifi-context-panel summary strong {
  color: #0f6956;
  font-size: 0.84rem;
}

.hifi-context-panel[open] {
  padding-bottom: 14px;
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.hifi-context-panel[open]::-webkit-scrollbar {
  display: none;
}

.hifi-context-panel[open] .hifi-journey-row,
.hifi-context-panel[open] > .hifi-composer-label,
.hifi-context-panel[open] > .hifi-journey-notes,
.hifi-context-panel[open] > .hifi-ai-actions,
.hifi-context-panel[open] > .hifi-planner-steps {
  margin-inline: 14px;
}

.hifi-context-panel .hifi-journey-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.hifi-context-panel .hifi-journey-notes {
  min-height: 70px;
  margin-top: 7px;
  margin-bottom: 12px;
}

.hifi-context-panel .hifi-ai-actions {
  margin-bottom: 10px;
}

.hifi-context-panel .hifi-planner-steps {
  margin-top: 0;
}

.hifi-history-grid {
  width: min(100%, 960px);
  margin: 0 auto;
  grid-template-columns: 1fr;
}

.hifi-history-grid .hifi-active {
  padding: 16px;
  border-radius: 20px;
}

.hifi-history-grid .hifi-active-list {
  margin-top: 10px;
}

.hifi-history-grid .hifi-plan-grid {
  gap: 12px;
}

.hifi-timeline-actions,
.hifi-timeline-mount {
  width: min(100%, 960px);
  margin-inline: auto;
}

:root[data-theme='dark'] .hifi-chat-studio,
:root[data-theme='dark'] .hifi-chat-top,
:root[data-theme='dark'] .hifi-chat-composer {
  background: rgba(11, 21, 38, 0.92);
  border-color: rgba(148, 163, 184, 0.18);
}

:root[data-theme='dark'] .hifi-chat-agent p,
:root[data-theme='dark'] .hifi-chat-bubble p,
:root[data-theme='dark'] .hifi-chat-list,
:root[data-theme='dark'] .hifi-context-panel summary span {
  color: #c8d4e6;
}

:root[data-theme='dark'] .hifi-chat-title {
  color: #f4f8ff;
}

:root[data-theme='dark'] .hifi-mode-toggle {
  background: rgba(15, 28, 50, 0.9);
  border-color: rgba(148, 163, 184, 0.2);
}

:root[data-theme='dark'] .hifi-session-button,
:root[data-theme='dark'] .hifi-chat-history-panel {
  background: rgba(15, 28, 50, 0.96);
  border-color: rgba(148, 163, 184, 0.22);
  color: #eef5ff;
}

:root[data-theme='dark'] .hifi-session-button:disabled,
:root[data-theme='dark'] .hifi-session-button.is-disabled {
  background: rgba(15, 28, 50, 0.72);
  border-color: rgba(148, 163, 184, 0.12);
  color: #8796aa;
}

:root[data-theme='dark'] .hifi-chat-history-head {
  border-color: rgba(148, 163, 184, 0.18);
}

:root[data-theme='dark'] .hifi-chat-history-head button {
  background: rgba(31, 54, 88, 0.95);
  color: #eef5ff;
}

:root[data-theme='dark'] .hifi-chat-history-item {
  background: rgba(11, 21, 38, 0.84);
  border-color: rgba(148, 163, 184, 0.16);
  color: #eef5ff;
}

:root[data-theme='dark'] .hifi-chat-history-delete {
  background: rgba(11, 21, 38, 0.72);
  border-color: rgba(148, 163, 184, 0.16);
  color: #a8b5c8;
}

:root[data-theme='dark'] .hifi-chat-history-delete:hover {
  background: rgba(78, 24, 24, 0.72);
  border-color: rgba(248, 113, 113, 0.3);
  color: #fecaca;
}

:root[data-theme='dark'] .hifi-chat-history-item span,
:root[data-theme='dark'] .hifi-chat-history-empty {
  color: #a8b5c8;
}

:root[data-theme='dark'] .hifi-chat-history-row.active .hifi-chat-history-item {
  background: rgba(31, 54, 88, 0.92);
  border-color: rgba(96, 165, 250, 0.38);
}

:root[data-theme='dark'] .hifi-chat-bubble,
:root[data-theme='dark'] .hifi-context-panel {
  background: rgba(15, 28, 50, 0.9);
  border-color: rgba(148, 163, 184, 0.2);
}

:root[data-theme='dark'] .hifi-chat-message--user .hifi-chat-bubble {
  background: rgba(31, 54, 88, 0.95);
}

:root[data-theme='dark'] .hifi-chat-message--user .hifi-chat-bubble p {
  color: #e7f0ff;
}

:root[data-theme='dark'] .hifi-chat-bubble p strong,
:root[data-theme='dark'] .hifi-chat-list strong {
  color: #eef5ff;
}

:root[data-theme='dark'] .hifi-chat-action {
  background: rgba(11, 21, 38, 0.95);
  border-color: rgba(148, 163, 184, 0.24);
  color: #eef5ff;
}

:root[data-theme='dark'] .hifi-chat-action--primary {
  border-color: transparent;
  background: linear-gradient(135deg, #1688f3, #0ca58c);
  color: #fff;
}

@media (max-width: 720px) {
  .view-hifi {
    padding-top: 12px;
  }

  .hifi-chat-studio {
    height: calc(100dvh - 118px);
    min-height: 480px;
    max-height: calc(100dvh - 118px);
    border-radius: 20px;
  }

  .hifi-chat-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'agent agent'
      'status status'
      'trailing trailing';
    gap: 10px 8px;
    align-items: center;
    padding: 12px 14px;
  }

  .hifi-chat-top-trailing {
    grid-area: trailing;
    grid-column: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    width: 100%;
  }

  .hifi-chat-agent {
    grid-area: agent;
    flex: none;
    width: 100%;
    gap: 10px;
  }

  .hifi-chat-agent h2 {
    font-size: 1.2rem;
  }

  .hifi-chat-agent p {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .hifi-chat-top-status {
    position: static;
    transform: none;
    grid-area: status;
    justify-self: stretch;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.78rem;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    pointer-events: none;
  }

  .hifi-chat-top-status.hidden {
    display: none;
  }

  .hifi-mode-toggle {
    grid-area: auto;
    display: flex;
    width: 100%;
    min-width: 0;
    padding: 3px;
    gap: 3px;
  }

  .hifi-mode-toggle button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 0 12px;
    font-size: 0.84rem;
  }

  .hifi-chat-session-actions {
    grid-area: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 0;
    flex-shrink: 0;
  }

  .hifi-session-button {
    min-width: 44px;
    min-height: 44px;
    height: 44px;
  }

  .hifi-session-button--wide {
    min-width: 5.5rem;
    padding: 0 14px;
  }

  .hifi-chat-history-panel {
    top: auto;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: min(420px, calc(100% - 24px));
  }

  .hifi-chat-messages {
    padding: 18px 12px;
  }

  .hifi-chat-message,
  .hifi-chat-message--user {
    max-width: 100%;
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .hifi-chat-message--user {
    grid-template-columns: minmax(0, 1fr);
  }

  .hifi-chat-message--user .hifi-chat-avatar {
    display: none;
  }

  .hifi-chat-message--user .hifi-chat-bubble {
    grid-column: 1;
  }

  .hifi-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 11px;
  }

  .hifi-chat-composer {
    grid-template-columns: minmax(0, 1fr) 48px;
    padding: 10px;
  }

  .hifi-chat-composer .hifi-composer-go {
    width: 48px;
    min-width: 48px;
    height: 48px;
  }

  .hifi-context-panel .hifi-journey-row {
    grid-template-columns: 1fr;
  }

  .hifi-context-panel[open] {
    max-height: 230px;
  }
}

html[data-high-contrast='true'] .view-hifi .hifi-studio,
html[data-high-contrast='true'] .view-hifi .hifi-chat-studio,
html[data-high-contrast='true'] .view-hifi .hifi-chat-top,
html[data-high-contrast='true'] .view-hifi .hifi-chat-composer,
html[data-high-contrast='true'] .view-hifi .hifi-context-panel,
html[data-high-contrast='true'] .view-hifi .hifi-timeline-hero,
html[data-high-contrast='true'] .view-hifi .hifi-event-card,
html[data-high-contrast='true'] .view-hifi .hifi-plan-card,
html[data-high-contrast='true'] .view-hifi .hifi-active,
html[data-high-contrast='true'] .view-hifi .hifi-timeline-actions {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: var(--surface-solid) !important;
  border: 2px solid var(--line-strong) !important;
  box-shadow: none !important;
}

html[data-high-contrast='true'] .view-hifi .hifi-chat-bubble,
html[data-high-contrast='true'] .view-hifi .hifi-journey-input,
html[data-high-contrast='true'] .view-hifi .hifi-journey-notes,
html[data-high-contrast='true'] .view-hifi .hifi-composer-input,
html[data-high-contrast='true'] .view-hifi .hifi-composer-chip,
html[data-high-contrast='true'] .view-hifi .hifi-day-tab,
html[data-high-contrast='true'] .view-hifi .hifi-action-btn {
  border: 2px solid var(--line-strong) !important;
  background: var(--surface-solid) !important;
  color: var(--ink) !important;
}

html[data-high-contrast='true']
  .view-hifi
  .hifi-chat-message--assistant
  .hifi-chat-bubble,
html[data-high-contrast='true']
  .view-hifi
  .hifi-chat-message--user
  .hifi-chat-bubble {
  background: var(--surface-soft) !important;
}

html[data-high-contrast='true'] .view-hifi .hifi-event-badge,
html[data-high-contrast='true'] .view-hifi .hifi-event-time,
html[data-high-contrast='true'] .view-hifi .hifi-timeline-disclaimer,
html[data-high-contrast='true'] .view-hifi .hifi-empty,
html[data-high-contrast='true'] .view-hifi .hifi-composer-status {
  color: var(--ink) !important;
}

html[data-high-contrast='true'] .view-hifi .hifi-timeline-actions .primary,
html[data-high-contrast='true'] .view-hifi .hifi-timeline-actions .secondary {
  border: 2px solid var(--line-strong) !important;
  box-shadow: none !important;
}
