/* ==========================================================
   TypingTutor.Online
   Natural Hand Position + Side Mode Fix v17.0.31
========================================================== */

/* Mode visibility */
html[data-hand-guidance="overlay"] .hands-guidance-card {
    display: none !important;
}

/*
 * Side Hands is a true fourth style. Hide BOTH keyboard-overlay engines:
 * - #handsKeyboardOverlay: Articulated and Capsule
 * - #handsClassicOverlay: Classic Curved
 */
html[data-hand-guidance="separate"] #handsKeyboardOverlay,
html[data-hand-guidance="separate"] #handsClassicOverlay,
html[data-hand-guidance-style="side"] #handsKeyboardOverlay,
html[data-hand-guidance-style="side"] #handsClassicOverlay,
html[data-show-side-hands="true"] #handsKeyboardOverlay,
html[data-show-side-hands="true"] #handsClassicOverlay {
    display: none !important;
}

html[data-hand-guidance="hidden"] .hands-guidance-card,
html[data-hand-guidance="hidden"] #handsKeyboardOverlay,
html[data-hand-guidance="hidden"] #handsClassicOverlay,
html[data-hand-guidance-style="off"] #handsKeyboardOverlay,
html[data-hand-guidance-style="off"] #handsClassicOverlay {
    display: none !important;
}

/*
 * Mobile keeps both guidance designs hidden because the full tutor
 * keyboard is intentionally hidden there.
 */
@media (max-width: 760px) {
    .hands-guidance-card,
    #handsKeyboardOverlay {
        display: none !important;
    }
}

/* ==========================================================
   SEPARATE HAND PANEL
========================================================== */

/* ==========================================================
   TypingTutor.Online
   Clean Functional Hands
========================================================== */

#handsContainer {
    width: 100%;
    max-width: 1040px;
    height: 330px;

    margin: 18px auto 24px;

    overflow: hidden;
    user-select: none;

    background: #ffffff;
    border: 1px solid #edf1f6;
    border-radius: 28px;

    box-shadow:
        0 14px 35px rgba(15, 23, 42, 0.06);
}

#typingHands {
    display: block;
    width: 100%;
    height: 100%;
}

/* ==========================================================
   PALMS AND WRISTS
========================================================== */

.hand-palm {
    fill: #ffd4ae;
    stroke: #dca56f;
    stroke-width: 3;
}

.hand-wrist {
    fill: #f6c79d;
    stroke: #dca56f;
    stroke-width: 3;
}

/* ==========================================================
   FINGERS
========================================================== */

.finger {
    transition:
        filter 0.17s ease,
        opacity 0.17s ease;
}

.finger-segment {
    fill: #ffd4ae;
    stroke: #dca56f;
    stroke-width: 2.2;

    transition:
        fill 0.15s ease,
        stroke 0.15s ease;
}

.finger-tip {
    fill: #f8c89e;
    stroke: #dca56f;
    stroke-width: 2.2;

    transition:
        fill 0.15s ease,
        stroke 0.15s ease;
}

/* ==========================================================
   EXPECTED FINGER
========================================================== */

.finger.finger-active {
    filter:
        drop-shadow(0 5px 6px rgba(37, 99, 235, 0.42));
}

.finger.finger-active .finger-segment,
.finger.finger-active .finger-tip {
    fill: #8fc4ff;
    stroke: #2563eb;
    stroke-width: 3;
}

/* ==========================================================
   CORRECT PRESS
========================================================== */

.finger.finger-correct {
    filter:
        drop-shadow(0 5px 6px rgba(22, 163, 74, 0.4));
}

.finger.finger-correct .finger-segment,
.finger.finger-correct .finger-tip {
    fill: #86efac;
    stroke: #16a34a;
    stroke-width: 3;
}

/* ==========================================================
   WRONG PRESS
========================================================== */

.finger.finger-wrong {
    filter:
        drop-shadow(0 5px 6px rgba(239, 68, 68, 0.42));
}

.finger.finger-wrong .finger-segment,
.finger.finger-wrong .finger-tip {
    fill: #fca5a5;
    stroke: #ef4444;
    stroke-width: 3;
}

/* ==========================================================
   PRESS FEEDBACK
========================================================== */

.finger.finger-press {
    animation:
        fingerPress 0.22s ease;
}

@keyframes fingerPress {

    0% {
        opacity: 1;
    }

    45% {
        opacity: 0.55;
    }

    100% {
        opacity: 1;
    }

}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 700px) {

    #handsContainer {
        height: 235px;
        margin-top: 12px;
        border-radius: 20px;
    }

}

/* Override the old mobile rule and mode visibility after its source CSS. */
html[data-hand-guidance="overlay"] .hands-guidance-card,
html[data-hand-guidance="hidden"] .hands-guidance-card {
    display: none !important;
}

html[data-hand-guidance="separate"] .hands-guidance-card,
html[data-hand-guidance-style="side"] .hands-guidance-card,
html[data-show-side-hands="true"] .hands-guidance-card {
    display: flex !important;
}

@media (max-width: 760px) {
    html[data-hand-guidance] .hands-guidance-card {
        display: none !important;
    }
}

/* Dark mode for the original separate panel */
html[data-theme="dark"][data-hand-guidance="separate"] #handsContainer {
    background: #111a2b;
    border-color: #26364e;
}

html[data-theme="dark"][data-hand-guidance="separate"] .hand-palm,
html[data-theme="dark"][data-hand-guidance="separate"] .finger-segment {
    fill: #d7b08c;
    stroke: #9a7454;
}

html[data-theme="dark"][data-hand-guidance="separate"] .hand-wrist,
html[data-theme="dark"][data-hand-guidance="separate"] .finger-tip {
    fill: #c99e79;
    stroke: #9a7454;
}

/* ==========================================================
   HANDS OVER KEYBOARD — HAND CLEANUP v12.3
========================================================== */

.keyboard-guidance-card {
    position: relative;
    overflow: hidden;
}

#handsKeyboardOverlay {
    position: absolute;
    z-index: 6;

    /*
     * The overlay begins at the home-row area.
     * Function and number rows stay completely unobstructed.
     */
    top: 48%;
    right: 5%;
    bottom: -2%;
    left: 5%;

    pointer-events: none;
    user-select: none;
}

