:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;color-scheme:dark;background:#111a26;color:#e7effa;font-size:14px;--paper:#1c2939;--edge:#37465a;--fill:#26374a;--ink:#ecf3fa;--muted:#b0c0d2;--blue:#83d2ff;--amber:#ffbf7f;--green:#9af2c8;--red:#ff8891}
:root[data-theme=light]{color-scheme:light;background:#edf3f9;color:#26394b;--paper:#fff;--edge:#cbd8e7;--fill:#f0f4fa;--ink:#26394b;--muted:#556e80;--blue:#166a99;--amber:#985200;--green:#08734e;--red:#ae2d38}
/* System follows OS appearance live, without polling or repainting the results table. */
@media(prefers-color-scheme:light){:root[data-theme=system]{color-scheme:light;background:#edf3f9;color:#26394b;--paper:#fff;--edge:#cbd8e7;--fill:#f0f4fa;--ink:#26394b;--muted:#556e80;--blue:#166a99;--amber:#985200;--green:#08734e;--red:#ae2d38}}
*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit;color:var(--ink)}button{padding:8px 12px;border:1px solid var(--edge);border-radius:7px;background:var(--fill);cursor:pointer;white-space:normal}button:hover:not(:disabled){filter:brightness(1.14);border-color:var(--blue)}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid var(--blue);outline-offset:2px}button:disabled{opacity:.42;cursor:not-allowed}button.primary{background:#146489;color:white;border-color:#338fba;font-weight:700}button.active,button[aria-selected=true]{border-color:var(--blue);color:var(--blue);background:color-mix(in srgb,var(--fill),var(--blue) 10%)}input,select,textarea{padding:9px 10px;background:var(--fill);border:1px solid var(--edge);border-radius:7px;max-width:100%}input[type=checkbox]{width:16px;height:16px;accent-color:#479fd1;vertical-align:middle}input[type=date],input[type=number]{min-width:120px}input[type=search]{min-width:190px}.panel{background:var(--paper);border:1px solid var(--edge);border-radius:12px;padding:18px;margin-bottom:12px;box-shadow:0 3px 14px #0000000b}.top-bar{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:12px 19px;border-radius:0 0 12px 12px;max-width:1420px;margin:0 auto 14px}.brand{display:flex;align-items:center;gap:11px}.brand img{width:96px;height:36px;flex:0 0 96px;object-fit:contain;border-radius:7px;box-shadow:0 0 0 1px #8595aa60;background:#fff}.brand b{font-size:22px;line-height:1.1}.brand small{display:block;font-size:12px;color:var(--muted);margin-top:4px}.version{font-size:11px;color:var(--muted);margin-left:6px;white-space:nowrap}.header-right{text-align:right}.header-right nav{display:flex;gap:6px;justify-content:end}.header-right>small{display:block;color:var(--muted);margin-top:5px}main{max-width:1420px;margin:0 auto;padding:0 12px 26px}h2{font-size:18px;margin:0 0 15px}p{line-height:1.55}.section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.section-title h2{margin:0 0 12px}.scan-grid{display:grid;grid-template-columns:minmax(250px,1.7fr) minmax(200px,1.1fr) 188px;gap:14px;align-items:start}.field{min-width:0}.field label{display:block;margin-bottom:8px;font-size:12px;font-weight:650}.field>select,.field>.row>input{width:100%}.field small,.micro,small,.history-note{color:var(--muted);font-size:12px}.field small{display:block;margin-top:6px}.row{display:flex;gap:9px;align-items:center}.spread{justify-content:space-between}.row input{flex:1;min-width:0}.scan-actions{padding-top:22px;display:flex;gap:6px}.scan-actions button{flex:1;min-width:0}.inline-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:12px}.inline-actions button{font-size:13px}.history-note{margin-top:12px}.checkbox{display:inline-flex;align-items:center;gap:6px;font-size:12px;white-space:normal}.status-tag{background:var(--fill);color:var(--blue);padding:7px 12px;border:1px solid var(--edge);border-radius:99px;font-size:12px}.active-status strong{font-size:15px}.active-status .micro{padding-top:5px}.progress-track{height:5px;background:var(--fill);margin-top:15px;border-radius:8px;overflow:hidden}.progress-track div{height:100%;width:0;background:var(--blue);transition:width .25s}.stats-grid{display:grid;grid-template-columns:repeat(5,minmax(105px,1fr));gap:9px;margin:14px 0}.stat{padding:13px;border:1px solid var(--edge);border-radius:9px;background:var(--fill);text-align:left;cursor:pointer}.stat strong{display:block;font-size:26px;color:var(--blue)}.stat span{font-size:12px;color:var(--muted)}.status-filters{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0 19px}.status-filters button{font-size:12px;padding:6px 10px}.tabs{display:flex;flex-wrap:wrap;gap:6px;align-items:flex-end;border-bottom:1px solid var(--edge);margin-top:15px;padding:0 2px}.tabs button{position:relative;background:color-mix(in srgb,var(--fill),transparent 14%);border:1px solid var(--edge);border-bottom-color:transparent;border-radius:10px 10px 0 0;padding:10px 15px 11px;min-height:42px;color:var(--muted);font-weight:650;box-shadow:inset 0 -1px 0 transparent;transition:background .16s,border-color .16s,color .16s,transform .16s}.tabs button:hover:not(:disabled){color:var(--ink);background:color-mix(in srgb,var(--fill),var(--paper) 25%);filter:none}.tabs button[aria-selected=true]{background:var(--paper);color:var(--blue);border-color:var(--edge);border-bottom-color:var(--paper);margin-bottom:-1px;z-index:1;box-shadow:0 -1px 0 0 var(--blue) inset,0 8px 18px #00000014}.tabs button:focus-visible{z-index:2}.tabs button:not([aria-selected=true]){margin-bottom:4px}.tabs button:not([aria-selected=true]):active{transform:translateY(1px)}.table-options{display:flex;flex-wrap:wrap;gap:11px;align-items:end;margin:12px 0}.table-options label{display:flex;flex-direction:column;gap:5px;font-size:12px}.table-options label.checkbox{flex-direction:row}.table-options input,.table-options select{padding:7px 9px}.table-scroll{margin-top:9px;overflow:auto;min-height:170px;height:480px;resize:vertical;border:1px solid var(--edge);border-radius:7px;max-height:1800px}.results-table{width:100%;border-collapse:collapse;min-width:850px;font-size:13px}.results-table thead{position:sticky;top:0;z-index:1;background:var(--fill)}th,td{border-bottom:1px solid var(--edge);padding:11px 8px;vertical-align:top;text-align:left}th{color:var(--muted);font-size:12px;font-weight:650}th button{background:transparent;border:0;font-size:12px;text-align:left;padding:0;font-weight:700;cursor:pointer}tbody tr:nth-child(even){background:#7f9cb509}td .mini{font-size:11px;color:var(--muted);display:block;margin-top:5px}td a{color:var(--blue);text-decoration:none}td a:hover{text-decoration:underline}.status-label{font-size:12px;font-weight:700}.status-label.FairPlay,.status-label.Abuse{color:var(--red)}.status-label.Active{color:var(--green)}.status-label.Unverified,.status-label.Unspecified{color:var(--amber)}.pager{margin-top:8px;font-size:12px;color:var(--muted)}.pager button{padding:5px 11px}.pager>div{display:flex;gap:5px;align-items:center}details>summary{font-size:17px;font-weight:700;cursor:pointer}details[open]>summary{margin-bottom:16px}#log{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;width:100%;height:310px;resize:vertical;min-height:120px;max-height:1400px;margin-top:12px}.legal{color:var(--muted);font-size:12px;margin:13px 4px 17px}#dialog-layer:empty{display:none}.veil{position:fixed;inset:0;z-index:100;background:#020a16a9;display:flex;align-items:center;justify-content:center;padding:18px}.dialog{background:var(--paper);color:var(--ink);border:1px solid var(--edge);border-radius:12px;width:min(680px,100%);max-height:min(88vh,980px);box-shadow:0 22px 70px #0008;overflow:auto}.dialog.wide{width:min(980px,100%)}.dialog-head{padding:15px 19px;background:var(--fill);display:flex;justify-content:space-between;align-items:center;gap:10px;border-bottom:1px solid var(--edge);cursor:move;user-select:none}.dialog-head h2{margin:0;font-size:18px}.dialog-main{padding:18px;max-height:70vh;overflow:auto}.dialog-main h3{font-size:14px;margin:18px 0 8px}.dialog-main label{line-height:1.5}.dialog-footer{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding:12px 18px;border-top:1px solid var(--edge)}.settings-grid{display:grid;grid-template-columns:minmax(180px,1fr) minmax(115px,1fr);align-items:center;gap:10px 14px}.settings-grid input,.settings-grid select{width:100%}.note{font-size:12px;color:var(--muted);margin:6px 0 13px}.warn{color:var(--amber)}.danger{color:var(--red)}.queue-table{width:100%;border-collapse:collapse;min-width:650px;font-size:12px}.queue-table th,.queue-table td{text-align:right}.queue-table td:first-child,.queue-table th:first-child{text-align:left}.queue-table td{font-family:ui-monospace,monospace}.list-errors{max-height:330px;overflow:auto}.error-item{padding:9px;border-bottom:1px solid var(--edge);overflow-wrap:anywhere}.error-item .micro{display:block;margin-top:4px}.scroll-x{overflow-x:auto}.field-box{margin:12px 0}.field-box>label{display:block;margin-bottom:7px;font-weight:700;font-size:12px}.selected-count{color:var(--blue)}#toast{position:fixed;bottom:20px;right:20px;background:#23435d;color:white;border-radius:8px;padding:10px 14px;z-index:500;display:none;box-shadow:0 8px 26px #0006}.date-extras{margin-top:10px;display:flex;gap:8px;flex-wrap:wrap;align-items:center}.date-extras label{display:flex;gap:6px;align-items:center}.kbd{font-family:ui-monospace,monospace;border:1px solid var(--edge);padding:1px 5px;border-radius:3px}.details-row{background:var(--fill)}.details-row li{margin:6px 0}.expand{padding:4px 8px;font-size:12px}.light-theme-mirror{display:none}@media(max-width:850px){.scan-grid{grid-template-columns:1fr 1fr}.scan-actions{grid-column:1/-1;padding-top:0}.stats-grid{grid-template-columns:repeat(3,1fr)}.top-bar{align-items:flex-start}.header-right nav{flex-wrap:wrap}.version{display:none}}@media(max-width:560px){.scan-grid{grid-template-columns:1fr}.scan-actions{grid-column:auto}.stats-grid{grid-template-columns:repeat(2,1fr)}.top-bar{display:block}.header-right{margin-top:12px;text-align:left}.header-right nav{justify-content:flex-start}.panel{padding:13px}.dialog-main{padding:12px}.settings-grid{grid-template-columns:1fr}.tabs{gap:4px}.tabs button{padding:9px 11px 10px;font-size:13px}}


/* Setup heading activity indicator: aligned with the section title and only
   animated while a scan is actively running. */
#busy-text.busy-indicator{
  display:inline-flex;
  align-items:center;
  align-self:flex-start;
  gap:8px;
  min-height:28px;
  margin:0 0 12px;
  line-height:28px;
  font-size:14px;
  color:var(--muted);
  white-space:nowrap;
}
#busy-text.busy-indicator[hidden]{display:none!important}
#busy-text.busy-indicator .busy-spinner{
  display:inline-grid;
  place-items:center;
  width:1.4em;
  min-width:1.4em;
  height:1.4em;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:0.95em;
  line-height:1;
  color:var(--blue);
}
#busy-text.busy-indicator[data-mode='scan'] .busy-label{color:var(--muted)}
#busy-text.busy-indicator[data-mode='export'] .busy-label{color:var(--muted)}
#busy-text.busy-indicator .busy-label{display:inline-block;line-height:28px}
@media(max-width:560px){#busy-text.busy-indicator{font-size:13px;gap:6px}}

/* Accessible, compact header theme switch. */
.theme-icon-button{width:38px;height:36px;display:inline-flex;align-items:center;justify-content:center;padding:6px;flex:0 0 auto}
.theme-icon-button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Small, scoped enhancements to existing table cells only. No column/layout changes. */
:root{--closure-purple:#c4aeff;--closure-pink:#f5a5d7;--glyph-cutout:#111a26}
:root[data-theme=light]{--closure-purple:#60399b;--closure-pink:#932b6f;--glyph-cutout:#fff}
@media(prefers-color-scheme:light){:root[data-theme=system]{--closure-purple:#60399b;--closure-pink:#932b6f;--glyph-cutout:#fff}}
.profile-identity{display:inline-flex;align-items:center;gap:3px;max-width:100%;vertical-align:middle}
.profile-link{font-weight:600;overflow-wrap:anywhere;text-decoration:none}
.results-table td a.profile-link{color:var(--ink)}
.results-table td a.profile-link.role-scanned{color:var(--green)}
.results-table td a.profile-link.kind-FairPlay{color:var(--red)}
.results-table td a.profile-link.kind-Abuse{color:var(--amber)}
.results-table td a.profile-link.kind-Inactive,.results-table td a.profile-link.kind-PlayerClosed,.results-table td a.profile-link.kind-Unspecified{color:var(--closure-purple)}
.results-table td a.profile-link.kind-Other{color:var(--closure-pink)}
.results-table td a.profile-link.kind-Unverified{color:var(--muted)}
.results-table td a.profile-link:hover,.results-table td a.profile-link:focus-visible{text-decoration:underline;text-underline-offset:2px}
.results-table td a.profile-link.role-closed{font-style:italic}
.profile-identity.has-icons{color:var(--closure-purple)}
.profile-identity.has-icons:has(.kind-FairPlay){color:var(--red)}
.profile-identity.has-icons:has(.kind-Abuse){color:var(--amber)}
.profile-identity.has-icons:has(.kind-Other){color:var(--closure-pink)}
.status-glyph{width:13px;height:13px;flex:0 0 13px;vertical-align:-2px;display:inline-block}
.status-label{display:inline-flex;align-items:center;gap:4px}
.status-label.FairPlay{color:var(--red)}.status-label.Abuse{color:var(--amber)}
.status-label.Inactive,.status-label.PlayerClosed,.status-label.Unspecified{color:var(--closure-purple)}
.status-label.Other{color:var(--closure-pink)}
.status-label.Unverified{color:var(--muted)}
.game-outcome{display:inline-flex;align-items:center;gap:3px;flex-wrap:wrap;color:var(--muted)}
.game-outcome.draw{color:var(--blue)}.game-outcome.unavailable{color:var(--muted)}

/* Closures summary colors and icons; keep table dimensions/columns unchanged. */
.stat>span{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.stat .status-glyph,.status-filters .status-glyph{height:14px;width:14px;flex:0 0 14px}
.stat-range{--stat-hue:var(--blue)}
.stat-new{--stat-hue:var(--closure-purple)}.stat-fairplay{--stat-hue:var(--red)}
.stat-abuse{--stat-hue:var(--amber)}
.stats-grid .stat strong{color:var(--stat-hue,var(--blue))}
.stats-grid .stat:hover,.stats-grid .stat.active{border-color:var(--stat-hue,var(--blue))}
.stats-grid .stat .status-glyph{color:var(--stat-hue,var(--blue))}
.status-filters button{display:inline-flex;align-items:center;gap:5px}
.status-filters .filter-inactive,.status-filters .filter-unspecified{color:var(--closure-purple)}
.status-filters .filter-other{color:var(--closure-pink)}
.status-filters .filter-reopened{color:var(--green)}
.status-filters .filter-unavailable{color:var(--blue)}
.status-filters button.active{border-color:currentColor}
/* Original desktop's warning sections, rewritten for browser-specific effects. */
.legal-section{margin:12px 0 18px}
.legal-section h3{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  color:var(--blue);background:var(--fill);padding:9px 12px;border-radius:5px}
.legal-section p{padding-left:8px;overflow-wrap:anywhere}
.contact-panel{margin-top:15px;padding:13px;border:1px solid var(--edge);border-radius:8px;background:var(--fill)}
.contact-panel h3{margin-top:0}
.contact-panel a:not(.button-link){color:var(--blue);overflow-wrap:anywhere}
.button-link{display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;
  border-radius:7px;border:1px solid var(--edge);background:var(--paper);color:var(--ink);text-decoration:none}
.button-link:hover,.button-link:focus-visible{border-color:var(--blue);text-decoration:underline}

/* About adopts the same section dividers, typography and rhythm as Warnings. */
.legal-section.contact-panel{background:var(--paper);margin-top:16px}
.legal-section.contact-panel h3{margin:0 0 10px}

/* Both legal dialogs use the same visible section breaks and blue heading bars. */
.dialog[data-modal="about"] .legal-section + .legal-section,
.dialog[data-modal="disclaimer"] .legal-section + .legal-section,
.dialog[data-modal="search-help"] .legal-section + .legal-section {
  border-top:1px solid var(--edge);padding-top:12px;margin-top:17px;
}
.dialog[data-modal="about"] .legal-section h3,
.dialog[data-modal="disclaimer"] .legal-section h3,
.dialog[data-modal="search-help"] .legal-section h3 {margin:0 0 10px;line-height:1.4;}

/* Compact category ratings from the Rust table; focused, not rendered for off-page rows. */
.rating-chips{display:flex;flex-wrap:wrap;gap:3px;margin:5px 0 3px;max-width:260px}
.rating-chip{font-size:11px;line-height:1.4;padding:2px 6px;white-space:nowrap;border:1px solid var(--edge);border-radius:4px;background:var(--fill);color:var(--ink);cursor:help}
.rating-chip.played{background:color-mix(in srgb,var(--blue) 23%,var(--paper));color:var(--ink);border-color:var(--blue);font-weight:700}
.rating-chip:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.clock-detail{color:var(--muted);font-size:11px}
.results-table{min-width:1070px}


/* Custom hover/focus tooltip for rating chips so closed opponents can match closure styling. */
.rating-chip-tooltip{position:fixed;z-index:700;min-width:260px;max-width:min(520px,calc(100vw - 24px));padding:10px 12px;border:1px solid var(--edge);border-radius:8px;background:var(--paper);color:var(--ink);box-shadow:0 14px 36px #0008;pointer-events:none;font-size:12px;line-height:1.45}
.rating-chip-tooltip[hidden]{display:none}
.rating-chip-tooltip .tooltip-heading{font-weight:700;margin-bottom:6px;color:var(--ink)}
:is(.rating-chip-tooltip,.rating-evidence-popup) .tooltip-line{white-space:normal;overflow-wrap:anywhere}
:is(.rating-chip-tooltip,.rating-evidence-popup) .tooltip-closed{font-weight:800;text-decoration:underline;text-underline-offset:2px}
:is(.rating-chip-tooltip,.rating-evidence-popup) .tooltip-closed.kind-FairPlay{color:var(--red)}
:is(.rating-chip-tooltip,.rating-evidence-popup) .tooltip-closed.kind-Abuse{color:var(--amber)}
:is(.rating-chip-tooltip,.rating-evidence-popup) .tooltip-closed.kind-Inactive,:is(.rating-chip-tooltip,.rating-evidence-popup) .tooltip-closed.kind-PlayerClosed,:is(.rating-chip-tooltip,.rating-evidence-popup) .tooltip-closed.kind-Unspecified{color:var(--closure-purple)}
:is(.rating-chip-tooltip,.rating-evidence-popup) .tooltip-closed.kind-Other{color:var(--closure-pink)}
:is(.rating-chip-tooltip,.rating-evidence-popup) .tooltip-closed.kind-Unverified{color:var(--muted)}

/* Show game time control and elapsed duration together, without player-time estimates. */
.game-time-cell{white-space:nowrap;font-variant-numeric:tabular-nums}
.game-time-control{font-weight:700;color:var(--blue)}
.game-time-separator{color:var(--muted)}
.game-duration-value{color:var(--ink)}


/* Keep compact action icon attached to the button label when grid cells shrink. */
.scan-actions button{display:inline-flex;align-items:center;justify-content:center;gap:6px;text-align:center;line-height:1.25}
.scan-actions .action-icon{display:block;width:14px;height:14px;min-width:14px;flex:0 0 14px}
.scan-actions button>span{display:inline-block;white-space:normal}
/* Export uses a native accessible progress element without animating the table. */
#export-progress{display:block;width:100%;height:18px;accent-color:var(--blue);margin:12px 0}
.dialog[data-modal="export"] .dialog-main{min-height:178px}
.dialog[data-modal="export"] .dialog-footer{padding-left:0;padding-right:0;padding-bottom:0}

/* Global result-set selection is intentionally a segmented filter, not a stat card.
   Closure categories below remain equal-sized statistic/filter cards. */
.results-filter-groups{margin-top:15px}
.filter-group-heading{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px;margin:0 0 8px;font-size:12px;font-weight:750;color:var(--ink)}
.filter-group-heading small{font-size:11px;font-weight:400;color:var(--muted)}
.global-filter-segment{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid var(--edge);border-radius:10px;overflow:hidden;background:var(--fill)}
.global-filter-segment .global-filter-option{position:relative;display:flex;align-items:center;gap:11px;min-width:0;min-height:74px;padding:13px 17px;background:transparent;color:var(--ink);border:0;border-radius:0;text-align:left;box-shadow:none;transition:background .15s ease,color .15s ease}
.global-filter-segment .global-filter-option+button{border-left:1px solid var(--edge)}
.global-filter-segment .global-filter-option:hover:not(:disabled){filter:none;background:color-mix(in srgb,var(--blue) 11%,var(--fill))}
.global-filter-segment .global-filter-option.active{background:color-mix(in srgb,var(--blue) 18%,var(--paper));color:var(--ink);box-shadow:inset 0 -3px var(--blue)}
.global-filter-segment .global-filter-option:focus-visible{outline:2px solid var(--blue);outline-offset:-3px;z-index:1}
.global-filter-segment .global-filter-label{display:flex;align-items:center;gap:7px;min-width:0;flex:1;font-size:13px;font-weight:650;line-height:1.3;color:var(--ink)}
.global-filter-segment .global-filter-label .status-glyph{color:var(--blue)}
.global-filter-segment .global-filter-count{font-weight:800;font-size:25px;line-height:1;font-variant-numeric:tabular-nums;color:var(--blue)}
.global-filter-segment .global-filter-indicator{width:19px;height:19px;flex:0 0 19px;border-radius:100%;border:1px solid var(--edge);font-size:13px;text-align:center;line-height:17px;color:transparent}
.global-filter-segment .global-filter-option.active .global-filter-indicator{border-color:var(--blue);background:var(--blue);color:var(--paper);font-weight:900}
.closure-group-heading{margin-top:15px}
.closure-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.closure-summary-grid .stat{min-height:73px;display:flex;flex-direction:column;justify-content:center;gap:5px}
.closure-summary-grid .stat strong{font-size:25px;line-height:1.1;color:var(--stat-hue,var(--blue))}
.closure-summary-grid .stat span{display:flex;align-items:center;gap:5px;color:var(--muted);font-size:12px}
.closure-summary-grid .stat span .status-glyph{color:var(--stat-hue,var(--blue))}
.closure-summary-grid .stat.active{border-color:var(--stat-hue);box-shadow:inset 3px 0 var(--stat-hue)}
.closure-summary-grid .stat:hover:not(:disabled){border-color:var(--stat-hue);filter:none;background:color-mix(in srgb,var(--fill),var(--stat-hue) 8%)}
@media(max-width:560px){
  .global-filter-segment .global-filter-option{padding:11px 9px;min-height:82px;gap:5px;flex-wrap:wrap}
  .global-filter-segment .global-filter-label{font-size:12px;flex-basis:100%}
  .global-filter-segment .global-filter-count{font-size:22px}
  .global-filter-segment .global-filter-indicator{margin-left:auto}
}
@media(prefers-reduced-motion:reduce){.global-filter-segment .global-filter-option{transition:none}}

/* Results mode: genuine tabs, with a natural-height flat Simple view. */
.results-view-tabs{display:flex;align-items:flex-end;gap:5px;margin:2px 0 16px;padding:0 3px;border-bottom:2px solid var(--edge)}
.results-view-tabs button{border:1px solid var(--edge);border-bottom:0;border-radius:9px 9px 0 0;padding:10px 24px;min-height:40px;background:var(--fill);color:var(--muted);font-weight:750}
.results-view-tabs button[aria-selected=true]{background:var(--paper);color:var(--blue);border-color:var(--blue);box-shadow:inset 0 3px var(--blue);margin-bottom:-2px;padding-bottom:12px}
.results-view-tabs button:hover:not(:disabled){filter:none;color:var(--blue)}
.results-view-pane[hidden]{display:none}
.simple-results-intro{margin:4px 0 12px;max-width:850px}
/* Simple Results uses a responsive uniform-height card grid. Filter changes
   remove unused rows rather than stretching the remaining cards; long card
   content stays accessible through internal scrolling. */
.simple-results-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,250px),1fr));grid-auto-rows:220px;align-items:stretch;align-content:start;gap:10px;width:100%;height:auto;min-width:0}
.simple-results-list:not(:has(.simple-result-row)){grid-auto-rows:auto}
.simple-result-row{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:7px;min-width:0;height:100%;min-height:0;max-height:100%;padding:12px 14px;border:1px solid var(--edge);border-radius:9px;background:var(--fill);overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;overscroll-behavior:contain;transition:border-color .14s,background .14s}
.simple-result-row:hover,.simple-result-row:focus-within{border-color:var(--blue);background:color-mix(in srgb,var(--fill),var(--blue) 8%)}
.simple-opponent,.simple-game-date{min-width:0;max-width:100%;overflow-wrap:anywhere}
.simple-opponent .profile-link{font-weight:750}
.simple-game-date{font-size:12px;font-variant-numeric:tabular-nums}
.simple-game-date a{color:var(--blue);text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--blue),transparent 45%);text-underline-offset:3px}
.simple-game-date a:hover{text-decoration-color:currentColor}
.simple-list-footer{display:flex;flex-wrap:wrap;gap:12px;justify-content:space-between;align-items:center;margin:12px 0 5px}
.simple-list-footer #simple-more[hidden]{display:none}

/* Advanced results header: website toggles on the far left, closure cards in the middle,
   and compact global result-set controls on the right. */
.results-filter-groups{display:grid;grid-template-columns:180px minmax(0,2fr) minmax(255px,1fr);gap:13px;align-items:stretch;margin-top:15px}
.site-vertical-filter-group,.closure-filter-group,.global-filter-group{min-width:0}
.site-vertical-filter-group{display:flex;flex-direction:column}
.site-vertical-filter-group .site-filter-buttons{display:flex;flex-direction:column;gap:8px;flex:1 1 auto}
.site-vertical-filter-group .site-filter-button{width:100%;justify-content:flex-start;min-height:58px;padding:10px 12px;border-radius:9px}
.closure-summary-grid .stat{height:86px;min-height:86px}
.global-filter-segment{display:flex;flex-direction:column;gap:6px;border:0;border-radius:0;overflow:visible;background:transparent}
.global-filter-segment .global-filter-option{min-height:40px;height:40px;gap:7px;padding:5px 11px;border:1px solid var(--edge);border-radius:7px;background:var(--fill)}
.global-filter-segment .global-filter-option+button{border:1px solid var(--edge)}
.global-filter-segment .global-filter-option.active{border-color:var(--blue);background:color-mix(in srgb,var(--blue) 15%,var(--paper));box-shadow:inset 3px 0 var(--blue)}
.global-filter-segment .global-filter-label{font-size:12px;line-height:1.15;gap:5px}
.global-filter-segment .global-filter-label .status-glyph{width:12px;height:12px;flex:0 0 12px}
.global-filter-segment .global-filter-count{font-size:18px;line-height:1.1}
.global-filter-segment .global-filter-indicator{width:16px;height:16px;flex:0 0 16px;line-height:14px;font-size:11px}
@media(max-width:930px){.results-filter-groups{grid-template-columns:1fr 1fr}.site-vertical-filter-group{grid-column:1/-1}.site-vertical-filter-group .site-filter-buttons{flex-direction:row;flex-wrap:wrap}.site-vertical-filter-group .site-filter-button{flex:1 1 220px;min-height:48px}}
@media(max-width:750px){.results-filter-groups{grid-template-columns:1fr;gap:15px}.global-filter-segment{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.global-filter-segment .global-filter-option{min-height:48px;height:auto;padding:8px;flex-wrap:nowrap}.global-filter-segment .global-filter-label{flex-basis:auto}.site-vertical-filter-group .site-filter-buttons{flex-direction:column}.site-vertical-filter-group .site-filter-button{flex:none;width:100%}}
@media(max-width:480px){.results-view-tabs button{padding:9px 16px}.simple-result-row{gap:6px;min-height:70px;padding:10px 12px}.global-filter-segment{grid-template-columns:1fr}.closure-summary-grid .stat{height:78px;min-height:78px}}


/* Shared contact information at the bottom of the main screen, matching About. */
.main-contact{margin-top:14px;padding:15px 18px}
.main-contact h2{font-size:16px;margin:0 0 6px;color:var(--blue)}
.main-contact p{margin:6px 0;overflow-wrap:anywhere}
.main-contact a:not(.button-link){color:var(--blue);text-underline-offset:2px}
.main-contact .inline-actions{margin-top:8px}
.main-contact .note{margin:9px 0 0}

/* Shared tab language in both Results navigation areas. */
.results-view-tabs,.tabs{display:flex;align-items:flex-end;flex-wrap:wrap;gap:6px;border-bottom:2px solid var(--edge);margin:13px 0 15px;padding:0 3px}
.results-view-tabs button,.tabs button{position:relative;min-height:44px;margin:0 0 -2px;padding:10px 17px 11px;border:1px solid var(--edge);border-bottom:2px solid var(--edge);border-radius:9px 9px 0 0;background:var(--fill);color:var(--muted);font-size:13px;font-weight:750;box-shadow:none;transition:background .13s,border-color .13s}
.results-view-tabs button[aria-selected=true],.tabs button[aria-selected=true]{min-height:44px;margin:0 0 -2px;padding:10px 17px 11px;border-color:var(--blue);border-bottom-color:var(--paper);background:var(--paper);color:var(--blue);box-shadow:inset 0 3px var(--blue);z-index:1}
.results-view-tabs button:hover:not(:disabled),.tabs button:hover:not(:disabled){color:var(--blue);filter:none}
.results-view-tabs button:focus-visible,.tabs button:focus-visible{z-index:2;outline-offset:3px}

/* Status text, glyphs and links share a single stable palette in Simple and Advanced. */
.simple-results-list .profile-identity.has-icons{color:var(--closure-purple)}
.simple-results-list .profile-identity.has-icons:has(.kind-FairPlay){color:var(--red)}
.simple-results-list .profile-identity.has-icons:has(.kind-Abuse){color:var(--amber)}
.simple-results-list .profile-identity.has-icons:has(.kind-Other){color:var(--closure-pink)}
.simple-results-list .profile-link,.simple-results-list .profile-link:visited{font-weight:800;text-decoration:underline;text-underline-offset:3px;color:var(--ink)}
.simple-results-list .profile-link.kind-FairPlay,.simple-results-list .profile-link.kind-FairPlay:visited{color:var(--red)}
.simple-results-list .profile-link.kind-Abuse,.simple-results-list .profile-link.kind-Abuse:visited{color:var(--amber)}
.simple-results-list .profile-link.kind-Inactive,.simple-results-list .profile-link.kind-PlayerClosed,.simple-results-list .profile-link.kind-Unspecified{color:var(--closure-purple)}
.simple-results-list .profile-link.kind-Other{color:var(--closure-pink)}
.simple-results-list .profile-link:hover{filter:brightness(1.13);text-decoration:underline}
.simple-result-row{justify-content:flex-start;gap:5px;contain:layout style}
.simple-rating{display:block;font-size:12px;font-weight:750;color:var(--ink);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.simple-game-blurb{display:block;color:var(--muted);font-size:11px;line-height:1.45;overflow-wrap:anywhere}
.simple-extra-games{display:inline-flex;align-items:center;border:0;background:none;color:var(--blue);font-size:12px;font-weight:750;text-decoration:underline;text-underline-offset:3px;padding:2px 0;margin-top:3px}
.simple-extra-games:hover:not(:disabled){filter:none;color:var(--ink);border-color:transparent}
.older-games-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,250px),1fr));gap:10px}
.older-game{min-width:0;padding:10px 12px;background:var(--fill);border:1px solid var(--edge);border-radius:9px;overflow-wrap:anywhere}
.older-game a{color:var(--blue);font-weight:650}
.older-game .simple-rating{margin-top:5px}
.main-contact [data-copy-contact]{font-weight:700;cursor:copy}

