/*
 * DevelopChess Reframe — September 2026
 * An original warm-paper visual system for the public product. The existing
 * stylesheets keep application state/layout contracts; this file owns the look.
 */

@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/poppins-400-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/poppins-500-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/poppins-600-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/poppins-700-latin.woff2") format("woff2");
}

:root {
    color-scheme: light;
    --ink: #22211f;
    --ink-soft: #4f4b47;
    --muted: #68615c;
    --paper: #fbf8f3;
    --paper-strong: #f5f0e9;
    --sheet: #fffdfa;
    --line: #dfd9d2;
    --line-hi: #cfc7bf;
    --brand: #ea765f;
    --brand-dark: #ad4635;
    --brand-soft: #fff0eb;
    --success: #267844;
    --success-dark: #1f6037;
    --success-soft: #eaf7ef;
    --green: var(--success);
    --green-dark: var(--success-dark);
    --green-soft: var(--success-soft);
    --red: #b7453e;
    --red-soft: #fff0ee;
    --point-loss-red: #c9453f;
    --point-loss-red-active: #df5d55;
    --yellow: #fff7dd;
    --blue: #f0f4ff;
    --lilac: #f4f0ff;
    --peach: #fff0eb;
    --accent: var(--brand);
    --accent-deep: var(--brand-dark);
    --accent-ink: var(--brand-dark);
    --accent-soft: #f4b1a3;
    --accent-pale: #fff0eb;
    --violet: #7557d6;
    --cyan: #078b74;
    --surface: #fffdfa;
    --surface-raised: #fffaf5;
    --surface-soft: #f5f0e9;
    --surface-input: #ffffff;
    --radius-card: 24px;
    --radius-card-mobile: 18px;
    --radius-control: 13px;
    --radius-header: 22px;
    --radius-header-mobile: 16px;
    --display: "Poppins", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --sans: "Poppins", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --serif: "Poppins", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "Inconsolata", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --shadow: 0 18px 50px rgba(52, 43, 36, .10);
    --shadow-soft: 0 10px 28px rgba(52, 43, 36, .07);
    --focus: 0 0 0 3px rgba(234, 118, 95, .18);
    --field-depth:
        inset 0 2px 4px rgba(52, 43, 36, .13),
        inset 0 -1px 0 rgba(255, 255, 255, .92),
        0 2px 0 #d8cec5,
        0 6px 12px rgba(52, 43, 36, .04);
}

* {
    scrollbar-color: #cec5bc #f5f0e9;
}

html {
    background: var(--paper);
}

body {
    min-width: 0;
    background:
        radial-gradient(circle at 14% -8rem, rgba(234, 118, 95, .11), transparent 32rem),
        radial-gradient(circle at 96% 16rem, rgba(49, 100, 244, .055), transparent 30rem),
        radial-gradient(rgba(34, 33, 31, .026) .7px, transparent .8px),
        var(--paper);
    background-attachment: fixed;
    background-size: auto, auto, 5px 5px, auto;
    color: var(--ink);
    font: 15px/1.55 var(--sans);
    letter-spacing: -.01em;
}

::selection {
    background: var(--accent-soft);
    color: var(--ink);
}

a {
    text-underline-offset: 3px;
}

button,
input,
select,
textarea {
    font-family: var(--sans);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--accent) !important;
    outline-offset: 3px;
}

.skip-link {
    z-index: 1000;
    padding: 11px 15px;
    border: 1px solid var(--accent);
    border-radius: 12px;
    background: var(--surface-raised);
    color: var(--ink);
}

/* Floating command header */
.site-header {
    position: sticky;
    z-index: 210;
    top: 10px;
    width: min(1180px, calc(100% - 24px));
    max-width: none;
    min-height: 66px;
    height: auto;
    margin: 12px auto 0;
    padding: 9px 10px;
    border: 1px solid rgba(223, 217, 210, .88);
    border-radius: var(--radius-header);
    background: rgba(255, 253, 250, .92);
    box-shadow: 0 14px 42px rgba(52, 43, 36, .08);
    backdrop-filter: blur(18px) saturate(1.35);
}

.wordmark {
    gap: 8px;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 23px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -.04em;
    text-transform: none;
}

.brand-mark {
    width: auto;
    height: 45px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
}

.site-header-actions {
    gap: 9px;
}

.site-header nav {
    gap: 5px;
    padding: 4px;
    border: 1px solid #e8e1d9;
    border-radius: 999px;
    background: rgba(255, 253, 250, .86);
    box-shadow: 0 8px 24px rgba(52, 43, 36, .045);
}

.site-header nav a,
.site-header nav button {
    --nav-control-face: #fffdfa;
    --nav-control-edge: #c8bdb3;
    --nav-control-shadow: rgba(52, 43, 36, .1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin-bottom: 3px;
    padding: 8px 13px;
    border: 1px solid var(--nav-control-edge);
    border-radius: 999px;
    background: var(--nav-control-face);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .82),
        0 3px 0 var(--nav-control-edge),
        0 8px 15px var(--nav-control-shadow);
    color: #68615c;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    translate: 0 0;
    transition: border-color .14s ease, background .14s ease, box-shadow .1s ease, color .14s ease, translate .1s ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible,
.site-header nav button:hover,
.site-header nav button:focus-visible {
    --nav-control-face: #fffaf5;
    --nav-control-edge: #b9aca1;
    color: var(--ink);
}

.site-header nav a[aria-current="page"] {
    --nav-control-face: var(--accent);
    --nav-control-edge: #b94d39;
    --nav-control-shadow: rgba(185, 77, 57, .2);
    color: var(--ink);
    font-weight: 600;
}

.site-header nav a:hover,
.site-header nav a:focus-visible,
.site-header nav button:hover,
.site-header nav button:focus-visible {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .86),
        0 4px 0 var(--nav-control-edge),
        0 10px 18px var(--nav-control-shadow);
    outline: 0;
    translate: 0 -1px;
}

.site-header nav a:focus-visible,
.site-header nav button:focus-visible {
    outline: 3px solid rgba(234, 118, 95, .22);
    outline-offset: 2px;
}

.site-header nav a:active,
.site-header nav button:active {
    box-shadow:
        inset 0 1px 3px rgba(52, 43, 36, .14),
        0 1px 0 var(--nav-control-edge),
        0 4px 8px var(--nav-control-shadow);
    translate: 0 2px;
}

.nav-account-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 76px;
    min-height: 40px;
    margin-bottom: 3px;
    padding: 8px 15px;
    border: 1px solid #b94d39;
    border-radius: 999px;
    background: var(--accent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .5),
        0 4px 0 #b94d39,
        0 9px 18px rgba(185, 77, 57, .18);
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, translate .14s ease;
}

.nav-account-button:hover,
.nav-account-button:focus-visible {
    border-color: #c45742;
    background: var(--accent-soft);
    color: var(--ink);
}

.nav-account-button:active {
    box-shadow: inset 0 1px 3px rgba(52, 43, 36, .14), 0 1px 0 #b94d39;
    translate: 0 3px;
}

.nav-account-button.is-authenticated {
    min-width: 108px;
    padding: 6px 13px 6px 7px;
    border-color: #c9bdb2;
    background: #fff9f2;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .92),
        0 3px 0 #c9bdb2,
        0 8px 16px rgba(52, 43, 36, .10);
}

.nav-account-button.is-authenticated:hover,
.nav-account-button.is-authenticated:focus-visible {
    border-color: #d98b7c;
    background: var(--accent-pale);
}

.nav-account-button.is-authenticated:active {
    box-shadow: inset 0 1px 3px rgba(52, 43, 36, .13), 0 1px 0 #c9bdb2;
}

.nav-account-button.is-current,
.nav-account-button.is-progress {
    border-color: #c9bdb2;
    background: #fff9f2;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .92),
        0 3px 0 #c9bdb2,
        0 8px 16px rgba(52, 43, 36, .10);
}

.nav-account-button.is-current:hover,
.nav-account-button.is-current:focus-visible,
.nav-account-button.is-progress:hover,
.nav-account-button.is-progress:focus-visible {
    border-color: #b9aca1;
    background: #fffdf9;
}

.nav-account-button.is-current:active,
.nav-account-button.is-progress:active {
    box-shadow: inset 0 1px 3px rgba(52, 43, 36, .13), 0 1px 0 #c9bdb2;
}

.nav-account-avatar {
    display: grid;
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(34, 33, 31, .18);
    border-radius: 50%;
    background: #fffdfa;
    color: var(--accent-ink);
    font-size: 12px;
    font-weight: 700;
}

.nav-account-avatar[hidden],
.nav-account-avatar img[hidden] {
    display: none;
}

.nav-account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-account-label {
    white-space: nowrap;
}

.chess-dna-icon {
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 3px 4px rgba(29, 35, 48, .18));
}

.chess-dna-icon[hidden] {
    display: none;
}

.dna-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .22em;
    line-height: 1;
    white-space: nowrap;
}

.dna-value > .chess-dna-icon {
    width: calc(var(--dna-value-size, 18px) * 1.3333);
    height: var(--dna-value-size, 18px);
}

.dna-value > .dna-number-text {
    font-size: var(--dna-value-size, inherit);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.dna-value-unit {
    align-self: flex-end;
    margin: 0 0 .08em -.04em;
    color: var(--muted);
    font-size: calc(var(--dna-value-size, 18px) * .48);
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.nav-account-button.is-authenticated .nav-dna-value,
.nav-account-button.is-progress .nav-dna-value {
    --dna-value-size: 20px;
}

.nav-dna-icon {
    margin-left: -3px;
}

.nav-dna-value > .nav-context-icon {
    width: 28px;
    height: 28px;
    margin-left: -3px;
    object-fit: contain;
    filter: drop-shadow(0 3px 4px rgba(29, 35, 48, .18));
}

.nav-dna-value > .nav-context-icon.chess-dna-icon {
    width: calc(var(--dna-value-size, 20px) * 1.3333);
    height: var(--dna-value-size, 20px);
}

.nav-context-icon[hidden] {
    display: none;
}

.nav-account-button.is-authenticated .nav-account-label,
.nav-account-button.is-progress .nav-account-label {
    color: var(--accent-ink);
    font-size: var(--dna-value-size);
    font-weight: 800;
}

.nav-toggle,
.pwa-install-button {
    min-width: 40px;
    min-height: 40px;
    border: 1px solid var(--line-hi);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: 0 6px 16px rgba(52, 43, 36, .07);
    color: var(--ink);
}

.nav-toggle {
    --nav-toggle-edge: #c8bdb3;
    margin-bottom: 3px;
    border-color: var(--nav-toggle-edge);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .84),
        0 3px 0 var(--nav-toggle-edge),
        0 8px 15px rgba(52, 43, 36, .1);
    translate: 0 0;
    transition: border-color .14s ease, background .14s ease, box-shadow .1s ease, translate .1s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    border-color: #b9aca1;
    background: #fffaf5;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .88),
        0 4px 0 #b9aca1,
        0 10px 18px rgba(52, 43, 36, .12);
    outline: 0;
    translate: 0 -1px;
}

.nav-toggle:focus-visible {
    outline: 3px solid rgba(234, 118, 95, .22);
    outline-offset: 2px;
}

.nav-toggle:active {
    box-shadow: inset 0 1px 3px rgba(52, 43, 36, .14), 0 1px 0 #b9aca1;
    translate: 0 2px;
}

.site-header nav .pwa-install-button {
    min-height: 38px;
    padding: 8px 11px;
    border-color: #d98b7c;
    background: var(--accent-pale);
    box-shadow: none;
    color: var(--accent-ink);
    font-size: 10px;
}

.pwa-install-banner {
    position: relative;
    z-index: 205;
    display: block;
    width: max-content;
    max-width: calc(100% - 24px);
    min-height: 42px;
    margin: 8px auto 4px;
    padding: 9px 15px;
    border-color: #b94d39;
    background: var(--accent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .55),
        0 4px 0 #b94d39,
        0 10px 20px rgba(185, 77, 57, .2);
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
    translate: 0 0;
    transition: border-color .14s ease, background .14s ease, box-shadow .1s ease, translate .1s ease;
}

.pwa-install-banner:hover,
.pwa-install-banner:focus-visible {
    border-color: #a84332;
    background: var(--accent-soft);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .64),
        0 5px 0 #a84332,
        0 12px 22px rgba(185, 77, 57, .24);
    outline: 0;
    translate: 0 -1px;
}

.pwa-install-banner:focus-visible {
    outline: 3px solid rgba(234, 118, 95, .24);
    outline-offset: 2px;
}

.pwa-install-banner:active {
    box-shadow: inset 0 1px 3px rgba(52, 43, 36, .14), 0 1px 0 #a84332;
    translate: 0 3px;
}

.pwa-install-banner:disabled {
    box-shadow: inset 0 1px 2px rgba(52, 43, 36, .12), 0 2px 0 #b94d39;
    opacity: .68;
    translate: 0 2px;
}

body.is-quick-puzzle .pwa-install-banner {
    display: none !important;
}

.home-hub-tabs-wrap {
    width: min(1180px, calc(100% - 24px));
    max-width: none;
    margin: 14px auto 0;
    padding: 0;
}

.home-hub-tabs {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    padding: 5px 5px 9px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 253, 250, .94);
    box-shadow: var(--shadow-soft);
}

.home-hub-tabs a {
    --hub-tab-face: #fffdfa;
    --hub-tab-edge: #c8bdb3;
    --hub-tab-shadow: rgba(52, 43, 36, .11);
    min-height: 54px;
    margin-bottom: 4px;
    padding: 10px 16px;
    border: 1px solid var(--hub-tab-edge);
    border-radius: 17px;
    background: var(--hub-tab-face);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .84),
        0 4px 0 var(--hub-tab-edge),
        0 10px 19px var(--hub-tab-shadow);
    color: var(--muted);
    translate: 0 0;
    transition: border-color .14s ease, background .14s ease, box-shadow .1s ease, color .14s ease, translate .1s ease;
}

.home-hub-tabs a {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 32px auto;
    row-gap: 4px;
    align-content: center;
    align-items: center;
    justify-items: center;
    justify-content: center;
    text-align: center;
}

.home-hub-tab-icon {
    display: block;
    grid-column: 1;
    grid-row: 1;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

@media (min-width: 621px) {
    .home-hub-tabs a {
        grid-template-rows: 44px auto;
    }

    .home-hub-tab-icon {
        width: 44px;
        height: 44px;
    }
}

.home-hub-tabs a > span {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
}

.home-hub-tabs a:hover,
.home-hub-tabs a:focus-visible {
    --hub-tab-face: #fffaf5;
    --hub-tab-edge: #b9aca1;
    color: var(--ink);
}

.home-hub-tabs a.active {
    --hub-tab-face: var(--accent);
    --hub-tab-edge: #b94d39;
    --hub-tab-shadow: rgba(185, 77, 57, .2);
    border-color: var(--hub-tab-edge);
    background: var(--hub-tab-face);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .58),
        0 4px 0 var(--hub-tab-edge),
        0 10px 19px var(--hub-tab-shadow);
    color: var(--ink);
}

.home-hub-tabs a:hover,
.home-hub-tabs a:focus-visible {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .88),
        0 5px 0 var(--hub-tab-edge),
        0 12px 22px var(--hub-tab-shadow);
    outline: 0;
    translate: 0 -1px;
}

.home-hub-tabs a:focus-visible {
    outline: 3px solid rgba(234, 118, 95, .22);
    outline-offset: 2px;
}

.home-hub-tabs a:active {
    box-shadow:
        inset 0 1px 3px rgba(52, 43, 36, .14),
        0 1px 0 var(--hub-tab-edge),
        0 4px 8px var(--hub-tab-shadow);
    translate: 0 3px;
}

.home-hub-tabs a.active small {
    color: rgba(34, 33, 31, .72);
}

.home-hub-tabs span {
    font-size: 14px;
}

.home-hub-tabs small {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Foundational surfaces */
.paper-card,
.analyzer-card,
.legal-page section,
.account-page-card {
    border-color: var(--line);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    color: var(--ink);
}

.eyebrow,
.hero-brand {
    color: var(--accent-ink);
    font: 820 10px/1.2 var(--mono);
    letter-spacing: .16em;
    text-transform: uppercase;
}

.button {
    --button-face: var(--surface);
    --button-edge: #bfb4aa;
    --button-shadow: rgba(52, 43, 36, .12);
    min-height: 45px;
    padding: 10px 16px;
    border-color: var(--button-edge);
    border-radius: var(--radius-control);
    background: var(--button-face);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .78),
        inset 0 -1px 0 rgba(52, 43, 36, .10),
        0 4px 0 var(--button-edge),
        0 10px 18px var(--button-shadow);
    font: 600 14px/1 var(--sans);
    letter-spacing: -.01em;
    text-shadow: none;
    translate: 0 0;
    transition: background-color .12s ease, border-color .12s ease, box-shadow .09s ease, color .12s ease, translate .09s ease;
}

.primary-button {
    --button-face: var(--accent);
    --button-edge: #b94d39;
    --button-shadow: rgba(185, 77, 57, .22);
    border-color: var(--button-edge);
    background: var(--button-face);
    color: var(--ink);
}

.button:hover:not(:disabled) {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .82),
        inset 0 -1px 0 rgba(52, 43, 36, .10),
        0 5px 0 var(--button-edge),
        0 12px 22px var(--button-shadow);
    filter: none;
}

.button:not(.progress-share-sticky, .board-next-tactic):hover:not(:disabled) {
    translate: 0 -1px;
}

.button:active:not(:disabled) {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .55),
        inset 0 1px 3px rgba(52, 43, 36, .14),
        0 1px 0 var(--button-edge),
        0 4px 8px var(--button-shadow);
}

.button:not(.progress-share-sticky, .board-next-tactic):active:not(:disabled) {
    translate: 0 3px;
}

.button:disabled {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .5),
        0 2px 0 var(--button-edge);
    translate: 0 2px;
}

.primary-button:focus-visible {
    outline-color: var(--accent) !important;
}

.secondary-button {
    --button-face: var(--surface);
    --button-edge: #bfb4aa;
    --button-shadow: rgba(52, 43, 36, .12);
    border-color: var(--button-edge);
    background: var(--button-face);
    color: var(--ink);
}

.button:is(.board-reveal-tactic, .reveal-answer) {
    --button-face: var(--accent);
    --button-edge: #b94d39;
    --button-shadow: rgba(185, 77, 57, .22);
    border-color: var(--button-edge);
    background: var(--button-face);
    color: #fff0da;
    text-shadow: 0 1px 0 rgba(145, 62, 43, .42);
}

.secondary-button:hover {
    --button-face: var(--accent-pale);
    --button-edge: #d98b7c;
    border-color: var(--button-edge);
    background: var(--accent-pale);
}

.button:is(.board-reveal-tactic, .reveal-answer):hover:not(:disabled) {
    --button-face: #f08a75;
    --button-edge: #b94d39;
    border-color: var(--button-edge);
    background: var(--button-face);
}

@media (min-width: 721px) {
    .board-tactic-actions .board-reveal-tactic {
        font-size: 15px;
        font-weight: 850;
    }
}

.field > span,
.account-form label > span,
.deletion-form-card label > span,
.puzzle-tools label span {
    color: #5f5954;
    font: 780 9px/1.2 var(--mono);
    letter-spacing: .12em;
}

