@font-face { font-family: "Plex Sans"; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ink: #1B1F2A; --ink-2: #4A4F5C; --muted: #6B6F7A;
  --paper: #F4F2EC; --surface: #FFFFFF; --rule: #DAD6CC; --rule-2: #ECE9E1;
  --red: #B3261E; --red-bg: #FBEDEB; --green: #2F6B4F; --grey: #6B6F7A;
  --sans: "Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 400 15px/1.5 var(--sans); color: var(--ink); background: var(--paper); }
h1, h2 { margin: 0; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); font-weight: 400; }

/* top bar */
.top { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: var(--ink); color: #F4F2EC; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 19px; letter-spacing: .01em; }
.mark { width: 14px; height: 14px; border: 2px solid #F4F2EC; border-radius: 50%; position: relative; }
.mark::after { content: ""; position: absolute; left: 9px; top: 9px; width: 7px; height: 2px; background: #F4F2EC; transform: rotate(45deg); }
.what { margin: 0; font-size: 15px; color: #C9C6BD; flex: 1; }
.tag { font-size: 12px; color: #C9C6BD; white-space: nowrap; }

/* three columns */
.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr) 340px; min-height: calc(100vh - 52px); }
.side code { font-family: var(--mono); font-size: 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 4px; word-break: break-all; }
.side p { font-size: 12px; color: var(--ink-2); }
.rail { background: #23283A; color: #E9E6DD; padding: 24px 16px; }
.rail-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #C9C6BD; margin-bottom: 8px; }
.rail-h .muted { display: block; text-transform: none; letter-spacing: 0; color: #9C998F; font-size: 12px; margin-top: 4px; }
.own-h { margin-top: 32px; }
.own-h.own-top { margin-top: 0; }
#own { margin-bottom: 32px; }
.samples ul { list-style: none; margin: 0 0 8px; padding: 0; }
.samples details.grp { border-top: 1px solid #343A50; }
.samples summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 12px 8px 8px; border-radius: 4px; }
.samples summary::-webkit-details-marker { display: none; }
.samples summary:hover { background: #2E3449; }
.samples summary:focus-visible { outline: 2px solid #F4F2EC; outline-offset: -2px; }
.samples .g-t { font-size: 15px; font-weight: 500; color: #F4F2EC; }
.samples .g-t::before { content: "+"; display: inline-block; width: 16px; font-family: var(--mono); color: #9C998F; }
.samples details[open] .g-t::before { content: "−"; }
.samples .g-n { font-family: var(--mono); font-size: 12px; color: #9C998F; }
.samples .g-s { grid-column: 1 / -1; padding-left: 16px; font-size: 12px; color: #9C998F; }
.samples .s-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.samples button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: baseline;
  text-align: left; background: none; border: 0; border-radius: 4px; padding: 6px 8px; font-size: 15px; line-height: 1.35; color: #E9E6DD; cursor: pointer; }
.samples button:hover { background: #2E3449; }
.samples button[aria-current="true"] { background: #F4F2EC; color: var(--ink); }
.samples .sid { font-family: var(--mono); font-size: 12px; color: #9C998F; }
.samples button[aria-current="true"] .sid { color: var(--ink-2); }
.samples button { padding: 6px 8px 6px 24px; min-height: 32px; }
.ownstatic { margin-top: 16px; border-top: 1px solid #343A50; padding-top: 12px; }
.ownstatic summary { cursor: pointer; font-size: 15px; font-weight: 500; color: #F4F2EC; padding: 4px 8px; border-radius: 4px; }
.ownstatic summary:hover { background: #2E3449; }
.ownstatic[open] summary { margin-bottom: 8px; }
.ownstatic p { margin: 0 8px 8px; font-size: 12px; color: #C9C6BD; }
.ownstatic code { font-family: var(--mono); font-size: 12px; color: #F4F2EC; background: #1B1F2A; border-radius: 4px; padding: 1px 4px; }
.mobile-pick { display: none; }
.own { display: grid; gap: 8px; }
.own > * { min-width: 0; }
.filebtn { display: flex; align-items: center; gap: 8px; min-width: 0; }
.filebtn label.pick { flex: none; font-size: 12px; color: #F4F2EC; border: 1px solid #8A8678; border-radius: 4px; padding: 6px 10px; cursor: pointer; }
.filebtn label.pick:hover { border-color: #F4F2EC; }
.filebtn .fname { font-size: 12px; color: #9C998F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.own input[type=file]:focus-visible + label.pick { outline: 2px solid #F4F2EC; outline-offset: 2px; }
.own label, .own .own-l { font-size: 12px; color: #C9C6BD; }
.own input[type=file] { font-size: 12px; color: #C9C6BD; }
.own textarea { width: 100%; background: #1B1F2A; border: 1px solid #4A4F5C; border-radius: 4px; padding: 8px; color: #F4F2EC; resize: vertical; font-family: var(--mono); font-size: 12px; }
.primary { margin-top: 4px; background: #F4F2EC; color: var(--ink); border: 0; border-radius: 4px; padding: 10px 12px; font-weight: 600; cursor: pointer; }
.primary:hover { background: #FFFFFF; }
.primary:disabled { opacity: .6; cursor: progress; }
.hint { margin: 0; font-size: 12px; color: #C9C6BD; min-height: 20px; }
.hint.err { color: #F2B8B5; }

/* main */
.main { padding: 24px 32px 32px; min-width: 0; }
.dochead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.kicker { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.kicker .syn { color: var(--red); font-weight: 500; }
h1 { font-size: 15px; line-height: 1.4; }
.reader { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.ghost { font-size: 12px; color: var(--ink); border: 1px solid var(--rule); border-radius: 4px; padding: 6px 10px; text-decoration: none; background: var(--surface); white-space: nowrap; }
.ghost:hover { border-color: var(--ink-2); }
.verdict { margin: 20px 0 16px; font-size: 28px; line-height: 1.25; font-weight: 500; }
.verdict b { font-family: var(--mono); font-weight: 500; }
.verdict > b:first-child { font-size: 40px; }
.verdict .bad { color: var(--red); }
.verdict .good { color: var(--green); }
.verdict .sub { display: block; font-size: 15px; font-weight: 400; line-height: 1.5; color: var(--ink-2); margin-top: 4px; }
/* who read the results: one bar, APA rules and what the model added */
.rb { margin: 20px 0 12px; }
.rb-h { font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 8px; }
.rb-bar { display: flex; height: 32px; border-radius: 4px; overflow: hidden; }
.rb-seg { display: flex; align-items: center; padding: 0 8px; min-width: 32px; }
.rb-seg b { font-family: var(--mono); font-weight: 500; font-size: 15px; }
.rb-seg.rules { background: #C9C4B6; color: var(--ink); }
.rb-seg.model { background: var(--ink); color: #F4F2EC; }
.rb-k { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.rb-k b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.rb-k .sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }
.sw.rules { background: #C9C4B6; } .sw.model { background: var(--ink); }

/* p scale in the verdict cell (log axis) */
.ps { position: relative; display: block; width: 180px; height: 30px; margin-bottom: 8px; }
.ps-axis { position: absolute; left: 0; right: 0; top: 8px; height: 1px; background: var(--grey); }
.ps-t { position: absolute; top: 5px; height: 7px; border-left: 1px solid var(--grey); }
.ps-05 { position: absolute; top: 1px; height: 15px; border-left: 1px dashed var(--ink-2); }
.ps-tl { position: absolute; top: 17px; transform: translateX(-50%); font-family: var(--mono); font-size: 12px; color: var(--muted); line-height: 1; }
.ps-tl.s05 { color: var(--ink-2); }
.ps-link { position: absolute; top: 7px; height: 3px; background: var(--ink-2); }
.ps.cross .ps-link { background: var(--red); }
.ps-dot { position: absolute; top: 3px; width: 11px; height: 11px; margin-left: -5px; border-radius: 50%; border: 2px solid var(--ink); background: var(--surface); }
.ps-dot.rec { background: var(--ink); }
.ps.cross .ps-dot { border-color: var(--red); } .ps.cross .ps-dot.rec { background: var(--red); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; color: var(--ink-2); margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.tabs span { font-family: var(--mono); font-size: 12px; margin-left: 4px; }

.tablewrap { background: var(--surface); border: 1px solid var(--rule); border-top: 0; border-radius: 0 0 8px 8px; overflow-x: auto; }
table.results { width: 100%; border-collapse: collapse; }
.results th { font-family: var(--sans); text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.results td { padding: 12px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
.results tr.row { cursor: pointer; }
.results tr.row:hover td { background: #FAF9F5; }
.results tr.flag td { background: var(--red-bg); }
.results tr.flag:hover td { background: #F8E3E0; }
.results .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.results .c-page { width: 56px; font-family: var(--mono); }
.results .c-v { width: 170px; }
.quote { font-size: 15px; overflow-wrap: anywhere; }
tr.detail .full { display: block; margin-top: 4px; overflow-wrap: anywhere; color: var(--muted); }
.quote mark { white-space: nowrap; background: none; font-family: var(--mono); font-size: 15px; font-weight: 500; border-bottom: 2px solid var(--ink-2); padding: 0 1px; }
tr.flag .quote mark { border-bottom-color: var(--red); }
.readas { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 4px; }
.range { display: block; font-family: var(--sans); font-size: 12px; color: var(--muted); white-space: nowrap; }
.v { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 15px; }
.v::before { font-family: var(--mono); font-size: 12px; }
.v.bad { color: var(--red); } .v.bad::before { content: "✕"; }
.v.good { color: var(--green); } .v.good::before { content: "✓"; }
.v.grey { color: var(--grey); } .v.grey::before { content: "–"; }
.vnote { display: block; font-size: 12px; color: var(--ink-2); font-weight: 400; margin-top: 2px; }
.key { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
tr.detail td { background: #FAF9F5; font-size: 12px; color: var(--ink-2); padding: 12px 12px 16px 68px; }
tr.detail .mj { display: block; margin-top: 8px; }
tr.detail code { font-family: var(--mono); font-size: 12px; background: var(--surface); border: 1px solid var(--rule-2); border-radius: 4px; padding: 2px 4px; }
.empty { margin: 0; padding: 24px; color: var(--ink-2); }
.foot { font-size: 12px; color: var(--muted); margin: 12px 0 0; max-width: 72ch; }

/* right column */
.side { border-left: 1px solid var(--rule); padding: 24px; background: #EFECE4; }
.side h2 { font-size: 15px; line-height: 1.35; }
.sb { width: 100%; border-collapse: collapse; margin: 16px 0 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; }
.sb caption { text-align: left; font-size: 12px; color: var(--ink-2); padding-bottom: 8px; caption-side: top; }
.sb th, .sb td { padding: 8px 12px; border-bottom: 1px solid var(--rule-2); }
.sb tbody tr:last-child th, .sb tbody tr:last-child td { border-bottom: 0; }
.sb thead th { font-size: 12px; font-weight: 500; color: var(--ink-2); text-align: right; white-space: nowrap; width: 30%; }
.sb tbody th { white-space: nowrap; font-size: 15px; font-weight: 400; color: var(--ink); text-align: left; }
.sb td { text-align: right; font-family: var(--mono); font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sb td.b { color: var(--red); }
.side .muted { font-size: 12px; margin: 8px 0 16px; }
.claims { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.claims li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.claims .what { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.claims .why { font-size: 12px; color: var(--ink-2); margin: 4px 0 8px; }
.missed { font-size: 15px; margin: 16px 0 0; }
.missed b { font-family: var(--mono); color: var(--red); font-weight: 500; }

@media (max-width: 1200px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .side { grid-column: 2; border-left: 0; border-top: 1px solid var(--rule); }
}
@media (max-width: 900px) {
  .top { flex-wrap: wrap; gap: 8px 16px; padding: 12px 16px; }
  .what { order: 3; flex-basis: 100%; font-size: 12px; }
  .layout { grid-template-columns: 1fr; }
  .rail { padding: 16px; }
  .samples, .rail > .samples-h { display: none; }
  .rail { display: flex; flex-direction: column; min-width: 0; }
  .rail > *, .main, .side { min-width: 0; max-width: 100%; }
  .mobile-pick select { width: 100%; min-width: 0; }
  .kicker, h1 { overflow-wrap: anywhere; }
  .own-top, #own { order: 2; }
  #own { margin-bottom: 0; }
  .own-h.own-top { margin-top: 20px; }
  .mobile-pick { display: grid; gap: 4px; font-size: 12px; color: #C9C6BD; }
  .mobile-pick select { padding: 10px; border-radius: 4px; border: 0; background: #F4F2EC; color: var(--ink); }
  .own-h { margin-top: 16px; }
  .main { padding: 16px; }
  .side { grid-column: 1; padding: 16px; }
  .results thead { display: none; }
  .results, .results tbody, .results tr, .results td { display: block; width: 100%; }
  .results tr.row { padding: 12px; border-bottom: 1px solid var(--rule-2); display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .results td { border: 0; padding: 0; }
  .results .c-page { grid-column: 1 / -1; width: auto; font-size: 12px; color: var(--muted); }
  .results .c-page::before { content: "Page "; }
  .results td.quote-td { grid-column: 1 / -1; }
  .results .num { text-align: left; }
  .results td.num::before { content: attr(data-label); display: block; font-family: var(--sans); font-size: 12px; color: var(--muted); }
  .results .c-v { grid-column: 1 / -1; width: auto; }
  .results tr.flag { background: var(--red-bg); }
  tr.detail td { padding: 12px; }
  .verdict { font-size: 19px; }
  .verdict > b:first-child { font-size: 28px; }
  .ownstatic { order: 3; }
  tr.detail code { word-break: break-all; }
}
.results th.num { font-family: var(--sans); }

.main a, .side a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.main a.ghost { text-decoration: none; }
