/* =============================================================
   YI ER SAN — additions on top of the shared Learning Time
   design system (styles.css). Same tokens, cards and buttons.
   ============================================================= */

:root {
    /* Kai (楷体) matches the handwriting style of school textbooks */
    --font-hanzi: 'Kaiti SC', 'STKaiti', 'KaiTi', 'BiauKai', 'Noto Serif SC', 'Songti SC', serif;
}

body.round-open { overflow: hidden; }

.hanzi-text { font-family: var(--font-hanzi); }
.center { text-align: center; }
.muted { color: var(--text-muted); }

.title-sub { letter-spacing: 1.5px; }

/* ---------- Home: modules ---------- */
.module-list { display: flex; flex-direction: column; gap: 12px; }
.module-icon { color: #fff; font-size: 30px; box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
.module-icon .hanzi-text { font-weight: 700; }
.more-coming {
    text-align: center; margin-top: 18px;
    font-family: var(--font-ui); font-size: 12px; color: var(--text-muted);
}

/* ---------- Home: set list ---------- */
.new-set-card { border-left-color: var(--accent); border-style: dashed; border-left-style: solid; }
.new-set-plus {
    background: var(--bg-deep); color: var(--primary) !important;
    border: 2px dashed var(--primary); font-size: 26px !important; font-weight: 400 !important;
}
.set-num {
    background: linear-gradient(135deg, #CC0000, #8B0000);
    font-family: var(--font-hanzi) !important; font-size: 24px !important;
}
.set-meta { font-family: var(--font-ui); font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.set-preview {
    margin-top: 4px; font-size: 16px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Home: new set form ---------- */
.input-tabs { margin-bottom: 10px; }
.input-tabs .format-btn { padding: 14px 8px; gap: 4px; }
.input-tabs .format-btn span { font-size: 15px; }
.input-tabs .format-btn small { font-size: 11px; }
.input-tabs .format-btn.active {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    background: linear-gradient(135deg, #fef5f5, #fff);
}
.input-panel {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 18px;
    font-family: var(--font-body); font-size: 14px; line-height: 1.6; color: var(--text-secondary);
}
.input-panel .settings-help { margin-top: 10px; }
.upload-drop {
    display: flex; align-items: center; gap: 14px; cursor: pointer;
    padding: 16px; margin-bottom: 10px;
    border: 2px dashed var(--border-active); border-radius: var(--radius-md);
    background: var(--bg-surface); transition: border-color var(--transition);
}
.upload-drop:hover { border-color: var(--primary); }
.upload-drop small { color: var(--text-muted); }
.upload-icon { font-size: 30px; }
.upload-status { margin-top: 10px; font-family: var(--font-ui); font-size: 13px; min-height: 18px; }
.upload-status .ok { color: #116934; }
.upload-status .err { color: #b91c1c; }
.loading-dot {
    display: inline-block; width: 10px; height: 10px; margin-right: 6px;
    border: 2px solid var(--border-subtle); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -1px;
}
.zh-input { font-size: 22px; line-height: 1.5; resize: vertical; min-height: 84px; }
.chip-preview { margin: 10px 0 20px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.char-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: 18px; padding: 4px 6px 4px 12px;
    font-size: 20px; color: var(--secondary); box-shadow: var(--shadow-card);
}
.char-chip.static { padding: 4px 12px; }
.chip-x {
    border: none; background: transparent; color: var(--text-muted);
    font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 4px; border-radius: 50%;
}
.chip-x:hover { color: #dc2626; background: rgba(220,38,38,0.08); }
.chip-meta {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
    margin-top: 8px; font-family: var(--font-ui); font-size: 12px; color: var(--text-muted);
}
.chip-meta .over { color: #b91c1c; font-weight: 600; }
.new-set-meta { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.form-error {
    margin-top: 6px; padding: 10px 12px; border-radius: var(--radius-md);
    background: #fde2e2; color: #8a1f1f; font-family: var(--font-ui); font-size: 13px;
}

/* ---------- Home: round menu ---------- */
.set-chips { margin: -6px 0 18px; justify-content: center; }
.set-chips .char-chip { font-size: 18px; }
.round-list { padding: 0; }
.round-num { font-family: var(--font-hanzi) !important; font-size: 24px !important; }
.round-zh { font-size: 14px; color: var(--primary); margin-left: 4px; font-weight: 400; }
.round-card .topic-next { line-height: 1.45; }

.round-notice {
    background: #fff4de; color: #7a4b00; border: 1px solid rgba(200, 140, 0, 0.25);
    border-radius: var(--radius-md); padding: 10px 14px; margin-bottom: 14px;
    font-family: var(--font-ui); font-size: 13px; line-height: 1.5;
}

/* ---------- Round overlay header ---------- */
.round-header-actions { display: flex; align-items: center; gap: 8px; margin-right: 10px; }
.round-header-actions:empty { display: none; }
.round-progress-bar { flex: 1; height: 4px; background: var(--border-subtle); border-radius: 2px; overflow: hidden; }
.round-progress-bar > div { height: 100%; background: var(--primary); transition: width 0.3s ease; }
.refresh-btn {
    font-family: var(--font-ui); font-size: 12px; font-weight: 600;
    background: var(--bg-surface); color: var(--primary);
    border: 1px solid var(--primary); border-radius: 16px; padding: 6px 12px; cursor: pointer;
}
.refresh-btn:active { transform: scale(0.97); }
.points-pill {
    font-family: var(--font-ui); font-size: 13px; font-weight: 700;
    background: var(--accent); color: #fff; border-radius: 14px; padding: 5px 12px;
    white-space: nowrap;
}
.link-btn {
    background: none; border: none; cursor: pointer; padding: 4px 0;
    font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--primary);
    text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- Round body ---------- */
.round-loading { text-align: center; padding: 40px 22px; }
.round-loading p { font-family: var(--font-display); font-style: italic; color: var(--text-secondary); }
.assessment-progress-label { margin-bottom: 10px; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-top .assessment-type-badge { margin-bottom: 0; }
.round-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.round-nav .btn-primary, .round-nav .btn-secondary { min-width: 120px; }
.round-nav .btn-secondary:disabled { opacity: 0.35; pointer-events: none; }

.hanzi-xl {
    font-family: var(--font-hanzi); font-size: 88px; line-height: 1.15;
    text-align: center; color: var(--secondary); margin: 6px 0 2px; word-break: keep-all;
}
.pinyin-lg {
    font-family: var(--font-ui); font-size: 22px; font-weight: 600; color: var(--primary);
    text-align: center; letter-spacing: 0.5px;
}
.meaning-en { font-family: var(--font-body); font-size: 16px; color: var(--text-secondary); margin-top: 4px; }
.from-word, .stroke-facts { font-family: var(--font-ui); font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.from-word .hanzi-text, .stroke-facts .hanzi-text { font-size: 15px; color: var(--secondary); }
.instruction { font-family: var(--font-body); font-size: 15px; color: var(--text-secondary); margin: 6px 0 12px; }
.display-zh {
    font-family: var(--font-hanzi); font-size: 44px; text-align: center; color: var(--secondary);
    margin: 4px 0 18px; line-height: 1.35;
}
.prompt-zh { font-size: 16px; color: var(--text-secondary); margin-top: 4px; }
.points-worth { font-family: var(--font-ui); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.earned { float: right; font-family: var(--font-ui); font-size: 13px; }

/* Tones */
.tone-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0; }
.tone-row.left { justify-content: flex-start; }
.tone-chip {
    font-family: var(--font-ui); font-size: 11px; color: var(--text-secondary);
    background: var(--bg-deep); border-radius: 10px; padding: 3px 9px;
}

.sandhi-tip {
    text-align: center; font-family: var(--font-ui); font-size: 12px; color: #7a4b00;
    background: #fff4de; border-radius: var(--radius-sm); padding: 6px 10px; margin: 4px auto 0; max-width: 460px;
}

/* Speak buttons */
.speak-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.speak-row.left { justify-content: flex-start; margin: 10px 0 0; }
.speak-btn {
    font-family: var(--font-ui); font-size: 13px; font-weight: 600;
    background: var(--bg-surface); color: var(--secondary);
    border: 1px solid var(--border-subtle); border-radius: 18px; padding: 7px 14px; cursor: pointer;
    transition: all var(--transition);
}
.speak-btn:hover { border-color: var(--primary); color: var(--primary); }
.speak-btn.speaking { background: var(--primary); color: #fff; border-color: var(--primary); }
.pinyin-lg .speak-btn { padding: 3px 9px; font-size: 13px; vertical-align: 3px; }

/* Mic */
.mic-zone { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 14px 0 6px; }
.mic-btn {
    width: 76px; height: 76px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(204, 0, 0, 0.3); transition: transform var(--transition);
}
.mic-btn:active { transform: scale(0.95); }
.mic-btn svg { pointer-events: none; }
.mic-btn.listening { animation: pulsePlay 1.2s ease-in-out infinite; background: #e11d48; }
.mic-label { font-family: var(--font-ui); font-size: 13px; color: var(--text-secondary); text-align: center; }

/* Options */
.option-grid { display: flex; flex-direction: column; }
.option-grid.zh-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-grid.zh-options .mcq-option { margin-bottom: 0; }
.mcq-option.hanzi-option {
    font-family: var(--font-hanzi); font-size: 26px; text-align: center; padding: 14px 10px;
}

/* Bilingual explanations */
.bilingual {
    margin-top: 10px; padding: 10px 12px;
    background: rgba(255, 255, 255, 0.65); border-left: 3px solid var(--accent);
    border-radius: 4px; color: var(--text-primary);
}
.bi-label {
    font-family: var(--font-ui); font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-muted); margin: 0 0 6px;
}
.bi-row { display: flex; gap: 8px; align-items: baseline; font-size: 14px; line-height: 1.55; }
.bi-row + .bi-row { margin-top: 6px; }
.bi-row .hanzi-text { font-size: 16px; }
.bi-tag {
    flex: none; font-family: var(--font-ui); font-size: 10px; font-weight: 700;
    background: var(--secondary); color: #fff; border-radius: 3px; padding: 1px 5px;
}
.bi-row.zh .bi-tag, .bi-row:nth-child(n+2) .bi-tag { background: var(--primary); }
.feedback-answer strong { font-size: 15px; }

/* Writing */
.write-meta { text-align: center; }
.writer-wrap { display: flex; justify-content: center; margin: 14px 0 8px; }
.writer-wrap.small { margin: 10px 0 0; }
.writer-grid {
    background-color: #fffdf8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cg stroke='%23d9a3a3' stroke-width='0.6' stroke-dasharray='2.5 2' fill='none'%3E%3Cline x1='50' y1='0' x2='50' y2='100'/%3E%3Cline x1='0' y1='50' x2='100' y2='50'/%3E%3Cline x1='0' y1='0' x2='100' y2='100'/%3E%3Cline x1='100' y1='0' x2='0' y2='100'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 100% 100%;
    border: 2px solid #CC0000; border-radius: 4px;
    touch-action: none; box-shadow: var(--shadow-card);
}
.write-status {
    text-align: center; font-family: var(--font-ui); font-size: 13px; color: var(--text-secondary);
    min-height: 20px; margin-bottom: 10px;
}
.write-status.ok { color: #116934; font-weight: 600; }
.write-status.warn { color: #9a5b00; }
.write-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode-btn {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
    padding: 10px 6px; cursor: pointer; font-family: var(--font-ui); font-size: 13px; font-weight: 600;
    color: var(--secondary); transition: all var(--transition);
}
.mode-btn small { font-family: var(--font-hanzi); font-size: 13px; font-weight: 400; color: var(--text-muted); }
.mode-btn:hover { border-color: var(--primary); }
.mode-btn.mode-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.mode-btn.mode-primary small { color: rgba(255,255,255,0.85); }
.mode-btn:disabled { opacity: 0.35; pointer-events: none; }
.result-chip { font-family: var(--font-ui); font-size: 11px; font-weight: 600; border-radius: 10px; padding: 3px 9px; }
.result-chip.ok { background: #d1f5de; color: #116934; }
.result-chip.warn { background: #fff0d0; color: #7a4b00; }

/* Flashcards */
.flashcard { text-align: center; }
.flash-back { text-align: left; margin-top: 10px; }
.flash-back .bi-label { margin-top: 14px; }
.flip-btn { margin-top: 14px; width: 100%; }
.word-list { display: flex; flex-direction: column; gap: 6px; }
.word-row {
    display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center;
    padding: 6px 10px; background: var(--bg-surface); border-radius: var(--radius-sm);
}
.word-zh { font-size: 20px; color: var(--secondary); }
.word-py { font-family: var(--font-ui); font-size: 13px; color: var(--primary); }
.word-en { font-size: 13px; color: var(--text-secondary); }
.word-row .speak-btn { padding: 3px 8px; }

/* Sentences */
.sentence-display {
    font-size: 30px; line-height: 1.6; text-align: center; color: var(--secondary);
    margin: 8px 0 6px; word-break: break-all;
}
.blank {
    display: inline-block; color: var(--primary); border-bottom: 2px solid var(--primary);
    min-width: 1.6em; letter-spacing: -2px;
}
.target-hl { color: var(--primary); font-weight: 700; background: rgba(204, 0, 0, 0.08); border-radius: 3px; padding: 0 2px; }
.hint-zone { text-align: center; margin-bottom: 14px; }
.sentence-hint { margin-top: 6px; font-style: italic; color: var(--text-secondary); font-size: 14px; }
.sentence-full { font-size: 22px; margin-top: 6px; color: var(--secondary); }
.sentence-py { font-family: var(--font-ui); font-size: 13px; color: var(--primary); margin-top: 2px; }
.sentence-en { font-size: 14px; color: var(--text-secondary); margin-top: 2px; font-style: italic; }

/* Pinyin typing */
.type-row { display: flex; gap: 8px; }
.type-row .assessment-input { flex: 1; font-size: 18px; }
.type-row .btn-primary { flex: none; }

/* Summary */
.miss-list { display: flex; flex-direction: column; gap: 10px; }
.miss-item {
    background: var(--bg-card); border: 1px solid var(--border-subtle); border-left: 3px solid #dc2626;
    border-radius: var(--radius-md); padding: 12px 14px; box-shadow: var(--shadow-card);
}
.miss-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--secondary); margin-bottom: 4px; }
.miss-title .hanzi-text { font-size: 18px; }
.miss-hanzi { font-size: 26px !important; margin-right: 4px; }
.miss-body { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; }
.miss-yours { color: #8a1f1f; }
.miss-correct { color: #116934; }
.all-clear {
    text-align: center; font-family: var(--font-display); font-size: 17px; color: #116934;
    padding: 18px; background: #d1f5de; border-radius: var(--radius-md);
}

/* ---------- Sets / Progress ---------- */
.set-item .session-item-title { margin-bottom: 2px; }
.set-item-name { font-family: var(--font-display); font-size: 15px; color: var(--secondary); }
.set-item .set-preview { white-space: normal; margin: 4px 0 6px; font-size: 17px; }
.set-progress-header {
    background: linear-gradient(135deg, #CC0000, #8B0000);
    justify-content: space-between;
}
.set-progress-date { font-family: var(--font-ui); font-size: 11px; font-weight: 400; opacity: 0.85; }
.round-icon-sm { color: var(--primary); font-size: 16px; margin-right: 4px; }
.progress-round-stat { font-family: var(--font-ui); font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

/* ---------- Small screens ---------- */
@media (max-width: 520px) {
    .hanzi-xl { font-size: 72px; }
    .display-zh { font-size: 36px; }
    .sentence-display { font-size: 25px; }
    .new-set-meta { grid-template-columns: 1fr; gap: 0; }
    .slideshow-lang-indicator { display: none; }
    .round-nav .btn-primary, .round-nav .btn-secondary { min-width: 0; flex: 1; }
    .word-row { grid-template-columns: auto 1fr auto; }
    .word-row .word-en { grid-column: 1 / -1; grid-row: 2; }
    .input-tabs .format-btn small { display: none; }
}

/* =============================================================
   On-screen Chinese keyboard
   ============================================================= */
body.kb-enabled [data-kb] { padding-right: 44px; }
body.kb-open #app-content { padding-bottom: calc(var(--kb-h, 300px) + 16px); }
body.kb-open #round-viewport { padding-bottom: calc(var(--kb-h, 300px) + 16px); }

.kb-toggle {
    position: fixed; z-index: 360; width: 32px; height: 32px;
    border-radius: 8px; border: 1px solid var(--primary);
    background: #fff; color: var(--primary); cursor: pointer;
    font-size: 17px; font-weight: 700; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(204, 0, 0, 0.18);
}
.kb-toggle:hover { background: var(--primary); color: #fff; }
.kb-inline {
    display: inline-block; border: 1px solid var(--primary); color: var(--primary);
    border-radius: 4px; padding: 0 4px; font-weight: 700; line-height: 1.3;
}

.zh-kb {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 350;
    background: #e9e3d8; border-top: 2px solid var(--primary);
    padding: 6px 6px calc(8px + var(--safe-bottom));
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12);
    user-select: none; -webkit-user-select: none; touch-action: manipulation;
    animation: kbUp 0.18s ease-out;
}
@keyframes kbUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.zh-kb > * { max-width: 760px; margin-left: auto; margin-right: auto; }

.kb-top { display: flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: 6px; }
.kb-compose {
    flex: none; max-width: 38%; min-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: var(--font-ui); font-size: 15px; font-weight: 600; color: var(--primary); padding: 0 6px;
}
.kb-placeholder { color: var(--text-muted); font-weight: 400; font-size: 12px; }
.kb-cands {
    flex: 1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.kb-cands::-webkit-scrollbar { display: none; }
.kb-cand {
    flex: none; min-width: 40px; height: 40px; padding: 0 10px;
    border: none; border-radius: 8px; background: #fff; color: var(--secondary);
    font-size: 22px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.kb-cands .kb-cand:first-child { background: var(--primary); color: #fff; }
.kb-cand:active { transform: scale(0.95); }
.kb-more {
    flex: none; width: 36px; height: 40px; border: none; border-radius: 8px;
    background: #fff; color: var(--text-secondary); font-size: 16px; cursor: pointer;
}
.kb-cand-grid {
    display: flex; flex-wrap: wrap; gap: 4px; max-height: 170px; overflow-y: auto;
    padding: 4px 0 8px; margin-bottom: 4px; border-bottom: 1px solid rgba(0,0,0,0.08);
}

.kb-keys { display: flex; flex-direction: column; gap: 6px; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.kb-row-2 { padding: 0 4.5%; }
.kb-key {
    flex: 1 1 0; min-width: 0; height: 44px;
    border: none; border-radius: 7px; background: #fff; color: var(--secondary);
    font-family: var(--font-ui); font-size: 18px; cursor: pointer;
    box-shadow: 0 1px 0 rgba(0,0,0,0.25);
    display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.kb-key:active { background: #f1d9d9; transform: translateY(1px); }
.kb-wide { flex-grow: 1.5; }
.kb-fn { background: #d6cec1; font-size: 17px; }
.kb-fn.hanzi-text { font-size: 19px; font-weight: 700; color: var(--primary); }
.kb-on { background: var(--primary); color: #fff; }
.kb-space { flex-grow: 3.5; font-size: 12px; color: var(--text-secondary); }
.kb-tone-key { background: #f8efe0; }
.kb-tone { font-size: 20px; font-weight: 700; color: var(--primary); height: 14px; }
.kb-tone-key small { font-size: 9px; color: var(--text-muted); margin-top: 3px; }

@media (max-width: 420px) {
    .zh-kb { padding-left: 3px; padding-right: 3px; }
    .kb-row { gap: 4px; }
    .kb-key { height: 42px; font-size: 16px; border-radius: 6px; }
    .kb-cand { font-size: 20px; min-width: 36px; height: 38px; padding: 0 8px; }
}

/* Settings: keyboard option */
.kb-setting-options { display: flex; flex-direction: column; gap: 8px; }
.kb-option {
    display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
    background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
    padding: 10px 12px; font-family: var(--font-ui); font-size: 14px;
}
.kb-option input { margin-top: 3px; accent-color: var(--primary); }
.kb-option small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.kb-option:has(input:checked) { border-color: var(--primary); box-shadow: var(--shadow-glow); }

/* In-app prompt dialog */
.prompt-dialog { text-align: left; }
.prompt-dialog h3 { text-align: center; margin-bottom: 14px; }

/* Sentence Usage — difficulty levels */
.level-bar {
    display: flex; align-items: stretch; gap: 6px; margin-bottom: 4px;
}
.level-label {
    align-self: center; flex: none; margin-right: 2px;
    font-family: var(--font-ui); font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--text-muted);
}
.level-btn {
    flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
    background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
    padding: 7px 10px; cursor: pointer; text-align: left; transition: all var(--transition);
    font-family: var(--font-ui); font-size: 12px; color: var(--text-secondary);
}
.level-btn strong {
    flex: none; width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-deep); color: var(--secondary); font-size: 13px;
}
.level-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.level-btn:hover { border-color: var(--primary); }
.level-btn.active { border-color: var(--primary); box-shadow: var(--shadow-glow); color: var(--secondary); font-weight: 600; }
.level-btn.active strong { background: var(--primary); color: #fff; }
.level-desc { font-family: var(--font-ui); font-size: 12px; color: var(--text-muted); margin: 0 0 14px 2px; }
.sentence-display.long { font-size: 24px; line-height: 1.7; text-align: left; }

@media (max-width: 520px) {
    .level-label { display: none; }
    .level-btn { flex-direction: column; gap: 3px; padding: 6px 4px; text-align: center; }
    .level-btn span { font-size: 11px; }
    .sentence-display.long { font-size: 21px; }
}
