* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #1C1917;
  color: #F5F0EB;
  font-family: 'DM Sans', system-ui, sans-serif;
  height: 100vh;
  overflow: hidden;
}

.cue-root {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 180px;
  border-right: 0.5px solid #2E2B29;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  flex-shrink: 0;
}

.sidebar-item {
  padding: 9px 20px;
  font-size: 13px;
  color: #8B7E74;
  cursor: pointer;
  transition: color 0.15s;
}

.sidebar-item:hover { color: #F5F0EB; }
.sidebar-item.disabled { color: #2E2B29; cursor: default; }

/* Main */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Topbar */
.topbar {
  height: 44px;
  border-bottom: 0.5px solid #2E2B29;
  display: flex;
  align-items: center;
  padding: 0 20px;
  flex-shrink: 0;
  position: relative;
}

.ctx-pills {
  display: flex;
  gap: 6px;
}

.ctx-pill {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #242120;
  border: 0.5px solid #2E2B29;
  cursor: pointer;
  transition: border-color 0.15s;
  user-select: none;
}

.ctx-pill:hover { border-color: #D97757; }
.ctx-pill.active { border-color: #D97757; }

.pill-label { color: #5C5550; }
.pill-value { color: #E8B4A0; margin-left: 4px; }
.pill-value.empty { color: #3D3937; }

.session-name {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #3D3937;
  font-family: 'DM Mono', monospace;
  pointer-events: none;
}

/* Dropdown */
.ctx-dropdown {
  position: absolute;
  top: 44px;
  left: 20px;
  width: 220px;
  background: #242120;
  border: 0.5px solid #3D3937;
  border-radius: 8px;
  z-index: 100;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.ctx-dropdown.hidden { display: none; }

.ctx-search {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 0.5px solid #2E2B29;
  padding: 10px 12px;
  color: #F5F0EB;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  outline: none;
}

.ctx-search::placeholder { color: #5C5550; }

.ctx-options { max-height: 200px; overflow-y: auto; }

.ctx-option {
  padding: 9px 12px;
  font-size: 13px;
  color: #8B7E74;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.ctx-option:hover { background: #2E2B29; color: #F5F0EB; }

/* Empty state */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.empty-state.hidden { display: none; }

.orb-wrap {
  width: 72px;
  height: 72px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-glow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #E8A080 0%, #D97757 40%, #B5613E 70%, #8B4A30 100%);
  animation: breathe 3.5s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

.orb-halo {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,119,87,0.15) 0%, transparent 70%);
  animation: breathe 3.5s ease-in-out infinite;
  z-index: 1;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.12); opacity: 1; }
}

.welcome-text { text-align: center; }
.welcome-text h2 { font-size: 20px; font-weight: 500; color: #F5F0EB; margin-bottom: 6px; }
.welcome-text p { font-size: 13px; color: #5C5550; }

/* Chat */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat.hidden { display: none; }

.msg {
  max-width: 600px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.msg.user {
  align-self: flex-end;
  background: #2E2B29;
  border-radius: 10px 10px 2px 10px;
}

.msg.ai {
  align-self: flex-start;
  background: #242120;
  border-radius: 10px 10px 10px 2px;
  border: 0.5px solid #2E2B29;
  color: #E8B4A0;
}

/* Bottom */
.bottom-area {
  padding: 12px 20px 20px;
  border-top: 0.5px solid #2E2B29;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.suggestions-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.suggestion-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  flex: 1;
}

.suggestion-card {
  background: #242120;
  border: 0.5px solid #2E2B29;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.suggestion-card:hover { border-color: #D97757; background: #292524; }

.s-title {
  font-size: 12px;
  color: #E8B4A0;
  font-weight: 500;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s-sub {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: #5C5550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.refresh-btn {
  background: transparent;
  border: 0.5px solid #2E2B29;
  border-radius: 6px;
  padding: 0 12px;
  color: #5C5550;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.refresh-btn:hover { color: #8B7E74; border-color: #3D3937; }

.input-row {
  display: flex;
  gap: 8px;
}

.main-input {
  flex: 1;
  background: #242120;
  border: 0.5px solid #2E2B29;
  border-radius: 8px;
  padding: 10px 14px;
  color: #F5F0EB;
  font-size: 14px;
  font-family: 'DM Sans', system-ui, sans-serif;
  outline: none;
  transition: border-color 0.15s;
}

.main-input::placeholder { color: #3D3937; }
.main-input:focus { border-color: #D97757; }

.send-btn {
  width: 38px;
  height: 38px;
  background: #D97757;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.send-btn:hover { opacity: 0.85; }
.send-btn svg { width: 16px; height: 16px; }

/* Visuals */
.visual-card {
  margin-top: 12px;
  background: #1C1917;
  border: 1px solid #2E2B29;
  border-radius: 8px;
  padding: 12px 12px 8px 12px;
  overflow: hidden;
}

.visual-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #5C5550;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.band-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.band-row {
  display: flex;
  gap: 12px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #8B7E74;
}

.band-freq { color: #E8B4A0; min-width: 60px; }
.band-gain { color: #D97757; min-width: 55px; }
.band-q { min-width: 40px; }
.band-type { color: #5C5550; }

.bullet-line {
  padding: 3px 0;
  line-height: 1.6;
  color: #9B8E86;
  font-size: 13px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2E2B29; border-radius: 2px; }

.val {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #D97757;
}

.ai-heading {
  font-weight: 500;
  color: #F5F0EB;
  margin-bottom: 6px;
}

.feedback-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.thumb-btn {
  background: none;
  border: 1px solid #2E2B29;
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.4;
  transition: opacity 0.2s, border-color 0.2s;
}

.thumb-btn:hover {
  opacity: 0.8;
}

.thumb-btn.active {
  opacity: 1;
  border-color: #D97757;
}

.orb-wrap.small {
  position: relative;
  width: 24px;
  height: 24px;
}

.orb-wrap.small .orb-halo {
  width: 24px;
  height: 24px;
}

.orb-wrap.small .orb-glow {
  width: 14px;
  height: 14px;
}

.orb-wrap.small::before,
.orb-wrap.small::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #D97757;
  opacity: 0;
  animation: sonar 2s ease-out infinite;
}

.orb-wrap.small::after {
  animation-delay: 1s;
}

@keyframes sonar {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

.msg.ai strong {
  font-weight: 500;
  color: #E8B4A0;
}

.ai-bold {
  font-weight: 500;
  color: #E8B4A0;
}

.sidebar-item a, a.sidebar-item {
  text-decoration: none;
  color: inherit;
  display: block;
}

.takeover-statement {
  margin-top: 64px;
  padding: 64px 48px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.takeover-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--coral);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.takeover-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--off-white);
  margin-bottom: 20px;
}

.takeover-sub {
  font-size: 16px;
  color: var(--peach);
  font-weight: 300;
}

.ai-heading {
  display: none;
}

.intro-line {
  color: #F5F0EB;
  font-weight: 500;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.bullet-line .val {
  color: #E8B4A0;
}

.msg.ai .intro-line + .bullet-line {
  border-top: 0.5px solid #2A2724;
  padding-top: 8px;
  margin-top: 2px;
}

.sidebar-logo {
  padding: 0px 16px 4px;
}

@media (max-width: 600px) {
  .sidebar {
    display: none;
  }

  .suggestion-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .ctx-pills {
    gap: 4px;
    overflow-x: auto;
  }

  .ctx-pill {
    flex-shrink: 0;
  }
}

.topbar-logo-mobile {
  display: none;
}

@media (max-width: 600px) {
  .sidebar {
    display: none;
  }

  .topbar-logo-mobile {
    display: block;
    width: 32px;
    height: auto;
    margin-right: 10px;
    flex-shrink: 0;
  }

  .suggestion-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .ctx-pills {
    gap: 4px;
    overflow-x: auto;
  }

  .ctx-pill {
    flex-shrink: 0;
  }
}

@media (max-width: 600px) {
  .empty-state {
    gap: 12px;
  }

  .orb-wrap {
    width: 52px;
    height: 52px;
  }

  .orb-glow {
    width: 32px;
    height: 32px;
  }

  .orb-halo {
    width: 52px;
    height: 52px;
  }

  .welcome-text h2 {
    font-size: 16px;
  }

  .welcome-text p {
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  body {
    height: 100dvh;
  }

  .cue-root {
    height: 100dvh;
  }
}

@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg.ai {
  animation: msgFadeIn 0.45s ease forwards;
}
