:root {
    --ket-bg: #fff8e8;
    --ket-card: #ffffff;
    --ket-text: #27231f;
    --ket-muted: #756f66;
    --ket-yellow: #ffc93d;
    --ket-purple: #8b55f6;
    --ket-line: rgba(39, 35, 31, 0.12);
    --ket-shadow: 0 16px 40px rgba(83, 64, 28, 0.09);
}

body {
    margin: 0;
    background: var(--ket-bg);
    color: var(--ket-text);
    font-family: Nunito, Quicksand, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

.ket-app-shell {
    min-height: 100vh;
    padding-bottom: 88px;
}

.ket-header {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1280px;
    padding: 28px 24px 18px;
}

.ket-brand {
    align-items: center;
    display: inline-flex;
    gap: 10px;
    font-weight: 900;
    text-decoration: none;
}

.ket-brand-mark {
    align-items: center;
    background: var(--ket-yellow);
    border-radius: 50%;
    display: inline-flex;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.ket-brand-text {
    font-size: 24px;
}

.ket-header-actions,
.ket-header-nav {
    align-items: center;
    display: flex;
    gap: 14px;
}

.ket-header-actions {
    margin-left: auto;
    min-height: 46px;
    white-space: nowrap;
}

.ket-main {
    margin: 0 auto;
    max-width: 1160px;
    padding: 24px;
}

#ket-app {
    transform-style: preserve-3d;
}

#ket-app.ket-page-flip-out {
    opacity: 0;
    transform: perspective(1200px) rotateY(-10deg) translateX(-18px) scale(0.985);
    transform-origin: left center;
    transition: opacity 180ms ease, transform 180ms ease;
}

#ket-app.ket-page-flip-out.is-prev {
    transform: perspective(1200px) rotateY(10deg) translateX(18px) scale(0.985);
    transform-origin: right center;
}

#ket-app.ket-page-flip-in {
    animation: ket-page-flip-in 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#ket-app.ket-page-flip-in.is-prev {
    animation-name: ket-page-flip-in-prev;
}

@keyframes ket-page-flip-in {
    from {
        opacity: 0;
        transform: perspective(1200px) rotateY(10deg) translateX(18px) scale(0.985);
        transform-origin: right center;
    }
    to {
        opacity: 1;
        transform: perspective(1200px) rotateY(0) translateX(0) scale(1);
    }
}

@keyframes ket-page-flip-in-prev {
    from {
        opacity: 0;
        transform: perspective(1200px) rotateY(-10deg) translateX(-18px) scale(0.985);
        transform-origin: left center;
    }
    to {
        opacity: 1;
        transform: perspective(1200px) rotateY(0) translateX(0) scale(1);
    }
}

.ket-is-home .ket-main {
    max-width: 1280px;
    padding-top: 34px;
}

.ket-home-page {
    display: grid;
    gap: 34px;
}

.ket-home-topbar,
.ket-home-actions,
.ket-home-logo,
.ket-home-section-head,
.ket-home-side-row,
.ket-account-head {
    align-items: center;
    display: flex;
}

.ket-home-topbar {
    justify-content: space-between;
}

.ket-home-logo {
    gap: 12px;
    text-decoration: none;
}

.ket-home-logo span {
    align-items: center;
    background: var(--ket-yellow);
    border-radius: 50%;
    display: inline-flex;
    font-weight: 900;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.ket-home-logo strong {
    font-size: 28px;
}

.ket-login-link,
.ket-home-section-head a {
    color: var(--ket-purple);
    font-size: 18px;
    font-weight: 900;
    text-decoration: none;
}

.ket-home-actions {
    gap: 10px;
}

.ket-streak {
    background: #fff;
    border-radius: 999px;
    box-shadow: var(--ket-shadow);
    font-weight: 900;
    padding: 10px 14px;
}

.ket-icon-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    font-size: 32px;
    font-weight: 900;
    height: 46px;
    justify-content: center;
    width: 46px;
}

.ket-home-guest-hero,
.ket-home-greeting {
    display: grid;
    gap: 18px;
}

.ket-home-guest-hero h1,
.ket-home-greeting h1 {
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1.05;
    margin: 0;
}

.ket-home-guest-hero p,
.ket-home-greeting p {
    color: var(--ket-muted);
    font-size: 22px;
    margin: 0;
}

.ket-home-guest-hero .ket-button {
    align-items: center;
    border-radius: 18px;
    font-size: 22px;
    justify-content: center;
    min-height: 58px;
    width: 100%;
}

.ket-home-greeting .ket-button {
    font-size: 22px;
    justify-content: center;
    max-width: 210px;
}

.ket-home-stat-panel {
    background: #fff;
    border-radius: 26px;
    box-shadow: var(--ket-shadow);
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, 1fr);
    padding: 26px;
}

.ket-home-stat-panel article {
    text-align: center;
}

.ket-home-stat-panel span {
    background: #f3ecff;
    border-radius: 14px;
    display: inline-flex;
    margin-bottom: 10px;
    padding: 10px;
}

.ket-home-stat-panel strong {
    display: block;
    font-size: 28px;
}

.ket-home-stat-panel small {
    color: var(--ket-muted);
    font-weight: 800;
}

.ket-home-layout {
    align-items: start;
    display: grid;
    gap: 36px;
    grid-template-columns: minmax(0, 1fr) 380px;
}

.ket-home-section {
    margin-top: 34px;
}

.ket-home-section:first-child {
    margin-top: 0;
}

.ket-home-section h2,
.ket-home-section-head h2 {
    font-size: 26px;
    margin: 0 0 18px;
}

.ket-home-section-head {
    justify-content: space-between;
}

.ket-home-skills {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(4, 1fr);
}

.ket-home-skill-card {
    background: #fff;
    border-radius: 28px;
    box-shadow: var(--ket-shadow);
    display: grid;
    gap: 10px;
    justify-items: center;
    min-height: 70px;
    padding: 30px 20px 0px;
    text-align: center;
    text-decoration: none;
}

.ket-home-skill-card span {
    align-items: center;
    background: #f3ecff;
    border-radius: 18px;
    color: var(--ket-purple);
    display: inline-flex;
    font-size: 32px;
    font-weight: 900;
    height: 62px;
    justify-content: center;
    width: 62px;
}

.ket-home-skill-card strong {
    font-size: 20px;
    margin-top: 0;
}

.ket-home-popular-list {
    display: grid;
    gap: 22px;
}

.ket-load-more-hint {
    color: var(--ket-muted);
    font-size: 14px;
    font-weight: 800;
    padding: 18px 0 4px;
    text-align: center;
}

.ket-link-button {
    background: transparent;
    border: 0;
    color: var(--ket-purple);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    padding: 0;
}

.ket-home-skill-card small,
.ket-home-side-row span,
.ket-continue-card small {
    color: var(--ket-muted);
    font-weight: 800;
    font-size: 14px;
}

.ket-skill-sentence span {
    background: #e9fbf1;
    color: #28b77a;
}

.ket-skill-dialogue span {
    background: #fff1dd;
    color: #e78a32;
}

.ket-skill-listen span {
    background: #ffe9f1;
    color: #e54f8f;
}

.ket-home-path-feature,
.ket-home-lesson-feature,
.ket-home-sidebar section,
.ket-continue-card {
    background: #fff;
    border: 1px solid var(--ket-line);
    border-radius: 24px;
    box-shadow: var(--ket-shadow);
    overflow: hidden;
}

.ket-home-path-feature {
    border-color: rgba(34, 197, 94, 0.35);
}

.ket-home-path-feature a {
    display: grid;
    gap: 22px;
    grid-template-columns: 180px 1fr;
    padding: 18px;
    text-decoration: none;
}

.ket-home-path-thumb,
.ket-home-side-thumb,
.ket-home-mini-thumb {
    background: #f3ecff;
    border-radius: 18px;
    overflow: hidden;
}

.ket-home-path-thumb {
    aspect-ratio: 1;
}

.ket-home-path-thumb img,
.ket-home-side-thumb img,
.ket-home-mini-thumb img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.ket-home-pill {
    background: #2ed018;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-weight: 900;
    padding: 8px 12px;
}

.ket-home-path-body h3 {
    font-size: 22px;
    margin: 8px 0;
}

.ket-home-path-body p {
    color: var(--ket-muted);
    font-size: 16px;
    margin: 0 0 12px;
}

.ket-home-path-body strong {
    color: #1ca20e;
    display: block;
    margin-bottom: 16px;
}

.ket-green-button {
    background: #2ed018;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-weight: 900;
    padding: 13px 24px;
}

.ket-home-lesson-feature a {
    color: inherit;
    display: block;
    text-decoration: none;
}

.ket-home-lesson-feature header {
    align-items: center;
    display: flex;
    gap: 16px;
    padding: 18px;
}

.ket-home-mini-thumb {
    flex: 0 0 74px;
    height: 74px;
}

.ket-home-lesson-feature h3 {
    font-size: 22px;
    margin: 0 0 8px;
}

.ket-home-collage {
    display: grid;
    gap: 3px;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: minmax(104px, 1fr) minmax(104px, 1fr) minmax(86px, 0.72fr);
}

.ket-home-collage .ket-collage-cell {
    align-items: center;
    background: #f3ecff;
    display: flex;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.ket-home-collage .is-cell-1 {
    grid-column: 1 / 7;
    grid-row: 1 / 3;
}

.ket-home-collage .is-cell-2 {
    grid-column: 7 / 9;
    grid-row: 1 / 2;
}

.ket-home-collage .is-cell-3 {
    grid-column: 7 / 9;
    grid-row: 2 / 3;
}

.ket-home-collage .is-cell-4 {
    grid-column: 1 / 3;
    grid-row: 3 / 4;
}

.ket-home-collage .is-cell-5 {
    grid-column: 3 / 5;
    grid-row: 3 / 4;
}

.ket-home-collage .is-cell-6 {
    grid-column: 5 / 7;
    grid-row: 3 / 4;
}

.ket-home-collage .is-cell-7 {
    grid-column: 7 / 9;
    grid-row: 3 / 4;
}

.ket-home-collage img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.ket-home-collage .has-more::after {
    background: rgba(39, 35, 31, 0.55);
    content: "";
    inset: 0;
    position: absolute;
}

.ket-home-collage .has-more b {
    align-items: center;
    color: #fff;
    display: flex;
    font-size: 36px;
    font-weight: 900;
    inset: 0;
    justify-content: center;
    position: absolute;
    z-index: 1;
}

.ket-home-lesson-copy {
    padding: 18px;
}

.ket-home-lesson-copy strong {
    display: block;
    font-size: 22px;
    margin-bottom: 8px;
}

.ket-home-lesson-copy p {
    color: var(--ket-muted);
    font-size: 18px;
    line-height: 1.5;
    margin: 0;
}

.ket-feature-footer {
    align-items: center;
    border-top: 1px solid var(--ket-line);
    display: flex;
    gap: 22px;
    padding: 16px 18px;
    align-content: space-between;
    justify-content: space-between;
}

.ket-feature-footer b,
.ket-wide-card-actions b {
    background: var(--ket-yellow);
    border-radius: 999px;
    margin-left: auto;
    padding: 13px 24px;
}

.ket-heart-count {
    color: #8b867b;
    font-weight: 900;
}

.ket-heart-count.is-favorite,
.ket-fav-float.is-favorite,
.ket-hero-fav.is-favorite,
.ket-path-map-fav.is-favorite,
.ket-round.is-favorite {
    color: #f43f5e;
}

.ket-home-sidebar {
    display: grid;
    gap: 24px;
    position: sticky;
    top: 24px;
}

.ket-home-sidebar section {
    padding: 22px;
}

.ket-home-side-list {
    display: grid;
    gap: 18px;
}

.ket-home-side-row {
    gap: 14px;
    text-decoration: none;
}

.ket-home-side-thumb {
    flex: 0 0 82px;
    height: 82px;
}

.ket-home-side-row strong {
    display: block;
    font-size: 17px;
    line-height: 1.15;
    margin-bottom: 6px;
}

.ket-continue-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, 1fr);
}