#handsKeyboardOverlay svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.hand-structure-line,
.finger-line,
.finger-glow {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hand-structure-line {
    stroke: rgba(118, 124, 134, .68);
    stroke-width: 5.5;
}

.finger-line {
    stroke: rgba(118, 124, 134, .76);
    stroke-width: 6;

    transition:
        stroke .15s ease,
        stroke-width .15s ease,
        filter .15s ease,
        transform .15s ease;
}

.finger-glow {
    stroke: transparent;
    stroke-width: 20;
    opacity: 0;

    transition:
        stroke .15s ease,
        opacity .15s ease;
}

.finger.finger-active .finger-line {
    stroke: #2f6df6;
    stroke-width: 9;
    filter:
        drop-shadow(
            0 0 4px
            rgba(47, 109, 246, .30)
        );
}

.finger.finger-active .finger-glow {
    stroke: rgba(47, 109, 246, .13);
    opacity: 1;
}

.finger.finger-correct .finger-line {
    stroke: #16a34a;
    stroke-width: 9;
}

.finger.finger-correct .finger-glow {
    stroke: rgba(22, 163, 74, .13);
    opacity: 1;
}

.finger.finger-wrong .finger-line {
    stroke: #dc2626;
    stroke-width: 9;
}

.finger.finger-wrong .finger-glow {
    stroke: rgba(220, 38, 38, .13);
    opacity: 1;
}

/*
 * Animate only the visible finger paths, not the SVG finger group.
 * The left-hand group already has a permanent translate/scale transform.
 * Animating the group would overwrite that transform and make the finger
 * jump away from its correctly aligned position.
 */
.finger.finger-press .finger-line,
.finger.finger-press .finger-glow {
    animation: naturalFingerPress .20s ease;
    transform-box: fill-box;
    transform-origin: center bottom;
}

@keyframes naturalFingerPress {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(4px);
    }

    100% {
        transform: translateY(0);
    }
}

#keyboardContainer {
    position: relative;
    z-index: 2;
}

#targetRowGuide {
    position: relative;
    z-index: 8;
}

html[data-hand-guidance="separate"] .hands-guidance-card {
    display: block !important;
}

html[data-hand-guidance="overlay"] .hands-guidance-card,
html[data-hand-guidance="hidden"] .hands-guidance-card {
    display: none !important;
}

html[data-hand-guidance="separate"] #handsKeyboardOverlay,
html[data-hand-guidance="hidden"] #handsKeyboardOverlay,
html[data-show-keyboard="false"] #handsKeyboardOverlay {
    display: none !important;
}

html[data-hand-guidance="overlay"] #handsKeyboardOverlay {
    display: block;
}

html[data-theme="dark"] .hand-structure-line,
html[data-theme="dark"] .finger-line {
    stroke: rgba(174, 185, 202, .72);
}

html[data-theme="dark"]
.finger.finger-active .finger-line {
    stroke: #62a0ff;
}

html[data-theme="dark"]
.finger.finger-active .finger-glow {
    stroke: rgba(98, 160, 255, .16);
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .hand-structure-line,
    html[data-theme="system"] .finger-line {
        stroke: rgba(174, 185, 202, .72);
    }
}

@media (max-width: 760px) {
    #handsKeyboardOverlay {
        display: none !important;
    }
}

/* ==========================================================
   NUMBER AND SPECIAL-KEY FINGER REACH v13.4
========================================================== */

.finger-motion {
    transform-box: fill-box;
    transform-origin: center bottom;
    transition:
        transform .24s cubic-bezier(.2, .8, .2, 1);
    will-change: transform;
}

/* The press animation stays inside the moving finger wrapper. */
.finger.finger-press .finger-motion {
    filter: brightness(1.02);
}


/* Extra easing for long reaches to the number row. */
.finger-motion {
    transition-duration: .28s;
}


/* ==========================================================
   ARTICULATED LEFT INDEX — v13.5
========================================================== */

.articulated-finger .finger-bone {
    transition: d .20s ease;
}

.articulated-finger .finger-joint,
.articulated-finger .finger-tip-node {
    fill: rgba(255, 255, 255, .92);
    stroke: rgba(118, 124, 134, .82);
    stroke-width: 3.2;
    transition:
        cx .20s ease,
        cy .20s ease,
        fill .15s ease,
        stroke .15s ease;
}

.articulated-finger .finger-tip-node {
    fill: rgba(255, 255, 255, .98);
}

.articulated-finger.finger-active .finger-joint,
.articulated-finger.finger-active .finger-tip-node {
    fill: rgba(47, 109, 246, .22);
    stroke: #2f6df6;
}

.articulated-finger.finger-correct .finger-joint,
.articulated-finger.finger-correct .finger-tip-node {
    fill: rgba(22, 163, 74, .22);
    stroke: #16a34a;
}

.articulated-finger.finger-wrong .finger-joint,
.articulated-finger.finger-wrong .finger-tip-node {
    fill: rgba(220, 38, 38, .20);
    stroke: #dc2626;
}

html[data-theme="dark"]
.articulated-finger .finger-joint,
html[data-theme="dark"]
.articulated-finger .finger-tip-node {
    fill: rgba(17, 26, 43, .96);
    stroke: rgba(174, 185, 202, .80);
}

/* ==========================================================
   ARTICULATED ALPHABET HANDS v13.6
========================================================== */

.articulated-finger .finger-bone,
.articulated-finger .articulated-glow,
.articulated-finger .finger-joint,
.articulated-finger .finger-tip-node {
    transition:
        d .25s cubic-bezier(.2, .8, .2, 1),
        cx .25s cubic-bezier(.2, .8, .2, 1),
        cy .25s cubic-bezier(.2, .8, .2, 1),
        stroke .15s ease,
        fill .15s ease,
        opacity .15s ease;
}


/* Articulated thumbs */
.articulated-finger.left-thumb-finger .finger-joint,
.articulated-finger.right-thumb-finger .finger-joint {
    r: 4.3;
}

.articulated-finger.left-thumb-finger .finger-tip-node,
.articulated-finger.right-thumb-finger .finger-tip-node {
    r: 6.2;
}

.articulated-finger.left-thumb-finger .finger-bone,
.articulated-finger.right-thumb-finger .finger-bone {
    stroke-width: 6.5;
}


