:root {
  color-scheme: light;
  --text: #222;
  --background: #fff;
  --border: #ddd;
  --accent: #333;
  --control-border: #bbb;
  --button: #f5f5f5;
  --button-hover: #e9e9e9;
  --focus: #2864b4;
  --muted: #666;
  --danger: #b42318;
  --danger-text: #a21d1d;
  --danger-hover: #901c13;
  --table-header: #f6f6f6;
  --secondary: #555;
  --row-border: #e7e7e7;
  --row-hover: #fafafa;
  --selected: #f1f5fa;
  --link: #22558a;
  --dialog-border: #999;
  --backdrop: #0005;
  --code-background: #f7f7f7;
  --flagged: #a52a25;
  --legitimate: #276442;
  --abstain: #865b08;
  --chart-grid: #e4e4e4;
  --score: #225f9d;
  --chart-lower: #737373;
  --tag-category-saturation: 90%;
  --tag-category-lightness: 45%;
  --tag-category-text-lightness: 27%;
  --tag-cheat: #fff0ee;
  --tag-cheat-text: #a21d1d;
  --tag-legit: #edf7ef;
  --tag-legit-text: #28643d;
}
:root[data-theme="dark"] {
  --text: #e5e7eb;
  --background: #17191c;
  --border: #373d45;
  --accent: #abc9ee;
  --control-border: #505761;
  --button: #272c32;
  --button-hover: #343b44;
  --focus: #8cbdff;
  --muted: #a6adb6;
  --danger: #b7352d;
  --danger-text: #ff9a94;
  --danger-hover: #ce4038;
  --table-header: #22262c;
  --secondary: #bbc1ca;
  --row-border: #30363e;
  --row-hover: #23282f;
  --selected: #25374c;
  --link: #92c5ff;
  --dialog-border: #626b78;
  --backdrop: #0009;
  --code-background: #202328;
  --flagged: #ff9a94;
  --legitimate: #86cfa4;
  --abstain: #edc46b;
  --chart-grid: #373d45;
  --score: #85baff;
  --chart-lower: #b0b8c4;
  --tag-category-saturation: 95%;
  --tag-category-lightness: 64%;
  --tag-category-text-lightness: 74%;
  --tag-cheat: #3b2528;
  --tag-cheat-text: #ffaaa2;
  --tag-legit: #23372b;
  --tag-legit-text: #98d7ad;
  color-scheme: dark;
}
:root { font-family: Arial, Helvetica, sans-serif; color: var(--text); background: var(--background); font-size: 14px;  }
* { box-sizing: border-box; }
body { margin: 0; }
header { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.scan-tools { display: flex; align-items: center; gap: 8px; }
#scan-details { margin: 0; }
#scan-summary { padding: 7px 3px; color: var(--muted); font-size: 12px; }
#scan-details[open] > summary { color: var(--text); }
.scan-panel { position: absolute; z-index: 10; right: 24px; top: calc(100% - 8px); width: min(480px, calc(100vw - 48px)); max-height: 70vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 4px; padding: 16px; background: var(--background); box-shadow: 0 8px 24px #0002; }
.scan-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.scan-pending { border-top: 1px solid var(--border); padding-top: 12px; margin-bottom: 16px; font-size: 13px; }
#scan-pending-count { margin-left: 8px; font-size: 20px; font-variant-numeric: tabular-nums; }
#scan-pending-details { margin: 8px 0; }
#scan-pending-samples { font: 12px monospace; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
#scan-pending-note:empty, #scan-pending-updated:empty { display: none; }
#scan-state, #scan-count { color: var(--muted); font-size: 13px; }
#scan-progress { display: block; width: 100%; height: 10px; margin: 10px 0 16px; accent-color: var(--focus); }
.scan-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 12px; }
.scan-counts dt { color: var(--muted); font-size: 12px; }
.scan-counts dd { margin: 4px 0 0; font-size: 20px; font-variant-numeric: tabular-nums; }
.scan-panel [id$="-current"] { overflow-wrap: anywhere; white-space: pre-line; }
.scan-panel [id$="-error"]:empty, .scan-panel [id$="-note"]:empty,
.scan-panel [id$="-current"]:empty, .scan-panel [id$="-last"]:empty,
.scan-panel [id$="-last-failure"]:empty { display: none; }
@media (max-width: 600px) { header { gap: 12px; flex-wrap: wrap; } .scan-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.upload-table-wrap { max-height: 40vh; overflow: auto; border: 1px solid var(--border); margin-top: 16px; }
.upload-table { min-width: 620px; font-size: 12px; } .upload-table td { overflow-wrap: anywhere; max-width: 260px; }
#upload-status { min-height: 18px; } #uploader .dialog-actions { flex-wrap: wrap; }
#importer { width: min(850px, 94vw); border-radius: 16px; padding: 24px; background: linear-gradient(145deg, #202b3b, #191d25 35%); box-shadow: 0 24px 90px #0008; }
#import-selection { display: inline-block; margin: 10px 0 18px; padding: 5px 10px; border-radius: 20px; color: #b7d5ff; background: #293b56; font-size: 12px; }
.import-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; }
.import-steps li { display: flex; align-items: center; gap: 8px; padding: 10px 8px; border-bottom: 2px solid #353d4b; color: #9faabb; font-size: 12px; }
.import-steps span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: #2d3542; }
.import-steps [aria-current] { color: #c7dfff; border-color: #76aaff; }
.import-steps [aria-current] span { background: #3767ac; color: white; }
.import-steps .complete { color: #8edcbb; border-color: #448b72; }
#importer button { border-radius: 8px; }
#importer .dialog-actions { border-top: 1px solid #353d4b; padding-top: 16px; margin-top: 8px; }
#import-next, #import-confirm { background: #376ed2; border-color: #5689e6; color: #fff; padding: 9px 22px; font-weight: 600; }
#import-next:hover:enabled, #import-confirm:hover:enabled { background: #477de0; }
#importer [data-import-status="legit"] { color: #8ee0b8; border-color: #38644f; background: #223c32; }
#importer [data-import-status="unknown"] { color: #ebc884; border-color: #665637; background: #3b3325; }
#importer [data-import-step] > label { margin: 14px 0; }
.client-picker { margin: 18px 0; padding: 0; border: 0; min-width: 0; }
.client-picker legend { margin-bottom: 12px; font-weight: 600; }
.client-search { margin-bottom: 8px; }
#import-client-selection:empty { display: none; }
#import-client-more { margin-top: 10px; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 10px; max-height: clamp(120px, calc(92vh - 450px), 280px); overflow-y: auto; padding: 4px; }
.client-option { position: relative; cursor: pointer; padding: 0; text-align: left; }
.client-card { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 12px; }
#importer .client-option[aria-pressed="true"] { border-color: #8cbaff; background: #263e61; box-shadow: inset 0 0 0 1px #8cbaff; }
.client-option[aria-pressed="true"] .client-card::after { content: '✓'; color: #a9cdff; margin-left: auto; font-weight: bold; }
.client-icon { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 8px; background: #17191c; }
.client-icon > * { grid-area: 1 / 1; }
.client-icon img { width: 40px; height: 40px; object-fit: contain; }
.client-icon-fallback { color: #abc9ee; font-size: 22px; font-weight: bold; }
.client-name { font-size: 13px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.import-cheats { display: grid; gap: 8px; margin-top: 16px; }
.import-cheat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 12px; border: 1px solid #343c49; border-radius: 10px; background: #222833; }
.import-cheat-name { text-transform: capitalize; font-weight: 600; }
.import-status-options { display: flex; gap: 5px; }
#importer .import-status-option { min-width: 100px; padding: 6px 10px; background: #1c222c; border-color: transparent; color: #aeb8c7; }
#importer .import-status-option[data-status="legit"] { color: #8ee0b8; }
#importer .import-status-option[data-status="cheating"] { color: #ffa5af; }
#importer .import-status-option[data-status="unknown"] { color: #ebc884; }
#importer .import-status-option:hover { background: #303b4b; }
#importer .import-status-option[aria-pressed="true"] { border-color: currentColor; font-weight: 700; }
#importer .import-status-option[aria-pressed="true"]::before { content: '✓ '; }
#importer .import-status-option[data-status="legit"][aria-pressed="true"] { background: #234b3d; }
#importer .import-status-option[data-status="cheating"][aria-pressed="true"] { background: #542f3a; }
#importer .import-status-option[data-status="unknown"][aria-pressed="true"] { background: #4b402a; }
@media (max-width: 550px) {
  #importer { padding: 16px; }
  .import-cheat-row { flex-direction: column; align-items: stretch; }
  .import-status-options { display: grid; grid-template-columns: repeat(3, 1fr); }
  #importer .import-status-option { min-width: 0; padding: 8px 4px; font-size: 12px; }
  .import-steps li { flex-direction: column; gap: 5px; padding: 8px 2px; }
}
.import-preview-scroll { max-height: 35vh; overflow: auto; border: 1px solid var(--border); }
.import-preview-table { min-width: 620px; } .import-preview-table td { width: 33%; }
.import-preview-table details { margin: 8px 0 0; font: 12px Arial, sans-serif; }
#import-status { min-height: 18px; }
#import-status:empty { display: none; }
#importer .dialog-actions { margin-top: 18px; }
h1 { font-size: 20px; margin: 0; } h2 { margin: 0; font-size: 18px; } h3 { font-size: 15px; }
main { padding: 20px 24px; }
button, input, select, textarea { font: inherit; border: 1px solid var(--control-border); border-radius: 3px; padding: 7px 9px; background: var(--background); color: inherit; }
button { cursor: pointer; background: var(--button); white-space: nowrap; } button:hover:enabled { background: var(--button-hover); } button:disabled { cursor: default; opacity: .45; }
.button-link { display: inline-block; border: 1px solid var(--control-border); border-radius: 3px; padding: 7px 9px; background: var(--button); color: var(--text); text-decoration: none; white-space: nowrap; }
.button-link:hover { background: var(--button-hover); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; cursor: pointer; }
textarea { resize: vertical; min-height: 34px; } label { display: flex; flex-direction: column; gap: 5px; }
.filters, .toolbar { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.filters #identity, .filters #sample-id { width: 310px; max-width: 100%; } .tag-filter { flex: 1; min-width: 220px; max-width: 480px; }
.identity-filter { position: relative; max-width: 100%; }
.identity-matches { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; width: 100%; max-height: 250px; overflow-y: auto; padding: 4px; border: 1px solid var(--border); border-radius: 3px; background: var(--background); box-shadow: 0 4px 12px #0002; }
.identity-matches button { display: block; width: 100%; border: 0; background: transparent; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.identity-matches button[aria-selected="true"] { background: var(--selected); }
.identity-matches small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.identity-matches p { margin: 6px; color: var(--muted); font-size: 12px; }
@media (max-width: 650px) { .identity-filter { width: 100%; } }
.muted, .hint { color: var(--muted); } .hint { margin: 8px 0 14px; font-size: 12px; }
details { margin: 12px 0 18px; } summary { cursor: pointer; width: fit-content; }
.tags-main { width: min(900px, 100%); margin: 0 auto; }
.tag-directory-toolbar { display: flex; align-items: end; gap: 12px; margin: 20px 0 12px; }
.tag-directory-toolbar label { flex: 1; }
#tag-search { width: 100%; }
.tag-directory-wrap { max-height: calc(100vh - 250px); }
.tag-directory { min-width: 520px; }
.tag-directory th:last-child, .tag-directory td:last-child { width: 270px; }
.tag-directory .tag { margin: 0; }
.tag-count-cell { display: flex; align-items: center; gap: 9px; min-height: 34px; }
.tag-count-value { min-width: 72px; font-size: 18px; font-variant-numeric: tabular-nums; }
.tag-count-label { color: var(--muted); font-size: 12px; }
.tag-empty { color: var(--muted); text-align: center; }
.toolbar { align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.toolbar strong { font-size: 13px; } .check { flex-direction: row; align-items: center; gap: 7px; margin-right: 10px; }
#edit-tags { flex: 1; min-width: 180px; } #status { min-height: 18px; margin: 4px 0 12px; }
.tag-editor { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding: 5px; border: 1px solid var(--border); border-radius: 3px; min-height: 39px; margin-top: 5px; }
.tag-editor .tag { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 3px 6px; background: var(--button); }
.tag-editor .tag span { overflow-wrap: anywhere; min-width: 0; }
.tag-remove { border: 0; background: transparent; padding: 0 3px; font-size: 17px; line-height: 1; }
.tag-add { padding: 4px 7px; font-size: 12px; }
.sample-tag-field { flex: 1; min-width: 200px; }
.tag-dialog { background: var(--background); color: var(--text); width: min(520px, 94vw); }
.tag-dialog p { line-height: 1.5; overflow-wrap: anywhere; }
.confirmation-description { white-space: pre-line; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 20px; }
.tag-picker-search { margin-top: 16px; }
.tag-choices { max-height: 240px; overflow: auto; display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.tag-choices button { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; text-align: left; }
.tag-create { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.danger-dialog { border: 2px solid var(--danger); }
.danger-dialog h2, .danger-dialog .confirmation-description { color: var(--danger-text); }
button.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
button.danger:hover:enabled { background: var(--danger-hover); }
.tag-review-group { margin: 14px 0; } .tag-review-group h3 { margin: 0 0 6px; }
.error, #login-error { color: var(--danger-text); }
.table-wrap { overflow: auto; max-height: 65vh; border: 1px solid var(--border); }
table { border-collapse: collapse; width: 100%; min-width: 1020px; text-align: left; }
th { position: sticky; top: 0; z-index: 1; font-size: 12px; background: var(--table-header); color: var(--secondary); font-weight: 600; white-space: nowrap; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--row-border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; } tbody tr:hover { background: var(--row-hover); }
tr.selected { background: var(--selected); } .selection { width: 35px; }
.uuid { font-family: Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.identity-uuid { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.tag { display: inline-block; border: 1px solid var(--border); border-radius: 3px; padding: 2px 5px; margin: 0 4px 4px 0; font-size: 12px; overflow-wrap: anywhere; max-width: 240px; white-space: pre-wrap; }
.tag-classified[data-tag-status="cheat"] { --tag-status-color: var(--tag-cheat); --tag-status-text: var(--tag-cheat-text); }
.tag-classified[data-tag-status="legit"] { --tag-status-color: var(--tag-legit); --tag-status-text: var(--tag-legit-text); }
.tag-classified, .tag-editor .tag-classified, button.tag-classified:hover:enabled {
  --tag-category-color: hsl(var(--tag-category-hue), var(--tag-category-saturation), var(--tag-category-lightness));
  display: inline-flex;
  align-items: stretch;
  vertical-align: top;
  gap: 0;
  padding: 0;
  border-left: 3px solid var(--tag-category-color);
  color: var(--text);
  background: var(--button);
  line-height: 1.4;
}
.tag-category { min-width: 0; padding: 3px 6px; color: hsl(var(--tag-category-hue), var(--tag-category-saturation), var(--tag-category-text-lightness)); font-weight: 600; }
.tag-status { padding: 3px 6px; border-left: 1px solid var(--border); background: var(--tag-status-color); color: var(--tag-status-text); font-weight: 600; white-space: nowrap; }
.tag-count { padding: 3px 5px; color: var(--muted); white-space: nowrap; }
.tag-separator { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.tag-classified .tag-remove { margin: 0; padding: 0 6px; border-left: 1px solid var(--border); border-radius: 0; color: var(--muted); }
button.tag-classified:hover:enabled { border-top-color: var(--control-border); border-right-color: var(--control-border); border-bottom-color: var(--control-border); }
.link { color: var(--link); background: transparent; border: 0; padding: 0; text-align: left; white-space: normal; }
.sort { padding: 0; border: 0; background: transparent; font-weight: 600; font-size: inherit; }
.sort span { margin-left: 4px; } .number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pagination { display: flex; justify-content: end; align-items: center; gap: 8px; margin-top: 14px; } .pagination span { margin-right: auto; color: var(--muted); }
dialog { width: min(1000px, 94vw); max-height: 92vh; border: 1px solid var(--dialog-border); border-radius: 4px; padding: 20px; }
dialog::backdrop { background: var(--backdrop); } .dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
dl { display: grid; grid-template-columns: 110px 1fr; gap: 9px 14px; } dt { color: var(--muted); } dd { margin: 0; overflow-wrap: anywhere; }
#sample-tags label { flex: 1; } pre { background: var(--code-background); border: 1px solid var(--border); padding: 12px; overflow: auto; max-height: 48vh; font: 12px/1.6 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.inference-model { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 14px; }
.inference-model h4 { margin: 0 0 4px; font-size: 16px; } .inference-model > p { margin: 4px 0 10px; }
.model-hash { margin: 8px 0; font-size: 12px; } .model-hash code { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.inference-summary { display: flex; flex-wrap: wrap; gap: 14px 24px; margin: 16px 0; }
.inference-metric { display: grid; gap: 3px; } .inference-metric strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.inference-metric > span { font-size: 12px; color: var(--secondary); }
.flagged { color: var(--flagged); } .legitimate { color: var(--legitimate); } .abstain { color: var(--abstain); } .unknown { color: var(--muted); }
.decision { display: inline-block; padding: 3px 6px; border: 1px solid currentColor; border-radius: 3px; font-size: 12px; white-space: nowrap; }
.inference-figure { margin: 16px 0; padding: 8px; border: 1px solid var(--border); overflow-x: auto; }
.inference-chart { display: block; width: 100%; min-width: 620px; height: auto; } .inference-chart text { font: 12px Arial, sans-serif; fill: var(--secondary); }
.chart-grid { stroke: var(--chart-grid); } .chart-score, .chart-threshold, .chart-lower { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-score { stroke: var(--score); } .chart-threshold { stroke: var(--flagged); stroke-dasharray: 6 4; } .chart-lower { stroke: var(--chart-lower); stroke-dasharray: 3 4; }
.chart-point { fill: currentColor; } .chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; font-size: 12px; padding-bottom: 4px; }
.chart-legend span::before { content: ''; display: inline-block; width: 20px; margin: 0 6px 3px 0; border-top: 2px solid var(--score); }
.chart-legend .legend-threshold::before { border-top: 2px dashed var(--flagged); } .chart-legend .legend-lower::before { border-top: 2px dotted var(--chart-lower); }
.inference-table-wrap { overflow: auto; max-height: 48vh; border: 1px solid var(--border); }
.inference-table { min-width: 700px; font-size: 12px; } .inference-table th, .inference-table td { padding: 8px; }
.inference-table small { display: block; margin-top: 4px; } .inference-table details { margin: 6px 0 0; }
.inference-table td:last-child { min-width: 180px; max-width: 350px; overflow-wrap: anywhere; } .inference-table td p { margin: 4px 0; }
.score-cell { min-width: 100px; font-variant-numeric: tabular-nums; } .score-cell meter { display: block; width: 85px; height: 12px; margin-top: 4px; }
.score-cell meter::-webkit-meter-optimum-value { background: currentColor; }
.score-cell meter::-moz-meter-bar { background: currentColor; }
.inference-pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; }
.login-page { display: grid; min-height: 100vh; place-items: center; } .login { width: min(350px, 100%); } .login h1 { margin: 0; } .login form { display: grid; gap: 10px; } #login-error { min-height: 18px; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
@media (max-width: 650px) { header { padding: 14px; } main { padding: 14px; } .filters label, .tag-filter { width: 100%; max-width: none; } .filters #identity, .filters #sample-id { width: 100%; } td, th { padding: 8px; } dialog { padding: 14px; } dl { grid-template-columns: 85px 1fr; } .tag-directory-toolbar { align-items: stretch; flex-direction: column; } }
a { color: var(--link); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.login-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
@media (max-width: 650px) { header { gap: 12px; flex-wrap: wrap; } }
