body {
    font-family: Arial, sans-serif;
    margin: 24px;
    background: #ffffff;
    color: #111111;
}


/* ------------------------------
   Header panel
------------------------------ */

.tracer-header,
.settings-panel {
    max-width: 1500px;
    padding: 22px 24px;
    background: #f8f9fa;
    border: 1px solid #dedede;
    border-radius: 12px;
}

.settings-panel {
    margin-top: 28px;
}

.settings-panel > h2 {
    margin: 0 0 10px;
    font-size: 1.35rem;
}

.settings-panel > p {
    color: #666;
    margin: 0 0 18px;
}

.settings-panel .color-scheme-section,
.settings-panel .orientation-section {
    margin: 20px 0 0;
    padding-top: 18px;
    border-top: 1px solid #e1e1e1;
}

.settings-panel h3 {
    margin: 0 0 14px;
    font-size: 1rem;
}

.settings-panel .reset-buttons,
.settings-panel .color-selectors {
    flex-wrap: wrap;
}

.settings-panel .orientation-section button {
    margin-bottom: 6px;
}

.cube-net-panel {
    overflow-x: auto;
}

.cube-net-panel .cube-net {
    margin-top: 0;
}

.tracer-header h1 {
    margin: 0 0 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e1e1e1;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.wca-sign-in {
    display: inline-block;
    margin-bottom: 16px;
    padding: 9px 14px;
    border: 1px solid #bfc4ca;
    border-radius: 6px;
    background: #fff;
    color: #111;
    text-decoration: none;
    font-weight: bold;
}

.wca-sign-in:hover {
    background: #edf0f3;
}

.wca-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wca-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.wca-user-info {
    display: flex;
    flex-direction: column;
}

.wca-user-info span {
    font-size: 0.8rem;
    color: #666;
}

.wca-logout {
    font-size: 0.75rem;
    color: #666;
    text-decoration: none;
}

.wca-logout:hover {
    text-decoration: underline;
}

.wca-user-links {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
}

.wca-user-links a {
    color: #666;
    text-decoration: none;
}

.wca-user-links a:hover {
    text-decoration: underline;
}

/* ------------------------------
   3BLD History
------------------------------ */

.history-results {
    margin-top: 24px;
    overflow-x: auto;
}

.history-table {
    width: 100%;
    min-width: 960px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 14px;
}

.history-competition-column {
    width: 20%;
}

.history-date-column {
    width: 120px;
}

.history-number-column {
    width: 76px;
}

.history-result-column {
    width: 84px;
}

.history-table th {
    padding: 0 12px 4px;
    text-align: center;
    vertical-align: middle;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

/* Each row encloses one attempt, including every scramble group. */
.history-attempt td {
    padding: 18px 12px;
    border-top: 1px solid #dedede;
    border-bottom: 1px solid #dedede;
    background: #f8f9fa;
    text-align: center;
    vertical-align: middle;
}

.history-attempt td:first-child {
    border-left: 1px solid #dedede;
    border-radius: 12px 0 0 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.history-attempt td:last-child {
    border-right: 1px solid #dedede;
    border-radius: 0 12px 12px 0;
    text-align: left;
}

.history-attempt td:nth-child(2),
.history-attempt td:nth-child(5) {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Container for all group scrambles */

.scramble-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* Individual group scramble */

.history-scramble {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
}


/* Group A / Group B label */

.scramble-group {
    font-family: Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;

    white-space: nowrap;
}


/* Scramble text */

.scramble-text {
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.4;

    white-space: normal;
}


/* Trace form */

.trace-form {
    margin: 0;
}


/* Trace button */

.history-trace-button {
    padding: 6px 12px;

    border: 1px solid #aaa;
    border-radius: 6px;

    background: white;

    cursor: pointer;
    white-space: nowrap;
}

.history-trace-button:hover {
    background: #eee;
}


/* Missing scramble */

.no-scramble {
    color: #888;
    font-style: italic;
}



.tracer-header .scramble-section {
    flex-wrap: wrap;
    gap: 10px;
}

.tracer-header .scramble-entry {
    display: flex;
    flex: 1 1 500px;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.tracer-header .scramble-input {
    flex: 1 1 280px;
    min-width: 0;
    width: auto;
}

.tracer-header .buffer-section {
    flex-wrap: wrap;
    margin: 20px 0;
}

.tracer-header button,
.settings-panel button,
.tracer-header select,
.tracer-header .scramble-input {
    border: 1px solid #bfc4ca;
    border-radius: 6px;
    background: #fff;
}

.tracer-header button:hover,
.settings-panel button:hover {
    background: #edf0f3;
}

.tracer-header .pseudo-swap-settings {
    padding-top: 16px;
    border-top: 1px solid #e1e1e1;
}

/* ------------------------------
   Scramble
------------------------------ */

.scramble-section {
    display: flex;
    align-items: center;
    gap: 6px;
}

.scramble-input {
    width: 500px;
    padding: 7px;
    font-size: 15px;
}

button {
    padding: 8px 14px;
    cursor: pointer;
}

.error {
    color: red;
}


/* ------------------------------
   Cube net
------------------------------ */

.cube-net {
    display: grid;

    grid-template-columns:
        repeat(4, 180px);

    grid-template-rows:
        repeat(3, 180px);

    gap: 6px;

    margin-top: 30px;
}


/* Face locations */

.face-u {
    grid-column: 2;
    grid-row: 1;
}

.face-l {
    grid-column: 1;
    grid-row: 2;
}

.face-f {
    grid-column: 2;
    grid-row: 2;
}

.face-r {
    grid-column: 3;
    grid-row: 2;
}

.face-b {
    grid-column: 4;
    grid-row: 2;
}

.face-d {
    grid-column: 2;
    grid-row: 3;
}


/* ------------------------------
   Individual faces
------------------------------ */

.face {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    grid-template-rows:
        repeat(3, 1fr);

    gap: 2px;

    width: 180px;
    height: 180px;

    background: #111;
    padding: 2px;

    box-sizing: border-box;
}


/* ------------------------------
   Stickers
------------------------------ */

.sticker {
    width: 100%;
    height: 100%;

    box-sizing: border-box;

    border: none;

    text-align: center;

    font-size: 20px;
    font-weight: bold;

    min-width: 0;
}

input.sticker {
    cursor: text;
}

input.sticker:focus {
    outline: 3px solid #222;
    z-index: 1;
}

.center {
    display: flex;
    justify-content: center;
    align-items: center;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 28px;
    font-weight: bold;
    font-style: italic;
}


/* ------------------------------
   Default face colors
------------------------------ */

.u-color {
    background: white;
    color: black;
}

.l-color {
    background: #ff8c00;
    color: black;
}

.f-color {
    background: #20a84a;
    color: black;
}

.r-color {
    background: #e53935;
    color: black;
}

.b-color {
    background: #2468d8;
    color: white;
}

.d-color {
    background: #ffd92f;
    color: black;
}

/* ------------------------------
   Customizable color scheme
------------------------------ */

.color-scheme-section {
    margin-top: 25px;
    margin-bottom: 20px;
}

.color-selectors {
    display: flex;
    gap: 18px;
    align-items: center;
}

.color-selectors label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
}

.color-selectors input[type="color"] {
    width: 38px;
    height: 32px;
    padding: 0;
    border: 1px solid #aaa;
    cursor: pointer;
}

/* ------------------------------
   Reset buttons
------------------------------ */

.reset-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* ------------------------------
   Memo results
------------------------------ */

hr {
    margin-top: 35px;
    margin-bottom: 25px;
    border: none;
    border-top: 1px solid #ccc;
}

.memo-section {
    display: flex;
    flex-direction: column;
    gap: 18px;

    max-width: 750px;
}

.memo-card {
    border: 1px solid #ccc;
    border-radius: 10px;

    padding: 18px 22px;

    background: #f8f8f8;
}

.memo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;
}

.memo-header h2 {
    margin: 0;
}

.target-count {
    font-size: 14px;
    color: #666;
}

.memo-content {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;

    margin-top: 15px;
}

.memo {
    margin: 0;

    font-family: "Courier New", monospace;
    font-size: 26px;
    font-weight: bold;

    letter-spacing: 2px;
    line-height: 1.5;

    overflow-wrap: anywhere;
}

.copy-button {
    flex-shrink: 0;

    padding: 7px 14px;

    border: 1px solid #aaa;
    border-radius: 6px;

    background: white;

    cursor: pointer;
}

.copy-button:hover {
    background: #eee;
}


/* ------------------------------
   Trace details
------------------------------ */

.trace-details {
    margin-top: 20px;

    border: 1px solid #ccc;
    border-radius: 8px;

    padding: 14px 18px;

    background: #fafafa;
}

.trace-details summary {
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.trace-content {
    margin-top: 18px;
}

.trace-group {
    margin-bottom: 18px;
}

.trace-group:last-child {
    margin-bottom: 0;
}

.trace-group h3 {
    margin-bottom: 7px;
}

.trace {
    margin: 0;

    font-family: "Courier New", monospace;
    font-size: 17px;

    line-height: 1.6;
    word-spacing: 6px;
}

/* ------------------------------
   Buffer section
------------------------------ */

.buffer-section {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 15px;
    margin-bottom: 25px;
}

.buffer-section select {
    padding: 6px 10px;
    font-size: 15px;

    margin-right: 15px;
}

/* ------------------------------
   Floating section
------------------------------ */

.floating-settings-panel {
    margin-top: 28px;
    padding: 22px 24px;

    background: #f8f9fa;
    border: 1px solid #dedede;
    border-radius: 12px;

    max-width: 1500px;
}

.floating-settings-header {
    margin-bottom: 22px;
}

.floating-settings-header h2 {
    margin: 0 0 5px 0;
    font-size: 1.35rem;
}

.floating-settings-header p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}


/* Edge / corner sections */

.floating-buffer-section {
    padding: 18px 0;
    border-top: 1px solid #e1e1e1;
}

.floating-buffer-section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.floating-buffer-section:last-child {
    padding-bottom: 0;
}

.floating-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;

    margin-bottom: 12px;
}

.floating-selection-actions {
    display: flex;
    gap: 6px;
}

.floating-selection-actions button {
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #bfc4ca;
    border-radius: 6px;
}

.floating-selection-actions button:hover {
    background: #edf0f3;
}

.floating-section-header h3 {
    margin: 0;
    font-size: 1rem;
}

.floating-hint {
    color: #777;
    font-size: 0.82rem;
}


/* Buffer list */

.floating-buffer-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}


/* Individual draggable buffer */

.floating-buffer-item {
    display: flex;
    align-items: center;
    gap: 7px;

    padding: 8px 11px;

    background: white;
    border: 1px solid #d3d3d3;
    border-radius: 7px;

    cursor: grab;
    user-select: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.floating-buffer-item:hover {
    border-color: #aaa;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.floating-buffer-item:active {
    cursor: grabbing;
}

.floating-buffer-item.dragging {
    opacity: 0.4;
    transform: scale(0.97);
}

.drag-handle {
    color: #999;
    font-size: 0.9rem;
}

/* ------------------------------
   Solve info
------------------------------ */

.solve-info {
    margin-top: 25px;
    padding-top: 15px;

    border-top: 1px solid #ddd;
}

.solve-info h3 {
    margin-top: 0;
}

.solve-info-grid {
    display: grid;
    grid-template-columns: 180px 1fr;

    gap: 8px 20px;

    font-size: 15px;
}

.solve-info-grid strong {
    font-family: "Courier New", monospace;
}

/* ------------------------------
   Mobile
------------------------------ */

@media (max-width: 800px) {

    body {
        margin: 12px;
    }

    .scramble-section {
        flex-wrap: wrap;
    }

    .scramble-input {
        width: 100%;
        box-sizing: border-box;
    }

    .cube-net {
        grid-template-columns:
            repeat(4, 90px);

        grid-template-rows:
            repeat(3, 90px);

        gap: 3px;

        overflow-x: auto;
    }

    .face {
        width: 90px;
        height: 90px;
    }

    .sticker {
        font-size: 14px;
    }

    .center {
        font-size: 14px;
    }
}

/* Bulk scramble input and analysis */
.bulk-input {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #dedede;
}

.bulk-input summary {
    font-weight: 600;
    cursor: pointer;
}

.bulk-input textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin: 8px 0 12px;
    padding: 12px;
    border: 1px solid #bfc4ca;
    border-radius: 6px;
    font: 0.95rem/1.6 monospace;
    resize: vertical;
}

.bulk-results {
    max-width: 1500px;
    margin-top: 28px;
    padding: 22px 24px;
    border: 1px solid #dedede;
    border-radius: 12px;
    background: #f8f9fa;
}

.bulk-results h2 { margin-top: 0; }
.bulk-definition { color: #666; font-size: 0.85rem; line-height: 1.6; }
.bulk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.bulk-stats > div { padding: 16px; background: #fff; border: 1px solid #dedede; border-radius: 8px; }
.bulk-stats strong { display: block; font-size: 1.7rem; margin-bottom: 6px; }
.bulk-stats span { color: #666; font-size: 0.9rem; }
.bulk-table-scroll { overflow-x: auto; }
.bulk-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.bulk-table th, .bulk-table td { padding: 14px 12px; border-bottom: 1px solid #dedede; text-align: center; }
.bulk-table th:first-child, .bulk-table td:first-child { text-align: left; min-width: 240px; }
.bulk-table .bulk-memo { min-width: 140px; font-family: monospace; overflow-wrap: anywhere; }

.bulk-buffer-usage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 24px;
}

.bulk-buffer-usage .bulk-table th:first-child {
    min-width: 0;
}

.sandwich-highlight {
    background: #fff0be;
    color: #694400;
    border-radius: 4px;
    padding: 2px 4px;
}
.memo-setting { display: block; margin-top: 16px; font-weight: 600; }

.bulk-query-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin-top: 24px; }
.bulk-query-controls label { display: flex; flex-direction: column; gap: 8px; }
.bulk-query-controls input, .bulk-query-controls select { padding: 10px; font: inherit; }

.bulk-wca-details { margin-top: 10px; font-size: 0.85rem; }
.bulk-wca-details summary { cursor: pointer; }
.bulk-wca-details ul { padding-left: 20px; }
.bulk-wca-details li { margin: 8px 0; }
.bulk-wca-details p { color: #666; max-width: 360px; }

.mbld-attempts { display: grid; gap: 24px; margin-top: 24px; }
.mbld-attempt { border: 1px solid #dedede; border-radius: 12px; overflow: hidden; background: #fff; }
.mbld-attempt-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; background: #f7f8fa; }
.mbld-attempt-header h2 { margin: 0 0 8px; font-size: 1.15rem; }
.mbld-attempt-header p { margin: 0; color: #666; font-size: .9rem; }
.mbld-attempt-header button { flex-shrink: 0; }
.mbld-cubes { width: 100%; border-collapse: collapse; table-layout: auto; }
.mbld-cubes th, .mbld-cubes td { padding: 12px 16px; border-top: 1px solid #e5e7eb; text-align: left; vertical-align: top; }
.mbld-cubes th:first-child { width: 48px; }
.mbld-cubes td:last-child { width: 76px; }
.mbld-cubes .scramble-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.7; }
.mbld-cubes form { margin: 0; padding: 0; }
.mbld-cubes button { margin: 0; }
@media (max-width: 600px) {
    .mbld-attempt-header { align-items: flex-start; flex-direction: column; }
    .mbld-cubes th, .mbld-cubes td { padding: 10px 8px; }
}

.parity-settings { margin: 24px 0; padding: 16px; border: 1px solid #ddd; border-radius: 8px; }
.parity-settings summary { cursor: pointer; padding: 10px 0; font-weight: 600; }
.parity-case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.parity-case-grid fieldset { min-width: 0; border: 1px solid #ddd; border-radius: 6px; }
.parity-case-grid label { display: inline-flex; flex-direction: column; gap: 6px; margin: 6px; }

[data-cycle-break-order] { display: flex; flex-wrap: nowrap; gap: 8px; list-style: none; padding: 2px 2px 10px; max-width: 100%; overflow-x: auto; }
[data-cycle-break-order] li { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; padding: 8px; border: 1px solid #ddd; border-radius: 9px; background: white; cursor: grab; }
[data-cycle-break-order] li.dragging { opacity: .4; }
[data-cycle-break-order] strong { min-width: 0; }
[data-cycle-break-order] button { margin: 0; padding: 2px 6px; min-height: 30px; }
.cycle-break-groups, .cycle-break-groups > div { min-width: 0; }
.cycle-drag-handle { color: #999; }
.cycle-break-groups > div + div { border-top: 1px solid #ddd; margin-top: 20px; }

[data-cycle-break-order][hidden] { display: none; }

/* Official history: competition archive */
body.history-page { margin: 0; background: #f4f6f8; color: #243342; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.history-page * { box-sizing: border-box; }
.history-page .history-results { max-width: 1540px; margin: 0 auto; padding: 36px 40px 72px; overflow: visible; }
.history-back { display: inline-flex; gap: 9px; align-items: center; color: #526474; font-size: 13px; font-weight: 600; text-decoration: none; padding: 6px 0; }
.history-back:hover { color: #087e79; }
.history-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 30px 0; }
.history-eyebrow { font-size: 11px; font-weight: 750; letter-spacing: .16em; color: #087e79; margin: 0 0 12px; }
.history-hero h1 { font-size: clamp(28px, 3vw, 42px); letter-spacing: -.045em; line-height: 1.15; margin: 0; font-weight: 750; color: #192b3b; }
.history-title-dot { color: #0d9488; }
.history-subtitle { color: #687785; font-size: 14px; line-height: 1.6; margin: 12px 0 0; }
.history-profile { border: 1px solid #dbe4e8; border-radius: 30px; padding: 9px 14px; color: #526474; font-size: 12px; font-weight: 650; white-space: nowrap; background: #fff; }
.history-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; background: #fff; border: 1px solid #e0e6eb; border-radius: 14px; padding: 20px 24px; box-shadow: 0 2px 4px #23354803; }
.history-event-form { display: flex; align-items: flex-end; gap: 12px; margin: 0; }
.history-event-form label { display: grid; gap: 8px; color: #586877; font-size: 12px; font-weight: 650; }
.history-event-form select { width: 285px; max-width: 100%; padding: 11px 36px 11px 12px; border: 1px solid #d6dfe5; border-radius: 8px; background: #fbfcfd; font: inherit; font-size: 14px; color: #243342; min-height: 42px; }
.history-page button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; font: inherit; font-size: 12px; font-weight: 650; padding: 10px 14px; min-height: 40px; margin: 0; border: 1px solid #d6e0e6; border-radius: 8px; background: #fff; color: #3d5263; white-space: nowrap; transition: background .15s, border-color .15s; }
.history-page button:hover { background: #eff7f6; border-color: #9bcac5; color: #076e68; }
.history-page button.history-primary { background: #087e79; border-color: #087e79; color: #fff; }
.history-page button.history-primary:hover { background: #066964; }
.history-page :is(button, a, select):focus-visible { outline: 3px solid #41b8ac; outline-offset: 3px; }
.history-list-heading { display: flex; justify-content: space-between; align-items: center; margin: 32px 0 16px; }
.history-list-heading h2 { display: flex; align-items: center; gap: 9px; font-size: 14px; margin: 0; }
.history-list-heading h2 span { background: #e4ebef; border-radius: 6px; padding: 3px 7px; font-size: 11px; color: #526474; }
.history-list-heading > span { font-size: 12px; color: #687785; }
.history-competitions { display: grid; gap: 24px; }
.competition-card { background: #fff; border: 1px solid #dce4e9; border-radius: 16px; overflow: hidden; box-shadow: 0 3px 12px #23354804; }
.competition-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid #e5ebef; background: linear-gradient(110deg, #f6faf9, #fff 65%); }
.competition-identity { display: flex; align-items: center; gap: 16px; min-width: 0; }
.competition-date { display: grid; text-align: center; gap: 2px; flex: 0 0 52px; padding: 8px 5px; background: #e8f3f0; border: 1px solid #d5e9e3; border-radius: 10px; color: #18786d; }
.competition-date span { font-size: 9px; letter-spacing: .12em; font-weight: 750; }
.competition-date strong { font-size: 22px; line-height: 1.1; }
.competition-header h2 { margin: 0 0 7px; font-size: 18px; letter-spacing: -.02em; line-height: 1.3; overflow-wrap: anywhere; }
.competition-header p { margin: 0; font-size: 12px; color: #6a7985; }
.competition-header p > span { padding: 0 6px; }
.competition-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.competition-table thead { background: #fbfcfd; }
.competition-table th { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #73818d; font-weight: 650; padding: 13px 16px; text-align: left; }
.competition-table th:nth-child(1) { width: 112px; padding-left: 24px; }
.competition-table th:nth-child(2) { width: 84px; }
.competition-table th:nth-child(3) { width: 98px; }
.history-page .history-attempt td { background: #fff; text-align: left; border: 0; border-top: 1px solid #edf0f3; border-radius: 0; padding: 18px 16px; vertical-align: middle; font-size: 13px; }
.history-page .history-attempt td:first-child { padding-left: 24px; font-weight: 500; }
.history-page .history-attempt td:last-child { padding-right: 24px; }
.history-page .history-attempt:hover td { background: #fcfdfd; }
.round-badge { font-size: 11px; color: #5b6a78; }
.attempt-number { color: #7c8994; font-variant-numeric: tabular-nums; }
.result-badge { display: inline-flex; align-items: baseline; gap: 3px; padding: 6px 9px; border-radius: 6px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-badge small { font-size: 10px; font-weight: 500; }
.result-success { color: #117362; background: #eaf6ef; }
.result-unfinished { color: #97663c; background: #fbf1e6; }
.history-page .scramble-options { gap: 10px; }
.history-page .history-scramble { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 14px; }
.history-page .scramble-group { font-family: inherit; font-size: 10px; font-weight: 650; color: #6d7e8b; }
.history-page .scramble-text { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; line-height: 1.8; color: #405364; overflow-wrap: anywhere; }
.history-page .trace-form { padding: 0; margin: 0; }
.history-page .history-trace-button { min-height: 32px; padding: 6px 10px; font-size: 11px; gap: 8px; }
.history-notice { border-left: 3px solid #82b8af; padding: 4px 0 4px 15px; font-size: 13px; line-height: 1.7; color: #657481; margin: 24px 0; max-width: 1000px; }
.history-empty { background: #fff; padding: 40px 24px; border: 1px dashed #ccd9e1; border-radius: 14px; margin-top: 24px; color: #657481; text-align: center; line-height: 1.6; }
.history-empty h2 { font-size: 18px; color: #243342; }
.history-page .mbld-attempts { margin: 0; gap: 0; }
.history-page .mbld-attempt { border: 0; border-radius: 0; }
.history-page .mbld-attempt + .mbld-attempt { border-top: 1px solid #dce4e9; }
.history-page .mbld-attempt-header { padding: 18px 24px; background: #fbfcfd; }
.history-page .mbld-attempt-header h3 { font-size: 14px; margin: 0 0 7px; }
.history-page .mbld-attempt-header p { font-size: 12px; line-height: 1.6; }
.history-page .mbld-cubes th { font-size: 11px; color: #687785; }
.history-page .mbld-cubes th, .history-page .mbld-cubes td { padding: 12px 24px; }
@media (max-width: 850px) {
    .history-page .history-results { padding: 24px 20px 48px; }
    .history-hero { align-items: flex-start; }
    .history-profile { display: none; }
    .history-toolbar { flex-wrap: wrap; padding: 18px; }
    .competition-table th:nth-child(1) { width: 94px; }
    .competition-table th:nth-child(2) { width: 72px; }
    .competition-table th:nth-child(3) { width: 84px; }
    .history-page .history-scramble { gap: 8px; grid-template-columns: minmax(0, 1fr) auto; }
    .history-page .history-scramble .scramble-group { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .history-page .history-results { padding: 20px 14px 40px; }
    .history-hero { margin: 24px 0; }
    .history-event-form { flex-wrap: wrap; width: 100%; }
    .history-event-form label, .history-event-form select { width: 100%; }
    .history-toolbar { gap: 12px; }
    .competition-header { padding: 18px 16px; align-items: flex-start; flex-direction: column; gap: 14px; }
    .competition-header h2 { font-size: 16px; }
    .competition-header .import-competition { align-self: flex-end; }
    .competition-table, .competition-table tbody { display: block; }
    .competition-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .history-page .history-attempt { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #e5ebef; padding: 16px; gap: 12px; }
    .history-page .history-attempt td, .history-page .history-attempt td:first-child, .history-page .history-attempt td:last-child { display: block; border: 0; padding: 0; }
    .history-page .history-attempt td[data-label]::before { content: attr(data-label); display: block; font-size: 10px; color: #73818d; margin-bottom: 8px; font-weight: 500; }
    .history-page .history-attempt .history-scrambles { grid-column: 1 / -1; padding-top: 12px; border-top: 1px dashed #e5ebef; }
    .history-page .mbld-attempt-header { padding: 16px; }
    .history-page .mbld-cubes th, .history-page .mbld-cubes td { padding: 10px 8px; }
}

.history-search { display: grid; gap: 8px; margin: 0 0 20px; }
.history-search label { color: #586877; font-size: 12px; font-weight: 650; }
.history-search input { width: 100%; min-height: 44px; padding: 12px 16px; border: 1px solid #d6dfe5; border-radius: 10px; background: #fff; color: #243342; font: inherit; font-size: 14px; }
.history-search input:focus-visible { outline: 3px solid #41b8ac; outline-offset: 3px; }
.competition-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.history-page .competition-toggle { min-width: 104px; }
.competition-chevron { font-size: 16px; line-height: 1; }
.competition-toggle[aria-expanded="false"] .competition-chevron { transform: rotate(180deg); }
.competition-card.is-collapsed .competition-header { border-bottom: 0; }
.history-page [hidden] { display: none !important; }
@media (max-width: 600px) {
    .competition-actions { align-self: flex-end; flex-wrap: wrap; justify-content: flex-end; }
}

.history-filters { display: grid; grid-template-columns: minmax(0, 1fr) 150px 180px; align-items: end; gap: 14px; margin-bottom: 20px; }
.history-filters .history-search { margin: 0; }
.history-filter { display: grid; gap: 8px; }
.history-filter label { color: #586877; font-size: 12px; font-weight: 650; }
.history-filter select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d6dfe5; border-radius: 10px; background: #fff; color: #243342; font: inherit; font-size: 14px; }
@media (max-width: 600px) {
    .history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .history-filters .history-search { grid-column: 1 / -1; }
}

.history-page .history-event-form { flex-wrap: wrap; flex: 1; }
.history-page .history-toolbar { flex-wrap: wrap; }
.history-event-form #history-view { width: 195px; }
.history-event-form input { width: 155px; max-width: 100%; min-height: 42px; border: 1px solid #d6dfe5; border-radius: 8px; padding: 11px 12px; background: #fbfcfd; color: #243342; font: inherit; font-size: 14px; text-transform: uppercase; }
.history-event-form input:focus-visible { outline: 3px solid #41b8ac; outline-offset: 3px; }
@media (max-width: 600px) {
    .history-event-form #history-view, .history-event-form input { width: 100%; }
}

/* Tracer home */
body.tracer-page { margin: 0; padding: 36px 40px 64px; background: #f4f6f8; color: #243342; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.tracer-page #memo-form { max-width: 1460px; margin: 0 auto; }
.tracer-page .tracer-header { max-width: none; padding: 0; background: none; border: 0; border-radius: 0; }
.tracer-masthead { display: flex; justify-content: space-between; align-items: center; gap: 30px; margin: 12px 0 32px; }
.tracer-intro { max-width: 820px; }
.tracer-page .tracer-eyebrow { margin: 0 0 12px; font-size: 11px; letter-spacing: .15em; font-weight: 750; color: #087e79; }
.tracer-page .tracer-intro h1 { border: 0; padding: 0; margin: 0 0 12px; font-size: clamp(26px, 2.5vw, 38px); line-height: 1.18; letter-spacing: -.04em; color: #192b3b; }
.tracer-intro h1 span { color: #0d9488; }
.tracer-intro > p:last-child { color: #687785; font-size: 14px; line-height: 1.6; margin: 0; }
.tracer-account { padding: 16px 18px; border: 1px solid #dce4e9; border-radius: 12px; background: #fff; flex-shrink: 0; max-width: 100%; box-sizing: border-box; }
.tracer-page .wca-user { margin: 0; gap: 12px; }
.tracer-page .wca-avatar { width: 42px; height: 42px; }
.tracer-page .wca-user-info strong { font-size: 14px; }
.tracer-page .wca-user-info > span { font-size: 11px; color: #73818d; margin-top: 3px; }
.tracer-page .wca-user-links { gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.tracer-page .wca-user-links a { font-size: 11px; color: #087e79; font-weight: 600; text-decoration: none; }
.tracer-page .wca-user-links a:last-child { color: #73818d; }
.tracer-page .wca-user-links a:hover { text-decoration: underline; }
.tracer-page .wca-sign-in { font-size: 12px; display: block; margin: 0; padding: 8px 0; background: none; border: 0; color: #087e79; }
.tracer-workspace, .tracer-configuration, .tracer-advanced { background: #fff; border: 1px solid #dce4e9; border-radius: 16px; padding: 24px; margin-bottom: 20px; box-shadow: 0 3px 12px #23354804; }
.tracer-section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.tracer-step { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: #e8f3f0; color: #18786d; font-size: 11px; font-weight: 700; }
.tracer-section-heading h2 { font-size: 17px; letter-spacing: -.02em; margin: 0 0 5px; }
.tracer-section-heading p { font-size: 12px; color: #687785; margin: 0; line-height: 1.5; }
.tracer-page button, .tracer-page select { font-family: inherit; font-size: 13px; }
.tracer-page :is(.tracer-header, .settings-panel, .floating-settings-panel) button { min-height: 36px; padding: 9px 13px; border: 1px solid #d6e0e6; border-radius: 8px; color: #3d5263; background: #fff; font-weight: 600; cursor: pointer; }
.tracer-page :is(.tracer-header, .settings-panel, .floating-settings-panel) button:hover { background: #eff7f6; border-color: #9bcac5; color: #076e68; }
.tracer-page :is(button, select, input, textarea, summary, a):focus-visible { outline: 3px solid #41b8ac; outline-offset: 3px; }
.tracer-page input[type="checkbox"] { accent-color: #087e79; width: 16px; height: 16px; vertical-align: middle; }
.tracer-page .tracer-header button.tracer-primary { background: #087e79; border-color: #087e79; color: #fff; padding: 13px 22px; }
.tracer-page .tracer-header button.tracer-primary:hover { background: #066964; }
.tracer-page .scramble-section { align-items: flex-end; gap: 12px; position: relative; padding-top: 25px; }
.tracer-page .scramble-section > label { position: absolute; top: 0; left: 0; font-size: 12px; color: #586877; }
.tracer-page .scramble-entry { flex-basis: 500px; }
.tracer-page .scramble-input { padding: 13px 14px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; background: #fbfcfd; border-color: #d6dfe5; border-radius: 8px; }
.tracer-page .bulk-input { border-top: 1px solid #e7ecef; margin: 20px 0 0; padding-top: 16px; }
.tracer-page .bulk-input > summary { font-size: 13px; color: #526474; cursor: pointer; }
.tracer-page .bulk-input p { font-size: 12px; line-height: 1.7; color: #687785; }
.tracer-page .buffer-section { margin: 0 0 20px; gap: 12px; background: #f7f9fa; padding: 16px; border: 1px solid #e7ecef; border-radius: 10px; }
.tracer-page .buffer-section label { font-size: 12px; color: #526474; }
.tracer-page .buffer-section select { padding: 8px 12px; border-color: #d6dfe5; margin-right: 12px; }
.technique-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.technique-card { min-width: 0; border: 1px solid #e1e7eb; border-radius: 10px; padding: 16px; background: #fff; }
.technique-card:has(input:checked) { border-color: #9bcac5; background: #f4faf8; }
.tracer-page .technique-card .memo-setting { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; margin: 0; font-weight: 600; cursor: pointer; }
.technique-card input { flex-shrink: 0; margin: 2px 0 0; }
.technique-help { margin: 12px 0 0 24px; }
.technique-help summary { font-size: 11px; color: #687785; cursor: pointer; }
.tracer-page .technique-help .bulk-definition { margin: 10px 0 0; font-size: 12px; line-height: 1.7; color: #687785; }
.tracer-page .tracer-advanced .parity-settings { margin: 10px 0; padding: 16px; border: 1px solid #e1e7eb; border-radius: 10px; background: #fbfcfd; }
.tracer-page .tracer-advanced .parity-settings > summary { font-size: 13px; color: #405364; cursor: pointer; }
.tracer-page .tracer-advanced .parity-settings > p { font-size: 12px; color: #687785; line-height: 1.7; }
.tracer-page .pseudo-swap-settings { margin-top: 18px; font-size: 13px; }
.tracer-page .settings-panel, .tracer-page .floating-settings-panel { max-width: none; box-sizing: border-box; padding: 24px; margin-top: 20px; background: #fff; border: 1px solid #dce4e9; border-radius: 16px; }
.tracer-page .floating-settings-header h2, .tracer-page .settings-panel > h2 { font-size: 18px; color: #243342; }
.tracer-page .floating-settings-header p, .tracer-page .settings-panel > p { font-size: 13px; line-height: 1.7; color: #687785; }
@media (max-width: 1100px) {
    .tracer-masthead { align-items: flex-start; flex-direction: column; gap: 20px; }
    .technique-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    body.tracer-page { padding: 20px 14px 40px; }
    .tracer-workspace, .tracer-configuration, .tracer-advanced, .tracer-page .settings-panel, .tracer-page .floating-settings-panel { padding: 18px 16px; }
    .tracer-account { width: 100%; }
    .technique-grid { grid-template-columns: 1fr; }
    .tracer-page .scramble-entry { flex-basis: 100%; }
    .tracer-page .scramble-input { flex-basis: 100%; width: 100%; box-sizing: border-box; }
    .tracer-page .buffer-section { display: grid; grid-template-columns: 1fr auto; }
    .tracer-page .buffer-section select { margin: 0; }
}

.conjugacy-summary { padding: 20px 24px; background: #fff; border: 1px solid #dce4e9; border-radius: 12px; margin: 20px 0; }
.conjugacy-summary > code { display: inline-block; margin: 8px 0 8px 16px; padding: 8px 12px; background: #e8f3f0; border-radius: 6px; color: #18786d; overflow-wrap: anywhere; }
.conjugacy-summary p { margin: 8px 0 0; color: #687785; font-size: 12px; line-height: 1.6; }
.conjugacy-value { overflow-wrap: anywhere; }

.conjugacy-practice { margin-top: 20px; padding: 16px; background: #f4faf8; border: 1px solid #d5e9e3; border-radius: 10px; }
.conjugacy-practice summary { cursor: pointer; color: #18786d; font-size: 13px; font-weight: 650; }
.conjugacy-practice p { font-size: 12px; line-height: 1.7; color: #687785; }
.conjugacy-practice-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.conjugacy-practice-controls label { display: grid; gap: 8px; flex: 1 1 240px; font-size: 12px; font-weight: 600; }
.conjugacy-practice-controls input { box-sizing: border-box; width: 100%; padding: 12px; border: 1px solid #d6dfe5; border-radius: 8px; font-family: monospace; font-size: 14px; }
#conjugacy-status:empty { display: none; }
.conjugacy-practice #conjugacy-status.error { color: #a13434; }
.tracer-page button:disabled { opacity: .6; cursor: wait; }

/* Solve setup follows the order in which a solver configures their method. */
.solve-settings .tracer-section-heading { padding-bottom: 18px; border-bottom: 1px solid #e7ecef; }
.solve-settings .technique-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scheme-layout { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.4fr); gap: 32px; align-items: center; }
.tracer-page .scheme-controls.settings-panel { margin: 0; padding: 0; border: 0; border-radius: 0; }
.scheme-controls > p { font-size: 13px; line-height: 1.7; }
.scheme-layout .cube-net-panel { padding: 20px; border: 1px solid #e7ecef; border-radius: 12px; background: #f7f9fa; }
.scheme-layout .cube-net { width: 100%; max-width: 580px; margin: 0 auto; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); gap: 6px; }
.scheme-layout .face { width: 100%; height: auto; aspect-ratio: 1; }
.scheme-layout .sticker { font-size: clamp(12px, 1.5vw, 20px); padding: 0; }
.tracer-page .solve-settings .floating-settings-panel { padding: 0; margin: 0; border: 0; border-radius: 0; }
.solve-settings .floating-settings-header h3 { font-size: 14px; margin: 0 0 8px; }
.settings-optional { display: inline-block; margin-left: 8px; padding: 4px 7px; border-radius: 5px; background: #eef3f5; color: #687785; font-size: 10px; font-weight: 500; vertical-align: middle; }
.solve-settings .floating-settings-header p { max-width: 850px; }
.solve-settings .floating-section-header h3 { font-size: 13px; }
.solve-settings .floating-hint { font-size: 12px; }
.solve-settings .floating-buffer-item { padding: 9px 12px; gap: 9px; font-size: 14px; border-color: #dce4e9; border-radius: 8px; }
.solve-settings .floating-buffer-item:has(input:checked) { background: #eff8f5; border-color: #9bcac5; }
.tracer-page .parity-section .pseudo-swap-settings { margin: 0 0 16px; padding: 16px; background: #f7f9fa; border: 1px solid #e7ecef; border-radius: 10px; }
.parity-section .pseudo-swap-settings > label { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.parity-section #pseudoswapEdgeSelection:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.solve-settings select { padding: 8px 12px; border: 1px solid #d6dfe5; border-radius: 8px; background: #fff; }
.solve-settings .tracer-advanced .technique-grid { margin-bottom: 20px; }
@media (max-width: 900px) {
    .scheme-layout { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 600px) {
    .solve-settings .technique-grid { grid-template-columns: 1fr; }
    .scheme-layout .cube-net-panel { padding: 10px; }
    .scheme-layout .cube-net { gap: 3px; }
    .scheme-layout .face { gap: 1px; padding: 1px; }
    .scheme-layout .sticker { font-size: 12px; }
    .solve-settings .floating-section-header { gap: 10px; }
}

.conjugacy-practice-controls .conjugacy-count { flex: 0 1 140px; }

.tracer-mode-nav { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 20px; border: 1px solid #dce4e9; border-radius: 10px; background: #eaf0f2; }
.tracer-mode-nav a { padding: 10px 22px; border-radius: 7px; color: #526474; text-decoration: none; font-size: 13px; font-weight: 600; }
.tracer-mode-nav a[aria-current="page"] { background: #fff; color: #087e79; box-shadow: 0 1px 4px #23354812; }
.tracer-mode-nav a:hover { color: #087e79; }

.preset-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.preset-controls label { display: grid; gap: 8px; flex: 1 1 220px; font-size: 12px; font-weight: 600; }
.preset-controls :is(input, select, button) { min-height: 40px; box-sizing: border-box; padding: 10px 12px; border: 1px solid #d6dfe5; border-radius: 8px; background: #fff; color: #243342; font: inherit; }
.preset-controls button { cursor: pointer; font-size: 13px; }
#save-preset { background: #087e79; border-color: #087e79; color: #fff; }
#preset-status { font-size: 13px; }
#preset-status:empty { display: none; }

.solution-section > button { padding: 10px 16px; border: 1px solid #087e79; border-radius: 8px; background: #087e79; color: white; cursor: pointer; }
.solution-examples { padding-left: 24px; }
.solution-examples li { padding: 16px; margin: 12px 0; border: 1px solid #dce4e9; border-radius: 10px; background: #f7f9fa; }
.solution-examples code { display: block; margin: 12px 0; font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
.solution-examples a, .solution-examples details { font-size: 12px; color: #087e79; }
.solution-examples details { margin-top: 12px; }
#solution-status { font-size: 13px; }

.beginner-method-section { margin-bottom: 20px; }
.beginner-method-section > label { display: block; margin-bottom: 8px; font-size: 13px; }
.beginner-method-section select { max-width: 100%; }