/* v14.0: two-joint articulated thumbs */
.articulated-thumb .finger-middle,
.articulated-thumb .finger-joint:nth-of-type(2) {
    display: none;
}


/* ==========================================================
   TRANSPARENT SKIN-TONE FINGERS v14.1
========================================================== */

:root {
    --hand-skin-fill: rgba(232, 190, 145, .34);
    --hand-skin-fill-active: rgba(232, 190, 145, .44);
    --hand-skin-fill-correct: rgba(190, 225, 198, .40);
    --hand-skin-fill-wrong: rgba(244, 193, 193, .38);

    --hand-rest-stroke: rgba(118, 124, 134, .78);
    --hand-active-stroke: rgba(47, 109, 246, .94);
    --hand-correct-stroke: rgba(22, 163, 74, .94);
    --hand-wrong-stroke: rgba(220, 38, 38, .94);
}

/*
 * The articulated finger bones stay readable but no longer create a
 * heavy solid-blue shape over the active key. The skin-toned joints are
 * translucent, so key labels remain visible underneath.
 */
.articulated-finger .finger-bone {
    stroke: var(--hand-rest-stroke);
    stroke-width: 5.5;
    filter: none;
}

.articulated-finger .finger-joint,
.articulated-finger .finger-tip-node {
    fill: var(--hand-skin-fill);
    stroke: var(--hand-rest-stroke);
    stroke-width: 2.8;
}

.articulated-finger .finger-tip-node {
    fill: rgba(232, 190, 145, .42);
}

/* Active / expected finger */
.articulated-finger.finger-active .finger-bone {
    stroke: var(--hand-active-stroke);
    stroke-width: 7;
    filter:
        drop-shadow(
            0 0 4px
            rgba(47, 109, 246, .20)
        );
}

.articulated-finger.finger-active .finger-joint,
.articulated-finger.finger-active .finger-tip-node {
    fill: var(--hand-skin-fill-active);
    stroke: var(--hand-active-stroke);
}

.articulated-finger.finger-active .articulated-glow {
    stroke: rgba(47, 109, 246, .11);
    opacity: .56;
}

/* Correct feedback */
.articulated-finger.finger-correct .finger-bone {
    stroke: var(--hand-correct-stroke);
    stroke-width: 7;
}

.articulated-finger.finger-correct .finger-joint,
.articulated-finger.finger-correct .finger-tip-node {
    fill: var(--hand-skin-fill-correct);
    stroke: var(--hand-correct-stroke);
}

.articulated-finger.finger-correct .articulated-glow {
    stroke: rgba(22, 163, 74, .10);
    opacity: .68;
}

/* Wrong feedback */
.articulated-finger.finger-wrong .finger-bone {
    stroke: var(--hand-wrong-stroke);
    stroke-width: 7;
}

.articulated-finger.finger-wrong .finger-joint,
.articulated-finger.finger-wrong .finger-tip-node {
    fill: var(--hand-skin-fill-wrong);
    stroke: var(--hand-wrong-stroke);
}

.articulated-finger.finger-wrong .articulated-glow {
    stroke: rgba(220, 38, 38, .10);
    opacity: .68;
}

/*
 * Keep the target key label above the key background. This does not place
 * the label above the finger SVG, but the transparent finger styling means
 * the character remains clearly readable through the guidance layer.
 */
#keyboardContainer .key,
#keyboardContainer [data-code],
#keyboardContainer [data-key] {
    isolation: isolate;
}

/* Dark mode: warmer translucent skin with clear outlines. */
html[data-theme="dark"] {
    --hand-skin-fill: rgba(198, 148, 108, .30);
    --hand-skin-fill-active: rgba(210, 160, 116, .40);
    --hand-skin-fill-correct: rgba(117, 179, 132, .34);
    --hand-skin-fill-wrong: rgba(204, 113, 113, .34);
    --hand-rest-stroke: rgba(174, 185, 202, .78);
    --hand-active-stroke: rgba(98, 160, 255, .96);
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
        --hand-skin-fill: rgba(198, 148, 108, .30);
        --hand-skin-fill-active: rgba(210, 160, 116, .40);
        --hand-skin-fill-correct: rgba(117, 179, 132, .34);
        --hand-skin-fill-wrong: rgba(204, 113, 113, .34);
        --hand-rest-stroke: rgba(174, 185, 202, .78);
        --hand-active-stroke: rgba(98, 160, 255, .96);
    }
}


/* ==========================================================
   READABLE TRANSPARENT SKIN FINGERS v14.2
========================================================== */

:root {
    --finger-skin-rest: rgba(224, 180, 142, .20);
    --finger-skin-active: rgba(224, 180, 142, .34);
    --finger-skin-correct: rgba(196, 224, 201, .32);
    --finger-skin-wrong: rgba(239, 197, 197, .30);

    --finger-outline-rest: rgba(112, 120, 132, .72);
    --finger-outline-active: rgba(37, 99, 235, .92);
    --finger-outline-correct: rgba(22, 163, 74, .92);
    --finger-outline-wrong: rgba(220, 38, 38, .92);
}

/*
 * The wide under-stroke becomes the translucent finger body.
 * The narrow upper stroke becomes the clean finger outline.
 * This keeps key labels visible through the finger.
 */
.articulated-finger .articulated-glow {
    stroke: var(--finger-skin-rest);
    stroke-width: 17;
    opacity: 1;
    filter: none;
}

.articulated-finger .finger-bone {
    stroke: var(--finger-outline-rest);
    stroke-width: 3.5;
    filter: none;
}

.articulated-finger .finger-joint,
.articulated-finger .finger-tip-node {
    fill: rgba(224, 180, 142, .28);
    stroke: var(--finger-outline-rest);
    stroke-width: 2.2;
}

/* Expected finger */
.articulated-finger.finger-active .articulated-glow {
    stroke: var(--finger-skin-active);
    stroke-width: 19;
    opacity: 1;
    filter: none;
}

.articulated-finger.finger-active .finger-bone {
    stroke: var(--finger-outline-active);
    stroke-width: 4;
    filter: drop-shadow(0 0 3px rgba(37, 99, 235, .20));
}

.articulated-finger.finger-active .finger-joint,
.articulated-finger.finger-active .finger-tip-node {
    fill: rgba(224, 180, 142, .42);
    stroke: var(--finger-outline-active);
}

