.pen-practice button[name="penpl_action"] {
    min-height: 44px;
    padding: .65em 1.4em;
    border: 2px solid #522574;
    border-radius: .5rem;
    background: #522574;
    color: white;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.pen-practice button[value="logout"],
.pen-practice button[value="restart"] {
    background: white;
    color: #522574;
}
.pen-practice button[name="penpl_action"]:focus-visible {
    outline: 3px solid #522574;
    outline-offset: 3px;
}

.pen-practice .penpl-heading {
    margin: 1.25rem 0 .5rem;
    color: #44215e;
    line-height: 1.2;
}
.pen-practice ul.penpl-levels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 11rem));
    gap: .55rem;
    padding: 0;
    margin: 1rem 0;
    list-style: none;
}
.pen-practice .penpl-levels > li {
    margin: 0;
    padding: 0;
    list-style: none;
}
.pen-practice a.penpl-card {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100%, 11rem);
    padding: .5rem .8rem;
    min-height: 44px;
    line-height: 1.35;
    color: #44215e;
    background: linear-gradient(110deg, #fcf9ff, white);
    border: 1px solid #ddd3e4;
    border-inline-start: 2px solid #b38a40;
    border-radius: .55rem;
    text-decoration: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
}
.pen-practice .penpl-card::after {
    content: '';
    width: .5em;
    height: .5em;
    flex: none;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}
.pen-practice .penpl-card:focus-visible {
    outline: 3px solid #522574;
    outline-offset: 3px;
}

.pen-practice .penpl-back a {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 44px;
    padding: .4rem .9rem;
    color: #522574;
    background: #faf7fc;
    border: 1px solid #baa5c7;
    border-radius: .5rem;
    font-size: .95rem;
    line-height: 1.35;
    font-weight: 600;
    text-decoration: none;
}
.pen-practice .penpl-back a:focus-visible { outline: 3px solid #522574; outline-offset: 3px; }
@media (max-width: 28rem) {
    .pen-practice ul.penpl-levels { grid-template-columns: minmax(0, 14rem); }
}
.pen-practice .penpl-empty { padding: 1rem 1.25rem; background: #f7f4f9; border-radius: .55rem; }
.pen-practice .penpl-picture { display: block; width: 100%; height: auto; border-radius: .65rem; }
.pen-practice .penpl-bar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(1.6rem, 3vw, 2.25rem);
    padding: .85rem 0;
    border-bottom: 1px solid #ded5e3;
}
.pen-practice .penpl-bar .penpl-heading,
.pen-practice .penpl-bar .penpl-back { margin: 0; }
.pen-practice ul.penpl-lessons {
    display: grid;
    grid-template-columns: minmax(0, 21rem);
    gap: .5rem;
    margin: 1.25rem 0;
    padding: 0;
    list-style: none;
}
.pen-practice .penpl-lessons > li { list-style: none; margin: 0; padding: 0; }
.pen-practice .penpl-lessons a.penpl-card {
    width: 100%;
    min-height: 48px;
    padding: .65rem 1rem;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: start;
}
.pen-practice .penpl-footer {
    display: flex;
    justify-content: flex-start;
    border-top: 1px solid #e9e3ec;
    margin-top: 1.5rem;
    padding-top: .5rem;
}
.pen-practice .penpl-footer button[value="logout"] {
    background: #faf7fc;
    color: #522574;
    border: 2px solid #70498a;
    border-radius: .5rem;
    padding: .45rem 1.15rem;
    font-size: .925rem;
}

.pen-practice :is(a.penpl-card, .penpl-back a, button[name="penpl_action"]):is(:hover, :focus-visible) {
    color: #40234f !important;
    background: linear-gradient(110deg, #f7e5bd 0%, #fff9e9 38%, #fffefa 47%, #f6e7c7 67%, #f8f0dc 100%) !important;
    border-color: #b49457;
    box-shadow: inset 0 1px 0 #fff, 0 2px 5px rgb(73 46 40 / 12%);
    text-shadow: none;
}

.pen-practice label.penpl-field {
    display: block;
    width: 100%;
    max-width: 26rem;
    color: #44215e;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
}
.pen-practice .penpl-field input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    margin: .35rem 0 0;
    padding: .65rem .85rem;
    border: 1px solid #b9a7c4;
    border-radius: .5rem;
    background: #fcfaff;
    color: #35233f;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: inset 0 1px 2px rgb(68 33 94 / 4%);
}
.pen-practice .penpl-field br { display: none; }
.pen-practice .penpl-field input:focus {
    background: white;
    border-color: #70498a;
    outline: 2px solid #70498a;
    outline-offset: 2px;
}
.pen-practice label.penpl-code-field { max-width: 15rem; }
.pen-practice .penpl-code-field input {
    letter-spacing: .18em;
    font-variant-numeric: tabular-nums;
}

.pen-practice .penpl-player { max-width: 48rem; margin: 1.25rem 0; }
.pen-practice .penpl-tip { font-size: .95rem; line-height: 1.6; color: #5e5265; }
.pen-practice .penpl-stage {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f2f8;
    border: 1px solid #e4dbe9;
    border-radius: .7rem;
    overflow: hidden;
}
.pen-practice .penpl-scene { display: block; width: 100%; height: 100%; object-fit: contain; }
.pen-practice .penpl-player [hidden] { display: none !important; }
.pen-practice .penpl-caption {
    min-height: 3.5rem;
    padding: .75rem 1rem;
    margin-top: .5rem;
    border-radius: .5rem;
    background: #fbf5e8;
    color: #35233f;
    line-height: 1.5;
    text-align: center;
}
.pen-practice .penpl-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e4dbe9;
}
.pen-practice .penpl-controls button, .pen-practice .penpl-retry {
    min-height: 44px;
    padding: .5rem .9rem;
    border: 1px solid #70498a;
    border-radius: .5rem;
    font: inherit;
    color: #44215e;
    background: #faf7fc;
    cursor: pointer;
}
.pen-practice .penpl-controls .penpl-play { background: #522574; color: white; min-width: 5rem; }
.pen-practice .penpl-controls button:hover, .pen-practice .penpl-retry:hover {
    background: linear-gradient(110deg,#f7e5bd,#fff9e9,#f6e7c7);
    color: #40234f !important;
}
.pen-practice .penpl-controls button:focus-visible, .pen-practice .penpl-controls input:focus-visible,
.pen-practice .penpl-retry:focus-visible { outline: 2px solid #70498a; outline-offset: 3px; }
.pen-practice .penpl-controls button:disabled { opacity: .5; cursor: wait; }
.pen-practice .penpl-seek-label { flex: 1 1 12rem; }
.pen-practice .penpl-volume-label { flex: 0 1 6rem; }
.pen-practice .penpl-controls label { font-size: .8rem; color: #5e5265; margin: 0; }
.pen-practice .penpl-controls input[type="range"] {
    display: block;
    width: 100%;
    min-height: 24px;
    margin: .2rem 0 0;
    padding: 0;
    accent-color: #70498a;
    cursor: pointer;
}
.pen-practice .penpl-time { font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pen-practice .penpl-toggle[aria-pressed="true"] { background: #f8edcf; }
.pen-practice .penpl-player-status { color: #654e70; font-size: .9rem; }
.pen-practice .penpl-player-status:empty { display: none; }
@media (max-width: 30rem) {
    .pen-practice .penpl-seek-label { flex-basis: calc(100% - 6rem); }
}
