/* ================================================================
   長文読解クイズ CSS — eiken-quiz と同じ構造、アクセント #5f72bd
   ================================================================ */

/* ── ラッパー ── */
.reading-quiz-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ── スタート画面 ── */
.rq-start-screen {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}
.rq-start-inner {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 48px 48px 40px;
    text-align: center;
    max-width: 480px;
    width: 100%;
}
.rq-start-badge {
    display: inline-block;
    background: #5f72bd;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 18px;
    border-radius: 20px;
    margin-bottom: 16px;
}
.rq-start-section {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 28px;
}
.rq-start-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 36px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 12px;
}
.rq-start-stat { text-align: center; }
.rq-start-stat-num   { display: block; font-size: 22px; font-weight: 700; color: #5f72bd; }
.rq-start-stat-label { display: block; font-size: 11px; color: #999; margin-top: 2px; }
.rq-start-btn {
    background: #5f72bd;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
}
.rq-start-btn:active { opacity: 0.85; }

/* ── 結果グリッド（番号＋⭕/❌） ── */
.rq-result-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 10px 8px 4px;
    margin-bottom: 4px;
}
.rq-result-grid-item {
    position: relative;
    width: 40px;
    height: 40px;
}
.rq-result-grid-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eef0fb;
    font-size: 14px;
    font-weight: 700;
    color: #5f72bd;
}
.rq-result-grid-num.ok { background: #e8f5e9; color: #2e7d32; }
.rq-result-grid-num.ng { background: #fff3f3; color: #c62828; }
.rq-result-grid-mark {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 13px;
    line-height: 1;
    pointer-events: none;
}

/* ================================================================
   スマホ専用レイアウト（〜767px）
   上固定ヘッダー / 中央スクロール / 下固定バー
   ================================================================ */

/* 上固定ヘッダー */
.rq-mob-header {
    display: none; /* PC では非表示、スマホでのみ表示 */
}
.rq-mob-prog-wrap {
    display: none;
}

/* 中央スクロールエリア */
.rq-mob-scroll { display: contents; }

/* 下部バー（スマホ時に固定） */
.rq-bottom-bar { display: none; }

/* タイマーテキスト（スマホ用ヘッダー内） */
.rq-timer-text {
    font-size: 12px;
    color: #888;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ── パッセージ ── */
.rq-passage-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 14px;
}
.rq-passage-label {
    font-size: 10px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}
.rq-passage-eng-title {
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    color: #1a1a1a;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
    line-height: 1.5;
}
.rq-passage-ja-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}
.rq-passage-text p {
    font-size: 14px;
    line-height: 1.9;
    color: #222;
    margin-bottom: 10px;
}
.rq-passage-text p:last-child { margin-bottom: 0; }

/* 空欄バッジ */
.rq-blank {
    display: inline-block;
    background: #eef0fb;
    color: #5f72bd;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 9px;
    font-size: 13px;
    border: 1.5px solid #c5caed;
    min-width: 32px;
    text-align: center;
    vertical-align: baseline;
}
.rq-blank.current {
    background: #5f72bd;
    color: #fff;
    border-color: #5f72bd;
    animation: rq-blink 1s ease-in-out infinite alternate;
}
@keyframes rq-blink {
    from { opacity: 1; }
    to   { opacity: 0.7; }
}

/* ── 問題文カード ── */
.rq-question-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 12px;
}
.rq-q-label {
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

/* ── 選択肢 ── */
.rq-choices-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rq-choice-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    text-align: left;
    color: #1a1a1a;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
    width: 100%;
    box-sizing: border-box;
}
.rq-choice-btn:hover:not(.disabled) {
    border-color: #bbb;
    background: #fafafa;
}
.rq-choice-btn:active:not(.disabled) { transform: scale(0.99); }
.rq-choice-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 500; color: #666;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.rq-choice-btn.correct { border-color: #388e3c; background: #f1f8e9; }
.rq-choice-btn.correct .rq-choice-num { background: #388e3c; color: #fff; }
.rq-choice-btn.wrong   { border-color: #c62828; background: #fce4ec; }
.rq-choice-btn.wrong .rq-choice-num   { background: #c62828; color: #fff; }
.rq-choice-btn.disabled { cursor: default; }

/* ── フィードバック ── */
.rq-feedback {
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.7;
    display: none;
    margin-top: 12px;
}
.rq-feedback.show { display: block; }
.rq-feedback.correct { background: #f1f8e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.rq-feedback.wrong   { background: #fce4ec; color: #880e4f; border: 1px solid #ef9a9a; }

/* 解説・日本語訳 */
.rq-extra-info  { margin-top: 10px; border-top: 1px solid rgba(0,0,0,0.08); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.rq-translation,
.rq-explanation { font-size: 13px; color: #444; line-height: 1.6; }
.rq-extra-label { display: inline-block; font-size: 10px; font-weight: 600; background: rgba(0,0,0,0.08); border-radius: 3px; padding: 1px 6px; margin-right: 6px; color: #555; vertical-align: middle; }
.rq-highlight   { color: #e53935; font-weight: 600; }
.rq-trans-row .rq-pc-exp-label,
.rq-trans-row .rq-mob-exp-label { display: block; margin-bottom: 4px; }
.rq-trans-body { display: block; width: 100%; }
.rq-choices-ja-list { list-style: none; margin: 0; padding: 0; }
.rq-choices-ja-list li { padding: 1px 0; }
.rq-choice-ja-correct { color: #1a7a1a; font-weight: 600; }

/* ── 次へボタン ── */
.rq-next-btn {
    background: #5f72bd;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    width: 100%;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: none;
    margin-top: 12px;
    transition: opacity 0.15s;
}
.rq-next-btn.show { display: block; }
.rq-next-btn:active { opacity: 0.85; }

/* ── スマホ用テキストリスト＋数字ボタン ── */
.rq-choice-text-list {
    margin-bottom: 6px;
}
.rq-choice-text-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 3px 16px;
    font-size: 16px;
    color: #1a1a1a;
    line-height: 1.5;
}
.rq-choice-text-num {
    font-size: 13px;
    font-weight: 600;
    color: #aaa;
    min-width: 14px;
    flex-shrink: 0;
}
.rq-choice-text-row.correct .rq-choice-text-num,
.rq-choice-text-row.correct .rq-choice-text-content { color: #388e3c; font-weight: 500; }
.rq-choice-text-row.wrong   { opacity: 0.5; }
.rq-choice-text-row.wrong .rq-choice-text-content   { text-decoration: line-through; }

.rq-num-btn-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 4px;
}
.rq-num-btn {
    height: 45px;
    font-size: 24px;
    font-weight: 700;
    color: #555;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}
.rq-num-btn:active:not(.disabled) { background: #f0f0f0; }
.rq-num-btn.selected { background: #5f72bd; color: #fff; border-color: #5f72bd; }
.rq-num-btn.correct  { background: #f1f8e9; color: #388e3c; border-color: #388e3c; }
.rq-num-btn.wrong    { background: #fce4ec; color: #c62828; border-color: #c62828; }
.rq-num-btn.disabled { cursor: default; }

/* ── 段落区切り画面 ── */
.rq-para-break { display: none; }
.rq-para-break.show { display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.rq-para-break-inner {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 40px 48px;
    text-align: center;
}
.rq-para-break-num   { font-size: 28px; font-weight: 600; color: #5f72bd; margin-bottom: 12px; }
.rq-para-break-score { font-size: 18px; color: #333; margin-bottom: 28px; }
.rq-pb-score         { font-size: 36px; font-weight: 600; color: #388e3c; }
.rq-para-next-btn {
    background: #5f72bd; color: #fff; border: none;
    border-radius: 12px; padding: 14px 32px;
    font-size: 16px; font-weight: 500; font-family: inherit;
    cursor: pointer;
}
.rq-para-next-btn:active { opacity: 0.85; }

/* ── 結果画面 ── */
.rq-result { display: none; }
.rq-result.show { display: block; }
.rq-result-header {
    background: none;
    border-radius: 0;
    padding: 5px 0;
    text-align: center;
    color: #1a1a1a;
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}
.rq-result-score-big   { font-size: 28px; font-weight: 700; line-height: 1; }
.rq-result-score-label { font-size: 15px; font-weight: 500; }
.rq-result-title       { display: none; }
.rq-result-sub         { display: none; }

.rq-answer-summary { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.rq-ans-row { padding: 10px 14px; border-radius: 10px; border: 1px solid #e0e0e0; }
.rq-ans-row.ok { border-color: #a5d6a7; background: #f1f8e9; }
.rq-ans-row.ng { border-color: #e0e0e0; background: #fff; }
.rq-ans-q  { font-size: 12px; color: #888; }
.rq-ans-val { font-size: 13px; font-weight: 500; margin-top: 3px; }
.rq-ans-correct { font-size: 13px; font-weight: 500; margin-top: 4px; }
.c-ok { color: #388e3c; } .c-ng { color: #c62828; }

/* スマホ結果画面：解説・日本語訳 */
.rq-mob-exp {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.rq-mob-exp-row {
    font-size: 12px;
    color: #555;
    line-height: 1.6;
}
.rq-mob-exp-label {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
    padding: 1px 5px;
    margin-right: 5px;
    color: #555;
    vertical-align: middle;
}

/* 全文日本語訳 */
.rq-full-trans { margin: 12px 0; }
.rq-full-trans-title { font-size: 13px; font-weight: 700; color: #5f72bd; margin-bottom: 8px; border-bottom: 1.5px solid #e0e0e0; padding-bottom: 4px; }
.rq-full-trans-para { font-size: 13px; line-height: 1.75; color: #333; margin-bottom: 10px; background: #f8f8f8; border-radius: 8px; padding: 10px 12px; }
.rq-full-trans-label { display: block; font-size: 11px; font-weight: 600; color: #5f72bd; margin-bottom: 4px; }

.rq-result-btn-row { display: flex; gap: 12px; margin-top: 4px; }
.rq-result-restart {
    background: #5f72bd; color: #fff; border: none;
    border-radius: 12px; padding: 14px;
    font-size: 15px; font-weight: 500; font-family: inherit;
    cursor: pointer; flex: 1;
}
.rq-result-back {
    background: #f0f0f0; color: #666;
    border: 1px solid #ddd;
    border-radius: 12px; padding: 14px;
    font-size: 14px; font-family: inherit;
    cursor: pointer; flex: 1;
    text-decoration: none; display: flex; align-items: center; justify-content: center;
}

/* ================================================================
   PC / タブレット 2カラムレイアウト（≥768px）
   ================================================================ */
@media (min-width: 768px) {
    .rq-pc-wrap {
        display: flex;
        border: 1px solid #e8e8e8;
        border-radius: 0;
        overflow: hidden;
        min-height: 400px;
        background: #fff;
        width: 100%;
        margin-bottom: 80px;
        /* zoom率に関係なく画面内に収める（topbar≒54px） */
        max-height: calc(100vh - 54px);
    }
    /* 左: パッセージ 70% */
    .rq-pc-passage {
        flex: 7;
        overflow-y: auto;
        padding: 20px 28px;
        border-right: 1px solid #e8e8e8;
    }
    .rq-pc-passage .rq-passage-text p {
        font-size: 15px;
        line-height: 2;
        color: #222;
        margin-bottom: 12px;
    }
    .rq-pc-passage .rq-passage-eng-title { font-size: 17px; margin-bottom: 18px; }
    /* 右: 問題リスト 30% */
    .rq-pc-questions {
        flex: 3;
        width: auto;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: relative;
    }
    .rq-pc-questions-scroll {
        flex: 1;
        overflow-y: auto;
        padding: 62px 14px 72px;
    }
    .rq-pc-q-block {
        padding: 14px 16px;
        border-bottom: 1px solid #f0f0f0;
    }
    .rq-pc-q-label {
        font-size: 11px;
        font-weight: 600;
        color: #5f72bd;
        margin-bottom: 8px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }
    .rq-pc-choice-list {
        margin-bottom: 8px;
    }
    .rq-pc-choice-text-row {
        display: flex;
        align-items: flex-start;
        gap: 6px;
        font-size: 12px;
        color: #444;
        line-height: 1.5;
        padding: 3px 0;
    }
    .rq-pc-choice-text-num {
        font-weight: 600;
        color: #888;
        flex-shrink: 0;
        min-width: 22px;
    }
    .rq-pc-choice-text-row.correct .rq-pc-choice-text-num,
    .rq-pc-choice-text-row.correct .rq-pc-choice-text-content { color: #388e3c; font-weight: 500; }
    .rq-pc-choice-text-row.wrong   { opacity: 0.5; }
    .rq-pc-choice-text-row.wrong .rq-pc-choice-text-content   { text-decoration: line-through; }

    .rq-pc-num-row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 4px;
        flex-wrap: wrap;
    }
    .rq-pc-num-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 1.5px solid #5f72bd;
        background: #fff;
        color: #5f72bd;
        font-size: 15px;
        font-weight: 700;
        cursor: pointer;
        font-family: inherit;
        transition: background 0.15s, color 0.15s;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        padding: 0;
    }
    .rq-pc-num-btn:hover:not(:disabled) { background: #eef0fb; }
    .rq-pc-num-btn.selected  { background: #5f72bd; color: #fff; }
    .rq-pc-num-btn.correct   { background: #388e3c; color: #fff; border-color: #388e3c; }
    .rq-pc-num-btn.wrong     { background: #c62828; color: #fff; border-color: #c62828; }
    .rq-pc-num-btn:disabled  { cursor: default; }

    /* 採点バー（右カラム下から20pxに固定） */
    .rq-pc-submit-bar {
        position: absolute;
        bottom: 20px;
        left: 14px;
        right: 14px;
        background: transparent;
    }
    .rq-pc-submit-btn {
        width: 100%;
        padding: 13px;
        background: #5f72bd;
        color: #fff;
        border: none;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        transition: opacity 0.15s;
        box-shadow: 0 2px 12px rgba(95,114,189,0.3);
    }
    .rq-pc-submit-btn:hover  { opacity: 0.9; }
    .rq-pc-submit-btn:active { opacity: 0.8; }
    .rq-pc-submit-btn.done   { background: #388e3c; box-shadow: 0 2px 12px rgba(56,142,60,0.3); cursor: default; }

    /* PC: 採点後の「もう一度」ボタン */
    .rq-pc-retry-btn {
        flex: 1;
        padding: 13px;
        background: #388e3c;
        color: #fff;
        border: none;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        transition: opacity 0.15s;
        box-shadow: 0 2px 12px rgba(56,142,60,0.3);
    }
    .rq-pc-retry-btn:hover  { opacity: 0.9; }
    .rq-pc-retry-btn:active { opacity: 0.8; }

    /* PC: 採点後の「一覧に戻る」ボタン */
    .rq-pc-back-btn {
        flex: 1;
        padding: 13px;
        background: #5f72bd;
        color: #fff;
        border: none;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        transition: opacity 0.15s;
        box-shadow: 0 2px 12px rgba(95,114,189,0.3);
        text-decoration: none;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .rq-pc-back-btn:hover  { opacity: 0.9; text-decoration: none; color: #fff; }
    .rq-pc-back-btn:active { opacity: 0.8; }

    /* PC: A+フォントサイズボタン（topbar内右端） */
    .rq-pc-font-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: #e53935;
        color: #fff;
        border: none;
        font-size: 11px;
        font-weight: 700;
        font-family: inherit;
        cursor: pointer;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 6px rgba(0,0,0,0.25);
        line-height: 1;
        transition: transform 0.1s;
        margin-left: 12px;
    }
    .rq-pc-font-btn:active { transform: scale(0.92); }

    .rq-passage-font-btn {
        background: #e53935;
        color: #fff;
        border: none;
        border-radius: 6px;
        padding: 5px 12px;
        font-size: 12px;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        flex-shrink: 0;
        transition: opacity 0.1s;
    }
    .rq-passage-font-btn:active { opacity: 0.8; }

    /* PC: フォントサイズ段階（左パッセージ＋右選択肢テキスト両方） */
    .rq-pc-font-2 .rq-passage-text p { font-size: 16px !important; }
    .rq-pc-font-3 .rq-passage-text p { font-size: 18px !important; }
    .rq-pc-font-4 .rq-passage-text p { font-size: 20px !important; }
    .rq-pc-font-2 .rq-pc-choice-text-content,
    .rq-pc-font-2 .rq-pc-choice-text-num  { font-size: 13px !important; }
    .rq-pc-font-3 .rq-pc-choice-text-content,
    .rq-pc-font-3 .rq-pc-choice-text-num  { font-size: 14px !important; }
    .rq-pc-font-4 .rq-pc-choice-text-content,
    .rq-pc-font-4 .rq-pc-choice-text-num  { font-size: 15px !important; }

    /* PC: タイマー中央マーカー（準2級） */
    .rq-timer-center-mark {
        position: absolute;
        top: 0;
        left: 50%;
        width: 2px;
        height: 100%;
        background: rgba(255,255,255,0.55);
        transform: translateX(-50%);
        pointer-events: none;
    }

    /* PC: 解説ブロック */
    .rq-pc-explanation {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #f0f0f0;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .rq-pc-exp-row {
        font-size: 11px;
        color: #555;
        line-height: 1.6;
    }
    .rq-pc-exp-label {
        display: inline-block;
        font-size: 9px;
        font-weight: 600;
        background: rgba(0,0,0,0.08);
        border-radius: 3px;
        padding: 1px 5px;
        margin-right: 5px;
        color: #555;
        vertical-align: middle;
    }

    /* PC: 全文日本語訳（左カラム下部） */
    .rq-pc-full-trans {
        margin-top: 20px;
        padding-top: 16px;
        border-top: 2px solid #e8e8e8;
    }
    .rq-pc-full-trans-title {
        font-size: 12px;
        font-weight: 700;
        color: #5f72bd;
        margin-bottom: 10px;
        letter-spacing: 0.04em;
    }
    .rq-pc-full-trans-para {
        font-size: 13px;
        line-height: 1.8;
        color: #333;
        background: #f8f9ff;
        border-radius: 6px;
        padding: 10px 14px;
        margin-bottom: 8px;
    }
    .rq-pc-full-trans-label {
        display: block;
        font-size: 10px;
        font-weight: 600;
        color: #5f72bd;
        margin-bottom: 4px;
    }

    /* PC: パッセージカード（左カラム、青枠） */
    .rq-pc-para-card {
        border: 2px solid #5f72bd;
        border-radius: 8px;
        padding: 12px 16px;
        margin-bottom: 14px;
        position: relative;
    }
    .rq-pc-para-label {
        position: absolute;
        top: -10px;
        left: 12px;
        font-size: 11px;
        font-weight: 700;
        color: #5f72bd;
        background: #fff;
        padding: 0 6px;
        letter-spacing: 0.04em;
    }

    /* PC: パッセージカード内の日本語訳 */
    .rq-pc-para-trans {
        font-size: 12px;
        line-height: 1.75;
        color: #555;
        background: #f8f9ff;
        border-radius: 6px;
        padding: 8px 12px;
        margin-top: 10px;
    }

    /* PC: セット問題グループ枠（右カラム、青枠） */
    .rq-pc-group-wrap {
        border: 2px solid #5f72bd;
        border-radius: 8px;
        margin-bottom: 8px;
        position: relative;
        padding-top: 6px;
    }
    .rq-pc-group-label {
        position: absolute;
        top: -10px;
        left: 12px;
        font-size: 11px;
        font-weight: 700;
        color: #5f72bd;
        background: #fff;
        padding: 0 6px;
        letter-spacing: 0.04em;
    }
    .rq-pc-group-wrap .rq-pc-q-block { border-bottom: 1px solid #eef0fb; }
    .rq-pc-group-wrap .rq-pc-q-block:last-child { border-bottom: none; }

    /* PC: トップバー */
    .rq-topbar {
        background: #5f72bd;
        border-radius: 0;
        padding: 14px 24px;
        display: flex;
        align-items: center;
        gap: 16px;
        color: #fff;
        margin-bottom: 0;
        width: 100%;
        box-sizing: border-box;
    }
    .rq-topbar-info { display: flex; flex-direction: column; gap: 2px; }
    .rq-topbar-title { font-size: 14px; font-weight: 500; }
    .rq-topbar-sub   { font-size: 12px; opacity: 0.8; }
    .rq-topbar .rq-progress-area { flex: 1; }
    .rq-topbar .rq-timer-track {
        background: rgba(255,255,255,0.3);
        height: 5px;
        border-radius: 99px;
    }
    .rq-topbar .rq-timer-fill {
        background: #fff;
        height: 5px;
        border-radius: 99px;
        transition: width 1s linear;
    }
    .rq-topbar .rq-timer-fill.warn { background: #FFB3A0; }
}

/* ── スマホ ── */
@media (max-width: 767px) {
    /* クイズ中: ナビ・ヘッダー・ロゴを非表示 */
    body.rq-quiz-active header.header,
    body.rq-quiz-active .header,
    body.rq-quiz-active #g_nav,
    body.rq-quiz-active .g_nav-sp,
    body.rq-quiz-active #wpadminbar {
        display: none !important;
    }

    /* クイズUI: 全画面フレックスで上下固定・中スクロール */
    .rq-quiz-ui {
        position: fixed;
        inset: 0;
        display: flex;
        flex-direction: column;
        background: #f5f5f0;
        z-index: 9999;
        overflow: hidden;
    }

    /* 上固定ヘッダー */
    .rq-mob-header {
        display: flex;
        align-items: center;
        gap: 8px;
        background: #fff;
        padding: 10px 14px;
        min-height: 44px;
        flex-shrink: 0;
        border-bottom: 1px solid #e8e8e8;
    }
    .rq-mob-back {
        font-size: 28px;
        color: #5f72bd;
        background: none;
        border: none;
        cursor: pointer;
        line-height: 1;
        padding: 0 4px 0 0;
        flex-shrink: 0;
    }
    .rq-mob-title-wrap {
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .rq-mob-title {
        font-size: 14px;
        font-weight: 600;
        color: #1a1a1a;
    }
    .rq-mob-sub {
        font-size: 12px;
        color: #888;
        margin-left: 4px;
    }
    .rq-mob-counter {
        font-size: 13px;
        color: #888;
        flex-shrink: 0;
        font-variant-numeric: tabular-nums;
    }

    /* ヘッダー右側（カウンター＋タイマー） */
    .rq-mob-header-right {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 1px;
        flex-shrink: 0;
    }

    /* ヘッダー下の細いプログレスバー（問題進捗） */
    .rq-mob-prog-wrap {
        display: block;
        height: 3px;
        background: #e8e8e8;
        flex-shrink: 0;
    }
    .rq-mob-prog-bar {
        height: 3px;
        background: #5f72bd;
        transition: width 0.4s ease;
    }

    /* タイマーバー（問題進捗バーの直下） */
    .rq-mob-timer-wrap {
        display: block;
        height: 3px;
        background: #e8e8e8;
        flex-shrink: 0;
    }
    .rq-mob-timer-fill {
        height: 3px;
        background: #5f72bd;
        border-radius: 0;
        transition: width 1s linear;
        width: 100%;
    }
    .rq-mob-timer-fill.warn { background: #e53935; }

    /* 中央スクロール（パッセージのみ） */
    .rq-mob-scroll {
        display: block;
        flex: 1;
        overflow-y: auto;
        padding: 8px 10px 0;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    /* A+ フォントサイズボタン */
    .rq-font-btn {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: #e53935;
        color: #fff;
        border: none;
        font-size: 13px;
        font-weight: 700;
        font-family: inherit;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
        box-shadow: 0 2px 8px rgba(0,0,0,0.18);
        line-height: 1;
        transition: transform 0.1s;
    }
    .rq-font-btn:active { transform: scale(0.93); }

    /* フォントサイズ段階 */
    .rq-font-2 .rq-passage-text p,
    .rq-font-2 .rq-choice-text-content { font-size: 15px !important; line-height: 1.9 !important; }
    .rq-font-3 .rq-passage-text p,
    .rq-font-3 .rq-choice-text-content { font-size: 17px !important; line-height: 1.9 !important; }
    .rq-font-4 .rq-passage-text p,
    .rq-font-4 .rq-choice-text-content { font-size: 19px !important; line-height: 1.9 !important; }

    /* 下部バー（問題・選択肢・ボタン） */
    .rq-bottom-bar {
        display: block;
        background: #fff;
        border-top: 2px solid #c5caed;
        padding: 5px 12px 2px;
        flex-shrink: 0;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
    }

    /* 問題番号ナビ行（前へ | badge | 次へ） */
    .rq-q-nav-row {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        margin-top: 3px;
        margin-bottom: 3px;
    }
    .rq-nav-prev,
    .rq-nav-next {
        padding: 8px 12px;
        border-radius: 10px;
        border: 1.5px solid #e0e0e0;
        background: #fff;
        color: #5f72bd;
        font-size: 13px;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        transition: opacity 0.15s, background 0.15s, color 0.15s;
        white-space: nowrap;
    }
    .rq-nav-prev { justify-self: start; }
    .rq-nav-next { justify-self: end; background: #f0f0f0; color: #aaa; border-color: #e0e0e0; cursor: default; }
    .rq-nav-prev:disabled { color: #ccc; border-color: #ebebeb; cursor: default; }
    .rq-nav-next.active { background: #5f72bd; color: #fff; border-color: #5f72bd; cursor: pointer; }
    .rq-nav-next.active:active { opacity: 0.85; }
    .rq-nav-badge {
        text-align: center;
        line-height: 1;
    }
    .rq-nav-badge-status { display: none; }
    .rq-nav-badge-num {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 4px 14px;
        border-radius: 20px;
        background: #eef0fb;
        color: #5f72bd;
        font-weight: 700;
        font-size: 15px;
        border: 1.5px solid #c5caed;
        transition: background 0.2s, color 0.2s, border-color 0.2s;
        white-space: nowrap;
    }
    .rq-nav-badge-num.ok { background: #c8e6c9; color: #1b5e20; border-color: #a5d6a7; }
    .rq-nav-badge-num.ng { background: #ffcdd2; color: #b71c1c; border-color: #ef9a9a; }
    .rq-nav-badge-label { display: none; }

    /* 「隠す」ボタン */
    .rq-choices-toggle {
        display: inline-block;
        background: none;
        border: 1px solid #b8c4d8;
        border-radius: 10px;
        padding: 2px 7px;
        font-size: 10px;
        font-weight: 600;
        color: #555;
        cursor: pointer;
        margin-left: 6px;
        white-space: nowrap;
        vertical-align: middle;
        font-family: inherit;
        line-height: 1.5;
    }
    .rq-choices-toggle.is-hidden {
        background: #eef0fb;
        color: #5f72bd;
        border-color: #5f72bd;
    }
    /* 隠した時に選択肢・数字ボタンを非表示 */
    .rq-bottom-bar.rq-choices-hidden .rq-choices-wrap,
    .rq-bottom-bar.rq-choices-hidden .rq-num-btn-row {
        display: none !important;
    }

    /* 下バー内の選択肢リスト */
    .rq-bottom-bar .rq-choices-wrap {
        margin-bottom: 4px;
    }
    .rq-bottom-bar .rq-choice-text-list {
        margin-bottom: 0;
    }

    /* 下バー内の数字ボタン */
    .rq-bottom-bar .rq-num-btn-row {
        margin-bottom: 0;
    }

    /* 旧次へボタン（非表示） */
    .rq-bottom-bar .rq-next-btn { display: none !important; }

    /* 下バー内の次へボタン（残す場合のスタイル） */

    /* パッセージcard padding調整 */
    .rq-passage-card  { padding: 10px 10px; }
    .rq-passage-text p { font-size: 14px; line-height: 1.85; }

    .rq-para-break-inner { padding: 32px 24px; }
    .rq-result-score-big { font-size: 28px; }
    .rq-result-header { padding: 5px 0; }
}

/* 結果画面 パッセージトグル */
.rq-mob-passage-toggle {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    border: 1px solid #c5caed;
    border-radius: 20px;
    background: #eef0fb;
    color: #5f72bd;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.rq-mob-passage-detail {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.07);
}
.rq-mob-passage-eng {
    font-size: 12px;
    line-height: 1.8;
    color: #222;
    margin-bottom: 8px;
}
.rq-mob-passage-trans {
    font-size: 12px;
    line-height: 1.75;
    color: #555;
    background: #f8f9ff;
    border-radius: 6px;
    padding: 8px 10px;
}

/* 結果画面 A+ ボタン */
.rq-result-font-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e53935;
    color: #fff;
    border: none;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
/* 結果画面フォントサイズ段階 */
.rq-res-font-2 .rq-ans-row,
.rq-res-font-2 .rq-mob-exp-row  { font-size: 14px !important; }
.rq-res-font-3 .rq-ans-row,
.rq-res-font-3 .rq-mob-exp-row  { font-size: 16px !important; }
.rq-res-font-4 .rq-ans-row,
.rq-res-font-4 .rq-mob-exp-row  { font-size: 18px !important; }

/* ── スマホ結果画面: フルスクリーン固定 + ボタン sticky ── */
body.rq-result-active { overflow: hidden; }
body.rq-result-active .rq-result.show {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 0;
    background: #fff;
    z-index: 100;
    display: flex;
    flex-direction: column;
}
body.rq-result-active .rq-result-btn-row {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 10px 0 16px;
    margin-top: auto;
    border-top: 1px solid #f0f0f0;
}


/* ── セットタブナビゲーション ─────────────────────── */
.lq-set-tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.lq-set-tab-btn {
    padding: 5px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lq-set-tab-btn:hover { background: #e2e8f0; }
.lq-set-tab-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

