:root {
  --bg: #f4f7fb;
  --bg-soft: #eef3fb;
  --panel: #ffffff;
  --text: #1d2433;
  --muted: #63708a;
  --primary: #2f6fed;
  --primary-2: #153d94;
  --primary-soft: #eaf1ff;
  --border: #dbe3ef;
  --success: #1f9d55;
  --warn: #d97706;
  --danger: #dc2626;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, #edf4ff 0%, transparent 36%),
    radial-gradient(circle at 85% 8%, #ecf9f3 0%, transparent 34%),
    var(--bg);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 28px;
}

.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-content { display: flex; justify-content: space-between; align-items: center; }
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  min-width: 44px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(135deg, #2f6fed, #163f97);
  box-shadow: 0 8px 20px rgba(47, 111, 237, 0.35);
  padding: 0 10px;
}
.header-actions { display: flex; gap: 10px; align-items: center; }
.env-pill {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #c8d6f4;
  color: #2552b5;
  background: #f4f8ff;
  font-size: 12px;
  font-weight: 700;
}
.header-content h1 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
.header-content p { margin: 4px 0 0; color: var(--muted); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(22, 45, 82, 0.08);
}

sl-card.panel::part(base) {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(22, 45, 82, 0.08);
}

sl-card.panel::part(body) {
  padding: 16px;
}

.hero-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.elevated {
  box-shadow: 0 12px 28px rgba(35, 65, 115, 0.14);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.section-sub {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.route-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d4e2f8;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  margin-bottom: 12px;
}

.route-pill {
  border-radius: 999px;
  background: #e8f0ff;
  color: #2a57b4;
  border: 1px solid #c9daf8;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
}

.timeline-wrap {
  margin-top: 10px;
  border: 1px solid #d4e2f8;
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #d6e2f6;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2f6fed, #163f97);
}

.timeline-title {
  font-size: 13px;
  font-weight: 800;
  color: #21427f;
}

.timeline-meta {
  margin-top: 2px;
  font-size: 12px;
  color: #5c7298;
}

.timeline-compact-wrap {
  margin-bottom: 12px;
}

.timeline-compact {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  border: 1px solid #d0ddf2;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fc 100%);
  overflow: hidden;
}

.timeline-compact-item {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  padding: 10px 12px;
  border-right: 1px solid #e0e8f6;
  background: rgba(255, 255, 255, 0.5);
}

.timeline-compact-item:last-child {
  border-right: none;
}

.timeline-compact-item.timeline-note-item {
  flex: 1 1 100%;
  border-right: none;
  border-top: 1px solid #e0e8f6;
  background: rgba(255, 255, 255, 0.7);
}

.timeline-compact-item .timeline-dot {
  margin-top: 2px;
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f6fed, #163f97);
}

.timeline-compact-content {
  min-width: 0;
}

.timeline-compact-label {
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1e3a7a;
}

.timeline-compact-meta {
  color: #4a5f8a;
  font-weight: 600;
  margin-top: 2px;
  font-size: 11px;
}

.timeline-compact-note {
  margin-top: 2px;
  font-size: 10px;
  color: #6b7fa5;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  opacity: 0.96;
  transform: translateY(-1px);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  box-shadow: 0 8px 16px rgba(41, 90, 190, 0.25);
}
.btn-secondary { background: white; color: var(--text); border-color: var(--border); }
.btn-wide { width: 100%; margin-top: 12px; }

.input-area { position: relative; }
.input-section.hidden { display: none !important; }
.input-collapsed-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #f0f6ff 0%, #e8f0fe 100%);
  font-size: 13px;
  color: var(--muted);
}
.input-collapsed-bar.hidden { display: none !important; }
.input-collapsed-bar .bar-label { font-weight: 600; color: #33425f; }
.input-collapsed-bar .btn { padding: 6px 12px; font-size: 12px; }

.input-toggle { display: flex; gap: 8px; margin-bottom: 12px; }
textarea {
  width: 100%;
  min-height: 160px;
  max-height: 300px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  resize: vertical;
  background: #fcfdff;
}

input[type="file"] {
  width: 100%;
  padding: 9px;
  border: 1px dashed #bfd1f2;
  border-radius: 10px;
  background: #fbfdff;
}

.upload-box {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f9fbff;
}

.helper-row {
  margin-top: 8px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
}
.tab {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  color: #33425f;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border-color: #2d5fc5;
  box-shadow: 0 8px 16px rgba(41, 90, 190, 0.2);
}

.hidden { display: none !important; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge.success { background: #e6f7ef; color: var(--success); }
.badge.warn { background: #fff6e8; color: var(--warn); }
.badge.danger { background: #feecec; color: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.overview-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.kpi-card {
  background: linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
  border: 1px solid #d6e2f5;
  border-radius: 12px;
  padding: 10px 12px;
}

.kpi-label {
  font-size: 12px;
  color: #5c7096;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 800;
  color: #203e7b;
}

.kpi-note {
  margin-top: 3px;
  font-size: 11px;
  color: #6880a7;
}

.flight-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
sl-card.flight-card {
  display: block;
  width: 100%;
  padding: 0;
}
sl-card.flight-card::part(base) {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
sl-card.flight-card::part(body) {
  padding: 12px;
}
.flight-meta { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.price { font-size: 20px; font-weight: 800; }
.flight-options-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.option-flip {
  position: relative;
}
.option-flip .option-face {
  transition: transform 0.4s ease, opacity 0.35s ease;
  transform-origin: center;
}
.option-flip .option-back {
  display: none;
  opacity: 0;
  transform: rotateY(-90deg);
}
.option-flip.is-flipped .option-front {
  display: none;
}
.option-flip.is-flipped .option-back {
  display: block;
  opacity: 1;
  transform: rotateY(0deg);
}
.option-panel {
  display: block;
  width: 100%;
  padding: 0;
  position: relative;
  overflow: hidden;
}
.option-panel::part(body) { padding: 12px; }
.option-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, #81a8ff, #2f6fed);
}
.option-panel.best-option::part(base) { border: 2px solid #87a9ff; box-shadow: 0 8px 20px rgba(59, 99, 198, 0.12); }
.option-panel.option-front {
  box-shadow: 0 10px 24px rgba(30, 66, 127, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}
.option-panel.option-back {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.option-panel.option-front::part(base) {
  box-shadow: 0 10px 24px rgba(30, 66, 127, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}
.option-panel.option-back::part(base) {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.option-panel:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}
.option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.option-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.option-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.option-pill-1 {
  background: #e8f0ff;
  color: #1e40af;
  border: 1px solid #cbdafc;
}

.option-pill-2 {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

.option-pill-3 {
  background: #f3e8ff;
  color: #6d28d9;
  border: 1px solid #e9d5ff;
}

.option-index {
  font-size: 12px;
  color: #60729a;
  font-weight: 700;
}

.option-actions {
  display: flex;
  gap: 8px;
}
.option-actions .btn {
  padding: 7px 10px;
  font-size: 11px;
  border-radius: 8px;
}
.option-total {
  font-size: 22px;
  font-weight: 900;
  color: #183f8f;
}

.option-total-sub {
  font-size: 10px;
  color: #6b7fa5;
  font-weight: 700;
  margin-top: 1px;
}

.flight-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.summary-chip {
  border: 1px solid #cad9f4;
  border-radius: 999px;
  background: #f6faff;
  color: #35518a;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
}

.flight-card.detailed {
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid #d6e2f4;
  background: linear-gradient(180deg, #fcfdff 0%, #f7faff 100%);
}
.flight-card-compact {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 4px;
}
.flight-side {
  width: 28px;
  min-width: 28px;
  border-right: 1px solid #c5d4f0;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  background: linear-gradient(180deg, #e2ebfa 0%, #d6e0f6 100%);
  border-radius: 8px 0 0 8px;
  margin: -1px 0 -1px -1px;
  padding: 6px 4px 6px 6px;
}
.airline-logo {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d4e1f8;
  padding: 1px;
}
.airline-logo.fallback {
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  color: #2e58ab;
  background: #eaf2ff;
}
.flight-label {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 8px;
  font-weight: 800;
  color: #2c4a8a;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  padding: 3px 1px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.2;
  border: 1px solid rgba(197, 212, 240, 0.8);
}
.flight-main {
  min-width: 0;
}
.flight-main-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.flight-main-title {
  font-size: 13px;
  font-weight: 800;
  color: #1f3f7f;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.flight-times {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  margin: 4px 0 6px;
}
.flight-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
}
.route-line {
  width: 82px;
  border-top: 2px dashed #b6c7e5;
  margin: 4px 0;
}
.flight-time-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.airport-above {
  font-size: 11px;
  font-weight: 800;
  color: #21427f;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1px;
}

.time-strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.05;
}
.time-sub {
  color: var(--muted);
  font-size: 10px;
}
.time-date {
  font-size: 10px;
  color: #47618f;
  margin-top: 1px;
}
.flight-meta-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 6px 0 4px;
}
.chip {
  border: 1px solid #c9d8f2;
  color: #35518a;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 7px;
  background: #f5f9ff;
}
.cost-breakdown-full {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d6e2f4;
  border-radius: 12px;
  background: linear-gradient(180deg, #fafcff 0%, #f2f7ff 100%);
}

.cost-breakdown-header {
  font-size: 12px;
  font-weight: 800;
  color: #1e40af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.cost-section {
  margin-bottom: 10px;
}

.cost-section-title {
  font-size: 11px;
  font-weight: 800;
  color: #35518a;
  margin-bottom: 6px;
}

.cost-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 2px 0;
  gap: 12px;
}

.cost-line span:first-child,
.cost-line strong {
  color: #33425f;
}

.cost-line.cost-total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid var(--primary);
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

.cost-booking-links {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cost-booking-links .booking-link {
  font-size: 12px;
}

.booking-link {
  display: inline-block;
  margin: 2px 0;
  color: #2453b8;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.booking-link:hover { text-decoration: underline; }
.booking-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.booking-link.alt {
  color: #0a7b57;
}
.flight-compact-meta {
  font-size: 11px;
  color: #6f82a5;
  margin-top: 4px;
}
.flight-stops {
  margin-top: 2px;
  font-size: 10px;
  color: #5c7299;
}

.flight-num {
  font-size: 11px;
  font-weight: 600;
  color: #5c7299;
}

.chip-eco {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.leg-detail-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px dotted #e4ebf8;
}
.leg-detail-row:first-child {
  border-top: none;
  padding-top: 0;
}
.leg-detail-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.chip-tiny {
  font-size: 9px;
  font-weight: 700;
  color: #3a5286;
  background: #f0f4ff;
  border: 1px solid #d4e0f6;
  border-radius: 6px;
  padding: 1px 5px;
}
.leg-co2 {
  font-size: 9px;
  font-weight: 600;
  color: #065f46;
}
.leg-route {
  font-size: 9px;
  font-weight: 700;
  color: #1e3a6e;
  white-space: nowrap;
}
.leg-layover-row {
  font-size: 9px;
  font-weight: 600;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 2px 8px;
  margin: 2px 0;
}

.price-breakdown {
  margin-top: 10px;
  border-top: 1px dashed #c8d8f4;
  padding-top: 10px;
  display: none;
  gap: 6px;
}
.price-breakdown.force-visible {
  display: grid;
}

.option-panel.open-details .price-breakdown {
  display: grid;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #375284;
}

.breakdown-row.total {
  font-size: 13px;
  font-weight: 800;
  color: #1f3f7f;
}

.see-more-wrap {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

/* ── Chat Container ── */
.chat-container {
  max-height: 500px;
  overflow-y: auto;
  padding: 20px;
  background: linear-gradient(to bottom, #f9fafb, #ffffff);
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 12px;
  scroll-behavior: smooth;
}

/* ── Chat Messages ── */
.chat-message {
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  animation: chatSlideIn 0.3s ease-out;
}
@keyframes chatSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-message-user {
  flex-direction: row-reverse;
}
.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.avatar-user {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}
.avatar-assistant {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}
.chat-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 75%;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  line-height: 1.55;
  font-size: 13.5px;
}
.bubble-user {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.bubble-assistant {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

/* ── Welcome state ── */
.chat-welcome {
  text-align: center;
  padding: 32px 16px;
  color: #6b7280;
}
.chat-welcome-icon {
  font-size: 40px;
  margin-bottom: 8px;
}
.chat-welcome h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 6px;
}
.chat-welcome p {
  font-size: 13px;
  line-height: 1.5;
  max-width: 420px;
  margin: 0 auto;
}

/* ── Typing indicator ── */
.chat-typing {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}
.chat-typing.hidden { display: none; }
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  min-height: 20px;
}
.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ca3af;
  animation: typingDot 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ── Chat Input Form ── */
.chat-input-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: flex-end;
}
.chat-textarea {
  flex: 1;
  border: 2px solid #6366f1;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  resize: none;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 44px;
  max-height: 120px;
}
.chat-textarea:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.2);
}
.chat-send-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  color: white !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 10px 20px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.chat-send-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
  box-shadow: 0 6px 16px rgba(67, 56, 202, 0.35);
  transform: translateY(-1px);
}

/* ── Control bar ── */
.chat-control-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.chat-control-bar .btn-sm {
  font-size: 11px;
  padding: 5px 10px;
}

/* ── Command groups ── */
.cmd-groups-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.cmd-group {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
}
.cmd-group-label {
  font-size: 11px;
  font-weight: 800;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.cmd-group-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.btn-cmd {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.btn-cmd:hover {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4f46e5;
}

@media (max-width: 700px) {
  .chat-bubble { max-width: 90%; }
  .cmd-groups-wrap { grid-template-columns: 1fr; }
}

.muted { color: var(--muted); font-size: 13px; }

.empty-state {
  border: 1px dashed #c7d7f1;
  border-radius: 12px;
  background: #f7faff;
  color: #546c95;
  padding: 16px;
  text-align: center;
  font-weight: 600;
}

.quote-preview {
  margin-top: 12px;
  white-space: pre-wrap;
  overflow-x: auto;
  background: #f9fbff;
  border: 1px solid #d6e2f4;
}

.markdown-preview-rendered {
  white-space: normal;
  line-height: 1.55;
  color: #22324d;
}

.markdown-preview-rendered h1,
.markdown-preview-rendered h2,
.markdown-preview-rendered h3 {
  margin: 12px 0 8px;
  color: #1f3f7f;
}

.markdown-preview-rendered h1 { font-size: 22px; }
.markdown-preview-rendered h2 { font-size: 18px; }
.markdown-preview-rendered h3 { font-size: 15px; }

.markdown-preview-rendered p {
  margin: 6px 0;
}

.markdown-preview-rendered ul {
  margin: 6px 0 8px 20px;
  padding: 0;
}

.markdown-preview-rendered li {
  margin: 3px 0;
}

.markdown-preview-rendered hr {
  border: none;
  border-top: 1px solid #d4deef;
  margin: 12px 0;
}

.markdown-preview-rendered a {
  color: #2453b8;
  text-decoration: none;
  font-weight: 700;
}

.markdown-preview-rendered a:hover {
  text-decoration: underline;
}

.pdf-preview-canvas-wrap {
  display: grid;
  gap: 14px;
}

.pdf-preview-page {
  background: #ffffff;
  border: 1px solid #d9e3f2;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(19, 48, 96, 0.08);
}

.pdf-preview-page-label {
  font-size: 12px;
  font-weight: 800;
  color: #3a5286;
  margin-bottom: 8px;
}

.pdf-preview-canvas {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid #e4ebf8;
  border-radius: 6px;
}

.quote-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.quote-card {
  border: 1px solid #d6e2f4;
  border-radius: 14px;
  width: 100%;
  padding: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  overflow: hidden;
}
sl-card.quote-card::part(base) {
  border: 1px solid #d6e2f4;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  overflow: hidden;
}
sl-card.quote-card::part(body) {
  padding: 0;
}

.quote-card-recommended {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(47, 111, 237, 0.15);
}
sl-card.quote-card-recommended::part(base) {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(47, 111, 237, 0.15);
}

.quote-card-header {
  padding: 10px 12px;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.quote-card-badge {
  font-size: 11px;
  font-weight: 800;
  color: #dbeafe;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.quote-card-total {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 0;
}

.quote-card-body {
  padding: 12px;
}

.quote-leg-title {
  font-size: 12px;
  font-weight: 800;
  color: #1e3a8a;
  text-transform: uppercase;
  margin-top: 10px;
  margin-bottom: 6px;
}

.quote-leg-title:first-child {
  margin-top: 0;
}

.quote-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #334155;
  margin-top: 4px;
}

.quote-row strong {
  color: #0f172a;
  text-align: right;
}

.quote-cost-box {
  margin-top: 8px;
  border-radius: 8px;
  padding: 8px;
  background: #dbeafe;
}

.quote-cost-box .total-row {
  border-top: 2px solid #3b82f6;
  padding-top: 6px;
  margin-top: 4px;
}

.quote-cost-box .total-row strong {
  color: #1d4ed8;
}

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.readiness-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.readiness-list li {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.readiness-list li.ok {
  color: #1c7e47;
  background: #eefaf3;
  border: 1px solid #cbead9;
}

.readiness-list li.pending {
  color: #6d7b96;
  background: #f7faff;
  border: 1px solid #d7e2f4;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
}

th {
  font-weight: 700;
  background: #f8fbff;
}

.progress-panel {
  border-left: 4px solid var(--primary);
}

.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.progress-bar-track {
  flex: 1;
  height: 10px;
  background: #e2e8f4;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2f6fed, #163f97);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-bar-pct {
  font-size: 13px;
  font-weight: 800;
  color: #183f8f;
  min-width: 36px;
  text-align: right;
}
.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.progress-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.progress-actions .btn-danger {
  background: #feecec;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.progress-actions .btn-danger:hover {
  background: #fdd8d8;
}
.progress-logs-toggle {
  padding: 5px 10px !important;
  font-size: 11px !important;
  margin-bottom: 4px;
}
.progress-logs {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 11px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e2e8f4;
  border-radius: 8px;
  padding: 8px 8px 8px 24px;
  background: #f8fbff;
}
.progress-logs li {
  margin-bottom: 3px;
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 11px;
  color: #4a5f8a;
}

.progress-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.progress-steps {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.progress-steps li {
  margin-bottom: 4px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #cfd9ea;
  border-top-color: var(--primary);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1080px) {
  .flight-options-grid { grid-template-columns: repeat(2, 1fr); }
  .flight-card-compact { grid-template-columns: 28px minmax(0, 1fr); }
  .route-line { width: 70px; }
  .timeline-compact-item { min-width: 120px; }
  .overview-kpis { grid-template-columns: 1fr 1fr; }
  .quote-cards { grid-template-columns: 1fr 1fr; }
  .data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .container { padding: 12px 16px; }
  .header-content { gap: 10px; flex-direction: column; align-items: flex-start; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
  .grid-2 { grid-template-columns: 1fr; }
  .overview-kpis { grid-template-columns: 1fr; }
  .route-hero { flex-direction: column; align-items: flex-start; }
  .flight-options-grid { grid-template-columns: 1fr; }
  .timeline-compact-item { min-width: 0; flex: 1 1 100%; }
  .quote-cards { grid-template-columns: 1fr; }
  .data-grid { grid-template-columns: 1fr; }
  .option-actions { flex-direction: column; align-items: flex-end; }
  .flight-card-compact {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .flight-side {
    border-right: none;
    border-bottom: 1px solid #dce7fa;
    padding-right: 0;
    padding-bottom: 6px;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
  }
  .flight-label {
    writing-mode: horizontal-tb;
    transform: none;
    padding: 2px 6px;
  }
}