.ket-continue-card {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: 96px 1fr auto;
    padding: 18px;
    text-decoration: none;
}

.ket-continue-card strong {
    display: block;
    font-size: 20px;
}

.ket-continue-card b {
    align-items: center;
    background:
        radial-gradient(#fff 0 55%, transparent 56%),
        conic-gradient(var(--ket-yellow) 0 var(--progress, 0%), #f1ead6 var(--progress, 0%) 100%);
    border-radius: 50%;
    display: inline-flex;
    height: 58px;
    justify-content: center;
    width: 58px;
}

.ket-account-scrim {
    background: rgba(0, 0, 0, 0.32);
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.18s ease;
    z-index: 40;
}

.ket-account-menu {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
    display: grid;
    min-width: 320px;
    opacity: 0;
    padding: 14px;
    pointer-events: none;
    position: fixed;
    right: max(24px, calc((100vw - 1280px) / 2 + 24px));
    top: 92px;
    transform: translateY(-10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 41;
}

.ket-menu-open .ket-account-scrim,
.ket-menu-open .ket-account-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.ket-account-menu a,
.ket-account-menu button {
    background: transparent;
    border: 0;
    border-radius: 14px;
    color: var(--ket-text);
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    font-weight: 800;
    padding: 16px;
    text-align: left;
    text-decoration: none;
}

.ket-account-menu a:hover,
.ket-account-menu button:hover {
    background: #f8f4eb;
}

.ket-account-head {
    gap: 14px;
}

.ket-account-head span {
    align-items: center;
    background: #f3ecff;
    border-radius: 50%;
    color: var(--ket-purple);
    display: inline-flex;
    flex: 0 0 58px;
    font-weight: 900;
    height: 58px;
    justify-content: center;
}

.ket-account-head small {
    color: var(--ket-muted);
    display: block;
}

.ket-account-head b {
    margin-left: auto;
}

.ket-placeholder,
.ket-home-hero {
    background: var(--ket-card);
    border-radius: 24px;
    box-shadow: var(--ket-shadow);
    padding: clamp(32px, 7vw, 84px);
}

.ket-eyebrow {
    color: var(--ket-purple);
    font-weight: 900;
    margin: 0 0 10px;
}

.ket-placeholder h1,
.ket-home-hero h1 {
    font-size: clamp(34px, 6vw, 68px);
    line-height: 1.05;
    margin: 0 0 18px;
    max-width: 780px;
}

.ket-placeholder p,
.ket-home-hero p {
    color: var(--ket-muted);
    font-size: 20px;
    line-height: 1.55;
    max-width: 760px;
}

.ket-button {
    background: var(--ket-yellow);
    border: 0;
    border-radius: 18px;
    color: var(--ket-text);
    cursor: pointer;
    display: inline-flex;
    font-weight: 900;
    margin-top: 18px;
    padding: 16px 28px;
    text-decoration: none;
}

.ket-button:disabled {
    cursor: default;
    opacity: 0.65;
}

.ket-button-outline {
    background: #fff;
    border: 2px solid var(--ket-purple);
    color: var(--ket-purple);
}

.ket-muted {
    color: var(--ket-muted);
    font-size: 18px;
    line-height: 1.55;
}

.ket-section {
    margin-top: 34px;
}

.ket-section h2,
.ket-page-head h1 {
    margin: 0 0 18px;
}

.ket-page-head {
    margin-bottom: 24px;
    text-align: center;
}

.ket-page-head p {
    color: var(--ket-muted);
    font-size: 18px;
    margin: 0;
}

.ket-back {
    align-items: center;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--ket-shadow);
    display: inline-flex;
    font-size: 24px;
    font-weight: 900;
    height: 46px;
    justify-content: center;
    margin-bottom: 14px;
    text-decoration: none;
    width: 46px;
}

.ket-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.ket-card {
    background: var(--ket-card);
    border: 1px solid var(--ket-line);
    border-radius: 18px;
    box-shadow: var(--ket-shadow);
    overflow: hidden;
}

.ket-card-link {
    display: grid;
    height: 100%;
    text-decoration: none;
}

.ket-card-media {
    align-items: center;
    aspect-ratio: 16 / 10;
    background: #f3ecff;
    color: var(--ket-purple);
    display: flex;
    font-size: 34px;
    font-weight: 900;
    justify-content: center;
}

.ket-card-media img,
.ket-lesson-art img,
.ket-study-image img,
.ket-item-thumb img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.ket-card-body {
    padding: 18px;
}

.ket-card h3 {
    font-size: 23px;
    line-height: 1.2;
    margin: 8px 0;
}

.ket-card p {
    color: var(--ket-muted);
    line-height: 1.45;
    margin: 0;
}

.ket-path-map-page {
    margin: 0 auto;
    min-height: calc(100vh - 190px);
    padding: 8px 24px 56px;
    position: relative;
}

.ket-path-map-head {
    margin: 0 auto 34px;
    max-width: 680px;
    text-align: center;
}

.ket-path-map-head h1 {
    font-size: 28px;
    line-height: 1.2;
    margin: 0 0 8px;
}

.ket-path-map-head p {
    color: var(--ket-muted);
    font-size: 18px;
    font-weight: 800;
    margin: 0;
}

.ket-path-map-back,
.ket-path-map-fav {
    align-items: center;
    background: #fff;
    border: 0;
    border-radius: 50%;
    box-shadow: var(--ket-shadow);
    color: var(--ket-text);
    cursor: pointer;
    display: inline-flex;
    font-size: 28px;
    font-weight: 900;
    height: 52px;
    justify-content: center;
    position: absolute;
    text-decoration: none;
    top: 10px;
    width: 52px;
}

.ket-path-map-back {
    left: 28px;
}

.ket-path-map-fav {
    font-size: 30px;
    right: 28px;
}

.ket-path-map-page > .ket-progress-badge {
    position: absolute;
    right: 92px;
    top: 10px;
    z-index: 2;
}

.ket-path-timeline {
    display: grid;
    gap: 54px;
    justify-items: center;
    margin: 0 auto;
    max-width: 560px;
    padding: 18px 0 70px;
    position: relative;
}

.ket-path-timeline::before {
    background: rgba(39, 35, 31, 0.12);
    bottom: 96px;
    content: "";
    left: 50%;
    position: absolute;
    top: 60px;
    transform: translateX(-50%);
    width: 8px;
}

.ket-path-step {
    align-items: center;
    color: inherit;
    display: grid;
    justify-items: center;
    position: relative;
    text-align: center;
    text-decoration: none;
    width: min(100%, 360px);
    z-index: 1;
}

.ket-path-step:nth-child(odd) {
    transform: translateX(-72px);
}

.ket-path-step:nth-child(even) {
    transform: translateX(72px);
}

.ket-path-node {
    align-items: center;
    border-radius: 50%;
    box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.12), 0 7px 0 rgba(39, 35, 31, 0.12);
    display: inline-flex;
    height: 104px;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    width: 104px;
}

.ket-path-node b {
    color: #fff;
    font-size: 44px;
    line-height: 1;
}

.ket-path-node.is-unlocked {
    background:
        radial-gradient(circle at center, #37d414 0 58%, transparent 59%),
        conic-gradient(var(--ket-yellow) 0 var(--progress, 0%), rgba(39, 35, 31, 0.16) var(--progress, 0%) 100%);
    border: 10px solid rgba(39, 35, 31, 0.16);
}

.ket-path-node.is-review {
    background:
        radial-gradient(circle at center, #38d117 0 58%, transparent 59%),
        conic-gradient(var(--ket-yellow) 0 var(--progress, 0%), rgba(39, 35, 31, 0.16) var(--progress, 0%) 100%);
}

.ket-path-node.is-completed {
    background: #37d414;
}

.ket-path-node.is-locked {
    background: #dedacf;
    border: 10px solid rgba(39, 35, 31, 0.08);
}

.ket-path-node.is-locked b {
    color: #aaa397;
    font-size: 38px;
}

.ket-path-node em {
    background: #fff;
    border-radius: 999px;
    bottom: -6px;
    box-shadow: 0 8px 18px rgba(39, 35, 31, 0.14);
    color: #28a928;
    font-size: 14px;
    font-style: normal;
    font-weight: 900;
    padding: 3px 9px;
    position: absolute;
    right: -8px;
}

.ket-start-badge {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--ket-shadow);
    color: #33ae2a;
    font-size: 17px;
    font-weight: 900;
    left: 50%;
    letter-spacing: 0;
    padding: 8px 18px;
    position: absolute;
    top: -56px;
    transform: translateX(-50%);
    white-space: nowrap;
}

.ket-start-badge::after {
    background: #33ae2a;
    border-radius: 50%;
    bottom: -18px;
    content: "";
    height: 10px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 10px;
}

.ket-path-step strong {
    font-size: 20px;
    line-height: 1.2;
}

.ket-path-step small {
    color: var(--ket-muted);
    font-size: 16px;
    font-weight: 800;
    margin-top: 4px;
}

.ket-path-step.is-locked {
    color: #716b61;
}

.ket-meta,
.ket-stats,
.ket-stat-row,
.ket-quiz-head {
    color: var(--ket-muted);
    display: flex;
    flex-wrap: wrap;
    font-weight: 800;
    gap: 10px;
}

.ket-meta span,
.ket-stats span,
.ket-stat-row span {
    background: #f8f4eb;
    border-radius: 999px;
    padding: 6px 10px;
}

.ket-stats {
    margin-top: 14px;
}

.ket-skill-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ket-center-tabs {
    justify-content: center;
    margin-bottom: 22px;
}

.ket-skill-tabs a {
    background: #fff;
    border-radius: 999px;
    box-shadow: var(--ket-shadow);
    color: var(--ket-muted);
    font-weight: 900;
    padding: 14px 22px;
    text-decoration: none;
}

.ket-skill-tabs a:hover,
.ket-skill-tabs a:focus,
.ket-skill-tabs a.is-active {
    background: var(--ket-purple);
    color: #fff;
}

.ket-learn-list-page {
    margin: 0 auto;
    max-width: 980px;
}

.ket-learning-filter-row {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 190px;
    margin-bottom: 22px;
}

.ket-learning-filter-row .ket-search,
.ket-learning-filter-row .ket-level-filter {
    margin: 0;
}

.ket-wide-list {
    display: grid;
    gap: 18px;
}

.ket-wide-card {
    background: #fff;
    border: 1px solid var(--ket-line);
    border-radius: 24px;
    box-shadow: var(--ket-shadow);
    overflow: hidden;
}

.ket-wide-card a {
    color: inherit;
    display: grid;
    gap: 24px;
    grid-template-columns: 330px 1fr;
    min-height: 250px;
    padding: 20px;
    text-decoration: none;
}

.ket-wide-card-media {
    background: #f3ecff;
    border-radius: 20px;
    overflow: hidden;
}

.ket-wide-card-media img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.ket-wide-card-body {
    display: grid;
    align-content: start;
    gap: 12px;
}

.ket-wide-card-body h3 {
    font-size: 30px;
    line-height: 1.2;
    margin: 0;
}

.ket-wide-card-body p {
    color: var(--ket-muted);
    font-size: 18px;
    margin: 0;
}

.ket-wide-card-actions {
    align-items: center;
    align-self: end;
    display: flex;
    gap: 22px;
    margin-top: auto;
}

.ket-level-chip {
    color: var(--ket-purple);
}

.ket-favorite-list {
    margin: 0 auto;
    max-width: 1080px;
}

.ket-favorite-row {
    background: #fff;
    border: 1px solid var(--ket-line);
    border-radius: 24px;
    box-shadow: var(--ket-shadow);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 20px;
}

.ket-favorite-row a {
    display: grid;
    gap: 6px;
    text-decoration: none;
}

.ket-favorite-row strong {
    font-size: 24px;
}

.ket-favorite-row span {
    color: var(--ket-purple);
}

.ket-search {
    margin: 0 0 18px;
}

.ket-level-filter {
    margin: 0 0 12px;
}

.ket-search input,
.ket-level-filter select {
    background: #fff;
    border: 1px solid var(--ket-line);
    border-radius: 999px;
    box-shadow: var(--ket-shadow);
    font: inherit;
    min-height: 54px;
    padding: 0 22px;
    width: 90%;
}

.ket-content-filters {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 260px 1fr;
    margin: 22px 0;
}

.ket-content-filters .ket-search,
.ket-content-filters .ket-level-filter {
    margin: 0;
}

.ket-search-page-form {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 170px;
    margin: 0 0 18px;
}

.ket-search-page-form input {
    background: #fff;
    border: 1px solid var(--ket-line);
    border-radius: 999px;
    box-shadow: var(--ket-shadow);
    font: inherit;
    min-height: 58px;
    padding: 0 24px;
    width: 100%;
}

.ket-search-page-form .ket-button {
    justify-content: center;
    min-height: 58px;
}

.ket-login-modal {
    inset: 0;
    position: fixed;
    z-index: 80;
}

.ket-login-modal-backdrop {
    background: rgba(39, 35, 31, 0.42);
    border: 0;
    cursor: pointer;
    inset: 0;
    position: absolute;
    width: 100%;
}

.ket-login-modal-panel {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
    display: grid;
    gap: 12px;
    left: 50%;
    max-width: 420px;
    padding: 28px;
    position: absolute;
    text-align: center;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 44px);
}

.ket-login-modal-panel h2 {
    font-size: 30px;
    margin: 0;
}

.ket-login-modal-panel p {
    color: var(--ket-muted);
    font-size: 18px;
    line-height: 1.5;
    margin: 0;
}

.ket-login-modal-close {
    background: #f8f4eb;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 26px;
    font-weight: 900;
    height: 42px;
    position: absolute;
    right: 14px;
    top: 14px;
    width: 42px;
}

.ket-filter-bar {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 0 auto 22px;
    max-width: 980px;
}

.ket-filter-bar label {
    color: var(--ket-muted);
    display: grid;
    font-weight: 900;
    gap: 8px;
}

.ket-filter-bar select {
    background: #fff;
    border: 1px solid var(--ket-line);
    border-radius: 14px;
    box-shadow: var(--ket-shadow);
    font: inherit;
    min-height: 48px;
    padding: 0 14px;
}

.ket-lesson-hero {
    align-items: center;
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(260px, 0.9fr) 1.1fr;
    margin-bottom: 22px;
    position: relative;
}

.ket-lesson-hero .ket-back {
    grid-column: 1 / -1;
    margin: 0;
}

.ket-lesson-hero h1 {
    font-size: clamp(34px, 4vw, 54px);
    line-height: 1.08;
    margin: 0 0 12px;
}

.ket-lesson-hero p {
    color: var(--ket-muted);
    font-size: 19px;
    line-height: 1.55;
}

.ket-lesson-art {
    align-items: center;
    aspect-ratio: 1 / 1;
    background: #f3ecff;
    border-radius: 22px;
    box-shadow: var(--ket-shadow);
    color: var(--ket-purple);
    display: flex;
    font-size: 48px;
    font-weight: 900;
    justify-content: center;
    overflow: hidden;
}

.ket-hero-fav,
.ket-fav-float {
    align-items: center;
    background: #fff;
    border: 0;
    border-radius: 50%;
    box-shadow: var(--ket-shadow);
    cursor: pointer;
    display: inline-flex;
    font-size: 26px;
    font-weight: 900;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.ket-hero-fav {
    position: absolute;
    right: 0;
    top: 0;
}

.ket-actions {
    display: grid;
    gap: 12px;
}

.ket-actions .ket-button {
    justify-content: center;
}

.ket-actions .ket-button:first-child {
    background: var(--ket-purple);
    color: #fff;
}

.ket-listening-page {
    margin: 0 auto 120px;
    max-width: 1180px;
    position: relative;
}

.ket-listening-page > .ket-back {
    left: 0;
    position: absolute;
    top: 0;
}

.ket-listening-title {
    margin: 0 auto 26px;
    text-align: center;
}

.ket-listening-title h1 {
    color: var(--ket-purple);
    font-size: 42px;
    line-height: 1.1;
    margin: 0 0 4px;
}

.ket-listening-title p {
    color: var(--ket-muted);
    font-size: 18px;
    margin: 0;
}

.ket-listening-hero {
    align-items: stretch;
    display: grid;
    gap: 28px;
    grid-template-columns: 1.05fr 0.95fr;
    margin-bottom: 24px;
}

.ket-listening-art {
    aspect-ratio: 1.2 / 1;
    background: #f3ecff;
    border-radius: 22px;
    box-shadow: var(--ket-shadow);
    overflow: hidden;
}

.ket-listening-art img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.ket-listening-art span {
    align-items: center;
    color: var(--ket-purple);
    display: flex;
    font-size: 48px;
    font-weight: 900;
    height: 100%;
    justify-content: center;
}

.ket-listening-info {
    background: #fff;
    border-radius: 22px;
    box-shadow: var(--ket-shadow);
    display: grid;
    gap: 18px;
    padding: 28px;
}

.ket-listening-info h2 {
    align-items: center;
    color: var(--ket-purple);
    display: flex;
    font-size: 34px;
    gap: 12px;
    margin: 0;
}

.ket-listening-info h2 span {
    align-items: center;
    background: #f1eaff;
    border-radius: 50%;
    display: inline-flex;
    height: 54px;
    justify-content: center;
    width: 54px;
}

.ket-listening-info p {
    color: var(--ket-muted);
    font-size: 19px;
    line-height: 1.55;
    margin: 0;
}

.ket-listening-stats {
    background: #fff7df;
    border-radius: 18px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, 1fr);
    padding: 20px 14px;
    text-align: center;
}

.ket-listening-stats article {
    display: grid;
    gap: 4px;
}

.ket-listening-stats span {
    color: var(--ket-purple);
    font-size: 28px;
}

.ket-listening-stats strong {
    font-size: 30px;
    line-height: 1;
}

.ket-listening-stats small {
    color: var(--ket-muted);
    font-size: 14px;
}

.ket-listening-tip {
    align-items: start;
    background: #eee6ff;
    border-radius: 16px;
    color: #4f485d;
    display: flex;
    font-size: 17px;
    gap: 10px;
    line-height: 1.45;
    padding: 16px 18px;
}

.ket-listening-player {
    background: #f2edff;
    border-radius: 22px;
    box-shadow: var(--ket-shadow);
    padding: 28px 28px 34px;
    position: relative;
}

.ket-player-toolbar {
    align-items: center;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    margin-bottom: 18px;
}

.ket-player-left,
.ket-player-right {
    align-items: center;
    display: flex;
    gap: 12px;
}

.ket-player-right {
    justify-content: flex-end;
}

.ket-listening-play {
    align-items: center;
    background: var(--ket-purple);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 14px 28px rgba(139, 85, 246, 0.28);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 36px;
    height: 92px;
    justify-content: center;
    padding-left: 6px;
    width: 92px;
}

.ket-progress-ring {
    align-items: center;
    background:
        radial-gradient(#fff 55%, transparent 56%),
        conic-gradient(var(--ket-yellow) 0 var(--progress, 0%), #ebe5d4 var(--progress, 0%) 100%);
    border-radius: 50%;
    color: var(--ket-text);
    display: inline-flex;
    font-size: 14px;
    font-weight: 900;
    height: 58px;
    justify-content: center;
    width: 58px;
}

.ket-listening-lines {
    display: grid;
    gap: 24px;
}

.ket-listening-line {
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr 44px;
}

.ket-listening-line h3 {
    font-size: 24px;
    line-height: 1.3;
    margin: 0 0 10px;
}

.ket-listening-line p {
    color: #5b5662;
    font-size: 18px;
    font-style: italic;
    margin: 0 0 8px;
}

.ket-listening-line small {
    color: var(--ket-muted);
    display: block;
    font-size: 18px;
    line-height: 1.45;
}

.ket-line-audio {
    align-items: center;
    align-self: start;
    background: #fff;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.ket-vocab-scroll {
    display: grid;
    gap: 18px;
    grid-auto-columns: minmax(180px, 220px);
    grid-auto-flow: column;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}

.ket-vocab-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--ket-shadow);
    min-height: 330px;
    overflow: hidden;
    position: relative;
    scroll-snap-align: start;
}

.ket-vocab-card a {
    display: block;
    padding: 16px;
    text-decoration: none;
}

.ket-vocab-image {
    aspect-ratio: 1;
    background: #f3ecff;
    border-radius: 16px;
    display: grid;
    overflow: hidden;
    place-items: center;
}

.ket-vocab-image img,
.ket-row-thumb img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.ket-vocab-tools,
.ket-row-tools {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.ket-mini-tool,
.ket-speed-chip {
    align-items: center;
    background: #f8f7f5;
    border: 0;
    border-radius: 999px;
    color: var(--ket-text);
    display: inline-flex;
    font: inherit;
    font-weight: 900;
    height: 42px;
    justify-content: center;
    min-width: 42px;
    padding: 0 12px;
}

.ket-mini-tool {
    cursor: pointer;
    font-size: 20px;
    width: 42px;
}

.ket-vocab-card h3 {
    font-size: 21px;
    margin: 14px 0 4px;
}

.ket-vocab-card p,
.ket-lesson-text-row p {
    color: var(--ket-muted);
    font-style: italic;
    margin: 0;
}

.ket-vocab-card small,
.ket-lesson-text-row small {
    color: var(--ket-muted);
    display: block;
    font-size: 16px;
    margin-top: 6px;
}

.ket-vocab-card .ket-fav-float {
    position: absolute;
    right: 12px;
    top: 12px;
}

.ket-lesson-row-list {
    display: grid;
    gap: 16px;
}

.ket-lesson-text-row {
    background: #f3efff;
    border-radius: 18px;
    position: relative;
}

.ket-lesson-text-row a {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: 116px 70px 1fr 24px;
    min-height: 116px;
    padding: 18px 74px 18px 18px;
    text-decoration: none;
}

.ket-lesson-text-row.is-no-controls a {
    grid-template-columns: 116px minmax(0, 1fr) 24px;
    padding-right: 20px;
}

.ket-row-thumb {
    aspect-ratio: 1;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
}

.ket-row-tools {
    display: grid;
    justify-items: center;
    margin: 0;
}

.ket-row-copy h3 {
    font-size: 24px;
    line-height: 1.25;
    margin: 0 0 6px;
    word-break: normal;
}

.ket-speaker-label {
    background: #fff;
    border: 1px solid var(--ket-line);
    border-radius: 8px;
    display: inline-flex;
    font-weight: 900;
    margin-bottom: 8px;
    padding: 5px 12px;
}

.ket-lesson-text-row .ket-fav-float {
    position: absolute;
    right: 18px;
    top: 18px;
}

.ket-lesson-text-row b {
    color: var(--ket-muted);
    font-size: 42px;
    line-height: 1;
}

.ket-item-list {
    display: grid;
    gap: 14px;
}

.ket-item-row {
    align-items: center;
    background: #f5f0ff;
    border-radius: 16px;
    display: grid;
    gap: 10px 16px;
    grid-template-columns: 76px 1fr;
    padding: 14px;
    text-decoration: none;
}

.ket-item-row strong {
    display: block;
    font-size: 22px;
}

.ket-item-row small {
    color: var(--ket-muted);
    display: block;
    font-size: 16px;
    margin-top: 4px;
}

.ket-item-thumb {
    align-items: center;
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: 14px;
    display: flex;
    font-weight: 900;
    justify-content: center;
    overflow: hidden;
}

.ket-study-card,
.ket-auth,
.ket-quiz-panel {
    background: #fff;
    border-radius: 24px;
    box-shadow: var(--ket-shadow);
    margin: 0 auto;
    max-width: 900px;
    padding: clamp(24px, 5vw, 54px);
}

.ket-study-card {
    text-align: center;
}

.ket-study-actions {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 12px;
}

.ket-speaking-practice {
    align-items: center;
    border-top: 1px solid var(--ket-line);
    display: grid;
    gap: 10px;
    justify-items: center;
    margin-top: 22px;
    padding-top: 22px;
}

.ket-speak-button {
    align-items: center;
    background: var(--ket-purple);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 12px 26px rgba(139, 85, 246, 0.25);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 900;
    gap: 8px;
    justify-content: center;
    min-height: 54px;
    padding: 0 26px;
}

.ket-speak-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.ket-speaking-practice p {
    color: var(--ket-muted);
    margin: 0;
    text-align: center;
}

.ket-study-image {
    align-items: center;
    aspect-ratio: 1 / 1;
    background: #f3ecff;
    border-radius: 22px;
    color: var(--ket-purple);
    display: inline-flex;
    font-size: 46px;
    font-weight: 900;
    justify-content: center;
    margin: 16px auto;
    max-width: 300px;
    overflow: hidden;
    width: min(70vw, 300px);
}

.ket-round {
    align-items: center;
    background: #f7f7f7;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    font-size: 20px;
    height: 50px;
    justify-content: center;
    width: 50px;
}

.ket-phonetic {
    color: var(--ket-muted);
    font-style: italic;
}

.ket-auth {
    max-width: 560px;
}

.ket-auth form {
    display: grid;
    gap: 16px;
}

.ket-auth label {
    display: grid;
    font-weight: 900;
    gap: 8px;
}

.ket-auth input,
.ket-auth select {
    border: 1px solid var(--ket-line);
    border-radius: 12px;
    font: inherit;
    min-height: 46px;
    padding: 0 14px;
}

.ket-form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #b91c1c;
    font-weight: 800;
    line-height: 1.45;
    padding: 12px 14px;
}

.ket-google {
    background: #4285f4;
    border: 0;
    border-radius: 14px;
    color: #fff;
    cursor: pointer;
    display: flex;
    font: inherit;
    font-weight: 900;
    justify-content: center;
    margin: 0 0 24px;
    padding: 14px;
    text-decoration: none;
}

.ket-auth-switch {
    color: var(--ket-muted);
    font-weight: 800;
    text-align: center;
}

.ket-auth-switch a {
    color: var(--ket-purple);
}

.ket-profile-card {
    align-items: center;
    background: #fbf9f3;
    border: 1px solid var(--ket-line);
    border-radius: 18px;
    display: grid;
    gap: 6px;
    justify-items: center;
    margin-bottom: 22px;
    padding: 22px;
    text-align: center;
}

.ket-profile-card img,
.ket-profile-card span {
    align-items: center;
    background: #f3ecff;
    border-radius: 50%;
    display: flex;
    font-size: 36px;
    height: 88px;
    justify-content: center;
    object-fit: cover;
    width: 88px;
}

.ket-profile-card strong {
    font-size: 24px;
}

.ket-profile-card small {
    color: var(--ket-muted);
    font-size: 15px;
}

.ket-level-page {
    margin: 0 auto 110px;
    max-width: 980px;
}

.ket-level-intro {
    margin: 24px 0 26px;
}

.ket-level-intro h2 {
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.08;
    margin: 0 0 14px;
}

.ket-level-intro p,
.ket-level-intro span {
    color: var(--ket-muted);
    display: block;
    font-size: 20px;
    line-height: 1.4;
    margin: 0 0 8px;
}

.ket-level-intro strong {
    color: var(--ket-text);
}

.ket-level-list {
    display: grid;
    gap: 14px;
}

.ket-level-choice {
    align-items: center;
    background: #fff;
    border: 3px solid transparent;
    border-radius: 22px;
    box-shadow: var(--ket-shadow);
    cursor: pointer;
    display: grid;
    gap: 18px;
    grid-template-columns: 28px 58px 1fr auto;
    min-height: 94px;
    padding: 18px 24px;
}

.ket-level-choice.is-active {
    border-color: #18bf77;
    box-shadow: 0 0 0 4px var(--ket-yellow), var(--ket-shadow);
}

.ket-level-choice input {
    accent-color: #1478ff;
    height: 22px;
    width: 22px;
}

.ket-level-icon {
    align-items: center;
    display: inline-flex;
    font-size: 34px;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.ket-level-choice strong {
    display: block;
    font-size: 24px;
    line-height: 1.2;
}

.ket-level-choice small {
    color: var(--ket-muted);
    display: block;
    font-size: 18px;
    line-height: 1.35;
    margin-top: 4px;
}

.ket-level-choice b {
    background: #20c77b;
    border-radius: 999px;
    color: #fff;
    font-size: 14px;
    padding: 8px 14px;
}

.ket-level-list .ket-button {
    justify-content: center;
    margin-top: 14px;
}

.ket-button-danger {
    background: #fff;
    border: 2px solid #ef4444;
    color: #dc2626;
    justify-content: center;
    width: 100%;
}

.ket-quiz-panel {
    max-width: 1050px;
}

.ket-quiz-head {
    justify-content: space-between;
    margin-bottom: 18px;
}

.ket-progress {
    background: #eee8dd;
    border-radius: 999px;
    height: 10px;
    margin-bottom: 24px;
    overflow: hidden;
}

.ket-progress span {
    background: var(--ket-yellow);
    display: block;
    height: 100%;
}

.ket-quiz-list {
    display: grid;
    gap: 16px;
}

.ket-quiz-choice {
    align-items: center;
    background: linear-gradient(135deg, #fff, #fff8e8);
    border: 1px solid var(--ket-line);
    border-radius: 22px;
    box-shadow: var(--ket-shadow-soft);
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr auto;
    padding: 18px;
}

.ket-quiz-choice span {
    background: #f5efe4;
    border-radius: 999px;
    color: var(--ket-purple);
    display: inline-flex;
    font-weight: 1000;
    margin-bottom: 8px;
    padding: 7px 12px;
}

.ket-quiz-choice h2 {
    font-size: 24px;
    margin: 0 0 6px;
}

.ket-quiz-choice p {
    color: var(--ket-muted);
    font-weight: 800;
    margin: 0;
}

.ket-question {
    background: #fbf9f3;
    border: 1px solid var(--ket-line);
    border-radius: 18px;
    padding: 22px;
    text-align: center;
}

.ket-question h2 {
    font-size: 26px;
    margin: 12px 0 6px;
}

.ket-question p {
    color: var(--ket-muted);
}

.ket-quiz-warning {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 14px;
    color: #e11d48;
    display: inline-flex;
    font-weight: 900;
    margin: 12px auto 2px;
    padding: 10px 14px;
}

.ket-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.ket-options button {
    background: #fff;
    border: 1px solid var(--ket-line);
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    min-height: 44px;
    padding: 8px 18px;
}

.ket-options button.is-selected,
.ket-options button:hover,
.ket-options button:focus {
    border-color: var(--ket-purple);
    box-shadow: 0 0 0 3px rgba(139, 85, 246, 0.16);
    color: var(--ket-purple);
}

.ket-quiz-feedback {
    pointer-events: none;
    position: fixed;
    z-index: 10000;
}

.ket-confetti-burst {
    inset: 0;
    overflow: hidden;
}

.ket-confetti-burst i {
    animation: ket-confetti-fall 1.18s cubic-bezier(0.12, 0.72, 0.28, 1) forwards;
    animation-delay: var(--d, 0s);
    background: var(--c, #ffc83d);
    border-radius: 3px;
    height: 14px;
    left: 50%;
    position: absolute;
    top: 42%;
    transform: translate(-50%, -50%);
    width: 8px;
}

.ket-confetti-burst i:nth-child(3n) {
    border-radius: 999px;
    height: 10px;
    width: 10px;
}

.ket-confetti-burst i:nth-child(4n) {
    height: 8px;
    width: 18px;
}

.ket-confetti-burst strong {
    animation: ket-feedback-pop 0.86s ease both;
    background: #fff;
    border-radius: 999px;
    box-shadow: var(--ket-shadow);
    color: #20a35b;
    font-size: clamp(24px, 4vw, 46px);
    font-weight: 1000;
    left: 50%;
    padding: 14px 26px;
    position: absolute;
    top: 42%;
    transform: translate(-50%, -50%);
}

.ket-encourage-pop {
    align-items: center;
    animation: ket-encourage-in 0.34s ease both;
    background: linear-gradient(135deg, #fff8e8, #f5f0ff);
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 22px;
    box-shadow: var(--ket-shadow);
    display: grid;
    gap: 2px 12px;
    grid-template-columns: auto 1fr;
    left: 50%;
    max-width: min(520px, calc(100vw - 32px));
    padding: 16px 20px;
    top: min(72vh, 680px);
    transform: translateX(-50%);
    width: max-content;
}

.ket-encourage-pop b {
    font-size: 34px;
    grid-row: span 2;
}

.ket-encourage-pop strong {
    color: #7c3aed;
    font-size: 18px;
    font-weight: 1000;
}

.ket-encourage-pop span {
    color: var(--ket-muted);
    font-size: 14px;
    font-weight: 800;
}

@keyframes ket-confetti-fall {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
    }
    14% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(var(--r));
    }
}

@keyframes ket-feedback-pop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.72);
    }
    28% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.08);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -64%) scale(1);
    }
}

