:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-alt: #fbfaf7;
  --ink: #1f2a32;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-dark: #0b4d49;
  --accent-warm: #f59e0b;
  --stroke: #e5e7eb;
  --shadow: 0 18px 40px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  background: radial-gradient(circle at top left, #fef6e4, #f4f1ea 55%, #ece7df 100%);
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
  margin: 0;
}

.page-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 28px 64px;
}

.hero-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 24px 28px;
  border-radius: 24px;
  background: linear-gradient(130deg, #0f766e 0%, #1f2933 60%);
  color: #f8fafc;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.hero-bar h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 32px;
  margin: 6px 0;
}

.hero-bar .eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  margin: 0;
  opacity: 0.8;
}

.hero-bar .subhead {
  margin: 0;
  max-width: 520px;
  color: rgba(248, 250, 252, 0.85);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.panel {
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(31, 41, 55, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.panel-header h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  margin-bottom: 6px;
}

.upload-zone {
  border: 1px dashed var(--accent);
  border-radius: 16px;
  padding: 18px;
  background: var(--surface-alt);
}

.upload-zone.dragover {
  background: rgba(15, 118, 110, 0.08);
  border-color: var(--accent-dark);
}

.upload-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.upload-title {
  font-weight: 600;
}

.upload-sub {
  font-size: 13px;
  color: var(--muted);
}

.status-text {
  font-size: 13px;
  color: var(--muted);
}

.doc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.doc-count {
  font-size: 13px;
  color: var(--muted);
}

.doc-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
}

.doc-card {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.doc-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-sub {
  font-size: 12px;
  color: var(--muted);
}

.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.indexed {
  background: rgba(16, 185, 129, 0.15);
  color: #065f46;
}

.status-badge.not-indexed {
  background: rgba(239, 68, 68, 0.15);
  color: #991b1b;
}

.doc-footer {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-state {
  border: 1px dashed var(--stroke);
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border-radius: 12px;
}

.helper-text {
  font-size: 12px;
  color: var(--muted);
}

.mode-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.mode-hint {
  font-size: 13px;
  color: var(--muted);
}

.results {
  border-top: 1px solid var(--stroke);
  padding-top: 20px;
}

.results-actions {
  display: flex;
  justify-content: flex-end;
}

.result-banner {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-dark);
  font-weight: 600;
}

.warning-banner {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-weight: 600;
  font-size: 13px;
}

.timing-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--stroke);
}

.timing-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.timing-item {
  background: var(--surface-alt);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, 0.12);
}

.answer-card,
.debug-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--stroke);
}

.answer-card h3,
.debug-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  margin-bottom: 12px;
}

.answer-card pre {
  font-family: "Source Sans 3", sans-serif;
  white-space: pre-wrap;
  margin: 0;
  font-size: 15px;
}

.citation-list {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.citation-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

.citation-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.citation-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-dark);
  border: 1px solid rgba(15, 118, 110, 0.2);
  font-size: 12px;
}

.accordion-button {
  font-weight: 600;
}

.accordion-body pre {
  white-space: pre-wrap;
  font-family: "Source Sans 3", sans-serif;
  margin: 0;
  font-size: 14px;
}

@media (max-width: 992px) {
  .hero-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
