@font-face {
  font-family: Nunito;
  src: url("nunito.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #172b3d;
  --muted: #475e73;
  --accent: #244e73;
  --line: #d7e1e9;
  --paper: #f8fbfd;
  font: 16px/1.5 Nunito, "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: radial-gradient(ellipse at 70% 80%, #e3edf2 0, transparent 62%), #f7f6f2;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
body { margin: 0; min-height: 100vh; }
button, textarea { font: inherit; }
a { color: var(--accent); text-underline-offset: .2em; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #4a729a; outline-offset: 3px; }
h1, h2, h3, h4, p, blockquote { margin: 0; }

.shell {
  width: min(1240px, calc(100% - 3rem));
  margin: clamp(1rem, 5vh, 3.5rem) auto;
  padding: clamp(.65rem, 1.6vw, 1.25rem);
  border: 1px solid #fff;
  border-radius: 2rem;
  background: #ffffff95;
  box-shadow: 0 22px 55px #223b4b1c;
}

.topbar, .composer-row { display: flex; align-items: center; gap: .75rem; }
.topbar { justify-content: space-between; padding: .25rem .75rem 1rem; }
.topbar h1 {
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .07em;
}
.icon { width: 1em; height: 1em; flex: none; fill: currentColor; }
.health { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .82rem; }
.health::before { content: ""; width: .45rem; height: .45rem; background: #8396a9; border-radius: 50%; }
.health[data-state="ready"]::before { background: #28705b; }
.health[data-state="unavailable"]::before { background: #b26a29; }
.workspace {
  display: grid;
  gap: 1rem;
  padding: clamp(.8rem, 2.3vw, 1.65rem);
  border-radius: 1.45rem;
  background: radial-gradient(ellipse at 5% 100%, #b6d0e5, transparent 56%),
    linear-gradient(125deg, #eaf0f5, #d2e1ef 75%, #e0e9ee);
}
.workspace-title h2 { font-size: 1.5rem; line-height: 1.2; font-weight: 800; letter-spacing: -.025em; }
.workspace-title p { color: var(--muted); font-size: .83rem; margin-top: .25rem; }
.columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: .9rem; }
.conversation, .details { border: 1px solid #fff; border-radius: 1.1rem; background: var(--paper); }
.conversation { height: clamp(390px, 72vh, 720px); display: grid; grid-template-rows: minmax(0, 1fr) auto auto; overflow: hidden; }
.output, .detail-content {
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior-y: contain;
  overflow-wrap: anywhere;
  scrollbar-gutter: stable;
}
.output:focus-visible, .detail-content:focus-visible { outline-offset: -3px; }
.output { display: flex; flex-direction: column; padding: clamp(.8rem, 3vw, 2.2rem); }
.output:has(.welcome:not([hidden])) { overflow: clip; container-type: size; }
.output > * { flex: none; }
.welcome { margin-block: auto; text-align: center; padding-block: clamp(.4rem, 3vh, 1.8rem); }
.welcome h3, .result h3 { font-size: clamp(1.6rem, 3.2vw, 2.6rem); line-height: 1.12; font-weight: 800; letter-spacing: -.035em; }
.welcome p, .qualification { color: var(--muted); margin-top: .6rem; }
.examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  max-width: 36rem;
  margin: 1.15rem auto 0;
}
.example {
  min-height: 44px;
  padding: .45rem .7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .88rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: .65rem;
  color: var(--accent);
  background: #eef4fa;
}
.example:hover { background: #e1edf6; }
.example, .composer button { transition: background-color .18s, transform .18s; }
.example:active, .composer button:active { transform: scale(.97); }
.loading { margin: auto; text-align: center; color: var(--muted); animation: reveal .28s ease-out both; }
.loading-dots { display: inline-flex; gap: .35rem; margin-bottom: .65rem; }
.loading-dots i {
  width: .46rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  animation: loading-pulse 1s ease-in-out infinite;
}
.loading-dots i:nth-child(2) { animation-delay: .13s; }
.loading-dots i:nth-child(3) { animation-delay: .26s; }
.loading p { font-size: .94rem; }
.feedback:empty { display: none; }
.feedback { align-self: stretch; padding: 0 1.25rem 1rem; color: var(--accent); }
.feedback[data-error="true"] { color: #883716; animation: reveal .22s ease-out both; }
.composer { padding: .8rem clamp(.75rem, 2vw, 1.25rem) 1rem; background: #edf4f9; border-top: 1px solid var(--line); }
.composer label { display: block; color: var(--muted); font-size: .83rem; margin-bottom: .35rem; }
.composer-row { align-items: stretch; }
textarea {
  width: 100%;
  min-width: 0;
  min-height: 4rem;
  resize: none;
  padding: .6rem .7rem;
  border: 1px solid #899fb4;
  border-radius: .65rem;
  background: #fff;
  color: var(--ink);
}
.composer button { display: inline-flex; align-items: center; gap: .35rem; flex: none; min-height: 44px; padding: .5rem .8rem; color: white; background: var(--accent); border: 1px solid var(--accent); border-radius: .65rem; }
.composer button:hover:not(:disabled) { background: #153b5e; }
.asked { padding-bottom: 1rem; border-bottom: 1px solid var(--line); color: var(--muted); white-space: pre-wrap; }
.result-status { margin: 1.15rem 0 .5rem; font-size: .86rem; color: #285d4d; font-weight: 700; }
.result-status[data-status="TENTATIVE"], .result-status[data-status="UNVERIFIED"] { color: #824719; }
.result-status[data-status="INSUFFICIENT_EVIDENCE"] { color: var(--muted); }
.result h4 { margin-top: 1.3rem; }
.evidence, .items { padding: 0; margin: .5rem 0 0; list-style: none; }
.evidence li, .items li { border-top: 1px solid var(--line); padding-block: .65rem; }
blockquote { padding-left: .65rem; border-left: 2px solid #9fb8ce; margin-block: .35rem; }
.details { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.details h3 { font-size: 1.2rem; line-height: 1.2; font-weight: 800; padding: 1.05rem 1rem .7rem; }
.detail-content { padding: 0 1rem 1rem; }
.details p, .items { color: var(--muted); font-size: .85rem; }
.details h4 { margin-top: .65rem; font-size: .9rem; }
.details details { border-top: 1px solid var(--line); }
.details summary { display: flex; align-items: center; cursor: pointer; min-height: 44px; padding: .6rem 0; font-size: .94rem; font-weight: 700; }
.details summary::-webkit-details-marker { display: none; }
.details summary:hover { color: var(--accent); }
.stage-caret { margin-left: auto; color: var(--accent); transition: transform .16s ease; }
details[open] > summary .stage-caret { transform: rotate(180deg); }
.details summary small { font-weight: 400; color: var(--muted); margin-left: .4rem; }
.details details > div { padding: 0 0 .8rem .15rem; }
.detail-label { color: var(--ink); font-weight: 700; }
.topbar, .workspace-title, .conversation, .details, .welcome > * {
  animation: reveal .38s cubic-bezier(.2, .75, .3, 1) var(--entrance-delay, 0s) backwards;
}
.workspace-title { --entrance-delay: .055s; }
.conversation { --entrance-delay: .10s; }
.details { --entrance-delay: .15s; }
.welcome > * { --entrance-delay: .20s; }
.welcome > .examples { --entrance-delay: .26s; }
.result > *, #stages:not(:empty), .details details[open] > div { animation: reveal .32s ease-out both; }
.result-status { animation-delay: .045s; }
.result h3 { animation-delay: .09s; }
.result .qualification, .result section { animation-delay: .15s; }
@supports (interpolate-size: allow-keywords) and selector(details::details-content) {
  .details details::details-content {
    interpolate-size: allow-keywords;
    block-size: 0;
    overflow: clip;
    opacity: 0;
    transition: block-size .24s ease, opacity .18s ease, content-visibility .24s allow-discrete;
  }
  .details details[open]::details-content { block-size: auto; opacity: 1; }
  .details details[open] > div { animation: none; }
}
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loading-pulse {
  0%, 75%, 100% { opacity: .4; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-.35rem); }
}
@media (min-width: 761px) {
  body { overflow: hidden; }
  .shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .workspace { grid-template-rows: auto minmax(0, 1fr); }
  .columns { grid-template-rows: minmax(0, 1fr); }
  .conversation { height: auto; min-height: 0; }
}
@media (max-height: 700px) {
  .output:has(.welcome:not([hidden])) { padding-block: .65rem; }
}
@container (max-height: 340px) {
  .welcome { padding-block: 0; }
  .welcome p { display: none; }
  .examples { margin-top: .65rem; }
}
@media (min-width: 761px) and (max-height: 535px) {
  .shell, .workspace { padding: .65rem; }
  .workspace { gap: .65rem; }
  .workspace-title p { display: none; }
  .welcome h3 { font-size: 1.35rem; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 1rem); margin: .5rem auto; border-radius: 1.25rem; }
  .workspace { border-radius: 1rem; }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .details { max-height: clamp(240px, 65vh, 560px); }
  .topbar { padding-inline: .35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .topbar, .workspace-title, .conversation, .details, .welcome > *,
  .loading, .loading-dots i, .result > *, #stages:not(:empty),
  .details details[open] > div, .feedback[data-error="true"] { animation: none; }
  .example, .composer button, .stage-caret { transition: none; }
  .example:active, .composer button:active { transform: none; }
  .details details::details-content { transition: none; }
}
