/* ============================================================
   i-TEST หน้าแรก (index.php) — ชิ้นส่วนเฉพาะหน้า ต่อยอดจาก pro/pro.css และ sunday/sunday.css
   โหลดผ่าน it_head() ใน itest_ui.php  ·  ทุกคลาสอยู่ใต้ .it (แท็ก <main class='pp ms it'>) ขึ้นต้นด้วย it-
   ============================================================ */

.it .sec-head h2 + p,
.it .sec-head p {
    max-width: 760px;
}

/* แถวการ์ดต่อกันในส่วนสรุปผล */
.it .it-row {
    margin-top: 20px;
}

.it .panel.empty b {
    color: var(--ink);
}

/* กราฟแท่งในแถวเดียวกับเรดาร์ : แท่งสูงเต็มการ์ด ไม่เหลือที่ว่างด้านบน */
.it .it-fill {
    display: flex;
    flex-direction: column;
}

.it .it-fill .hist {
    flex: 1;
    align-items: stretch;
    min-height: 240px;
}

.it .it-fill .hist .col {
    flex: 1;
    height: auto;
}

/* ---------- การ์ดเข้มใน hero : ผลรายวิชา ---------- */

.it .it-over-list {
    display: grid;
    gap: 8px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.it .it-over-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(214, 177, 114, 0.25);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transition: background .15s, border-color .15s;
}

.it .it-over-list a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(214, 177, 114, 0.6);
}

.it .it-over-list .ic {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(214, 177, 114, 0.18);
    color: var(--gold);
    font-size: 14px;
}

.it .it-over-list .n {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    line-height: 1.35;
}

.it .it-over-list .n small {
    display: block;
    font-size: 12px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
}

