/* Riings screen layouts. Printed exam papers keep their original geometry. */
@media screen and (max-width: 1279px) {
    body.riings { min-width: 0; background: #fff; }
    :is(body.riings, .riings-page) *,
    :is(body.riings, .riings-page) *::before,
    :is(body.riings, .riings-page) *::after { box-sizing: border-box; }
    :is(body.riings, .riings-page) :is(img, video) { max-width: 100%; height: auto; }
    :is(body.riings, .riings-page) :is(input, select, textarea) { max-width: 100%; }
    :is(body.riings, .riings-page) :is(p, h1, h2, h3, h4, dd, .tit) { overflow-wrap: anywhere; }
    body.riings #wrap { min-width: 0; width: 100%; }
    :is(body.riings, .riings-page) .view-content,
    .view-content.riings-page { width: 100%; padding: 0 16px; }
    :is(body.riings, .riings-page) .view-inner { width: 100%; min-width: 0; }
    body.riings .view-content.exam .view-inner,
    body.riings .view-content.exam.print .view-inner { width: 100%; }
    :is(body.riings, .riings-page) .main-inner { width: 100%; min-width: 0; }
    body.riings header { height: auto; }
    body.riings header .header-in {
        min-width: 0; height: auto; padding: 16px;
        flex-wrap: wrap; justify-content: space-between; gap: 12px;
    }
    body.riings header .header-in .logo { position: static; flex: 0 0 120px; }
    body.riings header .header-in .utility { position: static; margin-left: auto; }
    body.riings header .header-in .utility li { margin-left: 0; }
    body.riings header .header-in .utility li a { min-width: 0; padding: 0 12px; }
    body.riings header .header-in .nav-util { order: 3; width: 100%; }
    body.riings header .nav-util .list { flex-wrap: nowrap; }
    body.riings header .nav-util .list > li { flex: 1; min-width: 0; }
    body.riings header .header-in .nav-util .list > li > a {
        height: 48px; padding: 0 8px; justify-content: center; font-size: 16px;
    }
    body.riings header .header-in .nav-util .list > li.active > a:after {
        left: 8px; right: 8px; width: auto;
    }

    /* Intro and books use the university site's header. */
    .riings-page .pgc-main { height: auto; min-height: 0; padding: 32px 0; }
    .riings-page .pgc-main .main-inner:after { display: none; }
    .riings-page .pgc-main .txt-box { margin-bottom: 0; }
    .riings-page .pgc-main .txt-box h1 { height: auto; font-size: 40px; line-height: 1.2; }
    .riings-page .pgc-main .txt-box h2 { font-size: 28px; line-height: 1.5; margin-top: 24px; }
    .riings-page .pgc-main .txt-box p { font-size: 16px; line-height: 1.7; margin-top: 24px; }
    .riings-page .pgc-main .txt-box .btn { margin-top: 20px; }
    .riings-page .ebook-sticky { position: static; margin-bottom: 24px; }
    .riings-page .ebook-sticky .ebook-sticky-in,
    .riings-page .ebook-sticky .ebook-sticky-box { width: 100%; }
    .riings-page .ebook-sticky .ebook-sticky-box { height: auto; min-height: 110px; padding: 16px 48px 16px 92px; }
    .riings-page .pgc-ebook { height: auto; min-height: 0; padding-bottom: 32px; }
    .riings-page .pgc-ebook:before,
    .riings-page .pgc-ebook .deco,
    .riings-page .ebook-wrap .title-wrap:before,
    .riings-page .ebook-wrap .title-wrap:after { display: none; }
    .riings-page .ebook-wrap .title-wrap h1 { font-size: 28px; line-height: 1.5; }
    .riings-page .ebook-wrap .tab-group { width: 100%; max-width: 620px; height: auto; min-height: 60px; margin-top: 24px; }
    .riings-page .ebook-wrap .tab-group a { min-height: 40px; height: auto; padding: 8px; }
    .riings-page .ebook-wrap .ebook-box {
        position: relative; left: auto; right: auto; width: 100%; margin-left: 0;
        padding-top: 24px; display: none;
    }
    .riings-page .ebook-wrap .ebook-box[style*="z-index: 10"],
    .riings-page .ebook-wrap .ebook-box:not([style]).cate0,
    .riings-page .ebook-wrap .ebook-box:not([style]).cate1 { display: block; }
    .riings-page .ebook-box > .flex3 { justify-content: flex-start; overflow-x: auto; gap: 16px; }
    .riings-page .ebook-box > .flex3 > li { flex: 0 0 216px; }
    .riings-page .bx-wrapperEvent1 .bx-controls-direction {
        display: flex; justify-content: center; gap: 16px; margin-top: 16px;
    }
    .riings-page .bx-wrapperEvent1 .bx-controls-direction a {
        position: relative; left: auto; right: auto; top: auto; margin: 0;
    }

    /* Settings, sharing and list screens. */
    body.riings .pgc-member .pgc-member-box,
    body.riings .pgc-member .btn-box,
    body.riings .pgc-noti-box { width: 100%; max-width: 100%; }
    body.riings .pgc-member.join .pgc-member-box { padding: 24px 16px; }
    body.riings .pgc-setting-list > ul > li { padding-left: 0; }
    body.riings .module-box { flex-direction: column; }
    body.riings .module-box .left-group,
    body.riings .module-box .right-group { width: 100%; padding: 12px; height: auto; }
    body.riings .module-box .right-group { justify-content: center; border-top: 1px solid #eee; }
    body.riings .module-box .right-group:after { display: none; }
    body.riings .module-select-box { width: 100%; }
    body.riings .module-select-box ul { width: 100%; }
    body.riings .module-cont > li { width: 100% !important; height: auto !important; min-height: 35px; }
    body.riings .module-cont .cell { min-width: 0; flex: 1; }
    body.riings .module-cont .cell.remove { flex: 0 0 35px; }
    body.riings .module-cont .cell + .cell { margin-left: 6px; }
    body.riings .module-cont .select-box select { padding-inline: 6px 20px; }
    body.riings .module-box .badge { height: auto; min-height: 36px; padding: 6px 2px; line-height: 1.4; }
    body.riings .module-help { position: static; width: 100%; padding: 12px; }
    body.riings .btn-half,
    body.riings .btn-box { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
    body.riings .btn-half > *,
    body.riings .btn-box > [class^="btn"] { max-width: 100%; margin: 0; }
    body.riings .pgc-table-cont { padding-top: 24px; }
    body.riings .pgc-table-cont .make-test {
        position: static; transform: none; display: flex; max-width: 100%; margin: 20px auto 0;
    }
    body.riings .tab-in { position: static; margin-bottom: 16px; }
    body.riings .tab-in li a { padding-inline: 16px; }
    body.riings .sel-state .select-box.lengthSelect { position: static; margin-bottom: 12px; }
    body.riings .riings-table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    body.riings .riings-table-scroll .pgc-table { min-width: 1000px; }
    body.riings #pgcTable_wrapper { width: 100%; min-width: 0; }
    body.riings #pgcTable_wrapper .dataTables_scroll { width: 100%; }
    body.riings #pgcTable_wrapper .pgc-table,
    body.riings #pgcTable_wrapper .dataTables_scrollHeadInner { min-width: 1100px; }
    body.riings #pgcTable_wrapper .dataTables_scrollBody {
        overflow-x: auto !important; -webkit-overflow-scrolling: touch;
    }
    body.riings #pgcTable_wrapper .pgc-table th { white-space: nowrap; }
    body.riings .dataTables_wrapper .dataTables_filter,
    body.riings .dataTables_wrapper .dataTables_length {
        position: static; float: none; width: 100%; text-align: left; margin: 12px 0;
    }
    body.riings .dataTables_wrapper .dataTables_filter input { width: min(240px, 65vw); }
    body.riings .dataTables_wrapper .dataTables_paginate { display: flex; flex-wrap: wrap; justify-content: center; }
    body.riings .summary [id^="lineContainer"] { max-width: 100%; overflow-x: auto; }

    /* Keep timer, questions and answer sheet in normal document flow. */
    body.riings header.exam { position: relative; height: auto; }
    body.riings header.exam.print .header-in { min-width: 0; }
    body.riings header.print .header-in .test-timer-wrap,
    body.riings header.print .header-in .test-timer-wrap .step.flex { width: 100%; }
    body.riings header.exam .test-timer-wrap { width: 100%; height: auto; flex-wrap: wrap; gap: 16px; order: 3; padding: 12px 0; }
    body.riings .test-timer-wrap .timer { margin-right: 0; flex-wrap: wrap; }
    body.riings .test-timer-wrap .step.flex { width: 100%; }
    body.riings .test-timer-wrap .step .step-line { flex: 1; width: auto; min-width: 20px; }
    body.riings .test-timer-wrap .exam-number { width: auto; }
    body.riings .pgc-test-wrap { padding-top: 24px; }
    body.riings .pgc-test-in { flex-direction: column; }
    body.riings .pgc-test-view { width: 100%; padding: 16px; margin-left: 0; }
    body.riings .pgc-test-view .title-group { flex-wrap: wrap; gap: 12px; }
    body.riings .pgc-test-view .title-group h2 + p { padding-left: 0; }
    body.riings .pgc-test-view .title-group h2 + p:before { display: none; }
    body.riings .q_type li.qq { width: calc(100% - 36px); }
    body.riings .q_answer li dd.answer_contents { width: calc(100% - 72px); }
    body.riings .q_answer.hz li dd.answer_contents { float: none; width: calc(100% - 72px); }
    body.riings .q_area { max-width: 100%; overflow-x: auto; }
    body.riings .pgc-test-check {
        position: static; margin-left: 0; width: 100%; min-width: 0; height: auto; padding: 16px;
        border-left: 0; border-top: 1px solid #eee;
    }
    body.riings .pgc-test-check .answer-scroll { height: auto; max-height: 50vh; padding: 0; }
    body.riings .pgc-test-check .answer-list li { justify-content: center; }
    body.riings .pgc-test-check .submit-box { position: static; transform: none; width: 100%; padding: 16px 0 0; }
    body.riings .test-ready { inset: 0; width: 100%; height: 100%; }
    body.riings .check_pop,
    body.riings .check_pop.view {
        position: fixed; top: 50%; left: 50%; margin: 0;
        width: min(450px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
        overflow-y: auto; transform: translate(-50%, -50%); animation: none;
    }
    body.riings .pop-in .pop-cont { min-width: 0; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
    body.riings .result-box { width: 100%; height: auto; min-height: 80px; }
    body.riings .result-box > div { padding: 16px; }

    /* Reports contain fixed-coordinate graphs: scroll each section intact. */
    body.riings #report,
    body.riings #report_wrap { width: 100%; min-width: 0; }
    body.riings #report { padding: 16px; }
    body.riings #contents_info { width: 100%; overflow-x: auto; }
    body.riings #report .dotline { width: 100%; }
    body.riings #contents_info > :is(table, .guide_square) { min-width: 760px; }
    body.riings .rpt_top .rpt_top_tit .title { min-width: 0; margin: 12px 0; display: block; }
    body.riings .rpt_top_info ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
    body.riings #report .print-btn { position: static; display: block; text-align: right; margin-bottom: 16px; }
}

@media screen and (max-width: 767px) {
    .riings-page .pgc-main .txt-box .btn { width: 100%; margin-right: 0; }
    .riings-page .top_line_video { position: static; width: 100%; }
    .riings-page .top_line_video .duty_box { flex-direction: column; align-items: stretch; }
    .riings-page .top_line_video .right_group { width: 100%; padding: 16px 0; }
    body.riings .module-select-box ul li { width: calc(50% - 10px); }
    body.riings .pgc-setting-list > ul > li.flex { flex-wrap: wrap; gap: 12px; }
    body.riings .pgc-setting-list .label { position: static; width: 100%; margin-bottom: 12px; }
    body.riings .btn-half > * { width: 100%; }
    body.riings .test-timer-wrap .timer .time { min-width: 36px; font-size: 18px; }
    body.riings .test-timer-wrap .timer p { width: 100%; margin-bottom: 8px; }
    body.riings .test-timer-wrap .step p { margin-right: 10px; }
    body.riings .result-box { flex-direction: column; }
    body.riings .result-box > div { width: 100%; }
    body.riings .result-box > div + div { border-left: 0; border-top: 1px solid #ddd; }

    .pgc-test-wrap .checkbox{gap: 7px;display: inline-flex; flex-flow: wrap;}
    .print-info dt {
        text-align: left;
        margin-bottom:5px
    }
}