@keyframes ket-encourage-in {
    0% {
        opacity: 0;
        transform: translate(-50%, 18px) scale(0.94);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -4px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

.ket-answer-input {
    display: grid;
    gap: 8px;
    margin: 18px auto 0;
    max-width: 520px;
    text-align: left;
}

.ket-answer-input span {
    color: var(--ket-muted);
    font-weight: 900;
}

.ket-answer-input input {
    border: 1px solid var(--ket-line);
    border-radius: 14px;
    font: inherit;
    font-size: 20px;
    min-height: 52px;
    padding: 0 16px;
    width: 100%;
}

.ket-build-answer {
    align-items: center;
    background: #fff;
    border: 2px dashed rgba(139, 85, 246, 0.35);
    border-radius: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 18px auto 14px;
    min-height: 64px;
    padding: 12px;
    max-width: 760px;
}

.ket-build-answer span {
    color: var(--ket-muted);
    font-weight: 900;
}

.ket-build-answer button,
.ket-word-bank button,
.ket-mini-reset {
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.ket-build-answer button {
    background: #f1ecff;
    border-radius: 999px;
    color: var(--ket-purple);
    min-height: 42px;
    padding: 8px 14px;
}

.ket-word-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 14px auto 0;
    max-width: 820px;
}

.ket-word-bank button {
    background: #fff;
    border: 1px solid var(--ket-line);
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(74, 62, 42, 0.08);
    min-height: 46px;
    padding: 8px 18px;
}

.ket-letter-bank button,
.ket-spell-answer button {
    font-size: 24px;
    min-width: 48px;
    text-transform: uppercase;
}

.ket-mini-reset {
    background: transparent;
    color: var(--ket-purple);
    margin-top: 12px;
    text-decoration: underline;
}

.ket-matching-board {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 22px auto 10px;
    max-width: 760px;
    text-align: left;
}

.ket-matching-col {
    display: grid;
    gap: 10px;
}

.ket-matching-col > strong {
    color: var(--ket-muted);
    font-size: 15px;
    padding-left: 6px;
}

.ket-matching-col button {
    align-items: center;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(74, 62, 42, 0.08);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-weight: 900;
    justify-content: space-between;
    min-height: 54px;
    padding: 10px 14px;
    text-align: left;
}

.ket-matching-col button small {
    color: var(--ket-purple);
    font-weight: 900;
    margin-left: 10px;
}

.ket-matching-col button.is-selected {
    border-color: var(--ket-purple);
    box-shadow: 0 0 0 4px rgba(139, 85, 246, 0.16);
}

.ket-matching-col button.is-matched {
    background: #f1ecff;
    color: var(--ket-purple);
}

.ket-matching-col button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.ket-matching-note {
    color: var(--ket-muted);
    font-weight: 900;
    margin-top: 10px;
    text-align: center;
}

.ket-quiz-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.ket-quiz-timer,
.ket-quiz-time-limit {
    background: #fff7db;
    border: 1px solid #f6d56d;
    border-radius: 999px;
    color: #9a6a00;
    display: inline-flex;
    font-weight: 900;
    padding: 8px 14px;
}

.ket-quiz-timer.is-danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #e11d48;
}

.ket-dashboard-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.ket-dashboard-grid article,
.ket-list-row,
.ket-empty,
.ket-result {
    background: #fff;
    border: 1px solid var(--ket-line);
    border-radius: 18px;
    box-shadow: var(--ket-shadow);
    padding: 18px;
}

.ket-dashboard-grid strong,
.ket-result strong {
    display: block;
    font-size: 34px;
}

.ket-dashboard-grid span,
.ket-list-row span,
.ket-empty p,
.ket-result p {
    color: var(--ket-muted);
}

.ket-list {
    display: grid;
    gap: 14px;
}

.ket-list-row {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    text-decoration: none;
}

.ket-list-row a {
    text-decoration: none;
}

.ket-quiz-history-row small {
    color: var(--ket-muted);
    display: block;
    font-weight: 800;
    margin: 6px 0;
}

.ket-lesson-quiz-summary {
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 24px;
    box-shadow: var(--ket-shadow);
    display: grid;
    gap: 14px;
    padding: 20px;
}

.ket-lesson-quiz-summary.is-complete {
    background: linear-gradient(135deg, rgba(220, 252, 231, 0.96), rgba(255, 255, 255, 0.96));
    border-color: rgba(34, 197, 94, 0.38);
}

.ket-lesson-quiz-summary.is-incomplete {
    background: linear-gradient(135deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.96));
}

