:root {
  --bg-1: #050505;
  --bg-2: #1a1a1a;
  --ink: #15202b;
  --ink-muted: #3e556b;
  --panel: rgba(255, 255, 255, 0.76);
  --accent: #bf5a36;
  --accent-2: #1f5f5b;
  --border: rgba(21, 32, 43, 0.12);
  --shadow: 0 16px 38px rgba(15, 32, 46, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 8% 12%, #2b2b2b 0%, transparent 28%),
    radial-gradient(circle at 88% 8%, #1f1f1f 0%, transparent 30%),
    linear-gradient(130deg, var(--bg-1), var(--bg-2));
  overscroll-behavior-y: none;
}

.app-shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  display: grid;
  gap: 4px;
  grid-template-rows: auto minmax(0, 1fr);
}

.hero {
  padding: 18px 4px 4px 4px;  
  color: #f3f4f6;
  animation: reveal 420ms ease-out both;
}

.kicker {
  margin: 0 0 6px 0;
  color: #f3f4f6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero-link {
  color: inherit;
  text-decoration: none;
}

.hero-link:hover,
.hero-link:focus-visible {
  text-decoration: underline;
}

.hero h1 {
  margin: 8px 0 4px;
  font-family: "Fraunces", "Georgia", serif;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.05;
}

.subtitle {  
  margin: 0;
  color: #f3f4f6;
  max-width: 68ch;
}

.chat-panel {
  background: var(--panel);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 12px;
  animation: reveal 560ms ease-out both;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.3));
}

.chat-header.session-hidden {
  justify-content: flex-end;
}

.label {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.chat-header h2 {
  margin: 2px 0 0;
  font-size: 1rem;
}

#restartBtn {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(120deg, #1a1a1a, #0b0b0b 55%, #050505);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

#restartBtn:hover {
  filter: brightness(1.04);
}

.webchat-frame {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.starters {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.24));
}

.starters-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.starters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.starter-btn {
  border: 1px solid rgba(31, 95, 91, 0.26);
  background: rgba(235, 247, 246, 0.8);
  color: #0e3f3c;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.starter-btn:hover {
  background: rgba(213, 240, 238, 0.92);
  border-color: rgba(31, 95, 91, 0.42);
  transform: translateY(-1px);
}

.starter-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.webchat-host {
  flex: 1;
  min-height: 0;
  width: 100%;
}

.typing-indicator {
  margin: 12px 12px 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* .typing-indicator {
  margin: 12px 12px 0;
  padding: 10px 14px;
  border: 1px solid rgba(31, 95, 91, 0.16);
  border-radius: 16px 16px 16px 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 247, 246, 0.98));
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 20px rgba(15, 32, 46, 0.07);
} */

.typing-indicator__text {
  min-height: 1.2em;
  line-height: 1.35;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .app-shell {
    padding-top: max(14px, env(safe-area-inset-top));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-left: max(10px, env(safe-area-inset-left));
    gap: 8px;
  }

  .hero {
    padding-top: 10px;
    padding-right: 2px;
    padding-bottom: 0;
    padding-left: 2px;
  }

  .subtitle {
    max-width: none;
    font-size: 0.98rem;
    line-height: 1.45;
  }

  .chat-panel {
    margin-bottom: 0;
    border-radius: 18px;
  }

  .chat-header {
    padding: 10px 12px;
  }

  .webchat-frame {
    min-height: 0;
  }

  .webchat-host {
    min-height: 0;
  }

  .starters {
    padding: 10px 10px 8px;
  }

  .starters-list {
    gap: 6px;
  }

  .starter-btn {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .typing-indicator {
    margin: 10px 10px 0;
    padding: 9px 12px;
    font-size: 0.86rem;
  }
}
