* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --ink: #182f2c;
  --muted: #4d615c;
  --accent: #006751;
  --paper: #f6f7f3;
  --line: #dce4da;
  font-family: "Segoe UI", system-ui, sans-serif;
}
body { margin: 0; color: var(--ink); background: var(--paper); }
[hidden] { display: none !important; }
.wrap { max-width: 1250px; width: calc(100% - 64px); margin-inline: auto; }
.masthead { background: #142c2b; color: #f7f8f2; border-bottom: 4px solid #8dceaa; }
.topline { display: flex; justify-content: space-between; border-bottom: 1px solid #42605d; padding-block: 18px; }
.topline a { color: #d2e9da; }
.mast-content { padding-block: 29px 48px; }
h1 { font-family: Georgia, serif; font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 400; line-height: 1; margin: 0; letter-spacing: -.055em; }
.mast-content p { margin: 14px 0 0; color: #d2e9da; font-size: 1.08rem; }
main { padding-block: 26px 54px; }
h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.025em; }
p { line-height: 1.5; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #168468; outline-offset: 3px; }
.corpus, .search, .column { border: 1px solid var(--line); background: white; border-radius: 12px; }
.corpus { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 23px; }
.corpus p { color: var(--muted); margin: 6px 0; max-width: 75ch; }
.corpus a { display: inline-block; margin-top: 7px; font-size: .94rem; }
dl { display: flex; gap: 18px; align-items: start; margin: 0; }
dl div { min-width: 66px; padding-left: 13px; border-left: 1px solid var(--line); }
dt { font-size: .8rem; color: var(--muted); margin-top: 6px; }
dd { margin: 0; white-space: nowrap; font-size: 1.12rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.search { margin-top: 17px; padding: 23px; }
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
legend, .query label { padding: 0; font-weight: 650; font-size: 1.04rem; }
.profiles { display: grid; gap: 8px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 12px; }
.profile { min-width: 0; display: block; text-align: left; padding: 11px 12px; min-height: 92px; cursor: pointer; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.profile[aria-pressed="true"] { background: #e8f5ee; border-color: #217c63; box-shadow: inset 0 2px #217c63; }
.profile:disabled { opacity: .68; cursor: default; }
.profile strong, .profile small { display: block; }
.profile small { color: var(--muted); margin-top: 5px; line-height: 1.28; }
.query { margin-top: 20px; }
textarea { display: block; width: 100%; margin-top: 8px; min-height: 72px; border: 1px solid #adbbb2; border-radius: 8px; padding: 11px 13px; font: inherit; color: var(--ink); background: #fff; resize: vertical; }
.actions { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 12px; }
#status { margin: 0; color: var(--muted); font-size: .92rem; }
#submit { margin-left: auto; padding: 10px 21px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: white; font: inherit; font-weight: 650; }
#submit:disabled { opacity: .55; }
#submit:not(:disabled) { cursor: pointer; }
.report-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-block: 29px 12px; }
.report-heading p { color: var(--muted); margin: 0; font-size: .9rem; }
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; align-items: start; }
.column { overflow: hidden; }
.column header { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #e8f2ec; padding: 14px; }
.column h3 { font-size: 1rem; margin: 0; }
.column header small, .match-meta { color: var(--muted); font-variant-numeric: tabular-nums; }
.match, .column > p { padding: 13px 14px; margin: 0; }
.match + .match { border-top: 1px solid var(--line); }
.match-meta { font-size: .76rem; margin: 0 0 5px; }
.match h4 { font-size: .98rem; line-height: 1.35; margin: 0 0 6px; }
.match details { font-size: .9rem; margin-top: 8px; }
.match details p { white-space: pre-wrap; overflow-wrap: anywhere; }
summary { cursor: pointer; color: var(--accent); }
.api-content { max-width: 850px; }
.api-content h2 { margin-top: 26px; }
pre { overflow: auto; background: #e9f1eb; padding: 16px; border-radius: 8px; }
@media (max-width: 930px) {
  .profiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .corpus { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  .mast-content { padding-block: 27px 33px; }
  .corpus, .search { padding: 15px; }
  .profiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-heading { display: block; }
}