.ket-summary-head {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.ket-summary-head strong {
    display: block;
    font-size: clamp(22px, 3vw, 34px);
    line-height: 1.18;
}

.ket-summary-head small {
    color: var(--ket-muted);
    display: block;
    font-weight: 800;
    margin-top: 6px;
}

.ket-complete-tick,
.ket-pending-badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-weight: 1000;
    justify-content: center;
    white-space: nowrap;
}

.ket-complete-tick {
    background: #22c55e;
    box-shadow: 0 10px 22px rgba(34, 197, 94, 0.25);
    color: #fff;
    font-size: 24px;
    height: 48px;
    width: 48px;
}

.ket-pending-badge {
    background: rgba(251, 191, 36, 0.18);
    color: #9a6b00;
    padding: 10px 16px;
}

.ket-summary-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ket-summary-pills span {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 999px;
    color: var(--ket-ink);
    font-weight: 900;
    padding: 9px 13px;
}

.ket-failed-quiz-links {
    background: rgba(255, 255, 255, 0.72);
    border: 1px dashed rgba(239, 68, 68, 0.35);
    border-radius: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
}

.ket-failed-quiz-links b {
    color: #ef4444;
    width: 100%;
}

.ket-failed-quiz-links a {
    background: rgba(239, 68, 68, 0.08);
    border-radius: 999px;
    color: #dc2626;
    font-weight: 900;
    padding: 8px 12px;
    text-decoration: none;
}

