:root {
  --bg: #0a0e14;
  --bg-elevated: #121826;
  --surface: #161d2c;
  --surface-2: #1c2638;
  --border: #2a3548;
  --border-bright: #3d4f6a;
  --text: #eef3fa;
  --muted: #8b9cb8;
  --accent: #4d9fff;
  --accent-soft: rgba(77, 159, 255, 0.15);
  --seat-a: #22c55e;
  --seat-b: #a78bfa;
  --band-5: rgba(34, 197, 94, 0.45);
  --band-8: rgba(234, 179, 8, 0.45);
  --band-11: rgba(249, 115, 22, 0.45);
  --danger: #f87171;
  --booked: #64748b;
  --radius: 12px;
  --fuselage: linear-gradient(180deg, #1a2334 0%, #141c2b 40%, #121a28 100%);
  font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  padding: 1.25rem 1rem 2.5rem;
}

.app-header {
  max-width: 1200px;
  margin: 0 auto 1.25rem;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(77, 159, 255, 0.25);
}

.app-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 42rem;
}

.app-body {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 960px) {
  .app-body {
    grid-template-columns: minmax(280px, 320px) 1fr;
    align-items: start;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}

.card-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.85rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem 0.85rem;
}

.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.span-all {
  grid-column: 1 / -1;
}

.tight-top {
  margin-top: 0.5rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input,
select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.5rem 0.65rem;
  font-size: 0.9rem;
  font-family: inherit;
}