/* Correct feedback */
.articulated-finger.finger-correct .articulated-glow {
    stroke: var(--finger-skin-correct);
    stroke-width: 19;
    opacity: 1;
}

.articulated-finger.finger-correct .finger-bone {
    stroke: var(--finger-outline-correct);
    stroke-width: 4;
}

.articulated-finger.finger-correct .finger-joint,
.articulated-finger.finger-correct .finger-tip-node {
    fill: var(--finger-skin-correct);
    stroke: var(--finger-outline-correct);
}

/* Wrong feedback */
.articulated-finger.finger-wrong .articulated-glow {
    stroke: var(--finger-skin-wrong);
    stroke-width: 19;
    opacity: 1;
}

.articulated-finger.finger-wrong .finger-bone {
    stroke: var(--finger-outline-wrong);
    stroke-width: 4;
}

.articulated-finger.finger-wrong .finger-joint,
.articulated-finger.finger-wrong .finger-tip-node {
    fill: var(--finger-skin-wrong);
    stroke: var(--finger-outline-wrong);
}

/*
 * Readable target key: use a translucent blue surface instead of a
 * solid blue block. The character remains dark and clearly visible.
 */
#keyboardContainer .key-next {
    background: rgba(47, 103, 246, .18) !important;
    color: #172033 !important;
    border-color: rgba(47, 103, 246, .78) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .55),
        0 0 0 4px rgba(47, 103, 246, .10) !important;
}

#keyboardContainer .key-next .key-primary,
#keyboardContainer .key-next .key-secondary {
    color: #172033 !important;
    position: relative;
    z-index: 2;
}

#keyboardContainer .key-next .home-bump {
    background: rgba(23, 32, 51, .72) !important;
}

/* Keep feedback colors readable without hiding characters. */
#keyboardContainer .key-correct {
    background: rgba(34, 197, 94, .18) !important;
    border-color: rgba(22, 163, 74, .78) !important;
}

#keyboardContainer .key-wrong {
    background: rgba(239, 68, 68, .18) !important;
    border-color: rgba(220, 38, 38, .78) !important;
}

#keyboardContainer .key-correct .key-primary,
#keyboardContainer .key-correct .key-secondary,
#keyboardContainer .key-wrong .key-primary,
#keyboardContainer .key-wrong .key-secondary {
    color: #172033 !important;
}

html[data-theme="dark"] {
    --finger-skin-rest: rgba(197, 145, 106, .18);
    --finger-skin-active: rgba(205, 153, 111, .32);
    --finger-skin-correct: rgba(84, 161, 104, .26);
    --finger-skin-wrong: rgba(184, 89, 89, .26);
    --finger-outline-rest: rgba(181, 191, 207, .72);
}

html[data-theme="dark"] #keyboardContainer .key-next {
    background: rgba(79, 139, 255, .22) !important;
    color: #f8fafc !important;
    border-color: rgba(98, 160, 255, .82) !important;
}

html[data-theme="dark"] #keyboardContainer .key-next .key-primary,
html[data-theme="dark"] #keyboardContainer .key-next .key-secondary,
html[data-theme="dark"] #keyboardContainer .key-correct .key-primary,
html[data-theme="dark"] #keyboardContainer .key-correct .key-secondary,
html[data-theme="dark"] #keyboardContainer .key-wrong .key-primary,
html[data-theme="dark"] #keyboardContainer .key-wrong .key-secondary {
    color: #f8fafc !important;
}


/* ==========================================================
   CLEAR KEY FINGERTIPS v14.3
========================================================== */

/*
 * The skin body is intentionally very light. The final finger segment
 * stops before the key centre, while a larger hollow fingertip ring
 * surrounds the target character. This keeps letters such as Z visible.
 */
:root {
    --finger-skin-rest: rgba(224, 180, 142, .075);
    --finger-skin-active: rgba(224, 180, 142, .115);
    --finger-skin-correct: rgba(196, 224, 201, .12);
    --finger-skin-wrong: rgba(239, 197, 197, .11);
}

.articulated-finger .articulated-glow {
    stroke-width: 13px;
    opacity: 1;
}

.articulated-finger.finger-active .articulated-glow,
.articulated-finger.finger-correct .articulated-glow,
.articulated-finger.finger-wrong .articulated-glow {
    stroke-width: 14px;
}

/* Larger hollow fingertip / nail ring leaves the key centre readable. */
.articulated-finger .finger-tip-node {
    fill: rgba(255, 255, 255, .08) !important;
    stroke-width: 2.4px;
}

.articulated-finger.finger-active .finger-tip-node {
    fill: rgba(224, 180, 142, .07) !important;
    stroke-width: 3px;
}

.articulated-finger.finger-correct .finger-tip-node {
    fill: rgba(196, 224, 201, .07) !important;
    stroke-width: 3px;
}

.articulated-finger.finger-wrong .finger-tip-node {
    fill: rgba(239, 197, 197, .07) !important;
    stroke-width: 3px;
}

/* Joint circles stay small and subtle; only the fingertip is enlarged. */
.articulated-finger .finger-joint {
    fill: rgba(224, 180, 142, .16) !important;
}

html[data-theme="dark"] {
    --finger-skin-rest: rgba(205, 153, 111, .065);
    --finger-skin-active: rgba(205, 153, 111, .105);
    --finger-skin-correct: rgba(84, 161, 104, .10);
    --finger-skin-wrong: rgba(184, 89, 89, .10);
}

html[data-theme="dark"] .articulated-finger .finger-tip-node {
    fill: rgba(15, 23, 42, .08) !important;
}


/* ==========================================================
   FINAL READABLE FINGER MOTION v14.4
========================================================== */

/*
 * Extra transparency keeps every key character readable.
 * The larger hollow nail ring surrounds the character instead of
 * covering it, while the finger body remains lightly visible.
 */
:root {
    --finger-skin-rest: rgba(224, 180, 142, .040);
    --finger-skin-active: rgba(224, 180, 142, .070);
    --finger-skin-correct: rgba(196, 224, 201, .070);
    --finger-skin-wrong: rgba(239, 197, 197, .065);
}

.articulated-finger .articulated-glow {
    stroke-width: 11px;
}

