:root {
  color-scheme: light;
  --page: #ffffff; --surface: #ffffff; --ink: #272727; --ink2: #3e3e3e; --muted: #3e3e3e;
  --grid: #e6e6e6; --ring: #e6e6e6; --accent: #f0523d; --code: #f6f6f6;
  --sel: #fce9e6;
}
* { box-sizing: border-box; }
/* Text scales with the window: about 14px at 1280 wide, 17px at 1920, 19px from 2400.
   Every font size below is in rem, so it follows; the plots read this too. */
html { font-size: clamp(14px, 0.45vw + 8.5px, 19px); }

/* The experiment's design, at the top of the model. */
.exp-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 2px; }
.exp-title .exp-name { font-weight: 400; color: var(--ink2); font-size: 1rem; margin-left: 8px; }
.design { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 1.07rem; font-weight: 700; margin: 4px 0 6px; }
.design .k { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.04em; margin-right: 5px; }
.design .vary { color: var(--accent); }
.design .ctl { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.design .count { color: var(--ink2); }
.exp-about { color: var(--ink2); margin: 0 0 10px; max-width: 90ch; }
.model-line { font-size: 1rem; font-weight: 600; margin: 6px 0 2px; border-top: 1px solid var(--grid); padding-top: 8px; }
body { margin: 0; background: var(--page); color: var(--ink);
  font: 0.933rem/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 12px 16px;
  border-bottom: 1px solid var(--ring); background: var(--surface); }
h1 { font-size: 1.2rem; margin: 0; }
h2 { font-size: 1.133rem; margin: 0 0 4px; }
h3 { font-size: 0.933rem; margin: 16px 0 4px; }
[hidden] { display: none !important; }
.brand, .account { display: flex; align-items: center; gap: 0.7rem; }
.brand { font-weight: 700; }
.brand img { width: 2rem; height: 2rem; }
.account { margin-left: auto; flex-wrap: wrap; }
.account a { color: var(--ink); }
.account button, .signin button { border: 1px solid var(--grid); border-radius: 6px;
  background: var(--code); color: var(--ink); cursor: pointer; padding: 0.4rem 0.7rem; }
.gate { display: grid; place-items: center; min-height: 100vh; background: var(--code); padding: 1rem; }
.gate .signin { width: min(100%, 26rem); padding: 2rem; }
.signin h1 { margin-top: 1.6rem; font-size: 1.5rem; }
.signin p { color: var(--muted); }
.primary { display: block; padding: 0.7rem; text-align: center; border-radius: 6px;
  background: var(--accent); color: #151515; font-weight: 700; text-decoration: none; }
.muted { color: var(--muted); }
code { font: 0.8rem ui-monospace, Consolas, monospace; background: var(--code); padding: 1px 4px; border-radius: 4px; }

.layout { display: grid; grid-template-columns: 20rem minmax(0, 1fr); gap: 16px; padding: 16px; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }
aside input[type=search] { width: 100%; padding: 0.75rem 0.9rem 0.75rem 2.6rem; font: 600 1.1rem/1.3 system-ui, sans-serif;
  color: var(--ink); border: 2px solid #b9b8ae; border-radius: 10px; background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2352514e' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E") no-repeat 0.8rem center / 1.25rem;
  box-shadow: 0 1px 3px rgba(11, 11, 11, 0.10); transition: border-color 0.12s, box-shadow 0.12s; }
aside input[type=search]::placeholder { color: var(--muted); font-weight: 500; }
aside input[type=search]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240, 82, 61, 0.2); }
.hint { color: var(--muted); font-size: 0.8rem; margin: 6px 2px 12px; }