.error-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
.error-columns>section{min-width:0;background:var(--fill);border:1px solid var(--edge);border-radius:9px;padding:10px}
.error-columns h3{margin:2px 0 8px;font-size:14px;color:var(--blue)}
.error-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
.error-heading>strong{overflow-wrap:anywhere}
.error-buttons{display:inline-flex;align-items:center;gap:5px;flex:0 0 auto}
.error-buttons button{padding:4px 8px;font-size:12px}
@media(max-width:690px){.error-columns{grid-template-columns:1fr}}

/* Cross-provider compliance filters, explicitly separate from verified closure totals. */
.all-tos-filter{width:100%;display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:left;min-height:36px;margin:0 0 8px;border-color:var(--edge);border-radius:7px;background:var(--fill);color:var(--ink);font-weight:750}
.all-tos-filter small{font-weight:400;margin-left:7px;white-space:normal}
.all-tos-filter b{color:var(--blue);background:var(--paper);border-radius:15px;min-width:28px;text-align:center;padding:3px 8px}
.all-tos-filter.active{border-color:var(--blue);background:color-mix(in srgb,var(--blue) 18%,var(--fill))}
.closure-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.closure-summary-grid .stat-lichess-tos{--stat-hue:#95c7ff}
:root[data-theme=light] .closure-summary-grid .stat-lichess-tos{--stat-hue:#255dad}
.status-label.LichessTosOpen,.status-label.LichessTosClosed,.status-label.LichessTosUnknown,
.results-table td a.profile-link.kind-LichessTosOpen,.results-table td a.profile-link.kind-LichessTosClosed,.results-table td a.profile-link.kind-LichessTosUnknown,
.simple-results-list .profile-link.kind-LichessTosClosed{color:#95c7ff}
.status-label.LichessClosed,.results-table td a.profile-link.kind-LichessClosed,.simple-results-list .profile-link.kind-LichessClosed{color:var(--closure-purple)}
.profile-identity.has-icons:has(.kind-LichessTosClosed),.profile-identity.has-icons:has(.kind-LichessTosOpen){color:#95c7ff}
.site-pill{display:block;max-width:max-content;width:max-content;margin:0 0 7px;padding:3px 8px;border:1px solid var(--edge);border-radius:5px;font-size:11px;font-weight:750;background:var(--fill);color:var(--muted)}
.site-pill.lichess{color:#95c7ff;border-color:#496789}.site-pill.chesscom{color:#bad8ea}
.table-options input[type=date]{width:155px;min-width:130px}
#date-filter-note{margin:-3px 0 6px}
@media(max-width:680px){.closure-summary-grid{grid-template-columns:1fr}.closure-summary-grid .stat{min-height:65px;height:auto}.all-tos-filter small{display:block;margin:4px 0 0}.table-options input[type=date]{width:100%}}

/* Keep the winner/draw outcome immediately to the right of the two players. */
.players-with-result{display:grid;grid-template-columns:minmax(0,1fr) max-content;gap:8px;align-items:center}
.players-stack{min-width:0}.player-game-result{border-left:1px solid var(--edge);padding-left:9px;min-width:85px}
@media(max-width:620px){.players-with-result{grid-template-columns:minmax(0,1fr)}.player-game-result{border-left:0;border-top:1px solid var(--edge);padding:5px 0 0}}

/* rc.9 usability: expose status provenance in simple cards and progress semantics. */
#progress-description{margin-top:6px;min-height:16px}
.simple-status-context{font-size:12px;font-weight:700;color:var(--muted);overflow-wrap:anywhere}
.simple-scan-context{font-size:11px;color:var(--muted);overflow-wrap:anywhere}
@media(prefers-reduced-motion:reduce){.progress-track div{transition:none}}

/* rc.10: keep draggable dialogs reachable. Touch and narrow layouts are not draggable. */
@media(max-width:699px),(pointer:coarse){.dialog-head{cursor:default;touch-action:auto}}
#import-preview details{max-height:240px;overflow:auto}
/* rc.10: explicit dimensions for header pictograms across browsers and zoom levels. */
.header-labeled{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.header-labeled svg{width:17px;height:17px;max-width:17px;max-height:17px;flex:0 0 17px;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;fill:none}

/* rc.11: The provider selector precedes the username field and sizes to its text.
   Under narrow widths, Saved users moves to the next line rather than
   squeezing the username input or expanding the website selector. */
.scan-identity-row{display:flex;align-items:stretch;flex-wrap:wrap;gap:8px}
.scan-identity-row #scan-site{flex:0 0 auto;width:max-content;min-width:0;max-width:100%}
.scan-identity-row #scan-target-list{flex:1 1 125px;width:auto;min-width:95px}
.scan-identity-row #saved-users{flex:0 0 auto;white-space:nowrap}

/* RC53: Advanced no longer has an inner tab bar; close the top edge and
   round all corners of the independent Advanced table/filter panel. */
#results-range-panel{border:1px solid var(--edge);border-radius:10px;padding:12px 12px 14px;background:var(--paper)}
#results-range-panel .table-options{margin-top:2px}
@media(max-width:560px){#results-range-panel{padding:9px}}
/* rc.12: Provider-specific settings are navigable in their own modal subview. */
.settings-provider-launch{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}
.settings-provider-launch button{flex:1 1 190px;min-height:64px;text-align:left;font-weight:750;border-color:var(--blue)}
.settings-provider-launch button small{display:block;color:var(--muted);font-weight:400;font-size:12px;margin-top:5px}
.settings-provider-panel[hidden],#settings-home[hidden]{display:none!important}
.settings-provider-back{margin:0 0 10px}
.settings-provider-panel h3{margin:3px 0 13px}
.settings-provider-panel .settings-grid{margin-bottom:14px}

/* Pointer-anchored copy confirmation never traps taps or extends outside the viewport. */
#toast.toast-near-pointer{position:fixed!important;right:auto;bottom:auto;pointer-events:none;z-index:2000;max-width:min(340px,calc(100vw - 16px))}
#table-search-error{color:#b23d38;margin:6px 0;font-weight:650}
#table-search-help{margin:8px 0}

/* rc.13: conditional advisory beneath (not inside) the network line. */
.scan-settings-advisory{margin-top:3px;color:var(--amber);max-width:100%;overflow-wrap:anywhere}
.scan-settings-advisory[hidden]{display:none!important}
/* Fit the two clear buttons to their neighboring table controls only. */
.table-options .table-compact-clear{align-self:end;box-sizing:border-box;height:32px;min-height:0;padding:5px 10px;line-height:20px;white-space:nowrap}
.site-pill{display:inline-flex;align-items:center;gap:5px}
.site-pill .provider-brand-icon{display:block;width:18px;height:18px;object-fit:contain;flex:none}

.scan-settings-advisory button{padding:0 3px;margin-left:3px;min-height:0;border:0;background:transparent;color:inherit;text-decoration:underline;font-size:inherit;font-weight:700}

/* rc.15: Two-row priority layout; played categories remain visible. */
.rating-chip[hidden],.ratings-more[hidden]{display:none!important}
.ratings-more{font-size:11px;padding:2px 4px;white-space:nowrap;align-self:center;background:transparent;color:var(--blue);border:0;text-decoration:underline;font-weight:750;cursor:pointer}
.ratings-more:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.account-state{display:inline-flex;align-items:center;margin-left:6px;font-size:12px;font-weight:750;white-space:nowrap;color:var(--muted)}
.account-state-flagged{color:var(--red)!important}

/* rc.15: Queue Monitor is a compact, vertically aligned status table.
   Scope these dimensions to this table, not the results or error dialogs. */
.queue-table{font-variant-numeric:tabular-nums}
.queue-table th,.queue-table td{
  padding:6px 8px;
  vertical-align:middle;
  line-height:1.25;
}
.queue-table td:last-child,.queue-table th:last-child{text-align:right}
.queue-table [data-queue-errors]{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  vertical-align:middle;
  min-width:30px;
  height:24px;
  min-height:0;
  margin:0;
  padding:0 7px;
  font-size:11px;
  line-height:1;
  border-radius:6px;
}

/* rc.15: Historical Lichess ToS indications stay visible in Simple results. */
.simple-status-context.tos-flagged{color:var(--red)!important;font-weight:700}

/* rc.16: status first line always contains provider and account open/closed;
   closure reason is a separate, self-contained second line. */
.closure-status-cell{display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-width:0}
.closure-status-top{display:flex;flex-wrap:nowrap;align-items:center;gap:7px;min-width:0;max-width:100%;white-space:nowrap}
.closure-status-top .site-pill{display:inline-flex;align-items:center;margin:0;flex:0 0 auto}
.closure-status-top .account-state{display:inline-flex;align-items:center;margin:0;white-space:nowrap}
.closure-status-reason{display:inline-flex;align-items:center;gap:4px;max-width:100%;min-width:0;margin:0}
.closure-status-cell .mini{display:block;margin:0}

/* rc.18: Account closure reason centered beneath provider/closure line. */
.closure-status-reason{align-self:center;justify-content:center;text-align:center;}
/* Game outcome is now a true standalone column. Comparison shares the final
   actions column above Details/Timeline, without changing export schema. */
.players-cell .players-stack{min-width:145px}
.game-result-cell{min-width:100px;overflow-wrap:anywhere}
.game-result-cell .game-outcome{display:inline-block;max-width:160px}
.result-actions{display:flex;flex-direction:column;align-items:flex-start;gap:9px;min-width:125px}
.result-comparison{font-size:12px;color:var(--muted);line-height:1.3;overflow-wrap:anywhere}
.result-action-buttons{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
.result-action-buttons .expand{white-space:nowrap}
@media(max-width:700px){.game-result-cell{min-width:100px}.result-actions{min-width:120px}}

/* rc.20: compact vertical Simple category rail, aligned with the cards. */
.simple-results-layout{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:start;gap:10px;min-width:0}
.simple-category-rail{display:flex;flex-direction:column;align-items:stretch;gap:5px;max-width:165px;position:sticky;top:8px}
.simple-category-rail button{display:flex;align-items:center;gap:5px;min-height:33px;padding:6px 8px;border:1px solid var(--edge);border-radius:7px;background:var(--fill);color:var(--ink);font-size:11px;font-weight:650;text-align:left;white-space:nowrap}
.simple-category-rail button[aria-pressed=true]{border-color:var(--blue);background:color-mix(in srgb,var(--blue) 13%,var(--paper));color:var(--blue)}
.simple-category-rail button .status-glyph{width:13px;height:13px;flex-shrink:0}
.simple-category-rail button b{margin-left:auto;font-variant-numeric:tabular-nums;font-size:11px}
@media(max-width:570px){.simple-results-layout{grid-template-columns:95px minmax(0,1fr);gap:6px}.simple-category-rail button{flex-wrap:wrap;white-space:normal;font-size:10px}.simple-category-rail button b{min-width:1em}}

/* RC54: separator between Simple result filters and result cards. */
#results-simple .simple-results-list{border-left:1px solid var(--edge);padding-left:12px}
@media(max-width:700px){#results-simple .simple-results-list{border-left:0;border-top:1px solid var(--edge);padding-left:0;padding-top:12px}}

/* rc.20: sticky headers paint opaquely above body rows in Chromium/Firefox/Safari. */
.table-scroll{isolation:isolate;position:relative}
.results-table{border-collapse:separate;border-spacing:0}
.results-table thead{position:static;background:var(--fill)}
.results-table thead th{position:sticky;top:0;z-index:5;background:var(--fill);background-clip:padding-box;box-shadow:0 1px 0 var(--edge),0 -1px 0 var(--fill);vertical-align:middle}
.results-table tbody td{position:relative;z-index:0}
.results-table th button{position:relative;z-index:1}
/* Keep player and clock data aligned despite mixed glyph/text sizes. */
.results-table .players-stack,.results-table .players-stack .mini{line-height:1.35}
.results-table .clock-detail{display:inline-flex;align-items:baseline;vertical-align:baseline;font-size:inherit}

/* rc21: AI Report local-first workflow and harmonized Results navigation. */
#results-panel{position:relative}
.results-ai-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:5px 0 12px}
.results-ai-actions button{color:var(--blue);border-color:var(--blue);font-weight:750}
.results-ai-actions small{color:var(--muted)}
.results-view-tabs{justify-content:flex-start;margin-left:0;width:100%;border-bottom-color:var(--edge)}
.results-view-tabs button{color:var(--blue)}
.results-view-tabs button[aria-selected=true]{color:var(--blue)}
.simple-category-rail button[data-simple-filter="fairplay"]{color:var(--red)}
.simple-category-rail button[data-simple-filter="abuse"]{color:var(--amber)}
.simple-category-rail button[data-simple-filter="lichess-tos"]{color:var(--lichess-tos)}
.simple-category-rail button[data-simple-filter="lichess-closed"]{color:var(--lichess-closed)}
.simple-category-rail button[data-simple-filter="other"]{color:var(--closure-pink)}
.simple-category-rail button[aria-pressed="true"]{border-color:currentColor}
.ai-config{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.ai-config>label{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:650;min-width:0}
.ai-config input,.ai-config select,.ai-config textarea,.ai-transfer textarea{width:100%;max-width:100%}
.ai-config>.ai-span{grid-column:1/-1}
.ai-config label.checkbox{flex-direction:row;align-items:center;font-size:13px}
.ai-config label.checkbox input{width:auto}
.ai-review{padding:12px 0;border-block:1px solid var(--edge);margin:16px 0}
#ai-review-btn{color:var(--blue);font-weight:700}
.ai-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0}
.ai-stats>div{display:flex;flex-direction:column;padding:9px 11px;border:1px solid var(--edge);border-radius:7px;background:var(--fill);min-width:0}
.ai-stats span{color:var(--muted);font-size:11px}
.ai-stats strong{font-size:13px;overflow-wrap:anywhere}
.ai-transfer{border-top:1px solid var(--edge);margin-top:15px;padding-top:4px}
.ai-transfer label{display:block;margin-top:13px;font-size:12px;font-weight:650}
.ai-transfer select{margin-left:8px;max-width:100%}
.ai-transfer textarea{display:block;margin-top:7px;font-family:ui-monospace,monospace;font-size:12px}
@media(max-width:600px){.ai-config{grid-template-columns:1fr}.ai-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.results-view-tabs{width:100%}}

/* 2.0.0-rc.2: Results heading and compact Advanced status-rail correction. */
.results-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:9px}
.results-title-row #results-heading{margin:0}
.results-title-row .results-ai-actions{margin:0 0 0 auto;justify-content:flex-end}
.results-view-tabs{justify-content:flex-start;margin-left:0;width:100%}
/* Advanced mini-filters form a left-side vertical rail, outside the content column. */
#results-advanced{display:grid;grid-template-columns:minmax(132px,164px) minmax(0,1fr);gap:8px 13px;align-items:start;min-width:0}
#results-advanced>:not(#category-stats){grid-column:2;min-width:0}
#results-advanced #category-stats{grid-column:1;grid-row:1/span 4;position:sticky;top:8px;display:flex;flex-direction:column;gap:6px;margin:0;align-items:stretch;min-width:0}
#results-advanced #category-stats button{display:flex;align-items:center;gap:5px;text-align:left;min-height:36px;padding:7px 9px;font-size:11px;font-weight:700;white-space:normal;color:var(--rail-hue,var(--ink));border:1px solid var(--edge);background:var(--fill);border-radius:7px;line-height:1.3}
#results-advanced #category-stats button .status-glyph{flex:none;color:inherit}
#results-advanced #category-stats .filter-lichess{--rail-hue:var(--lichess-tos)}
#results-advanced #category-stats .filter-lichess-closed{--rail-hue:var(--lichess-closed)}
#results-advanced #category-stats .filter-inactive,#results-advanced #category-stats .filter-unspecified{--rail-hue:var(--closure-purple)}
#results-advanced #category-stats .filter-other{--rail-hue:var(--closure-pink)}
#results-advanced #category-stats .filter-reopened{--rail-hue:var(--green)}
#results-advanced #category-stats .filter-unavailable{--rail-hue:var(--blue)}
#results-advanced #category-stats button.active{border-color:var(--rail-hue);background:color-mix(in srgb,var(--rail-hue) 12%,var(--paper));box-shadow:inset 3px 0 var(--rail-hue)}
#results-advanced #category-stats button:hover:not(:disabled){border-color:var(--rail-hue);filter:none}
/* The Simple rail uses the same semantic status colors, including when selected. */
.simple-category-rail button[data-simple-filter="all"]{--rail-hue:var(--blue)}
.simple-category-rail button[data-simple-filter="fairplay"]{--rail-hue:var(--red)}
.simple-category-rail button[data-simple-filter="abuse"]{--rail-hue:var(--amber)}
.simple-category-rail button[data-simple-filter="lichess-tos"]{--rail-hue:var(--lichess-tos)}
.simple-category-rail button[data-simple-filter="lichess-closed"]{--rail-hue:var(--lichess-closed)}
.simple-category-rail button[data-simple-filter="other"]{--rail-hue:var(--closure-pink)}
.simple-category-rail button{color:var(--rail-hue,var(--ink))}
.simple-category-rail button[aria-pressed=true]{color:var(--rail-hue,var(--blue));border-color:var(--rail-hue,var(--blue));background:color-mix(in srgb,var(--rail-hue,var(--blue)) 12%,var(--paper))}
@media(max-width:850px){#results-advanced{display:block}#results-advanced #category-stats{position:static;display:flex;flex-direction:row;flex-wrap:wrap;margin:12px 0 16px}#results-advanced #category-stats button{flex:1 1 140px}}
@media(max-width:600px){.results-title-row .results-ai-actions{justify-content:flex-start;margin-left:0}.results-title-row{align-items:flex-start}}

/* Matching sizes for numerical player ratings and the adjacent clock text.
   Player names retain their existing individually styled font sizes. */
.results-table .players-cell .player-rating,
.results-table .players-cell .clock-detail{font-size:12px;font-weight:500;line-height:1.35}
/* Respect native view visibility after moving Advanced controls into a grid. */
#results-advanced[hidden]{display:none!important}
/* Zero-count Advanced categories remain legible and semantically colored. */
#results-advanced #category-stats button:disabled{opacity:.78;cursor:not-allowed;border-style:dashed}

/* rc3: both global shortcuts use the closure-card template; distinct from status tiles. */
.all-games-control{border-bottom:1px solid var(--edge);padding-bottom:9px;margin-bottom:9px}
.all-games-control .all-tos-filter{margin-bottom:0}
.all-tos-filter{justify-content:flex-start}
.all-tos-filter>b{font-size:25px;line-height:1.1;font-weight:750;flex:0 0 auto;min-width:28px;padding:3px 5px;text-align:center;color:var(--blue);background:transparent}
.all-tos-filter>span{min-width:0}
.all-tos-filter.active{border-color:var(--blue)}
.search-reference-button{margin:8px 0 10px;display:inline-flex;align-items:center;gap:7px;color:var(--blue);font-weight:700;text-align:left}
.dialog[data-modal="search-help"] .dialog-main code{white-space:normal;overflow-wrap:anywhere}
.dialog[data-modal="search-help"] .dialog-main h3{color:var(--blue)}

/* AI Report request is visible and distinct from evidence; the suggestion is not saved unless edited. */
#ai-instructions:placeholder-shown{color:var(--muted);font-style:italic}
.ai-request{padding:10px 13px;background:var(--fill);border:1px solid var(--edge);border-radius:8px;margin:12px 0;overflow-wrap:anywhere}
.ai-request>strong{color:var(--ink);font-size:13px}
.ai-request p{margin:7px 0 0;white-space:pre-wrap;line-height:1.5}

/* rc4: Results heading action is adjacent rather than pushed to the far edge. */
.results-title-row{justify-content:flex-start}
.results-title-row .results-ai-actions{margin:0 0 0 12px;justify-content:flex-start}
/* Advanced mini filters are once again a horizontal row below the two primary groups. */
#results-advanced{display:block}
#results-advanced #category-stats{position:static;display:flex;flex-direction:row;flex-wrap:wrap;gap:7px;margin:12px 0 16px;align-items:center}
#results-advanced #category-stats button{flex:0 1 auto;min-width:110px;min-height:34px;white-space:normal}
#results-advanced[hidden]{display:none!important}
/* Compact scan range controls and explicit handoff provider selection. */
#range-time-inputs[hidden]{display:none!important}
.range-time-toggle{display:flex;align-items:center;gap:8px;grid-column:1/-1}
.range-time-toggle input{width:auto}
#range-time-inputs{grid-column:1/-1}
.ai-provider-launch{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin-top:12px}
.ai-provider-launch label{margin:0;min-width:200px;flex:1 1 245px}
.ai-provider-launch button{flex:0 0 auto;min-height:38px}
.ai-provider-launch .note{width:100%;flex-basis:100%}
#ai-transfer .ai-provider-launch select{margin-left:0;margin-top:6px}

/* 2.0.0-rc.5: a theme-aware hairline separates Simple 'All' from status filters.
   The separator is noninteractive and is only rendered when other filters exist. */
.simple-category-rail .simple-category-divider{display:block;flex:0 0 1px;width:100%;height:1px;margin:5px 0 7px;background:var(--edge);pointer-events:none}

/* rc5: the provider selector and Open button form one compact, spaced row. */
#ai-transfer .ai-provider-launch{display:block;max-width:100%}
#ai-transfer .ai-provider-launch>label{display:block;min-width:0;width:auto;margin:10px 0 6px;font-weight:650}
#ai-transfer .ai-launch-controls{display:flex;align-items:flex-start;justify-content:flex-start;gap:12px;flex-wrap:wrap;max-width:100%}
#ai-transfer .ai-launch-controls select{margin:0;flex:0 1 280px;min-width:min(100%,190px);max-width:100%;height:40px}
#ai-transfer .ai-launch-controls button{margin:0;flex:0 0 auto;min-height:40px}
#ai-transfer .ai-provider-launch>.note{display:block;width:100%;margin-top:8px}
.theme-icon-button .theme-css-label{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10px;font-weight:800;letter-spacing:-.5px;white-space:nowrap}
/* Simple rail filtering should not invoke browser scroll anchoring. */
#results-simple .simple-results-layout{overflow-anchor:none}
@media(max-width:420px){#ai-transfer .ai-launch-controls{gap:9px}#ai-transfer .ai-launch-controls select{flex:1 1 190px;min-width:0}#ai-transfer .ai-launch-controls button{flex:0 0 auto}}
/* Prevent generic form-label display rules from overriding report safety state. */
#ai-copy-fallback-label[hidden]{display:none}

/* rc6: copy-action estimates are tied to the exact clipboard payload. */
.ai-copy-actions{display:flex;flex-wrap:wrap;align-items:stretch;gap:10px 12px;margin-top:12px}
.ai-copy-item{display:flex;flex:0 1 auto;flex-direction:column;align-items:flex-start;gap:5px;min-width:0}
.ai-copy-item button{font-size:13px;max-width:100%}
.ai-copy-size{color:var(--muted);font-size:11px;line-height:1.35;white-space:nowrap;font-variant-numeric:tabular-nums}
.ai-token-explainer{margin-top:8px}
@media(max-width:560px){.ai-copy-actions{gap:10px}.ai-copy-item{flex:1 1 180px}.ai-copy-item button{width:100%}.ai-copy-size{white-space:normal}}

/* rc8: accessible, distinct Lichess evidence categories and cautious published rating. */
#ai-copy-fallback-panel[hidden]{display:none}
#ai-copy-fallback-panel{display:flex;flex-direction:column;align-items:flex-start;gap:7px;margin-top:12px;min-width:0}
#ai-copy-fallback-panel textarea{width:100%;max-width:100%;min-width:0}
#ai-copy-fallback-button{align-self:flex-start}
.simple-latest-published{color:var(--muted);text-decoration-line:line-through;text-decoration-thickness:1px;text-decoration-color:color-mix(in srgb,var(--muted) 58%,transparent);text-decoration-skip-ink:auto}
.simple-status-context.lichess-tos-context{color:var(--lichess-tos)!important}
.simple-status-context.lichess-closed-context{color:var(--lichess-closed)!important}

/* Two independent evidence flags: historic/current ToS + account closure. */
.profile-identity.combined-lichess-flags{gap:4px}
.lichess-status-icon{display:inline-flex;align-items:center;flex:0 0 auto}
.lichess-status-icon.lichess-tos-icon{color:var(--lichess-tos)}
.lichess-status-icon.lichess-closed-icon{color:var(--lichess-closed)}
.game-outcome-reason{font-weight:400;color:var(--muted);white-space:normal}

/* rc10: supplemental evidence is visually separated from the row it expands. */
.results-table tbody tr.details-row{background:var(--paper)}
.results-table .details-row>td{padding:7px 10px 15px 24px;border-bottom:2px solid var(--edge)}
.details-evidence-panel{background:var(--fill);border:1px solid var(--edge);border-left:3px solid var(--blue);border-radius:7px;padding:12px 15px;box-shadow:inset 0 1px 0 #ffffff08}
.details-evidence-title{font-size:13px;font-weight:750;display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.details-evidence-title .mini{display:inline;font-weight:400;margin:0}
.details-source-links{margin:7px 0 10px;font-size:12px;overflow-wrap:anywhere}
.details-games-heading{font-size:12px;font-weight:650;padding-top:7px;border-top:1px solid var(--edge)}
.details-evidence-panel ul{padding-left:22px;margin:6px 0 0}

/* rc10: Keep players, ratings and clocks on one line per player.
   The username alone yields with an ellipsis; both numeric values stay readable. */
.results-table .players-cell{width:275px;max-width:290px}
.results-table .players-cell .players-stack{min-width:0;width:100%;max-width:290px}
.results-table .player-game-line{display:flex;align-items:baseline;gap:3px;width:100%;min-width:0;white-space:nowrap;line-height:1.35}
.results-table .player-game-line .profile-identity{min-width:0;flex:0 1 auto;max-width:100%;overflow:hidden}
.results-table .player-game-line .profile-link{min-width:0;flex:0 1 auto;display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;white-space:nowrap}
.results-table .player-game-line .status-glyph{flex:0 0 auto}
.results-table .player-game-line .player-rating,
.results-table .player-game-line .clock-detail{flex:0 0 auto;white-space:nowrap}

/* Advanced search help: no nested SQL-like filter or extra controls. */
.search-sql-toolbar{display:flex;align-items:center;gap:10px;margin:8px 0 10px;flex-wrap:wrap}
.search-sql-toolbar .search-reference-button{margin:0}
/* Consistent arrow avoids Windows' grey native combo-box inset. The OS still
   renders the opened option list, retaining keyboard and assistive support. */
select:not([multiple]):not([size]){
  -webkit-appearance:none;appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 6 5 5 5-5' fill='none' stroke='%238da9bd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 10px center;background-size:12px 12px;
  padding-right:30px;
}
select option{background:var(--paper);color:var(--ink)}

/* rc11: independent site toggles before Special Filters. */
.site-filter-buttons{display:inline-flex;align-items:center;gap:6px;flex:0 0 auto;min-width:0}
.site-filter-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:5px 10px;white-space:nowrap;border-radius:7px;border:1px solid var(--edge);background:var(--paper);color:var(--ink);font-size:12px;font-weight:650;cursor:pointer;opacity:1}
.site-filter-button.selected{background:var(--fill);border-color:var(--blue);color:var(--ink);opacity:1;box-shadow:inset 0 -2px 0 var(--blue)}
.site-filter-button:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.site-filter-button .site-toggle-icon{width:15px;height:15px;object-fit:contain;flex:none}
.site-filter-button.selected::after{content:"✓";font-size:11px;font-weight:800;color:var(--blue);margin-left:auto}
@media(max-width:560px){.search-sql-toolbar .site-filter-buttons{flex:1 1 100%;}.search-sql-toolbar .site-filter-button{flex:1 1 0}}

/* RC12: third results view, using the same theme variables as Advanced. */
.sql-workspace{max-width:100%;min-width:0}
.sql-workspace .section-title{display:flex;align-items:center;justify-content:space-between;gap:12px}
.sql-workspace textarea{display:block;width:100%;min-height:148px;resize:vertical;margin:8px 0 12px;padding:12px;border-radius:8px;border:1px solid var(--edge);color:var(--ink);background:var(--fill);font-family:ui-monospace,Consolas,monospace;font-size:13px;line-height:1.5}
.sql-workspace textarea:focus-visible{outline:2px solid var(--blue)}
.sql-results{max-width:100%;max-height:440px;overflow:auto;margin-top:14px;border:1px solid var(--edge);border-radius:8px;background:var(--paper)}
.sql-results:empty{display:none}
.sql-output-table{width:100%;overflow:auto}
.sql-output-table table{width:max-content;min-width:100%;border-collapse:collapse;font:12px/1.5 ui-monospace,Consolas,monospace}
.sql-output-table th,.sql-output-table td{padding:7px 9px;border:1px solid var(--edge);text-align:left;white-space:pre-wrap;max-width:450px;overflow-wrap:anywhere;color:var(--ink)}
.sql-output-table th{position:sticky;top:0;background:var(--fill);z-index:1;font-weight:700}
#sql-backup-status,#sql-workspace-status{margin-top:9px}
@media(max-width:600px){.sql-workspace .inline-actions{gap:6px}.sql-workspace .inline-actions button{flex:1 1 150px}}

/* RC15: SQL rating overrides must never be confused with published ratings. */
.sql-rating-override{display:block;margin-top:4px;font-size:12px;font-weight:700;color:var(--amber)}

/* RC16: every results view owns its heading and contextual AI report action. */
.results-pane-heading{display:flex;align-items:center;justify-content:flex-start;gap:16px;flex-wrap:wrap;margin:8px 0 14px}
.results-pane-heading h2{font-size:18px;line-height:1.3;margin:0}
.results-pane-heading [data-action="ai-report"]{border-color:var(--blue);color:var(--blue);font-weight:750;white-space:nowrap}
.sql-write-warning-veil{position:fixed;inset:0;z-index:1000;display:flex;justify-content:center;align-items:center;padding:18px;background:#010812cf}
.sql-write-warning-dialog{max-width:560px;width:100%;padding:20px;background:var(--paper);border:2px solid var(--red);border-radius:12px;box-shadow:0 20px 65px #000a}
.sql-write-warning-dialog h2{margin:0 0 12px;font-size:19px}
.sql-write-warning-dialog p{line-height:1.55}
.sql-write-warning-footer{display:flex;gap:12px;flex-wrap:wrap;margin-top:22px}
.sql-write-warning-footer.justify-start{justify-content:flex-start}
.sql-write-warning-footer.justify-center{justify-content:center}
.sql-write-warning-footer.justify-end{justify-content:flex-end}
.sql-write-warning-footer button{min-width:145px}
/* Re-import permission: distinct, high-contrast backgrounds in every theme. */
.sql-write-warning-dialog[data-warning-theme="blue"]{background:#e9f4ff;color:#10263a;border-color:#1268a5}
.sql-write-warning-dialog[data-warning-theme="amber"]{background:#fff0af;color:#332600;border-color:#b66b00}
.sql-write-warning-dialog[data-warning-theme="red"]{background:#d50000;color:#fff;border-color:#6b0000}
.sql-write-warning-dialog[data-warning-stage] h2,.sql-write-warning-dialog[data-warning-stage] p{color:inherit;background:transparent}
.sql-write-warning-dialog[data-warning-stage] button{background:#fff;color:#101820;border:2px solid #101820;font-weight:700}
.sql-write-warning-dialog[data-warning-stage] button.primary{background:#101820;color:#fff;border-color:#fff}
.sql-write-warning-dialog[data-warning-stage] button:focus-visible{outline:3px solid currentColor;outline-offset:3px}
.sql-edit-info-dialog{border-color:var(--blue)}

/* Simple provider toggles share Advanced selection affordances. */
.simple-category-rail .simple-site-toggle{justify-content:flex-start;--rail-hue:var(--blue)}
.simple-category-rail .simple-site-toggle .site-toggle-icon{width:15px;height:15px;flex:none}

.theme-icon-button .theme-css-logo{display:block;width:24px;height:24px;object-fit:contain}

/* RC20: compact SQL summary and clearly separated help dialogs. */
.sql-help-summary{display:flex;flex-wrap:wrap;align-items:center;gap:10px 20px;margin:10px 0 14px}
.sql-help-summary .note{flex:1 1 420px;margin:0;line-height:1.5}
.sql-help-buttons{margin:0;flex:0 1 auto;gap:8px}
.sql-help-buttons button{min-height:36px;font-size:12px}
@media(max-width:580px){.sql-help-buttons{width:100%}.sql-help-buttons button{flex:1 1 150px}}
/* Unfiltered results account roster, displayed across all result modes. */
.results-users-field{display:flex;flex-direction:column;gap:5px;width:100%;margin:0 0 14px;min-width:0}
.results-users-field[hidden]{display:none}
.results-users-field .results-users-label{font-weight:700;font-size:13px;color:var(--ink)}
.results-users-display{display:block;width:100%;min-width:0;box-sizing:border-box;border:1px solid var(--edge);border-radius:8px;background:var(--fill);color:var(--ink);padding:10px 12px;cursor:copy;font-size:13px;line-height:1.4;min-height:38px;white-space:normal;overflow-wrap:anywhere;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.results-users-display:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.results-users-field small{color:var(--muted);min-height:0}
.sql-restore-buttons{margin:6px 0 24px}

/* RC27: real SQL history write-back is a separate, permission-gated action. */
.sql-history-import-actions{margin-top:12px;display:flex;justify-content:stretch}
.sql-history-import-actions button{flex:1;min-height:40px;font-weight:750}
.sql-history-import-actions .danger:not(:disabled){background:#d50000!important;color:#fff!important;border:2px solid #850000!important}
.sql-history-import-actions .danger:disabled{background:var(--paper)!important;color:var(--muted)!important;opacity:.65}
.sql-history-risk{border:2px solid;border-radius:12px;padding:16px 18px;margin:6px 0;color:#101820}
.sql-history-risk[data-risk-color="blue"]{background:#e9f4ff;border-color:#1268a5;color:#10263a}
.sql-history-risk[data-risk-color="amber"]{background:#fff0af;border-color:#b66b00;color:#332600}
.sql-history-risk[data-risk-color="red"]{background:#d50000;border-color:#6b0000;color:#fff}
.sql-history-risk h3,.sql-history-risk p{background:transparent!important;color:inherit!important}
.sql-history-risk button{background:#fff!important;color:#101820!important;border:2px solid #101820!important;font-weight:700}
.sql-history-risk button.primary{background:#101820!important;color:#fff!important;border-color:#fff!important}
.sql-history-risk button:focus-visible{outline:3px solid currentColor;outline-offset:3px}
.date-criteria-help{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;min-height:28px;padding:0;border-radius:100%;font-weight:900;cursor:help;flex:none}
.date-criteria-help:focus-visible{outline:3px solid var(--blue);outline-offset:2px}
.queue-table [data-queue-requeued]{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}

/* RC28: backup/history tools live in a header-invoked dialog, not a lower-page accordion. */
.dialog[data-modal="data-history"] .dialog-main {padding:20px;}
.data-history-content {display:flex;flex-direction:column;gap:20px;min-width:0;}
.data-history-content > .note,.data-history-group > p {margin:0;}
.data-history-group {min-width:0;display:flex;flex-direction:column;gap:12px;}
.data-history-group + .data-history-group {border-top:1px solid var(--edge);padding-top:18px;}
.data-history-group h3 {margin:0!important;line-height:1.35;}
.data-history-actions {display:flex;align-items:stretch;flex-wrap:wrap;gap:10px;}
.data-history-actions button {max-width:100%;overflow-wrap:anywhere;min-height:40px;}
.data-history-danger button {border-color:var(--red);}
/* Scan and queue errors: prevent text, actions and nested controls from colliding. */
.dialog[data-modal="errors"] .scan-errors-panel {min-width:0;display:flex;flex-direction:column;gap:16px;}
.scan-errors-panel > .note {margin:0;}
.scan-error-actions {margin:0;display:flex;gap:10px;align-items:stretch;flex-wrap:wrap;}
.scan-error-actions > button {max-width:100%;min-height:38px;}
.scan-error-list {min-width:0;display:flex;flex-direction:column;gap:10px;max-height:min(48vh,410px);padding:2px;}
.scan-error-list > .error-item {border:1px solid var(--edge);border-radius:8px;padding:12px 14px;background:var(--fill);}
.scan-error-list .error-item-meta {display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 12px;line-height:1.5;overflow-wrap:anywhere;}
.scan-error-list .error-item-meta strong {color:var(--blue);}
.scan-error-list .error-resource {margin:6px 0 0;line-height:1.5;overflow-wrap:anywhere;}
.scan-error-list .error-message {margin:8px 0 0;line-height:1.55;overflow-wrap:anywhere;white-space:pre-wrap;}
.dialog[data-modal="queueerrors"] .dialog-main > .note {margin:0 0 16px;}
.dialog[data-modal="queueerrors"] .dialog-main > .inline-actions {margin:0 0 18px;gap:10px;align-items:stretch;}
.dialog[data-modal="queueerrors"] .dialog-main > .inline-actions button {min-height:38px;}
.dialog[data-modal="queueerrors"] .error-columns {gap:16px;margin-bottom:18px;}
.dialog[data-modal="queueerrors"] .error-columns > section {padding:14px;}
.dialog[data-modal="queueerrors"] .error-columns h3 {margin:0 0 12px;line-height:1.45;}
.dialog[data-modal="queueerrors"] .error-columns .list-errors {display:flex;flex-direction:column;gap:10px;}
.dialog[data-modal="queueerrors"] .error-columns .error-item {padding:12px;background:var(--paper);border:1px solid var(--edge);border-radius:8px;line-height:1.55;min-width:0;overflow-wrap:anywhere;}
.dialog[data-modal="queueerrors"] .error-heading {flex-wrap:wrap;gap:10px;align-items:flex-start;}
.dialog[data-modal="queueerrors"] .error-buttons {margin-inline-start:auto;max-width:100%;flex-wrap:wrap;}
.dialog[data-modal="queueerrors"] .error-item .micro {line-height:1.5;margin:6px 0;overflow-wrap:anywhere;}
.dialog[data-modal="queueerrors"] .retry-audit {margin-top:16px;min-width:0;}
@media(max-width:560px) {
 .data-history-actions {flex-direction:column;}
 .scan-error-actions {flex-direction:column;}
 .scan-error-actions > button {width:100%;}
 .dialog[data-modal="queueerrors"] .dialog-main > .inline-actions > button {flex:1 1 180px;}
}

/* Simple Results: default compact ratings; optional evidence-only sparklines. */
.simple-ratings-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:10px 18px;margin:0 0 10px}
.simple-ratings-toolbar .checkbox{display:inline-flex;align-items:center;gap:7px;font-weight:700;cursor:pointer}
.simple-ratings-toolbar input{accent-color:var(--blue);width:16px;height:16px}
.simple-ratings-toolbar .micro{color:var(--muted)}
.simple-rating-trend{width:100%;min-width:0;display:grid;gap:3px;line-height:1.25;font-variant-numeric:tabular-nums;color:var(--ink)}
.simple-trend-heading,.simple-trend-dates,.simple-trend-values{display:flex;justify-content:space-between;gap:8px;min-width:0;font-size:10px}
.simple-trend-heading{align-items:baseline;flex-wrap:wrap}
.simple-trend-heading strong{font-size:12px}
.simple-trend-heading span{color:var(--muted)}
.simple-rating-trend svg{display:block;width:100%;height:72px;color:var(--muted);overflow:visible}
.simple-trend-dates{color:var(--muted);font-size:10px}
.simple-trend-values{font-weight:750;font-size:11px}
.simple-rating-trend small,.simple-trend-empty{color:var(--muted);font-size:11px}

/* RC30: approved compact encounter-history graph geometry and game-type popup. */
.simple-results-list.simple-graph-mode{grid-auto-rows:minmax(315px,auto)}
.simple-graph-mode .simple-result-row{min-height:315px;max-height:none;overflow:visible}
.simple-rating-trend{width:100%;max-width:100%;min-width:0;display:flex;flex-direction:column;gap:4px}
.simple-trend-heading{display:flex;flex-direction:column;align-items:flex-start;gap:2px;font-size:11px;line-height:1.3}
.simple-trend-heading strong{font-size:12px;line-height:1.3}
.simple-trend-heading span{font-size:10px;color:var(--muted)}
.simple-rating-trend svg.simple-trend-plot{width:100%;height:auto;max-height:140px;min-height:100px;aspect-ratio:330 / 145;overflow:visible;flex:none}
.simple-spark-rating-label{fill:var(--blue);font-size:12px;font-weight:800;paint-order:stroke;stroke:var(--paper);stroke-width:2.5px;stroke-linejoin:round}
.simple-spark-latest-rating{fill:var(--red)}
.simple-spark-axis-date{font-size:10px;fill:var(--muted);font-weight:650}
.simple-rating-scope{font-size:10px;line-height:1.4;color:var(--muted)}
.simple-other-types{padding:4px 8px;border:1px solid var(--edge);border-radius:6px;color:var(--blue);font-size:11px;font-weight:700;background:var(--paper)}
.simple-rating-types-scroll{display:flex;flex-direction:column;gap:14px;max-height:min(67vh,650px);overflow-y:auto;overflow-x:hidden;padding:4px 6px 12px}
.simple-rating-pool-panel{width:100%;min-width:0;border:1px solid var(--edge);border-radius:9px;background:var(--fill);padding:12px 15px}
.simple-rating-pool-panel .simple-rating-trend{max-width:430px;margin-inline:auto}
@media(max-width:560px){.simple-results-list.simple-graph-mode{grid-auto-rows:auto}.simple-graph-mode .simple-result-row{min-height:0}.simple-rating-types-scroll{max-height:62vh}}

/* Simple All Games shortcut: same framed rail style, deliberately slimmer than
   the Closed/Flagged button immediately below. Keep text wrap safe on mobile. */
.simple-category-rail button[data-simple-filter="games"]{min-height:25px;padding:3px 8px;font-size:10px;color:var(--blue)}
.simple-category-rail button[data-simple-filter="all"]{min-height:40px;white-space:normal;overflow-wrap:anywhere}
.simple-category-rail button[data-simple-filter="games"] span{white-space:normal}
.simple-category-rail button[data-simple-filter="games"][aria-pressed="true"]{background:color-mix(in srgb,var(--blue) 14%,var(--paper));border-color:var(--blue)}


/* Advanced rating tooltip: reuse the same real-observation sparkline as Simple.
   Fit the floating tooltip inside the viewport, even near the table edge. */
.rating-chip-tooltip .rating-tooltip-spark{border-bottom:1px solid var(--edge);padding:2px 0 8px;margin-bottom:7px;min-width:0}
.rating-chip-tooltip .rating-tooltip-spark .simple-rating-trend{max-width:380px;gap:3px}
.rating-chip-tooltip .rating-tooltip-spark .simple-trend-plot{max-height:126px;min-height:0}
.rating-chip-tooltip .rating-tooltip-games{display:grid;gap:4px;min-width:0}
.rating-chip-tooltip .tooltip-more{color:var(--muted);font-style:italic}
.rating-chip-tooltip{max-height:calc(100dvh - 24px);overflow:hidden}
/* Always permit up to five latest matches in the rating tooltip, even on
   shorter viewports; the tooltip itself is positioned inside the viewport. */
@media(max-height:610px){.rating-chip-tooltip .rating-tooltip-spark .simple-trend-plot{max-height:82px}}

.sql-save-query{display:inline-flex;gap:8px;align-items:center;flex-wrap:wrap;min-width:0}
.sql-save-query input{width:clamp(135px,20vw,260px);max-width:100%}
.sql-rebuild-option{display:inline-flex;align-items:center;gap:9px;margin:2px 0 14px;font-weight:700}
.sql-rebuild-option input{width:17px;height:17px;accent-color:var(--blue)}
@media(max-width:520px){.sql-save-query{width:100%}.sql-save-query input{flex:1;min-width:120px}}

/* Short All Games shortcut sits directly above the existing long ToS filter. */
.closure-filter-group .all-games-thin{display:flex;align-items:center;min-height:30px;padding:3px 10px;margin:0 0 7px;width:100%;font-size:12px;line-height:1.35;background:color-mix(in srgb,var(--fill) 65%,var(--paper));}
.closure-filter-group .all-games-thin b{font-size:16px;min-width:26px;}
.closure-filter-group .all-games-thin span{font-size:12px;}
.closure-filter-group .all-games-thin small{opacity:.85;font-size:11px;}
@media(max-width:480px){.closure-filter-group .all-games-thin{padding:4px 9px;min-height:36px;}}

/* rc.31: branded popup titles, query manager and Simple outcome segment */
.dialog-head h2,.sql-write-warning-dialog h2{display:flex;align-items:center;gap:9px}
.mdk-dialog-logo{width:51px;height:24px;object-fit:contain;flex:none}
.sql-query-table-wrap{overflow:auto;max-width:100%;margin-top:12px}
.sql-saved-query-table{width:100%!important;font-size:12px}
.sql-saved-query-table th,.sql-saved-query-table td{vertical-align:top;padding:8px}
.sql-saved-query-table pre{white-space:pre-wrap;word-break:break-word;max-height:160px;overflow:auto;max-width:400px}
.sql-saved-query-table details summary{cursor:pointer;color:var(--blue)}
.sql-saved-actions{white-space:nowrap}
.sql-saved-actions button{margin-right:4px}
.simple-category-rail button[data-simple-filter="won"]{--rail-hue:var(--green)}
.simple-category-rail button[data-simple-filter="lost"]{--rail-hue:var(--red)}
.simple-category-rail button[data-simple-filter="draw"]{--rail-hue:var(--muted)}

/* RC32: latest retained game timestamp and its contextual detail button. */
.simple-game-meta{display:flex;align-items:center;gap:9px;flex-wrap:wrap;max-width:100%;min-width:0}
.simple-game-meta .simple-other-types{flex:0 1 auto;text-align:left;padding:2px 7px;line-height:1.35}
/* CSS display overrides must respect hidden, including flex/grid components. */
.rating-custom-row[hidden]{display:none!important}

/* RC32: option groups use the same blue heading bars as Warnings and About. */
.dialog[data-modal="settings"] .dialog-main h3{
  font-family:inherit;
  text-transform:uppercase;
  font-weight:700;
  letter-spacing:.035em;
  color:var(--blue);background:var(--fill);padding:9px 12px;border-radius:5px;
  margin:22px 0 12px;line-height:1.4
}
.dialog[data-modal="settings"] .dialog-main h3:not(:first-child){border-top:1px solid var(--edge)}
.sql-rebuild-status-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px;margin:8px 0 10px;min-width:0}
.sql-rebuild-status-row .sql-rebuild-option{flex:0 0 auto;margin:0}
.sql-rebuild-status-row #sql-workspace-edited{flex:1 1 360px;min-width:200px;margin:0;line-height:1.55}
.sql-rebuild-status-row #sql-workspace-edited[hidden]{display:none}
.sql-workspace #sql-workspace-status.sql-execution-message{
  display:block;width:100%;min-height:30px;height:30px;line-height:1.4;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis;cursor:text;border:1px solid var(--edge);
  border-radius:6px;padding:6px 9px;background:var(--fill);font-family:inherit;
  font-size:12px;font-weight:400;color:var(--amber);margin:0 0 8px
}
.sql-workspace #sql-workspace-status.sql-execution-message:focus{outline:2px solid var(--blue)}

/* Save SQL Query: single-column full-width fields at every dialog size. */
.dialog[data-modal="sql-save-query"] .dialog-main{min-width:0}
.sql-save-dialog-form{display:flex;flex-direction:column;gap:13px;width:100%;min-width:0}
.sql-save-dialog-form .note{margin:0 0 3px}
.sql-save-dialog-field{display:flex;flex-direction:column;align-items:stretch;gap:6px;width:100%;min-width:0}
.sql-save-dialog-field label{display:block;font-size:12px;font-weight:700;line-height:1.4}
.sql-save-dialog-field input,.sql-save-dialog-field textarea{display:block;width:100%;min-width:0;max-width:100%;margin:0}
.sql-save-dialog-field textarea{resize:vertical;min-height:87px;max-height:35vh;line-height:1.5}
.sql-save-overwrite{margin:0;padding:9px 11px;border-left:3px solid var(--amber);background:var(--fill);border-radius:4px;font-size:12px;line-height:1.45}
.sql-save-overwrite[hidden]{display:none}
.sql-save-dialog-actions{justify-content:flex-end;margin-top:3px;gap:9px}
@media(max-width:450px){.sql-save-dialog-actions button{flex:1 1 auto}}

/* RC32: DataTables presentation for full SQLite query projections. */
.sql-results{max-height:none;overflow:visible;padding:10px}
.sql-results-toolbar{display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap;margin:0 0 10px}
.sql-results-toolbar .micro{margin-right:auto}
.sql-results-toolbar button{font-size:12px;padding:5px 8px}
.sql-column-picker{position:relative;flex:0 0 auto}
.sql-column-picker summary{border:1px solid var(--edge);border-radius:6px;padding:6px 9px;cursor:pointer;background:var(--fill);font-size:12px}
.sql-column-picker fieldset{position:absolute;right:0;top:100%;z-index:12;display:grid;gap:6px;min-width:min(330px,75vw);max-height:290px;overflow:auto;border:1px solid var(--edge);border-radius:8px;background:var(--paper);box-shadow:0 6px 25px #0004;padding:12px}
.sql-column-picker label{display:flex;align-items:center;gap:7px;overflow-wrap:anywhere;font-size:12px}
.sql-output-table{max-width:100%;overflow:auto}
.sql-datatable{width:100%!important}
.sql-output-table .dataTables_wrapper,.sql-results .dataTables_wrapper{color:var(--ink);font-size:12px}
.sql-results .dataTables_wrapper .dataTables_filter,.sql-results .dataTables_wrapper .dataTables_length{margin:4px 0 12px}
.sql-results .dataTables_wrapper .dataTables_filter input,.sql-results .dataTables_wrapper .dataTables_length select{background:var(--fill);color:var(--ink);border:1px solid var(--edge);padding:5px 8px;border-radius:5px}
.sql-results .dataTables_wrapper .dataTables_paginate .paginate_button{color:var(--ink)!important;border:1px solid var(--edge);border-radius:5px}
.sql-results .dataTables_wrapper .dataTables_paginate .paginate_button.current{background:var(--fill);color:var(--ink)!important;border-color:var(--blue)}
.sql-results .dataTables_wrapper .dataTables_info{color:var(--muted)}
.sql-results .sql-datatable th,.sql-results .sql-datatable td{background:var(--paper);color:var(--ink);border-color:var(--edge);vertical-align:top}
.sql-results .sql-datatable th{background:var(--fill)}
.sql-results .sql-datatable tbody tr:hover td{background:var(--fill)}
.sql-results .sql-datatable [hidden]{display:none!important}
.sql-results-scope{margin:9px 0 0}

/* RC32: Saved Users DataTable; selection persists when changing pages. */
.saved-users-table-wrap{max-width:100%;overflow:auto;margin:10px 0}
.saved-users-table{width:100%!important;font-size:12px}
.saved-users-table th,.saved-users-table td{padding:8px;vertical-align:middle;border-color:var(--edge);color:var(--ink)}
.saved-users-table tbody tr[hidden]{display:none!important}
.dialog[data-modal="saved-users"] .dataTables_wrapper{color:var(--ink);font-size:12px}
.dialog[data-modal="saved-users"] .dataTables_wrapper select{background:var(--fill);color:var(--ink)}
.dialog[data-modal="saved-users"] .dataTables_wrapper .paginate_button{color:var(--ink)!important}
.dialog[data-modal="saved-users"] .dataTables_wrapper .paginate_button.current{background:var(--fill);color:var(--ink)!important}
#sql-db-size{margin-left:auto;white-space:nowrap}
@media(max-width:680px){#sql-db-size{margin-left:0}}

/* RC33: per-game-type compact chronological lists with independent More actions. */
.simple-rating-pool-panel .simple-pool-game-list{margin-top:12px;min-width:0}
.simple-pool-game-list h3{margin:0 0 8px;font-size:12px;color:var(--ink);font-weight:750}
.simple-pool-game-list .older-games-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,155px),1fr));gap:7px}
.simple-pool-game-list .older-game{padding:7px 9px;font-size:12px;line-height:1.4}
.simple-pool-game[hidden]{display:none!important}
.simple-pool-more{display:inline-flex;align-items:center;border:0;background:none;color:var(--blue);font-size:12px;font-weight:750;text-decoration:underline;text-underline-offset:3px;padding:3px 0;margin:7px 0 0}
.simple-pool-more:hover:not(:disabled){background:transparent;border-color:transparent;color:var(--ink)}
/* RC33: live SQL blocking status beside AI Report. */
.sql-scan-block-status{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);font-weight:650;line-height:1.4}
.sql-scan-block-status::before{content:"";display:inline-block;width:7px;height:7px;flex:none;border-radius:50%;background:var(--green)}
.sql-scan-block-status[data-blocked="true"]{color:var(--amber)}
.sql-scan-block-status[data-blocked="true"]::before{background:var(--amber)}
/* RC33: database size and SQL evidence warnings begin at the left edge of
   their own area, immediately after the rebuild checkbox. */
.sql-rebuild-status-row{align-items:flex-start}
.sql-rebuild-status-messages{flex:1 1 340px;min-width:min(100%,240px);display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;text-align:left;gap:3px}
.sql-rebuild-status-row #sql-db-size{margin:0;white-space:normal;text-align:left}
.sql-rebuild-status-row #sql-workspace-edited{width:100%;min-width:0;flex:none;margin:0;text-align:left}

/* RC34: checkbox bulk manager and floating non-interactive SQL preview. */
.sql-query-bulk-actions{display:flex;gap:9px;flex-wrap:wrap;align-items:center;margin:11px 0 9px}
.sql-query-bulk-actions .micro{margin-right:auto;font-variant-numeric:tabular-nums}
.sql-query-bulk-actions button{padding:6px 10px;font-size:12px}
.sql-saved-query-table .sql-query-select-col{width:35px;min-width:35px;text-align:center}
.sql-saved-query-table th.sql-query-view-col{min-width:80px}
.sql-saved-query-table td:first-child{text-align:center}
.sql-saved-query-table input[type=checkbox]{cursor:pointer;margin:0;vertical-align:middle}
.sql-query-view-link{color:var(--blue);text-decoration:underline;text-underline-offset:2px;white-space:nowrap;font-size:12px}
.sql-query-view-link:hover,.sql-query-view-link:focus-visible{color:var(--ink)}
.sql-query-hover-preview{position:fixed;z-index:650;width:min(560px,calc(100vw - 20px));max-height:min(55vh,370px);display:flex;flex-direction:column;gap:7px;padding:12px 14px;border:1px solid var(--blue);border-radius:9px;background:var(--paper);color:var(--ink);box-shadow:0 14px 38px #0009;pointer-events:none;font-size:12px}
.sql-query-hover-preview strong{overflow-wrap:anywhere}
.sql-query-hover-preview pre{margin:0;min-height:0;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--ink)}
.sql-delete-names{max-height:175px;overflow:auto;display:grid;gap:4px;padding:9px 12px;border:1px solid var(--edge);background:var(--fill);border-radius:6px;font-size:12px;overflow-wrap:anywhere}
@media(max-width:600px){.sql-query-bulk-actions .micro{flex-basis:100%}.sql-saved-query-table{min-width:680px}}

/* RC35: make Simple ratings cards content-sized and remove reserved graph space. */
.simple-results-list{grid-auto-rows:auto;align-items:start}
.simple-results-list .simple-result-row{height:auto;min-height:0;max-height:none;overflow:visible;padding:9px 11px;gap:4px}
.simple-results-list.simple-graph-mode{grid-auto-rows:auto;align-items:start}
.simple-graph-mode .simple-result-row{min-height:0;max-height:none}
.simple-graph-mode .simple-rating-trend{gap:2px}
.simple-trend-heading{line-height:1.2;gap:0}
.simple-rating-trend svg.simple-trend-plot{width:100%;min-width:0;min-height:0;max-height:94px;height:auto;aspect-ratio:330 / 92;flex:1 1 auto;overflow:visible}
.simple-spark-chart-row{display:flex;align-items:center;justify-content:center;gap:5px;width:100%;min-width:0}
.simple-spark-side-date{flex:0 0 auto;writing-mode:vertical-rl;transform:rotate(180deg);max-width:none;color:var(--muted);font-size:10px;font-weight:650;line-height:1.15;text-align:center;white-space:nowrap;font-variant-numeric:tabular-nums}
.simple-rating-types-scroll{gap:9px;padding:2px 3px 7px}
.simple-rating-pool-panel{padding:9px 11px}
.simple-rating-pool-panel .simple-rating-trend{max-width:none;margin-inline:0}
.simple-rating-pool-panel .simple-pool-game-list{margin-top:7px}
.simple-pool-game-list h3{margin:0 0 5px}
.simple-pool-game-list .older-games-grid{gap:5px}
.simple-pool-game-list .older-game{padding:5px 7px}
.dialog[data-modal="simple-game-types"].wide{width:min(570px,100%)}
.dialog[data-modal="simple-game-types"] .dialog-main{padding:12px 14px}
.dialog[data-modal="simple-game-types"] .dialog-main > .note{margin:0 0 8px}
/* All Simple rail filters share the compact All Games height. */
.simple-category-rail button,
.simple-category-rail button[data-simple-filter="games"],
.simple-category-rail button[data-simple-filter="all"]{
  height:26px;min-height:26px;max-height:26px;padding:3px 7px;
  font-size:10px;line-height:1.15;white-space:nowrap;overflow:hidden;overflow-wrap:normal
}
.simple-category-rail button .status-glyph{width:11px;height:11px;flex:0 0 11px}
.simple-category-rail button b{font-size:10px;flex:none}
.simple-category-rail button span:not(.status-glyph){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.simple-category-rail .simple-site-toggle .site-toggle-icon{width:13px;height:13px}
@media(max-width:570px){
  .simple-category-rail button,
  .simple-category-rail button[data-simple-filter="games"],
  .simple-category-rail button[data-simple-filter="all"]{font-size:9px;padding:3px 5px;flex-wrap:nowrap;white-space:nowrap}
  .simple-spark-side-date{font-size:9px}
  .simple-spark-chart-row{gap:3px}
}

/* RC36: one shared ratings evidence renderer, with surface-specific density. */
.simple-result-row > .rating-evidence-card{display:contents}
.rating-evidence-panel{min-width:0}
.rating-evidence-tooltip .rating-tooltip-games{min-width:0}
.rating-evidence-popup .simple-pool-game-list{min-width:0}

/* RC38: keep all Simple cards the same height across every grid row, with
   intrinsic content determining the minimum height rather than a fixed box. */
.simple-results-list,.simple-results-list.simple-graph-mode{grid-auto-rows:1fr;align-items:stretch}
.simple-results-list .simple-result-row,
.simple-graph-mode .simple-result-row{height:100%;min-height:0;max-height:none;align-self:stretch}
.simple-game-meta{width:100%}
.simple-game-meta .simple-other-types{flex:0 1 auto}
.rating-tooltip-compact{border-bottom:1px solid var(--edge);padding:2px 0 8px;margin-bottom:7px}
@media(max-width:560px){.simple-results-list,.simple-results-list.simple-graph-mode{grid-auto-rows:1fr;align-items:stretch}}

/* RC39: shared rating graphs, compact centered dates, and unified SQL options. */
.simple-spark-chart-row{width:min(100%,350px);max-width:350px;align-self:center;justify-content:center;gap:1px}
.simple-spark-chart-row .simple-trend-plot{width:calc(100% - 26px);min-width:0;max-width:322px;flex:1 1 auto}
.simple-spark-side-date{line-height:1;margin:0}
.dialog[data-modal="simple-game-types"].wide{width:min(410px,calc(100vw - 24px))}
.simple-rating-types-scroll{width:100%}
.sql-workspace-options{display:flex;flex-direction:column;align-items:flex-start;gap:6px;margin:10px 0 9px}
.sql-workspace-options .sql-rebuild-option{margin:0;min-height:21px;line-height:1.45;gap:9px}
.sql-workspace-options .sql-rebuild-option input{margin:0;vertical-align:middle;flex:0 0 17px}
.sql-readonly-status{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%;max-height:116px;min-height:35px;overflow-y:auto;overflow-x:hidden;padding:7px 10px;margin:0 0 10px;border:1px solid var(--edge);border-radius:6px;background:var(--fill);font-size:12px;line-height:1.45;color:var(--blue);text-align:left}
.sql-readonly-status #sql-db-size{display:block;width:100%;color:var(--blue);margin:0;white-space:normal;line-height:1.45}
.sql-readonly-status #sql-workspace-edited{display:block;width:100%;margin:0;color:var(--amber);line-height:1.45;min-width:0}
.sql-readonly-status #sql-workspace-edited[hidden]{display:none}
.sql-readonly-status:focus-visible{outline:2px solid var(--blue)}
.range-criteria{display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap}
.range-criteria .checkbox{display:inline-flex;align-items:center;gap:6px;min-height:19px;margin:0}
.range-criteria .date-criteria-help{display:inline-flex;align-items:center;justify-content:center;width:16px;height:19px;min-height:19px;border:0;border-radius:0;padding:0;margin:0;background:none;box-shadow:none;font-size:15px;font-weight:700;line-height:1;color:var(--muted);cursor:help;flex:0 0 16px;vertical-align:middle}
.range-criteria .date-criteria-help:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.sql-result-set{min-width:0;border-top:1px solid var(--edge);padding-top:10px;margin-top:12px}
.sql-result-set:first-child{margin-top:0;padding-top:0;border-top:0}
.sql-result-set-heading{font-size:13px;margin:0 0 9px;color:var(--ink)}

.sql-statement-summary{padding:6px 8px;color:var(--muted);background:var(--fill);border-radius:5px;font-size:12px}

/* RC40: checkbox DataTables use standard row selection without hijacking links. */
.sql-saved-query-table tbody tr,.saved-users-table tbody tr{cursor:pointer}
.sql-saved-query-table tbody tr.is-selected td,.saved-users-table tbody tr.is-selected td{background:color-mix(in srgb,var(--blue) 17%,var(--paper))!important}
.sql-saved-query-table tbody tr:hover td,.saved-users-table tbody tr:hover td{background:color-mix(in srgb,var(--blue) 10%,var(--paper))}
.sql-saved-query-table tbody tr.is-selected:hover td,.saved-users-table tbody tr.is-selected:hover td{background:color-mix(in srgb,var(--blue) 23%,var(--paper))!important}
/* Place the query manager on its own full-width line. */
.sql-restore-buttons{margin-bottom:8px}
.sql-query-save-row{display:flex;width:100%;margin:0 0 16px}
.sql-query-save-row .sql-save-query{width:100%;flex-wrap:nowrap}
.sql-query-save-row .sql-save-query input{flex:1 1 auto;width:auto;min-width:90px;max-width:none}
.sql-query-save-row .sql-save-query button{flex:0 0 auto}
@media(max-width:430px){.sql-query-save-row .sql-save-query{flex-wrap:wrap}.sql-query-save-row .sql-save-query input{flex:1 1 170px}}
/* Compact, copyable filenames: download requests are not download receipts. */
.sql-backup-file-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:10px 0 4px}
.sql-backup-file-grid label{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:650;color:var(--ink);min-width:0}
.sql-backup-filename{width:100%;box-sizing:border-box;min-width:0;background:var(--fill);color:var(--ink);font:12px/1.3 ui-monospace,Consolas,monospace;cursor:copy}
.sql-backup-filename:focus-visible{outline:2px solid var(--blue)}
@media(max-width:630px){.sql-backup-file-grid{grid-template-columns:minmax(0,1fr)}}

/* RC41: clearly distinguish the executed statement output from controls and
   diagnostics without sacrificing theme-dependent foreground contrast. */
#sql-workspace-results.sql-results:not(:empty){
  background:color-mix(in srgb,var(--blue) 9%,var(--paper));
  border:1px solid color-mix(in srgb,var(--blue) 55%,var(--edge));
  border-left:6px solid var(--blue);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--blue) 8%,transparent);
  border-radius:9px;
  padding:12px 14px 14px 14px;
}
.sql-statement-results-title{font-size:14px;line-height:1.35;font-weight:750;color:var(--ink);margin:0 0 12px}
@media(max-width:540px){#sql-workspace-results.sql-results:not(:empty){border-left-width:4px;padding:10px 8px}}

/* RC44: show verified baseline storage separately from scan setup. */
.baseline-history-panel[hidden]{display:none!important}
.baseline-history-panel .baseline-history-heading{justify-content:flex-start;gap:12px;flex-wrap:wrap}
.baseline-history-panel .section-title h2{margin:0}
.baseline-history-heading #saved-users{flex:0 0 auto;white-space:nowrap}
.baseline-history-stats{display:flex;align-items:center;gap:12px 22px;flex:0 1 auto;flex-wrap:wrap;min-width:0}
.baseline-history-stats>span{display:inline-flex;align-items:baseline;gap:6px;white-space:nowrap;font-size:12px;color:var(--muted)}
.baseline-history-stats strong{font-size:18px;font-weight:750;color:var(--ink);font-variant-numeric:tabular-nums}
@media(max-width:540px){.baseline-history-stats{gap:9px 15px}}
/* Rating controls belong on the same heading row, immediately after AI Report. */
.results-pane-heading .simple-ratings-toolbar{margin:0;gap:6px 12px}
.results-pane-heading .simple-ratings-toolbar .micro{font-size:11px}
/* Accessible hover description without an extra paragraph taking layout space. */
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

/* RC46: responsive breathing room pass. Keep information visible rather than
   depending on fixed-height control rows or narrow chart/card columns. */
@media(min-width:1500px){
  main,.top-bar{max-width:1600px}
}
.results-pane-heading{column-gap:14px;row-gap:12px;min-width:0}
.results-pane-heading h2{flex:0 1 auto;min-width:0}
.results-pane-heading .simple-ratings-toolbar{flex:0 1 auto;min-width:0;row-gap:9px}
.results-pane-heading .simple-ratings-toolbar label{min-width:0}
.results-pane-heading .simple-ratings-toolbar .micro{line-height:1.4;overflow-wrap:anywhere}
.baseline-history-heading{row-gap:10px}
.baseline-history-stats{row-gap:11px}
/* Wider cards preserve the date gutters and SVG labels in rating plots. */
.simple-results-list{grid-template-columns:repeat(auto-fill,minmax(min(100%,310px),1fr));gap:14px}
.simple-results-list .simple-result-row{padding:12px 14px;gap:7px;min-width:0}
.simple-rating-trend{min-width:0;gap:6px}
.simple-spark-chart-row{gap:4px;min-width:0}
.simple-spark-chart-row .simple-trend-plot{min-width:0;max-height:120px}
.simple-trend-heading{line-height:1.4;min-width:0}
.simple-trend-heading strong{overflow-wrap:anywhere}
/* Avoid the fixed 40px Advanced filter rows cutting into wrapped content. */
.global-filter-segment .global-filter-option{height:auto;min-height:48px;align-items:center}
.global-filter-segment .global-filter-label{min-width:0;overflow-wrap:anywhere;line-height:1.35}
.global-filter-segment .global-filter-count{flex:0 0 auto}
/* Switch the rail above the cards when a sidebar would squeeze the plots. */
@media(max-width:700px){
  .simple-results-layout{grid-template-columns:minmax(0,1fr);gap:12px}
  .simple-category-rail{position:static;top:auto;max-width:none;min-width:0;width:100%;flex-flow:row wrap;gap:6px}
  .simple-category-rail button,
  .simple-category-rail button[data-simple-filter="all"]{flex:1 1 120px;min-width:0}
  .simple-category-rail button[data-simple-filter="games"]{flex:1 1 120px;min-width:0}
  .simple-results-list{grid-template-columns:repeat(auto-fill,minmax(min(100%,295px),1fr))}
}
@media(max-width:480px){
  .results-pane-heading{align-items:flex-start;gap:10px}
  .results-pane-heading .simple-ratings-toolbar{flex-basis:100%}
  .simple-results-list{grid-template-columns:minmax(0,1fr)}
  .simple-category-rail button{flex-basis:calc(50% - 4px)}
  .baseline-history-heading #saved-users{white-space:normal;text-align:left}
}

/* RC47: Other game types popup uses the Advanced tooltip's complete game
   history rows. Keep dates clickable, chronological paging, and responsive
   wrapping for unusually long usernames without horizontal clipping. */
.dialog[data-modal="simple-game-types"].wide{width:min(650px,calc(100vw - 24px))}
.rating-evidence-popup .simple-pool-game-list .older-games-grid{grid-template-columns:minmax(0,1fr);gap:0}
.rating-evidence-popup .simple-pool-game-list .older-game{
  padding:8px 2px;border:0;border-bottom:1px solid var(--edge);
  border-radius:0;background:transparent;font-size:12px;line-height:1.5;
  overflow-wrap:anywhere;white-space:normal
}
.rating-evidence-popup .simple-pool-game-list .older-game:first-child{border-top:1px solid var(--edge)}
.rating-evidence-popup .simple-pool-game-list .older-game a{font-weight:650}
.rating-evidence-popup .simple-pool-game-list h3{overflow-wrap:anywhere}
@media(max-width:480px){
  .dialog[data-modal="simple-game-types"] .dialog-main{padding:10px}
  .simple-rating-pool-panel{padding:9px}
  .rating-evidence-popup .simple-pool-game-list .older-game{font-size:11px}
}

/* RC48: keep Baseline History totals directly to the right of its button,
   with wrapping as necessary instead of a separate statistics row. */
.baseline-history-heading{justify-content:flex-start;align-items:center;column-gap:14px}
.baseline-history-heading .baseline-history-stats{margin:0}

/* RC49: automatically number visible major page sections at their top-left.
   Hidden Baseline History does not consume a number. */
main{counter-reset:cass-major-section}
main>section.panel:not([hidden]){counter-increment:cass-major-section;position:relative;padding-left:56px}
main>section.panel:not([hidden])::before{
  content:counter(cass-major-section);position:absolute;left:13px;top:14px;
  display:grid;place-items:center;width:28px;height:28px;box-sizing:border-box;
  font-size:12px;font-weight:800;font-variant-numeric:tabular-nums;
  border:2px solid #fff;border-radius:50%;color:#fff;background:#223048;
  box-shadow:0 0 0 1px rgba(0,0,0,.28)
}
@media(max-width:560px){main>section.panel:not([hidden]){padding-left:49px}main>section.panel:not([hidden])::before{left:9px;top:12px}}
/* Independently sortable/selectable Saved History tables. */
#retained-scans-table tbody tr{cursor:pointer}
#retained-scans-table tbody tr.is-selected td{background:color-mix(in srgb,var(--blue) 17%,var(--paper))!important}
#retained-scans-table tbody tr:hover td{background:color-mix(in srgb,var(--blue) 10%,var(--paper))}
#retained-scans-table tbody tr.is-selected:hover td{background:color-mix(in srgb,var(--blue) 23%,var(--paper))!important}
#retained-scans-table td:last-child{overflow-wrap:anywhere;max-width:290px}
.dialog[data-modal="saved-users"] .dialog-main{min-height:325px}

/* Compact, accessible delete action beside the retained-scan selection tools. */
.retained-delete-icon{min-width:37px;min-height:36px;padding:5px 9px;font-size:18px;font-weight:700;line-height:1}

/* RC50: independent Baseline and Retained Scan sections, no nested tabs. */
.saved-history-section{position:relative;min-width:0;padding-bottom:14px}
.saved-history-section+.saved-history-section{border-top:1px solid var(--edge);padding-top:18px;margin-top:20px}
.saved-history-section>h3{font-size:15px;margin:0 0 10px;color:var(--ink);scroll-margin-top:16px}
.dialog[data-modal="saved-users"] .saved-history-actionbar{position:sticky;top:0;z-index:9;background:var(--paper);border:1px solid var(--edge);border-radius:7px;padding:9px;margin-top:10px;box-shadow:0 3px 10px #0002}
.dialog[data-modal="saved-users"] .saved-users-table-wrap{max-height:370px;overflow:auto;scrollbar-gutter:stable}
.dialog[data-modal="saved-users"] .saved-users-table-wrap table{min-width:650px}
.dialog[data-modal="saved-users"] .saved-users-table-wrap thead th{position:sticky;top:0;background:var(--fill);z-index:1}
.dialog[data-modal="saved-users"] .saved-users-table tbody tr{user-select:text}
.dialog[data-modal="saved-users"] .saved-users-table tbody tr.is-selected{background:color-mix(in srgb,var(--blue) 16%,transparent)}
.results-usernames-row{display:flex;align-items:stretch;gap:8px;min-width:0}
.results-usernames-row .results-users-display{flex:1;min-width:0}
.results-clear-button{flex:0 0 auto;align-self:stretch}
@media(max-width:510px){.results-usernames-row{flex-wrap:wrap}.results-clear-button{margin-left:auto}}
/* Keep the larger five-counter group next to Saved Users at desktop widths.
   Wrap individual counters inside the group rather than moving it wholesale. */
.baseline-history-heading .baseline-history-stats{flex:1 1 390px;min-width:0;align-content:center}

/* RC51: major-section headings align vertically with their circular number
   markers. A wrapped Baseline History counter row must not pull its title
   below the badge. Keep headings consistent on desktop and mobile. */
main>section.panel:not([hidden])::before{top:18px}
main>section.panel:not([hidden])>.major-section-heading{min-height:28px;margin:0 0 12px;align-items:flex-start;justify-content:flex-start}
main>section.panel:not([hidden])>.major-section-heading>h2{margin:0;line-height:28px;min-height:28px;flex:0 0 auto}
.baseline-history-panel .baseline-history-heading{align-items:flex-start;gap:10px 14px}
.baseline-history-panel .baseline-history-heading .baseline-history-stats{margin:0}
.baseline-history-stats{gap:10px 18px}
.baseline-stat-group{display:flex;align-items:center;flex:0 1 auto;flex-wrap:wrap;gap:10px 22px;min-width:0}
.baseline-stat-group>span{display:inline-flex;align-items:baseline;gap:6px;white-space:nowrap;font-size:12px;color:var(--muted)}
.baseline-retained-stat-group{border-inline-start:1px solid var(--muted);padding-inline-start:18px;min-height:28px}
/* RC58: the divider describes side-by-side groups, not stacked rows.
   Preserve its occupied width so hiding it cannot change the wrapping that
   triggered the decision (and cause resize/paint oscillation). Move the
   indentation to the trailing edge so a new row starts flush left. */
.baseline-history-stats.is-wrapped .baseline-retained-stat-group{
  border-inline-start-color:transparent;
  padding-inline-start:0;
  padding-inline-end:18px;
}
/* Retain clear-and-copy together, with Clear always preceding the field. */
@media(max-width:510px){.results-usernames-row{flex-wrap:nowrap}.results-clear-button{margin-left:0}}
@media(max-width:560px){main>section.panel:not([hidden])::before{top:13px}}

/* RC52: Restore the Baseline / Retained Scan tabs that RC50 mistakenly removed. */
.saved-history-tabs{margin:0 0 14px}
#saved-pane-retained[hidden],#saved-pane-baseline[hidden]{display:none!important}
/* Tabs are part of one continuous strip; inactive tabs no longer float. */
.saved-history-tabs button:not([aria-selected=true]){margin-bottom:-2px;transform:none}
.saved-history-tabs button[aria-selected=true]{margin-bottom:-2px;box-shadow:inset 0 2px 0 var(--blue)}
.saved-history-section+.saved-history-section{border-top:0;padding-top:0;margin-top:0}
.dialog[data-modal="saved-users"] .saved-history-section{min-width:0}

/* RC54: explicit site iconography, focused row actions and bottom toolbars. */
.dialog[data-modal="saved-users"] .saved-history-actionbar{position:static;box-shadow:none}
.dialog[data-modal="saved-users"] .saved-history-bottom-actions{position:static;z-index:auto;margin-top:12px;padding:9px 0;gap:7px}
.saved-history-action-divider{width:1px;height:28px;background:var(--edge);margin:0 3px}
.saved-history-bottom-actions .selected-count{margin-left:auto;font-size:12px}
#retained-scans-table .retained-row-actions{display:flex;flex-wrap:nowrap;align-items:center;gap:5px}
#retained-scans-table .retained-row-actions button{padding:5px 7px;font-size:11px;white-space:nowrap}
#retained-scans-table .retained-row-actions .danger{min-width:30px}
#retained-scans-table .retained-scope-link{border:0;background:transparent;padding:3px;color:var(--blue);font-size:12px;text-decoration:underline;white-space:nowrap}
#retained-scans-table td:last-child{max-width:none;overflow-wrap:normal}
.dialog[data-modal="saved-users"] #retained-scans-table{min-width:875px}
.dialog[data-modal="saved-users"] .saved-users-table-wrap thead th{position:static} /* header may scroll out */
.site-pill .provider-brand-icon{width:16px;height:16px;object-fit:contain;flex:0 0 16px}
.retained-scope-overlay{position:fixed;inset:0;z-index:150;display:grid;place-items:center;background:#010814ba;padding:16px}
.retained-scope-dialog{width:min(600px,100%);max-height:min(80vh,750px);overflow:auto;background:var(--paper);color:var(--ink);border:1px solid var(--edge);border-radius:10px;padding:18px;box-shadow:0 14px 60px #0008}
.retained-scope-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.retained-scope-heading h3{margin:0;font-size:16px}
.retained-scope-json{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--fill);border:1px solid var(--edge);border-radius:7px;padding:12px;max-height:55vh;overflow:auto;font-size:12px}
.main-contact .contact-legal{font-size:12px;color:var(--muted);margin-top:12px}
@media(max-width:600px){.saved-history-bottom-actions .selected-count{margin-left:0}.saved-history-action-divider{display:none}}

/* RC60: normalize the numbered major-section divider styling.
   Use one consistent line color/thickness across sections, and start the
   divider slightly to the right of the number badge rather than beneath it. */
main>section.panel:not([hidden])>.major-section-heading{
  position:relative;
  padding-bottom:13px;
  margin-bottom:16px;
}
main>section.panel:not([hidden])>details#troubleshooting>summary{
  position:relative;
  padding-bottom:13px;
}
main>section.panel:not([hidden])>.major-section-heading::after,
main>section.panel:not([hidden])>details#troubleshooting>summary::after{
  content:"";
  position:absolute;
  left:-8px;
  right:0;
  bottom:0;
  height:2px;
  border-radius:2px;
  background:var(--edge);
  pointer-events:none;
}
@media(max-width:560px){
  main>section.panel:not([hidden])>.major-section-heading::after,
  main>section.panel:not([hidden])>details#troubleshooting>summary::after{left:-6px}
}

/* RC56: the Results Saved History entry point shares the heading row,
   and wraps without pushing the numbered heading/divider out of alignment. */
#results-panel>.major-section-heading .results-history-button{flex:0 0 auto;max-width:100%;white-space:normal;text-align:center}
@media(max-width:560px){#results-panel>.major-section-heading .results-history-button{font-size:12px;padding:8px 10px}}

/* RC59: Saved History sort glyphs belong to their individual header cells,
   not the far edge of the modal. DataTables 1.13 renders a ::before/::after
   pair with position:absolute; position:static caused both to float. */
.dialog[data-modal="saved-users"] .saved-users-table-wrap thead th {
  position:relative;
  padding-right:24px;
}
.dialog[data-modal="saved-users"] .saved-users-table-wrap thead th.sorting_disabled::before,
.dialog[data-modal="saved-users"] .saved-users-table-wrap thead th.sorting_disabled::after {
  content:none!important;
  display:none!important;
}
/* Align the two saved-history launchers with the first heading line. */
.baseline-history-heading > #saved-users,
#results-panel > .major-section-heading > .results-history-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  align-self:flex-start;
  min-height:36px;
  margin-top:-4px;
  line-height:20px;
  text-align:center;
}
/* Keep the manual/automatic save state from resizing neighboring controls. */
#save-baseline {
  min-width:236px;
  min-height:36px;
}

/* RC61: align the Saved Users button label with the Results heading text.
   The existing heading/button font sizes leave the button label 3px lower.
   Relative positioning fixes the optical offset without resizing the button
   or changing the section underline's layout/spacing. */
#results-panel > .major-section-heading > .results-history-button {
  position:relative;
  top:-3px;
}

/* RC61: compact Simple ratings are three readable source-labelled tiles.
   The period-start tile is highlighted in green; labels wrap safely for
   long scanned usernames without resizing neighboring cards. */
.simple-results-list .simple-rating,
.rating-tooltip-compact .simple-rating,
.older-game .simple-rating{display:block;min-width:0;width:100%;line-height:1.3}
.simple-rating-type{display:block;margin:2px 0 5px;font-weight:800;font-size:12px;color:var(--ink)}
.simple-rating-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;min-width:0}
.simple-rating-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:64px;padding:7px 4px;text-align:center;border:1px solid var(--edge);border-radius:7px;background:var(--fill)}
.simple-rating-tile strong{font-size:17px;line-height:1.1;font-weight:850;font-variant-numeric:tabular-nums;color:var(--ink)}
.simple-rating-tile span{font-size:10px;line-height:1.28;font-weight:650;color:var(--muted);overflow-wrap:anywhere;word-break:normal;hyphens:auto}
.simple-rating-start{background:color-mix(in srgb,var(--green) 16%,var(--fill));border-color:var(--green)}
.simple-rating-start strong{color:var(--green)}
.simple-rating-start span{color:var(--ink)}
@media(max-width:430px){.simple-rating-tiles{gap:4px}.simple-rating-tile{padding:6px 3px}.simple-rating-tile strong{font-size:15px}}

/* RC65: three Simple rating tiles share a fixed visual number row and a
   centered caption row, with the observation date anchored to the bottom.
   Red status highlighting is reserved for explicitly flagged/closed types. */
.simple-rating-tiles{align-items:stretch}
.simple-rating-tile{
  display:grid;
  grid-template-rows:24px minmax(0,1fr) 18px;
  align-items:center;
  justify-items:center;
  gap:4px;
  min-height:116px;
  height:100%;
  padding:8px 4px 7px;
  text-align:center;
}
.simple-rating-tile .simple-rating-value{align-self:center;line-height:24px;font-variant-numeric:tabular-nums}
.simple-rating-tile .simple-rating-caption{align-self:center;font-size:10px;line-height:1.23}
.simple-rating-tile .simple-rating-date{
  align-self:end;
  font-size:9px;
  line-height:16px;
  font-weight:500;
  color:var(--muted);
  white-space:nowrap;
  max-width:100%;
  letter-spacing:-0.02em;
}
.simple-rating-tile.simple-rating-latest.is-status-red{
  background:color-mix(in srgb,var(--red) 18%,var(--fill));
  border-color:var(--red);
}
.simple-rating-tile.simple-rating-latest.is-status-red .simple-rating-value{color:var(--red)}
@media(max-width:430px){.simple-rating-tile .simple-rating-date{font-size:8px}}

/* RC2: tighten compact rating tiles without disturbing the three aligned rows. */
.simple-rating-tile{
  min-height:82px;
  grid-template-rows:21px minmax(25px,auto) 15px;
  gap:2px;
  padding:4px 4px 3px;
}
.simple-rating-tile .simple-rating-value{line-height:21px}
.simple-rating-tile .simple-rating-caption{line-height:1.17}
.simple-rating-tile .simple-rating-date{line-height:14px}

/* RC64: one stable tab edge for Results and all Saved History tabs.
   Older negative bottom margins and active padding offsets caused overlapping
   strokes at the strip baseline and inconsistent tab bottoms. */
.results-view-tabs, .tabs {
  align-items:flex-end;
  gap:6px;
  border-bottom:1px solid var(--edge);
}
.results-view-tabs > button, .tabs > button,
.results-view-tabs > button:not([aria-selected=true]), .tabs > button:not([aria-selected=true]) {
  position:relative;
  box-sizing:border-box;
  height:44px;
  min-height:44px;
  margin:0;
  padding:10px 17px 11px;
  border:1px solid var(--edge);
  border-radius:9px 9px 0 0;
  transform:none;
  box-shadow:none;
}
.results-view-tabs > button[aria-selected=true], .tabs > button[aria-selected=true] {
  height:44px;
  min-height:44px;
  margin:0;
  padding:10px 17px 11px;
  border:1px solid var(--blue);
  border-bottom-color:var(--paper);
  background:var(--paper);
  box-shadow:inset 0 3px var(--blue);
  z-index:1;
}
.results-view-tabs > button[aria-selected=true]::after,
.tabs > button[aria-selected=true]::after {
  content:"";
  position:absolute;
  height:1px;
  bottom:-1px;
  left:1px;
  right:1px;
  background:var(--paper);
  pointer-events:none;
}
/* RC64: last encounter rating sits directly under its dashed spark marker. */
.simple-spark-encounter-rating {
  fill:var(--red);
  font-size:11px;
}

/* RC66: The editorial “hmm” video opens on demand in a floating in-page player. */
.hmm-video-link{display:inline;border:0;padding:0;margin:0;background:none;color:var(--blue);font:inherit;text-decoration:underline;text-underline-offset:2px;cursor:pointer}
.hmm-video-link:hover{filter:none;color:var(--ink)}
.hmm-video-link:focus-visible{outline:2px solid var(--blue);outline-offset:3px;border-radius:2px}
.hmm-video-window{position:fixed;right:18px;bottom:18px;z-index:520;width:min(420px,calc(100vw - 24px));height:295px;min-width:min(280px,calc(100vw - 24px));min-height:240px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);display:flex;flex-direction:column;overflow:auto;resize:both;border:1px solid var(--edge);border-radius:11px;background:var(--paper);color:var(--ink);box-shadow:0 13px 48px #0009}
.hmm-video-titlebar{display:flex;align-items:center;gap:8px;flex:0 0 auto;min-height:38px;padding:5px 8px 5px 12px;background:var(--fill);border-bottom:1px solid var(--edge);user-select:none;cursor:move;touch-action:none}
.hmm-video-title{font-weight:700;font-size:12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1}
.hmm-video-external{font-size:11px;color:var(--blue);white-space:nowrap;cursor:pointer}
.hmm-video-close{flex:0 0 auto;padding:3px 7px;min-width:29px;min-height:27px;line-height:1}
.hmm-video-content{flex:1 1 auto;min-height:0;background:#000}
.hmm-video-content iframe{display:block;width:100%;height:100%;border:0}
.hmm-video-hint{flex:0 0 auto;font-size:10px;line-height:17px;padding:0 8px;color:var(--muted);text-align:right}
@media(max-width:560px){.hmm-video-window{right:10px;bottom:10px;width:min(360px,calc(100vw - 20px));height:262px}}

/* RC67: Keep existing Simple status categories visible when filters exclude
   their matches, instead of removing buttons from the rail. Dim only the
   unavailable category control, never the website toggles or dividers. */
.simple-category-rail button[data-simple-filter][data-simple-availability="site-filtered"],
.simple-category-rail button[data-simple-filter][data-simple-availability="empty"]{
  opacity:.4;
}
.simple-category-rail button[data-simple-filter][data-simple-availability="site-filtered"][aria-pressed="true"],
.simple-category-rail button[data-simple-filter][data-simple-availability="empty"][aria-pressed="true"]{
  opacity:.62;
}
.simple-category-rail button[data-simple-filter][data-simple-availability="site-filtered"]:hover,
.simple-category-rail button[data-simple-filter][data-simple-availability="empty"]:hover,
.simple-category-rail button[data-simple-filter][data-simple-availability="site-filtered"]:focus-visible,
.simple-category-rail button[data-simple-filter][data-simple-availability="empty"]:focus-visible{
  opacity:.83;
}


/* RC70: make rating-history authorization limits visible near scan usernames. */
.field > .lichess-rating-history-warning {
  display:block;
  margin:8px 0 0;
  font-size:11px;
  font-family:"Alegreya Sans SC",system-ui,sans-serif;
  font-variant-caps:all-small-caps;
  font-weight:800;
  letter-spacing:.035em;
  line-height:1.45;
  color:var(--amber);
}
.field > .lichess-rating-history-warning[hidden]{display:none!important}

/* b2: non-sensitive, per-run diagnostic of experimental Lichess cookie fetch. */
.field > .lichess-cookie-test-status{display:block;color:var(--muted);font-size:11px;line-height:1.4;margin-top:5px}
.field > .lichess-cookie-test-status[hidden]{display:none!important}

/* 2.0.1-rc.1: real small-cap forms from Alegreya Sans SC where requested.
   Local system sans-serif remains legible if external font hosting is blocked. */
/* Provider's official Lichess SVG is black. Keep it visible on dark themes,
   while preserving the publisher's unmodified image file. */
.provider-brand-icon[src^="https://raw.githubusercontent.com/lichess-org/lila/"],
.site-toggle-icon[src^="https://raw.githubusercontent.com/lichess-org/lila/"]{filter:invert(1)}
:root:is([data-theme="light"],[data-theme="github-light"],[data-theme="catppuccin-latte"],[data-theme="nord-light"],[data-theme="dracula-alucard"],[data-theme="rose-pine-dawn"],[data-theme="tokyo-light"],[data-theme="solarized-light"],[data-theme="gruvbox-light"],[data-theme="everforest-light"],[data-theme="everforest-light-soft"],[data-theme="everforest-light-hard"],[data-theme="ayu-light"]) .provider-brand-icon[src^="https://raw.githubusercontent.com/lichess-org/lila/"],
:root:is([data-theme="light"],[data-theme="github-light"],[data-theme="catppuccin-latte"],[data-theme="nord-light"],[data-theme="dracula-alucard"],[data-theme="rose-pine-dawn"],[data-theme="tokyo-light"],[data-theme="solarized-light"],[data-theme="gruvbox-light"],[data-theme="everforest-light"],[data-theme="everforest-light-soft"],[data-theme="everforest-light-hard"],[data-theme="ayu-light"]) .site-toggle-icon[src^="https://raw.githubusercontent.com/lichess-org/lila/"]{filter:none}
@media(prefers-color-scheme:light){
  :root[data-theme="system"] .provider-brand-icon[src^="https://raw.githubusercontent.com/lichess-org/lila/"],
  :root[data-theme="system"] .site-toggle-icon[src^="https://raw.githubusercontent.com/lichess-org/lila/"]{filter:none}
}

/* RC3: use freed space from the range dropdown for wider scan buttons. */
@media(min-width:900px){
  .scan-grid{grid-template-columns:minmax(255px,1.6fr) max-content minmax(265px,1.15fr)}
  .scan-grid>.field:nth-child(2){width:max-content;max-width:100%}
  #scope{width:max-content;min-width:0;max-width:100%;padding-right:32px}
  .scan-actions button{white-space:nowrap}
  .scan-actions button>span{white-space:nowrap}
}
@media(min-width:561px) and (max-width:899px){
  .scan-grid{grid-template-columns:minmax(0,1fr) max-content}
  .scan-grid>.scan-actions{grid-column:1/-1;display:flex;padding-top:0}
  #scope{width:max-content;max-width:100%}
}
.setup-bottom-actions{display:flex;align-items:center;gap:8px}
.setup-bottom-actions>.setup-lichess-auth{margin-left:auto;white-space:nowrap;font-weight:700}
.setup-lichess-auth.authorized{color:var(--green);border-color:var(--green);background:color-mix(in srgb,var(--green) 10%,var(--fill))}
.setup-lichess-auth.authorization-needed{color:var(--red);border-color:var(--red);background:color-mix(in srgb,var(--red) 9%,var(--fill))}
@media(max-width:560px){.setup-bottom-actions>.setup-lichess-auth{margin-left:0}}
.data-history-baseline-delete{justify-content:flex-end;margin-top:18px;border-top:1px solid var(--edge);padding-top:14px}
.hmm-video-hint{height:auto;line-height:1.3;padding:6px 8px;text-align:left}
.hmm-video-hint a{color:var(--blue)}

/* RC3: Advanced rating hover shows game type and encounter count on one
   compact heading row; do not repeat the type in parentheses or above it. */
.rating-chip-tooltip .rating-tooltip-inline-heading{
  display:flex;flex-direction:row;align-items:baseline;justify-content:flex-start;
  flex-wrap:wrap;column-gap:11px;row-gap:2px;min-width:0;line-height:1.3;
  margin-bottom:5px;
}
.rating-chip-tooltip .rating-tooltip-inline-heading strong{flex:0 0 auto;font-size:12px}
.rating-chip-tooltip .rating-tooltip-count{font-size:11px;overflow-wrap:anywhere;color:var(--muted)}
.rating-chip-tooltip .rating-tooltip-compact .simple-rating-type{display:none}