.articulated-finger.finger-active .articulated-glow,
.articulated-finger.finger-correct .articulated-glow,
.articulated-finger.finger-wrong .articulated-glow {
    stroke-width: 12px;
}

/* Larger, clearer and almost transparent fingertip/nail circle. */
.articulated-finger .finger-tip-node {
    fill: rgba(255, 255, 255, .018) !important;
    stroke-width: 2.2px;
}

.articulated-finger.finger-active .finger-tip-node {
    fill: rgba(224, 180, 142, .025) !important;
    stroke-width: 2.7px;
}

.articulated-finger.finger-correct .finger-tip-node {
    fill: rgba(196, 224, 201, .025) !important;
    stroke-width: 2.7px;
}

.articulated-finger.finger-wrong .finger-tip-node {
    fill: rgba(239, 197, 197, .025) !important;
    stroke-width: 2.7px;
}

/* Keep bend joints subtle so they do not compete with keyboard labels. */
.articulated-finger .finger-joint {
    fill: rgba(224, 180, 142, .095) !important;
}

html[data-theme="dark"] {
    --finger-skin-rest: rgba(205, 153, 111, .035);
    --finger-skin-active: rgba(205, 153, 111, .060);
    --finger-skin-correct: rgba(84, 161, 104, .055);
    --finger-skin-wrong: rgba(184, 89, 89, .055);
}

html[data-theme="dark"] .articulated-finger .finger-tip-node {
    fill: rgba(15, 23, 42, .018) !important;
}


/* ==========================================================
   THREE HAND GUIDANCE MODES v15.0
========================================================== */

/* Shared overlay positioning. */
#handsClassicOverlay {
    position: absolute;
    z-index: 6;
    top: 48%;
    right: 5%;
    bottom: -2%;
    left: 5%;
    pointer-events: none;
    user-select: none;
}

#handsClassicOverlay svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Articulated is the recommended/default engine. */
html[data-hand-guidance-style="articulated"] #handsKeyboardOverlay,
html[data-hand-guidance-style="capsule"] #handsKeyboardOverlay {
    display: block !important;
}

html[data-hand-guidance-style="articulated"] #handsClassicOverlay,
html[data-hand-guidance-style="capsule"] #handsClassicOverlay,
html[data-hand-guidance-style="side"] #handsClassicOverlay,
html[data-hand-guidance-style="off"] #handsClassicOverlay {
    display: none !important;
}

/* Classic curved mode uses the final pre-articulated hands. */
html[data-hand-guidance-style="classic"] #handsClassicOverlay {
    display: block !important;
}

html[data-hand-guidance-style="classic"] #handsKeyboardOverlay,
html[data-hand-guidance-style="side"] #handsKeyboardOverlay,
html[data-hand-guidance-style="off"] #handsKeyboardOverlay {
    display: none !important;
}

/* The old separate hand card is not one of the final three modes. */
.hands-guidance-card {
    display: none !important;
}

/* Capsule / Ribbon: same accurate target engine, premium rounded body. */
html[data-hand-guidance-style="capsule"] #handsKeyboardOverlay .articulated-glow {
    stroke: rgba(224, 180, 142, .34) !important;
    stroke-width: 20px !important;
    opacity: 1 !important;
    filter: drop-shadow(0 2px 2px rgba(84, 62, 44, .12));
}

html[data-hand-guidance-style="capsule"] #handsKeyboardOverlay .finger-bone {
    stroke: rgba(123, 101, 84, .72) !important;
    stroke-width: 2.6px !important;
}

html[data-hand-guidance-style="capsule"] #handsKeyboardOverlay .finger-joint {
    fill: rgba(224, 180, 142, .42) !important;
    stroke: rgba(123, 101, 84, .62) !important;
    r: 4.5;
}

html[data-hand-guidance-style="capsule"] #handsKeyboardOverlay .finger-tip-node {
    fill: rgba(255, 246, 238, .28) !important;
    stroke: rgba(123, 101, 84, .72) !important;
    stroke-width: 2px !important;
}

html[data-hand-guidance-style="capsule"] #handsKeyboardOverlay .finger-active .articulated-glow {
    stroke: rgba(224, 180, 142, .42) !important;
    filter:
        drop-shadow(0 0 5px rgba(37, 99, 235, .28));
}

html[data-hand-guidance-style="capsule"] #handsKeyboardOverlay .finger-active .finger-bone,
html[data-hand-guidance-style="capsule"] #handsKeyboardOverlay .finger-active .finger-tip-node {
    stroke: rgba(37, 99, 235, .92) !important;
}

html[data-theme="dark"][data-hand-guidance-style="capsule"] #handsKeyboardOverlay .articulated-glow {
    stroke: rgba(194, 143, 104, .30) !important;
}

html[data-theme="dark"][data-hand-guidance-style="capsule"] #handsKeyboardOverlay .finger-bone {
    stroke: rgba(210, 183, 160, .72) !important;
}

/* Hide all hand modes when the on-screen keyboard is hidden. */
html[data-show-keyboard="false"] #handsKeyboardOverlay,
html[data-show-keyboard="false"] #handsClassicOverlay {
    display: none !important;
}

/* Mobile keeps the tutor keyboard and all hand modes hidden. */
@media (max-width: 760px) {
    #handsKeyboardOverlay,
    #handsClassicOverlay {
        display: none !important;
    }
}


/* ==========================================================
   CAPSULE / RIBBON VISUAL POLISH v15.1
========================================================== */

/* Capsule-only SVG layers remain absent from the other visual modes. */
.capsule-ribbon-segment,
.capsule-ribbon-base,
.capsule-ribbon-nail {
    display: none;
}

html[data-hand-guidance-style="capsule"] #handsKeyboardOverlay {
    --capsule-skin: rgba(238, 225, 209, .18);
    --capsule-skin-active: rgba(238, 225, 209, .14);
    --capsule-skin-correct: rgba(214, 235, 220, .22);
    --capsule-skin-wrong: rgba(241, 214, 214, .22);
    --capsule-edge: rgba(181, 154, 129, .42);
    --capsule-edge-active: rgba(37, 99, 235, .38);
    --capsule-edge-correct: rgba(22, 163, 74, .82);
    --capsule-edge-wrong: rgba(220, 38, 38, .82);
    --capsule-highlight: rgba(255, 255, 255, .12);
    --capsule-nail: rgba(255, 248, 241, .10);
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-segment,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-base,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-nail {
    display: block;
}

