@layer responsive {
.kg-study .kg-subtitle,.kg-study .kg-english{color:var(--muted);font-size:15px;line-height:1.75}
.kg-study .kg-english{border-left:2px solid #b7c7ae;padding-left:14px;margin:16px 0!important}
.kg-study .kg-equation{font-weight:650;font-size:clamp(19px,2.5vw,28px);line-height:1.7;letter-spacing:.01em;color:var(--forest);border-left:3px solid #75946b;padding:9px 14px;margin:12px 0;background:#edf2e7;border-radius:0 10px 10px 0;overflow-wrap:anywhere}
.kg-study .kg-rule{border-bottom:1px solid var(--line);padding:8px 0}
.kg-study .kg-visual{margin:18px 0 26px;text-align:center;padding:16px 0;color:var(--forest)}
.kg-study .kg-visual svg{display:block;max-width:440px;width:100%;height:auto;margin:auto}
.kg-study figcaption{font-size:14px;color:var(--muted);margin-top:10px}
.kg-tiles,.kg-sky{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px}
.kg-tiles span,.kg-tiles b,.kg-tiles strong{padding:12px 18px;border:1px solid #d3dfcb;background:linear-gradient(145deg,#fffefa,#e7efdf);border-radius:12px;box-shadow:0 5px 0 #d6e0cf;font-size:clamp(19px,3vw,30px)}
.kg-tiles b{background:#f4e6c4;box-shadow:0 5px 0 #ddc695;border-color:#ddc695}
.kg-tiles strong{background:#dce9d2}.kg-sky{background:linear-gradient(#dfeef3,transparent);border-radius:16px;padding:14px}.kg-sky svg{max-width:150px!important}.kg-sky span{font-weight:650;font-size:25px}.kg-sky small{display:block;font-size:14px}
.kg-study .kg-recall{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:18px}
.kg-study details{border:1px solid var(--line);border-radius:12px;padding:10px 14px;margin:8px 0;background:var(--surface)}
.kg-study summary{cursor:pointer;min-height:44px;padding:7px 0;font-weight:650;overflow-wrap:anywhere}.kg-study summary small{display:block;font-weight:400;color:var(--muted);font-size:14px;margin-top:5px}
.kg-study select,.kg-reset{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:8px;padding:10px;min-height:44px;font:inherit}
.kg-study .kg-right{background:#e1eed8!important;border:1px solid #8eaf7c}.kg-study .kg-wrong{background:#f8e6e2!important;border:1px solid #c6877c}.kg-study [data-kg-score]{display:block;padding-top:14px;font-weight:650}
.kg-study .kg-next{display:flex;flex-wrap:wrap;gap:14px;margin-top:24px}.kg-study .kg-next a{border:1px solid var(--line);padding:10px 14px;border-radius:10px}
@media(max-width:520px){.kg-study .kg-recall{grid-template-columns:1fr}.kg-tiles{gap:8px}.kg-tiles span,.kg-tiles b,.kg-tiles strong{padding:8px}.kg-study .ge-table table{min-width:320px}.kg-sky{gap:8px}.kg-sky svg{max-width:92px!important}}
}

@layer responsive{
.kg-study .kg-equation{background:transparent;border:0;padding:10px 0;letter-spacing:0}
.kg-equation-tiles{display:flex;align-items:stretch;justify-content:flex-start;flex-wrap:wrap;gap:8px}
.kg-equation-tiles .ka-letter{min-width:54px;min-height:58px;padding:7px 11px;flex:0 1 auto;text-align:center}
.kg-equation-tiles .kg-word:last-child{background:linear-gradient(145deg,#e6efdf,#d6e5cc);border-color:#b8cbaa}
.kg-equation-tiles .kg-operator{align-self:center;color:var(--muted);font-weight:600}
.kg-equation-tiles .ka-letter strong{font-size:clamp(18px,2.6vw,26px)!important;overflow-wrap:anywhere}
.kg-study .kg-equation small{display:block;margin-top:8px;font-size:15px;color:var(--muted)}
.kg-category-tiles{margin:16px 0 22px;grid-template-columns:repeat(auto-fit,minmax(130px,1fr))}
.kg-category-tiles .ka-stat strong{font-size:28px}
.kg-category-tiles .ka-stat:nth-child(3n+2){background:#e3edf2}
.kg-category-tiles .ka-stat:nth-child(3n){background:#f2e8d5}
.kg-study .kg-english[hidden]{display:none!important}
@media(max-width:520px){.kg-category-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}.kg-equation-tiles{gap:5px}.kg-equation-tiles .ka-letter{padding:5px 8px;min-width:40px;min-height:45px}}
}

@layer responsive{.kg-study .kg-compass{max-width:430px;margin:20px auto;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.kg-study .kg-compass .ka-letter strong{font-size:clamp(14px,2.2vw,22px)!important;overflow-wrap:anywhere;text-align:center}.kg-study .kg-compass .ka-letter:nth-child(5){background:#d6e6ca}.kg-study .ge-table{max-width:100%}.kg-study .ge-lesson{min-width:0}.kg-study .kg-equation-tiles .ka-letter{max-width:100%}}

@layer responsive {
.kg-study .kg-adjacent{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:28px}
.kg-study .kg-adjacent>a,.kg-study .kg-pending{display:grid;gap:5px;min-width:0;border:1px solid var(--line);background:var(--surface);border-radius:13px;padding:12px 14px;overflow-wrap:anywhere}
.kg-study .kg-adjacent>a:hover,.kg-study .kg-adjacent>a:focus-visible{border-color:var(--forest)}
.kg-study .kg-adjacent span,.kg-study .kg-adjacent small{font-size:.86rem;color:var(--muted)}
.kg-study .kg-adjacent>.kg-pending{font-size:inherit}
}

@layer responsive {
.kg-study .kg-bank-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:end;margin:14px 0 8px}
.kg-study .kg-bank-controls label{display:grid;gap:4px;min-width:0;flex:1 1 170px;font-weight:650}
.kg-study .kg-bank-controls input,.kg-study .kg-bank-controls button{font:inherit;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink)}
.kg-study .kg-bank-controls input,.kg-study .kg-bank-controls select{min-width:0;width:100%}
.kg-study .kg-bank [hidden]{display:none!important}
.kg-study .kg-bank h3{margin-top:23px}
.kg-study .kg-bank h3 small{font-size:.8em;color:var(--muted)}
.kg-study .kg-bank-en{display:block;margin-top:5px!important;margin-bottom:0!important}
}

/* Keep translations as real table cells, not stacked prose. */
.kg-study .kg-bank .kg-bank-translation{border-left:0;margin:0!important;padding:12px 14px;line-height:1.55;color:inherit;vertical-align:top;overflow-wrap:anywhere;min-width:7rem}.kg-study .kg-bank th.kg-bank-translation{font-weight:700}.kg-study .kg-bank .ge-table{overflow-x:auto;max-width:100%}.kg-study .kg-bank td,.kg-study .kg-bank th{overflow-wrap:anywhere}@media(max-width:520px){.kg-study .kg-bank .kg-bank-translation{padding:9px 8px;min-width:6.5rem}}
