/* ==========================================================================
   Kids Zone (Learn & Play) — kids/*.html
   ========================================================================== */

.kz {
    --kz-bg: #f4f8ff;
    --kz-card: #ffffff;
    --kz-border: #e3ebf7;
    --kz-text: #1e2a4a;
    --kz-muted: #66728f;
    --kz-shadow: 0 6px 18px rgba(30, 64, 175, 0.08);
    --kz-yellow: #ffc727;
    --kz-yellow-dark: #f59e0b;
    --kz-navy: #173a8f;
    font-family: 'Baloo 2', 'Inter', system-ui, sans-serif;
    color: var(--kz-text);
    background: var(--kz-bg);
    padding: 0 clamp(12px, 2.5vw, 32px) 40px;
    min-height: 70vh;
}

.kz h1, .kz h2, .kz h3 { font-family: inherit; color: inherit; }
.kz a { text-decoration: none; }
.kz-muted { color: var(--kz-muted); }
.kz-empty { color: var(--kz-muted); padding: 12px 0; margin: 0; }

/* Colour themes for subjects / activities / badges */
.kz-c-blue   { --kc: #2f80ed; --kc2: #56ccf2; --kc-soft: #e6f2ff; }
.kz-c-pink   { --kc: #eb3f86; --kc2: #ff8fb8; --kc-soft: #ffe8f1; }
.kz-c-green  { --kc: #1fa855; --kc2: #6fdc8c; --kc-soft: #e5f8ea; }
.kz-c-purple { --kc: #8b45e8; --kc2: #c08bff; --kc-soft: #f1e8ff; }
.kz-c-orange { --kc: #f2711c; --kc2: #ffb162; --kc-soft: #fff0e3; }
.kz-c-teal   { --kc: #0fa5a5; --kc2: #5be0d2; --kc-soft: #e0f8f6; }
.kz-c-red    { --kc: #e53935; --kc2: #ff8a80; --kc-soft: #ffeaea; }
.kz-c-amber  { --kc: #e8a400; --kc2: #ffd54f; --kc-soft: #fff7dc; }

.kz-emoji { line-height: 1; }
.kz-ic-img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Buttons & chips ---------- */
.kz-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(180deg, var(--kz-yellow), var(--kz-yellow-dark));
    color: #1e2a4a !important; font-weight: 800; border: 0; border-radius: 999px;
    padding: 10px 22px; box-shadow: 0 4px 0 #c77d00; transition: transform .1s ease, box-shadow .1s ease;
    cursor: pointer; font-family: inherit; font-size: 1rem;
}
.kz-btn:hover { transform: translateY(-1px); }
.kz-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c77d00; }
.kz-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.kz-btn-lg { font-size: 1.2rem; padding: 12px 28px; }
.kz-btn-sm { font-size: .85rem; padding: 6px 14px; box-shadow: 0 3px 0 #c77d00; }
.kz-btn-ghost { background: var(--kz-card); color: var(--kz-navy) !important; border: 2px solid var(--kz-border); box-shadow: none; }

.kz-chip {
    display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700;
    background: var(--kc-soft, #eef3fb); color: var(--kc, #3a4a6b); border-radius: 999px; padding: 2px 10px;
}
.kz-chip-ok { background: #e5f8ea; color: #15803d; }

.kz-stars { color: #f5b301; font-size: .9rem; letter-spacing: 1px; white-space: nowrap; }
.kz-stars .bi-star { color: #cdd5e3; }

.kz-admin-note { background: #fff7dc; border: 1px dashed #e8a400; border-radius: 12px; padding: 8px 14px; margin-top: 12px; font-size: .9rem; }

/* ---------- Brand bar & tabs ---------- */
.kz-bar {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    background: var(--kz-card); border-radius: 0 0 22px 22px; padding: 10px 18px; box-shadow: var(--kz-shadow);
    margin-bottom: 18px;
}
.kz-brand { display: flex; align-items: center; gap: 10px; color: var(--kz-navy); }
.kz-brand-ic { font-size: 2.1rem; line-height: 1; }
.kz-brand-name { display: block; font-size: 1.55rem; font-weight: 800; line-height: 1; color: var(--kz-navy);
    background: linear-gradient(90deg, #173a8f 0 55%, #f2711c 55%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.kz-brand-tag { display: block; font-size: .78rem; color: var(--kz-muted); font-weight: 600; }
.kz-tabs { display: flex; gap: 4px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.kz-tabs::-webkit-scrollbar { display: none; }
.kz-tab {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 14px; border-radius: 14px;
    color: var(--kz-text); font-weight: 700; font-size: .85rem; white-space: nowrap;
}
.kz-tab i { font-size: 1.35rem; }
.kz-tab i { color: #2f80ed; }
.kz-tab:nth-child(3) i { color: #eb3f86; }
.kz-tab:nth-child(4) i { color: #e53935; }
.kz-tab:nth-child(5) i { color: #8b45e8; }
.kz-tab:nth-child(6) i { color: #1fa855; }
.kz-tab:nth-child(7) i { color: #e8a400; }
.kz-tab:nth-child(8) i { color: #e53935; }
.kz-tab:hover { background: var(--kz-bg); color: var(--kz-text); }
.kz-tab.is-active { background: #fff3c4; box-shadow: inset 0 -3px 0 var(--kz-yellow-dark); }
.kz-me { display: flex; align-items: center; gap: 8px; color: var(--kz-text); padding: 4px 12px 4px 4px; border-radius: 999px; border: 2px solid var(--kz-border); }
.kz-me-av { width: 40px; height: 40px; border-radius: 50%; background: #ffe7a8; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; overflow: hidden; }
.kz-me-av img { width: 100%; height: 100%; object-fit: cover; }
.kz-me-name { display: block; font-weight: 800; line-height: 1.1; }
.kz-me-sub { display: block; font-size: .75rem; color: var(--kz-muted); }

/* ---------- Hero ---------- */
.kz-hero {
    position: relative; display: grid; gap: 18px; align-items: center;
    grid-template-columns: minmax(0, 120px) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 90px) minmax(0, 1fr);
    background: linear-gradient(180deg, #8fd3ff 0%, #c7ecff 55%, #b6e6a1 100%);
    border-radius: 26px; padding: 26px; overflow: hidden; margin-bottom: 18px; box-shadow: var(--kz-shadow);
}
.kz-hero::after { content: ''; position: absolute; inset: auto -10% -60px -10%; height: 120px; background: #8fd16a; border-radius: 50%; opacity: .55; z-index: 0; }
.kz-hero > * { position: relative; z-index: 1; }
.kz-hero-kid { font-size: 6.5rem; line-height: 1; text-align: center; filter: drop-shadow(0 6px 8px rgba(0,0,0,.12)); }
.kz-hero-title { font-size: clamp(2rem, 3.6vw, 3.2rem); font-weight: 800; color: var(--kz-navy); line-height: 1; margin: 0 0 10px; }
.kz-hero-title span { display: block; color: #d6286f; transform: rotate(-2deg); transform-origin: left; }
.kz-hero-copy p { font-size: 1.05rem; color: #24365e; max-width: 460px; margin-bottom: 14px; }
.kz-class-pick { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; font-weight: 700; }
.kz-class-pick .form-select { width: auto; border-radius: 999px; font-family: inherit; }

.kz-journey { background: linear-gradient(180deg, #2453c7, #173a8f); color: #fff; border-radius: 20px; padding: 14px; box-shadow: 0 8px 20px rgba(23,58,143,.3); }
.kz-journey-head > span { font-weight: 700; font-size: 1.05rem; }
.kz-journey-level { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; font-size: 1.1rem; margin: 6px 0 10px; }
.kz-crown { font-size: 1.6rem; }
.kz-xpbar { flex: 1; min-width: 80px; height: 12px; background: rgba(255,255,255,.25); border-radius: 999px; overflow: hidden; }
.kz-xpbar div { height: 100%; background: linear-gradient(90deg, #ffe066, #ffb300); border-radius: inherit; }
.kz-journey-level small { font-size: .8rem; opacity: .9; }
.kz-journey-stats { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; color: var(--kz-text); border-radius: 14px; padding: 8px 4px; text-align: center; }
.kz-journey-stats > div { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.kz-journey-stats > div + div { border-left: 1px solid #e3ebf7; }
.kz-js-ic { font-size: 1.6rem; }
.kz-journey-stats strong { font-size: 1.15rem; }
.kz-journey-stats small { font-size: .72rem; color: var(--kz-muted); }
.kz-journey-login { display: block; color: #ffe066; font-size: .85rem; margin-top: 8px; font-weight: 700; }

.kz-mascot { text-align: center; font-size: 4.6rem; line-height: 1; }
.kz-bubble { font-size: .85rem; font-weight: 800; background: #fff; color: var(--kz-text); border-radius: 18px; padding: 8px 10px; margin-bottom: 8px; position: relative; line-height: 1.2; }
.kz-bubble::after { content: ''; position: absolute; bottom: -8px; left: 50%; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; transform: translateX(-50%); }

.kz-goals { background: #fff; border-radius: 20px; padding: 14px; box-shadow: var(--kz-shadow); align-self: stretch; }
.kz-goals h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.kz-goal { display: flex; align-items: center; gap: 10px; background: #f6f9fe; border-radius: 12px; padding: 6px 10px; margin-bottom: 6px; }
.kz-goal div { flex: 1; line-height: 1.15; }
.kz-goal strong { display: block; font-size: .92rem; }
.kz-goal small { color: var(--kz-muted); font-size: .75rem; }
.kz-goal-box { width: 26px; height: 26px; border-radius: 7px; border: 2px solid #b8c4d9; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.kz-goal.is-done .kz-goal-box { background: #22c55e; border-color: #22c55e; }
.kz-goal-tick { color: #b8c4d9; font-size: 1.2rem; }
.kz-goal.is-done .kz-goal-tick { color: #22c55e; }
.kz-goal-lock { background: var(--kz-yellow); border-color: var(--kz-yellow-dark); color: #1e2a4a; }
.kz-goal-play.is-done .kz-goal-lock { background: #22c55e; border-color: #22c55e; color: #fff; }

/* ---------- Subjects ---------- */
.kz-subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 14px; margin-bottom: 18px; }
.kz-subject { background: linear-gradient(180deg, var(--kc-soft) 0%, #fff 100%); border-radius: 20px; padding: 0 0 12px; color: var(--kz-text); box-shadow: var(--kz-shadow); overflow: hidden; border: 2px solid transparent; transition: transform .15s ease, border-color .15s ease; display: flex; flex-direction: column; }
.kz-subject:hover { transform: translateY(-3px); border-color: var(--kc); color: var(--kz-text); }
.kz-subject-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px; background: linear-gradient(90deg, var(--kc), var(--kc2)); color: #fff; }
.kz-subject-head h3 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(1.1rem, 1.35vw, 1.45rem); font-weight: 800; margin: 0; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.12); }
.kz-subject-art { width: 46px; height: 46px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; background: rgba(255,255,255,.85); border-radius: 16px; color: var(--kc); }
.kz-subject-art i { font-size: 1.9rem; }
.kz-subject-go { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--kc); display: inline-flex; align-items: center; justify-content: center; }
.kz-subject ul { list-style: none; padding: 10px 14px 0; margin: 0; }
.kz-subject li { font-size: .92rem; padding: 1px 0 1px 16px; position: relative; }
.kz-subject li::before { content: ''; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--kc); }
.kz-subject-desc { font-size: .88rem; color: var(--kz-muted); padding: 10px 14px 0; margin: 0; }
.kz-subject-foot { margin-top: auto; padding: 8px 14px 0; font-size: .8rem; font-weight: 700; color: var(--kc); }

/* ---------- Panels ---------- */
.kz-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.kz-grid-3 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.kz-panel { background: var(--kz-card); border-radius: 22px; padding: 16px; box-shadow: var(--kz-shadow); margin-bottom: 16px; min-width: 0; }
.kz-grid-2 > .kz-panel, .kz-grid-3 > .kz-panel { margin-bottom: 0; }
.kz-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.kz-panel-head h2 { font-size: 1.3rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; }
.kz-panel-head a { font-weight: 700; color: #2f80ed; font-size: .9rem; white-space: nowrap; }
.kz-page-head { text-align: center; margin: 6px 0 18px; }
.kz-page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; color: var(--kz-navy); margin-bottom: 0; }
.kz-page-head p { color: var(--kz-muted); font-size: 1.05rem; margin: 0; }
.kz-narrow { max-width: 620px; margin: 0 auto; }
.kz-back { font-weight: 700; color: var(--kz-navy); font-size: .9rem; }

/* ---------- Activity cards ---------- */
.kz-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kz-acts-wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.kz-act { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--kz-card); color: var(--kz-text); border: 2px solid var(--kz-border); transition: transform .15s ease, border-color .15s ease; }
.kz-act:hover { transform: translateY(-3px); border-color: var(--kc); color: var(--kz-text); }
.kz-act-art { position: relative; height: 110px; display: flex; align-items: center; justify-content: center; font-size: 3.6rem; background: radial-gradient(circle at 30% 20%, var(--kc2), var(--kc)); color: #fff; }
.kz-act-art .kz-ic-img { padding: 8px; }
.kz-act-play, .kz-act-lock { position: absolute; right: 8px; bottom: 8px; width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--kc); display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; box-shadow: 0 3px 8px rgba(0,0,0,.18); }
.kz-act-lock { font-size: 1rem; color: #64748b; }
.kz-act-body { padding: 10px 12px 12px; }
.kz-act-title { font-weight: 800; font-size: 1.05rem; line-height: 1.15; }
.kz-act-sub { font-size: .82rem; color: var(--kz-muted); line-height: 1.2; margin-top: 2px; }
.kz-act-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.kz-act.is-locked, .kz-game.is-locked { filter: grayscale(.85); opacity: .65; pointer-events: none; }

/* ---------- Mission map ---------- */
.kz-map { background: linear-gradient(180deg, #c9ecff, #d9f5c9); border-radius: 18px; padding: 18px 10px 12px; overflow-x: auto; }
.kz-map-track { display: flex; align-items: flex-start; min-width: max-content; position: relative; }
.kz-map-track::before { content: ''; position: absolute; left: 40px; right: 40px; top: 24px; border-top: 4px dashed rgba(255,255,255,.95); }
.kz-map-stop { position: relative; width: 112px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.kz-map-stop:nth-child(even) { margin-top: 14px; }
.kz-map-dot { width: 50px; height: 50px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; background: #fff; border: 4px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.12); color: #64748b; }
.is-done .kz-map-dot { background: #22c55e; color: #fff; }
.is-current .kz-map-dot { background: var(--kz-yellow); color: #c2410c; animation: kz-pulse 1.6s infinite; }
.is-goal .kz-map-dot { background: #fff3c4; font-size: 1.6rem; }
a.kz-map-dot:hover { transform: scale(1.08); }
.kz-map-label { background: #fff; border-radius: 10px; padding: 4px 8px; margin-top: 6px; font-size: .78rem; line-height: 1.15; max-width: 104px; box-shadow: 0 2px 6px rgba(0,0,0,.06); color: var(--kz-text); }
.kz-map-label strong { display: block; font-size: .82rem; }
@keyframes kz-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,199,39,.7); } 50% { box-shadow: 0 0 0 10px rgba(255,199,39,0); } }

/* ---------- Games strip ---------- */
.kz-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.kz-game { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--kz-text); font-weight: 800; font-size: .88rem; text-align: center; }
.kz-game-art { width: 100%; aspect-ratio: 1; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 2.8rem; background: radial-gradient(circle at 30% 20%, var(--kc2), var(--kc)); color: #fff; transition: transform .15s ease; overflow: hidden; }
.kz-game:hover .kz-game-art { transform: scale(1.05) rotate(-2deg); }
.kz-lock-note { background: #fff7dc; border-radius: 12px; padding: 6px 12px; font-weight: 700; font-size: .88rem; margin-bottom: 10px; }
.kz-lock-banner { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: #fff7dc; border: 2px dashed var(--kz-yellow-dark); border-radius: 18px; padding: 14px 18px; margin-bottom: 16px; }
.kz-lock-banner > span { font-size: 2.4rem; }
.kz-lock-banner p { margin: 0; color: var(--kz-muted); }
.kz-lock-banner ul { list-style: none; margin: 0 0 0 auto; padding: 0; font-weight: 700; font-size: .9rem; }
.kz-lock-banner li.is-done { color: #15803d; }

/* ---------- Progress & leaderboard ---------- */
.kz-prog { display: grid; grid-template-columns: 30px 90px 1fr 44px; align-items: center; gap: 8px; margin-bottom: 10px; }
.kz-prog-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--kc); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; overflow: hidden; }
.kz-prog-name { font-weight: 700; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kz-prog-bar { display: block; height: 10px; background: #e8eef8; border-radius: 999px; overflow: hidden; width: 100%; }
.kz-prog-bar span { display: block; height: 100%; background: var(--kc, #2f80ed); border-radius: inherit; }
.kz-prog-num { font-weight: 700; font-size: .85rem; text-align: right; }

.kz-leaders { list-style: none; padding: 0; margin: 0; }
.kz-leaders li { display: grid; grid-template-columns: 34px 34px 1fr auto; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; }
.kz-leaders li + li { margin-top: 2px; }
.kz-leaders li.is-me { background: #e6f2ff; font-weight: 800; }
.kz-leaders li.kz-empty { display: block; }
.kz-rank { font-weight: 800; font-size: 1.1rem; text-align: center; }
.kz-lb-av { width: 32px; height: 32px; border-radius: 50%; background: #ffe7a8; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #b45309; }
.kz-lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kz-lb-xp { font-weight: 800; color: #2f80ed; white-space: nowrap; }

.kz-statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kz-statrow > div { background: var(--kz-card); border-radius: 18px; padding: 12px; text-align: center; box-shadow: var(--kz-shadow); display: flex; flex-direction: column; line-height: 1.15; }
.kz-statrow span { font-size: 2rem; }
.kz-statrow strong { font-size: 1.3rem; }
.kz-statrow small { color: var(--kz-muted); }
.kz-recent-row { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; color: var(--kz-text); }
.kz-recent-row:hover { background: var(--kz-bg); color: var(--kz-text); }
.kz-recent-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Badges ---------- */
.kz-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 14px; }
.kz-badge { background: var(--kz-card); border-radius: 20px; padding: 18px 14px; text-align: center; box-shadow: var(--kz-shadow); display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px solid var(--kc-soft); }
.kz-badge-ic { width: 76px; height: 76px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 2.6rem; background: radial-gradient(circle at 30% 20%, var(--kc2), var(--kc)); color: #fff; box-shadow: 0 6px 14px rgba(0,0,0,.12); }
.kz-badge strong { font-size: 1.1rem; }
.kz-badge small { color: var(--kz-muted); line-height: 1.2; }
.kz-badge.is-locked .kz-badge-ic { filter: grayscale(1); opacity: .45; }

/* ---------- Player ---------- */
.kz-player { max-width: 860px; margin: 0 auto; }
.kz-player-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--kz-card); border-radius: 22px; padding: 12px 16px; box-shadow: var(--kz-shadow); margin-bottom: 12px; }
.kz-player-title { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 200px; }
.kz-player-title h1 { font-size: 1.5rem; font-weight: 800; margin: 0; line-height: 1.1; }
.kz-player-title p { margin: 0; color: var(--kz-muted); }
.kz-player-title .kz-subject-art { background: var(--kc-soft); }
.kz-player-hud { display: flex; gap: 6px; }
.kz-player-hud .kz-chip { font-size: .95rem; padding: 4px 12px; }
.kz-chip-score { background: #fff3c4; color: #b45309; }
.kz-chip-timer.is-low { background: #ffeaea; color: #c62828; animation: kz-pulse 1s infinite; }
.kz-instructions, .kz-guest-note { background: var(--kz-card); border-radius: 14px; padding: 8px 14px; font-size: .95rem; margin-bottom: 12px; }
.kz-guest-note { background: #fff7dc; }

.kz-stage { min-height: 320px; }
.kz-q { background: var(--kz-card); border-radius: 24px; padding: clamp(16px, 4vw, 30px); box-shadow: var(--kz-shadow); text-align: center; border-top: 8px solid var(--kc); }
.kz-q-prompt { font-size: clamp(1.4rem, 3.4vw, 2rem); font-weight: 800; margin-bottom: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.kz-q-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kz-opt { display: flex; align-items: center; gap: 10px; text-align: left; font-family: inherit; font-size: 1.15rem; font-weight: 700; color: var(--kz-text); background: var(--kz-bg); border: 3px solid var(--kz-border); border-radius: 18px; padding: 12px 14px; cursor: pointer; transition: transform .1s ease, border-color .1s ease; overflow-wrap: anywhere; }
.kz-opt:hover:not(:disabled) { border-color: var(--kc); transform: translateY(-2px); }
.kz-opt:disabled { cursor: default; }
.kz-opt-key { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--kc); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.kz-opt.is-right { border-color: #22c55e; background: #e5f8ea; }
.kz-opt.is-right .kz-opt-key { background: #22c55e; }
.kz-opt.is-wrong { border-color: #ef4444; background: #ffeaea; animation: kz-shake .35s; }
.kz-opt.is-wrong .kz-opt-key { background: #ef4444; }
.kz-q-feedback { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 24px; }
.kz-q-feedback .kz-ok { color: #15803d; font-size: 1.2rem; }
.kz-q-feedback .kz-no { color: #c62828; font-size: 1.2rem; }
.kz-hint { margin: 0; color: var(--kz-muted); }
@keyframes kz-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.kz-math-prompt { font-size: clamp(2.4rem, 8vw, 4rem); color: var(--kc); }
.kz-math-form { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.kz-math-input { width: 180px; max-width: 100%; text-align: center; font-size: 2rem; font-weight: 800; font-family: inherit; border: 3px solid var(--kz-border); border-radius: 18px; padding: 6px 10px; color: var(--kz-text); background: var(--kz-bg); }
.kz-math-input:focus { outline: none; border-color: var(--kc); }

.kz-slots, .kz-tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.kz-slot, .kz-tile { width: 52px; height: 58px; border-radius: 14px; font-family: inherit; font-size: 1.7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.kz-slot { background: var(--kz-bg); border: 3px dashed #b8c4d9; color: var(--kz-text); }
.kz-tile { background: linear-gradient(180deg, var(--kc2), var(--kc)); color: #fff; border: 0; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.kz-tile:disabled { opacity: .25; cursor: default; box-shadow: none; }
.kz-slots.is-right .kz-slot { border: 3px solid #22c55e; background: #e5f8ea; }
.kz-slots.is-wrong .kz-slot { border: 3px solid #ef4444; background: #ffeaea; }
.kz-word-actions { display: flex; justify-content: center; gap: 10px; }

.kz-memory { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 10px; max-width: 640px; margin: 0 auto; }
.kz-card { position: relative; aspect-ratio: 4 / 3; border: 0; border-radius: 16px; padding: 0; cursor: pointer; perspective: 600px; background: transparent; font-family: inherit; }
.kz-card-back, .kz-card-face { position: absolute; inset: 0; border-radius: 16px; display: flex; align-items: center; justify-content: center; backface-visibility: hidden; transition: transform .35s ease; padding: 6px; overflow-wrap: anywhere; }
.kz-card-back { background: linear-gradient(135deg, var(--kc), var(--kc2)); font-size: 2rem; color: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.kz-card-face { background: var(--kz-card); border: 3px solid var(--kc); transform: rotateY(180deg); font-weight: 800; font-size: clamp(.9rem, 2.4vw, 1.3rem); color: var(--kz-text); }
.kz-card.is-open .kz-card-back, .kz-card.is-matched .kz-card-back { transform: rotateY(180deg); }
.kz-card.is-open .kz-card-face, .kz-card.is-matched .kz-card-face { transform: rotateY(360deg); }
.kz-card.is-matched .kz-card-face { border-color: #22c55e; background: #e5f8ea; }

.kz-stage-msg { background: var(--kz-card); border-radius: 24px; padding: 30px; text-align: center; box-shadow: var(--kz-shadow); }
.kz-stage-msg-ic { font-size: 3rem; }

.kz-result { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; z-index: 1080; padding: 16px; }
.kz-result[hidden] { display: none; }
.kz-result-card { background: var(--kz-card); border-radius: 28px; padding: 26px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: kz-pop .35s ease; }
.kz-result-burst { font-size: 3.4rem; line-height: 1; }
.kz-result-card h2 { font-weight: 800; font-size: 2rem; margin: 4px 0; color: var(--kz-navy); }
.kz-result-stars { font-size: 2.6rem; color: #cdd5e3; display: flex; justify-content: center; gap: 6px; }
.kz-result-stars .is-on { color: #f5b301; animation: kz-pop .4s ease both; }
.kz-result-score { font-size: 1.2rem; font-weight: 700; margin: 6px 0; }
.kz-result-gains, .kz-result-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.kz-result-gains .kz-chip { font-size: 1rem; padding: 4px 12px; }
.kz-result-badge { display: flex; align-items: center; gap: 8px; background: #f1e8ff; color: #6d28d9; border-radius: 14px; padding: 6px 12px; }
.kz-result-badge span { font-size: 1.6rem; }
.kz-result-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
@keyframes kz-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

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

/* Mission path: when its box is too narrow for every stop in a row, the levels run top to bottom instead */
.kz-map { container-type: inline-size; }
@container (max-width: 640px) {
    .kz-map-track { flex-direction: column; min-width: 0; gap: 6px; padding: 0 4px; }
    .kz-map-track::before { left: 27px; right: auto; top: 26px; bottom: 26px; border-top: 0; border-left: 4px dashed rgba(255,255,255,.95); }
    .kz-map-stop { width: auto; flex-direction: row; gap: 12px; text-align: left; }
    .kz-map-stop:nth-child(even) { margin-top: 0; margin-left: 0; }
    .kz-map-dot { flex-shrink: 0; }
    .kz-map-label { margin-top: 0; max-width: none; flex: 1; }
    .kz-map-label strong { display: inline; margin-right: 6px; }
}
.kzs-land .kz-map-track::before { border-left-color: #f7d774; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .kz-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .kz-hero-kid, .kz-mascot { display: none; }
    /* Today's Goal takes the full width under the hero instead of leaving the right half empty */
    .kz-goals { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; align-content: start; }
    .kz-goals > h2, .kz-goals > p { grid-column: 1 / -1; }
    .kz-grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .kz-grid-3 > .kz-panel:first-child { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
    .kz { padding: 0 16px 32px; }
    .kz-hero, .kz-grid-2, .kz-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .kz-hero { padding: 18px; }
    .kz-bar { border-radius: 0 0 18px 18px; }
    /* All tabs visible on phones: a 4-across grid instead of a row that hides the rest off-screen */
    .kz-tabs { order: 3; width: 100%; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; overflow: visible; }
    .kz-tab { padding: 6px 2px; font-size: .74rem; white-space: normal; text-align: center; line-height: 1.1; }
    .kz-tab i { font-size: 1.2rem; }
    .kz-goals { display: block; }
    .kz-badges { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 10px; }
    .kz-me { margin-left: auto; }
    .kz-q-options { grid-template-columns: minmax(0, 1fr); }
    .kz-recent-row { grid-template-columns: 1fr auto auto; }
    .kz-recent-row > :nth-child(4), .kz-recent-row > :nth-child(5) { display: none; }
    .kz-lock-banner ul { margin: 0; }
    .kz-slot, .kz-tile { width: 42px; height: 48px; font-size: 1.4rem; }
}

/* ---------- Dark theme ---------- */
[data-bs-theme="dark"] .kz, html.dark-theme .kz {
    --kz-bg: #0f1626;
    --kz-card: #18223a;
    --kz-border: #2a3a5c;
    --kz-text: #eef3ff;
    --kz-muted: #9fb0d0;
    --kz-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    --kz-navy: #9cc0ff;
}
[data-bs-theme="dark"] .kz-hero, html.dark-theme .kz-hero { background: linear-gradient(180deg, #1c3f78 0%, #1e4b6e 55%, #24533b 100%); }
[data-bs-theme="dark"] .kz-hero-copy p, html.dark-theme .kz-hero-copy p { color: #dbe7ff; }
[data-bs-theme="dark"] .kz-hero-title span, html.dark-theme .kz-hero-title span { color: #ff7eb3; }
[data-bs-theme="dark"] .kz-goals, html.dark-theme .kz-goals,
[data-bs-theme="dark"] .kz-journey-stats, html.dark-theme .kz-journey-stats,
[data-bs-theme="dark"] .kz-bubble, html.dark-theme .kz-bubble,
[data-bs-theme="dark"] .kz-map-label, html.dark-theme .kz-map-label { background: var(--kz-card); color: var(--kz-text); }
[data-bs-theme="dark"] .kz-bubble::after, html.dark-theme .kz-bubble::after { border-top-color: var(--kz-card); }
[data-bs-theme="dark"] .kz-goal, html.dark-theme .kz-goal { background: #22304f; }
[data-bs-theme="dark"] .kz-journey-stats > div + div, html.dark-theme .kz-journey-stats > div + div { border-color: var(--kz-border); }
[data-bs-theme="dark"] .kz-subject, html.dark-theme .kz-subject { background: var(--kz-card); }
[data-bs-theme="dark"] .kz-map, html.dark-theme .kz-map { background: linear-gradient(180deg, #1c3a5e, #20402f); }
[data-bs-theme="dark"] .kz-tab.is-active, html.dark-theme .kz-tab.is-active { background: #3a3215; }
[data-bs-theme="dark"] .kz-leaders li.is-me, html.dark-theme .kz-leaders li.is-me { background: #1f3560; }
[data-bs-theme="dark"] .kz-prog-bar, html.dark-theme .kz-prog-bar { background: #2a3a5c; }
[data-bs-theme="dark"] .kz-lock-note, html.dark-theme .kz-lock-note,
[data-bs-theme="dark"] .kz-lock-banner, html.dark-theme .kz-lock-banner,
[data-bs-theme="dark"] .kz-guest-note, html.dark-theme .kz-guest-note,
[data-bs-theme="dark"] .kz-admin-note, html.dark-theme .kz-admin-note { background: #3a3215; color: #fde9a8; }
[data-bs-theme="dark"] .kz-opt.is-right, html.dark-theme .kz-opt.is-right,
[data-bs-theme="dark"] .kz-card.is-matched .kz-card-face, html.dark-theme .kz-card.is-matched .kz-card-face,
[data-bs-theme="dark"] .kz-slots.is-right .kz-slot, html.dark-theme .kz-slots.is-right .kz-slot { background: #173d28; }
[data-bs-theme="dark"] .kz-opt.is-wrong, html.dark-theme .kz-opt.is-wrong,
[data-bs-theme="dark"] .kz-slots.is-wrong .kz-slot, html.dark-theme .kz-slots.is-wrong .kz-slot { background: #4a1d1d; }

/* ==========================================================================
   Subject page (kids/subject.html)
   ========================================================================== */
.kzs-crumbs { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--kz-muted); margin: 2px 0 6px; flex-wrap: wrap; }
.kzs-crumbs a { color: var(--kz-muted); font-weight: 600; }
.kzs-crumbs a:hover { color: var(--kc); }
.kzs-crumbs span { color: var(--kc); font-weight: 700; }
.kzs-crumbs i { font-size: .7rem; }

.kzs-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.kzs-head-art { width: 64px; height: 64px; flex-shrink: 0; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 2.6rem; background: var(--kz-card); box-shadow: var(--kz-shadow); color: var(--kc); overflow: hidden; }
.kzs-head-text { flex: 1; min-width: 0; }
.kzs-head h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; color: var(--kz-navy); margin: 0; line-height: 1; }
.kzs-head p { margin: 4px 0 0; color: var(--kz-muted); font-size: 1.02rem; }
.kzs-class .form-select { border-radius: 14px; font-family: inherit; font-weight: 700; border: 2px solid var(--kz-border); background-color: var(--kz-card); color: var(--kz-text); min-width: 130px; box-shadow: var(--kz-shadow); }

/* Banner */
.kzs-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; gap: 16px;
    min-height: 230px; border-radius: 26px; overflow: hidden; padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--kz-shadow);
    background: linear-gradient(180deg, #7cc8ff 0%, #b9e6ff 45%, #d8f3c4 70%, #9bd77a 100%); }
.kzs-hero > * { position: relative; z-index: 1; }
.kzs-hero > .kzs-hero-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.kzs-hill { position: absolute; left: -10%; right: 30%; bottom: -70px; height: 150px; background: #86cf62; border-radius: 50%; }
.kzs-hill.h2 { left: 35%; right: -15%; bottom: -80px; background: #6fbf4f; }
.kzs-float { position: absolute; font-size: 2.6rem; line-height: 1; animation: kzs-bob 4s ease-in-out infinite; filter: drop-shadow(0 4px 4px rgba(0,0,0,.12)); }
.kzs-float .kz-ic-img { width: 54px; height: 54px; }
.kzs-float.f1 { left: 24%; top: 12%; font-size: 3.2rem; color: var(--kc); }
.kzs-float.f2 { left: 6%; bottom: 14%; animation-delay: -1s; }
.kzs-float.f3 { right: 30%; top: 10%; font-size: 1.8rem; animation-delay: -2s; }
.kzs-float.f4 { right: 4%; top: 12%; font-size: 2rem; animation-delay: -3s; }
@keyframes kzs-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }

.kzs-mascot { font-size: 7rem; line-height: 1; text-align: center; filter: drop-shadow(0 8px 10px rgba(0,0,0,.18)); position: relative; }
.kzs-bulb { position: absolute; font-size: 2.4rem; left: 12%; top: -6px; animation: kzs-bob 3s ease-in-out infinite; }

.kzs-hero-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.kzs-hero-card h2 { margin: 0; background: #fff; color: var(--kz-navy); font-weight: 800; font-size: clamp(1.25rem, 2.4vw, 1.8rem); border-radius: 16px; padding: 4px 18px; box-shadow: 0 4px 0 rgba(23,58,143,.12); }
.kzs-hero-level { margin: 0; font-weight: 800; font-size: 1.15rem; color: #12306f; }
.kzs-hero-level span { color: var(--kc); margin: 0 4px; }
.kzs-xp { display: flex; align-items: center; gap: 10px; width: min(100%, 380px); }
.kzs-xp-bar { flex: 1; height: 14px; background: rgba(255,255,255,.75); border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.1); }
.kzs-xp-bar span { display: block; height: 100%; background: linear-gradient(90deg, #ffe066, #ffb300); border-radius: inherit; }
.kzs-xp small { font-weight: 800; color: #12306f; white-space: nowrap; }
.kzs-go { display: inline-flex; align-items: center; gap: 10px; background: linear-gradient(180deg, #3b8bff, #1f5fe0); color: #fff !important; font-weight: 800; font-size: 1.15rem;
    border-radius: 999px; padding: 11px 28px; box-shadow: 0 5px 0 #143f9e; transition: transform .1s ease, box-shadow .1s ease; }
.kzs-go:hover { transform: translateY(-1px); }
.kzs-go:active { transform: translateY(4px); box-shadow: 0 1px 0 #143f9e; }
.kzs-go i.bi-play-fill { background: #fff; color: #1f5fe0; border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.kzs-hero-login { font-weight: 700; font-size: .85rem; color: #12306f; }

.kzs-scene { display: flex; align-items: flex-end; justify-content: flex-end; gap: 8px; height: 100%; }
.kzs-castle { font-size: 4.5rem; line-height: 1; filter: drop-shadow(0 6px 6px rgba(0,0,0,.15)); }
.kzs-sign { position: relative; max-width: 170px; padding: 12px 14px; text-align: center; font-weight: 800; font-size: 1.05rem; line-height: 1.15; text-transform: uppercase;
    color: #fff8e6; background: repeating-linear-gradient(0deg, #b7712f 0 14px, #a8642a 14px 16px); border: 4px solid #7a4518; border-radius: 10px;
    box-shadow: 0 6px 0 rgba(0,0,0,.18); transform: rotate(3deg); text-shadow: 0 2px 0 rgba(0,0,0,.25); margin-bottom: 18px; overflow-wrap: anywhere; }
.kzs-sign::after { content: ''; position: absolute; left: 50%; bottom: -34px; width: 12px; height: 30px; margin-left: -6px; background: #7a4518; border-radius: 0 0 4px 4px; z-index: -1; }

/* Learn / Practise / Games / Missions */
.kzs-modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kzs-mode { display: flex; align-items: center; gap: 12px; background: var(--kz-card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--kz-shadow);
    color: var(--kz-text); border: 2px solid transparent; transition: transform .15s ease, border-color .15s ease; }
.kzs-mode:hover, .kzs-mode.is-active { transform: translateY(-2px); border-color: var(--kc); color: var(--kz-text); }
.kzs-mode-ic { width: 52px; height: 52px; flex-shrink: 0; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; color: #fff;
    background: linear-gradient(135deg, var(--kc2), var(--kc)); box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.kzs-mode-text { flex: 1; min-width: 0; line-height: 1.2; }
.kzs-mode-text strong { display: block; font-size: 1.1rem; font-weight: 800; color: var(--kz-navy); }
.kzs-mode-text small { color: var(--kz-muted); font-size: .82rem; }
.kzs-mode-go, .kzs-topic-go { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--kz-border); display: inline-flex; align-items: center; justify-content: center; color: var(--kz-navy); font-size: .85rem; background: var(--kz-card); }

/* Topics + goals grid */
.kzs-grid { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.kzs-main .kz-panel:last-child { margin-bottom: 0; }
.kzs-h-ic { color: var(--kc); }
.kz-panel-head h2 small { font-size: .78rem; font-weight: 600; color: var(--kz-muted); margin-left: 6px; }
.kzs-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.kzs-topic { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; color: var(--kz-text);
    background: linear-gradient(135deg, var(--kc-soft), var(--kz-card)); border: 2px solid var(--kc-soft); transition: transform .15s ease, border-color .15s ease; }
.kzs-topic:hover, .kzs-topic.is-active { transform: translateY(-2px); border-color: var(--kc); color: var(--kz-text); }
.kzs-topic-ic { width: 54px; height: 54px; flex-shrink: 0; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; color: #fff;
    background: linear-gradient(135deg, var(--kc2), var(--kc)); box-shadow: 0 4px 0 rgba(0,0,0,.12); overflow: hidden; }
.kzs-topic-body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.kzs-topic-body strong { font-size: 1rem; font-weight: 800; }
.kzs-topic-body small { color: var(--kz-muted); font-size: .8rem; }
.kzs-topic-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.kzs-topic-foot .kz-prog-bar { flex: 1; height: 8px; background: rgba(255,255,255,.8); }
.kzs-topic-foot em { font-style: normal; font-size: .75rem; font-weight: 800; color: var(--kz-navy); white-space: nowrap; }

.kzs-goals { position: sticky; top: 90px; }
.kzs-date { font-size: .8rem; font-weight: 700; color: var(--kz-muted); border: 2px solid var(--kz-border); border-radius: 10px; padding: 2px 8px; white-space: nowrap; }
.kzs-goal { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px dashed var(--kz-border); font-weight: 700; }
.kzs-goal i { font-size: 1.35rem; color: #b8c4d9; }
.kzs-goal.is-done i { color: #22c55e; }
.kzs-goal b { color: var(--kz-muted); font-size: .9rem; }
.kzs-goal.is-done b { color: #15803d; }
.kzs-goal-total { margin-top: 12px; text-align: right; }
.kzs-goal-total .kz-prog-bar { height: 12px; }
.kzs-goal-total .kz-prog-bar span { background: linear-gradient(90deg, #2f80ed, #56ccf2); }
.kzs-goal-total small { color: var(--kz-muted); font-weight: 700; }
.kzs-cheer { display: flex; align-items: flex-end; gap: 6px; margin-top: 14px; background: linear-gradient(180deg, #fff7dc, #ffeec2); border-radius: 18px; padding: 10px 12px 0; overflow: hidden; }
.kzs-cheer-kid { font-size: 4.6rem; line-height: 1; transform: translateY(6px); }
.kzs-cheer-bubble { flex: 1; margin: 0 0 14px; background: #fff; color: #1e2a4a; border-radius: 16px; padding: 10px 12px; font-weight: 700; font-size: .92rem; line-height: 1.25; position: relative; box-shadow: 0 3px 8px rgba(0,0,0,.06); }
.kzs-cheer-bubble::before { content: ''; position: absolute; left: -8px; bottom: 14px; border: 8px solid transparent; border-right-color: #fff; border-left: 0; }

/* Learning path landscape */
.kzs-land { border-radius: 18px; overflow: hidden; position: relative; background: linear-gradient(180deg, #bfe8ff 0%, #e2f6ff 38%, #c7ecaa 39%, #9fd67f 100%); }
.kzs-land .kz-map { background: transparent; position: relative; padding-top: 22px; }
.kzs-land .kz-map-track::before { border-top-color: #f7d774; }

/* Activity filter chips */
.kzs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.kzs-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem;
    background: var(--kz-bg); color: var(--kz-text); border: 2px solid var(--kz-border); }
.kzs-chips a span { background: var(--kz-card); border-radius: 999px; padding: 0 7px; font-size: .75rem; }
.kzs-chips a.is-active, .kzs-chips a:hover { border-color: var(--kc); color: var(--kc); }

@media (max-width: 1199.98px) {
    .kzs-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
    .kzs-scene { display: none; }
    .kzs-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kzs-grid { grid-template-columns: minmax(0, 1fr); }
    .kzs-goals { position: static; }
}
@media (max-width: 767.98px) {
    .kzs-head { flex-wrap: wrap; }
    .kzs-head-art { width: 52px; height: 52px; font-size: 2rem; }
    .kzs-class { width: 100%; }
    .kzs-hero { grid-template-columns: minmax(0, 1fr); padding: 18px 14px 26px; }
    .kzs-mascot { font-size: 4.5rem; }
    .kzs-bulb { font-size: 1.6rem; left: 30%; }
    .kzs-float.f1 { left: 4%; top: 4%; font-size: 2.2rem; }
    .kzs-float.f2, .kzs-float.f3, .kzs-float.f4 { display: none; }
    .kz-panel-head h2 { flex-wrap: wrap; }
    .kz-panel-head h2 small { flex-basis: 100%; margin-left: 0; }
    .kzs-modes { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .kzs-go { font-size: 1.05rem; padding: 10px 20px; }
}

[data-bs-theme="dark"] .kzs-hero, html.dark-theme .kzs-hero { background: linear-gradient(180deg, #1c3f78 0%, #24557d 45%, #2c5a3a 70%, #24502f 100%); }
[data-bs-theme="dark"] .kzs-hill, html.dark-theme .kzs-hill { background: #2f6b2c; }
[data-bs-theme="dark"] .kzs-hill.h2, html.dark-theme .kzs-hill.h2 { background: #285c25; }
[data-bs-theme="dark"] .kzs-hero-level, html.dark-theme .kzs-hero-level,
[data-bs-theme="dark"] .kzs-xp small, html.dark-theme .kzs-xp small,
[data-bs-theme="dark"] .kzs-hero-login, html.dark-theme .kzs-hero-login { color: #eaf2ff; }
[data-bs-theme="dark"] .kzs-hero-card h2, html.dark-theme .kzs-hero-card h2 { background: var(--kz-card); }
[data-bs-theme="dark"] .kzs-topic-foot .kz-prog-bar, html.dark-theme .kzs-topic-foot .kz-prog-bar { background: #2a3a5c; }
[data-bs-theme="dark"] .kzs-cheer, html.dark-theme .kzs-cheer { background: linear-gradient(180deg, #3a3215, #2e2810); }
[data-bs-theme="dark"] .kzs-land, html.dark-theme .kzs-land { background: linear-gradient(180deg, #1c3a5e 0%, #20456a 38%, #2a5a30 39%, #224a28 100%); }

/* Lesson player */
.kz-video { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; margin-bottom: 12px; box-shadow: var(--kz-shadow); background: #000; }
.kz-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.kz-lesson { text-align: left; }
.kz-lesson-step { display: inline-block; background: var(--kc-soft); color: var(--kc); font-weight: 800; border-radius: 999px; padding: 2px 12px; font-size: .85rem; }
.kz-lesson-title { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; margin: 8px 0; color: var(--kz-navy); }
.kz-lesson-body { font-size: 1.15rem; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.kz-lesson-example { background: #fff7dc; border-left: 6px solid var(--kz-yellow-dark); border-radius: 14px; padding: 10px 14px; margin: 12px 0; color: #1e2a4a; }
.kz-lesson-example p { margin: 4px 0 0; font-size: 1.1rem; white-space: pre-line; overflow-wrap: anywhere; }
.kz-lesson-dots { display: flex; justify-content: center; gap: 6px; margin: 14px 0; }
.kz-lesson-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--kz-border); }
.kz-lesson-dots span.is-done { background: var(--kc2); }
.kz-lesson-dots span.is-on { background: var(--kc); width: 26px; border-radius: 999px; }
.kz-lesson .kz-hint { text-align: center; margin-top: 10px; }
[data-bs-theme="dark"] .kz-lesson-example, html.dark-theme .kz-lesson-example { background: #3a3215; color: #fde9a8; }

/* ==========================================================================
   Player page (kids/play.html): sidebar, question strip, board scene, Quick Tips
   ========================================================================== */
.kzp { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; max-width: 1280px; margin: 0 auto; align-items: start; }
.kzp-solo { grid-template-columns: minmax(0, 1fr); max-width: 1000px; }
.kzp .kz-player { max-width: none; margin: 0; min-width: 0; }

/* Sidebar */
.kzp-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 90px; }
.kzp-box { background: var(--kz-card); border-radius: 20px; padding: 10px; box-shadow: var(--kz-shadow); }
.kzp-box-head { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--kz-navy); padding: 4px 6px 10px; }
a.kzp-box-head:hover { color: var(--kc); }
.kzp-box-ic { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; background: var(--kc-soft, #eef3fb); color: var(--kc); overflow: hidden; flex-shrink: 0; }
.kzp-list { list-style: none; margin: 0; padding: 0; }
.kzp-list li + li { border-top: 1px solid var(--kz-border); }
.kzp-list a { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 12px; color: var(--kz-text); font-weight: 600; font-size: .95rem; }
.kzp-list a:hover { background: var(--kz-bg); color: var(--kz-text); }
.kzp-list a > .bi { color: var(--kz-muted); font-size: .85rem; }
.kzp-list-title { flex: 1; min-width: 0; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.kzp-num { width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--kc2), var(--kc)); }
.kzp-list a.is-active { background: linear-gradient(90deg, #2f80ed, #4c9bff); color: #fff; box-shadow: 0 4px 10px rgba(47,128,237,.3); }
.kzp-list a.is-active > .bi { color: #fff; }
.kzp-list a.is-active .kzp-num { background: rgba(255,255,255,.25); }
.kzp-list a.is-locked { opacity: .55; pointer-events: none; }
.kzp-box-games .kzp-box-head { background: linear-gradient(90deg, #8b45e8, #b07bff); color: #fff; border-radius: 14px; padding: 8px 10px; margin-bottom: 6px; font-size: 1.1rem; }
.kzp-box-games .kzp-box-ic { background: rgba(255,255,255,.25); color: #fff; width: 32px; height: 32px; font-size: 1.1rem; }
.kzp-game-ic { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; background: var(--kc-soft); overflow: hidden; }

/* Question strip */
.kzp-steps { list-style: none; display: flex; gap: 8px; padding: 10px 14px; margin: 0 0 12px; background: var(--kz-card); border-radius: 18px; box-shadow: var(--kz-shadow); overflow-x: auto; scrollbar-width: thin; }
.kzp-steps[hidden] { display: none; }
.kzp-steps li { flex: 1 0 40px; max-width: 54px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--kz-navy); background: #e6effc; border: 3px solid transparent; transition: all .2s ease; }
.kzp-steps li.is-current { background: #1f6fe0; color: #fff; box-shadow: 0 0 0 4px rgba(31,111,224,.2); }
.kzp-steps li.is-right { background: #22c55e; color: #fff; }
.kzp-steps li.is-wrong { background: #fde2e2; color: #c62828; border-color: #f5a3a3; }

.kzp .kz-instructions { background: #e6f2ff; font-weight: 600; }

/* Scene: sky, trees and grass behind a framed board */
.kzp-scene { position: relative; display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) minmax(0, 150px); align-items: end; gap: 10px;
    padding: 26px 16px 18px; border-radius: 24px; overflow: hidden; margin-bottom: 14px; box-shadow: var(--kz-shadow);
    background: radial-gradient(ellipse at 12% 100%, #5fb446 0 18%, transparent 19%), radial-gradient(ellipse at 90% 100%, #5fb446 0 16%, transparent 17%),
                linear-gradient(180deg, #8fd4ff 0%, #c4ecff 38%, #7cc85e 38.5%, #63b548 70%, #4f9f39 100%); }
.kzp-scene::before, .kzp-scene::after { position: absolute; top: 20%; font-size: 3.4rem; white-space: pre; pointer-events: none; line-height: 1; }
.kzp-scene::before { content: '🌳🌲'; left: 1%; }
.kzp-scene::after { content: '🌲🌳'; right: 1%; }
.kzp-scene > * { position: relative; }

.kzp-kid { text-align: center; line-height: 1; padding-bottom: 6px; }
.kzp-kid-face { display: block; font-size: 5.6rem; filter: drop-shadow(0 6px 6px rgba(0,0,0,.2)); }
.kzp-book { display: block; font-size: 2.2rem; margin-top: -10px; }
.kzp-bulb { display: block; font-size: 2.2rem; margin-bottom: 4px; animation: kzs-bob 3s ease-in-out infinite; }

.kzp-board-wrap { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.kzp-sign { position: relative; z-index: 2; margin-bottom: -10px; padding: 6px 26px; font-weight: 800; font-size: 1.3rem; color: #fff8e6; text-shadow: 0 2px 0 rgba(0,0,0,.3);
    background: repeating-linear-gradient(0deg, #b7712f 0 12px, #a8642a 12px 14px); border: 4px solid #7a4518; border-radius: 12px; box-shadow: 0 5px 0 rgba(0,0,0,.2); }
.kzp-sign::before, .kzp-sign::after { content: ''; position: absolute; top: -26px; width: 4px; height: 24px; background: #7a4518; }
.kzp-sign::before { left: 22%; } .kzp-sign::after { right: 22%; }
.kzp-board { width: 100%; padding: 14px; border-radius: 22px; background: linear-gradient(135deg, #c98a4b, #a5652c); box-shadow: 0 8px 0 #7a4518, 0 14px 24px rgba(0,0,0,.25); }
.kzp-board .kz-stage { min-height: 230px; background: #fff; border-radius: 14px; padding: 28px 18px 18px; box-shadow: inset 0 2px 6px rgba(0,0,0,.12); }
.kzp-board .kz-q, .kzp-board .kz-stage-msg { background: transparent; box-shadow: none; border-top: 0; padding: 0; }

.kzp-eq { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: .3em; font-size: clamp(2.6rem, 7vw, 4.4rem); font-weight: 800; line-height: 1.1; }
.kzp-eq-num { color: #1f6fe0; }
.kzp-eq-op { color: #1e2a4a; }
.kzp-eq-q { color: #eb3f86; }

/* Maths Race sums written in place-value columns (H T O); ÷ as a "bus stop" */
.kz-math-prompt.has-columns { font-size: 1rem; }
.kzc { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; overflow-x: auto; margin-bottom: 14px; }
.kzc-title .kzp-eq { font-size: clamp(1.5rem, 4vw, 2.2rem); }
.kzc-grid { --cell: clamp(40px, 10vw, 58px); display: grid; grid-template-columns: auto repeat(var(--cols), var(--cell)); gap: 8px; align-items: center; justify-items: center; }
.kzc-head { font-weight: 800; font-size: 1rem; color: #64748b; }
.kzc-cell { width: var(--cell); height: var(--cell); display: flex; align-items: center; justify-content: center; border-radius: 12px; font-size: calc(var(--cell) * .52); font-weight: 800; line-height: 1;
    background: #eef4ff; color: #1f6fe0; border: 2px solid #cfe0ff; }
.kzc-cell.is-blank { background: transparent; border-color: transparent; }
.kzc-sign { justify-self: end; padding-right: 6px; font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 800; color: #1e2a4a; }
.kzc-rule { grid-column: 1 / -1; justify-self: stretch; height: 4px; border-radius: 2px; background: #1e2a4a; }
.kzc-div .kzc-rule { grid-column: 2 / -1; margin-bottom: -8px; }
.kzc-divisor { display: inline-flex; align-items: center; gap: 4px; color: #1f6fe0; }
.kzc-bracket { color: #1e2a4a; font-size: 1.4em; font-weight: 400; transform: scaleY(1.3); margin-top: -10px; }
.kzc-ans { background: #fff; color: #eb3f86; border: 3px dashed #9cc3ff; }
.kzc-ans.is-filled { border-style: solid; }
.kzc-grid.is-right .kzc-ans { background: #dcfce7; border: 3px solid #22c55e; color: #15803d; }
.kzc-grid.is-wrong .kzc-ans { background: #fef3c7; border: 3px solid #f59e0b; color: #b45309; }
.kzc-legend { font-size: .9rem; font-weight: 600; color: #64748b; text-align: center; }
.kzp .kz-math-input { width: 230px; font-size: 1.4rem; border: 3px solid #9cc3ff; background: #fff; }
.kzp .kz-math-input::placeholder { color: #9aa7bf; font-weight: 600; }
.kzp .kz-math-form .kz-btn { font-size: 1.35rem; padding: 10px 34px; }

.kzp-owl { text-align: center; line-height: 1; padding-bottom: 4px; }
.kzp-owl-face { display: block; font-size: 4.6rem; filter: drop-shadow(0 6px 6px rgba(0,0,0,.2)); margin-bottom: -8px; position: relative; z-index: 1; }
.kzp-chalk { position: relative; background: #24443a; color: #f4f7f2; font-weight: 700; font-size: 1.05rem; line-height: 1.2; padding: 12px 10px; border: 6px solid #a8642a; border-radius: 10px;
    box-shadow: 0 5px 0 rgba(0,0,0,.2); transform: rotate(-3deg); font-family: 'Baloo 2', 'Comic Sans MS', cursive; overflow-wrap: anywhere; }

@media (max-width: 1199.98px) {
    .kzp-scene { grid-template-columns: minmax(0, 1fr) minmax(0, 130px); }
    .kzp-kid { display: none; }
}
@media (max-width: 991.98px) {
    .kzp { grid-template-columns: minmax(0, 1fr); }
    .kzp-side { order: 2; position: static; }
}
@media (max-width: 767.98px) {
    .kzp-scene { grid-template-columns: minmax(0, 1fr); padding: 26px 8px 12px; }
    .kzp-scene::before, .kzp-scene::after { font-size: 2rem; top: 4px; }
    .kzp-owl { display: flex; align-items: center; justify-content: center; gap: 8px; order: -1; }
    .kzp-owl-face { font-size: 2.6rem; margin: 0; }
    .kzp-chalk { font-size: .9rem; padding: 6px 10px; border-width: 4px; }
    .kzp-board { padding: 8px; }
    .kzp-board .kz-stage { padding: 22px 10px 12px; min-height: 200px; }
    /* Phones: keep the header, levels and notes compact so the board is near the top */
    .kz-player-head { padding: 10px 12px; gap: 8px 10px; }
    .kz-player-title { gap: 8px; }
    .kz-player-title h1 { font-size: 1.25rem; }
    .kz-player-title p { font-size: .85rem; line-height: 1.2; }
    .kzp .kzp-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 8px; }
    .kzp .kzp-levels-label { grid-column: 1 / -1; font-size: .9rem; }
    .kzp .kzp-level { justify-content: center; padding: 5px 6px; font-size: .88rem; gap: 4px; }
    .kzp-steps { flex-wrap: wrap; justify-content: center; gap: 5px; padding: 8px; overflow: visible; }
    .kzp-steps li { flex: 0 0 26px; height: 26px; font-size: .78rem; border-width: 2px; }
    .kz-instructions, .kz-guest-note { font-size: .85rem; padding: 6px 12px; margin-bottom: 10px; }
    .kzp .kz-math-input { width: 100%; }
}

[data-bs-theme="dark"] .kzp-scene, html.dark-theme .kzp-scene { background: linear-gradient(180deg, #1c3f78 0%, #24557d 38%, #2c5a3a 38.5%, #24502f 100%); }
[data-bs-theme="dark"] .kzp-board .kz-stage, html.dark-theme .kzp-board .kz-stage { background: var(--kz-card); }
[data-bs-theme="dark"] .kzp-eq-op, html.dark-theme .kzp-eq-op { color: var(--kz-text); }
[data-bs-theme="dark"] .kzc-cell, html.dark-theme .kzc-cell { background: #22304f; border-color: #33466e; color: #8fb8ff; }
[data-bs-theme="dark"] .kzc-cell.is-blank, html.dark-theme .kzc-cell.is-blank { background: transparent; border-color: transparent; }
[data-bs-theme="dark"] .kzc-ans, html.dark-theme .kzc-ans { background: var(--kz-bg); border-color: #4d6aa0; color: #ff7eb6; }
[data-bs-theme="dark"] .kzc-sign, html.dark-theme .kzc-sign,
[data-bs-theme="dark"] .kzc-bracket, html.dark-theme .kzc-bracket { color: var(--kz-text); }
[data-bs-theme="dark"] .kzc-divisor, html.dark-theme .kzc-divisor { color: #8fb8ff; }
[data-bs-theme="dark"] .kzc-rule, html.dark-theme .kzc-rule { background: var(--kz-text); }
[data-bs-theme="dark"] .kzc-head, html.dark-theme .kzc-head,
[data-bs-theme="dark"] .kzc-legend, html.dark-theme .kzc-legend { color: var(--kz-muted); }
[data-bs-theme="dark"] .kzp-steps li, html.dark-theme .kzp-steps li { background: #22304f; color: var(--kz-text); }
[data-bs-theme="dark"] .kzp .kz-instructions, html.dark-theme .kzp .kz-instructions { background: #1f3560; }
[data-bs-theme="dark"] .kzp .kz-math-input, html.dark-theme .kzp .kz-math-input { background: var(--kz-bg); }

/* Level picker (Easy / Medium / Hard) */
.kzp-levels { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; background: var(--kz-card); border-radius: 18px; padding: 8px 12px; margin-bottom: 12px; box-shadow: var(--kz-shadow); }
.kzp-levels-label { font-weight: 800; color: var(--kz-navy); margin-right: 4px; }
.kzp-level { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 999px; font-weight: 800; font-size: 1rem; color: var(--kz-text); border: 3px solid var(--kz-border); background: var(--kz-bg); transition: transform .1s ease; }
.kzp-level small { font-size: .72rem; font-weight: 800; background: var(--kz-card); border-radius: 999px; padding: 0 7px; color: var(--kz-muted); }
a.kzp-level:hover { transform: translateY(-1px); color: var(--kz-text); }
.kzp-level-easy.is-active { background: #22c55e; border-color: #16a34a; color: #fff; }
.kzp-level-medium.is-active { background: #f59e0b; border-color: #d97706; color: #fff; }
.kzp-level-hard.is-active { background: #ef4444; border-color: #dc2626; color: #fff; }
.kzp-level.is-active small { background: rgba(255,255,255,.3); color: #fff; }
.kzp-level.is-off { opacity: .45; cursor: not-allowed; }

/* ==========================================================================
   Picture banners (Admin → Kids Zone → Page banners) — Kids home, Stories, Do You Know?
   ========================================================================== */
.kz-banner { border-radius: 26px; overflow: hidden; margin-bottom: 18px; box-shadow: var(--kz-shadow); line-height: 0; background: #1c2f7c; }
.kz-banner img { display: block; width: 100%; height: auto; }
.kzd-main .kz-banner { margin-bottom: 14px; }
@media (max-width: 767.98px) {
    /* Phones: very wide pictures get at least a 3:1 height (cropped from the left, so the words stay readable);
       pictures that are already taller than that are shown whole */
    .kz-banner { border-radius: 18px; }
    .kz-banner img { min-height: calc((100vw - 32px) / 3); object-fit: cover; object-position: left center; }
}

/* ==========================================================================
   Stories (kids/stories.html, kids/story.html)
   ========================================================================== */
/* Layout: categories sidebar + content */
.kzt-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.kzt-side { background: var(--kz-card); border-radius: 20px; padding: 14px 10px; box-shadow: var(--kz-shadow); position: sticky; top: 90px; }
.kzt-side h2 { font-size: 1.25rem; font-weight: 800; color: var(--kz-navy); margin: 0 6px 10px; }
.kzt-side ul { list-style: none; margin: 0; padding: 0; }
.kzt-side a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: var(--kz-text); font-weight: 600; }
.kzt-side a:hover { background: var(--kz-bg); color: var(--kz-text); }
.kzt-side a small { margin-left: auto; font-size: .72rem; font-weight: 800; color: var(--kz-muted); background: var(--kz-bg); border-radius: 999px; padding: 0 8px; }
.kzt-side a.is-active { background: linear-gradient(90deg, #2f80ed, #4c9bff); color: #fff; box-shadow: 0 4px 10px rgba(47,128,237,.3); }
.kzt-side a.is-active small { background: rgba(255,255,255,.25); color: #fff; }
.kzt-side-ic { width: 28px; text-align: center; font-size: 1.35rem; line-height: 1; flex-shrink: 0; }
.kzt-side-ic .kz-ic-img { width: 26px; height: 26px; }
.kzt-hi { display: inline-flex; align-items: center; justify-content: center; height: 26px; border-radius: 6px; background: #1fa855; color: #fff; font-size: 1rem; font-weight: 800; }
.kzt-en { background: #2f80ed; font-size: .85rem; }
.kzt-side-sep { border-top: 1px dashed var(--kz-border); margin-top: 6px; padding-top: 6px; }

.kzt-main { min-width: 0; }
.kzt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.kzt-toolbar h2 { font-size: 1.6rem; font-weight: 800; color: var(--kz-navy); margin: 0; }
.kzt-search { display: flex; align-items: center; background: var(--kz-card); border: 2px solid var(--kz-border); border-radius: 999px; padding: 4px 6px 4px 16px; box-shadow: var(--kz-shadow); min-width: min(100%, 320px); }
.kzt-search input { border: 0; outline: 0; background: transparent; flex: 1; font-family: inherit; font-size: 1rem; color: var(--kz-text); min-width: 0; }
.kzt-search button { border: 0; background: #2f80ed; color: #fff; width: 36px; height: 36px; border-radius: 50%; }

.kzt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.kzt-card { display: flex; flex-direction: column; background: var(--kz-card); border-radius: 20px; overflow: hidden; box-shadow: var(--kz-shadow); color: var(--kz-text); border: 2px solid transparent; transition: transform .15s ease, border-color .15s ease; }
.kzt-card:hover { transform: translateY(-3px); border-color: #2f80ed; color: var(--kz-text); }
.kzt-art { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; overflow: hidden;
    background: radial-gradient(circle at 30% 25%, var(--kc2), var(--kc)); }
.kzt-art img { width: 100%; height: 100%; object-fit: cover; }
.kzt-art-emoji { font-size: 4rem; letter-spacing: -4px; filter: drop-shadow(0 6px 6px rgba(0,0,0,.2)); }
.kzt-card-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px 14px; }
.kzt-card-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.kzt-card-body strong { font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.kzt-card-sum { color: var(--kz-muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kzt-card-meta { display: flex; gap: 12px; font-size: .8rem; font-weight: 700; color: var(--kz-muted); margin-top: 2px; }
.kzt-card-meta .bi-heart-fill { color: #eb3f86; }
.kzt-pages { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.kzt-pages a, .kzt-pages span { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--kz-card); font-weight: 800; color: var(--kz-text); box-shadow: var(--kz-shadow); }
.kzt-pages a.is-active { background: #2f80ed; color: #fff; }

/* Story page */
.kzt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kzt-head-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kzt-head h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800; color: var(--kz-navy); margin: 0; line-height: 1.1; overflow-wrap: anywhere; }
.kzt-speak { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; border: 0; background: linear-gradient(135deg, #ff5fa2, #eb3f86); color: #fff; font-size: 1.3rem; box-shadow: 0 4px 0 #b52a65; }
.kzt-speak:disabled { opacity: .4; }
.kzt-lang { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.kzt-lang a, .kzt-lang-off { padding: 6px 18px; border-radius: 12px; border: 2px solid var(--kz-border); background: var(--kz-card); color: var(--kz-navy); font-weight: 800; }
.kzt-lang a.is-active { background: #2f80ed; border-color: #2f80ed; color: #fff; }
.kzt-lang-off { opacity: .45; cursor: not-allowed; }
.kzt-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 14px; }
.kzt-chips .kz-chip { font-size: .85rem; padding: 3px 12px; border: 1.5px solid currentColor; }
.kzt-stat { font-weight: 700; font-size: .9rem; color: var(--kz-muted); }
.kzt-stat .bi-heart-fill { color: #eb3f86; } .kzt-stat .bi-eye-fill { color: #2f80ed; }

/* Story text in a wide reading column; cover, player and actions in a sticky side panel,
   so long stories grow downwards instead of leaving gaps beside short boxes. */
.kzt-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; margin-bottom: 16px; align-items: start; }
.kzt-cover { border-radius: 20px; aspect-ratio: 4 / 3; box-shadow: var(--kz-shadow); }
.kzt-cover .kzt-art-emoji { font-size: 7rem; }
.kzt-text { background: var(--kz-card); border-radius: 20px; padding: 20px 24px; box-shadow: var(--kz-shadow); min-width: 0; }
.kzt-text h2 { font-size: 1.6rem; font-weight: 800; color: #1f5fe0; margin: 0 0 10px; }
.kzt-paras { font-size: 1.12rem; line-height: 1.7; }
.kzt-paras.is-clamped { max-height: 560px; overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent); mask-image: linear-gradient(to bottom, #000 78%, transparent); }
.kzt-paras .is-reading { background: #fff3c4; box-shadow: inset 4px 0 0 #f59e0b; border-radius: 8px; }
.kzt-readmore { display: flex; align-items: center; gap: 8px; margin: 10px auto 0; padding: 7px 22px; border-radius: 999px; border: 2px solid #ff8fb8; background: #ffe8f1; color: #c2185b; font-weight: 800; font-family: inherit; font-size: 1rem; }
.kzt-readmore[hidden] { display: none; }

.kzt-right { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 90px; }

/* Rich text from the admin editor (stories and "Do You Know?" sections) */
.kz-rich { overflow-wrap: anywhere; }
.kz-rich::after { content: ''; display: table; clear: both; }
.kz-rich > :first-child { margin-top: 0; }
.kz-rich p, .kz-rich li, .kz-rich h2, .kz-rich h3, .kz-rich h4, .kz-rich blockquote { transition: background .2s ease; }
.kz-rich p { margin: 0 0 14px; padding: 2px 6px; }
.kz-rich h2, .kz-rich h3, .kz-rich h4 { color: var(--kz-navy); font-weight: 800; line-height: 1.25; margin: 22px 0 10px; padding: 2px 6px; }
.kz-rich h2 { font-size: 1.5rem; } .kz-rich h3 { font-size: 1.28rem; } .kz-rich h4 { font-size: 1.12rem; }
.kz-rich ul, .kz-rich ol { margin: 0 0 14px; padding-left: 1.8em; }
.kz-rich li { margin-bottom: 4px; padding: 1px 4px; }
.kz-rich blockquote { margin: 0 0 14px; padding: 10px 16px; border-left: 5px solid #8b45e8; background: #f4ecff; border-radius: 0 14px 14px 0; font-style: italic; }
.kz-rich a { color: #1f5fe0; text-decoration: underline; }
.kz-rich hr { border: 0; border-top: 3px dashed var(--kz-border); margin: 20px 0; opacity: 1; }
.kz-rich mark { background: #fff1a8; padding: 0 3px; border-radius: 4px; }
.kz-rich img { max-width: 100%; height: auto; border-radius: 16px; box-shadow: var(--kz-shadow); margin: 6px 0 14px; }
.kz-rich img.ks-center { display: block; margin-left: auto; margin-right: auto; }
.kz-rich img.ks-left { float: left; margin: 4px 18px 10px 0; }
.kz-rich img.ks-right { float: right; margin: 4px 0 10px 18px; }
.kz-rich img.ks-w-25 { width: 25%; } .kz-rich img.ks-w-50 { width: 50%; }
.kz-rich img.ks-w-75 { width: 75%; } .kz-rich img.ks-w-100 { width: 100%; }
@media (max-width: 575.98px) {
    .kz-rich img.ks-left, .kz-rich img.ks-right { float: none; display: block; margin: 6px auto 14px; }
    .kz-rich img.ks-w-25, .kz-rich img.ks-w-50 { width: 75%; }
}
.kzt-listen { background: var(--kz-card); border-radius: 20px; padding: 14px 16px; box-shadow: var(--kz-shadow); }
.kzt-listen h2 { font-size: 1.25rem; font-weight: 800; color: var(--kz-navy); margin: 0 0 10px; }
.kzt-listen h2 i { color: #eb3f86; }
.kzt-progress { display: flex; align-items: center; gap: 10px; }
.kzt-progress-bar { flex: 1; height: 8px; border-radius: 999px; background: #e6edf8; overflow: hidden; }
.kzt-progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff5fa2, #eb3f86); border-radius: inherit; transition: width .3s ease; }
.kzt-progress small { font-weight: 700; color: var(--kz-muted); white-space: nowrap; }
.kzt-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 12px 0; }
.kzt-controls button { width: 48px; height: 48px; border-radius: 50%; border: 0; background: #e8f0fd; color: #1f5fe0; font-size: 1.4rem; }
.kzt-controls .kzt-play { width: 64px; height: 64px; background: linear-gradient(180deg, #3b8bff, #1f5fe0); color: #fff; font-size: 2rem; box-shadow: 0 5px 0 #143f9e; }
.kzt-controls button:disabled { opacity: .4; }
.kzt-speed-label { margin: 0 0 6px; font-weight: 700; color: var(--kz-muted); font-size: .9rem; }
.kzt-speeds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.kzt-speeds button { border: 2px solid var(--kz-border); background: var(--kz-card); color: var(--kz-text); border-radius: 12px; padding: 5px 0; font-weight: 800; font-family: inherit; }
.kzt-speeds button.is-active { background: #2f80ed; border-color: #2f80ed; color: #fff; }
.kzt-voice-note { margin: 8px 0 0; font-size: .85rem; color: #b45309; }
.kzt-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kzt-actions button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 6px; border-radius: 16px; border: 2px solid transparent; background: var(--kz-card); box-shadow: var(--kz-shadow); color: var(--kz-text); font-weight: 800; font-family: inherit; line-height: 1.1; }
.kzt-actions button small { display: block; font-weight: 600; color: var(--kz-muted); }
.kzt-actions button i { font-size: 1.6rem; }
.kzt-like-ic { color: #eb3f86; } .kzt-save-ic { color: #f5b301; } .kzt-share-ic { color: #2f80ed; }
.kzt-actions button.is-on { border-color: currentColor; }
.kzt-actions button[data-react="like"].is-on { border-color: #eb3f86; } .kzt-actions button[data-react="save"].is-on { border-color: #f5b301; }
.kzt-toast { margin: 0; text-align: center; background: #1e2a4a; color: #fff; border-radius: 12px; padding: 6px 10px; font-weight: 700; }

.kzt-bottom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kzt-bottom .kz-panel { margin-bottom: 0; }
.kzt-learn ul { list-style: none; margin: 0; padding: 0; }
.kzt-learn li { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-weight: 600; }
.kzt-learn li i { color: #22c55e; margin-top: 3px; }
.kzt-act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.kzt-act { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 12px 8px; border-radius: 16px; border: 2px solid transparent;
    background: var(--kc-soft); color: var(--kz-text); font-family: inherit; transition: transform .12s ease, border-color .12s ease; }
.kzt-act:hover { transform: translateY(-2px); border-color: var(--kc); color: var(--kz-text); }
.kzt-act-ic { font-size: 2.2rem; line-height: 1; color: var(--kc); }
.kzt-act-ic .kz-ic-img { width: 40px; height: 40px; }
.kzt-act strong { font-size: .95rem; line-height: 1.15; }
.kzt-act > i { color: var(--kc); font-size: 1.3rem; }
.kzt-sim-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kzt-sim-grid a { display: flex; flex-direction: column; gap: 6px; color: var(--kz-text); text-align: center; }
.kzt-sim-grid a:hover { color: #1f5fe0; }
.kzt-sim-grid .kzt-art { border-radius: 14px; }
.kzt-sim-grid .kzt-art-emoji { font-size: 2.6rem; }
.kzt-sim-grid strong { font-size: .9rem; line-height: 1.2; }

/* Draw the Story */
.kzt-draw { border: 0; border-radius: 24px; padding: 16px; width: min(960px, 96vw); max-height: 94vh; box-shadow: 0 20px 60px rgba(0,0,0,.35); background: var(--kz-card); color: var(--kz-text); font-family: 'Baloo 2', 'Inter', sans-serif; }
.kzt-draw::backdrop { background: rgba(15, 23, 42, .6); }
.kzt-draw-head { display: flex; justify-content: space-between; align-items: center; }
.kzt-draw-head h2 { margin: 0; font-weight: 800; font-size: 1.5rem; color: var(--kz-navy); }
.kzt-draw-head button { border: 0; background: var(--kz-bg); width: 38px; height: 38px; border-radius: 50%; font-size: 1.1rem; color: var(--kz-text); }
.kzt-draw-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 10px; }
.kzt-draw-tools [data-color] { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; background: var(--sw); box-shadow: 0 0 0 2px var(--kz-border); }
.kzt-draw-tools [data-color].is-active { box-shadow: 0 0 0 3px #2f80ed; transform: scale(1.1); }
.kzt-size { display: flex; align-items: center; gap: 6px; font-weight: 700; }
#kztCanvas { display: block; width: 100%; height: auto; border-radius: 16px; border: 3px dashed var(--kz-border); background: #fff; touch-action: none; cursor: crosshair; }

@media (max-width: 1199.98px) {
    /* side panel moves above the story: cover on the left, player + actions on the right */
    .kzt-top { grid-template-columns: minmax(0, 1fr); }
    .kzt-top .kzt-right { order: -1; position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
    .kzt-right .kzt-cover { grid-row: span 3; }
    .kzt-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .kzt-bottom .kzt-similar { grid-column: 1 / -1; }
}
@media (max-width: 991.98px) {
    .kzt-layout { grid-template-columns: minmax(0, 1fr); }
    .kzt-side { position: static; order: 2; }
}
@media (max-width: 767.98px) {
    .kzt-bottom { grid-template-columns: minmax(0, 1fr); }
    /* phones: cover, story, then the player and actions */
    .kzt-top .kzt-right { display: contents; }
    .kzt-right .kzt-cover { order: -1; grid-row: auto; }
    .kzt-listen { order: 1; } .kzt-actions { order: 2; } .kzt-toast { order: 3; }
    .kzt-text { padding: 16px; }
    .kzt-paras { font-size: 1.05rem; }
    .kzt-sim-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

[data-bs-theme="dark"] .kzt-paras .is-reading, html.dark-theme .kzt-paras .is-reading { background: #3a3215; }
[data-bs-theme="dark"] .kzt-act, html.dark-theme .kzt-act { background: color-mix(in srgb, var(--kc) 20%, var(--kz-card)); }
[data-bs-theme="dark"] .kz-rich blockquote, html.dark-theme .kz-rich blockquote { background: #2a2140; }
[data-bs-theme="dark"] .kz-rich mark, html.dark-theme .kz-rich mark { background: #5c4d12; color: #fff6cc; }
[data-bs-theme="dark"] .kz-rich a, html.dark-theme .kz-rich a { color: #9cc0ff; }
[data-bs-theme="dark"] .kzt-readmore, html.dark-theme .kzt-readmore { background: #3a1f2c; color: #ff9ec8; }
[data-bs-theme="dark"] .kzt-controls button:not(.kzt-play), html.dark-theme .kzt-controls button:not(.kzt-play),
[data-bs-theme="dark"] .kzt-progress-bar, html.dark-theme .kzt-progress-bar { background: #22304f; color: #9cc0ff; }
[data-bs-theme="dark"] .kzt-text h2, html.dark-theme .kzt-text h2 { color: #9cc0ff; }

/* ==========================================================================
   Do You Know? (kids/dyk_index.html, kids/dyk_article.html) — site header only
   ========================================================================== */
.kzd { padding-top: 14px; }
.kzd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; max-width: 1400px; margin: 0 auto; }
.kzd-main { min-width: 0; }

/* Hero */
.kzd-hero { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 260px); align-items: center; gap: 14px;
    min-height: 220px; padding: 20px 24px; border-radius: 26px; overflow: hidden; margin-bottom: 14px; box-shadow: var(--kz-shadow);
    background: radial-gradient(ellipse at 85% 100%, #b9e79d 0 25%, transparent 26%), linear-gradient(135deg, #e4f3ff 0%, #f3ecff 55%, #fff1f6 100%); }
.kzd-hero-kid { position: relative; font-size: 6.5rem; line-height: 1; text-align: center; filter: drop-shadow(0 6px 6px rgba(0,0,0,.15)); }
.kzd-q { position: absolute; left: 6px; top: -14px; font-size: 3.4rem; font-weight: 800; color: #f5a400; transform: rotate(-12deg); }
.kzd-think { position: absolute; right: 0; bottom: -4px; font-size: 2.4rem; }
.kzd-hero-copy h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; margin: 0; color: #1f3fae; line-height: 1; }
.kzd-hero-copy h1 span { color: #d6286f; }
.kzd-hero-sub { font-weight: 800; font-size: 1.25rem; color: #12306f; margin: 6px 0; }
.kzd-hero-copy p:last-child { margin: 0; color: #3c4a6b; max-width: 460px; }
.kzd-hero-art { position: relative; height: 180px; }
.kzd-bubble { position: absolute; background: #fff; color: #1f3fae; font-weight: 800; font-size: .85rem; border-radius: 14px; padding: 4px 10px; box-shadow: 0 3px 8px rgba(0,0,0,.08); animation: kzs-bob 4s ease-in-out infinite; white-space: nowrap; }
.kzd-bubble.b1 { left: 0; top: 10px; } .kzd-bubble.b2 { left: 42%; top: 0; animation-delay: -1s; background: #fff3c4; }
.kzd-bubble.b3 { right: 0; top: 20px; animation-delay: -2s; background: #ffe8f1; color: #c2185b; }
.kzd-bubble.b4 { left: 4%; top: 64px; animation-delay: -3s; background: #e5f8ea; color: #15803d; }
.kzd-bulb { position: absolute; left: 44%; bottom: 36px; font-size: 4.6rem; filter: drop-shadow(0 0 18px rgba(255,200,40,.8)); }
.kzd-books { position: absolute; left: 40%; bottom: 0; font-size: 3rem; }

/* Kind cards */
.kzd-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kzd-kind { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 18px; background: var(--kz-card); box-shadow: var(--kz-shadow); color: var(--kz-text); border: 2px solid transparent; }
.kzd-kind:hover, .kzd-kind.is-active { border-color: var(--kc); color: var(--kz-text); transform: translateY(-2px); }
.kzd-kind-ic { width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; background: var(--kc-soft); }
.kzd-kind > span:nth-child(2) { flex: 1; min-width: 0; line-height: 1.2; }
.kzd-kind strong { display: block; font-weight: 800; color: var(--kz-navy); }
.kzd-kind small { color: var(--kz-muted); font-size: .8rem; }
.kzd-kind > i { color: var(--kc); }

/* Art (cover picture or emoji) */
.kzd-art { display: flex; align-items: center; justify-content: center; overflow: hidden; background: radial-gradient(circle at 30% 25%, var(--kc2), var(--kc)); }
.kzd-art img { width: 100%; height: 100%; object-fit: cover; }
.kzd-art-emoji { font-size: 3rem; letter-spacing: -4px; line-height: 1; filter: drop-shadow(0 4px 4px rgba(0,0,0,.2)); }

/* Popular topics */
.kzd-popular { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kzd-pop { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, var(--kc-soft), var(--kz-card)); color: var(--kz-text); border: 2px solid var(--kc-soft); transition: transform .15s ease, border-color .15s ease; }
.kzd-pop:hover { transform: translateY(-3px); border-color: var(--kc); color: var(--kz-text); }
.kzd-pop strong { padding: 10px 12px 0; font-size: 1.15rem; font-weight: 800; color: var(--kz-navy); line-height: 1.15; }
.kzd-pop small { padding: 0 12px; color: var(--kz-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kzd-pop .kzd-art { margin-top: auto; aspect-ratio: 4 / 3; }
.kzd-pop > small { margin-bottom: 8px; }
.kzd-pop .kzd-art-emoji { font-size: 4rem; }
.kzd-mini { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.kzd-mini a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--kz-text); background: var(--kz-bg); border-radius: 14px; padding: 8px; }
.kzd-mini a:hover { color: #1f5fe0; }
.kzd-mini .kzd-art { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; }
.kzd-mini .kzd-art-emoji { font-size: 2rem; }
.kzd-mini strong { font-size: .85rem; line-height: 1.15; }

/* Latest + result cards */
.kzd-latest { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kzd-late { display: flex; flex-direction: column; gap: 4px; color: var(--kz-text); }
.kzd-late:hover { color: #1f5fe0; }
.kzd-late .kzd-art { aspect-ratio: 16 / 9; border-radius: 14px; margin-bottom: 4px; }
.kzd-late strong { font-weight: 800; color: var(--kz-navy); }
.kzd-late small, .kzd-card small { color: var(--kz-muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kzd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.kzd-card { position: relative; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--kz-card); border: 2px solid var(--kz-border); color: var(--kz-text); }
.kzd-card:hover { border-color: #2f80ed; color: var(--kz-text); }
.kzd-card .kzd-art { aspect-ratio: 16 / 9; }
.kzd-card-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 14px; }
.kzd-card-body strong { font-size: 1.1rem; font-weight: 800; color: var(--kz-navy); line-height: 1.2; }
.kzd-card-kind { align-self: flex-start; display: inline-block; font-size: .75rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--kc-soft); color: var(--kc); }
.kzd-card-go { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #1f5fe0; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.15); }

/* Sidebar */
.kzd-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 90px; }
.kzd-box { display: block; background: var(--kz-card); border-radius: 20px; padding: 14px; box-shadow: var(--kz-shadow); color: var(--kz-text); }
.kzd-box h2 { font-size: 1.15rem; font-weight: 800; color: var(--kz-navy); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.kzd-box-head { display: flex; justify-content: space-between; align-items: center; }
.kzd-box-head a { font-size: .85rem; font-weight: 700; color: #2f80ed; }
.kzd-search { background: linear-gradient(180deg, #fde8f4, var(--kz-card)); }
.kzd-search form { display: flex; border: 2px solid var(--kz-border); border-radius: 12px; overflow: hidden; background: var(--kz-card); }
.kzd-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 7px 10px; font-family: inherit; background: transparent; color: var(--kz-text); }
.kzd-search button { border: 0; background: #2f80ed; color: #fff; width: 40px; }
.kzd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kzd-chips a { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--kz-bg); border: 1px solid var(--kz-border); color: var(--kz-text); }
.kzd-chips a:hover { border-color: #2f80ed; color: #2f80ed; }
.kzd-featured-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: center; }
.kzd-featured-row .kzd-art { aspect-ratio: 1; border-radius: 14px; }
.kzd-featured-row strong { display: block; font-weight: 800; font-size: 1.1rem; color: var(--kz-navy); }
.kzd-featured-row small { display: block; color: var(--kz-muted); margin-bottom: 6px; line-height: 1.25; }
.kzd-recent { list-style: none; margin: 0; padding: 0; }
.kzd-recent li + li { border-top: 1px solid var(--kz-border); }
.kzd-recent a { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--kz-text); }
.kzd-recent a:hover { color: #1f5fe0; }
.kzd-recent .kzd-art { width: 52px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.kzd-recent .kzd-art-emoji { font-size: 1.3rem; letter-spacing: -2px; }
.kzd-recent strong { display: block; font-size: .92rem; line-height: 1.2; }
.kzd-recent small { color: var(--kz-muted); font-size: .78rem; }
.kzd-saved-link { font-weight: 800; color: #8b45e8; }

/* Article */
.kzd-head { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: center; padding: 20px; border-radius: 24px; margin-bottom: 14px;
    background: linear-gradient(135deg, var(--kc-soft), var(--kz-card)); box-shadow: var(--kz-shadow); }
.kzd-head h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; color: var(--kz-navy); margin: 8px 0 4px; line-height: 1.1; overflow-wrap: anywhere; }
.kzd-head p { margin: 0; color: #3c4a6b; font-size: 1.05rem; }
.kzd-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; }
.kzd-meta li { font-size: .82rem; font-weight: 700; background: var(--kz-card); border: 1px solid var(--kz-border); border-radius: 999px; padding: 3px 10px; color: var(--kz-muted); }
.kzd-meta li i { color: #2f80ed; }
.kzd-head-art { aspect-ratio: 4 / 3; border-radius: 18px; }
.kzd-head-art .kzd-art-emoji { font-size: 4.6rem; }

.kzd-sec { background: var(--kz-card); border-radius: 20px; padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--kz-shadow); scroll-margin-top: 90px; }
.kzd-sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.kzd-num { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: linear-gradient(135deg, #4c9bff, #1f5fe0); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.kzd-sec-head h2 { flex: 1; margin: 0; font-size: 1.4rem; font-weight: 800; color: var(--kz-navy); }
.kzd-speak { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #ffe8f1; color: #eb3f86; font-size: 1.1rem; flex-shrink: 0; }
.kzd-speak.is-on { background: #eb3f86; color: #fff; }
.kzd-sec p { font-size: 1.06rem; line-height: 1.55; margin: 0 0 10px; overflow-wrap: anywhere; }
.kzd-text-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.kzd-sec .kz-rich { margin-bottom: 10px; }
.kzd-sec .kz-rich p, .kzd-sec .kz-rich h2, .kzd-sec .kz-rich h3, .kzd-sec .kz-rich h4 { padding: 0; }
.kzd-sec .kz-rich h2 { font-size: 1.25rem; } .kzd-sec .kz-rich h3 { font-size: 1.12rem; } .kzd-sec .kz-rich h4 { font-size: 1rem; }
.kzd-sec-art { font-size: 5rem; line-height: 1; letter-spacing: -6px; padding: 8px 14px; border-radius: 18px; background: #eef5ff; }
.kzd-simple { background: #e8f8ec; border-left: 5px solid #22c55e; border-radius: 12px; padding: 8px 12px; color: #14532d; }
.kzd-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--kz-border); }
.kzd-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.kzd-table th, .kzd-table td { padding: 9px 12px; border-bottom: 1px solid var(--kz-border); text-align: left; vertical-align: top; font-size: .95rem; }
.kzd-table thead th { color: #fff; font-weight: 800; background: #475569; }
.kzd-table thead .kzd-col-a { background: #2f80ed; } .kzd-table thead .kzd-col-b { background: #8b45e8; }
.kzd-table tbody th { background: var(--kz-bg); font-weight: 800; width: 22%; }
.kzd-table tbody tr:last-child th, .kzd-table tbody tr:last-child td { border-bottom: 0; }
.kzd-flows { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-bottom: 10px; }
.kzd-flow { border-radius: 16px; padding: 12px; background: var(--kc-soft); }
.kzd-flow h3 { font-size: 1.05rem; font-weight: 800; color: var(--kc); margin: 0 0 8px; }
.kzd-flow ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kzd-flow li { display: inline-flex; align-items: center; gap: 6px; background: var(--kz-card); border-radius: 12px; padding: 5px 10px; font-weight: 700; font-size: .9rem; }
.kzd-flow li + li::before { content: '→'; color: var(--kc); font-weight: 800; margin-left: -2px; margin-right: 4px; }
.kzd-step-n { width: 22px; height: 22px; border-radius: 50%; background: var(--kc); color: #fff; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; }
.kzd-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 10px; }
.kzd-example { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px; border-radius: 16px; background: var(--kc-soft); }
.kzd-example-ic { font-size: 2.4rem; line-height: 1; }
.kzd-example strong { color: var(--kz-navy); }
.kzd-example small { color: var(--kz-muted); line-height: 1.25; }
.kzd-proscons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kzd-pros, .kzd-cons { border-radius: 16px; padding: 12px 14px; }
.kzd-pros { background: #e8f8ec; } .kzd-cons { background: #ffecec; }
.kzd-proscons h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 6px; }
.kzd-pros h3 { color: #15803d; } .kzd-cons h3 { color: #c62828; }
.kzd-proscons ul { margin: 0; padding-left: 18px; color: #1e2a4a; }
.kzd-proscons li { margin: 2px 0; }

.kzd-toc ol { margin: 0; padding-left: 20px; }
.kzd-toc li { margin: 4px 0; }
.kzd-toc a { color: var(--kz-text); font-weight: 600; }
.kzd-toc a:hover { color: #1f5fe0; }
.kzd-facts { background: linear-gradient(180deg, #fff8e1, var(--kz-card)); }
.kzd-facts ul { list-style: none; margin: 0; padding: 0; }
.kzd-facts li { display: flex; gap: 8px; padding: 3px 0; font-weight: 600; font-size: .92rem; }
.kzd-facts li i { color: #22c55e; margin-top: 3px; }
.kzd-dyk { position: relative; background: linear-gradient(180deg, #e7f1ff, var(--kz-card)); padding-right: 70px; }
.kzd-dyk p { margin: 0; font-weight: 600; }
.kzd-dyk-kid { position: absolute; right: 10px; bottom: 6px; font-size: 3rem; }
.kzd-quiz-q { font-weight: 800; margin: 0 0 8px; }
.kzd-quiz-opts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.kzd-quiz-opts label { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--kz-border); cursor: pointer; font-weight: 600; }
.kzd-quiz-opts label:has(input:checked) { border-color: #2f80ed; background: #e6f2ff; }
.kzd-quiz-opts label.is-right { border-color: #22c55e; background: #e8f8ec; }
.kzd-quiz-opts label.is-wrong { border-color: #ef4444; background: #ffecec; }
.kzd-quiz-result { margin: 8px 0 0; font-weight: 800; }
.kzd-quiz-result.is-right { color: #15803d; } .kzd-quiz-result.is-wrong { color: #c62828; }
.kzd-quiz-why { margin: 4px 0 0; color: var(--kz-muted); font-size: .9rem; }
.kzd-tool-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kzd-tool-row button { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px solid var(--kz-border); background: var(--kz-card); border-radius: 14px; padding: 8px 4px; font-weight: 700; font-size: .8rem; color: var(--kz-text); font-family: inherit; }
.kzd-tool-row button i { font-size: 1.4rem; }
.kzd-tool-row [data-print] i { color: #e53935; } .kzd-tool-row [data-save] i { color: #f5b301; } .kzd-tool-row [data-share] i { color: #2f80ed; }
.kzd-tool-row button.is-on { border-color: #f5b301; }
.kzd-tools .kzt-toast { margin-top: 8px; }

@media (max-width: 1199.98px) {
    .kzd-hero { grid-template-columns: 120px minmax(0, 1fr); }
    .kzd-hero-art { display: none; }
    .kzd-popular, .kzd-latest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kzd-mini { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kzd-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .kzd-grid { grid-template-columns: minmax(0, 1fr); }
    .kzd-side { position: static; }
    .kzd-article-grid .kzd-toc { display: none; }
}
@media (max-width: 767.98px) {
    .kzd-hero { grid-template-columns: minmax(0, 1fr); text-align: center; padding: 18px 14px; }
    .kzd-hero-kid { font-size: 4.4rem; }
    .kzd-hero-copy p:last-child { margin: 0 auto; }
    .kzd-kinds { grid-template-columns: minmax(0, 1fr); }
    .kzd-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kzd-head { grid-template-columns: minmax(0, 1fr); }
    .kzd-head-art { order: -1; aspect-ratio: 16 / 9; }
    .kzd-text-row, .kzd-proscons { grid-template-columns: minmax(0, 1fr); }
    .kzd-sec-art { justify-self: center; font-size: 3.6rem; }
    /* Comparison table: one card per row, each value labelled with its column */
    .kzd-table { min-width: 0; }
    .kzd-table thead { display: none; }
    .kzd-table, .kzd-table tbody, .kzd-table tr, .kzd-table th, .kzd-table td { display: block; width: 100%; }
    .kzd-table tbody th { width: 100%; border-bottom: 0; }
    .kzd-table td { border-bottom: 0; padding-top: 4px; }
    .kzd-table td::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 800; color: #2f80ed; }
    .kzd-table td + td::before { color: #8b45e8; }
    .kzd-table tbody tr { border-bottom: 1px solid var(--kz-border); padding-bottom: 6px; }
    .kzd-table tbody tr:last-child { border-bottom: 0; }
}

@media print {
    .site-header, header.site-header, footer, .kzs-crumbs, .kzd-side, .kzd-speak, .back-to-top, .scroll-progress, #chatbot, #cookieConsent { display: none !important; }
    .kzd-grid { grid-template-columns: 1fr; }
    .kz, .kzd-sec, .kzd-head { box-shadow: none !important; background: #fff !important; }
    .kzd-sec { break-inside: avoid; border: 1px solid #ddd; }
}

[data-bs-theme="dark"] .kzd-hero, html.dark-theme .kzd-hero { background: linear-gradient(135deg, #1c2f5e 0%, #2a2350 55%, #3a1f33 100%); }
[data-bs-theme="dark"] .kzd-hero-copy h1, html.dark-theme .kzd-hero-copy h1 { color: #9cc0ff; }
[data-bs-theme="dark"] .kzd-hero-sub, html.dark-theme .kzd-hero-sub, [data-bs-theme="dark"] .kzd-hero-copy p:last-child, html.dark-theme .kzd-hero-copy p:last-child,
[data-bs-theme="dark"] .kzd-head p, html.dark-theme .kzd-head p { color: #dbe7ff; }
[data-bs-theme="dark"] .kzd-simple, html.dark-theme .kzd-simple, [data-bs-theme="dark"] .kzd-pros, html.dark-theme .kzd-pros { background: #173d28; color: #c8f2d4; }
[data-bs-theme="dark"] .kzd-cons, html.dark-theme .kzd-cons { background: #4a1d1d; }
[data-bs-theme="dark"] .kzd-proscons ul, html.dark-theme .kzd-proscons ul { color: var(--kz-text); }
[data-bs-theme="dark"] .kzd-sec-art, html.dark-theme .kzd-sec-art { background: #22304f; }
[data-bs-theme="dark"] .kzd-search, html.dark-theme .kzd-search, [data-bs-theme="dark"] .kzd-facts, html.dark-theme .kzd-facts,
[data-bs-theme="dark"] .kzd-dyk, html.dark-theme .kzd-dyk { background: var(--kz-card); }
