:root {
  color-scheme: dark;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg: #05060b;
  --panel: rgba(6, 8, 15, 0.92);
  --accent: #00bcd4;
  --accent-strong: #0092a4;
  --border: rgba(255, 255, 255, 0.1);
  --text: #e5e7eb;
  --muted: #94a3b8;
}

* {
  box-sizing: border-box;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

img {
  max-width: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

.landing {
  position: relative;
  min-height: 100vh;
  padding: 4rem 6vw 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  overflow: hidden;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.landing.zoom-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.landing-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.landing-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(5, 6, 11, 0.75), rgba(5, 6, 11, 0.9));
}

.landing-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  filter: saturate(0.8);
}

.landing-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.hub-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 380px);
  grid-template-areas: "clients agent";
  gap: 2rem;
  margin-top: 2rem;
}

.clients-panel {
  grid-area: clients;
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 1.5rem;
  background: rgba(5, 6, 11, 0.55);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
}

.clients-panel .clients-grid {
  flex: 1;
}

.landing-agent-panel {
  grid-area: agent;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.25rem;
  background: rgba(3, 5, 12, 0.8);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.bubble--landing {
  font-size: 0.9rem;
  min-height: auto;
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.client-card {
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 1.2rem;
  background: rgba(10, 12, 20, 0.7);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.client-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 188, 212, 0.6);
}

.client-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.client-card .tagline {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.client-card h3 {
  margin: 0;
  font-size: 1.4rem;
}

.client-card .summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.client-card .chip {
  margin-top: 1rem;
  align-self: flex-start;
}

.detail {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.detail.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.pano-area {
  position: absolute;
  inset: 0;
}

#pano {
  position: absolute;
  inset: 0;
}

.pano-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  background: rgba(5, 6, 11, 0.92);
  z-index: 1;
}

.detail-overlay {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: 1.5rem;
  padding: 1.5rem 4vw 3rem;
  height: 100%;
  align-content: flex-start;
  pointer-events: none;
}

.detail-overlay > * {
  pointer-events: auto;
}

.panel-toggle {
  position: fixed;
  right: 1rem;
  top: calc(1rem + env(safe-area-inset-top, 0));
  bottom: auto;
  z-index: 25;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-weight: 600;
  background: rgba(3, 21, 25, 0.85);
  color: var(--text);
  cursor: pointer;
  display: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.panel-toggle.is-visible {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.back-btn {
  grid-column: 1 / -1;
  justify-self: flex-start;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  backdrop-filter: blur(10px);
}

.detail-meta {
  grid-column: 1 / 2;
  max-width: 520px;
}

.info-panel {
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  background: rgba(5, 6, 11, 0.65);
  backdrop-filter: blur(12px);
}

.client-tagline {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
}

.info-panel h2 {
  margin: 0;
  font-size: 1.8rem;
}

.client-description {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.side-panel {
  grid-column: 2 / 3;
  grid-row: 2 / span 2;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: rgba(5, 6, 11, 0.85);
  backdrop-filter: blur(14px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  min-width: 300px;
  max-width: 400px;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.route-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 1rem 1.1rem;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.route-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.route-status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.route-status.error {
  color: #ffb4a7;
}

.route-map {
  height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  overflow: hidden;
}

.route-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.route-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.route-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}

.route-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.agent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.agent img {
  width: 140px;
  margin: 0 auto;
}

.bubble {
  text-align: center;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  min-height: 64px;
  margin: 0;
}

.bubble.error {
  border-color: rgba(244, 67, 54, 0.8);
  color: #ffb4a7;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn {
  cursor: pointer;
  padding: 0.65rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition: background 0.2s ease;
}

.btn-small {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chip {
  cursor: pointer;
  border: none;
  background: rgba(0, 188, 212, 0.15);
  color: var(--text);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.chat-placeholder {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.chat-widget {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-widget__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.chat-widget__eyebrow {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.chat-widget small {
  color: var(--muted);
}

.chat-log {
  min-height: 180px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-right: 0.2rem;
}

.chat-message {
  border-radius: 1rem;
  padding: 0.65rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
  line-height: 1.4;
}

.chat-message--user {
  margin-left: auto;
  background: rgba(0, 188, 212, 0.15);
  border-color: rgba(0, 188, 212, 0.35);
}

.chat-message--status {
  font-size: 0.85rem;
  color: var(--muted);
  border-style: dashed;
}

.chat-input {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
}

.chat-input input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
}

.chat-input input:disabled {
  opacity: 0.4;
}

.chat-send,
.chat-mic {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.chat-send {
  background: var(--accent);
  color: #031519;
}

.chat-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.chat-mic {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.chat-mic[aria-pressed='true'] {
  background: #f44336;
  color: #fff;
}

.chat-mic:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.chat-mic-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.chat-widget--disabled {
  opacity: 0.6;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 0.9rem;
  background: rgba(0, 0, 0, 0.35);
}

.suggestion-chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.suggestion-chip:hover {
  background: rgba(255, 255, 255, 0.1);
}

.highlights {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.highlights li {
  position: relative;
  padding-left: 1.1rem;
}

.highlights li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}

@media (max-width: 1200px) {
  .detail-overlay {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-column: 1 / -1;
    grid-row: auto;
    max-width: none;
    max-height: none;
  }
}

@media (max-width: 900px) {
  .landing {
    padding: 3rem 2rem;
  }

  .hub-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "agent"
      "clients";
  }

  .clients-panel {
    min-height: auto;
  }

  .chat-log {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .landing {
    padding: 2.5rem 1.25rem;
  }

  .hub-layout {
    grid-template-columns: 1fr;
  }

  .detail {
    position: relative;
    height: auto;
    min-height: 100vh;
    overflow: hidden;
  }

  #pano,
  .pano-fallback {
    position: absolute;
    inset: 0;
  }

  .detail-overlay {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 9;
    padding: 1.5rem 1.25rem 2.75rem;
    background: linear-gradient(180deg, rgba(5, 6, 11, 0.98), rgba(5, 6, 11, 0.99));
    max-height: 75vh;
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
    box-shadow: 0 -20px 45px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    transition: transform 0.35s ease;
  }

  .detail-overlay.collapsed {
    transform: translateY(110%);
    pointer-events: none;
  }

  .side-panel {
    padding: 1.25rem;
    max-height: none;
    box-shadow: none;
  }

  .chat-input {
    grid-template-columns: auto 1fr;
  }

  .chat-send {
    width: 100%;
    grid-column: 1 / -1;
  }

  .back-btn {
    justify-self: stretch;
  }
}