.field textarea,
.field input,
.field select,
.account-form input,
.deletion-form-card input,
.puzzle-tools input,
.puzzle-tools select,
.training-mode-field select,
.progress-username-form input,
.admin-login-form input[type="password"],
.admin-search input[type="search"],
.admin-notification-compose input[type="text"],
.admin-notification-compose input[type="search"],
.admin-notification-compose input[type="datetime-local"],
.admin-notification-compose textarea,
.admin-notification-compose select,
.admin-source-prompt textarea[readonly] {
    border-color: #cfc3b8;
    background: linear-gradient(180deg, #f6efe8 0, #fffdfa 27%, #fff 100%);
    border-radius: 13px;
    box-shadow: var(--field-depth);
    color: var(--ink);
    transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}

.field textarea {
    font-family: var(--mono);
}

.field textarea::placeholder,
.field input::placeholder,
.account-form input::placeholder {
    color: #9b948e;
}

.field textarea:focus,
.field input:focus,
.field select:focus,
.account-form input:focus,
.puzzle-tools input:focus,
.puzzle-tools select:focus,
.training-mode-field select:focus,
.progress-username-form input:focus,
.admin-login-form input[type="password"]:focus,
.admin-search input[type="search"]:focus,
.admin-notification-compose input[type="text"]:focus,
.admin-notification-compose input[type="search"]:focus,
.admin-notification-compose input[type="datetime-local"]:focus,
.admin-notification-compose textarea:focus,
.admin-notification-compose select:focus,
.admin-source-prompt textarea[readonly]:focus {
    border-color: #ea765f;
    background: #fffdfa;
    box-shadow: var(--field-depth), var(--focus);
}

.deletion-form-card input:focus {
    border-color: var(--red);
    background: #fffdfa;
    box-shadow: var(--field-depth), 0 0 0 3px rgba(183, 69, 62, .14);
}

.deletion-form-card input:focus-visible {
    outline-color: var(--red) !important;
}

.deletion-form-card input[readonly],
.admin-source-prompt textarea[readonly] {
    background: linear-gradient(180deg, #ebe4dc 0, #f5f0e9 32%, #f8f4ef 100%);
    box-shadow:
        inset 0 2px 4px rgba(52, 43, 36, .10),
        inset 0 -1px 0 rgba(255, 255, 255, .76),
        0 1px 0 #d8cec5;
}

select {
    color-scheme: light;
}

/* Hero and entry workspace */
.capability-strip {
    width: min(1180px, calc(100% - 24px));
    height: auto;
    min-height: 34px;
    margin: 8px auto 0;
    padding: 0 8px;
    border: 0;
    background: transparent;
}

.capability-strip span {
    padding: 5px 8px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: 760 9px/1 var(--mono);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.view-home .capability-strip span + span::before {
    color: #cec5bc;
    content: "/";
}

.hero,
.directory-hero {
    position: relative;
    width: min(1180px, calc(100% - 24px));
    max-width: none;
    margin: 0 auto;
    padding: 66px 30px 32px;
    overflow: hidden;
    text-align: left;
}

.hero::after,
.directory-hero::after {
    position: absolute;
    z-index: -1;
    right: 6%;
    top: 48%;
    width: 310px;
    height: 310px;
    background: center / contain no-repeat url('/assets/images/tabs/play-clay-v1.png');
    content: "";
    filter: drop-shadow(0 20px 35px rgba(52, 43, 36, .108));
    opacity: .09;
    transform: translateY(-50%) rotate(-8deg);
}

.hero h1,
.directory-hero h1 {
    max-width: 850px;
    margin: 10px 0 15px;
    color: var(--ink);
    font: 860 clamp(52px, 7.5vw, 92px)/.91 var(--display);
    letter-spacing: -.075em;
}

.directory-hero h1 {
    font-size: clamp(47px, 6.5vw, 78px);
}

.hero h1 em,
.directory-hero h1 em,
.progress-page-hero h1 em,
.comparison-index-hero h1 em {
    color: var(--accent-ink);
    font-style: normal;
    font-weight: inherit;
}

.hero > p:last-child,
.directory-hero > p:last-child {
    max-width: 680px;
    margin: 0;
    color: #68615c;
    font-size: 18px;
    line-height: 1.58;
}

body.view-puzzles .directory-hero.puzzle-directory-hero {
    width: min(1100px, 100%);
    padding-inline: 20px;
}

body.view-puzzles .directory-hero.puzzle-directory-hero h1 {
    max-width: none;
    font-size: clamp(36px, 5vw, 66px);
    text-wrap: balance;
}

body.view-puzzles .directory-hero.puzzle-directory-hero > p:last-child {
    max-width: none;
    font-size: clamp(16px, 2.24vw, 18px);
    text-wrap: balance;
}

body.view-puzzles .directory-hero.workout-directory-hero h1 {
    font-size: clamp(28px, 4vw, 42px);
}

.directory-hero-action,
.library-more-link {
    border-color: #dfa395;
    border-radius: 10px;
    background: #fffaf5;
    color: var(--accent-ink);
}

.analyzer-wrap {
    max-width: 1180px;
    margin-bottom: 42px;
}

body.view-puzzles .site-header,
body.view-puzzles .home-hub-tabs-wrap {
    width: min(1060px, calc(100% - 40px));
}

.analyzer-card {
    padding: 0 26px 25px;
    overflow: hidden;
}

.analyzer-heading {
    padding-top: 3px;
}

.analyzer-heading h2,
.section-heading h2,
.coming-grid h2,
.how-section h2,
.progress-dashboard-grid h2,
.training-section-heading h2 {
    color: var(--ink);
    font-family: var(--display);
    font-weight: 820;
}

.analyzer-heading p:not(.eyebrow),
.section-heading p,
.analysis-options p,
.library-note,
.example-row,
.fen-actions p {
    color: var(--muted);
}

.coach-note {
    border-color: #dfd2a6;
    border-radius: 10px;
    background: #fff7dd;
    color: #80661e;
    font: 650 12px/1.4 var(--sans);
    transform: none;
}

.coach-note::before {
    display: none;
}

.input-tabs,
.puzzle-mode-tabs {
    gap: 5px;
    margin: 0 -26px 22px;
    padding: 6px;
    border-bottom-color: var(--line);
    background: #ffffff;
}

.input-tabs button,
.puzzle-mode-tabs button {
    min-height: 50px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
}

.input-tabs button.active,
.puzzle-mode-tabs button.active {
    border-color: #cec5bc;
    background: linear-gradient(180deg, #f5f0e9, #fffaf5);
    box-shadow: inset 0 -3px var(--accent), inset 0 1px rgba(255, 255, 255, .04);
    color: var(--ink);
}

.analysis-options {
    border-top-color: var(--line);
}

.text-button,
.account-text-button {
    border-color: #d98b7c;
    color: var(--accent-ink);
}

.analysis-progress {
    border-color: var(--line);
    border-radius: 17px;
    background: var(--surface-raised);
}

.thinking-knight {
    border-color: #c9bfb5;
    background: radial-gradient(circle, #fff0eb, #fffaf5);
    color: var(--accent-ink);
}

/* Puzzle and lesson library */
.curriculum-count {
    border-color: #d4ccc4;
    border-radius: 12px;
    background: #f8f3ed;
    box-shadow: inset 0 2px 4px rgba(52, 43, 36, .105);
}

.curriculum-count strong {
    color: var(--accent-ink);
    font-family: var(--display);
}

.game-library {
    gap: 9px;
}

.puzzle-card,
.puzzle-card:nth-child(n),
.quick-puzzle,
.stationery-card,
.stationery-card.blue,
.stationery-card.yellow,
.stationery-card.green {
    --card-tint: rgba(7, 139, 116, .06);
    border-color: var(--line);
    border-radius: 18px;
    background: linear-gradient(145deg, var(--card-tint), transparent 62%), var(--surface);
    box-shadow: 0 8px 22px rgba(52, 43, 36, .055);
    color: var(--ink);
}

.puzzle-card:nth-child(5n + 2),
.stationery-card.yellow {
    --card-tint: rgba(234, 118, 95, .1);
}

.puzzle-card:nth-child(5n + 3),
.stationery-card.green {
    --card-tint: rgba(49, 100, 244, .075);
}

.puzzle-card:nth-child(5n + 4) {
    --card-tint: rgba(117, 87, 214, .075);
}

.puzzle-card:nth-child(5n + 5) {
    --card-tint: rgba(255, 200, 92, .11);
}

.puzzle-card:hover:not(:disabled) {
    border-color: var(--accent-soft);
    box-shadow: 0 16px 34px rgba(52, 43, 36, .11);
}

.puzzle-card:disabled {
    border-color: #ebe4dc;
    background: #f5f0e9;
    color: #9b948e;
    filter: none;
    opacity: .64;
}

.puzzle-card.completed,
.quick-puzzle.completed {
    border-color: rgba(7, 139, 116, .42);
    background: linear-gradient(145deg, rgba(7, 139, 116, .09), transparent 62%), #fffdfa;
    box-shadow: inset 0 0 0 1px rgba(7, 139, 116, .08), 0 8px 22px rgba(52, 43, 36, .055);
}

.puzzle-card small,
.puzzle-card p,
.stationery-card small,
.stationery-card p {
    color: var(--muted);
}

.puzzle-card .game-status,
.puzzle-card .game-reward,
.puzzle-card.completed .game-reward {
    color: var(--accent-ink);
}

.puzzle-card.completed .game-status,
.puzzle-card.completed .game-reward,
.quick-puzzle.completed .game-status {
    color: var(--cyan);
}

.carousel-arrow,
.puzzle-page-controls button {
    border-color: var(--line-hi);
    background: #fffaf5;
    color: var(--ink);
}

.puzzle-branches {
    gap: 8px;
}

.puzzle-branches strong {
    font-size: clamp(13px, 1.1vw, 15px);
    line-height: 1.2;
}

.puzzle-branches small {
    margin-top: 3px;
    font-size: clamp(9px, .75vw, 10px);
    line-height: 1.2;
}

@media (max-width: 720px) {
    .puzzle-branches strong {
        font-size: clamp(11.5px, 3.33vw, 13px);
    }
}

@media (max-width: 360px) {
    .puzzle-branches button,
    .puzzle-branches button:nth-child(n) {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 5px;
        padding-inline: 7px;
    }

    .puzzle-branches button > span {
        min-width: 0;
    }

    .puzzle-branch-icon {
        width: 30px;
        height: 30px;
    }
}

.puzzle-branches button,
.puzzle-branches button:nth-child(n) {
    border-color: #d9d2cb;
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(49, 100, 244, .055), transparent 60%), #fffaf5;
    color: var(--ink);
}

.puzzle-branches button:hover,
.puzzle-branches button:focus-visible {
    border-color: #c4bbb2;
    background-color: #fffaf5;
}

.puzzle-branches button.active {
    border-color: #d98b7c;
    background: linear-gradient(145deg, rgba(234, 118, 95, .16), transparent 60%), #fff0eb;
    box-shadow: inset 3px 0 var(--accent);
}

.puzzle-mate-depths,
.puzzle-tools,
.puzzle-pagination,
.puzzle-workout-launch {
    border-color: #d7d0c8;
    border-radius: 14px;
    background: #fffaf5;
}

.puzzle-tools-toggle {
    border-color: var(--line-hi);
    background: linear-gradient(145deg, rgba(234, 118, 95, .055), transparent 58%), #fffaf5;
    color: var(--ink);
}

.puzzle-tools-toggle b {
    border-color: #c9bfb5;
    background: #f5f0e9;
    color: var(--accent-ink);
}

.game-library .puzzle-card .game-status,
.game-library.quick-library .quick-puzzle .game-status {
    border-color: #c4bbb2;
    background: #f5f0e9;
    color: var(--accent-ink);
}

.puzzle-mate-depths button,
.puzzle-page-controls button,
.puzzle-workout-durations button {
    border-color: var(--line-hi);
    border-radius: 9px;
    background: #fffaf5;
    color: var(--ink);
}

.puzzle-mate-depths button.active,
.puzzle-page-controls button[aria-current="page"],
.puzzle-workout-durations button.active {
    border-color: #ea765f;
    background: var(--accent);
    box-shadow: inset 0 1px rgba(255, 255, 255, .45);
    color: var(--ink);
}


/* Home narrative and DNA */
.how-section {
    border-color: var(--line);
}

.how-section li {
    border-color: var(--line-hi);
}

.how-section li span {
    border-color: #c8bfb6;
    background: #fffdfa;
    color: var(--accent-ink);
}

.coming-grid article,
.coming-grid article:first-child,
.coming-grid article:last-child {
    border-color: var(--line);
    border-radius: 17px;
    background: linear-gradient(145deg, rgba(49, 100, 244, .09), transparent 58%), var(--surface);
}

.coming-grid article:last-child {
    background: linear-gradient(145deg, rgba(7, 139, 116, .08), transparent 58%), var(--surface);
}

.dna-overview {
    border-color: #d4ccc4;
    background: linear-gradient(135deg, rgba(234, 118, 95, .1), transparent 42%), var(--surface);
}

.dna-focus {
    border-color: var(--line-hi);
}

.dna-focus > strong,
.dna-stat strong {
    color: var(--ink);
}

.dna-history {
    border-color: var(--line);
}

.dna-history span {
    border-color: var(--line-hi);
    background: #f8f3ed;
}

.dna-meter,
.progress-track,
.board-point-meter,
.report-dna-mini-stat > i,
.share-preview-row i,
.training-dna-meter,
.progress-domain-row i,
.progress-level-meter {
    overflow: hidden;
    border-radius: 999px;
    background: #e8e1d9;
}

.dna-meter i,
.progress-track span,
.board-point-meter i,
.report-dna-mini-stat > i b,
.share-preview-row b,
.training-dna-meter i,
.progress-domain-row b,
.progress-level-meter i {
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent));
}

.report-dna-mini-stat > i {
    border: 1px solid rgba(86, 65, 55, .2);
    background: linear-gradient(180deg, #d5cbc2 0%, #e7dfd7 52%, #f6f1ec 100%);
    box-shadow:
        inset 0 2px 3px rgba(54, 40, 34, .28),
        inset 0 -1px 0 rgba(255, 255, 255, .88),
        0 1px 0 rgba(255, 255, 255, .7);
}

.report-dna-mini-stat > i b {
    background: linear-gradient(180deg, #f39682 0%, var(--accent) 45%, var(--accent-deep) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .42),
        inset 0 -2px 2px rgba(111, 46, 35, .3),
        1px 0 2px rgba(72, 43, 35, .2);
}

.progress-avatar {
    background: linear-gradient(145deg, #f4b1a3, #fff0eb);
    color: var(--accent-ink);
}

/* Progress dashboard */
.progress-page {
    max-width: 1180px;
}

.progress-rhythm-card {
    grid-column: 2;
    grid-row: 1;
}

.progress-domains-card {
    grid-column: 1;
    grid-row: 1;
}

@media (max-width: 720px) {
    .progress-rhythm-card,
    .progress-domains-card {
        grid-column: 1;
        grid-row: auto;
    }
}

.progress-page-hero h1 {
    color: var(--ink);
    font-family: var(--display);
    font-weight: 860;
}

.progress-identity {
    border-color: #d4ccc4;
    background: linear-gradient(145deg, rgba(7, 139, 116, .08), transparent 58%), var(--surface);
}

.progress-account-action,
.progress-username-form button,
.progress-chart-switch {
    border-color: var(--line-hi);
    background: #f8f3ed;
    color: var(--accent-ink);
}

.progress-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.progress-kpis article {
    min-height: 122px;
    padding: 17px;
}

.progress-kpis article:nth-child(2n) {
    background: linear-gradient(145deg, rgba(49, 100, 244, .07), transparent 58%), var(--surface);
}

.progress-kpis strong {
    color: var(--accent-ink);
    font-family: var(--display);
}

.progress-kpis .progress-dna-kpi {
    display: block;
}

.progress-dna-value {
    --dna-value-size: 32px;
    justify-content: flex-start;
    margin: 7px 0 2px;
}

.progress-kpis .progress-dna-value {
    display: inline-flex;
}

.progress-kpis .progress-dna-value > .dna-number-text {
    margin: 0;
    color: var(--accent-ink);
    font-family: var(--display);
    font-weight: 800;
}

.dna-history-value {
    --dna-value-size: 15px;
}

.dna-history .dna-total-history {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.dna-history .dna-history-value {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.report-dna-value {
    --dna-value-size: 14px;
}

.report-dna-total-line {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.progress-level-runway,
.progress-rhythm-card,
.progress-milestones-card {
    background: linear-gradient(145deg, rgba(234, 118, 95, .08), transparent 60%), var(--surface);
}

.progress-level-medallion {
    border-color: #dfa395;
    background: #f8f3ed;
    color: var(--accent-ink);
}

.progress-momentum-card header > span {
    background: #f8f3ed;
}

.progress-momentum-card header > span[data-trend="up"] {
    background: #eefaf6;
    color: var(--cyan);
}

.progress-week-stats span,
.progress-rhythm-stats span,
.progress-recent-item,
.progress-milestone,
.progress-milestone.locked,
.progress-chart-switch button[aria-pressed="true"] {
    border-color: var(--line);
    background: #f8f3ed;
    color: var(--muted);
}

.progress-week-stats strong,
.progress-rhythm-stats strong,
.progress-recent-item strong {
    color: var(--ink);
}

.progress-coach-card {
    background: linear-gradient(145deg, rgba(49, 100, 244, .22), transparent 60%), #f6f4ff;
}

.progress-coach-card .eyebrow {
    color: var(--accent-ink);
}

.progress-coach-card h2 {
    color: var(--ink);
}

.progress-coach-card > p {
    color: var(--muted);
}

.progress-coach-piece {
    color: rgba(117, 87, 214, .08);
}

.progress-coach-card .button {
    border-color: #ea765f;
    background: var(--accent);
    color: var(--ink);
}

.progress-chart {
    background: repeating-linear-gradient(to bottom, transparent 0 46px, rgba(130, 123, 117, .22) 46px 47px);
}

.progress-chart-bar {
    background: linear-gradient(180deg, var(--accent), var(--accent-deep));
}

.progress-chart-bar.zero,
.progress-heatmap i,
.rhythm-share-grid i {
    background: #e8e1d9;
}

.rhythm-share-grid i {
    border-radius: 5px;
}

.progress-heatmap i.active,
.rhythm-share-grid i.active {
    background: #f4b1a3;
}

.progress-heatmap i.strong,
.rhythm-share-grid i.strong {
    background: var(--accent);
}

.progress-heatmap i.today,
.rhythm-share-grid i.today {
    outline-color: var(--violet);
}

.trophy-tier {
    border-color: #d7d0c8;
    background: linear-gradient(145deg, #fffaf5, #fffdfa 52%, #fffaf5);
    box-shadow: inset 0 1px rgba(255, 255, 255, .05), 0 9px 22px rgba(52, 43, 36, .087);
}

.trophy-tier-heading {
    border-color: #d7d0c8;
    color: var(--ink);
}

.trophy-tier-heading p {
    color: var(--muted);
}

.trophy-tier-heading > span {
    border-color: #cec5bc;
    background: #f5f0e9;
    color: var(--accent-ink);
}

.progress-milestone,
.progress-milestone.locked {
    border-right-color: rgba(255, 255, 255, .045);
    border-bottom-color: #d7d0c8;
    background: linear-gradient(90deg, rgba(255, 255, 255, .025), transparent 50%, rgba(52, 43, 36, .037));
    box-shadow: inset 0 -3px #fffaf5, 0 4px 0 #ddd4cb;
    color: var(--ink);
}

.progress-milestone-copy,
.progress-milestone-image {
    border-color: #d7d0c8;
    background: rgba(255, 253, 250, .76);
}

.progress-milestone strong {
    color: var(--ink);
}

.progress-share-sticky .button {
    --button-edge: #b94d39;
    --button-shadow: rgba(185, 77, 57, .22);
    border-color: #ea765f;
    background: var(--accent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .52),
        inset 0 -1px 0 rgba(117, 43, 30, .16),
        0 5px 0 var(--button-edge),
        0 16px 32px var(--button-shadow);
    color: var(--ink);
}

.progress-share-sticky .button:hover:not(:disabled) {
    background: #f28a75;
}

.progress-trophy-account {
    border-color: #cec5bc;
    background: linear-gradient(145deg, rgba(49, 100, 244, .08), transparent 60%), #fffaf5;
    color: var(--muted);
}

.progress-trophy-account button {
    border-color: #d98b7c;
    background: var(--accent);
    box-shadow: 0 3px 0 #b94d39;
    color: var(--ink);
}

.progress-rhythm-head > button {
    border-color: #c9bfb5;
    background: #f5f0e9;
    color: var(--accent-ink);
}

.progress-rhythm-head > button:hover,
.progress-rhythm-head > button:focus-visible {
    border-color: #d98b7c;
    background: #fff0eb;
}

/* Chessboard workspace — warm cream and dusty slate complement the coral accent. */
.report-shell {
    max-width: 1240px;
}

@media (min-width: 901px) {
    body.is-quick-puzzle .report-shell {
        padding-top: 8px;
    }
}

@media (min-width: 721px) {
    body.is-quick-puzzle .board-paper > #board-task {
        display: none !important;
    }
}

.back-link,
.report-copy-link {
    color: #736d67;
}

.report-hero h1 {
    color: var(--ink);
    font-family: var(--display);
    font-weight: 850;
}

.report-hero h1 span,
.matchup-vs,
.report-hero .report-skill-update {
    color: var(--accent-ink);
}

.matchup-result,
.report-hero .report-skill-update {
    border-color: #cec5bc;
    background: #fffaf5;
}

.board-paper {
    padding: 15px;
    border-color: #d7d0c8;
    background: linear-gradient(145deg, rgba(234, 118, 95, .055), transparent 44%), #fffdfa;
}

.board-task {
    border-color: #d7d0c8;
    border-radius: 12px;
    background: #f8f3ed;
}

.board-label {
    color: var(--muted);
    font-family: var(--mono);
}

.board-label .puzzle-solve-timer {
    color: var(--accent-ink);
}

.chessboard {
    border: 7px solid var(--board-frame);
    border-radius: 14px;
    background: var(--board-light);
    box-shadow: 0 4px 0 var(--board-frame), 0 15px 34px rgba(52, 43, 36, .093), inset 0 0 0 1px rgba(255, 255, 255, .05);
}

.board-square.light {
    background: var(--board-light);
}

.board-square.dark {
    background: var(--board-dark);
}

.board-side-cue {
    border-color: rgba(234, 118, 95, .45);
    background: rgba(34, 33, 31, .92);
    color: #fff;
}

.puzzle-board-prompt {
    border-color: var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.puzzle-board-prompt span {
    color: var(--accent-ink);
}

.puzzle-board-prompt.incorrect {
    border-color: #dca39e;
    background: var(--red-soft);
}

.puzzle-board-prompt.incorrect strong,
.puzzle-board-prompt.incorrect span {
    color: #b7453e;
}

.puzzle-board-prompt.correct {
    border-color: rgba(7, 139, 116, .38);
    background: #eefaf6;
}

.puzzle-board-prompt.correct strong,
.puzzle-board-prompt.correct span {
    color: var(--cyan);
}

.puzzle-board-prompt.answer {
    border-color: #ddca82;
    background: #fff7dd;
}

.board-point-gain {
    position: relative;
    border-color: var(--accent-deep);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(234, 118, 95, .09), transparent 58%), #fffaf5;
    animation: none;
}

.board-point-gain.actions-only.is-solved-puzzle {
    padding: 12px;
    border: 1px solid var(--accent-deep);
    background: linear-gradient(145deg, rgba(234, 118, 95, .09), transparent 58%), #fffaf5;
    box-shadow: 0 7px 20px rgba(56, 80, 60, .09);
}

.puzzle-success-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    align-items: center;
    min-height: 88px;
    margin: -12px -12px 12px;
    padding: 10px 6px 0 15px;
    overflow: hidden;
    border-bottom: 1px solid rgba(207, 89, 68, .24);
    border-radius: 13px 13px 0 0;
    background:
        radial-gradient(circle at 18% 115%, rgba(255, 215, 111, .55), transparent 46%),
        linear-gradient(120deg, #fff0eb, #fffaf5 66%);
}

.puzzle-success-hero > span {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 3px;
}

.puzzle-success-hero small {
    color: var(--accent-ink);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.puzzle-success-hero strong {
    color: var(--ink);
    font: 800 22px/1.05 var(--display);
    letter-spacing: -.035em;
}

.puzzle-success-hero img {
    align-self: end;
    display: block;
    width: 96px;
    height: 96px;
    margin: -8px -2px -11px 0;
    object-fit: contain;
}

@media(max-width:720px) {
    .board-point-gain.summary-only-modal > .puzzle-success-hero {
        display: none;
    }

    .report-dna-mini.mobile-modal-open > .mobile-point-summary .puzzle-success-hero {
        grid-template-columns: minmax(0, 1fr);
        min-height: 56px;
        margin: -10px -10px 10px;
        padding: 10px 13px;
    }

    .report-dna-mini.mobile-modal-open > .mobile-point-summary .puzzle-success-hero strong {
        font-size: 20px;
    }

    .report-dna-mini.mobile-modal-open > .mobile-point-summary .puzzle-success-hero img {
        display: none;
    }
}

.board-point-gain > header > span {
    border-radius: 9px;
    background: var(--accent);
    color: var(--ink);
}

.board-point-gain > header > .dna-point-change,
.board-feedback-card > header > .board-feedback-total-wrap {
    --dna-value-size: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 70px;
    height: 38px;
    padding: 0 8px 0 4px;
}

.dna-point-change > .chess-dna-icon {
    filter: drop-shadow(0 2px 2px rgba(29, 35, 48, .22));
}

.dna-point-change > .dna-point-sign,
.dna-point-change > span:last-child {
    color: #fff0da;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dna-point-change > .dna-point-sign {
    flex: 0 0 auto;
    margin-right: -2px;
    font-size: var(--dna-value-size, 24px);
    font-weight: 800;
    line-height: 1;
}

.training-point-gain[data-result-type="deduction"] .dna-point-sign,
.board-feedback-card.incorrect .dna-point-sign {
    color: var(--accent);
}

.board-point-gain > header small,
.report-dna-mini header small,
.report-dna-share,
.board-point-gain .board-point-row.increased .board-point-delta {
    color: var(--accent-ink);
}

.board-point-meter b,
.board-point-meter b.loss,
.board-feedback-progress .board-point-meter b.loss,
.report-dna-mini-stat > i .dna-meter-increase,
.report-dna-mini-stat > i .dna-meter-decrease {
    background: var(--accent-soft);
    animation: none;
}

.board-point-meter b,
.board-point-meter b.loss,
.board-feedback-progress .board-point-meter b.loss {
    clip-path: inset(0 calc(100% - var(--point-segment-end, 100%)) 0 var(--point-segment-start, 0%) round 0 999px 999px 0);
}

.board-point-meter b::after,
.board-point-meter b.loss::after {
    content: none;
    animation: none;
}

.board-feedback-overlay {
    border-color: #dca39e;
    border-radius: 14px;
    background: rgba(255, 240, 238, .98);
    box-shadow: 0 18px 45px rgba(52, 43, 36, .13);
    color: #b7453e;
}

.board-feedback-card,
.board-feedback-card.incorrect {
    border-color: #e6bbb6;
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(216, 86, 79, .09), transparent 58%), #fff7f5;
    color: var(--ink);
}

.board-feedback-card > header {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.board-feedback-card > header.no-deduction {
    grid-template-columns: minmax(0, 1fr) auto;
}

.mobile-reveal-results {
    display: none;
}

.puzzle-try-again-fox-row {
    display: flex;
    justify-content: center;
    margin: 7px 0 -5px;
}

.puzzle-try-again-fox {
    display: block;
    width: 140px;
    height: 140px;
    object-fit: contain;
}

@media(max-width:720px) {
    .mobile-reveal-results:not([hidden]) {
        display: grid;
        gap: 10px;
        margin: 12px 0 calc(62px + env(safe-area-inset-bottom));
    }

    .mobile-reveal-results > .puzzle-explanation {
        width: 100%;
        margin: 0;
        padding: 12px;
        border-radius: 13px;
        box-shadow: none;
    }

    .board-feedback-card > header {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 6px;
    }

    .board-feedback-card > header.no-deduction {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .puzzle-try-again-fox {
        width: 120px;
        height: 120px;
    }
}

.board-feedback-card > header > span,
.board-feedback-card .board-feedback-total {
    background: var(--red);
    color: #fffdfa;
}

.board-feedback-card > header > .board-feedback-total-wrap {
    background: #fff0ee;
    color: var(--red);
    box-shadow: inset 0 0 0 1px #dfaba5;
}

.board-feedback-card .board-feedback-total-wrap .board-feedback-total {
    display: inline;
    min-width: 0;
    height: auto;
    padding: 0;
    background: transparent;
    color: var(--red);
}

.share-dna-value {
    --dna-value-size: 17px;
    color: var(--accent-ink);
}

.share-preview-level .share-dna-value > strong {
    color: var(--accent-ink);
    font-weight: 800;
}

.board-feedback-close {
    border-color: #dfaba5;
    background: #fff0ee;
    color: var(--red);
}

.board-feedback-boxes > div {
    border-color: #edd2cf;
    background: #fff0ee;
}

.lesson-jump {
    border-color: var(--line);
    border-radius: 14px;
    background: rgba(255, 253, 250, .94);
    backdrop-filter: blur(14px);
}

.lesson-jump button.active {
    border-color: #dfa395;
    background: linear-gradient(180deg, #fff0eb, #fff0eb);
    box-shadow: inset 0 1px rgba(255, 255, 255, .06), 0 3px 0 #fffdfa, 0 8px 15px rgba(52, 43, 36, .077);
    color: var(--ink);
    text-shadow: none;
}

.lesson-jump button.done:not(.active),
.lesson-jump button.next-ready {
    background: #fff0eb;
    color: var(--accent-ink);
}

.moment-card,
.moment-card:nth-child(n) {
    border-color: #d7d0c8;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(49, 100, 244, .065), transparent 52%), #fffdfa;
    color: var(--ink);
}

.moment-number i,
.move-chip {
    border-color: var(--line-hi);
    background: #fffdfa;
    color: var(--ink);
}

.reason-summary,
.moment-card > p,
.lesson-reveal .explanation {
    color: #68615c !important;
}

.puzzle-feedback.correct {
    background: #eefaf6;
    color: var(--cyan) !important;
}

.puzzle-feedback.incorrect {
    background: var(--red-soft);
    color: #b7453e !important;
}

@media(max-width:360px) {
    .board-feedback-card > header {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    .board-feedback-card > header.no-deduction {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .board-feedback-card > header > div {
        min-width: 0;
    }

    .board-feedback-card > header strong {
        font-size: 15px;
    }

    .puzzle-try-again-fox {
        width: 96px;
        height: 96px;
    }
}

.board-feedback-card:has(> header.no-deduction) {
    padding: 18px;
}

.board-feedback-card:has(> header.no-deduction) > header {
    gap: 12px;
}

.board-feedback-card:has(> header.no-deduction) > header small {
    font-size: 10px;
    line-height: 1.2;
}

.board-feedback-card:has(> header.no-deduction) > header strong {
    margin-top: 4px;
    font-size: 22px;
    line-height: 1.08;
}

.board-feedback-card:has(> header.no-deduction) > header .board-feedback-close {
    width: 44px;
    height: 44px;
    font-size: 26px;
}

.board-feedback-card:has(> header.no-deduction) > p {
    margin: 14px 0 2px;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.4;
}

@media(max-width:720px) {
    .board-feedback-card:has(> header.no-deduction) {
        padding: 16px;
    }

    .board-feedback-card:has(> header.no-deduction) > header .board-feedback-close {
        width: 48px;
        height: 48px;
    }
}

.puzzle-feedback.answer,
.puzzle-feedback.hint {
    background: #fff7dd;
    color: #8a6b18 !important;
}

.puzzle-explanation {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    margin: 0;
    padding: 15px;
    border-color: #ead39a;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(234, 118, 95, .08), transparent 58%), #fff7dd;
    color: #6f5b23;
}

.puzzle-explanation[hidden] {
    display: none;
}

.puzzle-explanation-fox {
    display: block;
    width: 76px;
    height: 76px;
    object-fit: contain;
}

.puzzle-explanation-lock {
    display: block;
    width: 76px;
    height: 76px;
    object-fit: contain;
    filter: drop-shadow(0 7px 7px rgba(173, 75, 20, .2));
}

.puzzle-explanation-lock[hidden] {
    display: none;
}

.puzzle-explanation-body {
    min-width: 0;
}

.puzzle-explanation-body > p {
    margin: 0;
    color: #6f5b23;
    font-size: 13px;
    line-height: 1.52;
}

.puzzle-explanation-locked {
    position: relative;
    min-height: 112px;
    overflow: hidden;
    border: 1px solid rgba(196, 137, 51, .28);
    border-radius: 12px;
    background: rgba(255, 253, 246, .7);
}

.puzzle-explanation-locked[hidden] {
    display: none;
}

.puzzle-explanation-locked > p {
    margin: 0;
    padding: 13px;
    color: #7b6a43;
    font-size: 12px;
    line-height: 1.5;
    filter: blur(3.5px);
    opacity: .58;
    user-select: none;
}

.puzzle-explanation-lock-message {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    background: radial-gradient(circle at 50% 50%, rgba(255, 250, 235, .96) 0 38%, rgba(255, 250, 235, .76) 72%, rgba(255, 250, 235, .38));
    color: var(--ink);
    text-align: center;
}

.puzzle-explanation-lock-message strong {
    font: 800 15px/1.1 var(--serif);
}

.puzzle-explanation-lock-message span {
    color: #6f5b23;
    font-size: 10px;
}

.puzzle-explanation-lock-message button {
    margin-top: 4px;
    padding: 7px 11px;
    border: 1px solid #cf674e;
    border-radius: 9px;
    background: linear-gradient(180deg, #fffdf8, #ffd9c5);
    box-shadow: 0 3px 0 #bd5b49;
    color: #9c3927;
    font: 850 10px/1 var(--sans);
    cursor: pointer;
}

.puzzle-explanation-lock-message button:hover,
.puzzle-explanation-lock-message button:focus-visible {
    background: #fff;
    outline: 3px solid rgba(234, 118, 95, .24);
    outline-offset: 2px;
}

.puzzle-explanation-loading {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    color: #5f5954;
    font-size: 12px;
}

.puzzle-explanation-loading[hidden] {
    display: none;
}

.puzzle-explanation-loading > span {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border: 3px solid #eadbd3;
    border-top-color: var(--accent-deep);
    border-radius: 50%;
    animation: puzzle-explanation-spin .75s linear infinite;
}

.puzzle-explanation-retry {
    justify-self: start;
    padding: 7px 10px;
    border: 1px solid #d9a295;
    border-radius: 9px;
    background: #fff0eb;
    color: var(--accent-ink);
    font: 750 11px/1 var(--sans);
    cursor: pointer;
}

@keyframes puzzle-explanation-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
    .puzzle-explanation {
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 9px;
    }

    .puzzle-explanation-fox {
        width: 62px;
        height: 62px;
    }

    .puzzle-explanation-lock {
        width: 62px;
        height: 62px;
    }

    .board-paper > .puzzle-explanation:not(.in-mobile-modal) {
        margin: 11px 0 calc(62px + env(safe-area-inset-bottom));
        padding: 12px;
        border-radius: 13px;
    }

    .report-dna-mini.mobile-modal-open > .puzzle-explanation {
        margin: 0 0 11px;
        padding: 12px;
        border-radius: 13px;
        box-shadow: none;
    }

    .report-dna-mini.mobile-modal-open > .puzzle-explanation .puzzle-explanation-body > p {
        font-size: 12px;
        line-height: 1.45;
    }
}

@media (max-width: 360px) {
    .puzzle-explanation {
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .puzzle-explanation-fox {
        width: 54px;
        height: 54px;
    }

    .puzzle-explanation-lock {
        width: 54px;
        height: 54px;
    }
}

.is-coach-report .report-hero {
    max-width: none;
    text-align: center;
}

.is-coach-report .report-hero #report-matchup {
    justify-content: center;
}

.board-arrow-layer .coach-better-arrow {
    stroke: #078b74;
    stroke-width: 1.8;
    stroke-dasharray: 4 2;
}

.is-coach-report .board-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 0;
    color: var(--ink);
}

.is-coach-report .board-legend[hidden] {
    display: none;
}

.is-coach-report .board-legend span {
    justify-content: center;
    min-height: 44px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-raised);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.is-coach-report .board-legend i {
    width: 34px;
    height: 3px;
    flex: none;
    border-radius: 0;
}

.is-coach-report .legend-played {
    background: repeating-linear-gradient(90deg, var(--red) 0 6px, transparent 6px 10px);
}

.is-coach-report .legend-better {
    background: repeating-linear-gradient(90deg, #078b74 0 6px, transparent 6px 10px);
}

@media (max-width: 340px) {
    .is-coach-report .board-legend {
        grid-template-columns: 1fr;
    }
}

.better-move,
.lesson-reveal,
.explore-game {
    border-color: var(--line);
}

.better-move strong,
.better-icon {
    color: var(--accent-ink);
}

.better-icon {
    background: #fff0eb;
}

.lesson-note {
    border-color: #ddca82;
    border-radius: 12px;
    background: #fff7dd;
    color: #715a19;
    transform: none;
}

.board-controls button {
    border-color: var(--line-hi);
    background: #fffaf5;
    color: var(--ink);
}

.board-controls button:hover {
    background: #fff0eb;
}

.workout-panel {
    border-color: #c4bbb2;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(234, 118, 95, .08), transparent 48%), #fffaf5;
}

.workout-step,
.workout-step.lesson-step,
.workout-step.final-step {
    border-color: var(--line);
    border-radius: 14px;
    background: #fffdfa;
    color: var(--ink);
}

.workout-step.lesson-step {
    background: linear-gradient(145deg, rgba(255, 211, 100, .09), transparent), #fffbeb;
}

.workout-step.final-step {
    background: linear-gradient(145deg, rgba(49, 100, 244, .15), transparent), #f6f4ff;
}

/* Dialogs and overlays */
dialog,
.account-dialog,
.share-dialog,
.training-summary-dialog,
.training-break-dialog,
.puzzle-workout-summary {
    color-scheme: light;
}

.account-dialog,
.share-dialog,
.training-summary-dialog,
.training-break-dialog,
.puzzle-workout-summary {
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: 0 34px 100px rgba(52, 43, 36, .18);
    color: var(--ink);
}

.account-dialog::backdrop,
.share-dialog::backdrop,
.training-summary-dialog::backdrop,
.training-break-dialog::backdrop,
.puzzle-workout-summary::backdrop {
    background: rgba(34, 33, 31, .44);
    backdrop-filter: blur(10px) saturate(.78);
}

dialog[open] {
    animation: reframe-dialog-in .2s cubic-bezier(.22, 1, .36, 1);
}

@keyframes reframe-dialog-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.account-dialog-head,
.share-dialog-head {
    border-color: var(--line);
}

.account-dialog-head h2,
.share-dialog-head h2,
.training-summary-dialog h2,
.puzzle-workout-summary h2 {
    color: var(--ink);
    font-family: var(--display);
    font-weight: 850;
}

.account-close,
.share-dialog-close,
.report-dna-close {
    width: 40px;
    height: 40px;
    border-color: var(--line);
    border-radius: 999px;
    background: var(--paper-strong);
    color: var(--ink-soft);
}

.account-close:hover,
.share-dialog-close:hover,
.report-dna-close:hover {
    border-color: var(--accent-soft);
    background: var(--accent-pale);
    color: var(--accent-ink);
}

.account-tabs {
    gap: 5px;
    padding: 6px;
    border-color: var(--line);
    border-radius: 999px;
    background: var(--paper-strong);
}

.account-tabs button,
.training-account-dialog .account-tabs button {
    min-height: 43px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
}

.account-tabs button.active,
.training-account-dialog .account-tabs button.active {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 6px 16px rgba(207, 89, 68, .14);
    color: var(--ink);
}

.account-form > p,
.account-form label small,
.account-signed-in p,
.share-privacy,
.account-page-copy {
    color: var(--muted);
}

.account-signed-in .account-check {
    background: #eefaf6;
    color: var(--cyan);
}

.share-card-preview,
.rhythm-share-preview {
    border-color: var(--line);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(234, 118, 95, .07), transparent 58%), var(--paper-strong);
    box-shadow: none;
}

.share-preview-head h3,
.rhythm-share-preview-head h3,
.share-preview-level b {
    color: var(--ink);
}

.share-preview-head > div:first-child small,
.rhythm-share-preview-head small,
.share-card-preview footer,
.rhythm-share-preview footer,
.share-account-button {
    color: var(--accent-ink);
}

.share-evidence,
.rhythm-share-summary {
    border-color: var(--line);
}

.rhythm-share-summary span {
    border-color: var(--line);
    background: #fffdfa;
}

.report-dna-mini,
.report-dna-mini.mobile-modal-open,
.training-result-dna.mobile-modal-open {
    border-color: var(--line);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(234, 118, 95, .08), transparent 48%), #fffdfa;
    color: var(--ink);
}

.mobile-dna-backdrop {
    background: rgba(34, 33, 31, .44);
    backdrop-filter: blur(7px);
}


.lesson-loader {
    background: rgba(34, 33, 31, .48);
    backdrop-filter: blur(12px);
}

.lesson-loader-card {
    border-color: #cec5bc;
    background: linear-gradient(150deg, #fffdfa, #f8f3ed);
}

.loader-board {
    border-color: #ddd6cf;
    border-radius: 15px;
    background: repeating-conic-gradient(#667b8d 0 25%, #f0e4d2 0 50%) 0 / 34px 34px;
    color: var(--ink);
    box-shadow: 0 9px 22px rgba(52, 43, 36, .093);
}

.toast {
    right: 18px;
    bottom: 18px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 253, 250, .96);
    color: var(--ink);
    box-shadow: 0 16px 42px rgba(52, 43, 36, .13);
    backdrop-filter: blur(12px);
}

/* Puzzle workout controls */
.puzzle-workout-setup {
    border-color: #d4ccc4;
    background: linear-gradient(145deg, rgba(49, 100, 244, .08), transparent 58%), var(--surface);
}

.puzzle-workout-bar,
.training-session-bar {
    border-color: #d4ccc4;
    border-radius: 14px;
    background: rgba(255, 253, 250, .94);
    box-shadow: inset 0 1px rgba(255, 255, 255, .035), 0 10px 28px rgba(52, 43, 36, .074);
}

.puzzle-workout-bar > div:first-child span,
.training-session-bar > div:first-child span,
.puzzle-workout-actions button,
.training-session-actions a {
    color: var(--accent-ink);
}

.puzzle-workout-paused {
    border-color: #cec5bc;
    border-radius: 20px;
    background: linear-gradient(150deg, #fffdfa, #f8f3ed);
    color: var(--ink);
}

.puzzle-workout-paused::before {
    background: rgba(34, 33, 31, .44);
}

.puzzle-workout-summary-stats div,
.training-summary-stats div {
    border-color: var(--line);
    border-radius: 12px;
    background: #f8f3ed;
}

.puzzle-workout-summary-stats strong,
.training-summary-stats strong {
    color: var(--accent-ink);
}

.training-summary-stats .training-summary-dna-value {
    --dna-value-size: 29px;
    display: inline-flex;
}

/* Legacy /dna training workspace */
.training-hero {
    max-width: 1120px;
}

.training-hero-copy h1 {
    color: var(--ink);
    font-family: var(--display);
    font-weight: 860;
}

.training-hero-copy h1 em {
    color: var(--accent-ink);
    font-style: normal;
}

.training-launch-card {
    border-color: #cec5bc;
    background: linear-gradient(145deg, rgba(234, 118, 95, .09), transparent 58%), var(--surface);
}

.duration-options button {
    border-color: #d7d0c8;
    border-radius: 11px;
    background: #f8f3ed;
    color: var(--ink);
}

.duration-options button.active,
.duration-options button:focus-visible {
    border-color: #d98b7c;
    background: #fff0eb;
    box-shadow: inset 0 0 0 1px rgba(234, 118, 95, .2);
    color: var(--accent-ink);
}

.training-mode-grid button,
.training-mode-grid a {
    border-color: #d9d2cb;
    border-radius: 15px;
    background: #fffdfa;
    color: var(--ink);
}

.training-mode-grid button:hover,
.training-mode-grid button:focus-visible,
.training-mode-grid a:hover,
.training-mode-grid a:focus-visible {
    border-color: #dfa395;
    background: #fff0eb;
}

.training-mode-grid i,
.training-mode-grid > :nth-child(n) i {
    background: #fff0eb;
    color: var(--accent-ink);
}

.training-board-panel {
    border-color: #d7d0c8;
    border-radius: 17px;
    background: #f8f3ed;
}

.training-side-to-move {
    border-color: #cec5bc;
    background: #fffdfa;
    color: var(--ink);
}

.training-decision-panel {
    border-color: #d7d0c8;
}

.training-choice-list button {
    border-color: #d7d0c8;
    border-radius: 11px;
    background: #f8f3ed;
    color: var(--ink);
}

.training-choice-list button.active {
    border-color: #ddca82;
    background: #fff7dd;
}

.training-choice-list button.is-correct {
    border-color: rgba(7, 139, 116, .4);
    background: #eefaf6;
    color: var(--cyan);
}

.training-choice-list button.is-wrong {
    border-color: #dfaba5;
    background: var(--red-soft);
}

.selected-move,
.candidate-list {
    border-color: #cec5bc;
    border-radius: 11px;
    background: #fffaf5;
}

.candidate-list b {
    background: #e8e1d9;
}

.training-feedback {
    border-color: var(--line);
}

.training-board-panel > .training-point-gain {
    background: #fffaf5;
}

.training-break-dialog h2 {
    color: var(--ink);
}

/* Legal, account, and footer */
.legal-page {
    max-width: 900px;
}

.legal-page h1,
.account-page-card h1 {
    color: var(--ink);
    font-family: var(--display);
    font-weight: 860;
}

.legal-page .legal-intro,
.legal-page section p,
.deletion-summary ul,
.deletion-form-card > p {
    color: #68615c;
}

.legal-page section {
    border-radius: 17px;
}

.deletion-form-card {
    border-color: #dca39e !important;
    background: linear-gradient(145deg, rgba(216, 86, 79, .075), transparent 58%), #fff7f5 !important;
}

.deletion-button {
    --button-edge: #a83934;
    --button-shadow: rgba(168, 57, 52, .2);
    border-color: #b7453e;
    border-radius: 12px;
    background: linear-gradient(180deg, #e36b63, #c9453f);
    box-shadow: inset 0 1px rgba(255, 255, 255, .35), 0 4px 0 #a83934;
    color: #fffdfa;
    font-weight: 850;
}

.deletion-button:hover,
.deletion-button:focus-visible {
    background: linear-gradient(180deg, #b7453e, #b7453e);
}

.site-footer,
.comparison-footer {
    width: min(1120px, calc(100% - 32px));
    max-width: none;
    border-color: var(--line);
    color: var(--muted);
}

.site-footer .wordmark,
.comparison-footer .wordmark {
    color: var(--ink);
}

.maker-credit {
    border-color: #dfa395;
    background: rgba(255, 253, 250, .96);
    box-shadow: 0 12px 30px rgba(52, 43, 36, .093);
    color: var(--ink);
    backdrop-filter: blur(12px);
}

.maker-credit-copy small,
.maker-credit-arrow {
    color: var(--accent-ink);
}

/* Comparisons */
.comparison-index-hero h1,
.comparison-article-hero h1,
.comparison-method h2,
.comparison-directory h2,
.comparison-article h2,
.comparison-related h2,
.comparison-card h3,
.comparison-choice h3 {
    color: var(--ink);
    font-family: var(--display);
    font-weight: 840;
}

.comparison-breadcrumbs a,
.comparison-card-names,
.comparison-read,
.comparison-byline a,
.comparison-pick-grid span,
.comparison-sources li a,
.comparison-related article > span,
.comparison-related article > a,
.comparison-all-link {
    color: var(--accent-ink);
}

.comparison-method,
.comparison-article-hero,
.comparison-related,
.comparison-faq details {
    border-color: var(--line);
}

.comparison-card,
.comparison-choice,
.comparison-related article {
    border-color: #d9d2cb;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--card-accent), transparent 48%), var(--surface);
    box-shadow: inset 0 1px rgba(255, 255, 255, .03), var(--shadow-soft);
}

.comparison-card::before,
.comparison-article-hero::before {
    opacity: .14;
    filter: blur(4px);
}

.comparison-card-names i {
    border-color: var(--line-hi);
    background: #fffdfa;
}

.comparison-card dl div,
.comparison-pick-grid > div,
.comparison-choice-grid > div,
.comparison-choice-grid > div:last-child {
    border-color: var(--line);
    background: #f8f3ed;
}

.comparison-quick-answer {
    border-color: #e2aea3;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(234, 118, 95, .1), transparent 58%), var(--surface);
}

.comparison-deck,
.comparison-prose p:not(.eyebrow) {
    color: #68615c;
}

.comparison-table-wrap {
    border-color: var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.comparison-table-section th,
.comparison-table-section td {
    border-color: var(--line);
}

.comparison-table-section thead th,
.comparison-table-section tbody th {
    background: #f8f3ed;
    color: var(--ink);
}

.comparison-disclosure,
.comparison-together {
    border-color: #ddca82;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255, 211, 100, .08), transparent), #fffbeb;
}

.comparison-disclosure p,
.comparison-together p:last-child {
    color: #6f675f;
}

.comparison-together > div:first-child {
    border-color: #d7c790;
    background: #f5f0e9;
    color: var(--accent-ink);
}

.comparison-sources {
    border-color: var(--line);
    border-radius: 16px;
    background: #f8f3ed;
}

.comparison-sources li a {
    border-color: var(--line-hi);
    background: #fffaf5;
}

.comparison-cta {
    border: 1px solid #d4ccc4;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(49, 100, 244, .15), transparent 55%), #f6f4ff;
}

.comparison-cta .secondary-button {
    background: #f6f4ff;
    color: var(--ink);
}

/* Compact choices keep their state colors while gaining a shallow, tactile edge. */
:where(
    .carousel-arrow,
    .puzzle-tools-toggle,
    .puzzle-branches button,
    .puzzle-mate-depths button,
    .puzzle-page-controls button,
    .puzzle-workout-durations button,
    .lesson-jump button,
    .board-controls button,
    .duration-options button,
    .training-mode-grid button,
    .training-mode-grid a,
    .training-choice-list button
) {
    --control-edge: #c8bdb2;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .72),
        0 2px 0 var(--control-edge),
        0 6px 11px rgba(52, 43, 36, .08);
    translate: 0 0;
    transition: background-color .12s ease, border-color .12s ease, box-shadow .08s ease, translate .08s ease;
}

:where(
    .carousel-arrow,
    .puzzle-tools-toggle,
    .puzzle-branches button,
    .puzzle-mate-depths button,
    .puzzle-page-controls button,
    .puzzle-workout-durations button,
    .lesson-jump button,
    .board-controls button,
    .duration-options button,
    .training-mode-grid button,
    .training-mode-grid a,
    .training-choice-list button
):active:not(:disabled) {
    box-shadow:
        inset 0 1px 3px rgba(52, 43, 36, .13),
        0 1px 0 var(--control-edge),
        0 3px 6px rgba(52, 43, 36, .07);
    translate: 0 1px;
}

.puzzle-branches button.active,
.puzzle-mate-depths button.active,
.puzzle-page-controls button[aria-current="page"],
.puzzle-workout-durations button.active,
.lesson-jump button.active,
.duration-options button.active,
.training-choice-list button.active {
    --control-edge: #c45742;
}

.training-choice-list button.is-correct {
    --control-edge: #077461;
}

.training-choice-list button.is-wrong {
    --control-edge: #a93f38;
}

/* Responsive */
@media (max-width: 900px) {
    .site-header {
        top: 7px;
        width: calc(100% - 16px);
        margin-top: 7px;
    }

    .site-header nav a,
    .site-header nav button {
        padding-inline: 10px;
        font-size: 11px;
    }

    .hero,
    .directory-hero {
        width: calc(100% - 16px);
        padding-top: 48px;
    }

    .hero::after,
    .directory-hero::after {
        right: -2%;
        font-size: 240px;
    }

    .progress-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .analysis-layout {
        gap: 16px;
    }
}

@media (max-width: 760px) {
    body.view-puzzles .directory-hero.puzzle-directory-hero {
        padding-inline: 10px;
    }

    body:is(.view-home, .view-puzzles, .view-progress) .site-header nav:not(.open),
    .training-page .site-header nav:not(.open),
    .coach-site .site-header nav:not(.open) {
        display: none;
    }

    body:is(.view-home, .view-puzzles, .view-progress) .site-header nav.open,
    .training-page .site-header nav.open,
    .coach-site .site-header nav.open {
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + 8px);
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        padding: 8px;
        border: 1px solid #d4ccc4;
        border-radius: 16px;
        background: rgba(255, 253, 250, .98);
        box-shadow: 0 22px 55px rgba(52, 43, 36, .161);
        backdrop-filter: blur(18px);
    }

    body:is(.view-home, .view-puzzles, .view-progress) .site-header nav.open a,
    body:is(.view-home, .view-puzzles, .view-progress) .site-header nav.open button,
    .training-page .site-header nav.open a,
    .training-page .site-header nav.open button,
    .coach-site .site-header nav.open a,
    .coach-site .site-header nav.open button {
        width: 100%;
        min-height: 46px;
        padding-inline: 8px;
        justify-content: center;
    }

    .nav-toggle {
        display: grid;
        place-items: center;
        padding: 7px 11px;
    }

    body.view-puzzles.is-menu-free-practice-tab .site-header nav:not(.open) {
        position: static;
        display: flex;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    body.view-puzzles.is-menu-free-practice-tab .site-header nav:not(.open) > a,
    body.view-puzzles.is-menu-free-practice-tab .nav-toggle {
        display: none;
    }

    .comparison-site .site-header,
    .legal-site .site-header,
    .account-deletion-site .site-header {
        flex-wrap: wrap;
    }

    .comparison-site .site-header nav,
    .legal-site .site-header nav,
    .account-deletion-site .site-header nav {
        position: static;
        display: flex;
        order: 3;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        overflow: visible;
        scrollbar-width: none;
    }

    .comparison-site .site-header nav::-webkit-scrollbar,
    .legal-site .site-header nav::-webkit-scrollbar,
    .account-deletion-site .site-header nav::-webkit-scrollbar {
        display: none;
    }

    .comparison-site .site-header nav a,
    .legal-site .site-header nav a,
    .account-deletion-site .site-header nav a {
        flex: none;
        min-height: 34px;
        padding-inline: 8px;
    }

    .hero,
    .directory-hero {
        padding: 42px 18px 26px;
    }

    .hero h1,
    .directory-hero h1 {
        font-size: clamp(45px, 14vw, 68px);
    }

    .hero::after,
    .directory-hero::after {
        display: none;
    }

    .analyzer-wrap {
        padding-inline: 10px;
    }

    body.view-puzzles .site-header,
    body.view-puzzles .home-hub-tabs-wrap {
        width: calc(100% - 20px);
    }

    .analyzer-card {
        padding-inline: 16px;
    }

    .input-tabs,
    .puzzle-mode-tabs {
        margin-inline: -16px;
    }

    .progress-page {
        padding-inline: 10px;
    }

    .progress-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .comparison-index-hero,
    .comparison-article,
    .comparison-related,
    .comparison-method,
    .comparison-directory,
    .comparison-disclosure,
    .comparison-not-found {
        width: calc(100% - 20px);
    }

    .site-footer,
    .comparison-footer {
        width: calc(100% - 20px);
    }
}

@media (max-width: 620px) {
    dialog[open] {
        animation-name: reframe-dialog-mobile-in;
    }

    .site-header {
        position: relative;
        top: auto;
        min-height: 58px;
        padding: 7px;
        border-radius: var(--radius-header-mobile);
    }

    .brand-mark {
        width: auto;
        height: 45px;
        border-radius: 0;
    }

    .wordmark {
        gap: 8px;
        font-size: 20px;
    }

    .home-hub-tabs-wrap {
        position: fixed;
        z-index: 230;
        right: max(8px, env(safe-area-inset-right));
        bottom: max(8px, env(safe-area-inset-bottom));
        left: max(8px, env(safe-area-inset-left));
        width: auto;
        margin: 0;
        padding: 0;
    }

    .home-hub-tabs {
        gap: 2px;
        padding: 5px;
        overflow: visible;
        border-color: rgba(207, 197, 188, .94);
        border-radius: 21px;
        background: rgba(255, 253, 250, .96);
        box-shadow: 0 16px 42px rgba(52, 43, 36, .22), inset 0 1px rgba(255, 255, 255, .92);
        backdrop-filter: blur(18px) saturate(1.25);
    }

    .home-hub-tabs a {
        min-height: 60px;
        margin: 0;
        padding: 5px 1px 4px;
        grid-template-columns: 1fr;
        grid-template-rows: 32px auto;
        row-gap: 2px;
        align-items: center;
        justify-items: center;
        border-color: transparent;
        border-radius: var(--radius-card-mobile);
        background: transparent;
        box-shadow: none;
        translate: 0 0;
    }

    .home-hub-tab-icon {
        width: 32px;
        height: 32px;
    }

    .home-hub-tabs a > span {
        font-size: 9px;
        line-height: 1;
    }

    .home-hub-tabs a:hover,
    .home-hub-tabs a:focus-visible {
        border-color: #d9cec5;
        background: #fffaf5;
        box-shadow: none;
        translate: 0 0;
    }

    .home-hub-tabs a.active {
        border-color: #b94d39;
        background: var(--accent);
        box-shadow: inset 0 1px rgba(255, 255, 255, .62), 0 4px 0 #b94d39, 0 9px 16px rgba(185, 77, 57, .24);
        translate: 0 -6px;
    }

    .home-hub-tabs a.active:hover,
    .home-hub-tabs a.active:focus-visible {
        box-shadow: inset 0 1px rgba(255, 255, 255, .68), 0 4px 0 #b94d39, 0 10px 18px rgba(185, 77, 57, .27);
        translate: 0 -7px;
    }

    .home-hub-tabs a:active,
    .home-hub-tabs a.active:active {
        box-shadow: inset 0 2px 3px rgba(52, 43, 36, .14), 0 1px 0 #b94d39, 0 4px 8px rgba(52, 43, 36, .12);
        translate: 0 -2px;
    }

    body:is(.view-puzzles, .view-path, .training-page, .coach-site, .arcade-page, .battle-page, .play-page) {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    body:is(.view-puzzles, .view-path).has-report,
    body.is-quick-puzzle,
    body.is-puzzle-workout-active,
    body.training-page.is-training-active,
    body.arcade-page.is-playing,
    body.battle-page.is-playing,
    body.play-page.is-playing {
        padding-bottom: 0;
    }

    .home-hub-tabs a > small {
        font-size: 7px;
        letter-spacing: .03em;
        line-height: 1.05;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .capability-strip {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .hero > p:last-child,
    .directory-hero > p:last-child {
        font-size: 16px;
    }

    .paper-card,
    .analyzer-card,
    .legal-page section,
    .account-page-card {
        border-radius: var(--radius-card-mobile);
    }

    .game-library {
        gap: 8px;
    }

    .puzzle-card,
    .puzzle-card:nth-child(n),
    .quick-puzzle {
        border-radius: 13px;
    }

    .puzzle-branches button {
        min-height: 58px;
    }

    .report-shell {
        padding-inline: 7px;
    }

    .board-paper {
        padding: 7px;
        border-radius: 15px;
    }

    .chessboard {
        border-width: 5px;
        border-radius: 10px;
    }

    .puzzle-board-prompt {
        border-radius: 10px;
    }

    .puzzle-sticky-actions .button {
        border-radius: 12px;
    }

    .account-dialog,
    .share-dialog,
    .training-summary-dialog,
    .training-break-dialog,
    .puzzle-workout-summary {
        width: calc(100% - 12px);
        max-width: calc(100% - 12px);
        max-height: calc(100dvh - 20px);
        margin: auto auto max(10px, env(safe-area-inset-bottom));
        border-radius: 26px 26px 20px 20px;
    }

    .account-dialog {
        width: min(440px, calc(100% - 24px));
        max-width: calc(100% - 24px);
    }

    .share-actions,
    .account-tabs {
        gap: 6px;
    }

    .toast {
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        text-align: center;
    }

    .legal-page {
        margin-top: 32px;
        padding-inline: 12px;
    }

    .progress-share-sticky {
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: auto;
        transform: none;
    }

    .maker-credit {
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
    }
}

@keyframes reframe-dialog-mobile-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 420px) {
    .wordmark span {
        font-size: inherit;
    }

    .site-header-actions {
        gap: 5px;
    }

    .site-header nav .pwa-install-button {
        max-width: none;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hero,
    .directory-hero {
        padding-inline: 12px;
    }

    .hero h1,
    .directory-hero h1,
    .view-home .hero h1 {
        font-size: clamp(43px, 14.5vw, 58px);
    }

    .analysis-options {
        gap: 9px;
    }

    .progress-kpis article {
        min-height: 108px;
        padding: 14px;
    }

    .puzzle-tools,
    .puzzle-pagination {
        border-radius: 12px;
    }

    .share-card-preview,
    .rhythm-share-preview {
        border-radius: 13px;
    }
}

@media (max-width: 350px) {
    .nav-account-button.is-authenticated {
        width: auto;
        min-width: 66px;
        padding: 6px 9px 6px 6px;
    }

    .nav-account-button.is-authenticated .nav-account-avatar {
        display: none;
    }

    .nav-account-button.is-authenticated .nav-account-label {
        display: inline;
        font-size: var(--dna-value-size);
    }

    .nav-account-button.is-authenticated .nav-dna-value {
        --dna-value-size: 19px;
    }

    .nav-dna-icon {
        margin-left: 0;
    }
}

/* Private operations workspace: same palette, denser information hierarchy. */
.admin-body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
}

.admin-login-body {
    background-image:
        linear-gradient(rgba(234, 118, 95, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(234, 118, 95, .055) 1px, transparent 1px);
}

.admin-sidebar {
    border-right-color: #171513;
    background: #292521;
}

.admin-nav a:hover,
.admin-nav a:focus-visible {
    background: #403934;
}

.admin-nav a.is-active {
    border-color: var(--accent-deep);
    background: var(--accent);
    box-shadow: inset 3px 0 var(--accent-deep);
    color: var(--ink);
}

.admin-nav a.is-active > strong {
    color: #5d2c24;
}

.admin-search button,
.admin-login-form button,
.admin-report-detail header a,
.admin-puzzle-upload-form button,
.admin-puzzle-import-form button,
.admin-generator-start button,
.admin-notification-compose > button {
    color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
    dialog[open] {
        animation: none;
    }

    .puzzle-explanation-loading > span {
        animation: none;
    }

    .button,
    .nav-account-button,
    :where(
        .carousel-arrow,
        .puzzle-tools-toggle,
        .puzzle-branches button,
        .puzzle-mate-depths button,
        .puzzle-page-controls button,
        .puzzle-workout-durations button,
        .lesson-jump button,
        .board-controls button,
        .duration-options button,
        .training-mode-grid button,
        .training-mode-grid a,
        .training-choice-list button
    ) {
        transition: none;
        translate: 0 0;
    }
}

/* Homepage puzzle previews mirror Coach's board-first cards. */
.game-library.quick-library .quick-puzzle {
    min-height: 0;
    padding: 7px;
}

.quick-puzzle-preview-board {
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    pointer-events: none;
}

.quick-puzzle-preview-board .board-square {
    cursor: pointer;
}

.quick-puzzle-preview-board .coord {
    display: none;
}

.quick-puzzle-preview-copy {
    display: grid;
    gap: 5px;
    padding: 9px 4px 4px;
    text-align: center;
}

.game-library.quick-library .quick-puzzle .quick-puzzle-tag {
    overflow: hidden;
    width: 100%;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-library.quick-library .quick-puzzle .game-reward {
    position: absolute;
    z-index: 2;
    top: 11px;
    right: 11px;
    bottom: auto;
    left: auto;
    overflow: visible;
    width: auto;
    max-width: calc(100% - 22px);
    padding: 3px 5px;
    border: 1px solid rgba(82, 73, 65, .12);
    border-radius: 999px;
    background: rgba(255, 253, 250, .7);
    box-shadow: 0 3px 9px rgba(52, 43, 36, .1);
    color: var(--accent-ink);
    font-size: 10px;
    line-height: 1.35;
    text-align: center;
    text-overflow: clip;
    white-space: nowrap;
    backdrop-filter: blur(5px);
}

.game-library.quick-library .quick-puzzle .game-reward .point-award-visual {
    width: auto;
    flex-wrap: nowrap;
    gap: 4px;
}

.game-library.quick-library .quick-puzzle .game-reward .point-domain-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
}

.game-library.quick-library .quick-puzzle.completed .game-reward {
    color: var(--cyan);
}

@media (max-width: 720px) {
    .game-library.quick-library .quick-puzzle {
        min-height: 0;
        padding: 6px;
    }

    .quick-puzzle-preview-copy {
        gap: 4px;
        padding: 8px 2px 3px;
    }

    .game-library.quick-library .quick-puzzle .quick-puzzle-tag,
    .game-library.quick-library .quick-puzzle .game-reward {
        font-size: 9px;
    }

    .game-library.quick-library .quick-puzzle .game-reward {
        top: 9px;
        right: 9px;
        max-width: calc(100% - 18px);
        padding: 3px 4px;
    }

    .game-library.quick-library .quick-puzzle .game-reward .point-domain-icon {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }
}

.puzzle-reward-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 11px 0 12px;
    padding: 5px 7px;
}

.puzzle-tools {
    grid-template-columns: minmax(210px, 1fr) 145px 140px 145px auto;
}

.puzzle-reward-filter-label {
    margin-right: 3px;
    color: #5f5954;
    font: 780 9px/1.2 var(--mono);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.puzzle-reward-filter {
    --reward-button-edge: #c5bbb2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 38px;
    padding: 5px;
    border: 1px solid var(--reward-button-edge);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff 0, #fff8f1 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 3px 0 var(--reward-button-edge), 0 6px 12px rgba(52, 43, 36, .09);
    cursor: pointer;
    transition: border-color .14s, box-shadow .14s, translate .14s;
}

.puzzle-reward-filter:hover,
.puzzle-reward-filter:focus-visible {
    --reward-button-edge: #d98b7c;
    border-color: var(--reward-button-edge);
    outline: 2px solid rgba(234, 118, 95, .24);
    outline-offset: 2px;
}

.puzzle-reward-filter.active {
    --reward-button-edge: #d45d48;
    background: linear-gradient(180deg, #fff0eb 0, #ffd9d0 100%);
    box-shadow: inset 0 2px 4px rgba(94, 50, 41, .12), 0 1px 0 var(--reward-button-edge);
    translate: 0 2px;
}

.puzzle-reward-filter:disabled {
    cursor: wait;
    opacity: .58;
}

@media (min-width: 721px) and (max-width: 1000px) {
    .puzzle-tools {
        grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(120px, .65fr));
    }

    .puzzle-tools .surprise-button {
        grid-column: 4;
    }
}

.puzzle-reward-filter .point-domain-icon {
    width: 27px;
    height: 27px;
}

@media (max-width: 720px) {
    .puzzle-reward-filters {
        justify-content: center;
        flex-wrap: wrap;
        gap: 7px;
        margin: 10px 0 12px;
        padding-inline: 2px;
    }

    .puzzle-tools {
        grid-template-columns: 1fr 1fr;
    }

    .puzzle-tools label:first-child {
        grid-column: 1 / -1;
    }

    .puzzle-tools .surprise-button {
        grid-column: 2;
    }

    .puzzle-reward-filter-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .puzzle-reward-filter {
        width: 35px;
        height: 34px;
    }

    .puzzle-reward-filter .point-domain-icon {
        width: 23px;
        height: 23px;
    }
}

@media (max-width: 420px) {
    .puzzle-tools {
        grid-template-columns: 1fr;
    }

    .puzzle-tools label:first-child,
    .puzzle-tools .surprise-button {
        grid-column: 1;
    }
}

/* Point rewards use compact skill emoji instead of repeating skill names. */
.point-award-visual,
.point-award-entry,
.point-domain-label {
    display: inline-flex;
    align-items: center;
}

.point-domain-label {
    gap: 6px;
}

.point-award-visual {
    justify-content: center;
    gap: 5px;
}

.point-award-entry {
    gap: 2px;
    white-space: nowrap;
}

.point-award-join {
    color: var(--muted);
}

.point-award-prefix {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.point-domain-icon {
    display: block;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    object-fit: contain;
}

.game-reward .point-domain-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
}

.game-reward .point-award-visual {
    display: flex;
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
}

.board-point-row .point-domain-label,
.report-dna-mini-stat .point-domain-label {
    min-width: 24px;
}

@media (max-width: 720px) {
    .game-reward .point-award-visual {
        gap: 2px 3px;
    }

    .game-reward .point-domain-icon {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
    }

    .game-reward .point-award-prefix {
        font-size: 20px;
    }
}
@media (max-width: 480px) {
    .home-hub-tabs {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        overflow: visible;
    }

    .home-hub-tabs a > span {
        font-size: 10px;
    }
}

@media (max-width: 360px) {
    .home-hub-tabs-wrap {
        right: max(2px, env(safe-area-inset-right));
        left: max(2px, env(safe-area-inset-left));
    }

    .home-hub-tabs {
        gap: 0;
        padding: 2px;
    }

    .home-hub-tabs a {
        min-width: 44px;
        padding-right: 0;
        padding-left: 0;
    }

    .home-hub-tabs a > span {
        font-size: 8px;
    }
}

/* Keep the desktop learning switcher compact without changing the mobile dock. */
@media (min-width: 621px) {
    .home-hub-tabs-wrap.home-hub-tabs-wrap {
        width: min(980px, calc(100% - 40px));
        margin-top: 10px;
    }

    .home-hub-tabs {
        gap: 4px;
        padding: 4px 4px 7px;
        border-radius: 17px;
    }

    .home-hub-tabs a {
        min-height: 0;
        margin-bottom: 3px;
        padding: 6px 10px;
        grid-template-rows: 36px auto;
        row-gap: 2px;
        border-radius: 13px;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, .84),
            0 3px 0 var(--hub-tab-edge),
            0 7px 13px var(--hub-tab-shadow);
    }

    .home-hub-tab-icon {
        width: 36px;
        height: 36px;
    }

    .home-hub-tabs a > span {
        font-size: 13px;
        line-height: 1.1;
    }

    .home-hub-tabs a.active {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, .58),
            0 3px 0 var(--hub-tab-edge),
            0 7px 13px var(--hub-tab-shadow);
    }

    .home-hub-tabs a:hover,
    .home-hub-tabs a:focus-visible {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, .88),
            0 4px 0 var(--hub-tab-edge),
            0 9px 16px var(--hub-tab-shadow);
    }

    .home-hub-tabs a:active {
        box-shadow:
            inset 0 1px 3px rgba(52, 43, 36, .14),
            0 1px 0 var(--hub-tab-edge),
            0 3px 6px var(--hub-tab-shadow);
        translate: 0 2px;
    }
}

/* Progress keeps activity, Rhythm, and Chess DNA visually distinct. */
.progress-activity-card{background:linear-gradient(145deg,rgba(117,87,214,.08),transparent 58%),var(--surface)}
.progress-activity-key{border-color:var(--line);background:#f8f3ed}
.progress-activity-chart{background:repeating-linear-gradient(to bottom,transparent 0 43px,rgba(130,123,117,.18) 43px 44px)}
.progress-recent-item{background:#f8f3ed}
.progress-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
.progress-activity-card{margin-bottom:10px}
.progress-dashboard-grid{grid-template-columns:minmax(260px,.75fr) minmax(0,1.65fr)}
.progress-rhythm-card{grid-column:1;grid-row:1}
.progress-domains-card{grid-column:2;grid-row:1}
@media(max-width:760px){.progress-dashboard-grid{grid-template-columns:1fr}.progress-activity-card,.progress-rhythm-card,.progress-domains-card{grid-column:1;grid-row:auto}}

/* Activity overview: a clear summary, multicolor timeline, and compact breakdown. */
.progress-activity-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border-color: var(--line);
    background:
        radial-gradient(circle at 96% 4%, rgba(234, 118, 95, .1), transparent 28%),
        linear-gradient(145deg, #fffdfa 0%, #faf6ef 100%);
    box-shadow: var(--shadow);
    color: var(--ink);
}

.progress-activity-card::after {
    position: absolute;
    right: -58px;
    bottom: -88px;
    width: 210px;
    height: 210px;
    border: 1px solid rgba(234, 118, 95, .08);
    border-radius: 50%;
    box-shadow: 0 0 0 26px rgba(234, 118, 95, .035), 0 0 0 52px rgba(234, 118, 95, .02);
    content: "";
    pointer-events: none;
}

.progress-activity-card > * {
    position: relative;
    z-index: 1;
}

.progress-activity-card .eyebrow {
    color: var(--red);
}

.progress-activity-card h2 {
    color: var(--ink);
    font-size: 29px;
}

.progress-activity-card > header {
    align-items: center;
}

.progress-activity-card > header > .progress-activity-period {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: var(--muted);
    font: 750 8px/1 var(--mono);
    letter-spacing: .04em;
}

.progress-activity-overview {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: stretch;
    gap: 23px;
    margin-top: 23px;
}

.progress-activity-total {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 17px 16px;
    border: 1px solid #efdcd5;
    border-radius: var(--radius-control);
    background: linear-gradient(145deg, #fff3ee, #fffaf6);
}

.progress-activity-total strong,
.progress-activity-total span,
.progress-activity-total small {
    display: block;
}

.progress-activity-total strong {
    color: var(--red);
    font: 800 54px/.82 var(--serif);
    letter-spacing: -.06em;
}

.progress-activity-total span {
    margin-top: 9px;
    color: var(--red);
    font: 800 9px/1 var(--mono);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.progress-activity-total small {
    margin-top: 8px;
    color: var(--muted);
    font-size: 8px;
    white-space: nowrap;
}

.progress-activity-plot {
    min-width: 0;
}

.progress-activity-card .progress-activity-chart {
    height: 132px;
    gap: 4px;
    margin: 0;
    padding: 10px 3px 0;
    border-bottom-color: var(--line);
    background: repeating-linear-gradient(to bottom, transparent 0 39px, rgba(130, 123, 117, .14) 39px 40px);
}

.progress-activity-card .progress-activity-day.today {
    background: linear-gradient(to top, rgba(234, 118, 95, .11), transparent 76%);
}

.progress-activity-card .progress-activity-bar {
    min-height: 3px;
    border-radius: 3px 3px 1px 1px;
    background: #e5dfd6;
}

.progress-activity-card .progress-activity-bar i {
    min-height: 2px;
    border-top: 1px solid rgba(255, 255, 255, .48);
    background: var(--activity-color);
}

.progress-activity-card .progress-activity-axis {
    margin-top: 7px;
    color: var(--muted);
}

.progress-activity-card .progress-activity-legend {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 13px;
    margin-top: 19px;
    padding-top: 17px;
    border-top: 1px solid var(--line);
}

.progress-activity-card .progress-activity-key {
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 9px;
}

.progress-activity-card .progress-activity-key i {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
    border: 1px solid color-mix(in srgb, var(--activity-color) 42%, white);
    border-radius: 8px;
    background: color-mix(in srgb, var(--activity-color) 10%, white);
    box-shadow: none;
    color: var(--ink);
    font-size: 12px;
}

.progress-activity-card .progress-activity-key b {
    color: var(--ink);
    font-size: 11px;
}

@media (max-width: 900px) {
    .progress-activity-card .progress-activity-legend {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .progress-activity-card {
        padding: 19px 17px;
    }

    .progress-activity-overview {
        grid-template-columns: 1fr;
        gap: 17px;
        margin-top: 20px;
    }

    .progress-activity-total {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr);
        align-items: end;
        justify-content: start;
        gap: 8px;
        padding: 13px 14px;
        border: 1px solid #efdcd5;
    }

    .progress-activity-total strong {
        font-size: 44px;
    }

    .progress-activity-total span {
        margin: 0 0 4px;
    }

    .progress-activity-total small {
        justify-self: end;
        margin: 0 0 3px;
    }

    .progress-activity-card .progress-activity-chart {
        height: 120px;
        gap: 3px;
        padding-inline: 2px;
    }

    .progress-activity-card .progress-activity-legend {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 15px;
    }
}

@media (max-width: 360px) {
    .progress-activity-card > header > .progress-activity-period {
        padding-inline: 7px;
        font-size: 7px;
    }

    .progress-activity-card .progress-activity-chart {
        gap: 2px;
    }
}

/* Progress board appearance */
.progress-appearance-card {
    display: grid;
    grid-template-columns: minmax(360px, .92fr) minmax(0, 1.08fr);
    gap: 26px;
    margin-bottom: 10px;
    padding: 24px;
    border-color: #d4ccc4;
    background: #fff;
}

.progress-appearance-preview-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    align-items: center;
    gap: 22px;
    min-width: 0;
}

.progress-appearance-heading h2 {
    margin: 4px 0 9px;
    font: 850 clamp(25px, 2.5vw, 35px)/1 var(--display);
    letter-spacing: -.045em;
}

.progress-appearance-heading > p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.progress-appearance-preview {
    width: 190px;
    container-type: inline-size;
    pointer-events: none;
}

.progress-appearance-preview .coord {
    display: none;
}

.progress-appearance-controls {
    display: grid;
    align-content: center;
    gap: 16px;
    min-width: 0;
}

.progress-appearance-controls fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.progress-appearance-controls legend {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.progress-theme-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.progress-piece-theme-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.progress-board-theme-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.progress-theme-options button {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 48px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #faf8f3;
    text-align: left;
}

.progress-theme-options button:hover,
.progress-theme-options button:focus-visible {
    border-color: var(--accent);
    background: #fff7f1;
    outline: 0;
}

.progress-theme-options button:focus-visible {
    box-shadow: 0 0 0 3px rgba(234, 118, 95, .2);
}

.progress-theme-options button[aria-pressed="true"] {
    border-color: #d36550;
    background: #fff0eb;
    box-shadow: inset 0 0 0 1px #d36550;
}

.progress-theme-options strong {
    min-width: 0;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
}

.progress-piece-sample,
.progress-board-swatch {
    display: grid;
    width: 32px;
    height: 32px;
    flex: none;
    place-items: center;
    border-radius: 8px;
}

.progress-piece-sample[data-piece-sample="classic"] {
    background: center / 28px 28px no-repeat url('/assets/pieces/classic/bN.svg');
}

.progress-piece-sample[data-piece-sample="chessnut"] { background: #e9e1d4 center / 28px 28px no-repeat url('/assets/pieces/chessnut/bN.svg'); }
.progress-piece-sample[data-piece-sample="rhosgfx"] { background: #e9e1d4 center / 28px 28px no-repeat url('/assets/pieces/rhosgfx/bN.svg'); }
.progress-piece-sample[data-piece-sample="fantasy"] { background: #e9e1d4 center / 28px 28px no-repeat url('/assets/pieces/fantasy/bN.svg'); }
.progress-piece-sample[data-piece-sample="celtic"] { background: #e9e1d4 center / 28px 28px no-repeat url('/assets/pieces/celtic/bN.svg'); }
.progress-piece-sample[data-piece-sample="spatial"] { background: #e9e1d4 center / 28px 28px no-repeat url('/assets/pieces/spatial/bN.svg'); }
.progress-piece-sample[data-piece-sample="merida"] { background: #e9e1d4 center / 28px 28px no-repeat url('/assets/pieces/merida/bN.svg'); }
.progress-piece-sample[data-piece-sample="papercut"] { background: #e9e1d4 center / 28px 28px no-repeat url('/assets/pieces/papercut/bN.svg'); }

.progress-board-swatch {
    border: 1px solid rgba(34, 35, 31, .18);
    background-size: 50% 50%;
}

.progress-board-swatch.is-slate { background: conic-gradient(#f0e4d2 25%, #667b8d 0 50%, #f0e4d2 0 75%, #667b8d 0); }
.progress-board-swatch.is-forest { background: conic-gradient(#e8ecd9 25%, #6e8b68 0 50%, #e8ecd9 0 75%, #6e8b68 0); }
.progress-board-swatch.is-walnut { background: conic-gradient(#ead7bd 25%, #9b6948 0 50%, #ead7bd 0 75%, #9b6948 0); }
.progress-board-swatch.is-plum { background: conic-gradient(#eee5ed 25%, #80647f 0 50%, #eee5ed 0 75%, #80647f 0); }
.progress-board-swatch.is-ocean { background: conic-gradient(#dceaf0 25%, #4d7f96 0 50%, #dceaf0 0 75%, #4d7f96 0); }
.progress-board-swatch.is-rose { background: conic-gradient(#f2dfe1 25%, #b66f79 0 50%, #f2dfe1 0 75%, #b66f79 0); }
.progress-board-swatch.is-sand { background: conic-gradient(#f1e7c9 25%, #b39358 0 50%, #f1e7c9 0 75%, #b39358 0); }
.progress-board-swatch.is-midnight { background: conic-gradient(#ccd2dc 25%, #48546a 0 50%, #ccd2dc 0 75%, #48546a 0); }

.progress-appearance-status {
    min-height: 16px;
    margin: -4px 0 0;
    color: var(--cyan);
    font-size: 9px;
    font-weight: 800;
}

@media (max-width: 900px) {
    .progress-appearance-card {
        grid-template-columns: 1fr;
    }

    .progress-appearance-preview-wrap {
        grid-template-columns: minmax(0, 1fr) 170px;
    }

    .progress-appearance-preview {
        width: 170px;
    }

    .progress-piece-theme-options {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .progress-appearance-card {
        gap: 18px;
        padding: 17px;
    }

    .progress-appearance-preview-wrap {
        grid-template-columns: minmax(0, 1fr) 126px;
        gap: 13px;
    }

    .progress-appearance-preview {
        width: 126px;
        border-width: 5px;
        border-radius: 10px;
    }

    .progress-appearance-heading h2 {
        font-size: 23px;
    }

    .progress-appearance-heading > p:last-child {
        font-size: 9px;
    }

    .progress-board-theme-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .progress-piece-theme-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 360px) {
    .progress-appearance-preview-wrap {
        grid-template-columns: 1fr;
    }

    .progress-appearance-preview {
        width: min(100%, 180px);
        margin: auto;
    }

    .progress-theme-options {
        grid-template-columns: 1fr;
    }

    .progress-board-theme-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .progress-piece-theme-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Final activity layout: graph-first, minimal, and free of decorative icon tiles. */
.progress-activity-card {
    padding: 22px;
    border-color: var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--ink);
}

.progress-activity-card::after {
    display: none;
}

.progress-activity-card > header {
    align-items: flex-start;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
}

.progress-activity-card h2 {
    font-size: 27px;
}

.progress-activity-card .progress-activity-total {
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    justify-content: end;
    gap: 0 6px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: right;
}

.progress-activity-card .progress-activity-total > strong {
    color: var(--ink);
    font: 800 30px/.9 var(--serif);
    letter-spacing: -.04em;
}

.progress-activity-card .progress-activity-total > span {
    margin: 0;
    color: var(--red);
    font: 800 8px/1 var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.progress-activity-card .progress-activity-total > small {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 5px;
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 8px;
    white-space: nowrap;
}

.progress-activity-card .progress-activity-total > small > span {
    margin: 0;
    color: inherit;
    font: inherit;
    letter-spacing: normal;
    text-transform: none;
}

.progress-activity-overview {
    display: block;
    margin-top: 17px;
}

.progress-activity-card .progress-activity-chart {
    position: relative;
    display: block;
    width: 100%;
    height: 175px;
    padding: 0;
    border-bottom: 0;
    background: transparent;
}

.progress-activity-card .progress-activity-chart canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.progress-activity-card .progress-activity-legend {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 18px;
    margin-top: 15px;
    padding-top: 15px;
}

.progress-activity-card .progress-activity-key {
    gap: 6px;
    padding: 0;
    color: var(--muted);
    font-size: 9px;
    text-decoration: none;
}

.progress-activity-card .progress-activity-key:hover,
.progress-activity-card .progress-activity-key:focus-visible {
    color: var(--ink);
}

.progress-activity-card .progress-activity-key:focus-visible {
    border-radius: 4px;
    outline: 2px solid var(--activity-color);
    outline-offset: 4px;
}

.progress-activity-card .progress-activity-key i {
    width: 8px;
    height: 8px;
    flex-basis: 8px;
    border: 0;
    border-radius: 50%;
    background: var(--activity-color);
    color: transparent;
    font-size: 0;
}

.progress-activity-card .progress-activity-key b {
    font-size: 11px;
}

.progress-activity-card .progress-activity-link-arrow {
    margin-left: auto;
    color: var(--activity-color);
    font-size: 11px;
    font-weight: 800;
}

@media (max-width: 720px) {
    .progress-activity-card {
        padding: 17px;
    }

    .progress-activity-card > header {
        gap: 12px;
    }

    .progress-activity-card h2 {
        font-size: 25px;
    }

    .progress-activity-card .progress-activity-total {
        display: grid;
        padding: 0;
        border: 0;
    }

    .progress-activity-card .progress-activity-total > strong {
        font-size: 27px;
    }

    .progress-activity-card .progress-activity-chart {
        height: 150px;
    }

    .progress-activity-card .progress-activity-legend {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 16px;
    }
}

@media (max-width: 360px) {
    .progress-activity-card .progress-activity-total > small {
        gap: 3px;
        font-size: 7px;
    }
}

/* Progress Chess DNA summary and orange-and-cream achievement cabinet. */
.progress-domains-card .progress-domains-header {
    align-items: center;
}

.progress-domains-heading > span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: clamp(12px, 1.05vw, 14px);
    font-weight: 800;
}

.progress-domains-total {
    display: grid;
    flex: none;
    justify-items: end;
}

.progress-domains-total .progress-dna-value {
    --dna-value-size: 34px;
    display: inline-flex;
    justify-content: flex-end;
    margin: 0;
}

.progress-domains-total .dna-number-text {
    color: var(--accent-ink);
    font-family: var(--display);
    font-weight: 850;
}

.progress-domains-total > small {
    margin-top: 2px;
    color: var(--muted);
    font-size: clamp(11px, .95vw, 13px);
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.progress-trophy-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 0 24px;
    margin-bottom: 18px;
    padding: 4px 2px 0;
}

.progress-trophy-header h2 {
    margin: 3px 0 6px;
    font: 850 clamp(27px, 3vw, 38px)/1 var(--display);
    letter-spacing: -.045em;
}

.progress-trophy-header > p:last-child {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    margin: 0;
    color: var(--muted);
    font-size: clamp(13px, 1.15vw, 15px);
    line-height: 1.5;
}

.progress-trophy-header > span {
    flex: none;
    padding: 7px 11px;
    border: 1px solid #e3b779;
    border-radius: 999px;
    background: #fff4df;
    color: #9b4d18;
    font-size: clamp(12px, 1vw, 14px);
    font-weight: 900;
    white-space: nowrap;
}

.progress-trophy-tiers {
    display: grid;
    gap: 14px;
}

.progress-trophy-loader {
    min-height: 128px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: var(--muted);
    text-align: center;
}

.progress-trophy-loader[hidden] { display: none; }

.progress-trophy-loader-icon {
    width: 32px;
    height: 32px;
    border: 4px solid rgba(64, 105, 75, .18);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: progress-trophy-loader-spin .7s linear infinite;
}

.progress-trophy-loader strong { font-size: 11px; }

@keyframes progress-trophy-loader-spin { to { transform: rotate(1turn); } }

@media (prefers-reduced-motion: reduce) {
    .progress-trophy-loader-icon { animation-duration: 1.8s; }
}

.progress-trophy-tier {
    overflow: hidden;
    border: 1px solid #ead5bb;
    border-radius: 16px;
    background: rgba(255, 253, 247, .8);
    box-shadow: 0 8px 22px rgba(115, 69, 31, .07);
}

.progress-trophy-tier > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid #eddcc7;
    background: linear-gradient(90deg, rgba(240, 126, 31, .1), rgba(255, 248, 235, .2));
}

.progress-trophy-tier h3 {
    margin: 0;
    color: #7f3e14;
    font: 850 17px/1 var(--display);
    letter-spacing: -.025em;
}

.progress-trophy-tier header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: clamp(12px, 1vw, 14px);
    line-height: 1.4;
}

.progress-trophy-tier header > span {
    flex: none;
    min-width: 48px;
    padding: 5px 8px;
    border: 1px solid #e8c99e;
    border-radius: 999px;
    background: #fff8ea;
    color: #9b4d18;
    font-size: clamp(11px, .95vw, 13px);
    font-weight: 900;
    text-align: center;
}

.progress-trophy-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 1px;
    padding: 1px;
    background: #ead5bb;
}

.progress-trophy-item {
    position: relative;
    display: grid;
    min-width: 0;
    padding: 8px 6px 7px;
    border: 0;
    border-radius: 0;
    background: #fffaf0;
    color: inherit;
    font: inherit;
    text-align: inherit;
}

.progress-trophy-item.earned {
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 181, 74, .2), transparent 48%),
        #fffdf7;
}

.progress-trophy-image {
    display: grid;
    aspect-ratio: 1;
    place-items: center;
}

.progress-trophy-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: filter .2s ease, opacity .2s ease, transform .2s ease;
}

.progress-trophy-item.earned:hover .progress-trophy-image img {
    transform: translateY(-2px) scale(1.035);
}

.progress-trophy-item:focus-visible {
    z-index: 2;
    outline: 3px solid rgba(234, 118, 95, .42);
    outline-offset: -3px;
}

.progress-trophy-item.locked .progress-trophy-image img {
    filter: grayscale(.7) saturate(.45);
    opacity: .48;
}

.progress-trophy-item.earned::after {
    content: "✓";
    position: absolute;
    right: 7px;
    top: 7px;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border: 2px solid #fffaf0;
    border-radius: 50%;
    background: #ee7e20;
    color: white;
    font-size: 10px;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(139, 64, 14, .2);
}

.progress-trophy-copy {
    min-width: 0;
    text-align: center;
}

.progress-trophy-copy strong,
.progress-trophy-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-trophy-copy strong {
    color: #4f3020;
    font-size: clamp(11px, .9vw, 13px);
    font-weight: 850;
}

.progress-trophy-copy small {
    margin-top: 2px;
    color: #9c7963;
    font-size: clamp(10px, .8vw, 12px);
    font-weight: 750;
}

.progress-trophy-item.earned .progress-trophy-copy small {
    color: #b85514;
}

@media (max-width: 900px) {
    .progress-trophy-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .progress-domains-card .progress-domains-header {
        display: flex;
    }

    .progress-domains-total .progress-dna-value {
        --dna-value-size: 30px;
    }

    .progress-trophy-header {
        gap: 12px;
    }

    .progress-trophy-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .progress-trophy-item {
        padding: 6px 4px;
    }

}

@media (max-width: 360px) {
    .progress-trophy-header {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .progress-trophy-header > span {
        grid-row: 3;
        justify-self: start;
    }
}

/* Mode-based Progress: global consistency, focused sections, and seven mode tabs. */
.progress-overview-row {
    display: grid;
    grid-template-columns: minmax(280px, .55fr) minmax(0, 1.45fr);
    align-items: start;
    gap: 12px;
    margin-bottom: 12px;
}

.progress-profile-overview {
    display: grid;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    margin: 0;
}

.progress-profile-overview .progress-identity {
    min-width: 0;
    height: auto;
    margin: 0;
    align-content: center;
}

.progress-rhythm-global {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr) minmax(250px, .55fr);
    gap: 0 24px;
    min-width: 0;
    margin: 0;
    padding: 20px;
}

.progress-rhythm-global .progress-rhythm-head,
.progress-rhythm-global .progress-heatmap,
.progress-rhythm-global .progress-heatmap-axis {
    grid-column: 1;
}

.progress-rhythm-global .progress-rhythm-stats,
.progress-rhythm-global > .button {
    grid-column: 2;
}

.progress-rhythm-global .progress-rhythm-stats {
    grid-row: 1 / span 2;
    align-self: end;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 38px 0 9px;
}

.progress-rhythm-global > .button {
    grid-row: 3;
    align-self: end;
}

.progress-section-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid #d9d0c7;
    border-radius: 16px;
    background: #eee8e0;
    box-shadow: 0 7px 20px rgba(52, 43, 36, .07);
}

.progress-section-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 850;
}

.progress-section-tabs button.is-locked {
    color: #756e68;
    cursor: pointer;
}

.progress-section-tabs button.is-locked:hover,
.progress-section-tabs button.is-locked:focus-visible {
    color: var(--accent-ink);
    --tab-face: #fffaf5;
    --tab-edge: #c9a89e;
}

.progress-tab-lock {
    display: inline-grid;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    place-items: center;
    border: 1px solid #c9a89e;
    border-radius: 50%;
    background: #fff8f2;
    color: #9c4e3e;
}

.progress-tab-lock[hidden] {
    display: none;
}

.progress-tab-lock svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.progress-section-tabs button:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, .55);
}

.progress-section-tabs button[aria-selected="true"] {
    border-color: #e39a89;
    background: #fffaf5;
    color: var(--accent-ink);
    box-shadow: 0 3px 10px rgba(98, 68, 51, .11);
}

.progress-section-tabs button:focus-visible {
    outline: 3px solid rgba(234, 118, 95, .25);
    outline-offset: 1px;
}

.progress-mode-tabs {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
    padding: 6px;
    border: 1px solid #d9d0c7;
    border-radius: 16px;
    background: #eee8e0;
    box-shadow: 0 7px 20px rgba(52, 43, 36, .07);
}

.progress-mode-tabs button {
    display: grid;
    min-width: 0;
    min-height: 58px;
    padding: 7px 4px;
    place-items: center;
    gap: 2px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.progress-mode-tabs button > img {
    display: block;
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.progress-mode-tabs button:focus-visible {
    outline: 3px solid rgba(234, 118, 95, .25);
    outline-offset: 1px;
}

.progress-mode-card {
    min-width: 0;
    padding: 22px;
}

.progress-mode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.progress-mode-heading {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 13px;
}

.progress-mode-heading > span {
    display: grid;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    place-items: center;
    border: 1px solid #e0d7cf;
    border-radius: 15px;
    background: #f8f3ed;
}

.progress-mode-heading > span img {
    display: block;
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.progress-mode-heading h2 {
    margin: 2px 0 3px;
    font: 850 27px/1 var(--display);
    letter-spacing: -.04em;
}

.progress-mode-heading p:last-child {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.progress-mode-header > .button {
    flex: none;
    white-space: nowrap;
}

.progress-mode-empty {
    margin: 16px 0 0;
    padding: 12px 14px;
    border: 1px dashed #d7cdc4;
    border-radius: 11px;
    background: #faf6f0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.progress-mode-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 9px;
    margin-top: 16px;
}

.progress-mode-kpis article {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8f3ed;
}

.progress-mode-kpis small,
.progress-mode-kpis strong {
    display: block;
}

.progress-mode-kpis small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.progress-mode-kpis strong {
    margin-top: 6px;
    color: var(--ink);
    font: 850 28px/1 var(--display);
    letter-spacing: -.03em;
}

.progress-mode-kpis article.is-text strong {
    font-size: 18px;
    line-height: 1.15;
}

.progress-puzzle-stats {
    display: grid;
    grid-template-columns: minmax(270px, .7fr) minmax(0, 1.3fr);
    align-items: start;
    gap: 12px;
    margin-top: 12px;
}

.progress-puzzle-stats[hidden] {
    display: none;
}

.progress-puzzle-stats .progress-level-runway,
.progress-puzzle-stats .progress-domains-card {
    min-width: 0;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: linear-gradient(145deg, rgba(234, 118, 95, .06), transparent 60%), #fffdfa;
}

.progress-puzzle-stats .progress-level-runway h2 {
    margin: 2px 0 0;
    font: 850 24px/1 var(--display);
    letter-spacing: -.04em;
}

/* All customer-facing tab buttons share the same raised, pressable surface. */
:is(.input-tabs, .puzzle-mode-tabs, .account-tabs, .training-account-dialog .account-tabs, .progress-section-tabs, .progress-mode-tabs) button {
    --tab-face: #fffdfa;
    --tab-edge: #c8bdb3;
    --tab-shadow: rgba(52, 43, 36, .11);
    margin-bottom: 3px;
    border: 1px solid var(--tab-edge);
    background: var(--tab-face);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .84),
        0 3px 0 var(--tab-edge),
        0 8px 14px var(--tab-shadow);
    color: var(--muted);
    translate: 0 0;
    transition: border-color .14s ease, background .14s ease, box-shadow .1s ease, color .14s ease, translate .1s ease;
}

:is(.input-tabs, .puzzle-mode-tabs, .account-tabs, .training-account-dialog .account-tabs, .progress-section-tabs, .progress-mode-tabs) button:is(.active, [aria-selected="true"]) {
    --tab-face: var(--accent);
    --tab-edge: #b94d39;
    --tab-shadow: rgba(185, 77, 57, .2);
    border-color: var(--tab-edge);
    background: var(--tab-face);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .58),
        0 3px 0 var(--tab-edge),
        0 8px 14px var(--tab-shadow);
    color: var(--ink);
}

:is(.input-tabs, .puzzle-mode-tabs, .account-tabs, .training-account-dialog .account-tabs, .progress-section-tabs, .progress-mode-tabs) button:hover:not(:disabled),
:is(.input-tabs, .puzzle-mode-tabs, .account-tabs, .training-account-dialog .account-tabs, .progress-section-tabs, .progress-mode-tabs) button:focus-visible {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .88),
        0 4px 0 var(--tab-edge),
        0 10px 18px var(--tab-shadow);
    translate: 0 -1px;
}

:is(.input-tabs, .puzzle-mode-tabs, .account-tabs, .training-account-dialog .account-tabs, .progress-section-tabs, .progress-mode-tabs) button:active:not(:disabled) {
    box-shadow:
        inset 0 1px 3px rgba(52, 43, 36, .14),
        0 1px 0 var(--tab-edge),
        0 4px 8px var(--tab-shadow);
    translate: 0 2px;
}

.progress-tab-panel[hidden] {
    display: none;
}

.progress-tab-panel > .progress-activity-card,
.progress-tab-panel > .progress-appearance-card {
    margin: 0;
}

@media (max-width: 900px) {
    .progress-overview-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .progress-profile-overview .progress-identity {
        height: auto;
    }

    .progress-profile-overview,
    .progress-rhythm-global {
        grid-column: 1;
        grid-row: auto;
    }
}

@media (max-width: 760px) {
    .progress-rhythm-global {
        display: block;
    }

    .progress-rhythm-global .progress-rhythm-stats {
        margin-top: 17px;
    }

    .progress-puzzle-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .progress-section-tabs {
        gap: 3px;
        padding: 4px;
        border-radius: 13px;
    }

    .progress-section-tabs button {
        min-height: 40px;
        padding-inline: 5px;
        font-size: 12px;
    }

    .progress-rhythm-global,
    .progress-mode-card {
        padding: 15px;
    }

    .progress-rhythm-global .progress-rhythm-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .progress-mode-tabs {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 3px;
        padding: 4px;
    }

    .progress-mode-tabs button {
        min-height: 48px;
        padding: 5px 1px;
        gap: 1px;
        font-size: clamp(7px, 2.25vw, 9px);
    }

    .progress-mode-tabs button > img {
        width: 25px;
        height: 25px;
    }

    .progress-mode-header {
        display: grid;
        gap: 13px;
    }

    .progress-mode-header > .button {
        width: 100%;
        justify-content: center;
    }

    .progress-mode-heading > span {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .progress-mode-heading > span img {
        width: 36px;
        height: 36px;
    }

    .progress-mode-heading h2 {
        font-size: 24px;
    }

    .progress-mode-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .progress-mode-kpis strong {
        font-size: 24px;
    }

    .progress-puzzle-stats .progress-level-runway,
    .progress-puzzle-stats .progress-domains-card {
        padding: 14px;
    }
}

@media (min-width: 761px) {
    .pwa-install-banner {
        display: none !important;
    }
}

.progress-trophy-dialog {
    width: min(410px, calc(100% - 28px));
    overflow: visible;
    padding: 28px 24px 24px;
    border: 1px solid #e3bd8a;
    border-radius: var(--radius-card);
    background: radial-gradient(circle at 14% 10%, rgba(241, 139, 54, .17), transparent 34%), #fffaf0;
    box-shadow: 0 28px 80px rgba(63, 38, 23, .28);
    color: var(--ink);
}

.progress-trophy-dialog[open] {
    display: grid;
    justify-items: center;
    gap: 14px;
}

.progress-trophy-dialog::backdrop {
    background: rgba(42, 30, 22, .48);
    backdrop-filter: blur(4px);
}

.progress-trophy-dialog > img {
    display: block;
    width: 220px;
    height: 220px;
    object-fit: contain;
}

.progress-trophy-dialog-copy {
    display: grid;
    justify-items: center;
    min-width: 0;
    text-align: center;
}

.progress-trophy-dialog h2 {
    margin: 0 0 7px;
    font: 850 clamp(27px, 5vw, 34px)/1 var(--display);
    letter-spacing: -.045em;
}

#progress-trophy-dialog-requirement {
    margin: 0;
    color: var(--muted);
    font-size: clamp(14px, 2.7vw, 17px);
    font-weight: 700;
    line-height: 1.45;
}

.progress-trophy-dialog-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 15px;
    padding: 9px 13px;
    border: 1px solid #e5d4bd;
    border-radius: 12px;
    background: #f6eee3;
}

.progress-trophy-dialog-status strong {
    color: #7a5d49;
    font-size: 13px;
}

.progress-trophy-dialog-status.earned {
    border-color: #e3b779;
    background: #fff4df;
}

.progress-trophy-dialog-status.earned strong,
.progress-trophy-earned-check {
    color: #b85514;
}

.progress-trophy-earned-check {
    display: grid;
    width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 50%;
    background: #ee7e20;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

.progress-trophy-dialog-action {
    width: 100%;
    margin-top: 12px;
    justify-content: center;
    text-align: center;
}

.progress-trophy-dialog-close {
    position: absolute;
    right: 14px;
    top: 14px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid #ddc9b0;
    border-radius: 50%;
    background: #fffdf8;
    color: #75462a;
    font-size: 22px;
    line-height: 1;
}

@media (max-width: 540px) {
    .progress-trophy-dialog {
        padding: 20px;
    }

    .progress-trophy-dialog[open] {
        gap: 10px;
    }

    .progress-trophy-dialog > img {
        width: min(180px, 58vw);
        height: min(180px, 58vw);
    }

    .progress-trophy-dialog h2 {
        margin-bottom: 6px;
    }
}

/* Public design-system consistency pass — September 10, 2026. */
body.view-puzzles .site-header,
body.view-puzzles .home-hub-tabs-wrap,
.battle-header,
.arcade-header {
    width: min(1180px, calc(100% - 24px));
}

.site-header nav {
    padding: 1px;
}

.site-header nav a,
.site-header nav button {
    min-height: 40px;
    margin-bottom: 0;
}

.battle-header,
.arcade-header {
    min-height: 66px;
    height: auto;
    padding: 9px 10px;
    border-radius: var(--radius-header);
}

.section-page-title {
    margin: 22px 8px 18px;
    color: var(--ink);
    font: 800 clamp(34px, 4vw, 46px)/1 var(--display);
    letter-spacing: -.05em;
}

.progress-premium-strip {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 112px;
    margin-bottom: 14px;
    padding: 14px 20px 14px 15px;
    overflow: hidden;
    border: 1px solid #a9472f;
    background: radial-gradient(circle at 84% 0%, rgba(255, 247, 232, .32), transparent 30%), linear-gradient(135deg, #f6b29f, #ea765f);
    box-shadow: 0 6px 0 #a9472f, 0 16px 30px rgba(111, 50, 31, .15);
    color: #6f321f;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.progress-premium-strip:hover,
.progress-premium-strip:focus-visible {
    border-color: #a9472f;
    box-shadow: 0 7px 0 #a9472f, 0 19px 34px rgba(111, 50, 31, .2);
    outline: 3px solid rgba(238, 128, 104, .22);
    outline-offset: 3px;
    transform: translateY(-1px);
}

.progress-premium-icon {
    display: grid;
    width: 76px;
    height: 76px;
    place-items: center;
}

.progress-premium-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.progress-premium-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.progress-premium-copy small {
    color: #a9472f;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .12em;
    line-height: 1.3;
    text-transform: uppercase;
}

.progress-premium-copy strong {
    overflow: hidden;
    color: #6f321f;
    font: 820 clamp(20px, 2.2vw, 28px)/1.08 var(--display);
    letter-spacing: -.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-premium-copy > span {
    overflow: hidden;
    color: #6f321f;
    font-size: 12px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-premium-plan {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.progress-premium-plan > strong {
    color: #6f321f;
    font: 820 15px/1 var(--display);
}

.progress-premium-plan > span {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid #a9472f;
    border-radius: 11px;
    background: var(--accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 4px 0 #ad4432;
    color: #6f321f;
    font-size: 13px;
    font-weight: 820;
    white-space: nowrap;
}

.progress-access-summary{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:-2px 0 14px;padding:13px 17px;border-color:#f0b19f;background:#fff7e8}.progress-access-summary>div:first-child{display:grid;gap:2px;min-width:0}.progress-access-summary small{color:#a9472f;font-size:8px;font-weight:900;letter-spacing:.1em;text-transform:uppercase}.progress-access-summary strong{color:#6f321f;font-size:13px}.progress-access-summary span{color:#6f321f;font-size:9px;line-height:1.4}.progress-access-allowances{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:6px}.progress-access-allowances>span{padding:6px 8px;border:1px solid #f0b19f;border-radius:999px;background:#fffdf5;white-space:nowrap}.progress-access-allowances strong{color:#a9472f;font-size:11px}

.progress-premium-plan b {
    font-size: 16px;
}

@media (max-width: 620px) {
    .progress-premium-strip {
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 10px 13px;
        min-height: 0;
        padding: 14px;
        border-radius: var(--radius-card-mobile);
    }

    .progress-premium-icon {
        width: 62px;
        height: 62px;
    }

    .progress-premium-copy strong,
    .progress-premium-copy > span {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .progress-premium-copy strong {
        font-size: 20px;
    }

    .progress-premium-copy > span {
        margin-top: 2px;
        font-size: 11px;
    }

    .progress-premium-plan {
        display: flex;
        grid-column: 1 / -1;
        align-items: center;
        justify-content: space-between;
        padding-top: 2px;
    }

    .progress-premium-plan > span {
        min-height: 40px;
        padding: 9px 13px;
        font-size: 12px;
    }
    .progress-access-summary{align-items:flex-start;flex-direction:column;gap:9px;padding:12px}.progress-access-allowances{justify-content:flex-start}
}

.nav-account-button.is-current,
.nav-account-button.is-progress {
    border-color: #b94d39;
    background: var(--accent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .5),
        0 4px 0 #b94d39,
        0 9px 18px rgba(185, 77, 57, .18);
    color: var(--ink);
}

.nav-account-button.is-current:hover,
.nav-account-button.is-current:focus-visible,
.nav-account-button.is-progress:hover,
.nav-account-button.is-progress:focus-visible {
    border-color: #c45742;
    background: var(--accent-soft);
}

.nav-account-button.is-current .nav-account-label,
.nav-account-button.is-progress .nav-account-label {
    color: var(--ink);
}

.coach-hero h1,
.arcade-hero h1,
.battle-lobby h1,
.training-hero-copy h1 {
    font: 800 clamp(42px, 6.4vw, 78px)/.94 var(--display);
    letter-spacing: -.065em;
}

.coach-hero h1 em,
.arcade-hero h1 em,
.battle-lobby h1 em,
.training-hero-copy h1 em {
    color: var(--accent-ink);
}

.battle-page .battle-lobby #battle-find-match,
.arcade-page .arcade-card-foot .button,
body.view-path .path-next-level-action {
    --button-face: var(--accent);
    --button-edge: #b94d39;
    --button-shadow: rgba(185, 77, 57, .22);
    min-height: 45px;
    padding: 10px 16px;
    border: 1px solid var(--button-edge);
    border-radius: var(--radius-control);
    background: var(--button-face);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .78),
        inset 0 -1px 0 rgba(52, 43, 36, .10),
        0 4px 0 var(--button-edge),
        0 10px 18px var(--button-shadow);
    color: var(--ink);
    font: 600 14px/1 var(--sans);
    text-shadow: none;
}

.battle-page .battle-lobby #battle-find-match:hover:not(:disabled),
.battle-page .battle-lobby #battle-find-match:focus-visible,
.arcade-page .arcade-card-foot .button:hover:not(:disabled),
.arcade-page .arcade-card-foot .button:focus-visible,
body.view-path .path-next-level-action:hover:not(:disabled),
body.view-path .path-next-level-action:focus-visible {
    border-color: #b94d39;
    background: var(--accent-soft);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .82),
        inset 0 -1px 0 rgba(52, 43, 36, .10),
        0 5px 0 var(--button-edge),
        0 12px 22px var(--button-shadow);
    color: var(--ink);
    text-shadow: none;
}

.legal-page section,
.account-page-card,
.deletion-form-card,
.comparison-card,
.comparison-choice,
.comparison-related article,
.comparison-quick-answer,
.comparison-table-wrap,
.comparison-disclosure,
.comparison-together,
.comparison-sources,
.comparison-cta {
    border-radius: var(--radius-card);
}

.comparison-card dl div,
.comparison-pick-grid > div,
.comparison-choice-grid > div,
.comparison-choice-grid > div:last-child,
.comparison-table-section thead th,
.comparison-table-section tbody th,
.comparison-sources {
    background: var(--surface-soft);
}

.comparison-cta p:not(.eyebrow) {
    color: var(--ink-soft);
}

.path-rules strong,
.path-leaderboard header > span {
    color: #89651a;
}

.coach-game-result.win,
.coach-progress-steps li.complete > span {
    border-color: var(--success);
    background: var(--success-soft);
    color: var(--success);
}

.coach-game-hero .coach-game-result.win strong,
.coach-progress-live,
.coach-progress-steps li.complete,
.coach-progress-steps li.complete > span::after,
.arcade-feedback > span,
.battle-task > p.is-correct,
.battle-player-you strong,
.battle-final-score strong:first-child,
.matchmaking-record {
    color: var(--success) !important;
}

.coach-progress-live i,
.arcade-choices button.is-correct,
.matchmaking-person.is-matched .matchmaking-avatar {
    border-color: var(--success);
}

.coach-progress-live i {
    background: var(--success);
}

.arcade-choices button.is-correct {
    background: linear-gradient(180deg, #f2fbf4 0%, var(--success-soft) 100%);
    box-shadow: inset 0 1px 0 #fff, 0 4px 0 var(--success), 0 8px 14px rgba(38, 120, 68, .18);
    color: var(--success-dark);
}

.arcade-feedback > span {
    background: var(--success-soft);
}

.battle-avatar,
.matchmaking-avatar {
    background: var(--surface-soft);
    box-shadow: 0 3px 0 var(--line-hi);
}

.matchmaking-person.is-matched .matchmaking-avatar {
    box-shadow: 0 6px 0 var(--success-dark), 0 14px 25px rgba(52, 43, 36, .15);
}

@media (max-width: 760px) {
    .comparison-site .site-header,
    .legal-site .site-header,
    .account-deletion-site .site-header {
        flex-wrap: nowrap;
    }

    .comparison-site .site-header nav,
    .legal-site .site-header nav,
    .account-deletion-site .site-header nav {
        position: static;
        order: initial;
        width: auto;
        min-width: 0;
        flex: 1;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .comparison-table-wrap {
        width: 100%;
        margin-right: 0;
        margin-left: 0;
    }
}

@media (max-width: 620px) {
    body.view-puzzles .site-header,
    body.view-puzzles .home-hub-tabs-wrap,
    .battle-header,
    .arcade-header {
        width: calc(100% - 16px);
    }

    .battle-page .battle-header,
    .arcade-page .arcade-header {
        min-height: 61px;
        height: auto;
        padding: 7px;
        border-radius: var(--radius-header-mobile);
    }

    .arcade-page .arcade-header .brand-mark {
        height: 45px;
    }

    .arcade-page .arcade-header .wordmark {
        font-size: 20px;
    }

    .arcade-page .arcade-title-desktop {
        display: inline;
    }

    .arcade-page .arcade-title-mobile {
        display: none;
    }

    .coach-hero h1,
    .arcade-hero h1,
    .battle-lobby h1,
    .training-hero-copy h1 {
        font-size: 42px;
    }

    .section-page-title {
        margin: 20px 2px 16px;
        font-size: 30px;
    }

    .paper-card,
    .analyzer-card,
    .path-sidebar .paper-card,
    .legal-page section,
    .account-page-card,
    .deletion-form-card,
    .comparison-card,
    .comparison-choice,
    .comparison-related article,
    .comparison-quick-answer,
    .comparison-table-wrap,
    .comparison-disclosure,
    .comparison-together,
    .comparison-sources,
    .comparison-cta {
        border-radius: var(--radius-card-mobile);
    }

    body:is(.view-home, .view-progress) {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    .progress-share-sticky {
        position: static;
        width: calc(100% - 20px);
        margin: 18px auto 8px;
        transform: none;
    }

    .progress-share-sticky .button {
        min-height: 45px;
        padding: 10px 8px;
        font-size: 14px;
    }

    body.view-home .maker-credit {
        bottom: calc(92px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 350px) {
    body.view-home .wordmark span {
        display: none;
    }
}

/* Readable product type scale: keep compact text consistent after the Poppins reframe. */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

:root {
    --type-caption: 12px;
    --type-supporting: 13px;
    --type-control: 14px;
}

.eyebrow,
.hero-brand,
.field > span,
.account-form label > span,
.deletion-form-card label > span,
.puzzle-tools label span {
    font-size: var(--type-caption);
    line-height: 1.35;
}

.home-hub-tabs small,
.home-hub-tabs a > span,
.footer-column-title,
.footer-column a,
.footer-meta,
.back-link,
.comparison-site .site-header nav a,
.legal-site .site-header nav a,
.account-deletion-site .site-header nav a {
    font-size: var(--type-caption);
}

/* Progress account, milestone, activity, appearance, and achievement metadata. */
.progress-identity small,
.progress-identity span,
.progress-level-runway footer,
.progress-rhythm-head > button,
.progress-heatmap-axis,
.progress-rhythm-stats span,
.progress-domain-row strong,
.progress-activity-card > header > .progress-activity-period,
.progress-activity-card .progress-activity-total > span,
.progress-activity-card .progress-activity-total > small,
.progress-activity-card .progress-activity-key,
.progress-activity-card .progress-activity-key b,
.progress-activity-card .progress-activity-link-arrow,
.progress-appearance-controls legend,
.progress-theme-options strong,
.progress-appearance-status,
.progress-domains-total > small,
.progress-trophy-copy small {
    font-size: var(--type-caption);
    line-height: 1.4;
}

.progress-account-action,
.progress-username-form button {
    min-height: 36px;
    padding: 8px 11px;
    font-size: var(--type-supporting);
}

.progress-identity:has(.progress-username-form:not([hidden])) {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: start;
}

.progress-identity:has(.progress-username-form:not([hidden])) .progress-avatar-control {
    grid-row: 1 / span 2;
}

.progress-identity:has(.progress-username-form:not([hidden])) .progress-identity-copy,
.progress-identity:has(.progress-username-form:not([hidden])) .progress-profile-meta,
.progress-identity:has(.progress-username-form:not([hidden])) #progress-member-identity {
    display: contents;
}

.progress-identity:has(.progress-username-form:not([hidden])) .progress-access-tier {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
}

.progress-identity:has(.progress-username-form:not([hidden])) .progress-username-display {
    display: none;
}

.progress-identity:has(.progress-username-form:not([hidden])) .progress-username-form {
    display: grid;
    grid-column: 2 / -1;
    grid-row: 2;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    margin-top: 4px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255, 253, 250, .74);
    box-shadow: inset 0 1px 3px rgba(52, 43, 36, .06);
}

.progress-identity:has(.progress-username-form:not([hidden])) .progress-username-form input,
.progress-identity:has(.progress-username-form:not([hidden])) .progress-username-form button {
    min-height: 38px;
}

.progress-identity:has(.progress-username-form:not([hidden])) .progress-username-form input {
    height: 38px;
    padding: 7px 10px;
    font-size: 13px;
}

.progress-identity:has(.progress-username-form:not([hidden])) .progress-username-form button {
    padding: 7px 11px;
    border: 1px solid var(--button-edge);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 850;
}

.progress-identity:has(.progress-username-form:not([hidden])) .progress-username-form button[type="submit"] {
    border-color: var(--accent-deep);
    background: var(--accent);
    box-shadow: 0 3px 0 var(--accent-deep);
    color: #fff;
}

.progress-identity:has(.progress-username-form:not([hidden])) .progress-username-form button[type="submit"]:active {
    box-shadow: 0 1px 0 var(--accent-deep);
    translate: 0 2px;
}

.progress-username-cancel {
    background: var(--surface);
    color: var(--ink-soft);
}

.progress-username-cancel[hidden] {
    display: none;
}

.progress-identity:has(.progress-username-form:not([hidden])) .progress-account-controls {
    grid-column: 3;
    grid-row: 1;
}

.progress-identity:has(.progress-username-form:not([hidden])) .progress-username-message {
    grid-column: 2 / -1;
    grid-row: 3;
    margin-top: 0;
    white-space: normal;
}

@media (max-width: 350px) {
    .progress-identity:has(.progress-username-form:not([hidden])) .progress-username-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .progress-identity:has(.progress-username-form:not([hidden])) .progress-username-form input {
        grid-column: 1 / -1;
    }

    .progress-identity:has(.progress-username-form:not([hidden])) .progress-username-form:has(.progress-username-cancel[hidden]) button[type="submit"] {
        grid-column: 1 / -1;
    }
}

.progress-level-runway footer {
    align-items: baseline;
}

.progress-appearance-heading > p:last-child,
.progress-trophy-copy strong {
    font-size: var(--type-supporting);
    line-height: 1.4;
}

/* Puzzle library and workout controls. */
#library-count-label,
.puzzle-reward-filter-label,
.puzzle-tools-toggle span,
.quick-puzzle-tag,
.puzzle-page-summary,
.puzzle-page-controls button,
.puzzle-workout-launch-head,
.puzzle-workout-launch-head strong,
.puzzle-workout-resume,
.puzzle-workout-bar > div:first-child span,
.puzzle-workout-progress > span {
    font-size: var(--type-caption);
    line-height: 1.4;
}

.puzzle-branches small,
.puzzle-branches strong,
.game-library.quick-library .quick-puzzle .quick-puzzle-tag,
.puzzle-tools-toggle small,
.puzzle-tools-toggle .puzzle-tools-toggle-state,
.puzzle-workout-durations button small {
    font-size: var(--type-caption);
    line-height: 1.35;
}

.puzzle-tools .surprise-button,
.library-note,
.puzzle-workout-setup-copy > p:last-child {
    font-size: var(--type-supporting);
    line-height: 1.5;
}

.puzzle-tools-toggle strong {
    font-size: var(--type-supporting);
}

/* Route-specific supporting text that previously fell below the shared scale. */
.path-map small,
.path-leaderboard-note,
.path-rules small,
.coach-proof span,
#coach-plan-badge,
#coach-billing-note,
.arcade-page .eyebrow,
.arcade-game-card > div:not(.arcade-card-foot) > p.eyebrow,
.arcade-card-foot > span,
.battle-page .eyebrow,
.battle-record,
.deletion-form-card label > span,
.deletion-help,
.account-page-copy,
.account-form label small {
    font-size: var(--type-caption);
    line-height: 1.45;
}

.deletion-help,
.account-page-copy {
    font-size: var(--type-supporting);
}

.deletion-help,
.deletion-help a {
    font-size: var(--type-supporting) !important;
}

/* Comparison cards use the same label, support, and action hierarchy. */
.comparison-card-names,
.comparison-card dt,
.comparison-card-names i {
    font-size: var(--type-caption);
    line-height: 1.35;
}

.comparison-card dd,
.comparison-card > p,
.comparison-method span,
.comparison-directory > header > p,
.comparison-read,
.comparison-disclosure p {
    font-size: var(--type-supporting);
    line-height: 1.5;
}

.comparison-breadcrumbs,
.comparison-disclosure strong {
    font-size: var(--type-caption);
    line-height: 1.4;
}

@media (max-width: 620px) {
    .progress-identity {
        row-gap: 8px;
    }

    .progress-identity:has(.progress-username-form:not([hidden])) {
        grid-template-columns: 42px minmax(0, 1fr) auto;
    }

    .progress-level-runway footer {
        flex-wrap: wrap;
        row-gap: 3px;
    }

    .progress-rhythm-stats span {
        padding-block: 11px;
    }

    .progress-domain-row > div {
        align-items: center;
    }

    .comparison-card dl div {
        min-height: 0;
    }
}

/* Keep the fuller destination name on desktop and use the compact action label in the mobile dock. */
@media (max-width: 760px) {
    .home-hub-tabs [data-mobile-label] {
        font-size: 0 !important;
    }

    .home-hub-tabs [data-mobile-label]::after {
        content: attr(data-mobile-label);
    }

    .home-hub-tabs a > span:not([data-mobile-label]),
    .home-hub-tabs [data-mobile-label]::after {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .home-hub-tabs a > span:not([data-mobile-label]),
    .home-hub-tabs [data-mobile-label]::after {
        font-size: 10px;
    }
}

@media (max-width: 360px) {
    .home-hub-tabs a > span:not([data-mobile-label]),
    .home-hub-tabs [data-mobile-label]::after {
        font-size: 8px;
    }
}

/* The Progress profile is a welcoming identity card, not a utility toolbar. */
.progress-profile-overview .progress-identity {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 116px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid #d9cec4;
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0, rgba(244, 177, 163, .34), transparent 42%),
        linear-gradient(145deg, #fffdfa 0%, #f8f1e9 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .95),
        0 5px 0 #cfc2b7,
        0 14px 30px rgba(64, 48, 40, .1);
}

.progress-profile-overview .progress-identity::before {
    position: absolute;
    z-index: -1;
    top: 0;
    right: 22px;
    left: 22px;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    content: "";
    opacity: .75;
}

.progress-profile-overview .progress-avatar-control {
    width: 62px;
    height: 62px;
}

.progress-profile-overview .progress-avatar {
    border: 3px solid rgba(255, 255, 255, .86);
    background: linear-gradient(145deg, var(--accent), #f7c0b5);
    box-shadow:
        0 0 0 1px rgba(146, 75, 60, .16),
        0 7px 16px rgba(118, 66, 53, .18);
}

.progress-profile-overview .progress-identity #progress-avatar-fallback {
    color: #fff;
    font: 800 30px/1 var(--display);
    text-shadow: 0 1px 1px rgba(91, 44, 35, .18);
}

.progress-profile-overview .progress-avatar-upload {
    right: -2px;
    bottom: -2px;
    width: 24px;
    height: 24px;
    border: 3px solid var(--surface);
    background: var(--ink);
    box-shadow: 0 3px 7px rgba(34, 35, 31, .22);
    font-size: 14px;
}

.progress-profile-overview .progress-identity-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
}

.progress-profile-meta {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 9px;
}

.progress-identity .progress-access-tier {
    margin: 0;
    padding: 4px 8px;
    border-color: rgba(143, 112, 98, .2);
    background: rgba(255, 255, 255, .66);
    color: var(--accent-ink);
    font-size: 9px;
    line-height: 1.2;
}

.progress-profile-overview .progress-username-display {
    gap: 7px;
}

.progress-profile-overview .progress-username-display strong,
.progress-guest-identity strong {
    display: block;
    margin: 0;
    color: var(--ink);
    font: 850 19px/1.15 var(--display);
    letter-spacing: -.025em;
}

.progress-profile-overview .progress-username-edit {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
    border: 1px solid rgba(137, 111, 98, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .66);
}

.progress-profile-overview .progress-username-edit svg {
    width: 12px;
    height: 12px;
}

.progress-guest-identity {
    min-width: 0;
}

.progress-guest-identity[hidden] {
    display: none;
}

.progress-guest-identity span {
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 10px;
    line-height: 1.35;
}

.progress-guest-identity strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.progress-profile-overview .progress-guest-signin {
    grid-column: 1 / -1;
    display: flex;
    width: 100%;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 1px;
    padding: 10px 13px 10px 15px;
    border-color: #a84332;
    border-radius: 14px;
    background: linear-gradient(180deg, #ed745f 0%, var(--accent) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .34),
        0 4px 0 #a84332,
        0 9px 17px rgba(142, 68, 53, .18);
    color: #fff;
    text-align: left;
}

.progress-profile-overview .progress-guest-signin[hidden] {
    display: none;
}

.progress-profile-overview .progress-guest-signin > span {
    min-width: 0;
}

.progress-profile-overview .progress-guest-signin strong,
.progress-profile-overview .progress-guest-signin small {
    display: block;
}

.progress-profile-overview .progress-guest-signin strong {
    font-size: 13px;
    line-height: 1.25;
}

.progress-profile-overview .progress-guest-signin small {
    margin-top: 2px;
    color: rgba(255, 255, 255, .82);
    font-size: 9px;
    font-weight: 650;
    line-height: 1.3;
}

.progress-profile-overview .progress-guest-signin svg {
    width: 22px;
    height: 22px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.progress-profile-overview .progress-account-action {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border-color: rgba(117, 96, 85, .2);
    border-radius: 10px;
    background: rgba(255, 255, 255, .58);
    color: var(--ink-soft);
}

.progress-profile-overview .progress-account-action:hover,
.progress-profile-overview .progress-account-action:focus-visible {
    border-color: rgba(168, 67, 50, .3);
    background: var(--accent-pale);
    color: var(--accent-ink);
}

.progress-profile-overview .progress-account-action svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.progress-profile-overview .progress-identity:has(.progress-username-form:not([hidden])) {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: start;
}

.progress-profile-overview .progress-identity:has(.progress-username-form:not([hidden])) .progress-profile-meta {
    grid-column: 2;
    align-self: center;
}

@media (min-width: 901px) {
    .progress-overview-row {
        grid-template-columns: minmax(340px, .65fr) minmax(0, 1.35fr);
    }
}

@media (max-width: 620px) {
    .progress-profile-overview .progress-identity,
    .progress-profile-overview .progress-identity:has(.progress-username-form:not([hidden])) {
        grid-template-columns: 54px minmax(0, 1fr) auto;
        gap: 12px;
        min-height: 106px;
        padding: 16px;
        border-radius: 18px;
    }

    .progress-profile-overview .progress-avatar-control {
        width: 54px;
        height: 54px;
    }

    .progress-profile-overview .progress-identity #progress-avatar-fallback {
        font-size: 27px;
    }

    .progress-profile-overview .progress-username-display strong,
    .progress-guest-identity strong {
        font-size: 17px;
    }

    .progress-profile-overview .progress-account-action span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .progress-profile-overview .progress-account-action {
        width: 34px;
        justify-content: center;
        padding: 7px;
    }

    .progress-profile-overview .progress-identity:has(.progress-username-form:not([hidden])) .progress-username-form,
    .progress-profile-overview .progress-identity:has(.progress-username-form:not([hidden])) .progress-username-message {
        grid-column: 1 / -1;
    }
}

@media (max-width: 350px) {
    .progress-profile-overview .progress-identity,
    .progress-profile-overview .progress-identity:has(.progress-username-form:not([hidden])) {
        grid-template-columns: 48px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 14px;
    }

    .progress-profile-overview .progress-avatar-control {
        width: 48px;
        height: 48px;
    }

    .progress-guest-identity span {
        white-space: normal;
    }
}

/* Keep decorative and status artwork in the shared 3D clay visual language. */
.game-library.quick-library .quick-puzzle .quick-puzzle-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.quick-puzzle-tag-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(52, 43, 36, .16));
}

.puzzle-tools .surprise-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.puzzle-tools .surprise-button img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 3px 3px rgba(52, 43, 36, .14));
}

.clay-state-art {
    display: block;
    width: 92px;
    height: 92px;
    margin: 0 auto 10px;
    object-fit: contain;
    filter: drop-shadow(0 9px 10px rgba(52, 43, 36, .16));
}

.loader-board-art {
    position: relative;
    z-index: 2;
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 5px 5px rgba(52, 43, 36, .2));
    animation: knight-think 1.3s ease-in-out infinite;
}

.account-signed-in .account-check {
    overflow: visible;
    background: transparent;
}

.account-check img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    filter: drop-shadow(0 5px 6px rgba(38, 120, 68, .18));
}

.path-world-trophy-art,
.path-world-gate-art,
.path-leaderboard-icon,
.path-leaderboard-lock-art,
.path-leaderboard-score img,
.path-rules img {
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 4px 4px rgba(87, 62, 35, .16));
}

.path-world-trophy-art {
    width: 34px;
    height: 34px;
}

.path-world-gate-art {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
}

.path-leaderboard-icon {
    width: 46px;
    height: 46px;
}

.path-rules > p:not(.eyebrow) {
    display: grid;
    gap: 8px;
    line-height: 1.4;
}

.path-rules > p:not(.eyebrow) > span,
.path-leaderboard-score,
.path-leaderboard-guest-lock {
    display: inline-flex;
    align-items: center;
}

.path-rules > p:not(.eyebrow) > span {
    gap: 8px;
}

.path-rules img {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
}

.path-leaderboard-score {
    justify-content: flex-end;
    gap: 4px;
}

.path-leaderboard-score img {
    width: 18px;
    height: 18px;
}

.path-leaderboard-guest-lock {
    justify-content: center;
    gap: 7px;
}

.path-leaderboard li.path-leaderboard-guest-lock {
    display: block;
    padding: 12px 0;
}

.path-leaderboard-guest-lock .button {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}

.path-leaderboard-lock-art {
    width: 26px;
    height: 26px;
}

.comparison-together > div:first-child img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    filter: drop-shadow(0 8px 8px rgba(52, 43, 36, .17));
}

.comparison-not-found > .clay-state-art {
    width: 104px;
    height: 104px;
}

@media (max-width: 900px) and (min-width: 621px) {
    .hero::after,
    .directory-hero::after {
        width: 240px;
        height: 240px;
    }
}

@media (max-width: 620px) {
    .quick-puzzle-tag-icon {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }

    .comparison-together > div:first-child img {
        width: 58px;
        height: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .loader-board-art {
        animation: none;
    }
}

/* Pair the featured board with the complete puzzle launcher. */
body.view-puzzles .analyzer-wrap {
    padding-bottom: 25px;
}

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

.puzzle-library-intro {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: clamp(24px, 3vw, 38px);
    margin-bottom: 20px;
    padding: 26px 8px 30px;
    border-bottom: 1px solid var(--line);
}

.puzzle-library-intro:has(.mobile-puzzle-launch[hidden]) {
    grid-template-columns: minmax(0, 1fr);
}

.puzzle-library-intro:has(.mobile-puzzle-launch[hidden]) .puzzle-library-chooser {
    width: min(100%, 720px);
    margin-inline: auto;
}

.puzzle-library-chooser {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line-hi);
    border-radius: 20px;
    background:
        radial-gradient(circle at 100% 0, rgba(234, 118, 95, .12), transparent 38%),
        linear-gradient(150deg, #fffdfa, #f8f2eb);
    box-shadow: 0 14px 34px rgba(52, 43, 36, .1);
}

.puzzle-library-chooser-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
}

.puzzle-library-chooser-heading h2 {
    margin: 0;
    font: 700 clamp(24px, 2.4vw, 31px)/1.05 var(--display);
    letter-spacing: -.025em;
}

.puzzle-library-chooser .puzzle-branches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.puzzle-library-chooser .puzzle-branches button,
.puzzle-library-chooser .puzzle-branches button:nth-child(n) {
    min-height: 60px;
}

.puzzle-library-chooser .puzzle-branches strong {
    font-size: 13px;
}

.puzzle-library-chooser .puzzle-branches small {
    font-size: 9.5px;
}

.puzzle-library-chooser .puzzle-reward-filters {
    flex-wrap: wrap;
    margin: 0;
    padding: 7px 8px 9px;
    border: 1px solid rgba(52, 43, 36, .09);
    border-radius: 14px;
    background: rgba(255, 253, 250, .64);
}

.puzzle-library-chooser .puzzle-reward-filter {
    width: 38px;
    height: 36px;
}

.puzzle-first-paint { cursor: wait; }

.puzzle-library-chooser .puzzle-branches .puzzle-first-paint {
    min-width: 0;
    height: 60px;
}

.puzzle-first-paint-board {
    display: block;
    aspect-ratio: 1;
    background: linear-gradient(110deg, #eee8df 30%, #f9f5ef 48%, #eee8df 66%);
    background-size: 250% 100%;
    animation: puzzle-first-paint-shimmer 1.2s linear infinite;
}

.puzzle-first-paint .quick-puzzle-tag,
.puzzle-first-paint.puzzle-reward-filter,
.puzzle-branches .puzzle-first-paint { opacity: .68; }

@keyframes puzzle-first-paint-shimmer { to { background-position: -250% 0; } }

@media (prefers-reduced-motion: reduce) {
    .puzzle-first-paint-board { animation: none; }
}

.puzzle-library-chooser .puzzle-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 0;
    padding: 12px;
}

.puzzle-library-chooser .puzzle-tools label:first-child {
    grid-column: auto;
}

.puzzle-library-chooser .puzzle-tools .surprise-button {
    grid-column: auto;
    min-width: 0;
}

.puzzle-library-access-note {
    margin: 0;
    padding-inline: 3px;
    font-size: 10px;
    line-height: 1.35;
    text-align: center;
}

.mobile-puzzle-launch {
    display: grid;
    justify-items: center;
    gap: 12px;
    width: min(100%, 440px);
    margin-inline: auto;
}

.mobile-puzzle-launch[hidden] {
    display: none;
}

.mobile-puzzle-preview {
    position: relative;
    display: block;
    width: 100%;
    padding: 8px;
    border: 1px solid var(--line-hi);
    border-radius: 18px;
    background: var(--sheet);
    box-shadow: 0 16px 38px rgba(52, 43, 36, .15);
    color: var(--ink);
    cursor: pointer;
    touch-action: manipulation;
}

.mobile-puzzle-preview:hover,
.mobile-puzzle-preview:focus-visible {
    border-color: var(--accent);
    outline: 3px solid rgba(234, 118, 95, .2);
    outline-offset: 2px;
}

.mobile-puzzle-preview-board {
    width: 100%;
    overflow: hidden;
    border-radius: 11px;
    pointer-events: none;
}

.mobile-puzzle-preview-board .coord {
    display: none;
}

.mobile-puzzle-turn {
    position: absolute;
    left: 50%;
    bottom: 7px;
    padding: 6px 10px;
    border: 1px solid rgba(52, 43, 36, .15);
    border-radius: 999px;
    background: rgba(255, 253, 250, .9);
    box-shadow: 0 4px 12px rgba(52, 43, 36, .13);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    transform: translateX(-50%);
    backdrop-filter: blur(5px);
}

.mobile-puzzle-start {
    width: 100%;
    min-height: 50px;
    font-size: 14px;
}

@media (max-width: 900px) {
    .puzzle-library-intro {
        grid-template-columns: minmax(0, 1fr);
    }

    .puzzle-library-chooser {
        width: min(100%, 620px);
        margin-inline: auto;
    }
}

@media (max-width: 720px) {
    body.view-puzzles .game-library { margin-right: -10px; }

    body.view-puzzles .workout-directory-hero {
        margin-block: 29px 20px;
        padding-block: 42px 26px;
    }

    .puzzle-library-intro {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
        margin-bottom: 18px;
        padding: 14px 0 24px;
    }

    .puzzle-library-chooser {
        gap: 11px;
        padding: 14px;
        border-radius: 18px;
    }

    .puzzle-library-chooser-heading h2 {
        font-size: clamp(23px, 7vw, 28px);
    }

    .puzzle-library-chooser .puzzle-tools-toggle {
        margin: 0;
    }

    .puzzle-library-chooser .puzzle-tools {
        margin-top: -1px;
    }

    .puzzle-library-chooser .puzzle-reward-filter-label {
        position: static;
        width: auto;
        height: auto;
        flex-basis: 100%;
        overflow: visible;
        clip-path: none;
        text-align: center;
        white-space: normal;
    }

    .mobile-puzzle-launch {
        gap: 10px;
        width: min(100%, 318px);
    }

    .mobile-puzzle-preview {
        padding: 7px;
        border-radius: 17px;
    }

    .mobile-puzzle-turn {
        bottom: 7px;
        padding: 5px 9px;
        font-size: 10px;
    }

    .mobile-puzzle-start {
        min-height: 48px;
    }
}

@media (max-width: 360px) {
    body.view-puzzles .analyzer-card {
        padding-inline: 10px;
    }

    .puzzle-library-intro {
        margin-inline: -4px;
    }

    .puzzle-library-chooser {
        padding: 11px;
        border-radius: 16px;
    }

    .puzzle-library-chooser .puzzle-branches strong {
        font-size: 11.5px;
    }

    .puzzle-library-chooser .puzzle-branches small {
        font-size: 9px;
    }

    .puzzle-library-chooser .puzzle-branches button,
    .puzzle-library-chooser .puzzle-branches button:nth-child(n) {
        padding-inline: 5px;
    }

    .mobile-puzzle-preview {
        padding: 5px;
    }
}

@media (min-width: 621px) {
    body .home-hub-tabs-wrap.home-hub-tabs-wrap {
        width: min(980px, calc(100% - 40px));
    }
}