/* Hide the visible skeleton but keep it in the DOM for animation logic. */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-glow,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-bone {
    opacity: 0 !important;
}

/* Joint nodes become faint natural crease rings rather than bead joints. */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-joint {
    display: block;
    fill: transparent !important;
    stroke: rgba(143, 103, 75, .22) !important;
    stroke-width: 1.05px !important;
    r: 5.0;
    opacity: .52;
}

/* The old large fingertip ring is replaced by a skin cap + nail. */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-tip-node {
    display: none !important;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-nail {
    display: none !important;
}

.capsule-ribbon-segment {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    transition:
        stroke .16s ease,
        opacity .16s ease,
        filter .16s ease;
}

/* Tapered overlapping sections create the rounded real-finger silhouette. */
.capsule-ribbon-outline.capsule-lower { stroke-width: 30px; }
.capsule-ribbon-outline.capsule-middle { stroke-width: 25px; }
.capsule-ribbon-outline.capsule-upper { stroke-width: 19.5px; }

.capsule-ribbon-body.capsule-lower { stroke-width: 25.5px; }
.capsule-ribbon-body.capsule-middle { stroke-width: 20px; }
.capsule-ribbon-body.capsule-upper { stroke-width: 15.5px; }

.capsule-ribbon-highlight.capsule-lower { stroke-width: 6.8px; }
.capsule-ribbon-highlight.capsule-middle { stroke-width: 5.1px; }
.capsule-ribbon-highlight.capsule-upper { stroke-width: 4.2px; }

.capsule-ribbon-outline {
    stroke: var(--capsule-edge);
    filter: drop-shadow(0 1px 1px rgba(73, 50, 34, .06));
}

.capsule-ribbon-body {
    stroke: var(--capsule-skin);
}

.capsule-ribbon-highlight {
    stroke: var(--capsule-highlight);
    opacity: .56;
}

.capsule-ribbon-base {
    fill: var(--capsule-skin);
    stroke: var(--capsule-edge);
    stroke-width: 1.7px;
    opacity: .68;
}

.capsule-ribbon-nail {
    fill: var(--capsule-nail);
    stroke: rgba(135, 96, 68, .46);
    stroke-width: 1.25px;
    opacity: .95;
    pointer-events: none;
}

/* Active finger: skin remains natural; only the edge becomes instructional. */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-active .capsule-ribbon-outline,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-active .capsule-ribbon-base,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-active .finger-tip-node {
    stroke: var(--capsule-edge-active) !important;
    filter: drop-shadow(0 0 3px rgba(37, 99, 235, .14));
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-active .capsule-ribbon-body,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-active .capsule-ribbon-base,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-active .finger-tip-node {
    fill: var(--capsule-skin-active) !important;
    stroke-color: var(--capsule-edge-active);
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-active .capsule-ribbon-body {
    stroke: var(--capsule-skin-active);
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-active .capsule-ribbon-nail {
    stroke: rgba(37, 99, 235, .72);
}

/* Correct and wrong feedback preserve the realistic skin body. */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-correct .capsule-ribbon-outline,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-correct .capsule-ribbon-base,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-correct .finger-tip-node {
    stroke: var(--capsule-edge-correct) !important;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-correct .capsule-ribbon-body {
    stroke: var(--capsule-skin-correct);
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-wrong .capsule-ribbon-outline,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-wrong .capsule-ribbon-base,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-wrong .finger-tip-node {
    stroke: var(--capsule-edge-wrong) !important;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-wrong .capsule-ribbon-body {
    stroke: var(--capsule-skin-wrong);
}

/* Press only the rendered capsule layers; permanent hand transforms remain safe. */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-press .capsule-ribbon-segment,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-press .capsule-ribbon-base,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-press .finger-tip-node,
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .finger-press .capsule-ribbon-nail {
    animation: capsuleFingerPress .20s ease;
    transform-box: fill-box;
    transform-origin: center bottom;
}

@keyframes capsuleFingerPress {
    0% { transform: translateY(0); }
    48% { transform: translateY(3px); }
    100% { transform: translateY(0); }
}

/* Thumbs are wider and softer than the other fingers. */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-ribbon-outline.capsule-lower {
    stroke-width: 43px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-ribbon-outline.capsule-upper {
    stroke-width: 36px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-ribbon-body.capsule-lower {
    stroke-width: 36px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-ribbon-body.capsule-upper {
    stroke-width: 29px;
}

/* Dark mode keeps warm skin while increasing edge contrast. */
html[data-theme="dark"][data-hand-guidance-style="capsule"]
#handsKeyboardOverlay {
    --capsule-skin: rgba(204, 171, 141, .16);
    --capsule-skin-active: rgba(214, 183, 153, .14);
    --capsule-skin-correct: rgba(97, 171, 116, .20);
    --capsule-skin-wrong: rgba(190, 124, 124, .20);
    --capsule-edge: rgba(221, 196, 173, .42);
    --capsule-highlight: rgba(255, 241, 231, .08);
    --capsule-nail: rgba(255, 238, 224, .06);
}

html[data-theme="dark"][data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-nail {
    stroke: rgba(229, 199, 174, .46);
}


/* ==========================================================
   BALANCED SPACEBAR THUMBS v15.7
========================================================== */

/*
 * The thumb roots are intentionally broader than normal finger roots.
 * This removes the pinched connection while keeping the thumbs visually
 * independent from the index fingers.
 */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-thumb-base {
    stroke-width: 1.5px;
    opacity: .72;
}

/* Keep the thumb highlight proportionate to the wider silhouette. */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-ribbon-highlight.capsule-lower {
    stroke-width: 8.4px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-ribbon-highlight.capsule-upper {
    stroke-width: 6.8px;
}


/* ==========================================================
   DOWNWARD SPACEBAR THUMBS v15.8
========================================================== */

/*
 * Larger thumb roots remain mostly below the visible overlay.
 * This creates a broad wrist-origin silhouette instead of a narrow
 * connection to the index fingers.
 */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-thumb-base {
    opacity: .68;
    stroke-width: 1.35px;
}

/* Keep the larger thumbs softer than the instructional fingers. */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-ribbon-outline {
    filter: drop-shadow(0 1px 1px rgba(73, 50, 34, .045));
}


/* ==========================================================
   FINAL THREE MODES HOTFIX v16.1
========================================================== */

#handsClassicOverlay .classic-finger-motion {
    transform-origin: center bottom;
    transition:
        transform .19s cubic-bezier(.22, .61, .36, 1),
        opacity .16s ease;
    will-change: transform;
}

html[data-hand-guidance-style="classic"] #handsClassicOverlay .finger-line {
    stroke: rgba(112, 118, 128, .80);
    stroke-width: 6.2;
}

html[data-hand-guidance-style="classic"] #handsClassicOverlay .finger-glow {
    stroke-width: 22;
}

html[data-hand-guidance-style="classic"] #handsClassicOverlay .finger.finger-active .finger-glow {
    stroke: rgba(47, 109, 246, .16);
}

html[data-hand-guidance-style="articulated"] #handsKeyboardOverlay .articulated-glow {
    filter: drop-shadow(0 1px 2px rgba(37, 99, 235, .07));
}

html[data-hand-guidance-style="capsule"] #handsKeyboardOverlay .capsule-ribbon-body {
    opacity: .90;
}

html[data-hand-guidance-style="capsule"] #handsKeyboardOverlay .capsule-ribbon-outline {
    opacity: .78;
}


/* ==========================================================
   CENTERED KEYBOARD + OPTIONAL SIDE HANDS v17.0.4
========================================================== */

.typing-controls-grid {
    display: grid !important;
    width: 100%;
    max-width: 1480px;
    margin-right: auto;
    margin-left: auto;
    gap: 18px;
    align-items: stretch;
}

/* No side panel: remove the unused column and center the keyboard. */
html:not([data-show-side-hands="true"]) .typing-controls-grid,
html[data-show-side-hands="false"] .typing-controls-grid {
    grid-template-columns: minmax(0, 1120px) !important;
    justify-content: center !important;
}

html:not([data-show-side-hands="true"]) .keyboard-guidance-card,
html[data-show-side-hands="false"] .keyboard-guidance-card {
    width: 100%;
    max-width: 1120px;
    justify-self: center;
}

/* Side panel enabled on a wide desktop. */
html[data-show-side-hands="true"] .typing-controls-grid {
    grid-template-columns:
        minmax(0, 1fr)
        minmax(300px, 350px) !important;
    justify-content: center !important;
}

html[data-show-side-hands="true"] .keyboard-guidance-card {
    width: 100%;
    max-width: none;
    min-width: 0;
}

html[data-show-side-hands="true"] .hands-guidance-card {
    display: flex !important;
    min-width: 0;
    padding: 18px;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;

    background: #ffffff;
    border: 1px solid #e5ebf3;
    border-radius: 24px;

    box-shadow:
        0 14px 35px
        rgba(15, 23, 42, .06);
}

html[data-show-side-hands="false"] .hands-guidance-card,
html:not([data-show-side-hands="true"]) .hands-guidance-card,
html[data-show-keyboard="false"] .hands-guidance-card {
    display: none !important;
}

html[data-show-side-hands="true"] #handsContainer {
    width: 100%;
    max-width: none;
    min-height: 340px;
    height: auto;
    margin: 0;
    flex: 1 1 auto;
    overflow: hidden;

    background: transparent;
    border: 0;
    border-radius: 18px;
    box-shadow: none;
}

html[data-show-side-hands="true"] .hands-guidance-card > p {
    margin: 10px 0 0;
    color: #334155;
    font-size: .88rem;
    font-weight: 700;
    text-align: center;
}

html[data-theme="dark"][data-show-side-hands="true"] .hands-guidance-card {
    background: #111a2b;
    border-color: #2a3a53;
    box-shadow:
        0 14px 35px
        rgba(0, 0, 0, .20);
}

html[data-theme="dark"][data-show-side-hands="true"] .hands-guidance-card > p {
    color: #cbd5e1;
}

html[data-theme="dark"][data-show-side-hands="true"] #handsContainer {
    background: transparent;
    border: 0;
}

html[data-theme="dark"][data-show-side-hands="true"] .hand-palm,
html[data-theme="dark"][data-show-side-hands="true"] .finger-segment {
    fill: #d7b08c;
    stroke: #9a7454;
}

html[data-theme="dark"][data-show-side-hands="true"] .hand-wrist,
html[data-theme="dark"][data-show-side-hands="true"] .finger-tip {
    fill: #c99e79;
    stroke: #9a7454;
}

/* Never squeeze the calibrated keyboard on narrower screens. */
@media (max-width: 1240px) {
    html[data-show-side-hands="true"] .typing-controls-grid {
        grid-template-columns: minmax(0, 1120px) !important;
    }

    html[data-show-side-hands="true"] .keyboard-guidance-card,
    html[data-show-side-hands="true"] .hands-guidance-card {
        width: 100%;
        max-width: 1120px;
        justify-self: center;
    }

    html[data-show-side-hands="true"] #handsContainer {
        min-height: 300px;
    }
}

@media (max-width: 760px) {
    html[data-show-side-hands] .hands-guidance-card {
        display: none !important;
    }

    .typing-controls-grid {
        display: block !important;
    }
}


/* ==========================================================
   SIDE HANDS HIGHLIGHT FIX v17.0.5
========================================================== */

/*
 * These final scoped rules deliberately use higher specificity than the
 * resting light/dark hand colors. This ensures the separate hand panel
 * visibly changes for expected, correct and wrong fingers in every theme.
 */

#handsContainer
.side-hand-finger.finger-active {
    opacity: 1 !important;
    filter:
        drop-shadow(
            0 5px 8px
            rgba(37, 99, 235, .42)
        ) !important;
}

#handsContainer
.side-hand-finger.finger-active
.finger-segment,
#handsContainer
.side-hand-finger.finger-active
.finger-tip {
    fill: rgba(108, 174, 255, .92) !important;
    stroke: #2563eb !important;
    stroke-width: 3.2px !important;
}

#handsContainer
.side-hand-finger.finger-correct {
    opacity: 1 !important;
    filter:
        drop-shadow(
            0 5px 8px
            rgba(22, 163, 74, .40)
        ) !important;
}

#handsContainer
.side-hand-finger.finger-correct
.finger-segment,
#handsContainer
.side-hand-finger.finger-correct
.finger-tip {
    fill: rgba(134, 239, 172, .94) !important;
    stroke: #16a34a !important;
    stroke-width: 3.2px !important;
}

#handsContainer
.side-hand-finger.finger-wrong {
    opacity: 1 !important;
    filter:
        drop-shadow(
            0 5px 8px
            rgba(239, 68, 68, .42)
        ) !important;
}

#handsContainer
.side-hand-finger.finger-wrong
.finger-segment,
#handsContainer
.side-hand-finger.finger-wrong
.finger-tip {
    fill: rgba(252, 165, 165, .94) !important;
    stroke: #ef4444 !important;
    stroke-width: 3.2px !important;
}

/* Preserve readable highlights in Dark and System-dark modes. */
html[data-theme="dark"]
#handsContainer
.side-hand-finger.finger-active
.finger-segment,
html[data-theme="dark"]
#handsContainer
.side-hand-finger.finger-active
.finger-tip {
    fill: rgba(98, 160, 255, .86) !important;
    stroke: #8bb8ff !important;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"]
    #handsContainer
    .side-hand-finger.finger-active
    .finger-segment,
    html[data-theme="system"]
    #handsContainer
    .side-hand-finger.finger-active
    .finger-tip {
        fill: rgba(98, 160, 255, .86) !important;
        stroke: #8bb8ff !important;
    }
}


/* ==========================================================
   CAPSULE FRONT-LAYER FIX v17.0.8
========================================================== */

/*
 * Capsule fingers must visually sit above keyboard key surfaces.
 *
 * The keyboard container previously created its own stacking context.
 * That made the translucent capsule fingers appear behind the key faces,
 * especially on the highlighted target key.
 *
 * In Capsule mode:
 * 1. key backgrounds remain below the hand overlay;
 * 2. the capsule fingers render above the key surfaces and borders;
 * 3. key characters and home bumps remain above the translucent fingers.
 */
html[data-hand-guidance-style="capsule"]
.keyboard-guidance-card {
    position: relative;
    isolation: isolate;
}

html[data-hand-guidance-style="capsule"]
#keyboardContainer {
    position: relative;
    z-index: auto !important;
}

