/**
 * DRAWING.CSS - Estilos para Sistema de Pintado Custom
 * Ajedrez de Silicio - SilicioBoard + SilicioRules
 */

/* ===== MARCAS DE CASILLAS - MARCOS CUADRADOS ===== */
square.highlight-gold {
    box-shadow: inset 0 0 0 4px #D4AF37 !important;
    z-index: 10 !important;
}

square.highlight-red {
    box-shadow: inset 0 0 0 4px #DC143C !important;
    z-index: 10 !important;
}

square.highlight-blue {
    box-shadow: inset 0 0 0 4px #4169E1 !important;
    z-index: 10 !important;
}

square.highlight-green {
    box-shadow: inset 0 0 0 4px #00FF00 !important;
    z-index: 10 !important;
}

/* ===== ALTERNATIVA: CÍRCULOS (comentado por defecto) ===== */
/*
square.highlight-gold::after,
square.highlight-red::after,
square.highlight-blue::after,
square.highlight-green::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border-radius: 50%;
    pointer-events: none;
}

square.highlight-gold::after {
    border: 4px solid #D4AF37;
}

square.highlight-red::after {
    border: 4px solid #DC143C;
}

square.highlight-blue::after {
    border: 4px solid #4169E1;
}

square.highlight-green::after {
    border: 4px solid #00FF00;
}
*/

/* ===== CONTENEDOR SVG PARA FLECHAS ===== */
.drawing-svg-container {
    pointer-events: none;
    overflow: visible;
}

/* Las marcas cambian como una sola capa al navegar por el PGN. Esto evita que
   una flecha o un marco muestre durante un fotograma la geometría del nodo
   anterior sobre el tablero nuevo. */
#board.silicio-drawing-node-transition > svg.drawing-svg-container {
    transition: opacity 90ms cubic-bezier(0.22, 1, 0.36, 1) !important;
    will-change: opacity;
}

#board.silicio-drawing-node-transition > svg.drawing-svg-container.silicio-drawing-node-hidden {
    opacity: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
    #board.silicio-drawing-node-transition > svg.drawing-svg-container {
        transition: none !important;
    }
}

.paint-mode-overlay.active {
    touch-action: none !important;
    cursor: crosshair;
}

/* Entrenar Memoria conserva las marcas del PGN, pero no las muestra durante
   el ejercicio para evitar pistas visuales. La geometría permanece montada
   para que reaparezcan intactas al terminar. */
body.memory-training-active #board > svg.drawing-svg-container {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.memory-training-active #board square.highlight-gold,
body.memory-training-active #board square.highlight-red,
body.memory-training-active #board square.highlight-blue,
body.memory-training-active #board square.highlight-green {
    box-shadow: none !important;
}

/* ===== FLECHAS SVG ===== */
.drawing-svg-container g.arrow {
    pointer-events: none;
}

.drawing-svg-container g.arrow line {
    stroke-linecap: round;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
}

.drawing-svg-container g.arrow path {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
}

.drawing-svg-container g.arrow .knight-arrow-shaft,
.drawing-svg-container g.arrow-temp .knight-arrow-shaft {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ===== ANIMACIONES SUAVES ===== */
square[class*="highlight"] {
    transition: box-shadow 0.2s ease;
}

/* ===== HOVER EN CASILLAS MARCADAS ===== */
square[class*="highlight"]:hover {
    opacity: 0.9;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Ajustar grosor de marcos en móviles */
    square[class*="highlight"] {
        box-shadow: inset 0 0 0 3px !important;
    }
}

/* ===== MÓVIL HORIZONTAL - FLECHAS MÁS DELGADAS ===== */
@media (max-width: 768px) and (orientation: landscape) {
    /* Reducir grosor de flechas en móvil horizontal */
    .drawing-svg-container g.arrow line {
        stroke-width: 3.5 !important;
    }
    
    /* Reducir tamaño de sombra para flechas más delgadas */
    .drawing-svg-container g.arrow line,
    .drawing-svg-container g.arrow path {
        filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.3));
    }
}

