/* SolsticeBench -- Solstice skin for OpenBench.
 *
 * Loaded after OpenBench's own style.css / base.css / form.css / paging.css
 * and only overrides colour, type and a few details, so upstream OpenBench
 * updates still merge cleanly.
 *
 * Direction: "lit means live". The base is monochrome -- black glass, white
 * text, grey rules; pink is the secondary layer (sign, links, labels, focus). Light is
 * reserved for what is live: the sign (wordmark) and running tests glow hot
 * pink; finished tests are unlit tubes in their gas colour (mint = passed,
 * argon blue = passed non-regression, amber = failed with W >= L, red-orange
 * = failed). No glow is ever used as decoration.
 */

:root {
    /* monochrome base: black glass, white text */
    --glass:        #0A0A0A;   /* page                        */
    --glass-1:      #111111;   /* rows, sidebar               */
    --glass-2:      #181818;   /* alternate rows, inputs      */
    --glass-3:      #242424;   /* hover, raised               */
    --rule:         #2A2A2A;   /* hairlines                   */
    --rule-strong:  #404040;

    --core:         #F4F4F4;   /* primary text   (18.4:1 on glass) */
    --dust:         #B5B5B5;   /* secondary text  (9.9:1)          */
    --dust-2:       #8A8A8A;   /* hints / disabled (5.9:1)         */

    /* pink lives in the secondary layer only: sign, live state, links,
       section labels, focus, selection, hover and the current page */

    --neon:         #FF3D9A;   /* the lit tube                     */
    --neon-link:    #FF6FB2;   /* links (7.3:1)                    */
    --neon-hi:      #FF9ACB;
    --neon-wash:    rgba(255, 61, 154, 0.10);

    /* unlit tubes, by gas */
    --pass-fg: #8EF2C8;  --pass-bg: #0F2019;  --pass-rule: #2C5E4B;
    --run-fg:  #A9C2FF;  --run-bg:  #121826;  --run-rule:  #34436F;
    --warn-fg: #FFD38A;  --warn-bg: #261C10;  --warn-rule: #6A4A22;
    --fail-fg: #FF9B85;  --fail-bg: #28100E;  --fail-rule: #6E2F27;

    --radius: 3px;
    --pill:   999px;
    --sign: "Tilt Neon", "Barlow Semi Condensed", sans-serif;
    --sans: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
    --mono: "Red Hat Mono", ui-monospace, Consolas, monospace;
}

/* ---- Base ------------------------------------------------------------ */

html {
    scrollbar-color: var(--rule-strong) var(--glass);
}

body {
    /* re-point OpenBench's own variables at the palette */
    --color1: var(--glass);
    --color2: var(--glass-2);
    --color3: var(--glass-3);
    --color-font1: var(--core);
    --color-font2: var(--dust);
    --color-font3: var(--neon-link);

    background: var(--glass);
    color: var(--core);
    font-family: var(--sans);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    caret-color: var(--neon);
    -webkit-font-smoothing: antialiased;
}

a:link, a:visited, a:active {
    color: var(--neon-link);
    text-underline-offset: 3px;
    transition: color 120ms ease-out;
}

a:hover {
    color: var(--neon-hi);
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

:focus-visible {
    outline: 2px solid var(--neon);
    outline-offset: 2px;
}

::selection {
    background: rgba(255, 61, 154, 0.38);
    color: var(--core);
}

/* ---- Sidebar --------------------------------------------------------- */

#sidebar {
    background: var(--glass-1);
    border-right: 1px solid var(--rule);
    padding-top: 26px;
    min-height: 100vh;
    box-sizing: border-box;
    align-self: stretch;
}

#sidebar ul {
    padding: 0 10px;
    margin: 4px 0 10px;
    line-height: 1.5;
}

#sidebar li {
    padding: 3px 12px;
    font-size: 0.98rem;
    font-weight: 500;
    border-radius: var(--pill);
    transition: background-color 120ms ease-out;
}

#sidebar li a {
    color: var(--dust);
    transition: color 120ms ease-out;
}

#sidebar li a:hover { text-decoration: none; }

#sidebar li a i {
    color: var(--dust-2);
    margin-right: 6px;
    transition: color 120ms ease-out;
}

#sidebar li:hover {
    background-color: var(--glass-3);
}

#sidebar li:hover a, #sidebar li:hover a i {
    color: var(--core);
}

#sidebar .header {
    color: var(--neon-link);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 12px 12px 2px;
}

#sidebar .header:hover { background: none; }

#sidebar hr { display: none; }

/* ---- Header: the sign ------------------------------------------------ */

#content-header {
    display: flex;
    align-items: center;
    padding: 18px 0 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--rule);
}

#content-header h2 {
    margin: 0;
    font-size: 1.9rem;
    line-height: 1;
}

#content .site-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--sign);
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--core);
    text-decoration: none;
    /* a lit tube: white-hot core, pink falloff */
    text-shadow:
        0 0 2px  rgba(255, 232, 243, 0.9),
        0 0 8px  rgba(255, 61, 154, 0.85),
        0 0 22px rgba(255, 61, 154, 0.55),
        0 0 44px rgba(255, 61, 154, 0.30);
    animation: strike 900ms steps(1, end) 1 both;
}

#content .site-title img {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 0 5px rgba(255, 61, 154, 0.7));
}

#content .site-title:hover {
    color: var(--core);
    text-decoration: none;
}

/* the sign strikes once on load, like a tube catching */
@keyframes strike {
    0%   { opacity: 0.25; text-shadow: none; }
    12%  { opacity: 1; }
    18%  { opacity: 0.35; text-shadow: none; }
    30%  { opacity: 1; }
    36%  { opacity: 0.6; }
    100% { opacity: 1; }
}

/* ---- Tables ---------------------------------------------------------- */

#content table { line-height: 1.2; }

#content td {
    color: var(--dust);
    border-bottom: 1px solid var(--rule);
}

#content th, #content td {
    padding: 9px 12px 8px;
}

#content .stripes tr:nth-child(odd):not(.table-header)  { background-color: var(--glass-1); }
#content .stripes tr:nth-child(even):not(.table-header) { background-color: var(--glass-2); }

#content .hoverable tr:nth-child(odd):hover:not(.table-header),
#content .hoverable tr:nth-child(even):hover:not(.table-header) {
    background-color: var(--glass-3);
}

#content .stripes th,
#content .table-header th,
#content .table-small-header th {
    background-color: var(--glass);
    color: var(--core);
    font-weight: 600;
    letter-spacing: 0.01em;
    border-bottom: 1px solid var(--rule-strong);
}

#content .table-small-header th {
    color: var(--dust-2);
    font-weight: 500;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#content .table-header th:first-child,
#content .table-header th:last-child { border-radius: 0; }

#content .table-spacer th, #content .table-spacer tr,
#content .stripes tr.table-spacer:nth-child(odd),
#content .stripes tr.table-spacer:nth-child(even),
#content .hoverable tr.table-spacer:hover {
    background-color: transparent !important;
    border: none;
    height: 1.5rem;
}