.ket-lesson-lock-note {
    background: linear-gradient(135deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.9));
    border: 1px solid rgba(251, 191, 36, 0.42);
    border-radius: 22px;
    box-shadow: var(--ket-shadow);
    color: #8a6b1f;
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 900;
    margin: 18px auto;
    max-width: var(--ket-container);
    padding: 18px 22px;
    text-align: center;
}

.ket-search-result-row {
    display: grid;
    grid-template-columns: 78px 1fr;
    justify-content: start;
}

.ket-search-result-row .ket-home-mini-thumb {
    height: 78px;
}

.ket-search-result-row strong,
.ket-search-result-row span {
    display: block;
}

.ket-pass,
.ket-fail {
    border-radius: 999px;
    font-weight: 900;
    padding: 8px 12px;
}

.ket-pass {
    background: #ecfdf5;
    color: #047857;
}

.ket-fail {
    background: #fff1f2;
    color: #be123c;
}

.ket-link-button {
    background: transparent;
    border: 0;
    color: #dc2626;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    padding: 6px 0;
}

.ket-answer-row {
    background: #fff;
    border: 1px solid var(--ket-line);
    border-left: 6px solid #d1d5db;
    border-radius: 18px;
    box-shadow: var(--ket-shadow);
    padding: 18px;
}

.ket-answer-row.is-correct {
    border-left-color: #22c55e;
}

.ket-answer-row.is-wrong {
    border-left-color: #ef4444;
}

.ket-answer-row p {
    color: var(--ket-muted);
    margin: 8px 0 0;
}

.ket-answer-row small {
    color: var(--ket-muted);
    display: block;
    margin-top: 10px;
}

.ket-result {
    margin: 0 auto;
    max-width: 560px;
    text-align: center;
}

.ket-result strong {
    color: var(--ket-purple);
    font-size: clamp(58px, 12vw, 112px);
    line-height: 1;
}

.ket-result-compact strong {
    font-size: clamp(44px, 9vw, 82px);
}

.ket-json {
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--ket-shadow);
    overflow: auto;
    padding: 20px;
}

.ket-alert {
    border: 1px solid #ef4444;
    border-radius: 14px;
    color: #b91c1c;
    margin-top: 24px;
    padding: 14px 16px;
}

.ket-form-success {
    background: #ecfdf5;
    border: 1px solid #34d399;
    border-radius: 14px;
    color: #047857;
    font-weight: 800;
    padding: 12px 14px;
}

.ket-profile-section {
    border-top: 1px solid var(--ket-line);
    margin-top: 22px;
    padding-top: 22px;
}

.ket-danger-zone {
    background: #fff5f5;
    border: 1px solid rgba(239, 68, 68, 0.22);
    border-radius: 16px;
    padding: 18px;
}

.ket-danger-zone p {
    color: var(--ket-muted);
    margin: 0 0 14px;
}

.ket-profile-section h2,
.ket-faq-group h2 {
    font-size: 24px;
    margin: 0 0 16px;
}

.ket-faq-group {
    margin: 0 auto 28px;
    max-width: 980px;
}

.ket-faq-item {
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--ket-shadow);
    padding: 0;
}