.it .it-over-list .v {
    flex: none;
    font-size: 17px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.it .it-over-list .v.ok  { color: #a6e3bf; }
.it .it-over-list .v.bad { color: #f5b3aa; }

.it .it-over-list .st {
    flex: none;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    white-space: nowrap;
}

/* ---------- แท็บวิชา ---------- */

.it .it-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.it .it-tabs::-webkit-scrollbar {
    display: none;
}

.it .it-tab {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #444;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}

.it .it-tab i {
    color: var(--gold);
}

.it .it-tab b {
    padding: 1px 8px;
    border-radius: 999px;
    background: #f5f1ea;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.it .it-tab b.ok  { background: var(--green-soft); color: var(--green); }
.it .it-tab b.bad { background: var(--red-soft);   color: var(--red); }

.it .it-tab:hover {
    border-color: var(--gold);
}

.it .it-tab.on {
    background: var(--gold);
    border-color: var(--gold);
    color: #fff;
    box-shadow: 0 6px 16px rgba(214, 177, 114, 0.35);
}

.it .it-tab.on i {
    color: #fff;
}

.it .it-tab.on b {
    background: rgba(255, 255, 255, 0.92);
}

/* ---------- ผลรายวิชา ---------- */

.it .it-subj {
    display: grid;
    gap: 20px;
    scroll-margin-top: calc(140px + var(--pend-h, 0px));   /* ลิงก์ #subN : เว้นแถบเมนู + แถบแท็บวิชาไว้ด้านบน (+ แถบสถานะการสมัคร PRO) */
}

/* ไม่มีสคริปต์ : ทุกวิชาเรียงกัน เว้นระยะระหว่างวิชา */
.it .it-subj + .it-subj {
    margin-top: 40px;
}

/* การ์ดวิชาใบเดียว (เจ้าของเว็บขอ 2026-10-03 "ประหยัดพื้นที่และดูง่าย" · เดิมแยก 3 การ์ด)
   หัววิชา · ห้องสอบแบบตั๋ว (.it-when) · แถบล่าง = สถานะของผู้ใช้ตอนนี้ + ปุ่ม (.fc-cta) · ยังไม่ประกาศตารางสอบ = หัววิชาอย่างเดียว */
.it .it-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.it .it-card.st-open {
    border-color: rgba(214, 177, 114, 0.75);
    box-shadow: 0 12px 28px rgba(214, 177, 114, 0.2);
}

.it .it-subj-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 24px 0;
}

.it .it-subj-head .ic {
    flex: none;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--gold-soft);
    color: var(--gold-dark);
    font-size: 22px;
}

.it .it-subj-head .tx {
    flex: 1;
    min-width: 0;
}

.it .it-subj-head h3 {
    margin: 6px 0 2px;
    font-size: 21px;
    font-weight: 500;
    line-height: 1.35;
}

.it .it-subj-head p {
    margin: 0;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--muted);
}

.it .it-subj-head .badge {
    flex: none;
}

/* ห้องสอบแบบตั๋ว : เปิดห้อง → ปิดห้อง (ซ้าย) | รอยปรุ | จำนวนข้อ · เวลาทำ · ประกาศผล (ขวา) */
.it .it-when {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    overflow: hidden;   /* รอยบากครึ่งวงกลมที่ปลายรอยปรุ */
    margin: 18px 24px 0;
    border-radius: 18px;
    background: #faf4e9;
}

.it .it-when:last-child {   /* ประกาศผลแล้ว : ไม่มีแถบล่าง */
    margin-bottom: 24px;
}

.it .it-pass {
    display: grid;
    grid-template-columns: auto minmax(70px, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 16px 22px;
}

.it .it-pass-t small {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.it .it-pass-t b {
    display: block;
    margin: 1px 0 2px;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.it .it-pass-t b small {
    display: inline;
    font-size: 13px;
    font-weight: 500;
    color: #777;
}

.it .it-pass-t span {
    display: block;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}

.it .it-pass-t:last-child {
    text-align: right;
}

/* กลางตั๋ว : ความยาวห้อง + แถบเวลาที่ผ่านไปของห้อง (จุดปลาย = เปิด / ปิดห้อง · จุดเขียว = ตอนนี้) */
.it .it-pass-m {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: 0;
}

.it .it-pass-m span {
    font-size: 12px;
    font-weight: 500;
    color: var(--gold-dark);
    white-space: nowrap;
}

.it .it-pass-m > i {
    position: relative;
    display: block;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: #eadcc4;
}

.it .it-pass-m > i::before,
.it .it-pass-m > i::after {
    content: '';
    position: absolute;
    top: 50%;
    z-index: 1;
    width: 10px;
    height: 10px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%);
}

.it .it-pass-m > i::before {
    left: -5px;
}

.it .it-pass-m > i::after {
    right: -5px;
}

.it .it-pass-m > i > i {
    position: relative;
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #e3c48e, var(--gold));
}

.it .it-pass.now .it-pass-m > i::before {
    background: var(--gold);
}

.it .it-pass.now .it-pass-m > i > i::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    z-index: 2;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(63, 154, 100, 0.2);
    transform: translateY(-50%);
    animation: it-now 2s ease-in-out infinite;
}

@keyframes it-now {
    50% { box-shadow: 0 0 0 7px rgba(63, 154, 100, 0.08); }
}

.it .it-pass.end .it-pass-m > i > i {
    background: #d6c4a3;
}

.it .it-pass.end .it-pass-m > i::before,
.it .it-pass.end .it-pass-m > i::after {
    border-color: #cbb48c;
    background: #cbb48c;
}

/* ท้ายตั๋ว (หลังรอยปรุ) : จำนวนข้อ · เวลาทำ · ประกาศผล */
.it .it-spec {
    position: relative;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-content: center;
    gap: 6px 22px;
    margin: 0;
    padding: 14px 22px;
    border-left: 2px dashed #e2d1b2;
    list-style: none;
}

.it .it-spec::before,
.it .it-spec::after {
    content: '';
    position: absolute;
    left: -8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
}

.it .it-spec::before {
    top: -9px;
}

.it .it-spec::after {
    bottom: -9px;
}

.it .it-spec small {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.it .it-spec b {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

/* แถบล่างของการ์ด : สถานะของผู้ใช้ตอนนี้ + ปุ่ม (หน้าตาพื้นฐาน fc.css .fc-cta) · ยังไม่ประกาศตารางสอบ */
.it .it-card .fc-cta {
    margin-top: 18px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    background: #fffdf9;
}

.it .it-card .fc-cta.on {
    border-color: rgba(214, 177, 114, 0.45);
    background: linear-gradient(180deg, #fff6e3, #fffdf9);
    box-shadow: none;
}

.it .it-card .fc-cta-ic {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 18px;
}

.it .it-card .fc-cta .tx b {
    font-size: 16px;
}

.it .it-card .fc-cta .tx p {
    margin-top: 2px;
    font-size: 13.5px;
}

/* ยังไม่ประกาศตารางสอบ : การ์ดมีแค่หัววิชา */
.it .it-subj-head:last-child {
    padding-bottom: 22px;
}

.it .it-wait {
    padding: 18px;
}

/* ---------- สรุปผลบนมือถือ (เจ้าของเว็บขอ 2026-10-04 "ประหยัดพื้นที่มากที่สุด") ----------
   ตารางเดียว .it-sumx แทน 3 การ์ด .it-sum3 : คอลัมน์ ภาค ก. · ภาค ข. · รวม (คอลัมน์รวมพื้นทอง) · แถวคะแนน (สีตามเกณฑ์ 60%) · อันดับ 4 กลุ่ม
   จุดเด่น / ต้องพัฒนา .it-gw : หัวกลุ่ม .it-gh + แถวละหัวข้อ ร้อยละเป็นป้าย .it-pc · จอคอมใช้แบบเดิม (ซ่อนส่วนของมือถือ) */
.it .it-sumx,
.it .it-gw .it-gh,
.it .it-gw .it-pc {
    display: none;
}

@media screen and (max-width: 700px) {
    .it .it-sum3 {
        display: none;
    }
    .it .it-sumx {
        display: block;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    }
    .it .it-sumx-row {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr));
        align-items: stretch;
    }
    .it .it-sumx-row + .it-sumx-row {
        border-top: 1px solid var(--line2);
    }
    .it .it-sumx-row > span {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-width: 0;
        padding: 8px 4px;
        text-align: center;
    }
    .it .it-sumx-row > span:first-child {
        align-items: flex-start;
        padding-left: 14px;
        font-size: 13.5px;
        font-weight: 500;
        text-align: left;
    }
    .it .it-sumx-row small {
        display: block;
        font-size: 11px;
        font-weight: 400;
        line-height: 1.35;
        color: var(--muted);
    }
    /* คอลัมน์คะแนนรวม : พื้นทองต่อกันทั้งคอลัมน์ */
    .it .it-sumx-row > .main {
        background: #fbf2e1;
    }
    .it .it-sumx-row.hd > span {
        padding-top: 10px;
        padding-bottom: 9px;
        font-size: 14px;
        font-weight: 600;
    }
    .it .it-sumx-row.hd > span:first-child {
        justify-content: center;
        color: var(--gold);
        font-size: 18px;
    }
    .it .it-sumx-row.hd > .main {
        background: linear-gradient(135deg, #e3c48e, var(--gold) 55%, #c49a55);
        color: #fff;
    }
    .it .it-sumx-row.hd > .main small {
        color: rgba(255, 255, 255, 0.85);
    }
    .it .it-sumx-row.sc b {
        font-size: 23px;
        font-weight: 700;
        line-height: 1.15;
        font-variant-numeric: tabular-nums;
    }
    .it .it-sumx-row.sc em {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        margin-top: 2px;
        font-size: 11.5px;
        font-style: normal;
        font-weight: 600;
    }
    .it .it-sumx-row.sc em i {
        font-size: 9px;
    }
    .it .it-sumx-row.sc .ok em  { color: var(--green); }
    .it .it-sumx-row.sc .bad em { color: var(--red); }
    .it .it-sumx-sep {
        padding: 6px 14px;
        border-top: 1px solid var(--line2);
        background: #faf6ef;
        color: var(--gold-dark);
        font-size: 12px;
        font-weight: 600;
    }
    .it .it-sumx-row.rk > span:not(:first-child) {
        font-size: 18px;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }
    .it .it-sumx-note {
        margin: 0;
        padding: 8px 14px 10px;
        border-top: 1px solid var(--line2);
        font-size: 11.5px;
        line-height: 1.5;
        color: var(--muted);
    }

    /* จุดเด่น / ต้องพัฒนา : แถวละหัวข้อ + ป้ายร้อยละ · คำอธิบายใต้หัวการ์ดซ่อน (หัวกลุ่มบอกเกณฑ์แล้ว) */
    .it .panel:has(> .it-gw) .panel-head small {
        display: none;
    }
    .it .it-gw {
        gap: 0;
    }
    .it .it-gw > li {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 7px 2px;
    }
    .it .it-gw > li .li-ic,
    .it .it-gw > li > div p {
        display: none;
    }
    .it .it-gw > li > div b {
        font-size: 13.5px;
        font-weight: 400;
        line-height: 1.45;
    }
    .it .it-gw .it-pc {
        display: block;
        min-width: 52px;
        padding: 2px 8px;
        border-radius: 999px;
        font-size: 12.5px;
        font-weight: 700;
        text-align: center;
        font-variant-numeric: tabular-nums;
    }
    .it .it-gw .it-pc.ok  { background: var(--green-soft); color: var(--green); }
    .it .it-gw .it-pc.bad { background: var(--red-soft);   color: var(--red); }
    .it .it-gw > li.it-gh {
        display: flex;
        gap: 8px;
        padding: 10px 2px 4px;
        border-top: 0;
        font-size: 12.5px;
        font-weight: 700;
    }
    .it .it-gw > li.it-gh + li {
        border-top: 0;
    }
    .it .it-gw > li.it-gh.ok  { color: var(--green); }
    .it .it-gw > li.it-gh.bad { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 12px; color: var(--red); }
    .it .it-gw > li.it-gh:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
}

/* ข้อความแนะนำ (จุดเด่น / ต้องพัฒนา เมื่อยังไม่มีหัวข้อ) */
.it .it-say {
    margin: 0;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.8;
    color: #555;
}

/* ---------- TOP 10 : ชื่อ + บรรทัดรอง (สาขาวิชา / เขต) ไม่มีช่องลูกศร ---------- */

.it .rank-list.it-top li {
    grid-template-columns: 40px minmax(0, 1fr) auto;
}

.it .it-top .rank-name b,
.it .it-top .rank-name small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.it .it-top .rank-name b {
    font-weight: inherit;
}

.it .it-top .rank-name small {
    font-size: 12px;
    font-weight: 300;
    color: var(--muted);
}

.it .rank-list li.me:not(:first-child) {
    background: #fffaf0;
    box-shadow: inset 3px 0 0 var(--gold);
}

/* ชิ้นส่วนที่ใช้เฉพาะมือถือ (แสดงใน @media ด้านล่าง) : จุดวิชาที่ประกาศผลแล้วในกล่องสรุปผล · ปุ่มอ่านต่อคำอธิบายวิชา */
.it .it-dots,
.it .it-more {
    display: none;
}

/* ---------- Responsive ---------- */

/* ไม่เกิน 1000px : ตั๋วห้องสอบเรียงบน-ล่าง (รอยปรุแนวนอน รอยบากซ้าย-ขวา) */
@media screen and (max-width: 1000px) {
    .it .it-when {
        grid-template-columns: minmax(0, 1fr);
    }
    .it .it-spec {
        border-top: 2px dashed #e2d1b2;
        border-left: 0;
    }
    .it .it-spec::before,
    .it .it-spec::after {
        top: -8px;
        bottom: auto;
    }
    .it .it-spec::before {
        left: -9px;
    }
    .it .it-spec::after {
        right: -9px;
        left: auto;
    }
}

/* มือถือ (ไม่เกิน 700px) : หัวข้อส่วนกระชับ · สรุปผลรอครบ 5 วิชาแบบการ์ดแนวนอน · แท็บวิชาเต็มจอ
   การ์ดวิชา : ภาค + ป้ายสถานะแถวบน ไอคอน + ชื่อวิชา คำอธิบาย 2 บรรทัด + อ่านต่อ · ตั๋วห้องสอบ · แถบล่างกระชับ */
@media screen and (max-width: 700px) {
    .it .sec-head h2 {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        font-size: 21px;
    }
    .it .sec-head h2 > i {
        flex: none;
        display: grid;
        place-items: center;
        width: 34px;
        height: 34px;
        margin: -3px 0 0;
        border-radius: 11px;
        background: var(--gold-soft);
        font-size: 15px;
    }
    .it .sec-head p {
        margin-top: 6px;
        font-size: 13px;
        line-height: 1.6;
    }

    .it .it-sum-wait {
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr);
        align-items: center;
        gap: 14px;
        padding: 16px;
        font-size: 13.5px;
        line-height: 1.6;
        text-align: left;
    }
    .it .it-sum-wait > i {
        display: grid;
        place-items: center;
        width: 48px;
        height: 48px;
        margin: 0;
        border-radius: 15px;
        background: var(--gold-soft);
        color: var(--gold);
        font-size: 20px;
    }
    .it .it-sum-wait br {
        display: none;
    }
    .it .it-sum-n {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 10px;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed var(--line);
        font-size: 12.5px;
    }
    .it .it-dots {
        display: inline-flex;
        gap: 4px;
    }
    .it .it-dots i {
        width: 18px;
        height: 6px;
        border-radius: 999px;
        background: #efe8db;
    }
    .it .it-dots i.on {
        background: var(--gold);
    }

    /* แท็บวิชา : แถบเต็มความกว้างจอ ขอบจาง (บอกว่าเลื่อนได้) · เว้นล่างให้เงาแท็บที่เลือกไม่ถูกตัด */
    .it .it-tabs {
        margin: 0 -16px 10px;
        padding: 4px 16px 14px;
        scroll-padding: 0 16px;
        scroll-snap-type: x proximity;
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 28px), transparent);
    }
    .it .it-tab {
        scroll-snap-align: start;
    }

    .it .it-subj {
        gap: 12px;
    }
    .it .it-card {
        border-radius: 18px;
    }
    /* หัววิชา : แถวบน ภาค (ซ้าย) + ป้ายสถานะ (ขวา) · ไอคอน + ชื่อวิชา · คำอธิบาย 2 บรรทัด + อ่านต่อ */
    .it .it-subj-head {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "tag tag badge"
            "ic h3 h3"
            "p p p"
            "more more more";
        align-items: center;
        gap: 0 12px;
        padding: 14px 16px 0;
    }
    .it .it-subj-head .tx {
        display: contents;
    }
    .it .it-subj-head .tag {
        grid-area: tag;
        justify-self: start;
        padding: 0;
        background: none;
        font-size: 12px;
        line-height: 1.45;
        white-space: normal;
    }
    .it .it-subj-head .badge {
        grid-area: badge;
        padding: 2px 10px;
        font-size: 12px;
    }
    .it .it-subj-head .ic {
        grid-area: ic;
        width: 38px;
        height: 38px;
        margin-top: 8px;
        border-radius: 12px;
        font-size: 16px;
    }
    .it .it-subj-head h3 {
        grid-area: h3;
        margin: 8px 0 0;
        font-size: 18px;
        line-height: 1.3;
    }
    .it .it-subj-head p {
        grid-area: p;
        margin-top: 8px;
        font-size: 13px;
        line-height: 1.6;
    }
    .it .it-subj-head p.it-clamp:not(.open) {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
    }
    /* ตั๋ว + แถบล่าง : ระยะขอบแคบลง */
    .it .it-when {
        margin: 12px 16px 0;
        border-radius: 16px;
    }
    .it .it-when:last-child {
        margin-bottom: 16px;
    }
    .it .it-pass {
        gap: 10px;
        padding: 12px 14px;
    }
    .it .it-pass-t small {
        font-size: 11.5px;
    }
    .it .it-pass-t b {
        font-size: 22px;
    }
    .it .it-pass-t b small {
        font-size: 12px;
    }
    .it .it-pass-t span {
        font-size: 12px;
    }
    .it .it-pass-m span {
        font-size: 11.5px;
    }
    .it .it-spec {
        gap: 2px 16px;
        padding: 10px 14px 12px;
    }
    .it .it-spec small {
        font-size: 11.5px;
    }
    .it .it-spec b {
        font-size: 14px;
    }
    .it .it-card .fc-cta {
        margin-top: 12px;
        padding: 12px 16px 16px;
        gap: 10px 12px;
    }
    .it .it-card .fc-cta-ic {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 16px;
    }
    .it .it-card .fc-cta .tx b {
        font-size: 15px;
        line-height: 1.45;
    }
    .it .it-card .fc-cta .tx p {
        font-size: 13px;
        line-height: 1.55;
    }
    .it .it-more {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-top: 4px;
        padding: 2px 0;
        border: 0;
        background: none;
        color: var(--gold-dark);
        font-family: inherit;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
    }
    .it .it-more i {
        font-size: 10px;
    }
    .it .it-subj-head .it-more {
        grid-area: more;
        justify-self: start;
        margin-top: 2px;
    }

    .it .it-subj-head:last-child {
        padding-bottom: 16px;
    }
}

@media screen and (max-width: 480px) {
    .it .sec-head h2 {
        font-size: 20px;
    }
    .it .it-sum-wait {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }
    .it .it-sum-wait > i {
        width: 44px;
        height: 44px;
        border-radius: 13px;
        font-size: 18px;
    }
    .it .it-tabs {
        margin: 0 -12px 10px;
        padding: 4px 12px 14px;
        scroll-padding: 0 12px;
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 24px), transparent);
        mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 24px), transparent);
    }
    .it .it-subj-head {
        gap: 10px 12px;
        padding: 16px 14px;
    }
    .it .it-subj-head .ic {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }
    .it .it-subj-head .tx {
        flex-basis: calc(100% - 54px);
    }
    .it .it-subj-head .badge {
        margin-left: 54px;
    }
    .it .it-subj-head h3 {
        font-size: 18px;
    }
    .it .it-tab {
        height: 40px;
        padding: 0 14px;
        font-size: 13px;
    }
    .it .rank-list.it-top li {
        grid-template-columns: 32px minmax(0, 1fr) auto;
    }
}

