/* 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%;}
.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;flex-wrap:wrap;gap:8px}
.sql-history-import-actions button{flex:1 1 250px;min-height:40px;font-weight:750;white-space:normal}
.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{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{}
.simple-trend-heading span{}
.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;overflow:visible}
.simple-rating-trend{width:100%;max-width:100%;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{max-height:140px;min-height:100px;aspect-ratio:330 / 145;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{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;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;gap:5px;width:100%;}
.simple-spark-side-meta{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0}
.simple-spark-side-label{display:block;color:var(--ink);font-size:10px;font-weight:800;line-height:1.1;text-align:center;white-space:nowrap;max-width:4.8em;overflow:hidden;text-overflow:ellipsis}
.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);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-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:center;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)}
}

/* 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}
}

/* Keep Baseline History totals alongside its heading,
   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 beside the Baseline History title 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}

/* Alpha.44: every numbered section uses the same first-row vertical axis.
   The title and launcher occupy a 36px row; 28px badge/gear are centered in
   that row. Wrapped statistics and actions must not shift the title or badge. */
main>section.panel:not([hidden])::before{top:22px}
main>section.panel:not([hidden])>.major-section-heading{
  min-height:36px;margin:0 0 12px;align-items:flex-start;justify-content:flex-start;
}
main>section.panel:not([hidden])>.major-section-heading>h2{
  display:flex;align-items:center;min-height:36px;margin:0;line-height:1.25;flex:0 0 auto;
}
main>section.panel:not([hidden])>.major-section-heading>.section-options-gear{
  margin-top:4px;align-self:flex-start;
}
.baseline-history-panel .baseline-history-heading{align-items:flex-start;gap:10px 14px}
.baseline-history-panel .baseline-history-heading .baseline-history-stats{margin:0;min-height:36px}
.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:21px}
  main>section.panel:not([hidden])>.major-section-heading{min-height:44px}
  main>section.panel:not([hidden])>.major-section-heading>h2{min-height:44px}
  main>section.panel:not([hidden])>.major-section-heading>.section-options-gear{margin-top:0}
  .baseline-history-panel .baseline-history-heading .baseline-history-stats{min-height:44px}
}

/* 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;
  min-height:36px;
  line-height:36px;
  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}
  main>section.panel:not([hidden])>details#troubleshooting>summary{min-height:44px;line-height:44px}
}


/* Alpha.47: one detached pre-window encounter, not a historical line. The
   compact torn seam is rendered inside the existing SVG, so narrow cards do
   not acquire another fixed-width column or any extra text explanation. */
.simple-spark-chart-row .simple-trend-plot.has-pre-window-encounter{min-width:0;max-width:322px}
.simple-trend-plot .simple-prewindow-rating-label{
  fill:var(--red);font-size:12px;font-weight:800;
  paint-order:stroke;stroke:var(--paper);stroke-width:2px;stroke-linejoin:round;
}
.simple-trend-plot .simple-spark-empty-window{
  fill:var(--muted);font-size:11px;font-weight:650;
}
/* The earlier game date stays in the left stack. The previously-left
   in-window axis date is a small label under the plot, right of the seam. */
.simple-trend-plot .simple-spark-window-start-date{
  fill:var(--muted);font-size:8px;font-weight:650;
  paint-order:stroke;stroke:var(--paper);stroke-width:1.2px;stroke-linejoin:round;
}
