/* ═══════════════════════════════════════════════════════════════════════
   course_st.php — ใบโครงสร้างเวลาเรียน
   ทุกโทเคนของหน้าเป็น alias ของ --tb1-* เท่านั้น โหมดมืดจึงพลิกให้เอง
   ไม่มีเงาการ์ด ไม่มีพื้นไล่เฉด สีเน้นสงวนไว้ให้สิ่งที่บันทึกยังไม่ครบ
   ═══════════════════════════════════════════════════════════════════════ */
.cs {
    --cs-ink: var(--tb1-ink-1, #0F172A);
    --cs-ink-2: var(--tb1-ink-2, #334155);
    --cs-ink-3: var(--tb1-ink-3, #64748B);
    --cs-page: var(--tb1-page, #F8FAFC);
    --cs-paper: var(--tb1-surface, #FFFFFF);
    --cs-paper-alt: var(--tb1-surface-alt, #F1F5F9);
    --cs-rule: var(--tb1-border, #E2E8F0);
    --cs-rule-bold: var(--tb1-border-bold, #CBD5E1);
    --cs-mark: var(--tb1-brand, #1D4ED8);
    --cs-mark-pale: var(--tb1-brand-100, #DBEAFE);
    --cs-on-mark: var(--tb1-on-brand, #FFFFFF);
    --cs-short: #B91C1C;
    /* โทเคนกลาง text_danger โหมดสว่างได้ 4.41:1 ไม่ผ่าน AA */
    --cs-short-pale: var(--tb1-danger-soft, #FEE2E2);
    --cs-spine: 12px;
    --cs-radius: 14px;
}

:is(html.dark, html.dark-mode, html[data-theme="dark"],
    body.dark-mode, body[data-theme="dark"]) .cs {
    --cs-short: var(--tb1-text-danger, #FCA5A5);
    --cs-mark-pale: color-mix(in srgb, var(--tb1-brand, #60A5FA) 22%, transparent);
    --cs-short-pale: color-mix(in srgb, var(--tb1-text-danger, #FCA5A5) 18%, transparent);
}

/* หน้านี้ไม่ได้ใช้เฟรมเวิร์ก จึงประกาศพื้นฐานสามอย่างเอง */
.cs,
.cs *,
.cs *::before,
.cs *::after {
    box-sizing: border-box;
}

.cs :where(h1, h2, h3, h4, p, ul, ol, table, figure) {
    margin: 0;
}

.cs :where(ul, ol) {
    padding: 0;
    list-style: none;
}

/* ตัวกรองประกาศ display:flex ซึ่งชนะ [hidden] ของ UA stylesheet
   ถ้าไม่เขียนกฎนี้ หน้าที่ปิด JavaScript จะเห็นปุ่มกรองที่กดแล้วไม่มีอะไรเกิดขึ้น */
.cs [hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.tb1-curr {
    background: var(--tb1-page, #F8FAFC);
    color: var(--tb1-ink-1, #0F172A);
}

body.tb1-curr a.cs-skip {
    position: absolute;
    left: 1rem;
    top: -6rem;
    z-index: 10000;
    padding: .7rem 1.2rem;
    background: var(--tb1-banner-1, #1E3A8A);
    color: #FFFFFF;
    border-radius: 0 0 10px 10px;
    font-weight: 600;
    text-decoration: none;
}

body.tb1-curr a.cs-skip:focus {
    top: 0;
}

.cs :focus-visible {
    outline: 3px solid var(--cs-mark);
    outline-offset: 2px;
}

/* ── เปลือกหน้า ───────────────────────────────────────────────────── */
.cs {
    max-width: var(--tb1-page-max-width, 1440px);
    margin-inline: auto;
    padding-inline: var(--tb1-shell-gutter, 20px);
    padding-block: 1.75rem 3rem;
    color: var(--cs-ink);
    font-size: 1rem;
    line-height: 1.6;
}

.cs-paper {
    background: var(--cs-paper);
    border: 1px solid var(--cs-rule);
    border-left: var(--cs-spine) solid var(--tb1-brand-strong, #1E3A8A);
    border-radius: var(--cs-radius);
    padding: 1.5rem 1.5rem 1.35rem;
    margin-bottom: 1.5rem;
}

/* ── หัวกระดาษ ────────────────────────────────────────────────────── */
.cs-title {
    font-family: var(--tb1-font-display, 'Noto Serif Thai', Georgia, serif);
    font-size: clamp(1.5rem, 3.4vw, 2.05rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -.01em;
}

.cs-standfirst {
    margin-top: .5rem;
    max-width: 62ch;
    color: var(--cs-ink-2);
    font-size: .97rem;
}

/* บรรทัดสำมะโน — ตัวเลขหลักของหน้า แสดงครั้งเดียว */
.cs-census {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
    column-gap: 1.4rem;
    row-gap: .9rem;
    margin-top: 1.15rem;
    border-top: 1px solid var(--cs-rule);
    padding-top: 1rem;
}

.cs-census li {
    border-left: 2px solid var(--cs-rule);
    padding-left: .7rem;
}

/* ป้ายสั้นอย่างในใบคำอธิบายรายวิชา วางสองคอลัมน์ได้ตั้งแต่จอ 390px */
.cs-census.is-compact {
    grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr));
}

.cs-census .is-short {
    border-left-color: var(--cs-short);
}

.cs-census b {
    display: block;
    font-family: var(--tb1-font-display, 'Noto Serif Thai', Georgia, serif);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.cs-census span {
    font-size: .78rem;
    color: var(--cs-ink-3);
}

.cs-census .is-short b,
.cs-census .is-short span {
    color: var(--cs-short);
}

/* ── ผังความครบถ้วน ───────────────────────────────────────────────── */
.cs-section-title {
    font-family: var(--tb1-font-display, 'Noto Serif Thai', Georgia, serif);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
}

.cs-note {
    margin-top: .35rem;
    max-width: 74ch;
    color: var(--cs-ink-2);
    font-size: .86rem;
}

.cs-scroll {
    overflow-x: auto;
    margin-top: 1.1rem;
    -webkit-overflow-scrolling: touch;
}

.cs-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
}

.cs-grid caption {
    caption-side: top;
    text-align: left;
    padding-bottom: .55rem;
    color: var(--cs-ink-3);
    font-size: .82rem;
}

.cs-grid th,
.cs-grid td {
    border: 1px solid var(--cs-rule);
    padding: .45rem .5rem;
    vertical-align: top;
    position: relative;
}

.cs-grid thead th {
    background: var(--cs-paper-alt);
    font-weight: 600;
    font-size: .82rem;
    text-align: center;
    white-space: nowrap;
}

.cs-grid th[scope="row"] {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--cs-paper);
    text-align: left;
    font-weight: 500;
    min-width: 13rem;
    max-width: 17rem;
}

.cs-grid thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--cs-paper-alt);
    text-align: left;
}

.cs-cell {
    min-width: 5.6rem;
    text-align: center;
}

.cs-cell-none {
    background: var(--cs-paper-alt);
}

.cs .cs-cell-link {
    display: block;
    color: var(--cs-ink);
    text-decoration: none;
}

.cs .cs-cell-link:hover .cs-cell-v,
.cs .cs-cell-link:focus-visible .cs-cell-v {
    text-decoration: underline;
}

.cs-cell-v {
    display: block;
    font-family: var(--tb1-font-display, 'Noto Serif Thai', Georgia, serif);
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.cs-cell-pct {
    display: block;
    font-size: .7rem;
    color: var(--cs-ink-3);
    font-variant-numeric: tabular-nums;
}

.cs-track {
    display: block;
    position: relative;
    height: 7px;
    margin-top: .3rem;
    background: var(--cs-paper-alt);
    border: 1px solid var(--cs-rule);
    border-radius: 2px;
}

.cs-fill {
    display: block;
    height: 100%;
    background: var(--cs-mark);
    border-radius: 1px;
}

/* เส้นเกณฑ์ครึ่งหนึ่ง — ทำให้กฎ "บันทึกน้อย" มองเห็นได้บนภาพ */
.cs-track::after {
    content: '';
    position: absolute;
    top: -2px;
    bottom: -2px;
    left: 50%;
    width: 1px;
    background: var(--cs-rule-bold);
}

.cs-cell.is-thin {
    outline: 2px solid var(--cs-short);
    outline-offset: -2px;
}

.cs-cell.is-thin .cs-cell-v,
.cs-cell.is-thin .cs-cell-pct {
    color: var(--cs-short);
}

.cs-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    margin-top: .9rem;
    font-size: .8rem;
    color: var(--cs-ink-2);
}

.cs-legend li {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.cs-key {
    width: 1.5rem;
    height: .65rem;
    border: 1px solid var(--cs-rule);
    border-radius: 2px;
    flex-shrink: 0;
}

.cs-key.is-fill {
    background: var(--cs-mark);
    border-color: var(--cs-mark);
}

.cs-key.is-thin {
    outline: 2px solid var(--cs-short);
    outline-offset: -2px;
    background: var(--cs-paper);
}

.cs-key.is-none {
    background: var(--cs-paper-alt);
}

/* ── ตัวกรองระดับชั้น ─────────────────────────────────────────────── */
.cs-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    margin-bottom: 1.35rem;
}

.cs-filter-label {
    font-size: .84rem;
    color: var(--cs-ink-2);
    margin-right: .3rem;
}

.cs .cs-chip {
    font: inherit;
    font-size: .86rem;
    padding: .4rem .95rem;
    border: 1px solid var(--cs-rule-bold);
    border-radius: 999px;
    background: var(--cs-paper);
    color: var(--cs-ink-2);
    cursor: pointer;
}

.cs .cs-chip:hover {
    border-color: var(--cs-mark);
    color: var(--cs-mark);
}

.cs .cs-chip[aria-pressed="true"] {
    background: var(--cs-mark);
    border-color: var(--cs-mark);
    color: var(--cs-on-mark);
    font-weight: 500;
}

/* ── ส่วนของแต่ละระดับชั้น ────────────────────────────────────────── */
.cs-grade {
    margin-bottom: 2.25rem;
    scroll-margin-top: 4.5rem;
}

.cs-grade-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .75rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--cs-ink);
    margin-bottom: 1.15rem;
}

.cs-grade-head h2 {
    font-family: var(--tb1-font-display, 'Noto Serif Thai', Georgia, serif);
    font-size: 1.3rem;
    font-weight: 600;
}

.cs-grade-head p {
    color: var(--cs-ink-3);
    font-size: .84rem;
    font-variant-numeric: tabular-nums;
}

/* ── การ์ดโครงสร้างรายแผนการเรียน ─────────────────────────────────── */
.cs-plan {
    background: var(--cs-paper);
    border: 1px solid var(--cs-rule);
    border-left: var(--cs-spine) solid var(--cs-rule-bold);
    border-radius: var(--cs-radius);
    padding: 1.15rem 1.25rem 1.25rem;
    margin-bottom: 1.15rem;
    scroll-margin-top: 4.5rem;
}

.cs-plan.is-thin {
    border-left-color: var(--cs-short);
}

.cs-plan-head h3 {
    font-family: var(--tb1-font-display, 'Noto Serif Thai', Georgia, serif);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
}

.cs-plan-figures {
    display: flex;
    flex-wrap: wrap;
    margin-top: .6rem;
    padding-top: .6rem;
    border-top: 1px solid var(--cs-rule);
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}

.cs-plan-figures {
    gap: .3rem 1.1rem;
}

.cs-plan-figures li {
    border-left: 2px solid var(--cs-rule);
    padding-left: .6rem;
    color: var(--cs-ink-2);
}

.cs-plan-figures .is-short {
    border-left-color: var(--cs-short);
}

.cs-plan-figures b {
    font-weight: 600;
    color: var(--cs-ink);
}

.cs-plan-figures .is-short,
.cs-plan-figures .is-short b {
    color: var(--cs-short);
}

.cs-flag {
    margin-top: .7rem;
    padding: .15rem 0 .15rem .7rem;
    border-left: 3px solid var(--cs-short);
    color: var(--cs-ink-2);
    font-size: .85rem;
}

.cs-flag b {
    color: var(--cs-short);
    font-variant-numeric: tabular-nums;
}

.cs-terms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
    margin-top: 1.1rem;
    align-items: start;
}

.cs-term h4 {
    font-size: .95rem;
    font-weight: 600;
    padding-bottom: .35rem;
    border-bottom: 1px solid var(--cs-rule-bold);
}

.cs-empty {
    margin-top: .6rem;
    padding: .75rem .85rem;
    border: 1px dashed var(--cs-rule-bold);
    border-radius: 8px;
    color: var(--cs-ink-3);
    font-size: .85rem;
}

/* ── ตารางรายวิชา ─────────────────────────────────────────────────── */
.cs-courses {
    width: 100%;
    border-collapse: collapse;
    margin-top: .6rem;
    font-size: .86rem;
}

.cs-courses th,
.cs-courses td {
    padding: .38rem .45rem;
    text-align: left;
    vertical-align: top;
    /* .sr-only เป็น absolute ต้องมีบรรพบุรุษที่ position ไม่ใช่ static
       ไม่งั้นมันไปยึดกรอบทั้งหน้าแล้วทำให้จอแคบเลื่อนแนวนอนได้ */
    position: relative;
}

.cs-courses thead th {
    font-size: .76rem;
    font-weight: 600;
    color: var(--cs-ink-3);
    border-bottom: 1px solid var(--cs-rule-bold);
    white-space: nowrap;
}

.cs-courses .cs-num {
    text-align: right;
    width: 4.2rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cs-courses .cs-code {
    width: 6.2rem;
    color: var(--cs-ink-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cs-cat-row th {
    padding-top: .85rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--cs-ink);
    border-bottom: 1px solid var(--cs-rule);
}

.cs-cat-row .cs-cat-hint {
    display: block;
    font-weight: 400;
    font-size: .76rem;
    color: var(--cs-ink-3);
}

.cs-courses tbody td {
    border-bottom: 1px solid var(--cs-rule);
}

.cs-courses .cs-sum td {
    border-top: 1px solid var(--cs-rule-bold);
    border-bottom: none;
    font-weight: 600;
    color: var(--cs-ink-2);
    text-align: right;
}

.cs .cs-course-link {
    color: var(--cs-mark);
    text-decoration: none;
}

.cs .cs-course-link:hover,
.cs .cs-course-link:focus-visible {
    text-decoration: underline;
}

.cs-alt td {
    color: var(--cs-ink-2);
}

.cs-tag {
    display: inline-block;
    margin-left: .35rem;
    padding: 0 .35rem;
    border: 1px solid var(--cs-rule-bold);
    border-radius: 4px;
    font-size: .72rem;
    color: var(--cs-ink-3);
    white-space: nowrap;
}

.cs-dup td:first-child {
    box-shadow: inset 3px 0 0 var(--cs-short);
    padding-left: .7rem;
}

.cs-dup .cs-tag {
    border-color: var(--cs-short);
    color: var(--cs-short);
}

.cs-term-total {
    display: flex;
    flex-wrap: wrap;
    margin-top: .75rem;
    padding-top: .6rem;
    border-top: 2px solid var(--cs-ink);
    font-size: .86rem;
    font-variant-numeric: tabular-nums;
}

.cs-term-total {
    gap: .3rem 1rem;
}

.cs-term-total li {
    border-left: 2px solid var(--cs-rule);
    padding-left: .6rem;
    color: var(--cs-ink-2);
}

.cs-term-total b {
    color: var(--cs-ink);
}

.cs-foot {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--cs-rule);
    color: var(--cs-ink-2);
    font-size: .85rem;
}

.cs-foot p + p {
    margin-top: .4rem;
}

.cs .cs-link {
    color: var(--cs-mark);
    text-decoration: underline;
}

/* พื้นสีเต็มใบทำให้ลิงก์ในกล่องเหลือ 2.42:1 ใช้กระดาษปกติแล้วให้สันซ้ายเป็นตัวบอกสถานะ */
.cs-alert {
    background: var(--cs-paper);
    border: 1px solid var(--cs-rule);
    border-left: var(--cs-spine) solid var(--cs-short);
    border-radius: var(--cs-radius);
    padding: 1.15rem 1.25rem;
    color: var(--cs-ink);
}

.cs-alert strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: .35rem;
}

.cs-alert p + p {
    margin-top: .4rem;
}

/* ── จอแคบ ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .cs-terms {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .cs {
        padding-inline: 12px;
        padding-block: 1.25rem 2rem;
    }

    .cs-paper,
    .cs-plan {
        padding: 1rem .9rem 1.05rem;
        --cs-spine: 8px;
    }

    .cs-census li,
    .cs-plan-figures li,
    .cs-term-total li {
        padding-right: .85rem;
        margin-right: .85rem;
    }

    .cs-census b {
        font-size: 1.3rem;
    }

    .cs-grid th[scope="row"] {
        min-width: 10.5rem;
    }
}

/* ── โหมดคอนทราสต์สูง ─────────────────────────────────────────────
   ไฟล์กลางบังคับตัวอักษรทุกตัวเป็นสีขาวที่ (0,1,0) และโหลดทีหลังหน้า
   จึงห้ามบังคับพื้นการ์ดเป็นสีขาว ให้คงพื้นดำแล้วเขียนเฉพาะสิ่งที่
   สีเป็นตัวบอกความหมาย โดยแยกด้วยพื้นกับรูปทรง ไม่ใช่สีตัวอักษร */
html.tb1-contrast-high .cs-paper,
html.tb1-contrast-high .cs-plan,
html.tb1-contrast-high .cs-flag,
html.tb1-contrast-high .cs-alert,
html.tb1-contrast-high .cs-empty {
    background: #000000;
    border-color: #FFFFFF;
    border-left-color: #FFD400;
}

html.tb1-contrast-high .cs-grid th,
html.tb1-contrast-high .cs-grid td,
html.tb1-contrast-high .cs-courses th,
html.tb1-contrast-high .cs-courses td {
    border-color: #FFFFFF;
}

/* ไฟล์กลางบังคับลิงก์ทุกตัวเป็นเหลืองบนพื้นเดิม skip link จึงเหลือ 4.38:1 */
html.tb1-contrast-high body.tb1-curr a.cs-skip {
    background: #000000 !important;
    border: 2px solid #FFD400;
}

html.tb1-contrast-high .cs-grid caption,
html.tb1-contrast-high .cs-flag,
html.tb1-contrast-high .cs-plan-figures li {
    color: #FFFFFF;
}

html.tb1-contrast-high .cs-census .is-short,
html.tb1-contrast-high .cs-plan-figures .is-short,
html.tb1-contrast-high .cs-flag,
html.tb1-contrast-high .cs-dup td:first-child {
    border-left-color: #FFD400;
    box-shadow: none;
}

html.tb1-contrast-high .cs-dup td:first-child {
    border-left: 3px solid #FFD400;
}

html.tb1-contrast-high .cs-grid thead th,
html.tb1-contrast-high .cs-grid th[scope="row"] {
    background: #000000;
}

html.tb1-contrast-high .cs-cell-none {
    background: repeating-linear-gradient(135deg, #000 0 5px, #333 5px 10px);
}

html.tb1-contrast-high .cs-track {
    background: #000000;
    border-color: #FFFFFF;
}

html.tb1-contrast-high .cs-fill,
html.tb1-contrast-high .cs-key.is-fill {
    background: #FFD400;
}

html.tb1-contrast-high .cs-cell.is-thin,
html.tb1-contrast-high .cs-key.is-thin {
    outline: 3px dotted #FFD400;
    outline-offset: -3px;
}

html.tb1-contrast-high .cs-alert {
    background: #000000;
    border-left-color: #FFD400;
}

/* ปุ่มที่กำลังถูกเลือกต้องกลับสี ไฟล์กลางทำทุกปุ่มเหมือนกันหมด */
html.tb1-contrast-high .cs .cs-chip[aria-pressed="true"] {
    background: #FFD400 !important;
    border-color: #FFD400 !important;
}

html.tb1-contrast-high .cs .cs-chip[aria-pressed="true"] {
    color: #000000 !important;
}

/* ── พิมพ์ ────────────────────────────────────────────────────────── */
@media print {
    .cs {
        max-width: none;
        padding: 0;
        font-size: 10pt;
    }

    .cs-filter,
    .cs-skip {
        display: none !important;
    }

    .cs-paper,
    .cs-plan {
        border: 1px solid #999 !important;
        border-left: 4px solid #333 !important;
        background: #fff !important;
        padding: .5rem .6rem;
        margin-bottom: .5rem;
    }

    .cs-plan,
    .cs-term {
        break-inside: avoid;
    }

    .cs-scroll {
        overflow: visible !important;
    }

    .cs-grid th[scope="row"],
    .cs-grid thead th {
        position: static !important;
        background: #f2f2f2 !important;
    }

    .cs-fill {
        background: #444 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .cs-track {
        background: #fff !important;
        border-color: #999 !important;
    }

    .cs-cell-none {
        background: #eee !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .cs-cell.is-thin {
        outline: 1.5pt solid #000 !important;
    }

        .cs-flag,
    .cs-alert {
        background: #fff !important;
        border-color: #000 !important;
    }

    .cs-dup td:first-child {
        box-shadow: inset 3px 0 0 #000 !important;
    }

    .cs .cs-course-link,
    .cs .cs-cell-link {
        color: #000 !important;
        text-decoration: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cs * {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   course_detail.php — ใบคำอธิบายรายวิชา
   ใช้โทเคนและคอมโพเนนต์ชุดเดียวกับใบโครงสร้างเวลาเรียนด้านบน
   ═══════════════════════════════════════════════════════════════════════ */
.cs-crumb {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: baseline;
    margin-bottom: .7rem;
    font-size: .82rem;
    color: var(--cs-ink-3);
}

.cs-crumb li::after {
    content: '/';
    margin-left: .4rem;
    color: var(--cs-rule-bold);
}

.cs-crumb li:last-child::after {
    content: none;
}

.cs .cs-crumb a {
    color: var(--cs-mark);
    text-decoration: none;
}

.cs .cs-crumb a:hover,
.cs .cs-crumb a:focus-visible {
    text-decoration: underline;
}

.cs-crumb [aria-current] {
    color: var(--cs-ink-2);
    font-variant-numeric: tabular-nums;
}

.cd-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: 1.5rem;
    align-items: start;
}

/* คำอธิบายรายวิชา — ความเรียงของจริงจากทะเบียน */
.cs-prose {
    max-width: 46rem;
    color: var(--cs-ink);
    font-size: 1rem;
    line-height: 1.85;
}

.cs-prose p {
    margin: 0 0 .9rem;
}

.cs-prose p:last-child {
    margin-bottom: 0;
}

.cs-prose strong,
.cs-prose b {
    font-weight: 600;
}

.cs-prose ol,
.cs-prose ul {
    margin: 0 0 .9rem;
    padding-left: 1.6rem;
    list-style: decimal;
}

.cs-prose ul {
    list-style: disc;
}

.cs-prose li {
    margin-bottom: .3rem;
}

/* รายการมีเส้นแบ่ง ใช้ทั้งแผนการเรียนที่ใช้วิชานี้ และวิชาอื่นในหมวดเดียวกัน */
.cs-rows {
    margin-top: .9rem;
    border-top: 1px solid var(--cs-rule);
}

.cs-row {
    display: block;
    padding: .65rem .1rem;
    border-bottom: 1px solid var(--cs-rule);
    text-decoration: none;
}

.cs .cs-row {
    color: var(--cs-ink);
}

.cs a.cs-row:hover .cs-row-t,
.cs a.cs-row:focus-visible .cs-row-t {
    text-decoration: underline;
}

.cs-row-k {
    display: block;
    font-size: .76rem;
    color: var(--cs-ink-3);
    font-variant-numeric: tabular-nums;
}

.cs-row-t {
    display: block;
    font-size: .9rem;
    line-height: 1.5;
}

.cs-row-m {
    display: block;
    margin-top: .1rem;
    font-size: .78rem;
    color: var(--cs-ink-3);
    font-variant-numeric: tabular-nums;
}

.cs-count {
    font-variant-numeric: tabular-nums;
    color: var(--cs-ink-3);
    font-size: .84rem;
    margin-top: .3rem;
    display: block;
}

@media (max-width: 900px) {
    .cd-layout {
        grid-template-columns: 1fr;
    }

    .cs-prose {
        max-width: none;
    }
}

@media print {

    .cd-layout {
        grid-template-columns: minmax(0, 1fr) 18rem;
        gap: .75rem;
    }

    .cs-prose {
        max-width: none;
    }

    .cs-row,
    .cs-prose li {
        break-inside: avoid;
    }
}