.ket-faq-item summary {
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    list-style: none;
    padding: 20px 24px;
}

.ket-faq-item summary::-webkit-details-marker {
    display: none;
}

.ket-faq-item summary::after {
    content: "+";
    float: right;
}

.ket-faq-item[open] summary::after {
    content: "-";
}

.ket-faq-item div {
    color: var(--ket-muted);
    line-height: 1.7;
    padding: 0 24px 22px;
}

.ket-bottom-nav {
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--ket-line);
    bottom: 0;
    box-shadow: 0 -12px 30px rgba(83, 64, 28, 0.08);
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(5, 1fr);
    left: 50%;
    max-width: 1160px;
    padding: 12px;
    position: fixed;
    transform: translateX(-50%);
    width: min(100%, 1160px);
    z-index: 20;
}

.ket-bottom-nav a {
    border-radius: 14px;
    color: #817b70;
    display: grid;
    font-size: 14px;
    font-weight: 800;
    gap: 4px;
    justify-items: center;
    padding: 12px 8px;
    text-align: center;
    text-decoration: none;
}

.ket-bottom-nav a b {
    font-size: 26px;
    line-height: 1;
}

.ket-bottom-nav a.is-active {
    color: var(--ket-yellow);
}

@media (max-width: 720px) {
    .ket-header {
        gap: 12px;
        padding: 18px;
    }

    .ket-brand-text {
        font-size: 22px;
    }

    .ket-header-actions {
        gap: 8px;
    }

    .ket-header-actions .ket-streak {
        font-size: 13px;
        padding: 8px 10px;
    }

    .ket-header-actions .ket-login-link {
        font-size: 16px;
    }

    .ket-main {
        padding: 18px;
    }

    .ket-is-home .ket-main {
        padding-top: 22px;
    }

    .ket-home-layout,
    .ket-home-path-feature a,
    .ket-continue-grid,
    .ket-content-filters,
    .ket-search-page-form,
    .ket-learning-filter-row,
    .ket-wide-card a {
        grid-template-columns: 1fr;
    }

    .ket-wide-card a {
        min-height: 0;
    }

    .ket-wide-card-media {
        aspect-ratio: 16 / 10;
    }

    .ket-wide-card-body h3 {
        font-size: 24px;
    }

    .ket-wide-card-actions,
    .ket-feature-footer,
    .ket-favorite-row {
        align-items: center;
        /* flex-direction: column; */
    }

    .ket-wide-card-actions b,
    .ket-feature-footer b {
        margin-left: 0;
        text-align: center;
    }

    .ket-home-skills,
    .ket-home-stat-panel {
        grid-template-columns: repeat(2, 1fr);
    }

    .ket-home-sidebar {
        position: static;
    }

    .ket-home-guest-hero h1,
    .ket-home-greeting h1 {
        font-size: 36px;
    }

    .ket-home-guest-hero p,
    .ket-home-greeting p {
        font-size: 18px;
    }

    .ket-home-skill-card {
        min-height: 118px;
        padding: 18px 12px;
        gap: 14px;
    }

    .ket-home-skill-card strong {
        font-size: 18px;
    }

    .ket-level-choice {
        grid-template-columns: 24px 44px 1fr;
        padding: 16px;
    }

    .ket-level-choice b {
        grid-column: 3;
        justify-self: start;
    }

    .ket-level-choice strong {
        font-size: 20px;
    }

    .ket-level-choice small {
        font-size: 15px;
    }

    .ket-home-path-thumb {
        max-width: 180px;
    }

    .ket-account-menu {
        bottom: 92px;
        left: 18px;
        min-width: 0;
        right: 18px;
        top: auto;
    }

    .ket-home-hero {
        border-radius: 20px;
    }

    .ket-grid,
    .ket-lesson-hero {
        grid-template-columns: 1fr;
    }

    .ket-path-map-page {
        padding: 6px 0 44px;
    }

    .ket-path-map-head {
        padding: 0 58px;
    }

    .ket-path-map-head h1 {
        font-size: 22px;
    }

    .ket-path-map-head p {
        font-size: 15px;
    }

    .ket-path-map-back,
    .ket-path-map-fav {
        height: 46px;
        top: 0;
        width: 46px;
    }

    .ket-path-map-back {
        left: 0;
    }

    .ket-path-map-fav {
        right: 0;
    }

    .ket-path-map-page > .ket-progress-badge {
        right: 52px;
        top: 0;
        transform: scale(0.86);
        transform-origin: top right;
    }

    .ket-path-timeline {
        gap: 48px;
        max-width: 100%;
        padding-top: 32px;
    }

    .ket-path-step:nth-child(odd),
    .ket-path-step:nth-child(even) {
        transform: none;
    }

    .ket-path-node {
        height: 88px;
        width: 88px;
    }

    .ket-path-node b {
        font-size: 36px;
    }

    .ket-start-badge {
        font-size: 14px;
        padding: 7px 14px;
        top: -50px;
    }

    .ket-path-step strong {
        font-size: 18px;
    }

    .ket-lesson-hero {
        gap: 18px;
    }

    .ket-listening-page > .ket-back {
        position: static;
        margin-bottom: 12px;
    }

    .ket-listening-title {
        margin-bottom: 18px;
    }

    .ket-listening-title h1 {
        font-size: 30px;
    }

    .ket-listening-hero,
    .ket-player-toolbar {
        grid-template-columns: 1fr;
    }

    .ket-listening-hero {
        gap: 16px;
    }

    .ket-listening-info {
        padding: 20px;
    }

    .ket-listening-info h2 {
        font-size: 26px;
    }

    .ket-listening-stats {
        grid-template-columns: 1fr;
    }

    .ket-listening-player {
        padding: 18px;
    }

    .ket-player-toolbar {
        gap: 16px;
        justify-items: center;
    }

    .ket-player-left,
    .ket-player-right {
        justify-content: center;
    }

    .ket-listening-play {
        height: 76px;
        width: 76px;
    }

    .ket-listening-line {
        grid-template-columns: 1fr;
    }

    .ket-listening-line h3 {
        font-size: 20px;
    }

    .ket-hero-fav {
        right: 8px;
        top: 54px;
    }

    .ket-vocab-scroll {
        grid-auto-columns: minmax(160px, 190px);
    }

    .ket-lesson-text-row a {
        gap: 12px;
        grid-template-columns: 78px 52px 1fr 18px;
        padding: 14px 58px 14px 14px;
    }

    .ket-lesson-text-row.is-no-controls a {
        grid-template-columns: 78px minmax(0, 1fr) 18px;
        padding-right: 14px;
    }

    .ket-row-copy h3 {
        font-size: 19px;
    }

    .ket-mini-tool,
    .ket-speed-chip {
        height: 36px;
        min-width: 36px;
        padding: 0 9px;
    }

    .ket-lesson-text-row .ket-fav-float {
        height: 42px;
        right: 10px;
        top: 10px;
        width: 42px;
    }

    .ket-item-row {
        grid-template-columns: 62px 1fr;
    }

    .ket-quiz-actions,
    .ket-study-actions,
    .ket-list-row {
        align-items: stretch;
        flex-direction: column;
    }

    .ket-bottom-nav a {
        font-size: 12px;
        padding: 10px 4px;
    }
}

/* Design refresh: playful, polished surfaces for primary-school learners. */
:root {
    --ket-bg: #fff6df;
    --ket-card: #fffdf8;
    --ket-surface: rgba(255, 253, 248, 0.92);
    --ket-text: #26211d;
    --ket-muted: #746f64;
    --ket-yellow: #ffc83d;
    --ket-purple: #8757f6;
    --ket-green: #23c16b;
    --ket-blue: #2f80ed;
    --ket-coral: #ff7b54;
    --ket-pink: #ff6fae;
    --ket-line: rgba(58, 50, 38, 0.1);
    --ket-shadow: 0 18px 46px rgba(101, 74, 24, 0.12);
    --ket-shadow-soft: 0 10px 24px rgba(101, 74, 24, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 9% 12%, rgba(255, 255, 255, 0.86) 0 62px, transparent 63px),
        radial-gradient(circle at 88% 8%, rgba(255, 255, 255, 0.58) 0 112px, transparent 113px),
        radial-gradient(circle at 80% 54%, rgba(231, 251, 239, 0.9) 0 150px, transparent 151px),
        radial-gradient(circle at 13% 70%, rgba(241, 234, 255, 0.78) 0 130px, transparent 131px),
        linear-gradient(180deg, #fff3ce 0%, #fff8e9 34%, #fff6df 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

body::before {
    background-image:
        radial-gradient(circle, rgba(255, 201, 61, 0.25) 0 3px, transparent 4px),
        radial-gradient(circle, rgba(135, 87, 246, 0.18) 0 2px, transparent 3px);
    background-position: 0 0, 28px 22px;
    background-size: 56px 56px, 64px 64px;
    content: "";
    inset: 0;
    opacity: 0.35;
    pointer-events: none;
    position: fixed;
    z-index: -1;
}

.ket-header {
    background: rgba(255, 248, 230, 0.72);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.66);
    border-radius: 0 0 28px 28px;
    box-shadow: 0 10px 32px rgba(101, 74, 24, 0.08);
    max-width: 1360px;
    padding-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 35;
}

.ket-brand {
    transition: transform 0.16s ease;
}

.ket-brand:hover {
    transform: translateY(-1px);
}

.ket-brand-mark {
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08), 0 10px 20px rgba(255, 201, 61, 0.28);
    position: relative;
}

.ket-brand-mark::after {
    content: "\2728";
    font-size: 14px;
    position: absolute;
    right: -10px;
    top: -11px;
}

.ket-login-link,
.ket-home-section-head a,
.ket-link-button {
    color: var(--ket-purple);
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
}

.ket-streak,
.ket-icon-button,
.ket-back,
.ket-hero-fav,
.ket-fav-float,
.ket-round,
.ket-line-audio {
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--ket-shadow-soft);
}

