* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  color-scheme: light;
  --ink: #192820;
  --muted: #52635a;
  --line: #dbe3dc;
  --surface: #fff;
  --background: #f4f7f2;
  --green: #27634d;
  --pale-green: #e9f5ed;
  --amber: #825310;
  --pale-amber: #fcf2dc;
  font: 14px/1.5 "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
}
body { margin: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: 23px; letter-spacing: -.02em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
button, select, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead-inner, .shell { max-width: 1500px; margin: auto; padding: 18px 28px; }
.masthead-inner, .identity, .panel-heading, .decision-line, .sql-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.subtitle { font-weight: 600; }
.metadata { color: var(--muted); font-size: 12px; }
.mono, pre, code, td { font-family: "Cascadia Mono", Consolas, monospace; }
.modes { display: flex; gap: 4px; background: var(--background); border-radius: 8px; padding: 3px; }
.modes button, #copy-sql { border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 5px 9px; }
.modes [aria-pressed="true"], #copy-sql { border-color: var(--line); background: var(--surface); }
.status { padding: 9px 13px; background: var(--pale-green); border-radius: 8px; margin-bottom: 12px; }
.status.error { background: var(--pale-amber); color: var(--amber); }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.workspace { display: grid; grid-template-columns: 218px minmax(0, 1.55fr) minmax(265px, 1fr); gap: 14px; align-items: start; }
.cases nav { display: grid; gap: 5px; margin-top: 10px; }
.case { text-align: left; background: #fff; border: 1px solid transparent; border-radius: 7px; padding: 7px 8px; }
.case:hover { background: var(--background); }
.case[aria-current="true"] { border-color: #a1c8ae; background: var(--pale-green); }
.case strong, .case small { display: block; }
.case small { overflow-wrap: anywhere; }
.question { font-size: 15px; line-height: 1.5; margin: 10px 0 6px; }
details { color: var(--muted); font-size: 12px; }
details p { margin-top: 5px; overflow-wrap: anywhere; }
summary { cursor: pointer; font-weight: 600; }
.decision-box { margin: 10px 0; background: var(--pale-green); border-radius: 8px; padding: 10px 12px; }
.decision-box.review { background: var(--pale-amber); }
.decision-line { justify-content: flex-start; flex-wrap: wrap; gap: 7px; }
#decision { color: var(--green); }
.review #decision, .annotation.wrong { color: var(--amber); }
#support { padding: 1px 7px; border-radius: 8px; background: #fff; font-weight: 650; }
.annotation { margin-left: auto; font-weight: 600; font-size: 12px; }
#reasons { padding-left: 16px; margin: 4px 0 0; font-size: 12px; }
.table-wrap { max-height: 180px; overflow: auto; margin: 4px 0 11px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { text-align: left; padding: 5px 8px; border: 1px solid var(--line); white-space: nowrap; }
th { background: var(--background); }
.sql-heading { gap: 8px; }
#copy-sql { font-size: 12px; }
.sql { background: #172c24; color: #e9f5ee; padding: 10px 12px; margin: 5px 0 6px; max-height: 150px; }
pre { border-radius: 7px; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; font-size: 12px; }
.usage { margin-top: 9px; }
#sample-caption { margin: 5px 0 8px; }
.groups { display: grid; gap: 6px; }
.group { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(32px, 1fr) auto; align-items: center; gap: 8px; font-size: 12px; }
.group-preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { display: block; width: 100%; height: 8px; }
#sample-detail { margin-top: 9px; }
#samples details { margin: 6px 0 0 14px; }
.trace-heading { margin: 11px 0 4px; padding-top: 9px; border-top: 1px solid var(--line); }
.timeline { max-height: 185px; overflow: auto; display: grid; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.timeline li { border-left: 2px solid #bfd1c3; padding: 4px 6px; }
.timeline li.hit { color: var(--amber); border-color: #ab7321; background: var(--pale-amber); }
.timeline .hit summary { color: var(--amber); }
.timeline pre, #samples pre { margin: 4px 0; background: var(--background); padding: 6px; }
.step-number { margin-right: 8px; font-variant-numeric: tabular-nums; }
.metrics-panel { margin-bottom: 12px; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.65fr) repeat(4, minmax(0, 1fr)); gap: 10px; margin: 10px 0 7px; }
.metrics dt { color: var(--muted); font-size: 12px; }
.metrics dd { font-family: "Cascadia Mono", Consolas, monospace; font-size: 20px; font-weight: 600; }
.metrics div:nth-child(4) dd { color: var(--green); }
.caveat { color: var(--amber); font-size: 12px; }
.caveat a { color: inherit; font-weight: 650; }
.trace-heading { flex-wrap: wrap; gap: 3px 12px; }
.online-panel { margin-bottom: 12px; }
.online-panel form { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 10px; }
.online-panel label { display: grid; gap: 3px; }
.online-panel select, .online-panel input, .primary { min-height: 34px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.primary { background: var(--green); color: #fff; border-color: var(--green); }
@media (max-width: 1100px) {
  .masthead-inner, .shell { padding: 13px 16px; }
  .workspace { grid-template-columns: 178px minmax(0, 1.4fr) minmax(245px, 1fr); gap: 9px; }
  .panel { padding: 12px; }
}
@media (max-width: 890px) {
  .workspace { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .cases { grid-column: 1 / -1; }
  .cases nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 600px) {
  .masthead-inner, .panel-heading { align-items: flex-start; flex-wrap: wrap; }
  .workspace, .online-panel form { grid-template-columns: minmax(0, 1fr); }
  .cases nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