#content .table-spacer-small th, #content .table-spacer-small tr {
    background-color: var(--glass);
}

#content .active-highlight {
    border-left: none;
    background-color: var(--neon-wash) !important;
}

/* ---- Test lists (index, search) ------------------------------------- */

#content .test-list {
    width: 100%;
    border-collapse: collapse;
}

#content .test-list td {
    vertical-align: middle;
    background: transparent;
}

#content .test-list .section-row th {
    text-align: left;
    background: none;
    padding: 30px 12px 10px;
    border-bottom: 1px solid var(--rule-strong);
    font-weight: 400;
}

#content .test-list tr.section-row:first-child th { padding-top: 4px; }

#content .test-list .section-title {
    color: var(--core);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

#content .test-list .section-meta {
    color: var(--dust-2);
    font-size: 0.9rem;
    margin-left: 14px;
}

#content .col-heads th {
    text-align: left;
    background: none;
    color: var(--dust-2);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 10px 12px 6px;
    border-bottom: 1px solid var(--rule);
}

#content .test-list .group-row th {
    text-align: left;
    background: var(--glass-1);
    color: var(--dust);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 12px;
    border-bottom: 1px solid var(--rule);
}

#content .test-list .empty-row td {
    color: var(--dust-2);
    padding: 16px 12px;
}

/* Test name with its notes underneath is the one flexible column; the
   metadata and result sit together on the right. */
#content .test-list td.col-test { width: 100%; }

#content .col-test .test-line { white-space: nowrap; }

#content .col-test .test-notes {
    margin-top: 3px;
    max-width: 90ch;
    color: var(--dust-2);
    font-size: 0.88rem;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#content .col-test .test-name {
    color: var(--core);
    font-weight: 600;
}

#content .col-test .test-name:hover { color: var(--neon-hi); }

#content .col-test .test-diff {
    color: var(--dust-2);
    font-size: 0.85rem;
    margin-left: 10px;
}

#content .col-test .test-diff:hover { color: var(--neon-link); }

#content .test-flag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px 0;
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dust);
    border: 1px solid var(--rule-strong);
    border-radius: var(--pill);
    cursor: help;
    vertical-align: 1px;
}

#content .test-flag.flag-error {
    color: var(--fail-fg);
    border-color: var(--fail-rule);
}

#content .test-list td.statblock { white-space: nowrap; }

#content .col-tc,
#content .col-engine,
#content .col-author { padding-right: 20px; }

#content .col-heads th { padding-right: 20px; }

#content .col-tc {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--core);
    white-space: nowrap;
}

#content .col-engine,
#content .col-author { color: var(--dust); white-space: nowrap; }

#content .col-author a { color: var(--dust); }
#content .col-author a:hover { color: var(--neon-link); }

#content .test-list td.datestamp {
    color: var(--dust-2);
    font-size: 0.9rem;
    white-space: nowrap;
}


/* ---- Workload config (grouped key/value) ----------------------------- */

#content .test-config { border-collapse: collapse; }

#content .test-config .cfg-group th {
    text-align: left;
    background: none;
    color: var(--neon-link);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 22px 12px 6px;
    border-bottom: 1px solid var(--rule-strong);
}

#content .test-config tr.cfg-group:first-child th { padding-top: 2px; }

#content .test-config td {
    padding: 7px 12px 6px;
    color: var(--core);
    background: transparent;
}

#content .test-config .td-label {
    width: 1%;
    white-space: nowrap;
    color: var(--dust-2);
    font-size: 0.92rem;
    padding-right: 28px;
}

/* ---- Workload results / SPSA tables: same column-heading voice ------- */

#content #summary-container .table-header th,
#content #parameters .table-header th,
#content #results .table-header th {
    text-align: left;
    background: none;
    color: var(--dust-2);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 16px 12px 6px;
    border-bottom: 1px solid var(--rule);
}

#content #summary-container td,
#content #parameters td,
#content #results td {
    color: var(--core);
    background: transparent;
}

#content #summary-container .stripes tr:nth-child(odd):not(.table-header),
#content #summary-container .stripes tr:nth-child(even):not(.table-header),
#content #parameters .stripes tr:nth-child(odd):not(.table-header),
#content #parameters .stripes tr:nth-child(even):not(.table-header),
#content #results .stripes tr:nth-child(odd):not(.table-header),
#content #results .stripes tr:nth-child(even):not(.table-header) {
    background-color: transparent;
}

/* ---- Result blocks: lit while running, unlit tubes when done --------- */

/* A status light, not a box: a small dot before the result text. Lit
   (glowing pink) while the test runs; an unlit dot in the result colour once
   it has finished. The text still states the result, so colour is never the
   only signal. */
#content .statblock {
    position: relative;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.35;
    color: var(--core);
    background: transparent;
    box-shadow: none;
    border-top: none;
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 8px 14px 7px 30px;
    --light: var(--neon);
}

#content .statblock::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-radius: 50%;
    background: var(--light);
    /* running: lit */
    box-shadow:
        0 0 0 2px rgba(255, 61, 154, 0.18),
        0 0 10px rgba(255, 61, 154, 0.85);
}

#content .statblock strong { font-weight: 500; }

#content .statblock-green  { --light: var(--pass-fg); color: var(--pass-fg); }
#content .statblock-blue   { --light: var(--run-fg);  color: var(--run-fg); }
#content .statblock-yellow { --light: var(--warn-fg); color: var(--warn-fg); }
#content .statblock-red    { --light: var(--fail-fg); color: var(--fail-fg); }

#content .statblock-green::before,
#content .statblock-blue::before,
#content .statblock-yellow::before,
#content .statblock-red::before { box-shadow: none; }

#content .long-statblock {
    font-family: var(--mono);
    font-size: 13px;
    background-color: var(--glass-1);
    color: var(--dust);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}

#content .redlink { color: var(--fail-fg); }

/* configs, hashes, options: measured data */
#content .test-config td:not(.td-label),
#content .engine-options {
    font-family: var(--mono);
    font-size: 13px;
}

/* ---- Buttons --------------------------------------------------------- */

#content .anchorbutton {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    border: 1px solid var(--rule-strong);
    border-radius: var(--pill);
    color: var(--core);
    transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}

#content .anchorbutton:hover { text-decoration: none; }

#content .btn-blue, #content .btn-start {
    background-color: var(--glass-2);
}
#content .btn-blue:hover, #content .btn-start:hover {
    background-color: var(--neon);
    border-color: var(--neon);
    color: var(--glass);
}

#content .btn-preset       { background-color: var(--pass-bg); border-color: var(--pass-rule); color: var(--pass-fg); }
#content .btn-preset:hover { background-color: #173A2E; border-color: var(--pass-fg); }

