/* ============================================================
   C-008 — National CBT 首頁模式選擇密度
   Scope：僅 #modeSelectScreen presentation；不修改 mode/runtime contract。
   ============================================================ */

#modeSelectScreen #nationalCbtViewModeGroup {
    margin: 0 0 10px;
    padding: 6px 9px;
    box-sizing: border-box;
}

#modeSelectScreen #nationalCbtViewModeGroup .ncbt-view-title {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
}

#modeSelectScreen #nationalCbtViewModeGroup .ncbt-view-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

#modeSelectScreen #nationalCbtViewModeGroup .ncbt-view-btn {
    width: auto;
    min-width: 0;
    height: 28px;
    padding: 0 11px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
}

#modeSelectScreen #nationalCbtViewModeDescription {
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.45;
    color: #7a8491;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* C-010：即使舊版 Learning Ledger 仍將入口 append 到 mode-footer，
   presentation 也固定把同一入口排在考試日期之前，避免部署快取造成舊位置殘留。 */
#modeSelectScreen .mode-footer #nationalCbtLearningRecordButton {
    order: -1;
    align-self: flex-start;
    margin-top: 0 !important;
}

/* CBT-023：Practice-only Learning UI 在 shared mode-select 預設 fail-closed。
   只使用既有 body view-mode presentation state；不新增 runtime / state owner。 */
#modeSelectScreen [data-practice-learning-entry="true"] {
    display: none !important;
}

body[data-national-cbt-view-mode="practice"] #modeSelectScreen [data-practice-learning-entry="true"] {
    display: inline-block !important;
}

@media (max-width: 700px) {
    #modeSelectScreen #nationalCbtViewModeGroup .ncbt-view-actions {
        display: flex;
        grid-template-columns: none;
        gap: 5px;
        flex-wrap: nowrap;
    }

    #modeSelectScreen #nationalCbtViewModeGroup .ncbt-view-btn {
        width: auto;
        min-width: 0;
    }

    #modeSelectScreen #nationalCbtViewModeDescription {
        white-space: normal;
    }
}