/* ---------- การ์ดโฆษณา i-TEST PRO ก่อนตารางสอบ (index.php · สมาชิกทั่วไปที่ยังไม่ได้สมัคร) ----------
   จอคอม : รูป · ชื่อ + ป้าย PRO + ข้อความ · ปุ่มขอบทองขวา   มือถือ : รูปเล็ก + ข้อความ ปุ่มเต็มความกว้างใต้ลงมา
   ทั้งการ์ดเป็นลิงก์ไปหน้าสมัคร (ชี้ / แตะที่ไหนก็ได้ ปุ่มเปลี่ยนเป็นทองทึบ) */
.it .it-ad-sec {
    margin-top: -24px;
    margin-bottom: 36px;
}

.it .it-ad {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    padding: 20px 28px 20px 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(100deg, #f8efe0 0%, #fffdf9 38%, #fff 100%);
    box-shadow: 0 10px 28px rgba(120, 90, 40, 0.08);
    color: var(--ink);
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.it .it-ad:hover,
.it .it-ad:focus-visible {
    border-color: rgba(214, 177, 114, 0.7);
    box-shadow: 0 16px 34px rgba(120, 90, 40, 0.14);
    transform: translateY(-1px);
}

.it .it-ad-av {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 20px;
    background: #f3e6cf;
    box-shadow: inset 0 0 0 4px #fff, 0 4px 12px rgba(120, 90, 40, 0.12);
    overflow: hidden;
}

.it .it-ad-av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.it .it-ad-t {
    min-width: 0;
}

.it .it-ad-t b {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.35;
}

.it .it-ad-t b em {
    padding: 2px 12px;
    border-radius: 999px;
    background: var(--gold-soft);
    color: var(--gold-dark);
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.it .it-ad-t > span {
    display: block;
    margin-top: 6px;
    font-size: 15.5px;
    font-weight: 300;
    line-height: 1.6;
    color: var(--muted);
}

.it .it-ad-go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 54px;
    padding: 0 26px;
    border: 2px solid var(--gold);
    border-radius: 999px;
    color: var(--gold-dark);
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .2s, color .2s;
}

.it .it-ad-go i {
    transition: transform .2s;
}

.it .it-ad:hover .it-ad-go,
.it .it-ad:focus-visible .it-ad-go {
    background: var(--gold);
    color: #fff;
}

.it .it-ad:hover .it-ad-go i {
    transform: translateX(3px);
}

@media screen and (max-width: 860px) {
    .it .it-ad-sec {
        margin-top: -14px;
        margin-bottom: 28px;
    }
    .it .it-ad {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px 14px;
        padding: 16px;
        border-radius: 20px;
    }
    .it .it-ad-av {
        align-self: start;
        width: 54px;
        height: 54px;
        border-radius: 15px;
        box-shadow: inset 0 0 0 3px #fff, 0 3px 10px rgba(120, 90, 40, 0.12);
    }
    .it .it-ad-t b {
        gap: 8px;
        font-size: 17px;
    }
    .it .it-ad-t b em {
        padding: 1px 9px;
        font-size: 12px;
    }
    .it .it-ad-t > span {
        margin-top: 3px;
        font-size: 13px;
        line-height: 1.55;
    }
    .it .it-ad-go {
        grid-column: 1 / -1;
        height: 44px;
        font-size: 15px;
    }
}

/* มือถือ (เจ้าของเว็บขอ 2026-10-04 ลดความสูงลงครึ่งหนึ่ง) : แถวเดียว รูปเล็ก · ชื่อ + ข้อความ 2 บรรทัด · ปุ่มเล็กขวา */
@media screen and (max-width: 700px) {
    .it .it-ad {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 10px 10px 10px 12px;
        border-radius: 16px;
    }
    .it .it-ad-av {
        align-self: center;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        box-shadow: inset 0 0 0 2px #fff, 0 2px 8px rgba(120, 90, 40, 0.12);
    }
    .it .it-ad-t b {
        gap: 6px;
        font-size: 14.5px;
        line-height: 1.3;
    }
    .it .it-ad-t b em {
        padding: 0 7px;
        font-size: 10.5px;
    }
    .it .it-ad-t > span {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
        margin-top: 2px;
        font-size: 12px;
        line-height: 1.5;
    }
    .it .it-ad-go {
        grid-column: auto;
        gap: 5px;
        height: 34px;
        padding: 0 12px;
        border-width: 1.5px;
        font-size: 13px;
    }
    .it .it-ad-gl {
        display: none;
    }
    .it .it-ad-t b {
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .it .it-ad,
    .it .it-ad-go,
    .it .it-ad-go i {
        transition: none;
    }
    .it .it-pass.now .it-pass-m > i > i::after {
        animation: none;
    }
}

/* ---------- โหมดผู้ชมของผู้ดูแล (kingofexam.php $VIEW) ---------- */

/* การ์ดตารางสอบ (พื้นเข้ม) : ห้องที่เปิดอยู่ + จำนวนผู้เข้าห้อง / ส่งคำตอบ แทนปุ่มเข้าห้องสอบ */
.it .it-view-live {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(214, 177, 114, 0.35);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
}

.it .it-view-live .ic {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(63, 154, 100, 0.28);
    color: #8fe0ad;
}

.it .it-view-live .tx {
    min-width: 0;
}

.it .it-view-live .tx b {
    display: block;
    font-weight: 600;
    color: #fff;
}

.it .it-view-live .tx span {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
}

/* ผลแยกสาขาวิชา : แถวแบบ TOP 10 (ลำดับเป็นตัวเลขธรรมดา) */
.it .it-view-mj .rank-num small {
    white-space: nowrap;
}

/* ---------- ผลรายวิชา + TOP 10 บนมือถือ (เจ้าของเว็บขอ 2026-10-04 "ประหยัดพื้นที่มากที่สุด") ----------
   การ์ดคะแนน : วงเล็กลง · อันดับ 4 กลุ่มเป็นแถบ 4 ช่อง (ชื่อสั้นจาก data-s · "จาก n คน" จาก data-n)
   ผลรายหัวข้อ : ไม่มีเรดาร์ (แถบบอกตัวเลขเดียวกัน) แถวเดียว ชื่อ · ถูก x จาก y · ร้อยละ + แถบบาง · กลุ่มคะแนนเตี้ยลงครึ่งหนึ่ง
   TOP 10 : แถวกระชับ · 2 การ์ดอันดับสลับด้วยปุ่ม (it_pair_tabs) จอคอมซ่อนปุ่ม */
.it .it-seg {
    display: none;
}

@media screen and (max-width: 700px) {
    /* การ์ดคะแนนที่ได้ / ภาพรวมผู้เข้าสอบ */
    .it .it-subj .stat .it-d2 {
        display: none;
    }
    .it .it-subj .stat .ring {
        --size: 70px;
        --th: 7px;
    }
    .it .it-subj .stat .ring b {
        font-size: 17px;
    }
    .it .it-subj .stat .ring small {
        font-size: 10px;
    }
    .it .it-subj .stat .ranks {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }
    .it .it-subj .stat .ranks li {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
        min-width: 0;
        padding: 8px 4px 9px;
        border-radius: 12px;
        text-align: center;
    }
    .it .it-subj .stat .ranks li > span {
        font-size: 11.5px;
        font-weight: 500;
        line-height: 1.3;
    }
    .it .it-subj .stat .ranks li > small {
        display: none;
    }
    .it .it-subj .stat .ranks li b {
        margin-top: 2px;
        font-size: 19px;
        line-height: 1.2;
    }
    .it .it-subj .stat .ranks li b small {
        font-size: 10.5px;
    }
    .it .it-subj .stat .ranks li[data-s] > span,
    .it .it-subj .stat .ranks li[data-s] b small {
        display: none;
    }
    .it .it-subj .stat .ranks li[data-s]::before {
        content: attr(data-s);
        font-size: 11.5px;
        font-weight: 500;
        line-height: 1.3;
        color: #555;
    }
    .it .it-subj .stat .ranks li[data-n]::after {
        content: "จาก " attr(data-n) " คน";
        font-size: 10.5px;
        line-height: 1.3;
        color: var(--muted);
    }

    /* ผลรายหัวข้อ */
    .it .it-subj .radar,
    .it .it-subj .radar + .chart-lg {
        display: none;
    }
    .it .it-subj .fc-topics {
        gap: 9px;
        margin-top: 8px;
    }
    .it .it-subj .fc-topics li {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: baseline;
        gap: 4px 8px;
    }
    .it .it-subj .fc-tp-h {
        display: contents;
    }
    .it .it-subj .fc-tp-h span {
        grid-row: 1;
        grid-column: 1;
        font-size: 13.5px;
        line-height: 1.4;
    }
    .it .it-subj .fc-topics li > small {
        grid-row: 1;
        grid-column: 2;
        font-size: 11px;
        white-space: nowrap;
    }
    .it .it-subj .fc-tp-h b {
        grid-row: 1;
        grid-column: 3;
        min-width: 44px;
        font-size: 14px;
        text-align: right;
    }
    .it .it-subj .fc-topics .meter {
        grid-row: 2;
        grid-column: 1 / -1;
        height: 5px;
    }

    /* กลุ่มคะแนน : เตี้ยลง */
    .it .it-subj .hist {
        gap: 3px;
        padding-top: 22px;
    }
    .it .it-subj .hist .col {
        height: 110px;
    }
    .it .it-subj .hist .hb {
        gap: 5px;
    }

    /* TOP 10 : แถวกระชับ */
    .it .rank-list.it-top li {
        grid-template-columns: 26px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 6px 6px;
        border-radius: 12px;
    }
    .it .rank-list.it-top .rank-no {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    .it .it-top .rank-name b {
        font-size: 14px;
        line-height: 1.35;
    }
    .it .it-top .rank-name small {
        font-size: 11px;
        line-height: 1.35;
    }
    .it .rank-list.it-top .rank-num {
        font-size: 16px;
    }
    .it .rank-list.it-top .rank-num small {
        font-size: 10.5px;
    }
    .it .rank-list.it-top li:first-child {
        margin-bottom: 2px;
    }
    .it .rank-list.it-top li:first-child .rank-num {
        font-size: 18px;
    }
    .it .panel:has(> .it-top) .panel-head {
        margin-bottom: 8px;
    }

    /* 2 การ์ดอันดับ : ปุ่มสลับ แสดงทีละใบ */
    .it .it-seg {
        display: flex;
        gap: 4px;
        margin: 0;
        padding: 4px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fff;
    }
    .it #summary .it-seg {
        margin-top: 16px;
    }
    .it .it-seg + .it-pair {
        margin-top: 10px;
    }
    .it .it-subj .it-seg + .it-pair {
        margin-top: 0;
    }
    .it .it-seg button {
        flex: 1;
        min-width: 0;
        height: 36px;
        padding: 0 8px;
        border: 0;
        border-radius: 10px;
        background: none;
        color: #777;
        font-family: inherit;
        font-size: 13.5px;
        font-weight: 500;
        cursor: pointer;
    }
    .it .it-seg button[aria-selected='true'] {
        background: linear-gradient(135deg, #e3c48e, var(--gold) 55%, #c49a55);
        color: #fff;
        font-weight: 600;
        box-shadow: 0 4px 12px rgba(214, 177, 114, 0.35);
    }
    .it .it-pair[data-k='0'] > :nth-child(2),
    .it .it-pair[data-k='1'] > :nth-child(1) {
        display: none;
    }
}

/* ---------- จอคอม + แท็บเล็ต (701 px ขึ้นไป · เจ้าของเว็บขอ 2026-10-04 "ลดระยะห่างระหว่างบรรทัดลงอีก") ----------
   จุดเด่น / ต้องพัฒนา .it-gw : แบบเดียวกับมือถือ — หัวกลุ่ม + แถวละหัวข้อ ร้อยละเป็นป้าย (ไม่มีไอคอน / บรรทัดรอง)
   TOP 10 .it-top : แถวเดียว — ชื่อ · สาขาวิชา / เขต (ตัวเล็กต่อท้าย ยาวเกินตัด …) · คะแนน */
@media screen and (min-width: 701px) {
    .it .it-gw {
        gap: 0;
    }
    .it .it-gw > li {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        padding: 7px 4px;
    }
    .it .it-gw > li .li-ic,
    .it .it-gw > li > div p {
        display: none;
    }
    .it .it-gw > li > div b {
        font-size: 15px;
        font-weight: 400;
        line-height: 1.45;
    }
    .it .it-gw .it-pc {
        display: block;
        min-width: 58px;
        padding: 2px 10px;
        border-radius: 999px;
        font-size: 13px;
        font-weight: 700;
        text-align: center;
        font-variant-numeric: tabular-nums;
    }
    .it .it-gw .it-pc.ok  { background: var(--green-soft); color: var(--green); }
    .it .it-gw .it-pc.bad { background: var(--red-soft);   color: var(--red); }
    .it .it-gw > li.it-gh {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 4px 4px;
        border-top: 0;
        font-size: 13.5px;
        font-weight: 700;
    }
    .it .it-gw > li.it-gh + li {
        border-top: 0;
    }
    .it .it-gw > li.it-gh.ok  { color: var(--green); }
    .it .it-gw > li.it-gh.bad { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--red); }
    .it .it-gw > li.it-gh:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

    .it .panel:has(> .it-top) {
        padding: 18px 20px;
    }
    .it .panel:has(> .it-top) .panel-head {
        margin-bottom: 10px;
    }
    .it .rank-list.it-top li {
        grid-template-columns: 30px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 5px 10px;
        border-radius: 12px;
    }
    .it .rank-list.it-top .rank-no {
        width: 30px;
        height: 30px;
        font-size: 13.5px;
    }
    .it .it-top .rank-name {
        display: flex;
        align-items: baseline;
        gap: 10px;
        font-size: 15px;
    }
    .it .it-top .rank-name b {
        flex: 0 1 auto;
        max-width: 60%;
        line-height: 1.45;
    }
    .it .it-top .rank-name small {
        flex: 1 1 0;
        min-width: 0;
        font-size: 12.5px;
    }
    .it .rank-list.it-top .rank-num {
        font-size: 18px;
    }
    .it .rank-list.it-top .rank-num small {
        font-size: 11.5px;
    }
    .it .rank-list.it-top li:first-child {
        margin-bottom: 3px;
    }
    .it .rank-list.it-top li:first-child .rank-num {
        font-size: 20px;
    }

    /* สรุปผล 3 การ์ด .it-sum3 (ภาค ก. / ภาค ข. / คะแนนรวม · เจ้าของเว็บขอ 2026-10-04 "ลดความสูง ลดระยะห่างระหว่างบรรทัด")
       ระยะขอบ / ช่องไฟเล็กลง · วงเล็กลง · แถวอันดับ : บรรทัดชิดขึ้น (ตัวเลขอันดับเคยใช้ระยะบรรทัดของหน้า แถวจึงสูง) */
    .it .it-sum3 .stat {
        gap: 10px;
        padding: 18px 20px;
    }
    .it .it-sum3 .stat .desc {
        font-size: 13.5px;
        line-height: 1.5;
    }
    .it .it-sum3 .ring {
        --size: 80px;
        --th: 8px;
    }
    .it .it-sum3 .ranks {
        gap: 6px;
        margin: 0;
    }
    .it .it-sum3 .ranks li {
        gap: 1px 12px;
        padding: 7px 12px;
        border-radius: 12px;
    }
    .it .it-sum3 .ranks span {
        font-size: 13.5px;
        line-height: 1.35;
    }
    .it .it-sum3 .ranks li > small {
        font-size: 11.5px;
        line-height: 1.35;
    }
    .it .it-sum3 .ranks b {
        font-size: 20px;
        line-height: 1.15;
    }
    .it .it-sum3 .ranks b small {
        font-size: 10.5px;
        line-height: 1.2;
    }
}

/* ---------- จอคอม (861 px ขึ้นไป · เจ้าของเว็บขอ 2026-10-04 "ประหยัดพื้นที่มากที่สุด") ----------
   การ์ดโฆษณา PRO : แถวเดียวเตี้ยลงครึ่งหนึ่ง (ข้อความบรรทัดเดียว ยาวเกินตัด …)
   การ์ดวิชา : ระยะขอบ / ตัวอักษรกระชับขึ้น
   ผลสอบของวิชา (.it-done) : กริด 2 คอลัมน์ — การ์ดคะแนน | กลุ่มคะแนน (แท่งสูงเต็มการ์ด) · ผลรายหัวข้อเต็มแถว (หัวข้อเรียง 2 คอลัมน์ ไม่มีเรดาร์) · TOP 10
   ไม่ย้าย HTML : .grid ของคะแนน + หัวข้อเป็น display: contents ลูกจึงวางในกริดของ .it-subj ได้ · มือถือ / แท็บเล็ตเรียงเหมือนเดิม
   การ์ดคะแนน : อันดับ 4 กลุ่มเป็นแถบ 4 ช่องแบบมือถือ (ชื่อสั้น data-s · ชื่อเต็มอยู่ใน title) */
@media screen and (min-width: 861px) {
    .it .it-ad {
        gap: 16px;
        padding: 8px 14px 8px 10px;
        border-radius: 18px;
    }
    .it .it-ad-av {
        width: 46px;
        height: 46px;
        border-radius: 13px;
        box-shadow: inset 0 0 0 3px #fff, 0 3px 8px rgba(120, 90, 40, 0.12);
    }
    .it .it-ad-t b {
        gap: 8px;
        font-size: 17px;
        line-height: 1.3;
    }
    .it .it-ad-t b em {
        padding: 0 9px;
        font-size: 11.5px;
    }
    .it .it-ad-t > span {
        overflow: hidden;
        margin-top: 1px;
        font-size: 13.5px;
        line-height: 1.5;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .it .it-ad-go {
        gap: 8px;
        height: 40px;
        padding: 0 20px;
        border-width: 1.5px;
        font-size: 15px;
    }

    /* การ์ดวิชา */
    .it .it-subj-head {
        gap: 14px;
        padding: 16px 20px 0;
    }
    .it .it-subj-head .ic {
        width: 44px;
        height: 44px;
        border-radius: 14px;
        font-size: 19px;
    }
    .it .it-subj-head h3 {
        margin: 4px 0 0;
        font-size: 19px;
    }
    .it .it-subj-head p {
        font-size: 13.5px;
        line-height: 1.55;
    }
    .it .it-subj-head:last-child {
        padding-bottom: 16px;
    }
    .it .it-when {
        margin: 12px 20px 0;
        border-radius: 16px;
    }
    .it .it-when:last-child {
        margin-bottom: 18px;
    }
    .it .it-pass {
        gap: 14px;
        padding: 10px 18px;
    }
    .it .it-pass-t b {
        margin: 0 0 1px;
        font-size: 22px;
    }
    .it .it-pass-t span {
        font-size: 12.5px;
    }
    .it .it-spec {
        padding: 10px 18px;
    }
    .it .it-card .fc-cta {
        margin-top: 14px;
        padding: 12px 20px;
    }

    /* แสดงทีละวิชา (สคริปต์ซ่อนวิชาอื่น) : วิชาถัดจากวิชาที่ซ่อนไม่ต้องเว้น 40 px (เดิมวิชา 2-5 ห่างแถบแท็บมากกว่าวิชาแรก) */
    .it .it-subj[hidden] + .it-subj {
        margin-top: 0;
    }

    /* ผลสอบของวิชา : กริด 2 คอลัมน์ */
    .it .it-done {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "card   card"
            "score  hist"
            "topics topics"
            "top    top";
    }
    .it .it-done > .it-card { grid-area: card; }
    .it .it-done > .grid:not(.it-pair) { display: contents; }
    .it .it-done > .grid:not(.it-pair) > .stat { grid-area: score; }
    .it .it-done > .grid:not(.it-pair) > .panel { grid-area: topics; }
    .it .it-done > .panel { grid-area: hist; }
    .it .it-done > .it-pair { grid-area: top; }

    .it .it-done .stat,
    .it .it-done .panel {
        padding: 18px 20px;
    }
    .it .it-done .stat {
        gap: 12px;
    }
    .it .it-done .panel-head {
        margin-bottom: 10px;
    }

    /* การ์ดคะแนน : วงเล็กลง · อันดับเป็นแถบ 4 ช่อง (โหมดผู้ชม : ชื่อจาก span + ตัวเลข + หน่วย) */
    .it .it-done .stat .ring {
        --size: 80px;
        --th: 8px;
    }
    .it .it-done .stat .ranks {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
    }
    .it .it-done .stat .ranks li {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
        min-width: 0;
        padding: 9px 6px 10px;
        border-radius: 12px;
        text-align: center;
    }
    .it .it-done .stat .ranks li > span {
        max-width: 100%;
        overflow: hidden;
        font-size: 12.5px;
        font-weight: 500;
        line-height: 1.35;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .it .it-done .stat .ranks li > small {
        display: none;
    }
    .it .it-done .stat .ranks li b {
        margin-top: 2px;
        font-size: 22px;
        line-height: 1.2;
    }
    .it .it-done .stat .ranks li b small {
        font-size: 11px;
    }
    .it .it-done .stat .ranks li[data-s] > span,
    .it .it-done .stat .ranks li[data-s] b small {
        display: none;
    }
    .it .it-done .stat .ranks li[data-s]::before {
        content: attr(data-s);
        font-size: 12.5px;
        font-weight: 500;
        line-height: 1.35;
        color: #555;
    }
    .it .it-done .stat .ranks li[data-n]::after {
        content: "จาก " attr(data-n) " คน";
        font-size: 11.5px;
        line-height: 1.35;
        color: var(--muted);
    }

    /* กลุ่มคะแนน : แท่งสูงเต็มการ์ด (เท่าการ์ดคะแนนข้าง ๆ) */
    .it .it-done > .panel {
        display: flex;
        flex-direction: column;
    }
    .it .it-done > .panel .hist {
        flex: 1;
        align-items: stretch;
        gap: 6px;
        min-height: 120px;
        padding-top: 22px;
    }
    .it .it-done > .panel .hist .hb {
        gap: 6px;
    }
    .it .it-done > .panel .hist .col {
        flex: 1;
        height: auto;
    }

    /* ผลรายหัวข้อ : ไม่มีเรดาร์ (แถบบอกตัวเลขเดียวกัน) · หัวข้อเรียง 2 คอลัมน์ แถวละหัวข้อ ชื่อ · ถูก x จาก y · ร้อยละ + แถบบาง */
    .it .it-done .radar,
    .it .it-done .radar + .chart-lg {
        display: none;
    }
    .it .it-done .fc-topics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 40px;
        margin-top: 4px;
    }
    .it .it-done .fc-topics li {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: baseline;
        gap: 4px 10px;
    }
    .it .it-done .fc-tp-h {
        display: contents;
    }
    .it .it-done .fc-tp-h span {
        grid-row: 1;
        grid-column: 1;
        font-size: 14px;
        line-height: 1.45;
    }
    .it .it-done .fc-topics li > small {
        grid-row: 1;
        grid-column: 2;
        white-space: nowrap;
    }
    .it .it-done .fc-tp-h b {
        grid-row: 1;
        grid-column: 3;
        min-width: 50px;
        font-size: 14.5px;
        text-align: right;
    }
    .it .it-done .fc-topics .meter {
        grid-row: 2;
        grid-column: 1 / -1;
        height: 6px;
    }

    /* สมาชิก : ผลสอบรายวิชาไม่มี TOP 10 แล้ว (เจ้าของเว็บขอ 2026-10-06 · .it-notop) → ไม่มีแถว top ท้ายกริด · โหมดผู้ชมยังมี */
    .it .it-done.it-notop {
        grid-template-areas:
            "card   card"
            "score  hist"
            "topics topics";
    }
}

/* ============================================================
   หน้าการแจ้งเตือน (notify.php · เจ้าของเว็บขอ 2026-10-11) — <main class='pp ms it nt'>
   แถว : ไอคอนเล็ก (สี่เหลี่ยมมนทอง) · หัวข้อ · ข้อความย่อ 2 บรรทัด · เวลา + ป้ายใหม่ · แตะกาง (<details>) = ข้อความเต็ม + รายละเอียด + ปุ่ม
   ใหม่ = พื้นครีมเข้ม + จุดแดงที่มุมไอคอน · การ์ดท้ายหน้า = รับการแจ้งเตือนบนโทรศัพท์ (.ok = เครื่องนี้เปิดรับแล้ว)
   ============================================================ */
.it.nt .nt-wrap {
    width: min(760px, 100% - 32px);
}

.it.nt .nt-ph {
    padding-bottom: 22px;
}

.it.nt .nt-sec + .nt-sec {
    margin-top: 26px;
}

.it.nt .nt-h {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 600;
}

.it.nt .nt-h b {
    min-width: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #e0463a;
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

.it.nt .nt-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(120, 90, 40, 0.07);
}

.it.nt .nt-item + .nt-item {
    border-top: 1px solid var(--line2);
}

.it.nt .nt-item.new {
    background: #fff8ec;
}

.it.nt .nt-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    list-style: none;
}

.it.nt summary.nt-row {
    cursor: pointer;
    transition: background .15s;
}

.it.nt summary.nt-row::-webkit-details-marker {
    display: none;
}

.it.nt summary.nt-row::marker {
    content: "";
}

.it.nt summary.nt-row:hover {
    background: rgba(214, 177, 114, 0.08);
}

.it.nt .nt-ic {
    position: relative;
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(145deg, #e6c88f, var(--gold));
    color: #fff;
    font-size: 17px;
    box-shadow: 0 6px 14px rgba(214, 177, 114, 0.35);
}

.it.nt .nt-item.new .nt-ic::after {
    content: "";
    position: absolute;
    top: -3px;
    right: -3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e0463a;
    box-shadow: 0 0 0 2px #fff8ec;
}

.it.nt .nt-tx {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
}

.it.nt .nt-t {
    display: block;
    font-size: 16px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.it.nt .nt-sum {
    display: -webkit-box;
    margin-top: 2px;
    overflow: hidden;
    color: #4a4a4a;
    font-size: 14.5px;
    overflow-wrap: anywhere;
    white-space: pre-line;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.it.nt article .nt-sum {
    display: block;   /* ข้อความสั้น (ไม่กาง) แสดงเต็ม */
}

.it.nt details[open] .nt-sum {
    display: none;   /* กางแล้ว : ข้อความเต็มอยู่ด้านล่าง (ลิงก์กดได้) */
}

.it.nt .nt-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12.5px;
}

.it.nt .nt-new {
    padding: 0 8px;
    border-radius: 999px;
    background: #fde3e0;
    color: #c0392b;
    font-size: 11.5px;
    font-style: normal;
    font-weight: 600;
    line-height: 19px;
}

.it.nt .nt-has i {
    margin-right: 4px;
    font-size: 11px;
}

.it.nt .nt-car {
    flex: none;
    margin-top: 14px;
    color: var(--muted);
    font-size: 12px;
    transition: transform .2s;
}

.it.nt details[open] .nt-car {
    transform: rotate(180deg);
}

.it.nt .nt-more {
    padding: 0 18px 18px 76px;   /* ตรงกับข้อความ (ไอคอน 44 + ระยะ 14 + ขอบ 18) */
}

.it.nt .nt-body,
.it.nt .nt-detail {
    color: #333;
    font-size: 15px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.it.nt .nt-body {
    font-weight: 500;
}

.it.nt .nt-detail {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.it.nt .nt-body p,
.it.nt .nt-detail p {
    margin: 0 0 0.75em;
}

.it.nt .nt-body p:last-child,
.it.nt .nt-detail p:last-child {
    margin-bottom: 0;
}

.it.nt .nt-body a,
.it.nt .nt-detail a {
    color: var(--gold-dark);
    font-weight: 500;
    text-decoration: underline;
    word-break: break-all;
}

.it.nt .nt-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-top: 16px;
}

.it.nt .nt-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 18px;
    border-radius: 999px;
    background: linear-gradient(145deg, #e2c287, var(--gold));
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(214, 177, 114, 0.4);
}

.it.nt .nt-btn:hover {
    filter: brightness(1.04);
}

.it.nt .nt-when {
    color: var(--muted);
    font-size: 12.5px;
}

.it.nt .nt-when i {
    margin-right: 5px;
}

.it.nt .nt-cap {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.it.nt .nt-empty {
    padding: 44px 20px;
    border: 1px dashed #e7d6b6;
    border-radius: 22px;
    background: #fff;
    text-align: center;
}

.it.nt .nt-empty-ic {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    border-radius: 20px;
    background: var(--gold-soft);
    color: var(--gold-dark);
    font-size: 26px;
}

.it.nt .nt-empty b {
    display: block;
    font-size: 18px;
    font-weight: 600;
}

.it.nt .nt-empty p {
    max-width: 420px;
    margin: 6px auto 0;
    color: var(--muted);
    font-size: 14.5px;
}

.it.nt .nt-app {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(135deg, #fffaf1, #fff);
}

.it.nt .nt-app-ic img {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(120, 90, 40, 0.18);
}

.it.nt .nt-app-tx {
    flex: 1;
    min-width: 0;
    line-height: 1.45;
}

.it.nt .nt-app-tx b {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.it.nt .nt-app-tx span {
    display: block;
    color: #666;
    font-size: 13px;
}

.it.nt .nt-app.ok .nt-app-tx b {
    color: var(--green);
}

.it.nt .nt-app.ok .nt-app-tx b::before {
    content: "\f058";
    margin-right: 6px;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

.it.nt .nt-app-go {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--gold);
    border-radius: 999px;
    background: #fff;
    color: var(--gold-dark);
    font-size: 13.5px;
    font-weight: 600;
}

.it.nt .nt-app-go[hidden] {
    display: none;
}

.it.nt .nt-app-go i {
    font-size: 10px;
}

@media screen and (max-width: 600px) {
    .it.nt .nt-row {
        gap: 12px;
        padding: 14px 14px;
    }
    .it.nt .nt-ic {
        width: 40px;
        height: 40px;
        border-radius: 13px;
        font-size: 15px;
    }
    .it.nt .nt-t {
        font-size: 15px;
    }
    .it.nt .nt-sum {
        font-size: 14px;
    }
    .it.nt .nt-more {
        padding: 0 14px 16px 14px;
    }
    .it.nt .nt-body,
    .it.nt .nt-detail {
        font-size: 14.5px;
    }
    .it.nt .nt-foot .nt-btn {
        justify-content: center;
        width: 100%;
    }
    .it.nt .nt-list {
        border-radius: 18px;
    }
    .it.nt .nt-app {
        flex-wrap: wrap;
    }
    .it.nt .nt-app-tx {
        flex-basis: calc(100% - 58px);
    }
    .it.nt .nt-app-go {
        justify-content: center;
        width: 100%;
    }
}