#content .btn-yellow       { background-color: var(--warn-bg); border-color: var(--warn-rule); color: var(--warn-fg); }
#content .btn-yellow:hover { background-color: #3D2B17; border-color: var(--warn-fg); }

#content .btn-red          { background-color: var(--fail-bg); border-color: var(--fail-rule); color: var(--fail-fg); }
#content .btn-red:hover    { background-color: #421A16; border-color: var(--fail-fg); }

#content .btn-disabled, #content .btn-disabled:hover {
    background-color: var(--glass-1);
    border-color: var(--rule);
    color: var(--dust-2);
}

#content .copy-button { color: var(--dust-2); }
#content .copy-button:hover { color: var(--neon-link); }

/* ---- Forms ----------------------------------------------------------- */

#content .form h3 {
    color: var(--core);
    font-family: var(--sans);
    font-weight: 600;
    font-size: 1.2rem;
}

#content .row label {
    color: var(--dust);
    font-family: var(--sans);
    font-size: 14px;
}

#content .row input, #content .row select, #content .row textarea {
    background-color: var(--glass-1);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    color: var(--core);
    font-family: var(--mono);
    font-size: 13px;
}

#content .row input:focus, #content .row select:focus, #content .row textarea:focus {
    border-color: var(--neon);
    box-shadow: none;
    background-color: var(--glass-1);
    color: var(--core);
    outline: none;
}

#content .row input::placeholder, #content .row textarea::placeholder { color: var(--dust-2); }

#content .row select > option {
    background-color: var(--glass-1);
    color: var(--core);
}

#content .row input[type="file"]::file-selector-button {
    background-color: var(--glass-2);
    border: 1px solid var(--rule-strong);
    border-radius: var(--pill);
    color: var(--core);
    font-family: var(--sans);
}

#content .row input[type="file"]::file-selector-button:hover { background-color: var(--glass-3); }

#content .row input[readonly] { color: var(--dust-2); }

/* ---- Paging ---------------------------------------------------------- */

.page, .ellipsis {
    background-color: var(--glass-1);
    color: var(--dust);
    border-color: var(--rule);
}

.page:hover { background-color: var(--glass-3); }

.current {
    background-color: var(--neon) !important;
    color: var(--glass) !important;
}

/* ---- Messages / misc ------------------------------------------------- */

#content .error-message pre,
#content .warning-message pre,
#content .status-message pre {
    font-family: var(--mono);
    font-size: 13px;
    border-radius: var(--radius);
    padding: 9px 12px;
    white-space: pre-wrap;
}

#content .error-message pre   { color: var(--fail-fg); background: var(--fail-bg); border: 1px solid var(--fail-rule); }
#content .warning-message pre { color: var(--warn-fg); background: var(--warn-bg); border: 1px solid var(--warn-rule); }
#content .status-message pre  { color: var(--pass-fg); background: var(--pass-bg); border: 1px solid var(--pass-rule); }

#content .default-network     { color: var(--neon-link); }
#content .was-default-network { color: var(--warn-fg); }

#content .engine-options-popup {
    background-color: var(--glass-1);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    color: var(--dust);
    line-height: 1.5;
}

/* ---- Small screens --------------------------------------------------- */

@media (max-width: 767px) {
    #sidebar { padding-top: 64px; }

    #content-header {
        background-color: var(--glass);
        width: 100%;
        padding: 6px 0;
        margin-bottom: 0;
    }

    #content-header h2 { font-size: 1.45rem; }

    #sidebar-toggle { color: var(--core); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* Result is the last column: line its heading up with the text after the light */
#content .col-heads th:last-child { padding-left: 30px; }

/* ---- Progress charts (solstice_charts.js) ---------------------------- */

#content #history { white-space: normal; }

#content .sb-section-label {
    color: var(--neon-link);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 12px 6px;
    border-bottom: 1px solid var(--rule-strong);
    margin-bottom: 4px;
}

#content .sb-panel { margin: 10px 0 18px; }

#content .sb-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 12px 6px;
}

#content .sb-panel-title {
    color: var(--core);
    font-weight: 600;
    font-size: 0.98rem;
}

#content .sb-readout {
    color: var(--dust);
    font-family: var(--mono);
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#content .sb-panel-body { padding: 0 4px; }

#content .sb-chart {
    display: block;
    width: 100%;
    height: auto;
    touch-action: pan-y;
}

#content .sb-grid line { stroke: var(--rule); stroke-width: 1; }

#content .sb-tick {
    fill: var(--dust-2);
    font-family: var(--mono);
    font-size: 11px;
}

#content .sb-rule-label {
    font-family: var(--mono);
    font-size: 11px;
}

#content .sb-cross {
    stroke: var(--dust-2);
    stroke-width: 1;
    stroke-dasharray: 2 3;
}

#content .sb-note,
#content .sb-empty {
    color: var(--dust-2);
    font-size: 0.85rem;
    padding: 4px 12px 0;
}

#content .sb-empty { padding: 14px 12px; }

#content .sb-spsa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    border-top: 1px solid var(--rule);
    border-left: 1px solid var(--rule);
    margin: 4px 0 8px;
}

#content .sb-spsa-cell {
    padding: 9px 12px 8px;
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    min-width: 0;
}

#content .sb-spsa-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

#content .sb-spsa-name {
    color: var(--core);
    font-family: var(--mono);
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#content .sb-spsa-val {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--core);
    white-space: nowrap;
}

#content .sb-spsa-start { color: var(--dust-2); }
#content .sb-up   { color: var(--pass-fg); }
#content .sb-down { color: var(--fail-fg); }

#content .sb-spark { display: block; width: 100%; height: 56px; }

#content .sb-baseline {
    stroke: var(--rule-strong);
    stroke-width: 1;
    stroke-dasharray: 3 4;
    vector-effect: non-scaling-stroke;
}

#content .sb-spark-line {
    fill: none;
    stroke: var(--neon);
    stroke-width: 1.6;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

#content .sb-spark-gap {
    fill: none;
    stroke: var(--neon);
    stroke-width: 1;
    stroke-dasharray: 3 4;
    opacity: 0.55;
    vector-effect: non-scaling-stroke;
}

/* ---- Phones: test rows become stacked cards -------------------------- */

