:root {
  color-scheme: light;
  font: 100%/1.6 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #172923;
  background: #f5f6ef;
  --accent: #214f3e;
  --muted: #4d6258;
  --line: #ccd5cb;
  --paper: #fffffb;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--accent); }
p { margin: .55rem 0; }
h1, h2, h3 { margin: 0; line-height: 1.32; }
h1 { margin-bottom: 1.4rem; font-size: clamp(2rem, 5vw, 3.35rem); letter-spacing: -.025em; }
h2 { font-size: 1.27rem; }
h3 { font-size: 1.06rem; }

button, input { font: inherit; }
button {
  min-height: 2.5rem;
  padding: .3rem .75rem;
  border: 1px solid #9aaea1;
  border-radius: .35rem;
  color: var(--accent);
  background: var(--paper);
  cursor: pointer;
}
button:hover { background: #eaf2e9; }
button:disabled { opacity: .68; cursor: wait; }
:focus-visible { outline: 3px solid #307957; outline-offset: 3px; }
#job-title { scroll-margin-top: 1rem; }
.primary { color: white; background: var(--accent); border-color: var(--accent); }
.primary:hover { background: #2b634d; }

.shell { max-width: 79rem; margin: auto; padding: 0 clamp(1rem, 4vw, 3.2rem) 3rem; }
.masthead, .section-heading, .account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.masthead { min-height: 4.25rem; border-bottom: 1px solid var(--line); }
.brand { color: var(--accent); font-weight: 730; text-decoration: none; }
.brand span { margin-left: .25rem; font-size: .86rem; font-weight: 550; }
.account { min-width: 0; }
#account { color: var(--muted); overflow-wrap: anywhere; font-size: .88rem; }
.account button, .section-heading button { flex-shrink: 0; white-space: nowrap; }
main { padding-top: clamp(1.4rem, 4vw, 3rem); }
.workspace { display: grid; grid-template-columns: minmax(15rem, 1fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: .55rem; padding: clamp(1rem, 3vw, 1.55rem); }
.login { max-width: 30rem; }
.login form { display: grid; gap: .65rem; margin-top: 1rem; }
.login input { min-width: 0; min-height: 2.75rem; border: 1px solid #8da498; border-radius: .3rem; padding: .35rem .6rem; }
.login .primary { justify-self: start; }
.oauth-login { display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: 1rem; padding: .35rem .8rem; border: 1px solid #9aaea1; border-radius: .35rem; text-decoration: none; font-weight: 650; }
.oauth-login:hover { background: #eaf2e9; }

.job-list { list-style: none; padding: 0; margin: .8rem 0 0; }
.job-list li + li { border-top: 1px solid var(--line); }
.job-button { text-align: start; display: grid; gap: .25rem; width: 100%; border-color: transparent; padding: .58rem .42rem; }
.job-button[aria-current="true"] { background: #eaf2e9; border-color: #91aa99; }
.job-button span:first-child { font-weight: 635; overflow-wrap: anywhere; }
.muted, .feedback, .facts, .status { color: var(--muted); font-size: .88rem; }
.status { display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.status time { font-variant-numeric: tabular-nums; }
.feedback:empty { display: none; }
.feedback[data-error="true"] { color: #943b2d; }
.detail-panel :where(p, li), #source-content { overflow-wrap: anywhere; }
.facts { margin-top: .8rem; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .3rem .75rem; }
.facts dt { font-weight: 640; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.result-section { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.prose { white-space: pre-wrap; }
.claims, .citations { padding-inline-start: 1.25rem; }
.claims > li, .citations > li { margin-bottom: .8rem; }
.citation-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.citation-links button, .citations button { max-width: 100%; text-align: start; overflow-wrap: anywhere; }

dialog {
  width: min(54rem, calc(100% - 1.5rem));
  max-height: calc(100dvh - 2rem);
  padding: clamp(1rem, 4vw, 1.7rem);
  color: inherit;
  background: var(--paper);
  border: 1px solid #a8b6aa;
  border-radius: .55rem;
  box-shadow: 0 14px 70px #23392d38;
}
dialog::backdrop { background: #182b22a1; }
.source-heading { position: sticky; top: 0; z-index: 1; background: var(--paper); padding-bottom: .35rem; }
.source-page { margin-top: .8rem; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: .7rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
caption { font-weight: 650; text-align: left; margin-bottom: .3rem; }
th, td { border: 1px solid var(--line); text-align: start; vertical-align: top; padding: .4rem .55rem; white-space: pre-wrap; }
th { background: #ecf2ea; }

@media (max-width: 46rem) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
}