.exp { background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; }
.exp-code { font-weight: 650; }
.exp-desc { color: var(--ink2); font-size: 0.833rem; margin: 2px 0 6px; }
/* Model buttons: raised cards with a chevron, so they read as clickable. */
.mod { position: relative; display: block; width: 100%; text-align: left; font: inherit; color: var(--ink);
  background: linear-gradient(#ffffff, #f6f6f6); border: 1px solid #d6d5ce; border-radius: 8px;
  padding: 8px 28px 8px 10px; margin: 6px 0 0; cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 1px 2px rgba(11, 11, 11, 0.12);
  transition: box-shadow 0.12s, transform 0.12s, border-color 0.12s; }
.mod::after { content: "›"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 1.333rem; color: var(--muted); }
.mod:hover { border-color: #b9b8ae; transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 3px 6px rgba(11, 11, 11, 0.14); }
.mod:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(11, 11, 11, 0.18) inset; }
.mod.on { background: linear-gradient(#fff, var(--sel)); border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset; }
.mod.on::after { color: var(--accent); }
.mod .meta { color: var(--muted); font-size: 0.8rem; }
.why { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.chip { font: 0.733rem/1 ui-monospace, Consolas, monospace; color: var(--ink2); background: var(--code);
  border: 1px solid var(--grid); border-radius: 999px; padding: 3px 7px; }

.panel { background: var(--surface); border: 1px solid var(--ring); border-radius: 10px;
  padding: 14px 16px; margin: 0 0 12px; }
.close { float: right; border: 1px solid var(--grid); background: var(--code); border-radius: 6px;
  width: 30px; height: 30px; font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--ink2); }
.close:hover { background: var(--grid); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
details { margin-top: 8px; } summary { cursor: pointer; color: var(--ink2); font-weight: 600; }
.rule { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.rule input { width: 80px; }
select, input, button { font: inherit; }
.ok { color: #006300; } .warn { color: #a34a00; }

/* Tabs: raised buttons; the active one joins the panel below it. */
.tabs { display: flex; gap: 6px; margin: 0 0 -1px; flex-wrap: wrap; position: relative; z-index: 1; }
.tabs button { border: 1px solid #d6d5ce; border-bottom-color: var(--ring); border-radius: 10px 10px 0 0;
  font: 700 1.15rem/1.2 system-ui, sans-serif; min-width: 11rem;
  background: linear-gradient(#ffffff, #ecebe6); padding: 0.75rem 1.5rem; cursor: pointer; color: var(--ink2);
  box-shadow: 0 -1px 2px rgba(11, 11, 11, 0.06); transition: background 0.12s, color 0.12s; }
.tabs button:hover { background: linear-gradient(#ffffff, #f4f3ef); color: var(--ink); }
.tabs button.on { background: var(--surface); color: var(--ink); font-weight: 600; cursor: default;
  border-color: var(--ring); border-bottom-color: var(--surface); border-top: 4px solid var(--accent);
  padding-top: calc(0.75rem - 3px); color: var(--accent); }
.view { border-top-left-radius: 0; }

/* The view on the left, the protein panel on the right (stacked when narrow). */
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1350px) { .split { grid-template-columns: minmax(0, 1fr); } }
.protein-panel { position: sticky; top: 8px; border-left: 1px solid var(--grid); padding-left: 16px; }
@media (max-width: 1350px) { .protein-panel { position: static; border-left: 0; padding-left: 0;
  border-top: 1px solid var(--grid); padding-top: 12px; } }
.tblwrap.short { max-height: 260px; }

/* The default truth set's toggle: big and green, so it invites a press. */
.truth-btn { flex-basis: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  font: 600 1rem/1.3 system-ui, sans-serif; padding: 10px 16px; border-radius: 10px; cursor: pointer;
  border: 2px solid #1baf7a; color: #0e7a53; background: linear-gradient(#f4fcf8, #e3f6ee);
  box-shadow: 0 1px 3px rgba(11, 11, 11, 0.12); transition: transform 0.12s, box-shadow 0.12s, background 0.12s; }
.truth-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(27, 175, 122, 0.25); }
.truth-btn:active { transform: translateY(0); }
.truth-btn .dot { width: 18px; height: 18px; border-radius: 50%; border: 3px solid currentColor; flex: none; }
.truth-btn .sub { font-weight: 400; font-size: 0.833rem; opacity: 0.85; }
.truth-btn.on { background: linear-gradient(#22c28a, #169a6b); color: #fff; border-color: #138a60; }
.truth-btn.on .dot { background: #fff; border-color: #fff; box-shadow: 0 0 0 3px #22c28a inset; }
/* Test buttons: every test visible, its hits under the current rule. */
.test-pick { flex-basis: 100%; display: flex; gap: 10px; align-items: flex-start; }
.test-label { font-weight: 700; font-size: 1rem; padding-top: 0.45rem; }
#test-chips { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.test-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.test-stratum { font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.04em; min-width: 5.5rem; }
.test-btn { display: inline-flex; align-items: baseline; gap: 8px; font: 700 1rem/1.2 system-ui, sans-serif;
  padding: 0.45rem 0.8rem; border-radius: 8px; cursor: pointer; color: var(--ink);
  border: 1px solid #d6d5ce; background: linear-gradient(#ffffff, #f0efea);
  box-shadow: 0 1px 2px rgba(11, 11, 11, 0.12); transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s; }
.test-btn:hover { transform: translateY(-1px); border-color: #b9b8ae; box-shadow: 0 3px 6px rgba(11, 11, 11, 0.14); }
.test-btn .n { font-weight: 600; font-size: 0.8rem; }
.test-btn .nu { color: #c63d3d; } .test-btn .nd { color: #2a78d6; }
.test-btn.on { background: linear-gradient(#3b88e3, #2a6fc4); border-color: #215ba3; color: #fff; cursor: default;
  box-shadow: 0 1px 3px rgba(11, 11, 11, 0.25) inset; transform: none; }
.test-btn.on .nu, .test-btn.on .nd { color: #fff; }
.test-select { font: 700 1rem system-ui, sans-serif; padding: 0.45rem 0.6rem; border: 2px solid #b9b8ae; border-radius: 8px; }
label.small { font-size: 0.833rem; color: var(--ink2); }
tr.sel td { background: var(--sel); }
.bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 8px; }
.bar input[type=search] { min-width: 220px; padding: 4px 8px; }
.csv { margin-left: auto; border: 1px solid var(--grid); background: var(--code); border-radius: 6px;
  padding: 4px 10px; cursor: pointer; }
.plot { width: 100%; }

.tblwrap { overflow-x: auto; margin: 8px 0; max-height: 520px; overflow-y: auto; }
table.tbl { border-collapse: collapse; font-size: 0.833rem; font-variant-numeric: tabular-nums; }
table.tbl th, table.tbl td { padding: 4px 10px; border-bottom: 1px solid var(--grid); text-align: right; white-space: nowrap; }
table.tbl th { color: var(--ink2); font-weight: 600; background: var(--surface); position: sticky; top: 0; }
table.tbl td:first-child, table.tbl th:first-child { text-align: left; }
table.tbl td.l, table.tbl th.l { text-align: left; }
table.tbl tr.click { cursor: pointer; }
table.tbl tr.click:hover td { background: var(--code); }
.kv td { text-align: left !important; }