@media (max-width: 767px) {

    /* upstream makes every table a sideways-scrolling block on phones */
    #content table.test-list { display: block; overflow-x: visible; width: 100%; }
    #content table.test-list > tbody { display: block; }

    #content .test-list tr { display: block; }

    #content .test-list .col-heads { display: none; }

    #content .test-list .section-row th,
    #content .test-list .group-row th,
    #content .test-list .empty-row td { display: block; }

    #content .test-list .section-row th { padding: 24px 4px 8px; }
    #content .test-list tr.section-row:first-child th { padding-top: 8px; }
    #content .test-list .section-meta { display: block; margin: 2px 0 0; font-size: 0.85rem; }

    /* a card: [date] / name + notes .. TC / result / engine by author */
    #content .test-list tr:not(.section-row):not(.group-row):not(.empty-row):not(.col-heads) {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        column-gap: 10px;
        padding: 12px 4px 11px;
        border-bottom: 1px solid var(--rule);
    }

    #content .test-list tr td {
        display: block;
        border: none;
        padding: 0;
        background: transparent;
    }

    #content .test-list td.datestamp { flex: 0 0 100%; order: 0; font-size: 0.78rem; margin-bottom: 3px; }

    #content .test-list td.col-test { flex: 1 1 0; order: 1; width: auto; min-width: 0; }
    #content .col-test .test-line { white-space: normal; }
    #content .col-test .test-notes { max-width: none; font-size: 0.86rem; }

    #content .test-list td.col-tc { flex: 0 0 auto; order: 2; font-size: 12.5px; color: var(--dust); }

    #content .test-list td.statblock {
        flex: 0 0 100%;
        order: 3;
        white-space: normal;
        margin-top: 9px;
        padding: 0 0 0 18px;
        font-size: 12px;
    }

    #content .test-list td.statblock::before { left: 2px; }

    #content .test-list td.col-engine,
    #content .test-list td.col-author {
        flex: 0 0 auto;
        margin-top: 7px;
        font-size: 0.82rem;
        color: var(--dust-2);
    }

    #content .test-list td.col-engine { order: 4; }
    #content .test-list td.col-author { order: 5; }
    #content .test-list td.col-author::before { content: "by "; color: var(--dust-2); }
    #content .test-list td.col-author a { color: var(--dust); }

    /* workload page: let everything wrap inside the phone width */
    #content .workload-container,
    #content .workload-container * { white-space: normal; }
    #content .workload-container > div { min-width: 0; max-width: 100%; box-sizing: border-box; }
    #content #actions { margin: 0 0 1rem 0; width: 100%; }
    #content #actions h4 { margin: 4px 0 10px; }
    #content #actions textarea,
    #content #actions input { width: 100%; box-sizing: border-box; }
    #content .test-config td { overflow-wrap: anywhere; }
    #content .test-config .td-label { white-space: nowrap; padding-right: 14px; }
    #content .sb-spsa-cell, #content #history { white-space: normal; }

    /* progress charts: two parameter columns on a phone */
    #content .sb-spsa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #content .sb-spsa-top { flex-direction: column; gap: 1px; }
    #content .sb-panel-head { flex-direction: column; gap: 2px; align-items: flex-start; }
    #content .sb-readout { white-space: normal; }
}

@media (max-width: 767px) {
    /* The page is a column flexbox on phones; without min-width: 0 the content
       column grows to its longest unwrapped line and gets clipped at the edge. */
    #content-parent { min-width: 0; width: 100%; max-width: 100vw; box-sizing: border-box; }
    #content { width: 100%; max-width: 100% !important; min-width: 0; }
}

@media (max-width: 767px) {
    /* workload config: a real table at phone width so long values (repo URL,
       sha, adjudication) wrap instead of scrolling off the edge */
    #content table.test-config {
        display: table;
        table-layout: auto;
        width: 100%;
        overflow: visible;
    }
    #content .test-config td.td-label { width: 1%; white-space: nowrap; }
    #content .workload-container .test-config td:not(.td-label) { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
}

/* ---- Status lights: one per state, shape as well as colour ------------
   running   lit pink dot (the default above)
   pending   hollow pink ring    -- approved yet? not lit
   complete  white dot           -- finished tune / datagen
   stopped   hollow grey ring    -- ended without a result
   green / blue / yellow / red: unlit dots in the result colour (above)   */

#content .statblock.status-pending::before {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--neon);
}
#content .statblock.status-pending { color: var(--dust); }

#content .statblock.status-complete::before {
    background: var(--core);
    box-shadow: none;
}
#content .statblock.status-complete { color: var(--core); }

#content .statblock.status-stopped::before {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--dust-2);
}
#content .statblock.status-stopped { color: var(--dust-2); }

#content .statblock[title] { cursor: help; }

/* ---- Datagen runs (datagen_index.html / datagen_run.html) ------------- */

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

#content .dg-list .col-heads th:nth-child(4),
#content .dg-list .col-heads th:nth-child(5),
#content .dg-list .col-heads th:nth-child(6),
#content .dg-list td.dg-num { text-align: right; }

#content .dg-list td.statblock strong { white-space: pre; }

#content .dg-col-progress { min-width: 170px; }

#content .dg-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

#content .dg-track {
    position: relative;
    flex: 1 1 120px;
    min-width: 80px;
    height: 4px;
    background: var(--rule);
    border-radius: 2px;
    overflow: hidden;
}

#content .dg-fill {
    width: 100%;
    height: 100%;
    background: var(--core);
    border-radius: 2px;
    transform-origin: left center;
    transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

#content .dg-fill.is-live { background: var(--neon); }

#content .dg-pct {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--dust);
    min-width: 3.2em;
    text-align: right;
}

#content .dg-live {
    color: var(--dust-2);
    font-size: 0.82rem;
    margin: 14px 12px 0;
    white-space: normal;
}

/* one run */

#content .dg-run { white-space: normal; }

#content .dg-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 4px 0 2px;
}

#content .dg-back {
    color: var(--dust-2);
    font-size: 0.9rem;
    width: 100%;
}

#content .dg-back::before { content: "\2190  "; }
#content .dg-back:hover { color: var(--neon-link); }

#content .dg-title {
    margin: 0;
    color: var(--core);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

#content .dg-head .statblock {
    padding: 2px 0 2px 22px;
    font-size: 13px;
}

#content .dg-head .statblock::before { left: 4px; }

#content .dg-tag {
    margin: 0 0 18px;
    color: var(--dust-2);
    font-family: var(--mono);
    font-size: 13px;
    overflow-wrap: anywhere;
}

#content .dg-grid {
    display: grid;
    grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
    gap: 8px 36px;
    align-items: start;
}

#content .dg-grid .test-config { width: 100%; }
#content .dg-grid .test-config td { overflow-wrap: anywhere; }

#content .dg-split {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    gap: 2px;
    max-width: 240px;
}

#content .dg-seg { min-width: 2px; }
#content .dg-seg-w { background: var(--core); }
#content .dg-seg-d { background: var(--dust-2); }
#content .dg-seg-b { background: var(--rule-strong); }

#content .dg-threads {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    height: 64px;
    margin: 12px 12px 4px;
    border-bottom: 1px solid var(--rule-strong);
}

#content .dg-thread {
    flex: 1 1 0;
    min-width: 2px;
    background: var(--dust-2);
    transition: background-color 120ms ease-out;
}

#content .dg-thread:hover { background: var(--neon); }