html[data-hand-guidance-style="capsule"]
#keyboardContainer .key {
    position: relative;
    z-index: auto !important;
}

/* Finger artwork is above the physical key faces. */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay {
    z-index: 20 !important;
}

/*
 * Key text remains readable above the translucent hand artwork.
 * The parent key itself does not create a stacking context, so these
 * positive-z-index labels can sit above the overlay.
 */
html[data-hand-guidance-style="capsule"]
#keyboardContainer .key-primary {
    position: relative;
    z-index: 24 !important;
}

/* Secondary characters and home-row bumps must preserve their original key placement. */
html[data-hand-guidance-style="capsule"]
#keyboardContainer .key-secondary {
    position: absolute;
    z-index: 24 !important;
}

html[data-hand-guidance-style="capsule"]
#keyboardContainer .home-bump {
    position: absolute;
    left: 50%;
    bottom: 5px;
    transform: translateX(-50%);
    z-index: 24 !important;
}

/* Keep the target-row guide above every keyboard hand mode. */
html[data-hand-guidance-style="capsule"]
#targetRowGuide {
    z-index: 30 !important;
}

/*
 * A slightly clearer warm edge gives the transparent capsule fingers a
 * visible front surface without making the skin body heavy or opaque.
 */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-outline {
    opacity: .90 !important;
    filter:
        drop-shadow(
            0 1px 1px
            rgba(84, 62, 44, .10)
        );
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-body {
    opacity: .92 !important;
}

/*
 * The active finger stays translucent, but its edge is sufficiently visible
 * over the blue expected-key surface.
 */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay {
    --capsule-edge-active:
        rgba(77, 137, 255, .55);
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay
.finger-active
.capsule-ribbon-outline {
    filter:
        drop-shadow(
            0 0 4px
            rgba(77, 137, 255, .20)
        ) !important;
}

/*
 * Keep the expected key lighter in Capsule mode so the moving finger remains
 * the primary teaching cue while its character stays fully readable.
 */
html[data-hand-guidance-style="capsule"]
#keyboardContainer .key-next {
    background:
        rgba(47, 103, 246, .14) !important;

    border-color:
        rgba(79, 139, 255, .72) !important;

    box-shadow:
        inset 0 0 0 1px
        rgba(255, 255, 255, .28),
        0 0 0 3px
        rgba(47, 103, 246, .09)
        !important;
}

html[data-theme="dark"]
[data-hand-guidance-style="capsule"]
#keyboardContainer .key-next {
    background:
        rgba(79, 139, 255, .16) !important;

    border-color:
        rgba(112, 169, 255, .74) !important;
}