.ket-icon-button,
.ket-back,
.ket-hero-fav,
.ket-fav-float,
.ket-round,
.ket-line-audio {
    background: #fff;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.ket-icon-button:hover,
.ket-back:hover,
.ket-hero-fav:hover,
.ket-fav-float:hover,
.ket-round:hover,
.ket-line-audio:hover {
    box-shadow: var(--ket-shadow);
    transform: translateY(-2px);
}

.ket-button {
    align-items: center;
    box-shadow: inset 0 -5px 0 rgba(101, 74, 24, 0.14), 0 12px 24px rgba(255, 201, 61, 0.26);
    gap: 8px;
    justify-content: center;
    min-height: 54px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.ket-button:hover,
.ket-button:focus {
    filter: saturate(1.05);
    transform: translateY(-2px);
}

.ket-button-outline {
    box-shadow: 0 10px 22px rgba(135, 87, 246, 0.12);
}

.ket-home-greeting,
.ket-home-guest-hero,
.ket-page-head,
.ket-level-intro,
.ket-listening-title {
    position: relative;
}

.ket-home-greeting::after,
.ket-home-guest-hero::after {
    content: "\2B50";
    font-size: clamp(46px, 9vw, 92px);
    opacity: 0.18;
    position: absolute;
    right: 4%;
    top: 0;
    transform: rotate(12deg);
}

.ket-home-stat-panel,
.ket-home-path-feature,
.ket-home-lesson-feature,
.ket-home-sidebar section,
.ket-wide-card,
.ket-card,
.ket-favorite-row,
.ket-study-card,
.ket-auth,
.ket-quiz-panel,
.ket-dashboard-grid article,
.ket-list-row,
.ket-empty,
.ket-result,
.ket-listening-info,
.ket-listening-player,
.ket-profile-card,
.ket-profile-section,
.ket-level-choice {
    background: var(--ket-surface);
    border: 1px solid rgba(255, 255, 255, 0.76);
    box-shadow: var(--ket-shadow);
}

.ket-home-path-feature,
.ket-home-lesson-feature,
.ket-home-sidebar section,
.ket-wide-card,
.ket-card,
.ket-vocab-card,
.ket-lesson-text-row,
.ket-study-card,
.ket-auth,
.ket-quiz-panel,
.ket-listening-info,
.ket-listening-player,
.ket-profile-card,
.ket-profile-section,
.ket-level-choice,
.ket-empty,
.ket-list-row {
    border-radius: 26px;
}

.ket-home-section h2::before,
.ket-section h2::before {
    color: var(--ket-yellow);
    content: "\2726";
    margin-right: 10px;
    text-shadow: 0 2px 0 rgba(101, 74, 24, 0.12);
}

.ket-home-skill-card {
    border: 1px solid rgba(255, 255, 255, 0.8);
    min-height: 220px;
    overflow: hidden;
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ket-home-skill-card::before {
    border-radius: 50%;
    content: "";
    height: 92px;
    opacity: 0.42;
    position: absolute;
    right: -28px;
    top: -24px;
    width: 92px;
}

.ket-home-skill-card:hover {
    box-shadow: 0 22px 54px rgba(101, 74, 24, 0.16);
    transform: translateY(-4px);
}

.ket-home-skill-card span {
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.04);
    font-size: 42px;
}

.ket-skill-vocabulary span,
.ket-skill-vocabulary::before { background: #f1e8ff; }
.ket-skill-sentence span,
.ket-skill-sentence::before { background: #e8fbef; }
.ket-skill-dialogue span,
.ket-skill-dialogue::before { background: #fff0dc; }
.ket-skill-listen span,
.ket-skill-listen::before { background: #ffe8f2; }

.ket-home-path-thumb,
.ket-home-side-thumb,
.ket-home-mini-thumb,
.ket-card-media,
.ket-wide-card-media,
.ket-lesson-art,
.ket-listening-art,
.ket-vocab-image,
.ket-row-thumb,
.ket-study-image {
    background:
        radial-gradient(circle at 26% 22%, rgba(255, 255, 255, 0.86) 0 24%, transparent 25%),
        radial-gradient(circle at 78% 14%, rgba(255, 255, 255, 0.62) 0 18%, transparent 19%),
        linear-gradient(135deg, #ddf7ff, #fff3d8);
}

.ket-home-collage {
    border-radius: 18px;
    overflow: hidden;
}

.ket-home-collage .has-more::after {
    background: rgba(30, 27, 24, 0.48);
}

.ket-level-chip,
.ket-home-pill,
.ket-wide-card-actions b,
.ket-meta span {
    background: #f5efe4;
    border-radius: 999px;
    color: var(--ket-purple);
    display: inline-flex;
    font-weight: 900;
    padding: 7px 12px;
}

.ket-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ket-search input,
.ket-level-filter select,
.ket-auth input,
.ket-auth select,
.ket-answer-input input,
.ket-search-page-form input,
.ket-filter-bar select {
    background: rgba(255, 255, 255, 0.94);
    border: 2px solid rgba(38, 33, 29, 0.1);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.85), var(--ket-shadow-soft);
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.ket-search input:focus,
.ket-level-filter select:focus,
.ket-auth input:focus,
.ket-auth select:focus,
.ket-answer-input input:focus,
.ket-search-page-form input:focus,
.ket-filter-bar select:focus {
    border-color: rgba(135, 87, 246, 0.55);
    box-shadow: 0 0 0 4px rgba(135, 87, 246, 0.14), var(--ket-shadow-soft);
}

.ket-skill-tabs a {
    border: 1px solid rgba(255, 255, 255, 0.76);
    box-shadow: var(--ket-shadow-soft);
    transition: transform 0.16s ease, background 0.16s ease;
}

.ket-skill-tabs a:hover,
.ket-skill-tabs a:focus,
.ket-skill-tabs a.is-active {
    box-shadow: 0 12px 24px rgba(135, 87, 246, 0.2);
    transform: translateY(-2px);
}

.ket-wide-card,
.ket-card,
.ket-vocab-card,
.ket-lesson-text-row,
.ket-home-side-row,
.ket-continue-card {
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.ket-wide-card:hover,
.ket-card:hover,
.ket-vocab-card:hover,
.ket-lesson-text-row:hover,
.ket-home-side-row:hover,
.ket-continue-card:hover {
    box-shadow: 0 22px 52px rgba(101, 74, 24, 0.15);
    transform: translateY(-3px);
}

.ket-lesson-hero {
    background: rgba(255, 253, 248, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 30px;
    box-shadow: var(--ket-shadow-soft);
    padding: clamp(18px, 3vw, 28px);
}

.ket-stat-row span {
    background: #fff6df;
    border-radius: 18px;
    color: var(--ket-muted);
    display: inline-flex;
    font-weight: 900;
    padding: 10px 14px;
}

.ket-listening-player {
    background:
        radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.58) 0 74px, transparent 75px),
        linear-gradient(135deg, #f2edff, #fff7df);
}

.ket-listening-info,
.ket-listening-tip,
.ket-lesson-text-row {
    background: linear-gradient(135deg, #f5f0ff, #fff8ef);
}

.ket-vocab-card {
    border: 1px solid rgba(255, 255, 255, 0.82);
}

.ket-mini-tool,
.ket-speed-chip {
    background: #fff;
    box-shadow: var(--ket-shadow-soft);
}

.ket-question {
    background: linear-gradient(135deg, #fffaf0, #f5f0ff);
    border-color: rgba(255, 255, 255, 0.76);
}

.ket-options button {
    border-radius: 16px;
    box-shadow: var(--ket-shadow-soft);
}

.ket-profile-card,
.ket-level-choice {
    background: linear-gradient(135deg, #fff, #fff8e9);
}

.ket-level-choice.is-active {
    background: linear-gradient(135deg, #f3fff8, #fffdf8);
}

.ket-account-menu {
    border: 1px solid rgba(255, 255, 255, 0.82);
}

.ket-bottom-nav {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -14px 42px rgba(101, 74, 24, 0.12);
}

.ket-bottom-nav a {
    border-radius: 18px;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.ket-bottom-nav a:hover,
.ket-bottom-nav a.is-active {
    background: #fff7df;
    color: #f5b400;
    transform: translateY(-2px);
}

.ket-bottom-nav b {
    font-size: 24px;
    line-height: 1;
}

.ket-empty::before {
    content: "\1F308";
    display: block;
    font-size: 34px;
    margin-bottom: 8px;
}

.ket-load-more-hint::before {
    content: "\2B07\FE0F  ";
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

@media (max-width: 760px) {
    body {
        background-attachment: scroll;
    }

    .ket-header {
        border-radius: 0 0 22px 22px;
        position: relative;
    }

    .ket-home-skill-card {
        min-height: 160px;
    }

    .ket-home-collage {
        grid-template-rows: minmax(82px, 1fr) minmax(82px, 1fr) minmax(70px, 0.74fr);
    }

    .ket-home-skill-card span {
        font-size: 32px;
    }

    .ket-lesson-hero {
        border-radius: 24px;
    }

    .ket-quiz-choice {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .ket-quiz-choice .ket-button {
        justify-content: center;
        width: 100%;
    }
}

/* Responsive navigation placement: header on desktop/tablet, footer on mobile. */
.ket-header {
    justify-content: flex-start;
}

.ket-header-nav {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    margin-left: 18px;
    min-width: 0;
}

.ket-header-nav a {
    align-items: center;
    border-radius: 999px;
    color: var(--ket-muted);
    display: inline-flex;
    font-size: 15px;
    font-weight: 900;
    gap: 7px;
    min-height: 42px;
    padding: 0 13px;
    text-decoration: none;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
    white-space: nowrap;
}

.ket-header-nav a:hover,
.ket-header-nav a:focus {
    background: rgba(255, 255, 255, 0.78);
    color: var(--ket-purple);
    transform: translateY(-1px);
}

.ket-header-nav b {
    font-size: 18px;
    line-height: 1;
}

.ket-bottom-nav {
    display: none;
}

.ket-app-shell {
    padding-bottom: 24px;
}

@media (max-width: 1100px) and (min-width: 721px) {
    .ket-is-home .ket-main {
        max-width: 100%;
        padding-left: clamp(18px, 3vw, 32px);
        padding-right: clamp(18px, 3vw, 32px);
    }

    .ket-home-layout {
        grid-template-columns: 1fr;
    }

    .ket-home-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        position: static;
    }

    .ket-home-sidebar section {
        min-width: 0;
    }

    .ket-home-side-row {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .ket-home-side-row strong,
    .ket-home-side-row span,
    .ket-continue-card strong,
    .ket-continue-card small {
        overflow-wrap: normal;
        word-break: normal;
    }

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

    .ket-continue-card {
        grid-template-columns: 92px minmax(0, 1fr) 58px;
        min-width: 0;
    }

    .ket-home-skills {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .ket-home-skill-card {
        min-height: 180px;
        padding: 24px 16px 20px;
    }

    .ket-home-skill-card strong {
        font-size: clamp(18px, 2.3vw, 24px);
        line-height: 1.15;
    }

    .ket-home-greeting h1,
    .ket-home-guest-hero h1 {
        font-size: clamp(42px, 6vw, 64px);
    }
}

@media (max-width: 860px) and (min-width: 721px) {
    .ket-home-sidebar,
    .ket-continue-grid {
        grid-template-columns: 1fr;
    }

    .ket-home-skills,
    .ket-home-stat-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ket-continue-card {
        grid-template-columns: 96px minmax(0, 1fr) 58px;
    }

    .ket-home-greeting h1,
    .ket-home-guest-hero h1 {
        font-size: clamp(36px, 7vw, 56px);
    }
}

@media (max-width: 1024px) {
    .ket-header {
        gap: 14px;
    }

    .ket-header-nav {
        gap: 4px;
        margin-left: 8px;
    }

    .ket-header-nav a {
        font-size: 0;
        height: 42px;
        justify-content: center;
        padding: 0;
        width: 42px;
    }

    .ket-header-nav b {
        font-size: 20px;
    }
}

@media (max-width: 720px) {
    .ket-header {
        justify-content: space-between;
    }

    .ket-header-nav {
        display: none;
    }

    .ket-bottom-nav {
        display: grid;
    }

    .ket-app-shell {
        padding-bottom: 88px;
    }
}

.ket-header-nav a.is-active {
    background: #fff7df;
    color: var(--ket-purple);
    box-shadow: var(--ket-shadow-soft);
}

.ket-exit-modal {
    align-items: flex-end;
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 24px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 9999;
}

.ket-exit-backdrop {
    background: rgba(32, 28, 21, 0.48);
    border: 0;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.ket-exit-panel {
    background: linear-gradient(180deg, #9a68ff 0%, #8054f5 100%);
    border-radius: 34px 34px 0 0;
    box-shadow: 0 -28px 70px rgba(62, 34, 142, 0.35);
    color: #fff;
    max-width: 980px;
    padding: 74px 48px 44px;
    position: relative;
    text-align: center;
    width: min(100%, 980px);
}

.ket-exit-badge {
    align-items: center;
    background: #fff;
    border: 10px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    box-shadow: 0 18px 38px rgba(50, 30, 110, 0.24);
    color: #8054f5;
    display: inline-flex;
    font-size: 44px;
    font-weight: 900;
    height: 112px;
    justify-content: center;
    left: 50%;
    position: absolute;
    top: -56px;
    transform: translateX(-50%);
    width: 112px;
}

.ket-exit-panel h2 {
    color: #fff;
    font-size: clamp(28px, 4vw, 42px);
    margin: 0 0 16px;
}

.ket-exit-panel p {
    color: rgba(255, 255, 255, 0.86);
    font-size: 20px;
    margin: 0 auto 34px;
    max-width: 760px;
}

.ket-exit-actions {
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr 1.5fr;
}

.ket-exit-actions button {
    border: 0;
    border-radius: 22px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 900;
    min-height: 72px;
    padding: 0 24px;
}

.ket-exit-leave {
    background: transparent;
    color: #fff;
}

.ket-exit-stay {
    background: #f4eeff;
    color: #8054f5;
}

.ket-lesson-progress {
    background: #fff;
    border: 1px solid rgba(136, 84, 245, 0.14);
    border-radius: 20px;
    box-shadow: var(--ket-shadow-soft);
    display: grid;
    gap: 6px;
    margin-top: 18px;
    max-width: 320px;
    padding: 16px;
}

.ket-lesson-progress strong {
    color: var(--ket-purple);
    font-size: 30px;
    line-height: 1;
}

.ket-lesson-progress span {
    color: var(--ket-muted);
    font-weight: 800;
}

.ket-lesson-sticky-cta {
    background: transparent;
    border: 0;
    bottom: 18px;
    box-shadow: none;
    left: 50%;
    max-width: 520px;
    opacity: 0;
    padding: 0;
    pointer-events: none;
    position: fixed;
    transform: translateX(-50%) translateY(18px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    width: min(calc(100% - 48px), 520px);
    z-index: 80;
}

.ket-lesson-sticky-cta.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.ket-lesson-sticky-cta .ket-button {
    border-radius: 22px;
    box-shadow: 0 8px 0 rgba(101, 74, 24, 0.14), 0 18px 34px rgba(101, 74, 24, 0.18);
    min-height: 54px;
    width: 100%;
}

.ket-lesson-actions {
    margin-bottom: 24px;
}

.ket-lesson-hero ~ .ket-section:last-of-type,
.ket-listening-page {
    margin-bottom: 96px;
}

@media (max-width: 720px) {
    .ket-exit-modal {
        padding: 18px 12px 0;
    }

    .ket-exit-panel {
        border-radius: 30px 30px 0 0;
        padding: 62px 22px 30px;
    }

    .ket-exit-actions {
        grid-template-columns: 1fr;
    }

    .ket-exit-actions button {
        min-height: 58px;
    }

    .ket-lesson-sticky-cta {
        bottom: calc(82px + env(safe-area-inset-bottom, 0px));
        width: calc(100% - 32px);
    }

    .ket-lesson-sticky-cta .ket-button {
        min-height: 48px;
    }

    .ket-lesson-hero ~ .ket-section:last-of-type,
    .ket-listening-page {
        margin-bottom: 142px;
    }
}

/* Compact study item screen: keep learning controls visible without scrolling. */
.ket-study-card {
    box-sizing: border-box;
    display: grid;
    gap: clamp(6px, 1.1vh, 10px);
    margin-bottom: 92px;
    min-height: min(720px, calc(100dvh - 128px));
    padding: clamp(10px, 1.6vw, 18px) clamp(12px, 2vw, 24px) clamp(12px, 2vw, 24px);
    position: relative;
}

.ket-study-card .ket-back {
    border: 0;
    height: 44px;
    left: auto;
    margin: 0;
    position: absolute;
    right: clamp(12px, 1.8vw, 20px);
    top: clamp(12px, 1.8vw, 20px);
    width: 44px;
    z-index: 2;
}

.ket-study-card .ket-quiz-head {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin: 0;
    min-height: 44px;
    padding-left: 0;
    padding-right: 62px;
}

.ket-study-card .ket-progress {
    height: 7px;
    margin: 0;
}

.ket-study-card h1,
.ket-study-card h2,
.ket-study-card .ket-phonetic {
    margin-bottom: 0;
    margin-top: 0;
}

.ket-study-card h1 {
    font-size: clamp(30px, 5vh, 52px);
    line-height: 1.05;
}

.ket-study-card h2 {
    font-size: clamp(22px, 3.6vh, 34px);
}

.ket-study-card .ket-phonetic {
    font-size: clamp(17px, 2.4vh, 23px);
}

.ket-study-image {
    height: clamp(118px, 25vh, 210px);
    margin: 0 auto;
    max-width: none;
    width: clamp(118px, 25vh, 210px);
}

.ket-study-tools {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.ket-study-tools .ket-round {
    box-shadow: var(--ket-shadow-soft);
    height: 44px;
    width: 44px;
}

.ket-study-lock-note {
    background: linear-gradient(135deg, rgba(255, 249, 230, 0.96), rgba(245, 239, 255, 0.96));
    border: 1px solid rgba(255, 200, 61, 0.42);
    border-radius: 20px;
    box-shadow: var(--ket-shadow-soft);
    color: #806a38;
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 900;
    justify-self: center;
    line-height: 1.35;
    max-width: 680px;
    padding: 14px 18px;
    text-align: center;
    width: min(100%, 680px);
}

.ket-audio-button.is-playing,
[data-audio].is-playing {
    background: var(--ket-purple);
    color: #fff;
    transform: translateY(1px) scale(0.98);
}

.ket-speaking-practice {
    gap: 6px;
    margin-top: 0;
    padding-top: clamp(10px, 1.6vh, 16px);
}

.ket-speak-button {
    min-height: 48px;
    padding: 0 22px;
}

.ket-speaking-practice p {
    font-size: clamp(15px, 2vh, 19px);
}

.ket-study-actions {
    background: transparent;
    border: 0;
    border-radius: 0;
    bottom: 0;
    box-shadow: none;
    display: flex;
    gap: 0;
    justify-content: space-between;
    left: 50%;
    margin: 0;
    max-width: 1180px;
    padding: 10px 18px;
    pointer-events: none;
    position: fixed;
    transform: translateX(-50%);
    width: min(calc(100% - 32px), 1180px);
    z-index: 90;
}

.ket-study-actions .ket-button {
    align-items: center;
    border-radius: 18px;
    box-shadow: 0 8px 0 rgba(101, 74, 24, 0.1), 0 16px 30px rgba(101, 74, 24, 0.14);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: clamp(15px, 1.5vw, 18px);
    gap: 8px;
    justify-content: center;
    min-height: 46px;
    min-width: 124px;
    padding: 0 18px;
    pointer-events: auto;
}

.ket-study-next {
    margin-left: auto;
}

.ket-study-action-spacer {
    display: block;
    width: 124px;
}

.ket-study-actions .ket-button-outline {
    background: #fff;
    box-shadow: inset 0 0 0 3px var(--ket-purple), 0 16px 30px rgba(139, 85, 246, 0.12);
}

@media (max-height: 760px) {
    .ket-study-card {
        gap: 5px;
        min-height: calc(100dvh - 112px);
        padding-bottom: 10px;
        padding-top: 10px;
    }

    .ket-study-image {
        height: clamp(96px, 20vh, 154px);
        width: clamp(96px, 20vh, 154px);
    }

    .ket-speaking-practice p {
        display: none;
    }
}

@media (max-width: 720px) {
    .ket-study-card {
        margin-bottom: 168px;
        min-height: calc(100dvh - 145px);
    }

    .ket-study-actions {
        bottom: calc(65px + env(safe-area-inset-bottom, 0px));
        flex-direction: row;
        padding: 8px 14px;
        width: calc(100% - 12px);
    }

    .ket-study-actions .ket-button {
        border-radius: 16px;
        flex-basis: auto;
        font-size: 13px;
        gap: 6px;
        min-height: 40px;
        min-width: 76px;
        padding: 0 10px;
    }

    .ket-study-action-spacer {
        width: 76px;
    }
}

.ket-progress-badge {
    align-items: center;
    background: #fffaf0;
    border: 1px solid rgba(255, 200, 61, 0.34);
    border-radius: 999px;
    color: var(--ket-muted);
    display: inline-flex;
    gap: 9px;
    margin-top: 12px;
    padding: 8px 12px;
    width: fit-content;
}

.ket-progress-badge b {
    align-items: center;
    background:
        radial-gradient(#fff 0 55%, transparent 56%),
        conic-gradient(var(--ket-yellow) 0 var(--progress, 0%), #f1ead6 var(--progress, 0%) 100%);
    border-radius: 50%;
    color: var(--ket-text);
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.ket-progress-badge small {
    font-size: 14px;
    font-weight: 900;
}

.ket-range-field span {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 62px;
}

.ket-range-field input[type="range"] {
    accent-color: var(--ket-yellow);
    cursor: pointer;
    width: 100%;
}

.ket-range-field b {
    background: #fff7df;
    border-radius: 999px;
    color: var(--ket-text);
    font-size: 16px;
    padding: 8px 10px;
    text-align: center;
}

.ket-profile-menu {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.ket-profile-menu a {
    align-items: center;
    background: #fff;
    border: 1px solid var(--ket-line);
    border-radius: 18px;
    color: var(--ket-text);
    display: flex;
    font-size: 18px;
    font-weight: 900;
    gap: 12px;
    min-height: 56px;
    padding: 0 18px;
    text-decoration: none;
}