@media (max-width: 900px) {
    #content .dg-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
    #content .dg-list td.dg-col-progress { flex: 0 0 100%; order: 3; margin-top: 8px; }
    #content .dg-list td.dg-num { flex: 0 0 auto; order: 4; margin-top: 7px; text-align: left; }
    #content .dg-list td.dg-pos::after   { content: " positions"; color: var(--dust-2); font-family: var(--sans); }
    #content .dg-list td.dg-games::after { content: " games";     color: var(--dust-2); font-family: var(--sans); }
    #content .dg-list td.statblock { order: 5; }
    #content .dg-list td.col-engine { order: 6; }
}

/* ---- Index tabs (All / SPRT / SPSA / Fixed games / Datagen) ----------- */

#content .kind-tabs {
    display: flex;
    gap: 4px 26px;
    margin: 2px 0 6px;
    padding: 0 12px;
    border-bottom: 1px solid var(--rule);
    overflow-x: auto;
    scrollbar-width: none;
}

#content .kind-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 0 9px;
    color: var(--dust);
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 120ms ease-out, border-color 120ms ease-out;
}

#content .kind-tab:hover { color: var(--core); text-decoration: none; }

#content .kind-tab[aria-current="page"] {
    color: var(--core);
    border-bottom-color: var(--neon);
}

#content .kind-running {
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1;
    padding: 3px 6px 2px;
    border-radius: var(--pill);
    color: var(--neon-hi);
    background: var(--neon-wash);
}

/* what kind of workload a row is: quiet, monochrome */
#content .kind-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 6px 0;
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dust-2);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    vertical-align: 1px;
    cursor: help;
}

#content .test-list .section-row:first-child th { padding-top: 14px; }

/* ---- Training runs (training_run.html) -------------------------------- */

#content .tr-key {
    display: inline-block;
    width: 18px;
    height: 0;
    margin: 0 2px 3px 4px;
    vertical-align: middle;
}
#content .tr-key-val   { border-top: 2px solid var(--neon); }
#content .tr-key-train { border-top: 2px dashed var(--core); }

#content .tr-epochs {
    width: 100%;
    margin: 6px 0 4px;
    font-family: var(--mono);
    font-size: 12.5px;
}

#content .tr-epochs td, #content .tr-epochs th { padding: 6px 12px 5px; text-align: right; }
#content .tr-epochs td:first-child, #content .tr-epochs th:first-child { text-align: left; }
#content .tr-epochs .table-header th {
    font-family: var(--sans);
    background: none;
    color: var(--dust-2);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    border-bottom: 1px solid var(--rule);
}
#content .tr-epochs tbody tr:nth-child(odd),
#content .tr-epochs tbody tr:nth-child(even) { background: transparent; }
#content .tr-epochs td { color: var(--core); border-bottom: 1px solid var(--rule); }
#content .tr-epochs .tr-best-row td:first-child { color: var(--neon-link); }

/* ---- Mobile menu button: thin icon in a 44px target, centred on the logo */

@media (max-width: 767px) {
    #content-header { gap: 4px; }

    #sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin: 0 2px 0 -6px;
        padding: 0;
        font-size: inherit;
        color: var(--dust);
        background: transparent;
        border: none;
        border-radius: 10px;
        cursor: pointer;
        transition: color 120ms ease-out, background-color 120ms ease-out;
    }

    #sidebar-toggle:hover,
    #sidebar-toggle[aria-expanded="true"] {
        color: var(--core);
        background: var(--glass-2);
    }

    #sidebar-toggle:focus-visible {
        outline: 2px solid var(--neon);
        outline-offset: 0;
    }
}

/* ---- Rating gauntlets (gauntlet_run.html) ----------------------------- */

#content .gt-hero {
    margin: 4px 0 26px;
}

#content .gt-hero-num {
    font-family: var(--mono);
    font-size: clamp(2.6rem, 7vw, 3.6rem);
    font-weight: 500;
    line-height: 1;
    color: var(--core);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

#content .gt-hero-err {
    font-size: 0.42em;
    color: var(--neon-link);
    letter-spacing: 0;
    margin-left: 6px;
    vertical-align: 0.55em;
}

#content .gt-hero-caption {
    margin-top: 8px;
    color: var(--dust-2);
    font-size: 0.86rem;
}

#content .gt-key {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin: 0 2px 1px 8px;
    vertical-align: middle;
}
#content .gt-key-list    { border: 1.5px solid var(--dust-2); }
#content .gt-key-implied { background: var(--core); }

#content .gt-ladder-name {
    fill: var(--core);
    font-family: var(--mono);
    font-size: 11.5px;
}

#content .gt-table .gt-name { font-family: var(--sans); font-size: 0.9rem; }
#content .gt-table .gt-implied { color: var(--neon-link); }

@media (max-width: 767px) {
    #content .gt-table { font-size: 11.5px; }
    #content .gt-table td, #content .gt-table th { padding: 6px 6px 5px; }
}

/* ---- Workload page: keep the actions panel beside the config table ---- */
/* #config and #actions are floated side by side; a long unwrapped value in
   the config table widened it until #actions dropped below. Cap the table
   and let the Progress values wrap. */
@media (min-width: 768px) {
    #content .workload-container #config { max-width: 58%; }
    #content #eta-played, #content #eta-rate, #content #eta-left, #content #eta-finish {
        white-space: normal;
    }
}

/* ---- Play page (play.html, solstice_play.js) ------------------------- */

#content .pl-wrap { white-space: normal; max-width: 1040px; }
#content .pl-head { margin: 4px 0 18px; }
#content .pl-title { margin: 0 0 4px; font-size: 1.5rem; font-weight: 600; color: var(--core); }
#content .pl-sub { margin: 0; color: var(--dust-2); font-family: var(--mono); font-size: 12.5px; }
#content .pl-about { display: flex; align-items: center; gap: 18px; margin-top: 12px; max-width: 86ch; }
#content .pl-about[hidden] { display: none; }
#content .pl-about img { width: 88px; height: 88px; flex: none; }
#content .pl-about p { margin: 0; color: var(--dust-2); font-size: 14px; line-height: 1.5; }
@media (max-width: 600px) {
    #content .pl-about { gap: 12px; align-items: flex-start; }
    #content .pl-about img { width: 56px; height: 56px; }
}
/* "How the fly works": an explainer for first-time visitors, closed by default */
#content .pl-how { margin-top: 14px; max-width: 86ch; border: 1px solid var(--rule); border-radius: var(--radius); }
#content .pl-how[hidden] { display: none; }
#content .pl-how summary {
    cursor: pointer; padding: 10px 14px; color: var(--core); font-weight: 600; font-size: 15px;
    list-style-position: inside;
}
#content .pl-how summary:hover, #content .pl-how summary:focus-visible { color: var(--neon-link); outline: none; }
#content .pl-how[open] summary { border-bottom: 1px solid var(--rule); }
#content .pl-how-body { padding: 4px 16px 12px; }
#content .pl-how h4 {
    margin: 14px 0 4px; color: var(--core); font-size: 13px; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
}
#content .pl-how p { margin: 0; color: var(--dust); font-size: 14px; line-height: 1.6; }
#content .pl-how strong { color: var(--core); font-weight: 600; }
@media (max-width: 600px) {
    #content .pl-how-body { padding: 2px 12px 10px; }
    #content .pl-how p { font-size: 14.5px; }
}