/* The other two modes retain their existing calibrated stacking. */


/* ==========================================================
   RIGHT-HAND CENTERING + THICKER CAPSULE FINGERS v17.1.10
========================================================== */

/*
 * Capsule mode only: make both hands slightly fuller so the overlay feels
 * visually balanced with the classic and articulated modes.
 */
html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-outline.capsule-lower {
    stroke-width: 33px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-outline.capsule-middle {
    stroke-width: 27.5px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-outline.capsule-upper {
    stroke-width: 21.5px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-body.capsule-lower {
    stroke-width: 28px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-body.capsule-middle {
    stroke-width: 22.5px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-body.capsule-upper {
    stroke-width: 17.2px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-highlight.capsule-lower {
    stroke-width: 7.4px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-highlight.capsule-middle {
    stroke-width: 5.7px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .capsule-ribbon-highlight.capsule-upper {
    stroke-width: 4.7px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-ribbon-outline.capsule-lower {
    stroke-width: 47px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-ribbon-outline.capsule-upper {
    stroke-width: 39px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-ribbon-body.capsule-lower {
    stroke-width: 40px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-ribbon-body.capsule-upper {
    stroke-width: 32px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-ribbon-highlight.capsule-lower {
    stroke-width: 9.1px;
}

html[data-hand-guidance-style="capsule"]
#handsKeyboardOverlay .articulated-thumb .capsule-ribbon-highlight.capsule-upper {
    stroke-width: 7.3px;
}
