:root {
  --bg: #040912;
  --bg-2: #07101d;
  --panel: rgba(8, 15, 29, 0.9);
  --panel-2: rgba(11, 20, 38, 0.9);
  --line: rgba(84, 120, 255, 0.18);
  --line-strong: rgba(84, 120, 255, 0.34);
  --accent: #7aa9ff;
  --accent-2: #35dbff;
  --accent-3: #f97316;
  --text: #eef5ff;
  --muted: #90a8d0;
  --success: #22c55e;
  --danger: #f43f5e;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(122, 169, 255, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

#helixCanvas,
#helixCanvasSecondary {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#helixCanvasSecondary {
  opacity: 0.9;
  mix-blend-mode: screen;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100vw - 24px));
  min-height: calc(100vh - 24px);
  margin: 12px auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 290px;
  gap: 18px;
}

.side-panel,
.chat-panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.side-panel {
  padding: 22px;
}

.left-panel,
.right-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: calc(100vh - 24px);
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(53, 219, 255, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(7, 12, 24, 0.98), rgba(5, 9, 18, 0.96));
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-family: "Outfit", sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
}

.eyebrow,
.card-label,
.message-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow,
.card-label {
  color: var(--accent-2);
}

.brand-lockup h1,
.chat-header h2,
.info-card strong {
  margin: 0;
  font-family: "Outfit", sans-serif;
  letter-spacing: -0.04em;
}

.brand-lockup h1 {
  font-size: 34px;
}

.side-copy,
.chat-header p,
.info-card p,
.composer-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.primary-btn,
.ghost-btn,
.suggestion-chip {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.primary-btn:hover,
.ghost-btn:hover,
.suggestion-chip:hover {
  transform: translateY(-1px);
}

.primary-btn {
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 700;
  color: #03111f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 30px rgba(53, 219, 255, 0.18);
}

.ghost-btn {
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.ghost-btn:disabled,
.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.info-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

.glow-card {
  background:
    radial-gradient(circle at top right, rgba(53, 219, 255, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

.info-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.mini-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--muted);
}

.metric-row:last-child {
  border-bottom: 0;
}

.metric-row strong {
  margin-top: 0;
  font-size: 15px;
  letter-spacing: 0;
  font-family: "Inter", sans-serif;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.chat-header h2 {
  margin-top: 6px;
  font-size: clamp(30px, 4vw, 44px);
}

.status-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(84, 120, 255, 0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 24px 0;
}

.suggestion-chip {
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.suggestion-chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.chat-history {
  padding: 18px 24px 24px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
}

.empty-state {
  padding: 26px;
  border-radius: 24px;
  border: 1px dashed var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--muted);
}

.message {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.message-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: "Outfit", sans-serif;
  font-size: 14px;
  font-weight: 800;
  background: rgba(84, 120, 255, 0.16);
  border: 1px solid rgba(84, 120, 255, 0.22);
}

.message.user .message-badge {
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(249, 115, 22, 0.22);
}

.message-card {
  min-width: 0;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.message.user .message-card {
  background: rgba(249,115,22,0.08);
  border-color: rgba(249,115,22,0.16);
}

.message-head {
  color: var(--muted);
  margin-bottom: 10px;
}

.message-body {
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.message-body p {
  margin: 0 0 12px;
}

.message-body p:last-child {
  margin-bottom: 0;
}

.message-body ul,
.message-body ol {
  margin: 0 0 12px;
  padding-left: 20px;
}

.message-body li {
  margin-bottom: 6px;
}

.message-body pre {
  margin: 12px 0;
  padding: 14px;
  border-radius: 16px;
  overflow-x: auto;
  background: rgba(0,0,0,0.26);
  border: 1px solid rgba(255,255,255,0.06);
}

.message-body code {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.93em;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: blink 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 120ms;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.composer {
  padding: 18px 24px 24px;
  border-top: 1px solid rgba(255,255,255,0.04);
  background: rgba(4, 9, 18, 0.88);
}

.composer textarea {
  width: 100%;
  min-height: 58px;
  max-height: 180px;
  resize: none;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font: inherit;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.composer textarea:focus {
  border-color: var(--line-strong);
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

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

@media (max-width: 1220px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .left-panel,
  .right-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-panel {
    min-height: 70vh;
  }
}

@media (max-width: 800px) {
  .app-shell {
    width: min(1480px, calc(100vw - 14px));
    margin: 7px auto;
    min-height: calc(100vh - 14px);
  }

  .left-panel,
  .right-panel {
    grid-template-columns: 1fr;
  }

  .chat-header,
  .composer-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-cluster {
    justify-content: flex-start;
  }

  .suggestions {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
  }

  .suggestion-chip {
    white-space: nowrap;
  }
}