#content .pl-grid {
    display: grid;
    grid-template-columns: minmax(280px, 600px) minmax(260px, 1fr);
    gap: 24px 36px;
    align-items: start;
}

#content .pl-player {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 34px;
    color: var(--dust);
    font-size: 0.95rem;
}
#content .pl-name { font-weight: 600; color: var(--core); }
#content .pl-rating { margin-left: 8px; font-family: var(--mono); font-weight: 400; font-size: 12.5px; color: var(--dust-2); }
#content .pl-thinking { width: 8px; height: 8px; border-radius: 50%; background: transparent; }
#content .pl-thinking.is-on { background: var(--neon); box-shadow: 0 0 8px var(--neon); animation: pl-pulse 1.1s ease-in-out infinite; }
@keyframes pl-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { #content .pl-thinking.is-on { animation: none; } }

#content .pl-board-frame { position: relative; }
#content .pl-board {
    display: flex;
    flex-direction: column;
    aspect-ratio: 1;
    width: 100%;
    border: 1px solid var(--rule-strong);
    user-select: none;
    touch-action: none;
}
#content .pl-row { display: flex; flex: 1; }
#content .pl-sq {
    position: relative;
    flex: 1;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    min-width: 0;
}
#content .pl-light { background: #D6D3CE; }
#content .pl-dark  { background: #8F8A84; }
#content .pl-sq:focus-visible { outline: 2px solid var(--neon); outline-offset: -2px; z-index: 1; }
#content .pl-sq.is-last::before,
#content .pl-sq.is-sel::before { content: ""; position: absolute; inset: 0; pointer-events: none; }
#content .pl-sq.is-last::before { background: rgba(255, 61, 154, 0.26); }
#content .pl-sq.is-sel::before  { background: rgba(255, 61, 154, 0.46); }
#content .pl-sq.is-check { background-image: radial-gradient(circle, rgba(255, 61, 154, 0.95) 0%, rgba(255, 61, 154, 0.45) 45%, transparent 72%); }
#content .pl-sq.is-target::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 26%; height: 26%;
    transform: translate(-50%, -50%); border-radius: 50%; background: rgba(12, 12, 12, 0.42); pointer-events: none;
}
#content .pl-sq.is-capture::after {
    content: ""; position: absolute; inset: 4%; border-radius: 50%;
    border: 5px solid rgba(12, 12, 12, 0.42); pointer-events: none;
}
#content .pl-piece { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
#content .pl-coord {
    position: absolute; font-family: var(--mono); font-size: 11px; font-weight: 600; line-height: 1;
    pointer-events: none; z-index: 2;
}
#content .pl-rank { left: 3px; top: 3px; }
#content .pl-file { right: 3px; bottom: 3px; }
#content .pl-light .pl-coord { color: #8F8A84; }
#content .pl-dark .pl-coord  { color: #D6D3CE; }
.pl-ghost { position: fixed; pointer-events: none; z-index: 1000; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }

#content .pl-promo {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(10, 10, 10, 0.62); z-index: 5;
}
#content .pl-promo[hidden] { display: none; }
#content .pl-promo-card {
    background: var(--glass-1); border: 1px solid var(--rule-strong); border-radius: var(--radius);
    padding: 14px 16px 16px; text-align: center;
}
#content .pl-promo-label { display: block; color: var(--dust); font-size: 0.85rem; margin-bottom: 10px; }
#content .pl-promo-row { display: flex; gap: 8px; }
#content .pl-promo-btn {
    width: 64px; height: 64px; padding: 4px; border-radius: var(--radius);
    background: #D6D3CE; border: 2px solid transparent; cursor: pointer;
}
#content .pl-promo-btn:hover, #content .pl-promo-btn:focus-visible { border-color: var(--neon); outline: none; }
#content .pl-promo-btn img { width: 100%; height: 100%; }

#content .pl-side { display: flex; flex-direction: column; gap: 20px; padding-top: 34px; }
#content .pl-status {
    font-size: 1.15rem; font-weight: 600; color: var(--core);
    padding: 12px 14px; border: 1px solid var(--rule-strong); border-left: 3px solid var(--dust-2);
    border-radius: var(--radius); background: var(--glass-1);
}
#content .pl-status[data-tone="you"]  { border-left-color: var(--core); }
#content .pl-status[data-tone="busy"] { border-left-color: var(--neon); }
#content .pl-status[data-tone="win"]  { border-left-color: var(--pass-fg); color: var(--pass-fg); }
#content .pl-status[data-tone="loss"] { border-left-color: var(--fail-fg); color: var(--fail-fg); }
#content .pl-status[data-tone="draw"] { border-left-color: var(--warn-fg); color: var(--warn-fg); }

#content .pl-panel .sb-section-label { padding-left: 0; }
#content .pl-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
#content .pl-field-label { color: var(--dust); font-size: 0.92rem; }
#content .pl-seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; }
#content .pl-seg button {
    background: transparent; color: var(--dust); border: 0; border-right: 1px solid var(--rule-strong);
    padding: 6px 11px; font-family: var(--sans); font-size: 0.9rem; cursor: pointer; min-height: 32px;
}
#content .pl-seg button:last-child { border-right: 0; }
#content .pl-seg button:hover { color: var(--core); background: var(--glass-3); }
#content .pl-seg button.is-on { color: var(--glass); background: var(--core); font-weight: 600; }
#content .pl-seg button:focus-visible { outline: 2px solid var(--neon); outline-offset: -2px; }

#content .pl-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
#content .pl-btn {
    background: transparent; color: var(--core); border: 1px solid var(--rule-strong); border-radius: var(--radius);
    padding: 7px 14px; font-family: var(--sans); font-size: 0.95rem; cursor: pointer; min-height: 36px;
}
#content .pl-btn:hover { border-color: var(--dust-2); background: var(--glass-3); }
#content .pl-btn:disabled { color: var(--dust-2); cursor: default; background: transparent; border-color: var(--rule); }
#content .pl-btn-primary { background: var(--core); color: var(--glass); border-color: var(--core); font-weight: 600; }
#content .pl-btn-primary:hover { background: var(--neon-hi); border-color: var(--neon-hi); color: var(--glass); }
#content .pl-btn:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }

#content .pl-readout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 10px 0 6px; }
#content .pl-readout div { display: flex; flex-direction: column; gap: 2px; }
#content .pl-readout dt { color: var(--dust-2); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
#content .pl-readout dd { margin: 0; color: var(--core); font-family: var(--mono); font-size: 14px; }
#content #pl-eval { font-size: 18px; font-weight: 600; }
/* the fly's 3D stage (over the board) and brain view */
#content .pl-board-frame { position: relative; }
#content .fly-stage { position: absolute; inset: 0; z-index: 2; background: #0a0a0c; overflow: hidden; }
#content .fly-stage[hidden] { display: none; }
#content .fly-stage-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; }
#content .fly-stage-hint { position: absolute; right: 10px; bottom: 8px; z-index: 1; pointer-events: none;
    color: var(--dust-2); font-family: var(--mono); font-size: 11px; background: rgba(10, 10, 12, 0.7); padding: 2px 7px; }
