:root {
  --bg: #eef6f2;
  --bg-2: #f8fbf9;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: #ffffff;
  --text: #17312a;
  --muted: #61766f;
  --line: rgba(23, 49, 42, 0.1);
  --mint: #62d3ac;
  --mint-deep: #15795b;
  --sand: #f2e4c8;
  --shadow: 0 24px 60px rgba(36, 68, 59, 0.12);
  --radius: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Fraunces", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(98, 211, 172, 0.2), transparent 24%),
    radial-gradient(circle at top left, rgba(242, 228, 200, 0.28), transparent 20%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

button,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #162f2a, #62d3ac);
  color: #fff;
  font-weight: 800;
}

.brand-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.brand-subtitle,
.thread-meta,
.sidebar-label,
.eyebrow,
.stat-label,
.message-meta,
.inspector-label,
.composer-hint {
  color: var(--muted);
}

.brand-subtitle,
.sidebar-label,
.eyebrow,
.stat-label,
.inspector-label,
.composer-hint {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
}

.new-chat-btn,
.ghost-btn,
.primary-btn,
.send-btn {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.new-chat-btn:hover,
.ghost-btn:hover,
.primary-btn:hover,
.send-btn:hover {
  transform: translateY(-1px);
}

.new-chat-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  background: #17312a;
  color: #fff;
  font-weight: 700;
  margin-bottom: 18px;
}

.thread-list {
  display: grid;
  gap: 8px;
}

.thread {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  text-align: left;
  color: inherit;
}

.thread.active {
  background: rgba(255, 255, 255, 0.65);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.thread-title {
  font-weight: 700;
}

.sidebar-card {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
}

.sidebar-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.workspace {
  padding: 28px 30px 34px;
}

.topbar,
.hero-panel,
.composer,
.inspector-card,
.bubble {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.topbar h1,
.hero-panel h2 {
  margin: 8px 0 0;
  letter-spacing: -0.05em;
}

.topbar h1 {
  font-size: 2.5rem;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ghost-btn {
  padding: 12px 16px;
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.6);
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.58));
}

.hero-panel h2 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 0.95;
}

.hero-panel p {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  min-width: 380px;
}

.stat-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.3rem;
}

.stat-card.accent {
  background: linear-gradient(135deg, rgba(98, 211, 172, 0.34), rgba(242, 228, 200, 0.78));
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  margin-top: 18px;
}

.conversation {
  display: grid;
  gap: 16px;
}

.message {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #17312a;
  color: #fff;
  font-weight: 800;
}

.user-avatar {
  background: #dbc292;
  color: #17312a;
}

.bubble {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
}

.bubble p {
  margin: 8px 0 0;
  line-height: 1.65;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(98, 211, 172, 0.18);
  color: var(--mint-deep);
  font-size: 0.88rem;
  font-weight: 700;
}

.inspector {
  display: grid;
  gap: 12px;
}

.inspector-card {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.inspector-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.context-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.composer {
  margin-top: 18px;
  padding: 18px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.8);
}

.composer textarea {
  width: 100%;
  min-height: 128px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

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

.send-btn,
.primary-btn {
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 700;
}

.send-btn,
.primary-btn {
  background: #17312a;
  color: #fff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 22, 19, 0.42);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(460px, 100%);
  padding: 26px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(98, 211, 172, 0.2);
  color: var(--mint-deep);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.modal h2 {
  margin: 14px 0 10px;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.modal p {
  margin: 0;
  color: var(--muted);
}

.modal-error {
  min-height: 18px;
  margin: 16px 0;
  color: #ad4333;
  font-weight: 700;
}

.modal-actions {
  display: grid;
  gap: 10px;
}

.full-width {
  width: 100%;
}

@media (max-width: 1080px) {
  .app-shell,
  .chat-layout,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-stats {
    min-width: 0;
  }
}

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

  .workspace {
    padding: 16px;
  }

  .hero-stats,
  .topbar-actions,
  .composer-actions {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    display: grid;
  }

  .topbar h1 {
    font-size: 2rem;
  }
}