/* ===== CONTROLES TÁCTILES DE PINTADO ===== */
.paint-touch-controls[hidden],
.paint-color-palette[hidden] {
    display: none !important;
}

#mobilePaintLauncher {
    display: none;
}

#mobilePaintLauncher svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
    pointer-events: none;
}

.paint-touch-controls {
    --paint-active-color: #DC143C;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px;
    border: 1px solid var(--theme-border, rgba(212, 175, 55, 0.35));
    border-radius: 16px;
    background: color-mix(in srgb, var(--theme-bg-secondary, #151515) 94%, transparent);
    box-shadow: 0 10px 28px var(--theme-shadow, rgba(0, 0, 0, 0.35));
    color: var(--theme-text-primary, #f5f5f5);
    box-sizing: border-box;
    z-index: 235;
    isolation: isolate;
}

body.paint-touch-controls-enabled .paint-touch-controls {
    display: flex;
}

.paint-mode-button,
.paint-color-choice,
.paint-shape-choice {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.paint-mode-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    margin: 0 !important;
    padding: 8px 12px !important;
    border: 1px solid var(--theme-border, rgba(212, 175, 55, 0.35)) !important;
    border-radius: 11px !important;
    background: var(--theme-button-bg, rgba(20, 20, 20, 0.92)) !important;
    color: var(--theme-button-text, var(--theme-text-primary, #f5f5f5)) !important;
    box-shadow: none !important;
    font: 700 12px/1.15 'Poppins', sans-serif;
    white-space: nowrap;
}

#paintTouchControls #modoPintadoBtn {
    display: inline-flex !important;
}

.paint-mode-button__icon {
    display: block;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    color: inherit;
    pointer-events: none;
}

#modoPintadoBtn .paint-mode-button__icon,
#modoPintadoBtn .paint-mode-button__icon > * {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.paint-mode-button__swatch {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    background: var(--paint-active-color);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.62), 0 0 12px color-mix(in srgb, var(--paint-active-color) 58%, transparent);
}

.paint-mode-button.button-paint-mode--active {
    border-color: var(--paint-active-color) !important;
    background: color-mix(in srgb, var(--paint-active-color) 18%, var(--theme-button-bg, #161616)) !important;
    color: var(--theme-text-primary, #fff) !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--paint-active-color) 48%, transparent) !important;
}

.paint-color-palette {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.paint-color-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.paint-color-choice {
    --paint-choice-color: #DC143C;
    position: relative;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    padding: 0;
    border: 2px solid color-mix(in srgb, var(--paint-choice-color) 58%, var(--theme-border, #777));
    border-radius: 12px;
    background: var(--paint-choice-color);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.18),
        inset 0 0 0 3px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.paint-shape-choice {
    position: relative;
    display: inline-grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    padding: 8px;
    place-items: center;
    border: 1px solid var(--theme-border, rgba(212, 175, 55, 0.42));
    border-radius: 12px;
    background: var(--theme-button-bg, rgba(20, 20, 20, 0.92));
    color: var(--theme-button-text, var(--theme-text-primary, #f5f5f5));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-accent-primary, #d4af37) 7%, transparent);
    cursor: pointer;
}

.paint-shape-choice svg {
    width: 25px;
    height: 25px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.paint-shape-choice[aria-pressed="true"] {
    border-color: var(--theme-accent-primary, #d4af37);
    background: color-mix(in srgb, var(--theme-accent-primary, #d4af37) 18%, var(--theme-button-bg, #161616));
    color: var(--theme-accent-primary, #d4af37);
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--theme-accent-primary, #d4af37) 18%, transparent),
        inset 0 0 0 1px color-mix(in srgb, var(--theme-accent-primary, #d4af37) 18%, transparent);
}

body.knight-arrow-invalid .paint-shape-choice[aria-pressed="true"] {
    border-color: #ff5b62;
    color: #ff7b80;
}

.paint-color-choice[aria-checked="true"] {
    transform: translateY(-1px);
    box-shadow:
        0 0 0 3px var(--theme-bg-primary, #111),
        0 0 0 5px var(--theme-accent-primary, #d4af37),
        0 7px 16px color-mix(in srgb, var(--paint-choice-color) 42%, transparent),
        inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.paint-color-choice[aria-checked="true"]::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font: 900 19px/1 sans-serif;
    text-shadow: 0 1px 3px #000, 0 0 2px #000;
}

.paint-mode-button:focus-visible,
.paint-color-choice:focus-visible,
.paint-shape-choice:focus-visible {
    outline: 3px solid var(--theme-accent-primary, #d4af37);
    outline-offset: 3px;
}

/* Móvil y tablet vertical: cápsula horizontal bajo el tablero. Al crecer,
   participa en el flujo y desplaza los controles de reproducción. */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1180px) and (orientation: portrait) {
    .mobile-workspace[data-mobile-workspace-tab="pgn"] #mobilePaintLauncher:not([hidden]) {
        display: inline-grid !important;
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0 !important;
        place-items: center;
        color: var(--theme-accent-primary, #d4af37);
    }

    #mobilePaintLauncher[aria-pressed="true"] {
        border-color: var(--theme-accent-primary, #d4af37) !important;
        background: color-mix(in srgb, var(--theme-accent-primary, #d4af37) 15%, var(--theme-bg-secondary, #151515)) !important;
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-accent-primary, #d4af37) 14%, transparent);
    }

    body.paint-touch-controls-enabled .chess-layout > .chess-container {
        flex-direction: column !important;
        justify-content: flex-start !important;
        gap: 0 !important;
    }

    body.paint-touch-controls-enabled:not([data-tablet-fix]) .chess-layout > .chess-container {
        padding-bottom: 3px !important;
        margin-bottom: 0 !important;
    }

    body.paint-touch-controls-enabled:not([data-tablet-fix]) .controls-container > .navigation-section {
        margin-top: 2px !important;
    }

    body.paint-touch-controls-enabled:not([data-tablet-fix]) .chess-layout > .controls-container {
        padding-top: 2px !important;
    }

    body.paint-touch-controls-enabled .paint-touch-controls {
        position: relative;
        order: 2;
        width: min(95vw, 620px);
        max-width: calc(100% - 12px);
        min-height: 58px;
        margin: 27px auto 3px;
        overflow: visible;
    }

    body.paint-mode-active .paint-touch-controls {
        justify-content: space-between;
    }

    .paint-mode-button {
        flex: 1 1 auto;
        min-width: 0;
    }

    .paint-color-palette {
        flex: 0 0 auto;
    }

    .paint-color-choice {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .paint-shape-choice {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }
}

@media (max-width: 460px) {
    body.paint-mode-active .paint-touch-controls {
        gap: 5px;
        padding: 5px;
    }

    body.paint-mode-active .paint-mode-button {
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        padding-inline: 7px !important;
        flex: 0 0 44px;
    }

    body.paint-mode-active .paint-mode-button__label {
        display: none;
    }

    body.paint-mode-active .paint-mode-button__swatch {
        display: none;
    }

    .paint-color-choice {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .paint-shape-choice {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        padding: 7px;
    }
}

/* Tablet horizontal, escritorio táctil y pizarra proyectada: paleta vertical
   al costado, con espacio reservado para no cubrir ninguna casilla. */
@media (min-width: 769px) and (orientation: landscape) {
    body.paint-touch-controls-enabled .chess-layout > .chess-container {
        padding-right: 70px !important;
    }

    html:not([data-workbench="v3"]) body.paint-touch-controls-enabled
    .chess-layout > .chess-container .play-surface {
        margin-right: 70px !important;
    }

    body.paint-touch-controls-enabled .paint-touch-controls {
        position: absolute;
        right: 8px;
        top: 50%;
        flex-direction: column;
        width: 54px;
        padding: 5px;
        transform: translateY(-50%);
    }

    .paint-mode-button {
        width: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 7px !important;
    }

    .paint-mode-button__label,
    .paint-mode-button__swatch {
        display: none;
    }

    .paint-color-palette {
        flex-direction: column;
    }

    .paint-color-options {
        flex-direction: column;
    }
}

@media (min-width: 769px) and (orientation: landscape) {
    html[data-workbench="v3"] body.paint-touch-controls-enabled:not([data-tablet-fix])
    .chess-layout > .chess-container {
        padding-right: 70px !important;
    }
    html[data-workbench="v3"] body.paint-touch-controls-enabled:not([data-tablet-fix])
    .chess-layout > .chess-container .play-surface #board.board {
        /* La paleta ocupa primero el espacio lateral libre. Solo limita el
           tablero si ambos no caben; nunca descuenta del tamaño elegido. */
        --paint-board-available: max(200px,
            calc(100vw - var(--panel-w-desktop) - var(--icons-sidebar-w) - 96px));
        max-width: var(--paint-board-available) !important;
        max-height: var(--paint-board-available) !important;
        min-width: 0 !important;
        min-height: 0 !important;
    }
}

/* Borrador en la propia barra; los accesos PGN abren pintado, nunca borran. */
#paintTouchControls #borrarMarcas {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    order: 3 !important;
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid var(--theme-border, rgba(212, 175, 55, .4));
    border-radius: 11px;
    background: var(--theme-button-bg, #161616);
    color: var(--theme-accent-primary, #d4af37);
    font: 600 12px/1.2 'Poppins', sans-serif;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}
#paintTouchControls #borrarMarcas svg {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}
#paintTouchControls #borrarMarcas:disabled {
    opacity: .42;
    cursor: default;
}
#paintTouchControls #borrarMarcas:focus-visible,
#workbenchPaintLauncher:focus-visible {
    outline: 2px solid var(--theme-accent-primary, #d4af37);
    outline-offset: 3px;
}
html[data-workbench="v3"] body #workbenchPaintLauncher {
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
}
#workbenchPaintLauncher svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    pointer-events: none;
}
#workbenchPaintLauncher[aria-pressed="true"] {
    background: color-mix(in srgb, var(--theme-accent-primary, #d4af37) 18%, var(--theme-bg-secondary, #151515)) !important;
    border-color: var(--theme-accent-primary, #d4af37) !important;
}
#workbenchPaintLauncher:disabled { opacity: .42; cursor: default; }
#paintTouchControls .paint-color-choice,
#paintTouchControls .paint-shape-choice { width: 44px; height: 44px; flex-basis: 44px; }
#paintTouchControls #modoPintadoBtn { order: 2 !important; }
#paintTouchControls #paintColorPalette { order: 1; }
@media (max-width: 768px), (min-width: 769px) and (max-width: 1180px) and (orientation: portrait) {
    #paintTouchControls { flex-wrap: wrap; }
    #paintTouchControls #borrarMarcas { padding-inline: 10px; }
}
@media (max-width: 460px) {
    body.paint-mode-active #paintTouchControls #borrarMarcas { width: 44px; padding-inline: 7px; }
    body.paint-mode-active #paintTouchControls #borrarMarcas span { display: none; }
}
@media (max-width: 380px) {
    body.paint-mode-active #paintTouchControls #paintColorPalette {
        flex: 1 0 100%;
        order: 0;
        margin-bottom: 4px;
    }
    body.paint-mode-active #paintTouchControls #modoPintadoBtn,
    body.paint-mode-active #paintTouchControls #borrarMarcas {
        width: auto;
        max-width: none;
        flex: 1 1 0;
    }
    body.paint-mode-active #paintTouchControls .paint-mode-button__label,
    body.paint-mode-active #paintTouchControls #borrarMarcas span { display: inline; }
    body.paint-mode-active #paintTouchControls .paint-mode-button__label { white-space: normal; }
}
@media (min-width: 769px) and (orientation: landscape) {
    body.paint-touch-controls-enabled #paintTouchControls { width: 56px; }
    #paintTouchControls #borrarMarcas { width: 44px; padding: 7px; }
    #paintTouchControls #borrarMarcas span { display: none; }
}
@media (min-width: 769px) and (max-width: 1200px) and (orientation: landscape) {
    html[data-workbench="v3"] body .workbench-pgn-heading-actions { flex-wrap: wrap; }
    html[data-workbench="v3"] body .workbench-pgn-heading-actions .workbench-beta-badge { display: none; }
}

/* ===== AJUSTES DE LA PALETA ===== */
.desktop-settings-panel .settings-panel-row--paint-colors {
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.settings-paint-studio-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 9px 10px;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.settings-paint-studio-toggle:hover,
.settings-paint-studio-toggle[aria-expanded="true"] {
    border-color: color-mix(in srgb, var(--theme-accent-primary, #d4af37) 30%, var(--theme-border, transparent));
    background: color-mix(in srgb, var(--theme-accent-primary, #d4af37) 6%, transparent);
}

.settings-paint-studio-toggle:focus-visible {
    outline: 2px solid var(--theme-accent-primary, #d4af37);
    outline-offset: -3px;
}

.settings-paint-studio-toggle__icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    box-sizing: border-box;
    border: 1px solid color-mix(in srgb, var(--theme-accent-primary, #d4af37) 42%, var(--theme-border, transparent));
    border-radius: 9px;
    background: color-mix(in srgb, var(--theme-accent-primary, #d4af37) 9%, var(--theme-bg-primary, #111));
    color: var(--theme-accent-primary, #d4af37);
    font: 700 18px/1 'Poppins', sans-serif;
}

.settings-paint-studio-body {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 2px 9px 10px;
}

.settings-paint-studio-body[hidden] {
    display: none !important;
}

.settings-paint-colors {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
}

.settings-paint-color {
    display: grid;
    min-width: 0;
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--theme-border, rgba(212, 175, 55, 0.25));
    border-left: 3px solid var(--paint-editor-color, var(--theme-accent-primary, #d4af37));
    border-radius: 12px;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--theme-accent-primary, #d4af37) 6%, transparent),
            transparent 55%),
        color-mix(in srgb, var(--theme-bg-secondary, #171717) 86%, transparent);
    color: var(--theme-text-secondary, #b8b8b8);
    font-family: 'Poppins', sans-serif;
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--theme-text-primary, #fff) 5%, transparent);
}

.settings-paint-color__header {
    display: grid;
    grid-template-columns: 42px minmax(64px, 1fr) minmax(104px, 118px);
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.settings-paint-color__identity {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.settings-paint-color__identity strong {
    overflow: hidden;
    color: var(--theme-text-primary, #f8f8f8);
    font-size: 10px;
    font-weight: 750;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-paint-color__identity small {
    overflow: hidden;
    color: var(--theme-text-muted, #8f96a3);
    font-size: 8px;
    font-weight: 550;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-paint-color__swatch {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 2px;
    border: 1px solid color-mix(in srgb, var(--theme-accent-primary, #d4af37) 42%, var(--theme-border, #5f5f5f));
    border-radius: 10px;
    background: var(--theme-bg-primary, #111);
    cursor: pointer;
    box-shadow: 0 5px 15px color-mix(in srgb, #000 20%, transparent);
}

.settings-paint-color__swatch::-webkit-color-swatch-wrapper {
    padding: 0;
}

.settings-paint-color__swatch::-webkit-color-swatch {
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 7px;
}

.settings-paint-color__swatch::-moz-color-swatch {
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 7px;
}

.settings-paint-color__swatch:focus-visible,
.settings-paint-hex input:focus-visible,
.settings-paint-rgb input:focus-visible {
    outline: 2px solid var(--theme-accent-primary, #d4af37);
    outline-offset: 2px;
}

.settings-paint-hex {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.settings-paint-hex > span,
.settings-paint-rgb label > span {
    color: var(--theme-text-muted, #8f96a3);
    font-size: 7px;
    font-weight: 750;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.settings-paint-hex input,
.settings-paint-rgb input {
    width: 100%;
    min-width: 0;
    height: 30px;
    margin: 0;
    box-sizing: border-box;
    border: 1px solid color-mix(in srgb, var(--theme-border, #5f5f5f) 82%, transparent);
    border-radius: 7px;
    background: color-mix(in srgb, var(--theme-bg-primary, #101010) 92%, transparent);
    color: var(--theme-text-primary, #f7f7f7);
    font: 650 10px/1 'Roboto Mono', 'Consolas', monospace;
    text-align: center;
    caret-color: var(--theme-accent-primary, #d4af37);
}

.settings-paint-hex input {
    text-transform: uppercase;
}

.settings-paint-hex input[aria-invalid="true"],
.settings-paint-rgb input[aria-invalid="true"] {
    border-color: var(--theme-danger, #ef4444);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-danger, #ef4444) 15%, transparent);
}

.settings-paint-rgb {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding-top: 7px;
    border-top: 1px solid color-mix(in srgb, var(--theme-border, rgba(212, 175, 55, 0.25)) 66%, transparent);
}

.settings-paint-rgb label {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.settings-paint-rgb label > span {
    color: var(--theme-accent-primary, #d4af37);
    font-size: 8px;
    text-align: center;
}

.settings-paint-rgb input {
    appearance: textfield;
}

.settings-paint-rgb input::-webkit-inner-spin-button,
.settings-paint-rgb input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}

.settings-paint-shortcuts {
    display: none;
    gap: 9px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--theme-accent-primary, #d4af37) 32%, var(--theme-border, transparent));
    border-radius: 12px;
    background: color-mix(in srgb, var(--theme-accent-primary, #d4af37) 7%, var(--theme-bg-primary, #111));
}

.settings-paint-shortcuts__heading {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.settings-paint-shortcuts__heading > span:first-child {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--theme-accent-primary, #d4af37) 45%, transparent);
    border-radius: 8px;
    color: var(--theme-accent-primary, #d4af37);
    font-size: 14px;
}

.settings-paint-shortcuts__heading > span:last-child {
    display: grid;
    gap: 2px;
}

.settings-paint-shortcuts__heading strong {
    color: var(--theme-text-primary, #f7f7f7);
    font-size: 9px;
    line-height: 1.2;
}

.settings-paint-shortcuts__heading small {
    color: var(--theme-text-muted, #8f96a3);
    font-size: 7px;
    line-height: 1.35;
}

.settings-paint-shortcuts__grid {
    display: grid;
    gap: 5px;
}

.settings-paint-shortcuts__grid > span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    color: var(--theme-text-secondary, #c4c7ce);
    font-size: 7px;
}

.settings-paint-shortcuts__grid i {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border: 1px solid color-mix(in srgb, #fff 55%, transparent);
    border-radius: 50%;
    background: var(--paint-shortcut-color, #d4af37);
    box-shadow: 0 0 8px color-mix(in srgb, var(--paint-shortcut-color, #d4af37) 38%, transparent);
}

.settings-paint-shortcuts__grid kbd {
    flex: 0 0 auto;
    padding: 3px 5px;
    border: 1px solid color-mix(in srgb, var(--theme-border, #5f5f5f) 82%, transparent);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--theme-bg-secondary, #181818);
    color: var(--theme-text-primary, #f7f7f7);
    font: 650 7px/1 'Poppins', sans-serif;
}

.settings-paint-shortcuts__grid b {
    color: var(--theme-text-muted, #8f96a3);
    font-weight: 600;
}

.settings-paint-shortcuts__grid em {
    margin-left: auto;
    color: var(--theme-text-muted, #8f96a3);
    font-size: 7px;
    font-style: normal;
    white-space: nowrap;
}

.desktop-settings-panel .settings-paint-colors-reset {
    align-self: flex-start;
    width: auto;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 10px;
}

@media (min-width: 1181px) and (hover: hover) and (pointer: fine) {
    .settings-paint-shortcuts {
        display: grid;
    }
}

@media (min-width: 600px) and (max-width: 1180px) and (orientation: portrait) {
    .settings-paint-colors {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .settings-paint-color__header {
        grid-template-columns: 38px minmax(54px, 1fr) minmax(94px, 108px);
        gap: 6px;
    }

    .settings-paint-color__swatch {
        width: 38px;
        min-width: 38px;
        height: 38px;
    }

    .settings-paint-rgb {
        gap: 4px;
    }
}