#content .pl-board-frame.is-3d .pl-board, #content .pl-board-frame.is-3d .pl-arrows { visibility: hidden; }
#content .pl-board-frame .pl-promo { z-index: 3; }
#content .fly-brain-panel { margin-top: 18px; }
#content .fly-brain-panel[hidden] { display: none; }
#content .fly-brain-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#content .fly-replay { padding: 3px 12px; font-size: 13px; }
#content .fly-brain-stage { position: relative; height: clamp(220px, 34vw, 360px); margin-top: 8px;
    background: radial-gradient(ellipse at 50% 45%, #15111a 0%, #0a0a0c 70%); border: 1px solid var(--rule); }
#content .fly-brain-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#content .fly-brain-phase { position: absolute; left: 10px; top: 8px; z-index: 1; pointer-events: none; max-width: calc(100% - 20px);
    color: var(--core); font-size: 13px; background: rgba(10, 10, 12, 0.72); padding: 3px 8px; }
#content .fly-brain-hint { position: absolute; right: 10px; bottom: 8px; pointer-events: none; color: var(--dust-2);
    font-family: var(--mono); font-size: 11px; }
#content .fly-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 10px 0 0; padding: 0;
    color: var(--dust); font-size: 12.5px; }
#content .fly-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%;
    background: var(--c); box-shadow: 0 0 6px var(--c); vertical-align: 0; }
#content .fly-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 12px 0 0; }
#content .fly-stats div { display: flex; flex-direction: column; gap: 2px; }
#content .fly-stats .fly-stats-wide { grid-column: 1 / -1; }
#content .fly-stats dt { color: var(--dust-2); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
#content .fly-stats dd { margin: 0; color: var(--core); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
#content .fly-cands { margin-top: 12px; }
#content .fly-cands[hidden] { display: none; }
#content .fly-cands-label { color: var(--dust-2); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
#content .fly-cands ol { list-style: none; margin: 0; padding: 0; }
#content .fly-cands li { display: grid; grid-template-columns: 4.5em 1fr 3.5em; align-items: center; gap: 10px;
    padding: 2px 0; font-family: var(--mono); font-size: 12.5px; color: var(--dust); }
#content .fly-cands li.is-played { color: var(--core); }
#content .fly-cand-bar { height: 6px; background: var(--glass-2); }
#content .fly-cand-bar i { display: block; height: 100%; background: var(--dust-2); }
#content .fly-cands li.is-played .fly-cand-bar i { background: var(--neon); box-shadow: 0 0 8px var(--neon); }
#content .fly-cand-cp { text-align: right; }
#content .fly-credit { margin: 12px 0 0; color: var(--dust-2); font-size: 12px; line-height: 1.5; }
#content .pl-wdl { margin: 8px 0 2px; }
#content .pl-wdl[hidden], #content .pl-log[hidden] { display: none; }
#content .pl-wdl-bar { display: flex; height: 8px; border: 1px solid var(--rule); overflow: hidden; }
#content .pl-wdl-bar span { display: block; height: 100%; transition: width 0.25s ease-out; }
#content .pl-wdl-w { background: #ECECEC; }
#content .pl-wdl-d { background: #7A7A80; }
#content .pl-wdl-l { background: #1A1A1E; }
#content .pl-wdl-text { margin-top: 4px; color: var(--dust-2); font-family: var(--mono); font-size: 12px; }
#content .pl-log { width: 100%; margin-top: 10px; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
#content .pl-log caption { caption-side: top; text-align: left; padding-bottom: 4px; color: var(--dust-2); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
#content .pl-log th { text-align: left; font-weight: 400; color: var(--dust-2); padding: 2px 6px 4px 0; border-bottom: 1px solid var(--rule); }
#content .pl-log td { padding: 3px 6px 3px 0; color: var(--dust); white-space: nowrap; }
#content .pl-log tbody tr:first-child td { color: var(--core); }
#content .pl-log tr.is-change td:nth-child(3) { color: var(--neon-link); }
#content .pl-log th:nth-child(n+4), #content .pl-log td:nth-child(n+4) { text-align: right; padding-right: 0; padding-left: 6px; }
@media (prefers-reduced-motion: reduce) { #content .pl-wdl-bar span { transition: none; } }
#content .pl-pv { margin: 4px 0 0; color: var(--dust); font-family: var(--mono); font-size: 12.5px; line-height: 1.5; min-height: 1.5em; }

#content .pl-moves {
    position: relative; list-style: none; margin: 8px 0 0; padding: 0; max-height: 220px; overflow-y: auto;
    counter-reset: pl-move; font-family: var(--mono); font-size: 13px;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px;
}
#content .pl-moves li { counter-increment: pl-move; display: grid; grid-template-columns: 2.4em 1fr 1fr; gap: 6px; color: var(--core); }
#content .pl-moves li::before { content: counter(pl-move) "."; color: var(--dust-2); }
#content .pl-moves .is-last { color: var(--neon-link); font-weight: 600; }
#content .pl-credit { color: var(--dust-2); font-size: 0.8rem; line-height: 1.5; margin: 0; }

@media (max-width: 900px) {
    #content .pl-grid { grid-template-columns: minmax(0, 1fr); }
    #content .pl-side { padding-top: 0; }
}
@media (max-width: 767px) {
    #content .pl-coord { font-size: 9px; }
    #content .pl-moves { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Play: PGN + game review --------------------------------------------- */

#content .pl-btn-accent { border-color: var(--neon); color: var(--neon-link); }
#content .pl-btn-accent:hover { background: var(--neon-wash); border-color: var(--neon-hi); color: var(--neon-hi); }
#content .pl-note { margin: 8px 0 0; min-height: 1.3em; color: var(--dust); font-size: 0.85rem; }

/* "Review a game": paste or open a PGN, reviewed by Solstice */
#content .pl-import-hint { margin: 0 0 8px; color: var(--dust); font-size: 0.85rem; line-height: 1.45; }
#content .pl-import-text {
    display: block; width: 100%; box-sizing: border-box; min-height: 96px; resize: vertical;
    padding: 8px 10px; background-color: var(--glass-1); border: 1px solid var(--rule-strong);
    border-radius: var(--radius); color: var(--core); font-family: var(--mono); font-size: 12.5px; line-height: 1.4;
}
#content .pl-import-text:focus { border-color: var(--neon); outline: none; }
#content .pl-import-text::placeholder { color: var(--dust-2); }
#content label.pl-btn { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
#content label.pl-btn:has(+ input:focus-visible) { outline: 2px solid var(--neon); outline-offset: 2px; }
#content .pl-note.is-bad { color: var(--fail-fg); }
@media (max-width: 600px) {
    #content .pl-import-text { font-size: 14px; }  /* no zoom-on-focus on phones */
}

