:root {
  color-scheme: light;
  --bg: #efe4d5;
  --bg-deep: #d8c6ae;
  --panel: rgba(255, 251, 244, 0.88);
  --panel-strong: #fffaf2;
  --text: #1f1813;
  --muted: #67584d;
  --line: rgba(85, 60, 35, 0.15);
  --accent: #aa512e;
  --accent-strong: #6f250a;
  --accent-soft: rgba(170, 81, 46, 0.08);
  --ok: #1d7a4d;
  --shadow: 0 28px 80px rgba(76, 46, 18, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.65), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(145, 76, 43, 0.22), transparent 18%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

.page-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 22px;
  align-items: end;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.query-panel,
.answer-frame {
  backdrop-filter: blur(12px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 32px;
  border-radius: var(--radius-xl);
}

.eyebrow,
.hero-card-label,
.answer-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--accent);
}

h1,
h2,
.hero-card-value,
.empty-state-title {
  font-family: "Fraunces", Georgia, serif;
}

h1 {
  margin: 8px 0 10px;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: 0.95;
}

.hero-text {
  max-width: 56ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.05rem;
}

.hero-card {
  padding: 24px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.96), rgba(250, 240, 228, 0.94)),
    var(--panel);
}

.hero-card-value {
  margin-top: 10px;
  font-size: 2rem;
}

.hero-card-meta {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.query-panel,
.answer-frame {
  border-radius: var(--radius-xl);
  padding: 28px;
  min-height: 100%;
}

.panel-header h2 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.panel-header p,
.empty-state p,
.citation-meta,
.citation-snippet,
.field-help {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.sample-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 18px;
}

.sample-chip,
.submit-button,
select,
textarea {
  font: inherit;
}

.sample-chip {
  border: 1px solid rgba(170, 81, 46, 0.18);
  background: rgba(255, 251, 244, 0.82);
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.sample-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(170, 81, 46, 0.42);
  background: rgba(255, 244, 232, 0.96);
}

.ask-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 0.92rem;
  font-weight: 600;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.65;
}

textarea:focus,
select:focus {
  border-color: rgba(170, 81, 46, 0.5);
  box-shadow: 0 0 0 4px rgba(170, 81, 46, 0.12);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.submit-button {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 600;
  cursor: pointer;
  color: #fff9f1;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 14px 32px rgba(111, 37, 10, 0.24);
  transition: transform 140ms ease, opacity 140ms ease;
}

.submit-button:hover {
  transform: translateY(-1px);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
}

.answer-frame {
  display: grid;
  align-content: start;
  gap: 18px;
}

.empty-state,
.answer-card,
.citations-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 251, 244, 0.9);
}

.empty-state {
  padding: 22px;
}

.empty-state-title {
  margin-bottom: 8px;
  font-size: 1.5rem;
}

.answer-card {
  padding: 22px;
}

.answer-text {
  margin: 10px 0 0;
  white-space: pre-wrap;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  line-height: 1.75;
  font-size: 1rem;
}

.citations-panel {
  padding: 22px;
}

.citations-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.citation-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fffdf7;
  padding: 16px;
}

.citation-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.citation-index {
  font-weight: 700;
  color: var(--accent-strong);
}

.citation-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.citation-meta {
  margin-top: 6px;
  font-size: 0.92rem;
}

.citation-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
}

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

.citation-snippet {
  margin-top: 12px;
  font-size: 0.95rem;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 18px, 100%);
    padding: 18px 0 28px;
  }

  .hero-copy,
  .hero-card,
  .query-panel,
  .answer-frame {
    padding: 20px;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.8rem;
  }
}
