:root {
  color-scheme: light;
  --ink: #1b2430;
  --muted: #647083;
  --line: #dce3ea;
  --paper: #f7fafc;
  --panel: #ffffff;
  --accent: #176b87;
  --accent-dark: #0e4b60;
  --warning-bg: #fff7e5;
  --warning-line: #e7b84b;
  --shadow: 0 18px 45px rgb(24 45 67 / 8%);
  font-family: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgb(188 224 233 / 35%), transparent 34rem),
    var(--paper);
  line-height: 1.7;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100% - 2rem, 920px);
  margin: 0 auto;
  padding: 3.5rem 0 2rem;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 12em;
  margin-bottom: 0.6rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.3;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.hero-copy {
  max-width: 38rem;
  margin-bottom: 0;
  color: var(--muted);
}

.mode-badge,
.sample-label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgb(23 107 135 / 20%);
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgb(255 255 255 / 75%);
  font-size: 0.78rem;
  font-weight: 700;
}

.safety-notice {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--warning-line);
  border-radius: 1rem;
  background: var(--warning-bg);
}

.safety-notice p {
  margin: 0.25rem 0 0;
  color: #6d5523;
  font-size: 0.92rem;
}

.panel {
  margin-bottom: 1rem;
  padding: clamp(1.1rem, 3vw, 1.7rem);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-heading,
.sources-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading {
  margin-bottom: 1.3rem;
}

.section-heading h2 {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.question-row {
  display: flex;
  gap: 0.65rem;
}

input {
  min-width: 0;
  flex: 1;
  padding: 0.85rem 1rem;
  border: 1px solid #bfcbd5;
  border-radius: 0.75rem;
  color: var(--ink);
  background: #fff;
}

input:focus {
  outline: 3px solid rgb(23 107 135 / 20%);
  border-color: var(--accent);
}

button[type="submit"] {
  padding: 0.75rem 1.2rem;
  border: 0;
  border-radius: 0.75rem;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}

button[type="submit"]:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.quick-questions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.quick-questions button {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  background: #f8fbfc;
  font-size: 0.8rem;
}

.quick-questions button:hover {
  border-color: var(--accent);
}

.status {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #eef2f5;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.status--answered {
  background: #e7f6ee;
  color: #1b6b43;
}

.status--insufficient_evidence,
.status--safety_review_required {
  background: #fff1df;
  color: #8b5b13;
}

.status--no_query {
  background: #eef2f5;
  color: var(--muted);
}

.answer {
  min-height: 8rem;
  padding: 1rem;
  border-radius: 0.85rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f5f8fa;
}

.sources {
  margin-top: 1.4rem;
}

.sources-heading {
  margin-bottom: 0.7rem;
}

.sources-heading span {
  color: var(--muted);
  font-size: 0.78rem;
}

.source-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding-left: 1.4rem;
}

.source-card {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #fbfdfe;
}

.source-card span {
  color: var(--accent);
  font-size: 0.78rem;
}

.source-card p {
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
}

.source-empty {
  color: var(--muted);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
}

noscript {
  display: block;
  padding: 1rem;
  color: #8b3f3f;
  text-align: center;
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 1rem, 920px);
    padding-top: 1.25rem;
  }

  .hero {
    display: block;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .mode-badge {
    margin-top: 1rem;
  }

  .section-heading,
  .sources-heading,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .question-row {
    flex-direction: column;
  }

  button[type="submit"] {
    width: 100%;
  }

  .quick-questions {
    align-items: flex-start;
    flex-direction: column;
  }

  .quick-questions button {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}