input:focus,
select:focus {
  outline: 2px solid rgba(77, 159, 255, 0.4);
  border-color: var(--accent);
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

button:hover:not(:disabled) {
  filter: brightness(1.06);
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface-2);
  border: 1px solid var(--border-bright);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.status {
  font-size: 0.8rem;
  color: var(--muted);
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.65rem;
  line-height: 1.45;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 1.1rem 0;
}

.assign-toggle {
  display: flex;
  gap: 0.5rem;
}

.radio-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.radio-pill:has(:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.radio-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.proximity-badge {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
}

.proximity-badge.band-5 {
  border-color: rgba(34, 197, 94, 0.5);
  color: #86efac;
}

.proximity-badge.band-8 {
  border-color: rgba(234, 179, 8, 0.5);
  color: #fde047;
}

.proximity-badge.band-11 {
  border-color: rgba(249, 115, 22, 0.5);
  color: #fdba74;
}

.proximity-badge.error {
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--danger);
}

.raw-json {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.raw-json summary {
  cursor: pointer;
  user-select: none;
}

.out {
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.72rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

.error {
  color: var(--danger);
}

/* —— Map panel —— */
.map-panel {
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.map-panel-head {
  margin-bottom: 0.75rem;
}

.map-panel-head .card-title {
  margin-bottom: 0.25rem;
}

.map-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.map-view-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding: 0.25rem;
  background: var(--bg-elevated);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.map-tab {
  flex: 1;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.map-tab:hover {
  color: var(--text);
}

.map-tab.is-active {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.map-embed-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  align-items: flex-end;
  margin-bottom: 0.85rem;
}

.toolbar-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.toolbar-select {
  min-width: 140px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  font-family: inherit;
}

.toolbar-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-left: auto;
  align-self: center;
}

.toolbar-link:hover {
  text-decoration: underline;
}

.map-view-pane.is-hidden {
  display: none !important;
}

.iframe-shell {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-bright);
  background: #12161c;
  min-height: min(82vh, 880px);
}

.seatmap-iframe {
  display: block;
  width: 100%;
  height: min(82vh, 880px);
  border: none;
  background: #e8ecf2;
}

.seatmap-placeholder--iframe {
  min-height: min(82vh, 880px);
}

.iframe-shell .seatmap-placeholder--iframe.is-hidden {
  display: none;
}

.iframe-footnote {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0.75rem 0 0;
  line-height: 1.5;
}

.iframe-footnote a {
  color: var(--accent);
}

.iframe-footnote code {
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--bg-elevated);
}

.mono {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
}

.seatmap-mount {
  flex: 1;
  min-height: 360px;
}

.seatmap-placeholder {
  height: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.seatmap-placeholder p {
  margin: 0;
  max-width: 280px;
  line-height: 1.55;
}

/* —— Seat map renderer —— */
.seatmap-root {
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.seatmap-aircraft-header {
  text-align: center;
  margin-bottom: 1rem;
}

.seatmap-aircraft-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.seatmap-aircraft-route {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.2rem;
}

.seatmap-aircraft-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.seatmap-fuselage-scroll {
  max-height: min(72vh, 720px);
  overflow: auto;
  padding: 0.25rem;
  border-radius: 20px;
  background: linear-gradient(180deg, #0d121c, #0a0e14);
  border: 1px solid var(--border);
}

.seatmap-fuselage {
  position: relative;
  padding: 2.25rem 1.25rem 2.5rem;
  border-radius: 20px;
  background: var(--fuselage);
  border: 1px solid var(--border-bright);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 50px rgba(0, 0, 0, 0.45);
}

.seatmap-fuselage::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.35rem;
  transform: translateX(-50%);
  width: 18%;
  height: 10px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #2a3548, #1a2334);
  opacity: 0.85;
}

.seatmap-deck {
  margin-bottom: 1.5rem;
}

.seatmap-deck:last-child {
  margin-bottom: 0;
}

.seatmap-deck-head {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.seatmap-deck-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.seatmap-deck-sub {
  font-size: 0.68rem;
  color: var(--muted);
  opacity: 0.8;
}

.seatmap-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.28rem;
}

.seatmap-row-num {
  width: 1.65rem;
  flex-shrink: 0;
  text-align: right;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.seatmap-row-strip {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.12rem;
  min-height: 34px;
}

.seatmap-seat {
  --seat-fill: #3d5a80;
  appearance: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  background: var(--seat-fill);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    outline 0.12s ease;
}

.seatmap-seat:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  z-index: 1;
}

.seatmap-seat:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.seatmap-seat-letter {
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.seatmap-seat.is-a {
  border-color: var(--seat-a);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 12px rgba(34, 197, 94, 0.35),
    0 2px 0 rgba(0, 0, 0, 0.2);
}

.seatmap-seat.is-b {
  border-color: var(--seat-b);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 12px rgba(167, 139, 250, 0.35),
    0 2px 0 rgba(0, 0, 0, 0.2);
}

.seatmap-seat.is-a.is-b {
  border-color: #fff;
  box-shadow:
    0 0 0 2px var(--seat-a),
    0 0 0 4px var(--seat-b),
    0 2px 0 rgba(0, 0, 0, 0.2);
}

.seatmap-seat.band-5 {
  box-shadow:
    0 0 0 2px rgba(34, 197, 94, 0.85),
    0 0 24px rgba(34, 197, 94, 0.35),
    0 2px 0 rgba(0, 0, 0, 0.2);
}

.seatmap-seat.band-8 {
  box-shadow:
    0 0 0 2px rgba(234, 179, 8, 0.85),
    0 0 24px rgba(234, 179, 8, 0.3),
    0 2px 0 rgba(0, 0, 0, 0.2);
}

.seatmap-seat.band-11 {
  box-shadow:
    0 0 0 2px rgba(249, 115, 22, 0.85),
    0 0 24px rgba(249, 115, 22, 0.3),
    0 2px 0 rgba(0, 0, 0, 0.2);
}

.seatmap-seat.is-focus-target {
  outline: 2px dashed rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.seatmap-seat.is-booked {
  --seat-fill: var(--booked);
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  position: relative;
}

.seatmap-seat.is-booked::after {
  content: '✕';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.seatmap-seat.is-booked:hover {
  transform: none;
  box-shadow: none;
}

.seatmap-aisle {
  width: 10px;
  flex-shrink: 0;
  height: 22px;
  border-radius: 3px;
  background: repeating-linear-gradient(
    180deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.04) 2px,
    rgba(255, 255, 255, 0.04) 4px
  );
  margin: 0 0.08rem;
}

.seatmap-gap {
  width: 8px;
  flex-shrink: 0;
}

.seatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.seatmap-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.seatmap-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.dot-a {
  background: var(--seat-a);
}

.dot-b {
  background: var(--seat-b);
}

.dot-band {
  background: linear-gradient(90deg, #22c55e, #eab308, #f97316);
}

.dot-booked {
  background: var(--booked);
}

.person-card {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-top: 0.75rem;
}

.person-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.person-title {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.person-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.person-pill--a {
  border-color: rgba(34, 197, 94, 0.35);
}

.person-pill--b {
  border-color: rgba(167, 139, 250, 0.35);
}

.map-view-hint {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* --- Help Provider Enhancements --- */

.seatmap-seat.is-help-provider {
  --seat-fill: #3b82f6 !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5), 0 2px 0 rgba(0, 0, 0, 0.2) !important;
  animation: pulse-glow-v 2s infinite alternate;
}

@keyframes pulse-glow-v {
  from { box-shadow: 0 0 5px rgba(59, 130, 246, 0.3), 0 2px 0 rgba(0, 0, 0, 0.2); }
  to { box-shadow: 0 0 15px rgba(59, 130, 246, 0.7), 0 2px 0 rgba(0, 0, 0, 0.2); }
}

.dot-help {
  background: #3b82f6;
  box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
}

.help-tooltip-vanilla {
  position: absolute;
  z-index: 10000;
  background: #ffffff;
  color: #1e293b;
  width: 260px;
  border-radius: 14px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  pointer-events: none;
  font-family: 'DM Sans', sans-serif;
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.help-tooltip-vanilla.is-hidden {
  opacity: 0;
  transform: translateY(5px);
  pointer-events: none;
}

.v-tooltip-header {
  height: 40px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.v-tooltip-body {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: -25px;
}

.v-tooltip-avatar-wrap {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid #fff;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 8px;
  background: #f1f5f9;
}

.v-tooltip-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v-tooltip-name {
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
}

.v-tooltip-verified {
  color: #3b82f6;
  font-size: 0.8rem;
  margin-left: 2px;
}

.v-tooltip-rating {
  color: #f59e0b;
  font-weight: 600;
  font-size: 0.85rem;
  margin: 4px 0 12px;
}

.v-tooltip-contact {
  width: 100%;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: #64748b;
  text-align: left;
}

.v-tooltip-contact div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v-tooltip-contact span {
  color: #3b82f6;
  font-weight: bold;
}
