:root {
  color-scheme: light;
  --ink: #1f2a2e;
  --muted: #5b6b6a;
  --green-700: #2f7d33;
  --green-600: #3c8f3f;
  --green-200: #e1f0e3;
  --green-100: #f3f9f3;
  --surface: #ffffff;
  --shadow: 0 10px 30px rgba(35, 60, 46, 0.12);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

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

body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #f5fbf1 0%, #f7faf5 35%, #f4f7f4 100%);
  min-height: 100vh;
}

.page {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  gap: 24px;
  padding: 28px 32px;
  background-image: linear-gradient(135deg, rgba(47, 125, 51, 0.06), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(47, 125, 51, 0.08), transparent 45%);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 10px 0;
}

.brand-block {
  padding: 0 6px;
}

.btn {
  font: inherit;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 14px 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.full {
  width: 100%;
  justify-content: center;
}

.btn.primary {
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  color: #fff;
  box-shadow: var(--shadow);
}

.btn.primary:hover {
  transform: translateY(-1px);
}

.icon {
  font-weight: 700;
  font-size: 18px;
}

.history {
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.history-item {
  background: transparent;
  border: none;
  text-align: left;
  font: inherit;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
  transition: background 0.2s ease;
}

.history-item:hover {
  background: rgba(47, 125, 51, 0.08);
}

.main {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 26px;
  padding: 26px 32px 32px;
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 40px rgba(36, 60, 45, 0.08);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.topbar {
  display: flex;
  justify-content: flex-end;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(48, 85, 55, 0.08);
}

.logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--green-100);
  display: grid;
  place-items: center;
}

.logo-badge svg {
  width: 26px;
  height: 26px;
  fill: var(--green-700);
}

.logo-name {
  display: block;
  font-weight: 700;
}

.logo-tag {
  display: block;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.assistant-mark {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--green-100);
  display: grid;
  place-items: center;
}

.assistant-mark svg {
  width: 34px;
  height: 34px;
  fill: var(--green-700);
}

.hero h1 {
  font-family: "Fraunces", serif;
  font-size: 30px;
}

.hero p {
  color: var(--muted);
  max-width: 520px;
  line-height: 1.5;
}

.prompt-chips,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.chip {
  border: 1px solid rgba(47, 125, 51, 0.2);
  background: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(43, 82, 55, 0.12);
}

.chip.action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-100);
  border-color: transparent;
}

.chip-icon {
  font-size: 16px;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.empty-state {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(47, 125, 51, 0.2);
}

.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.chat-row.user {
  justify-content: flex-end;
}

.message {
  max-width: 70%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  line-height: 1.6;
  font-size: 15px;
}

.message.user {
  background: linear-gradient(135deg, var(--green-700), #2e7d31);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.message.card {
  background: #fff;
  box-shadow: var(--shadow);
}

.message.card ul {
  margin: 12px 0 0 18px;
  color: var(--muted);
}

.message.card li {
  margin-bottom: 8px;
}

.message.card h3,
.message.card h4 {
  font-family: "Fraunces", serif;
  margin: 8px 0 6px;
}

.message.card h3 {
  font-size: 18px;
}

.message.card h4 {
  font-size: 16px;
}

.message.card p {
  margin: 6px 0;
  color: var(--muted);
}

.message.card code {
  background: var(--green-100);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
}

.message.card a {
  color: var(--green-700);
  text-decoration: none;
}

.message.card a:hover {
  text-decoration: underline;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-100);
  color: var(--green-700);
  font-weight: 600;
}

.avatar.user {
  background: #d6ead6;
}

.avatar svg {
  width: 22px;
  height: 22px;
  fill: var(--green-700);
}

.sources {
  margin-top: 16px;
  border-top: 1px solid rgba(47, 125, 51, 0.15);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.source-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.source {
  border: 1px solid rgba(47, 125, 51, 0.2);
  background: var(--green-100);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: normal;
  text-transform: none;
  color: var(--green-700);
}

.web-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.web-header {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.web-results ol {
  margin-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.web-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.web-snippet {
  color: var(--muted);
  margin-bottom: 6px;
}

.web-link {
  color: var(--green-700);
  text-decoration: none;
  font-size: 13px;
}

.web-link:hover {
  text-decoration: underline;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-wrap {
  background: #fff;
  border-radius: 999px;
  padding: 6px 8px 6px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.input-wrap input {
  border: none;
  outline: none;
  font: inherit;
  font-size: 15px;
  width: 100%;
}

.input-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.send {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  padding: 6px;
}

.send {
  background: var(--green-700);
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(40, 90, 50, 0.25);
}

.mode-toggle {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.mode {
  border: 1px solid rgba(47, 125, 51, 0.2);
  background: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}

.mode.active {
  background: var(--green-100);
  color: var(--green-700);
  border-color: transparent;
}

@media (max-width: 1024px) {
  .page {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .history {
    display: none;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 18px;
  }

  .main {
    padding: 20px;
  }

  .message {
    max-width: 100%;
  }

  .logo {
    width: 100%;
    justify-content: center;
  }
}
