:root {
  color-scheme: light;
  --navy: #00244d;
  --yellow: #ffd508;
  --ink: #334155;
  --line: #f1f5f9;
  --muted: #64748b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #fff;
  color: var(--navy);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

a { color: #1d4ed8; }

.page {
  width: 100%;
  min-height: 100vh;
  background: #fff;
  padding: 2rem;
}

.sheet {
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
}

.header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  width: 100%;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.phv-logo {
  width: auto;
  max-height: 70px;
}

.main-title {
  margin: 0;
  color: var(--navy);
  text-align: left;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
}

.section-title {
  margin: 0 0 1.5rem;
  padding-left: 1.5rem;
  border-left: 8px solid var(--yellow);
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: left;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.option-card {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1.25rem;
  border: 2px solid var(--line);
  border-radius: 1rem;
  background: #fff;
  cursor: pointer;
}

.option-card.active {
  background: #fffde7;
  border-color: var(--yellow);
}

.option-card input {
  accent-color: var(--navy);
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  cursor: pointer;
}

.option-label {
  margin-left: 1.2rem;
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 700;
}

.disclaimer {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #f8fafc;
}

.disclaimer-layout {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
}

.large-checkbox {
  accent-color: var(--navy);
  width: 24px;
  height: 24px;
  margin: 2px 1.2rem 0 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.disclaimer-text {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: justify;
  hyphens: auto;
}

.disclaimer-text p { margin: 0 0 0.75rem; }

.disclaimer-text ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.disclaimer-text li + li { margin-top: 0.25rem; }

.advice {
  margin: 0;
  padding-top: 0.5rem;
  border-top: 1px solid #e5e7eb;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.sponsor-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.sponsor-logo {
  height: 35px;
  width: auto;
}

.sponsor-note {
  max-width: 250px;
  margin: 0.5rem 0 0;
  color: #6b7280;
  font-size: 10px;
  line-height: 1.25;
}

.start-button {
  width: 220px;
  padding: 1.1rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.start-button:hover:not(:disabled) { background: #003366; color: #fff; }

.start-button:active:not(:disabled) { transform: scale(0.95); }

.start-button:disabled {
  opacity: 0.5;
  filter: grayscale(1);
  background: #9ca3af;
  cursor: not-allowed;
}

.chat-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: min(820px, calc(100vh - 4rem));
  min-height: 700px;
  margin-bottom: 2.5rem;
  overflow: hidden;
  border: 2px solid #f1f5f9;
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 6%);
}

.chat-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1rem 0;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
}

.icon-button:hover { background: #f1f5f9; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1.25rem 1rem;
}

.row {
  display: flex;
  margin-bottom: 0.85rem;
}

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

.row.bot { justify-content: flex-start; }

.bubble {
  max-width: min(80%, 42rem);
  padding: 0.75rem 1rem;
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.bubble.user {
  background: var(--yellow);
  color: var(--navy);
  border-radius: 20px 20px 0 20px;
}

.bubble.bot {
  background: #f1f5f9;
  color: var(--navy);
  border-radius: 20px 20px 20px 0;
}

.bubble p { margin: 0 0 0.7rem; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 0.4rem 0 0.7rem; padding-left: 1.25rem; }
.bubble li + li { margin-top: 0.2rem; }
.bubble strong { font-weight: 700; }
.bubble code {
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  background: rgb(0 36 77 / 8%);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}
.bubble pre {
  margin: 0.5rem 0;
  padding: 0.75rem;
  overflow-x: auto;
  border-radius: 0.5rem;
  background: #fff;
}
.bubble a { color: #1d4ed8; }

.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.source {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  line-height: 1.3;
}

.typing {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.95rem 1.1rem;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--navy);
  animation: blink 1s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.4rem;
  border-top: 1px solid #e5e7eb;
}

.composer textarea {
  flex: 1;
  min-height: 56px;
  max-height: 160px;
  padding: 0.85rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  resize: none;
  color: var(--navy);
  background: #fff;
}

.composer textarea:focus {
  outline: 2px solid var(--yellow);
  border-color: transparent;
}

.send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 0.75rem;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
}

.send:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-footer {
  margin: 0;
  padding: 0.45rem 1rem 0.8rem;
  color: #303235;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 480px) {
  .page { padding: 1rem; }
  .header { gap: 0.75rem; margin-bottom: 1rem; padding-bottom: 0.75rem; }
  .phv-logo { max-height: 42px; }
  .main-title { font-size: 1.3rem; }
  .section-title { margin-bottom: 0.75rem; font-size: 1.05rem; }
  .options { gap: 0.4rem; }
  .option-card { padding: 0.5rem 1rem; border-radius: 0.6rem; }
  .option-label { font-size: 0.9rem; }
  .disclaimer { margin-top: 0.75rem; padding: 0.5rem 0.75rem; }
  .disclaimer-layout { display: block; }
  .large-checkbox { float: left; width: 20px; height: 20px; margin: 2px 0.6rem 0 0; }
  .disclaimer-text { font-size: 0.85rem; line-height: 1.35; }
  .footer { flex-direction: column-reverse; gap: 1rem; padding-top: 1rem; }
  .sponsor-logo { height: 25px; }
  .start-button { width: 100%; padding: 0.75rem; }
  .chat-card { min-height: calc(100vh - 2rem); height: calc(100vh - 2rem); margin-bottom: 0; }
}
