:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #25292b;
  background: #f0f1ef;
  --accent: #303b41;
  --muted: #535c60;
  --line: #d6d9d7;
  --soft: #f5f6f4;
  --selected: #eaf0f0;
  --control-edge: #858e91;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}
* { box-sizing: border-box; }
body, h1, h2, h3, p, figure, dl, dd { margin: 0; }
.shell { max-width: 1500px; margin-inline: auto; padding-inline: clamp(18px,4vw,64px); }
.masthead { background: #fcfcfa; color: #1d2224; border-bottom: 1px solid #c8ccca; }
.masthead-inner { height: 55px; display: flex; align-items: center; gap: 17px; }
.brand { font-size: 21px; font-weight: 650; letter-spacing: .09em; }
.brand-context { border-left: 1px solid #bfc5c3; padding-left: 17px; font-size: 13px; color: var(--muted); }
#engine { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
#engine::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #687477; }
main { padding-bottom: 48px; }
.page-heading { padding-block: clamp(24px,3vw,42px) 23px; }
h1 { font-size: clamp(26px,2.4vw,36px); letter-spacing: -.045em; line-height: 1.25; }
.page-heading p, .hint, .scope p, figcaption { color: var(--muted); font-size: 13px; line-height: 1.65; }
.page-heading p { margin-top: 7px; }
.workspace { display: grid; grid-template-columns: minmax(310px,.74fr) minmax(0,1.26fr); gap: clamp(16px,2vw,28px); align-items: start; }
.request, .inspector, .job { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: clamp(17px,1.85vw,28px); }
.section-heading, .field-heading, .drawing-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 17px; }
h2 { font-size: 20px; line-height: 1.3; letter-spacing: -.025em; }
h3 { font-size: 15px; }
label, .drawing-toolbar > span { font-size: 13px; font-weight: 600; }
.field-heading { margin-bottom: 8px; }
button, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; }
.link, a { font-size: 13px; color: var(--accent); text-underline-offset: 3px; }
.link { background: transparent; padding: 5px 0 5px 8px; text-decoration: underline; text-decoration-color: #9aa3a3; }
.link:hover, a:hover { text-decoration: underline; }
textarea, select { width: 100%; max-width: 100%; border: 1px solid var(--control-edge); border-radius: 5px; background: #fff; color: inherit; }
textarea { min-height: 140px; padding: 12px 14px; resize: vertical; font-size: 15px; line-height: 1.7; display: block; }
textarea::placeholder { color: #646e70; }
:is(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hint { margin-top: 7px; font-size: 12px; }
.primary { background: var(--accent); color: white; display: inline-flex; align-items: center; gap: 18px; border-radius: 5px; padding: 11px 17px; font-size: 14px; font-weight: 600; transition: background-color .15s; }
.primary:hover { background: #171f23; }
button:disabled { opacity: .55; cursor: default; }
#match { margin-top: 18px; }
.scope, #matches { margin-top: 21px; border-top: 1px solid var(--line); padding-top: 16px; }
.scope h3 { color: var(--muted); font-size: 12px; font-weight: 550; }
.scope p { margin-top: 4px; }
#feedback:not(:empty) { white-space: pre-line; margin-top: 18px; border-left: 3px solid #73858b; background: var(--soft); padding: 10px 12px; font-size: 13px; line-height: 1.7; }
#parsed { margin: 10px 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.candidate { display: flex; align-items: start; gap: 8px; border: 1px solid var(--line); padding: 12px; border-radius: 4px; margin: 7px 0; cursor: pointer; }
.candidate:has(input:checked) { border-color: #76868b; background: var(--selected); }
.candidate input { accent-color: var(--accent); }
.candidate small { display: block; font-weight: 450; color: var(--muted); margin-top: 5px; line-height: 1.6; }
#submit { margin-top: 8px; }
#catalog-size, #job-status { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.catalog-field { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.catalog-field label { flex-shrink: 0; color: var(--muted); }
select { min-width: 0; padding: 7px 10px; font-size: 14px; }
.drawing { border: 1px solid #c2c9c7; border-radius: 5px; overflow: hidden; }
.drawing-toolbar { padding: 7px 12px; background: var(--soft); border-bottom: 1px solid var(--line); }
.view-switch { display: flex; align-items: center; border: 1px solid #bac2bf; padding: 2px; border-radius: 4px; background: #e8ebe8; }
.view-switch button { padding: 4px 11px; border-radius: 2px; font-size: 12px; background: transparent; color: var(--muted); }
.view-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }
canvas {
  --plot-paper: #fafbf8;
  --plot-grid: #dde2df;
  --plot-glass: #dbe8eb;
  --plot-glass-alt: #c8dce1;
  --plot-surface: #365460;
  --plot-axis: #74858a;
  --plot-stop: #84401f;
  width: 100%; height: clamp(235px,23vw,316px); display: block; background: var(--plot-paper);
}
figcaption { padding: 6px 12px; border-top: 1px solid var(--line); font-size: 12px; }
dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 17px 0 13px; }
dl > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
dt { color: var(--muted); font-size: 12px; }
dd { margin-top: 4px; font: 500 clamp(17px,1.65vw,25px)/1.3 var(--mono); font-variant-numeric: tabular-nums; }
#source { display: inline-block; }
.job { margin-top: 22px; }
.job .section-heading { margin-bottom: 13px; }
#job-status { background: var(--selected); padding: 4px 9px; border-radius: 4px; color: var(--accent); }
.job p, .job summary, .job details { font-size: 13px; line-height: 1.65; }
.job p { margin-block: 8px; overflow-wrap: anywhere; }
.job details { color: var(--muted); margin-bottom: 14px; }
.job summary { cursor: pointer; width: fit-content; }
.job h3 { margin: 17px 0 8px; }
.job img { display: block; max-width: min(100%,640px); }
.job a { display: inline-flex; padding: 7px 13px; border: 1px solid var(--line); border-radius: 4px; margin: 0 8px 6px 0; }
.tablebox { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 550; background: var(--soft); }
:is(th,td):first-child { text-align: left; }
td:not(:first-child) { font-family: var(--mono); }
[hidden] { display: none !important; }
@media (max-width: 800px) {
  .workspace { grid-template-columns: minmax(0,1fr); }
  .brand-context { font-size: 12px; padding-left: 12px; }
  .masthead-inner { gap: 12px; }
  canvas { height: 240px; }
}
@media (max-width: 440px) {
  .shell { padding-inline: 14px; }
  .brand-context { display: none; }
  .request, .inspector, .job { padding: 15px; }
  .page-heading { padding-block: 20px 15px; }
  .section-heading { margin-bottom: 12px; padding-bottom: 12px; }
  th, td { padding: 8px 6px; }
  dl > div + div { padding-left: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
