/* KKD Study Tools — matches portal theme via --kkd-* variables (both modes) */
.study-wrap { width: 100%; padding: 18px clamp(14px,3vw,40px) 60px; }
.st-head { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 16px; }
.st-head h2 { margin: 0; font-size: 1.5rem; color: var(--kkd-ink); }
.st-head p { margin: 4px 0 0; color: var(--kkd-ink-soft); font-size: .95rem; }
.st-back { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--kkd-line); background: var(--kkd-card); color: var(--kkd-ink);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.st-card { display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
    background: var(--kkd-card); border: 1px solid var(--kkd-line); border-radius: 14px;
    padding: 14px; color: var(--kkd-ink); min-width: 0; }
.st-card:active { transform: scale(.98); }
.st-ic { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center; }
.st-tx { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-tx strong { font-size: 1rem; }
.st-tx small { color: var(--kkd-ink-soft); font-size: .82rem; line-height: 1.35; }
.st-badge { flex: 0 0 auto; font-size: .75rem; font-weight: 700; background: var(--kkd-mint);
    color: var(--kkd-ink); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.st-badge-red { background: #fbe3e3; color: #C62828; }
.st-go { color: var(--kkd-ink-soft); }
.st-note { color: var(--kkd-ink-soft); font-size: .85rem; line-height: 1.5; margin: 14px 2px 0; }
.st-panel { background: var(--kkd-card); border: 1px solid var(--kkd-line); border-radius: 14px;
    padding: 16px; margin-bottom: 12px; color: var(--kkd-ink); }
.st-panel p { margin: 0 0 10px; line-height: 1.55; }
.st-center { text-align: center; }
.st-empty { font-size: 44px; color: var(--kkd-saffron); }
.st-btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    background: var(--kkd-ink); color: var(--kkd-paper); border: 1px solid var(--kkd-ink);
    border-radius: 10px; padding: 10px 18px; font-size: .95rem; font-weight: 600; margin: 4px 4px 4px 0; }
.st-btn:disabled { opacity: .5; cursor: default; }
.st-btn-ghost { background: transparent; color: var(--kkd-ink); border: 1px solid var(--kkd-line); }
.st-list { display: flex; flex-direction: column; gap: 8px; }
.st-row { display: flex; align-items: center; gap: 10px; background: var(--kkd-card);
    border: 1px solid var(--kkd-line); border-radius: 12px; padding: 10px 12px; }
.st-row-tx { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-row-tx small { color: var(--kkd-ink-soft); font-size: .82rem; }
/* quiz */
.st-quizbar { display: flex; justify-content: space-between; color: var(--kkd-ink-soft);
    font-size: .85rem; margin-bottom: 10px; }
.st-q { font-size: 1.05rem; font-weight: 600; line-height: 1.5; margin: 0 0 12px !important; }
.st-opts { display: flex; flex-direction: column; gap: 8px; }
.st-opt { text-align: left; cursor: pointer; background: var(--kkd-input);
    border: 1px solid var(--kkd-line); border-radius: 10px; padding: 12px;
    color: var(--kkd-ink); font-size: .95rem; line-height: 1.45; }
.st-opt.st-correct { border-color: #2E7D32; background: #e8f3e8; }
.st-opt.st-wrong { border-color: #C62828; background: #fbe9e9; }
.st-opt:disabled { cursor: default; }
.st-feed { border-radius: 10px; padding: 12px; margin: 12px 0; line-height: 1.5; font-size: .92rem; }
.st-feed.st-ok { background: #e8f3e8; border: 1px solid #2E7D32; }
.st-feed.st-bad { background: #fbe9e9; border: 1px solid #C62828; }
.st-bigscore { font-size: 3rem; font-weight: 800; color: var(--kkd-ink); margin: 8px 0; }
/* mastery */
.st-paper { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    background: transparent; border: 0; border-bottom: 1px solid var(--kkd-line);
    padding: 12px 4px; cursor: pointer; color: var(--kkd-ink); }
.st-paper:last-child { border-bottom: 0; }
.st-paper-tx { flex: 0 0 42%; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-paper-tx small, .st-topic-tx small { color: var(--kkd-ink-soft); font-size: .8rem; }
.st-bar { flex: 1; height: 10px; border-radius: 999px; background: var(--kkd-canvas);
    overflow: hidden; min-width: 60px; }
.st-bar i { display: block; height: 100%; border-radius: 999px; }
.st-topic { display: flex; align-items: center; gap: 12px; padding: 10px 4px;
    border-bottom: 1px solid var(--kkd-line); }
.st-topic:last-child { border-bottom: 0; }
.st-topic-tx { flex: 0 0 46%; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* forms, checks, weeks */
.st-formrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.st-formrow label, .st-label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem;
    font-weight: 600; color: var(--kkd-ink); flex: 1; min-width: 160px; }
.st-formrow select, .st-formrow input, .st-label textarea, .st-label input {
    background: var(--kkd-input); border: 1px solid var(--kkd-line); border-radius: 10px;
    padding: 10px 12px; color: var(--kkd-ink); font-size: .95rem; font-family: inherit; }
.st-label textarea { resize: vertical; }
.st-check { display: flex; align-items: flex-start; gap: 10px; padding: 9px 4px;
    border-bottom: 1px solid var(--kkd-line); cursor: pointer; font-size: .93rem;
    color: var(--kkd-ink); line-height: 1.45; }
.st-check:last-child { border-bottom: 0; }
.st-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--kkd-saffron); flex: 0 0 auto; }
.st-check input:checked + span { text-decoration: line-through; color: var(--kkd-ink-soft); }
.st-week { border: 1px solid var(--kkd-line); border-radius: 12px; padding: 12px; margin-bottom: 10px;
    background: var(--kkd-input); }
.st-week-now { border-color: var(--kkd-saffron); }
.st-week-t { font-weight: 700; margin: 0 0 6px !important; }
.st-week-t em { color: var(--kkd-saffron); font-style: normal; font-size: .8rem; }
.st-planprog { display: flex; flex-direction: column; gap: 8px; }
/* streak */
.st-flame { font-size: 52px; }
.st-streakn { font-size: 2.4rem; font-weight: 800; color: var(--kkd-ink); }
/* flashcards */
.st-flip { perspective: 800px; margin: 6px auto 14px; max-width: 520px; cursor: pointer; }
.st-flip-in { background: var(--kkd-input); border: 2px solid var(--kkd-line); border-radius: 16px;
    min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 26px; transition: transform .35s; }
.st-flip.st-flipped .st-flip-in { border-color: var(--kkd-saffron); }
.st-flip-k { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--kkd-ink-soft); }
.st-flip-in p { font-size: 1.15rem; font-weight: 600; line-height: 1.5; margin: 0 !important; }
.st-flip-in small { color: var(--kkd-ink-soft); }
.st-flipbtns { margin-bottom: 10px; }
/* tabs */
.st-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 4px; }
.st-tab { flex: 0 0 auto; border: 1px solid var(--kkd-line); background: var(--kkd-card);
    color: var(--kkd-ink); border-radius: 999px; padding: 8px 14px; font-size: .85rem;
    font-weight: 600; cursor: pointer; }
.st-tab-on { background: var(--kkd-ink); color: var(--kkd-paper); border-color: var(--kkd-ink); }
/* Q&A */
.st-qa { background: var(--kkd-card); border: 1px solid var(--kkd-line); border-radius: 12px;
    margin-bottom: 10px; overflow: hidden; }
.st-qa-q { display: block; width: 100%; text-align: left; background: transparent; border: 0;
    padding: 12px 14px; cursor: pointer; color: var(--kkd-ink); }
.st-qa-qt { display: block; font-weight: 600; line-height: 1.45; margin-bottom: 4px; }
.st-qa-q small { color: var(--kkd-ink-soft); font-size: .78rem; }
.st-qa-q small code { font-size: .7rem; background: var(--kkd-canvas); padding: 1px 5px; border-radius: 4px; }
.st-qa-a { border-top: 1px solid var(--kkd-line); padding: 12px 14px; }
.st-ans { background: var(--kkd-input); border: 1px solid var(--kkd-line); border-radius: 10px;
    padding: 10px 12px; margin-bottom: 8px; }
.st-ans p { margin: 0 0 6px !important; line-height: 1.5; }
.st-ans small { color: var(--kkd-ink-soft); }
.st-tbadge { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; background: var(--kkd-saffron); color: #fff;
    border-radius: 6px; padding: 2px 8px; margin-bottom: 6px; }
@media (max-width: 560px) {
    .st-paper-tx, .st-topic-tx { flex-basis: 55%; }
    .st-grid { grid-template-columns: 1fr 1fr; }
    .st-tx small { display: none; }
    .st-card { flex-direction: column; align-items: flex-start; gap: 10px; }
    .st-tx { width: 100%; }
    .st-go { display: none; }
}

/* Dark-mode readability for quiz feedback (light theme keeps the pastel fills). */
[data-theme="dark"] .st-opt.st-correct { background: #1d3a24; border-color: #66bb6a; }
[data-theme="dark"] .st-opt.st-wrong { background: #402020; border-color: #e57373; }
[data-theme="dark"] .st-feed.st-ok { background: #1d3a24; border-color: #66bb6a; }
[data-theme="dark"] .st-feed.st-bad { background: #402020; border-color: #e57373; }