/* move-quality colours, shared by the table, move list, graph and arrows */
#content .c-best       { --q: var(--pass-fg); }
#content .c-excellent  { --q: #9FD9A8; }
#content .c-good       { --q: var(--dust); }
#content .c-inaccuracy { --q: var(--warn-fg); }
#content .c-mistake    { --q: #FFAE66; }
#content .c-blunder    { --q: var(--fail-fg); }

#content .pl-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
#content .pl-arrow { opacity: 0.82; }
#content .pl-arrow.is-best { fill: #3FD08C; }
#content .pl-arrow.is-played { fill: var(--q); opacity: 0.6; }

#content .pl-progress { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; color: var(--dust); font-size: 0.85rem; }
#content .pl-progress[hidden], #content #pl-review-body[hidden], #content #pl-review[hidden] { display: none; }
#content .pl-progress-track { height: 4px; background: var(--glass-3); border-radius: var(--pill); overflow: hidden; }
#content .pl-progress-fill { height: 100%; width: 0; background: var(--neon); transition: width 0.3s ease-out; }
@media (prefers-reduced-motion: reduce) { #content .pl-progress-fill { transition: none; } }

#content .pl-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 14px; }
#content .pl-acc div {
    display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
    background: var(--glass-2); border: 1px solid var(--rule); border-radius: var(--radius);
}
#content .pl-acc-label { color: var(--dust-2); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
#content .pl-acc-num { color: var(--core); font-family: var(--mono); font-size: 26px; font-weight: 600; line-height: 1.1; }
#content .pl-acc div:first-child .pl-acc-num { color: var(--neon-link); }

#content .pl-counts { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-bottom: 12px; }
#content .pl-counts th, #content .pl-counts td { padding: 3px 0; border-bottom: 1px solid var(--rule); }
#content .pl-counts thead th { color: var(--dust-2); font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
#content .pl-counts tbody th { text-align: left; font-weight: 500; color: var(--q); }
#content .pl-counts td, #content .pl-counts thead th:not(:first-child) { text-align: right; font-family: var(--mono); width: 5.5em; }
#content .pl-counts td { color: var(--core); }
#content .pl-counts tbody tr:last-child th, #content .pl-counts tbody tr:last-child td { border-bottom: 0; }
#content .pl-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--q); margin-right: 8px; vertical-align: 1px; }
#content .pl-nag { font-family: var(--mono); font-weight: 600; color: var(--q); }

#content .pl-graph { height: 72px; margin-bottom: 12px; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
#content .pl-graph svg { display: block; width: 100%; height: 100%; cursor: pointer; }
#content .pl-gbg { fill: #2C2C2C; }
#content .pl-gfill { fill: #D6D3CE; }
#content .pl-gmid { stroke: var(--dust-2); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
#content .pl-gline { fill: none; stroke: var(--neon); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
#content .pl-gcur { stroke: var(--neon-hi); stroke-width: 2; vector-effect: non-scaling-stroke; }
#content .pl-gdot { fill: var(--q); stroke: var(--glass); stroke-width: 1; vector-effect: non-scaling-stroke; }

#content .pl-review-nav { display: flex; gap: 6px; flex-wrap: wrap; }
#content .pl-review-nav .pl-btn { min-width: 40px; min-height: 36px; font-size: 1.05rem; }

#content .pl-verdict:empty { display: none; }
#content .pl-verdict {
    margin: 10px 0 0; padding: 8px 12px; min-height: 2.6em; line-height: 1.45; font-size: 0.92rem; color: var(--dust);
    border-left: 3px solid var(--q, var(--rule-strong)); background: var(--glass-2); border-radius: 0 var(--radius) var(--radius) 0;
}
#content .pl-verdict strong { color: var(--core); font-family: var(--mono); }
#content .pl-verdict-tag { color: var(--q); font-weight: 600; }

#content .pl-rmove {
    display: inline-flex; align-items: baseline; justify-self: start; gap: 1px; padding: 1px 4px; margin: 0 0 0 -4px;
    background: none; border: 0; border-radius: var(--radius); color: var(--core); font: inherit; text-align: left; cursor: pointer;
}
#content .pl-rmove.c-inaccuracy, #content .pl-rmove.c-mistake, #content .pl-rmove.c-blunder { color: var(--q); }
#content .pl-rmove:hover { background: var(--glass-3); }
#content .pl-rmove.is-cur { background: var(--neon-wash); box-shadow: inset 0 0 0 1px var(--neon); }
#content .pl-rmove:focus-visible { outline: 2px solid var(--neon); outline-offset: 1px; }

#content .pl-review-nav { margin-top: 10px; }
#content .pl-review-nav .pl-btn { flex: 1; }
#content .pl-status[data-tone="view"] { border-left-color: var(--run-fg); color: var(--dust); }
#content .pl-meval { margin-left: 6px; color: var(--dust-2); font-size: 11px; font-weight: 400; }

/* evaluation bar: White's share of the expected score, White's end nearest White's pieces */
#content .pl-board-row { display: flex; gap: 8px; align-items: stretch; }
#content .pl-board-row .pl-board-frame { flex: 1; min-width: 0; }
#content .pl-evalbar {
    position: relative; flex: 0 0 28px; overflow: hidden; border-radius: var(--radius);
    background: #2C2C2C; border: 1px solid var(--rule);
    display: flex; flex-direction: column-reverse;
}
#content .pl-evalbar.is-flipped { flex-direction: column; }
#content .pl-evalbar-fill { background: #D6D3CE; height: 50%; transition: height 0.35s ease-out; }
#content .pl-evalbar.is-empty .pl-evalbar-fill { background: #5A5A5A; }
#content .pl-evalbar-text {
    position: absolute; left: 0; right: 0; text-align: center; font-family: var(--mono);
    font-size: 10px; font-weight: 600; letter-spacing: -0.03em; color: #D6D3CE; top: 4px;
}
#content .pl-evalbar-text.is-white { color: #1A1A1A; top: auto; bottom: 4px; }
#content .pl-evalbar.is-flipped .pl-evalbar-text { top: auto; bottom: 4px; }
#content .pl-evalbar.is-flipped .pl-evalbar-text.is-white { bottom: auto; top: 4px; }
@media (prefers-reduced-motion: reduce) { #content .pl-evalbar-fill { transition: none; } }
@media (max-width: 767px) { #content .pl-evalbar { flex-basis: 22px; } #content .pl-evalbar-text { font-size: 8.5px; } }
#content .pl-board-col > .pl-player, #content .pl-board-col > .pl-verdict { margin-left: 36px; }
@media (max-width: 767px) { #content .pl-board-col > .pl-player, #content .pl-board-col > .pl-verdict { margin-left: 30px; } }
