:root {
  color-scheme: dark;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bg-gradient: radial-gradient(circle at top left, #1a1a1a, #080808 40%, #000000 80%),
    linear-gradient(160deg, rgba(255, 0, 76, 0.5), rgba(255, 0, 0, 0.2));
  --panel-bg: rgba(15, 15, 15, 0.75);
  --panel-border: rgba(255, 255, 255, 0.1);
  --accent: #ff2d55;
  --accent-soft: rgba(255, 45, 85, 0.18);
  --text-primary: #f5f5f5;
  --text-secondary: rgba(229, 229, 229, 0.72);
  --gray-700: rgba(255, 255, 255, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text-primary);
  background: var(--bg-gradient);
  background-attachment: fixed;
}

body {
  display: flex;
  justify-content: center;
  padding: 2.5rem 1.5rem 1.5rem;
}

.app-shell {
  width: min(960px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
}

.logo-circle {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  font-weight: 600;
}

.app-header p {
  margin: 0.25rem 0 0;
  color: var(--text-secondary);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 1.75rem;
  border-radius: 22px;
  border: 1px solid var(--panel-border);
  background: rgba(8, 8, 8, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 48px rgba(0, 0, 0, 0.35);
  min-height: 560px;
}

.chat-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.session-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.session-hint {
  margin: 0;
  color: rgba(229, 229, 229, 0.6);
  font-size: 0.85rem;
}

.status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  display: inline-block;
  background: var(--gray-700);
  transition: background 0.25s ease;
}

.status-dot[data-status='connected'] {
  background: #30d158;
}

.status-dot[data-status='error'] {
  background: #ff453a;
}

.starter-prompts {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(16, 16, 16, 0.85);
  padding: 1rem 1.25rem;
}

.starter-prompts h2 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.prompt-hint {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: rgba(229, 229, 229, 0.6);
}

.prompt-feedback {
  min-height: 1.25rem;
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--accent);
}

.starter-prompts ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}


.starter-prompts li {
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.starter-prompts li:hover,
.starter-prompts li:focus-visible {
  background: rgba(255, 45, 85, 0.2);
  transform: translateY(-1px);
}

.chatkit-host {
  flex: 1;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 12, 0.68);
  padding: 0.5rem;
  min-height: 320px;
  display: flex;
}

.chatkit-host > * {
  flex: 1;
}

.chatkit-surface {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}

.chatkit-fallback {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.45);
  color: rgba(235, 235, 235, 0.78);
  font-size: 0.95rem;
  line-height: 1.4;
}

.app-footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding-bottom: 1rem;
}

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

@media (max-width: 768px) {
  body {
    padding: 1.5rem 1rem 1rem;
  }

  .app-shell {
    gap: 1.25rem;
  }

  .chat-panel {
    padding: 1.25rem;
  }

  .starter-prompts ul {
    flex-direction: column;
  }

  .chatkit-host {
    min-height: 420px;
  }
}
