:root {
  --ink: #13261f;
  --ink-soft: #3a5348;
  --paper: #f3efe6;
  --paper-2: #e7efe8;
  --accent: #1f6f5b;
  --accent-deep: #0f4a3c;
  --line: rgba(19, 38, 31, 0.14);
  --danger: #8b2e2e;
  --ok: #1f6f5b;
  --warn: #8a5a12;
  --notice-bg: linear-gradient(160deg, rgba(255, 248, 236, 0.95), rgba(244, 232, 214, 0.92));
  --notice-border: rgba(138, 90, 18, 0.22);
  --shadow: 0 18px 50px rgba(19, 38, 31, 0.08);
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(1200px 600px at 10% -10%, #d9ebe3 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #efe6d4 0%, transparent 50%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
}

.page {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.5rem 0 4rem;
}

.hero {
  margin-bottom: 2rem;
}

.brand {
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--accent-deep);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.lede {
  margin: 0;
  max-width: 38rem;
  color: var(--ink-soft);
  line-height: 1.55;
  font-size: 0.98rem;
}

.ask-form {
  display: grid;
  gap: 1rem;
  padding: 1.25rem 0 0.5rem;
  border-top: 1px solid var(--line);
}

.ask-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.ask-form input,
.ask-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.ask-form textarea {
  resize: vertical;
  min-height: 7rem;
}

.ask-form input:focus,
.ask-form textarea:focus {
  outline: 2px solid rgba(31, 111, 91, 0.35);
  border-color: var(--accent);
}

.ask-form button {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.4rem;
  background: var(--accent);
  color: #f7fbf9;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.ask-form button:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.ask-form button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.result {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  animation: rise 280ms ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: baseline;
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #d9ebe3;
  color: var(--accent-deep);
}

.badge.is-refused {
  background: #f3e0d8;
  color: var(--danger);
}

.badge.is-error {
  background: #f0e2e2;
  color: var(--danger);
}

.reason {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.answer h2,
.citations h2 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.answer p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.6;
}

.citations ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.citations a {
  color: var(--accent-deep);
}

.notice-panel {
  padding: 1.25rem 1.3rem 1.35rem;
  border: 1px solid var(--notice-border);
  border-radius: 18px;
  background: var(--notice-bg);
  box-shadow: var(--shadow);
  animation: rise 320ms ease;
}

.notice-panel.is-soft-block {
  background: linear-gradient(160deg, rgba(255, 248, 236, 0.96), rgba(236, 244, 239, 0.9));
  border-color: rgba(31, 111, 91, 0.18);
}

.notice-panel.is-error {
  background: linear-gradient(160deg, rgba(255, 244, 242, 0.96), rgba(248, 232, 228, 0.92));
  border-color: rgba(139, 46, 46, 0.2);
}

.notice-eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warn);
}

.notice-panel.is-soft-block .notice-eyebrow {
  color: var(--accent-deep);
}

.notice-panel.is-error .notice-eyebrow {
  color: var(--danger);
}

.notice-title {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.notice-body {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.65;
  font-size: 0.98rem;
}

.notice-tips {
  margin-top: 1.1rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(19, 38, 31, 0.1);
}

.notice-tips-label {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.suggestion-chip {
  border: 1px solid rgba(31, 111, 91, 0.22);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-deep);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.suggestion-chip:hover {
  background: rgba(217, 235, 227, 0.9);
  border-color: rgba(31, 111, 91, 0.4);
  transform: translateY(-1px);
}

.error {
  margin: 0.85rem 0 0;
  color: var(--danger);
}

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

  .ask-form button {
    width: 100%;
    justify-self: stretch;
  }

  .notice-panel {
    padding: 1.1rem 1rem 1.2rem;
  }
}
