/* ============================================================
   i-TEST PRO (โฟลเดอร์ pro/) — ชุดสไตล์กลางของทุกหน้า
   โทนเดียวกับเว็บครูผู้ช่วย : หน้าแรก (home.css) + หน้าจัดการ (year_admin.css)
   ทอง #D6B172 / ครีม / ขาว  ·  โหลดผ่าน pro_head() ใน ui.php แทน report.css เดิม
   ทุกคลาสอยู่ใต้ .pp (แท็ก <main class='pp'>) จึงไม่ชนกับหน้าเก่าที่ยังใช้ report.css
   ============================================================ */

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: #fff;
    font-family: 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}

.pp {
    --gold: #D6B172;
    --gold-dark: #a8844a;
    --gold-soft: rgba(214, 177, 114, 0.14);
    --cream: #faf4eb;
    --ink: #1f1f1f;
    --muted: #8d8d8d;
    --line: #eee4d3;
    --line2: #f4efe6;
    --green: #3f9a64;
    --green-soft: rgba(63, 154, 100, 0.12);
    --red: #e05b5b;
    --red-soft: rgba(224, 91, 91, 0.12);
    --amber: #d18f1e;
    --amber-soft: rgba(209, 143, 30, 0.14);
    --radius: 22px;

    display: block;
    min-height: 100vh;
    padding: 65px 0 72px;   /* 65px = แถบเมนูด้านบน (menu.css) */
    color: var(--ink);
    font-size: 16px;
    line-height: 1.55;
    text-align: left;
    background: linear-gradient(180deg, var(--cream) 0, #fff 620px);
}

.pp *,
.pp *::before,
.pp *::after {
    box-sizing: border-box;
}

.pp a {
    color: inherit;
    text-decoration: none;
}

.pp img {
    max-width: 100%;
}

.pp a:focus-visible,
.pp button:focus-visible,
.pp [tabindex]:focus-visible {
    outline: 3px solid rgba(214, 177, 114, 0.6);
    outline-offset: 2px;
}

.pp .wrap {
    width: min(1200px, 100% - 32px);
    margin: 0 auto;
}

.pp .sec {
    margin-bottom: 56px;
}

.pp .num {
    font-variant-numeric: tabular-nums;
}

.pp .muted {
    color: var(--muted);
}

/* ---------- ป้าย / หัวข้อ ---------- */

.pp .chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 6px 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--gold);
    color: var(--gold-dark);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

/* หัวหน้าของหน้าทั่วไป (หน้าที่ไม่มี hero) : ชื่อหน้า + คำอธิบาย ซ้าย  ส่วนเสริม ขวา */
.pp .page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px 32px;
    padding: 40px 0 28px;
}

.pp .page-head h1 {
    margin: 14px 0 4px;
    font-size: 36px;
    font-weight: 500;
    line-height: 1.25;
}

.pp .page-head p {
    margin: 0;
    max-width: 720px;
    font-size: 16px;
    font-weight: 300;
    color: var(--muted);
}

.pp .sec-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}

.pp .sec-head h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 500;
    line-height: 1.3;
}

.pp .sec-head h2 > i {
    margin-right: 10px;
    color: var(--gold);
    font-size: 0.8em;
}

.pp .sec-head p {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 300;
    color: var(--muted);
}

/* ลิงก์ "ดูทั้งหมด" ขวาของหัวข้อ */
.pp .more {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 2px solid var(--gold);
    color: var(--gold-dark);
    font-size: 14px;
    white-space: nowrap;
    transition: background .2s, color .2s;
}

.pp .more:hover {
    background: var(--gold);
    color: #fff;
}

.pp .tag {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--gold-soft);
    color: var(--gold-dark);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

/* สถานะ : ok = ผ่าน/ดี  bad = ไม่ผ่าน  warn = ปานกลาง  gold = แนะนำ */
.pp .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    background: #f3f3f3;
    color: #777;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.pp .badge.ok   { background: var(--green-soft); color: var(--green); }
.pp .badge.bad  { background: var(--red-soft);   color: var(--red); }
.pp .badge.warn { background: var(--amber-soft); color: var(--amber); }
.pp .badge.gold { background: var(--gold);       color: #fff; }

.pp .dot {
    display: inline-block;
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
}

.pp .dot.ok   { background: var(--green); }
.pp .dot.bad  { background: var(--red); }
.pp .dot.warn { background: var(--amber); }
.pp .dot.gold { background: var(--gold); }

/* ---------- ปุ่ม ---------- */

.pp .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--gold);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(214, 177, 114, 0.4);
    transition: background .2s, color .2s, box-shadow .2s, transform .2s;
}

.pp .btn:hover {
    background: var(--gold-dark);
}

.pp .btn.sm {
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
    box-shadow: none;
}

.pp .btn.block {
    display: flex;
    width: 100%;
}

/* ขอบทอง พื้นขาว */
.pp .btn.line {
    background: #fff;
    border: 2px solid var(--gold);
    color: var(--gold-dark);
    box-shadow: none;
}

.pp .btn.line:hover {
    background: var(--gold);
    color: #fff;
}

/* ทองไล่เฉด มีแสงวิ่ง : ใช้บนพื้นเข้ม */
.pp .btn.shine {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ecd3a4, var(--gold) 45%, #c49a55);
    color: var(--ink);
    font-weight: 600;
}

.pp .btn.shine:hover {
    transform: translateY(-1px);
}

.pp .btn.shine::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: pp-shine 4s ease-in-out 1s infinite;
    pointer-events: none;
}

@keyframes pp-shine {
    0% { left: -60%; }
    35%, 100% { left: 130%; }
}

.pp .btn.off,
.pp .btn:disabled {
    background: #e6ddcd;
    color: #9a8f7c;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
}

/* ---------- การ์ด ---------- */

.pp .card,
.pp .panel {
    min-width: 0;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.pp .panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.pp .panel-head h3 {
    margin: 0;
    font-size: 21px;
    font-weight: 500;
    line-height: 1.35;
}

.pp .panel-head h3 > i {
    margin-right: 8px;
    color: var(--gold);
}

.pp .panel-head h3 small {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 300;
    color: var(--muted);
}

/* การ์ดพื้นเข้ม (แบบกล่องนับถอยหลังหน้าแรกเว็บครูผู้ช่วย) */
.pp .dark {
    position: relative;
    padding: 28px;
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 8% 0%, rgba(214, 177, 114, 0.32), transparent 45%),
        radial-gradient(circle at 100% 100%, rgba(214, 177, 114, 0.16), transparent 40%),
        linear-gradient(135deg, #2c231a, #1b1712);
    color: #fff;
    box-shadow: 0 16px 36px rgba(60, 42, 16, 0.25);
    overflow: hidden;
}

/* ---------- ตารางกริด ---------- */

.pp .grid {
    display: grid;
    gap: 20px;
}

.pp .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pp .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pp .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pp .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ---------- วงแหวนคะแนน (CSS ล้วน ไม่ต้องโหลดสคริปต์กราฟ) ----------
   <span class='ring ok' style='--p:61'><b>61%</b><small>ร้อยละ</small></span>
   --p = 0-100  ·  ok เขียว  bad แดง  warn ส้ม  (ไม่ใส่ = ทอง)  ·  sm = วงเล็ก */

.pp .ring {
    --p: 0;
    --c: var(--gold);
    --size: 92px;
    --th: 9px;
    --bg: #fff;

    position: relative;
    flex: none;
    display: grid;
    place-content: center;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: conic-gradient(var(--c) calc(var(--p) * 1%), #efe7d8 0);
    text-align: center;
    line-height: 1.1;
}

.pp .ring::before {
    content: "";
    position: absolute;
    inset: var(--th);
    border-radius: 50%;
    background: var(--bg);
}

.pp .ring > * {
    position: relative;
}

.pp .ring b {
    font-size: calc(var(--size) * 0.24);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pp .ring small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 300;
    color: var(--muted);
}

.pp .ring.ok   { --c: var(--green); }
.pp .ring.bad  { --c: var(--red); }
.pp .ring.warn { --c: var(--amber); }

.pp .ring.sm {
    --size: 52px;
    --th: 6px;
}

.pp .ring.sm b {
    font-size: 14px;
}

/* ---------- แถบความคืบหน้า ---------- */

.pp .meter {
    height: 6px;
    border-radius: 999px;
    background: var(--gold-soft);
    overflow: hidden;
}

.pp .meter > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--gold);
}

.pp .meter.ok > span   { background: var(--green); }
.pp .meter.bad > span  { background: var(--red); }
.pp .meter.warn > span { background: var(--amber); }

/* ---------- hero (หน้าแรก) ---------- */

.pp .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: 32px;
    padding: 44px 0 48px;
}

.pp .hero h1 {
    margin: 16px 0 4px;
    font-size: 40px;
    font-weight: 500;
    line-height: 1.25;
}

.pp .hero h1 span {
    color: var(--gold-dark);
}

.pp .hero-lead {
    margin: 0;
    font-size: 17px;
    font-weight: 300;
    color: var(--muted);
}

.pp .hero-total {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 18px 0 4px;
}

.pp .hero-total .num {
    font-size: 96px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -2px;
    color: var(--gold);
}

.pp .hero-total .num.ok   { color: var(--green); }
.pp .hero-total .num.bad  { color: var(--red); }
.pp .hero-total .num.warn { color: var(--amber); }

.pp .hero-total .unit {
    font-size: 22px;
    font-weight: 300;
}

.pp .progress-card {
    max-width: 540px;
    margin-top: 18px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(214, 177, 114, 0.18);
}

.pp .progress-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 15px;
}

.pp .progress-head b {
    color: var(--gold-dark);
    font-weight: 600;
}

.pp .progress {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: var(--gold-soft);
}

.pp .progress > span {
    display: block;
    min-width: 10px;
    max-width: 100%;
    height: 100%;
    border-radius: 999px;
    background: var(--gold);
}

.pp .progress > span.ok   { background: var(--green); }
.pp .progress > span.bad  { background: var(--red); }
.pp .progress > span.warn { background: var(--amber); }

/* ขีดแบ่งเกณฑ์บนแถบ */
.pp .progress > i {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    margin-left: -1px;
    border-radius: 2px;
    background: rgba(31, 31, 31, 0.25);
}

.pp .progress-lg {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

.pp .progress-lg span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pp .hero-note {
    max-width: 560px;
    margin: 14px 0 0;
    font-size: 13px;
    font-weight: 300;
    color: var(--muted);
}

/* ---------- ภารกิจประจำวัน (การ์ดเข้มใน hero) ---------- */

.pp .mission-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pp .mission-ic {
    flex: none;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(145deg, #ecd29c, #c49a55);
    color: var(--ink);
    font-size: 24px;
    box-shadow: 0 8px 20px rgba(214, 177, 114, 0.35);
}

.pp .mission-head .t {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    color: #f6e7c8;
}

.pp .mission-head .s {
    font-size: 15px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.78);
}

.pp .mission-topic {
    margin: 22px 0 18px;
    padding: 16px 18px;
    border: 1px solid rgba(214, 177, 114, 0.35);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
}

.pp .mission-topic small {
    display: block;
    font-size: 13px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
}

.pp .mission-topic b {
    display: block;
    margin-top: 2px;
    font-size: 19px;
    font-weight: 500;
    line-height: 1.4;
    background: linear-gradient(180deg, #f8e6bd, var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.pp .mission-done {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 44px;
    border-radius: 999px;
    background: rgba(63, 154, 100, 0.18);
    color: #a6e3bf;
    font-weight: 500;
}

.pp .mission-note {
    margin: 16px 0 0;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.66);
}

.pp .mission-note i {
    margin-right: 4px;
    color: var(--gold);
}

/* ---------- ประกาศ (เช่น หมดอายุสมาชิก) ---------- */

.pp .alert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 18px 22px;
    border: 1px solid rgba(214, 177, 114, 0.45);
    border-radius: 18px;
    background: #fffaf1;
}

.pp .alert-ic {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--gold-soft);
    color: var(--gold-dark);
    font-size: 20px;
}

.pp .alert-body {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.6;
}

.pp .alert-body b {
    display: block;
    font-size: 17px;
    font-weight: 600;
}

.pp .alert.bad {
    border-color: rgba(224, 91, 91, 0.35);
    background: #fff6f5;
}

.pp .alert.bad .alert-ic {
    background: var(--red-soft);
    color: var(--red);
}

/* ---------- แพ็กเกจ PRO หมดอายุ / รอตรวจการต่ออายุ (pro_exp_bar / pro_lock_open ใน ui.php) ---------- */

/* แถบแจ้งแบบย่อ : จอคอมบรรทัดเดียว */
.pp .pexp {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 14px;
    padding: 8px 10px 8px 12px;
    border: 1px solid rgba(224, 91, 91, 0.3);
    border-radius: 14px;
    background: #fff6f5;
}

.pp .pexp.pend {
    border-color: rgba(214, 177, 114, 0.45);
    background: #fffaf1;
}

.pp .pexp-ic {
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--red-soft);
    color: var(--red);
    font-size: 13px;
}

.pp .pexp.pend .pexp-ic {
    background: var(--gold-soft);
    color: var(--gold-dark);
}

.pp .pexp-t {
    flex: 1 1 240px;
    min-width: 0;
    margin: 0;
    color: #666;
    font-size: 13.5px;
    font-weight: 300;
    line-height: 1.4;
}

.pp .pexp-t b {
    margin-right: 8px;
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 600;
}

.pp .pexp-acts {
    display: flex;
    gap: 8px;
}

.pp .pexp .btn.sm {
    height: 32px;
    padding: 0 13px;
    font-size: 13.5px;
}

/* ล็อกหน้า : เนื้อหาเบลอ กดไม่ได้ + การ์ดล็อกลอยด้านบน  ความสูงของเนื้อหาที่เบลอจำกัดไว้ ค่อย ๆ จางหายด้านล่าง */
.pp .plock-wrap {
    position: relative;
}

.pp .plock {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    justify-content: center;
    padding: 56px 16px 0;
    pointer-events: none;
}

.pp .plock-card {
    width: min(520px, 100%);
    padding: 24px 24px 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 24px 60px rgba(44, 35, 26, 0.18);
    text-align: center;
    pointer-events: auto;
}

.pp .plock-ic {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: var(--gold);
    color: #fff;
    font-size: 20px;
    box-shadow: 0 8px 20px rgba(214, 177, 114, 0.45);
}

.pp .plock-card > b {
    display: block;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    text-wrap: balance;
}

.pp .plock-card > p {
    margin: 6px 0 16px;
    color: #666;
    font-size: 14.5px;
    font-weight: 300;
    line-height: 1.6;
    text-wrap: balance;
}

.pp .plock-acts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.pp .plock-blur {
    max-height: 1100px;
    overflow: hidden;
    filter: blur(6px);
    opacity: 0.6;
    pointer-events: none;
    user-select: none;
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
    mask-image: linear-gradient(180deg, #000 55%, transparent);
}

@media screen and (max-width: 600px) {
    .pp .pexp-acts {
        width: 100%;
    }
    .pp .pexp-acts .btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 0 8px;
    }
    .pp .plock {
        padding-top: 28px;
    }
    .pp .plock-card {
        padding: 20px 16px 16px;
    }
    .pp .plock-acts .btn {
        width: 100%;
    }
}

@media print {
    .pp .plock-blur {
        display: none;
    }
}

/* ---------- ไอคอนวิชา (5 วิชา) ---------- */

.pp .subj {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.pp a.subj:hover {
    border-color: var(--gold);
    box-shadow: 0 12px 28px rgba(214, 177, 114, 0.25);
    transform: translateY(-2px);
}

.pp .subj .ic {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    border-radius: 15px;
    background: var(--gold-soft);
    color: var(--gold-dark);
    font-size: 21px;
    transition: background .2s, color .2s;
}

.pp a.subj:hover .ic {
    background: var(--gold);
    color: #fff;
}

.pp .subj .part {
    position: absolute;
    top: 20px;
    right: 18px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.pp .subj b {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.35;
}

.pp .subj small {
    font-size: 14px;
    font-weight: 300;
    color: var(--muted);
}

.pp .subj .go {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    color: var(--gold-dark);
    font-size: 14px;
    font-weight: 500;
}

.pp .subj .go i {
    transition: transform .2s;
}

.pp a.subj:hover .go i {
    transform: translateX(3px);
}

/* ---------- การ์ดคะแนน (สรุปผล) ---------- */

.pp .stat {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.pp .stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.pp .stat .label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
    font-weight: 500;
}

.pp .stat .label i {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--gold-soft);
    color: var(--gold-dark);
    font-size: 15px;
    font-style: normal;
}

.pp .stat .desc {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 300;
    color: var(--muted);
}

.pp .stat .value {
    font-size: 44px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.pp .stat .value small {
    margin-left: 6px;
    font-size: 16px;
    font-weight: 300;
    color: var(--muted);
}

.pp .stat .badge {
    align-self: flex-start;
}

.pp .ranks {
    display: grid;
    gap: 8px;
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
}

.pp .ranks li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 12px;
    padding: 10px 14px;
    border-radius: 14px;
    background: #faf6ef;
}

.pp .ranks span {
    font-size: 14px;
    line-height: 1.35;
}

.pp .ranks small {
    grid-column: 1;
    font-size: 12px;
    font-weight: 300;
    color: var(--muted);
}

.pp .ranks b {
    grid-column: 2;
    grid-row: 1 / 3;
    font-size: 22px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pp .ranks b small {
    display: block;
    font-size: 11px;
    text-align: right;
}

/* การ์ดคะแนนรวม : พื้นทอง */
.pp .stat.main {
    background: linear-gradient(160deg, #dcbb82, var(--gold) 55%, #c9a261);
    border-color: var(--gold);
    color: #fff;
    box-shadow: 0 10px 26px rgba(214, 177, 114, 0.45);
}

.pp .stat.main .label i {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.pp .stat.main .desc,
.pp .stat.main .value small,
.pp .stat.main .ranks small {
    color: rgba(255, 255, 255, 0.88);
}

.pp .stat.main .ranks li {
    background: rgba(255, 255, 255, 0.18);
}

.pp .stat.main .ring {
    --bg: var(--gold);
    background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255, 255, 255, 0.35) 0);
}

.pp .stat.main .ring small {
    color: rgba(255, 255, 255, 0.9);
}

.pp .stat.main .ring.ok  { --c: #fff; }
.pp .stat.main .ring.bad { --c: #fff; }

.pp .stat.main .badge.ok,
.pp .stat.main .badge.bad {
    background: #fff;
}

/* การ์ดสรุปผลหน้าแรก PRO (.sc) บนมือถือ : เตี้ยลงประหยัดพื้นที่ (เจ้าของเว็บขอ 2026-09-30)
   คะแนน + ป้ายผ่าน / ไม่ผ่านอยู่แถวเดียว · อันดับทั่วประเทศ / สาขาวางคู่กัน · วงแหวนเล็กลง */
@media screen and (max-width: 600px) {
    .pp .stat.sc {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px 8px;
        padding: 14px;
    }

    .pp .stat.sc .stat-top,
    .pp .stat.sc .ranks {
        grid-column: 1 / -1;
    }

    .pp .stat.sc .label {
        gap: 8px;
        font-size: 16px;
    }

    .pp .stat.sc .label i {
        width: 28px;
        height: 28px;
        border-radius: 9px;
        font-size: 12px;
    }

    .pp .stat.sc .desc {
        margin-top: 2px;
        font-size: 12px;
    }

    .pp .stat.sc .ring {
        --size: 58px;
        --th: 6px;
    }

    .pp .stat.sc .value {
        font-size: 30px;
    }

    .pp .stat.sc .value small {
        margin-left: 4px;
        font-size: 13px;
    }

    .pp .stat.sc .badge {
        align-self: center;
        justify-self: end;
        padding: 3px 10px;
        font-size: 12px;
    }

    .pp .stat.sc .ranks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin: 0;
    }

    .pp .stat.sc .ranks li {
        gap: 0 6px;
        padding: 7px 10px;
        border-radius: 12px;
    }

    .pp .stat.sc .ranks span {
        font-size: 12px;
        line-height: 1.3;
    }

    .pp .stat.sc .ranks small {
        font-size: 10.5px;
    }

    .pp .stat.sc .ranks b {
        font-size: 17px;
    }
}

/* ---------- ผลวิเคราะห์ความพร้อม 6 ด้าน ---------- */

.pp .insight {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.pp .insight-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pp .insight-ic {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: var(--gold-soft);
    color: var(--gold-dark);
    font-size: 18px;
}

/* ชื่อด้าน (หน้าแรก PRO : วิเคราะห์ความพร้อม 6 ด้าน) — ไม่แสดงค่าตัวเลขแล้ว (เจ้าของเว็บ 2026-09-29) ชื่อด้านจึงเป็นป้ายหลักข้างไอคอน */
.pp .insight-top small {
    display: block;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--gold-dark);
}

.pp .insight h4 {
    margin: 2px 0 0;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.4;
}

.pp .insight p {
    margin: 0;
    font-size: 13.5px;
    font-weight: 300;
    line-height: 1.55;
    color: #555;
}

/* ---------- การ์ดแบบทดสอบ (แนะนำ / ประวัติ) ---------- */

.pp .tcard {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.pp .tcard .tc-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 14px;
    color: var(--gold-dark);
    font-weight: 500;
}

.pp .tcard .tc-title {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.4;
}

.pp .tcard .tc-meta {
    font-size: 14px;
    font-weight: 300;
    color: var(--muted);
}

.pp .tcard .btn {
    margin-top: auto;
    align-self: stretch;
}

.pp .tcard .tc-gap {
    flex: 1;
    min-height: 8px;
}

/* ---------- กราฟเรดาร์ (SVG จาก pro_radar() ใน ui.php) ---------- */

.pp .radar {
    display: block;
    width: 100%;
    max-width: 520px;
    height: auto;
    margin: 0 auto;
    overflow: visible;
}

.pp .radar .rg  { fill: none; stroke: #eee4d3; stroke-width: 1; }
.pp .radar .ra  { stroke: #eee4d3; stroke-width: 1; }
.pp .radar .rp  { fill: rgba(63, 154, 100, 0.05); stroke: var(--green); stroke-width: 1.5; stroke-dasharray: 5 4; }
.pp .radar .rv  { fill: rgba(214, 177, 114, 0.38); stroke: var(--gold-dark); stroke-width: 2; stroke-linejoin: round; }
.pp .radar .rd  { fill: #fff; stroke: var(--gold-dark); stroke-width: 2; }
.pp .radar .rl  { font-family: inherit; fill: #4a4a4a; }   /* ขนาดตัวอักษรส่งมาจาก pro_radar() */
.pp .radar .rl tspan.v { font-weight: 600; fill: var(--gold-dark); }
.pp .radar .rt  { font-family: inherit; font-size: 10px; fill: #b3a68f; }

/* คำอธิบายสีใต้กราฟ */
.pp .chart-lg {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin-top: 12px;
    font-size: 13px;
    color: #666;
}

.pp .chart-lg span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pp .chart-lg .sw {
    width: 16px;
    height: 10px;
    border-radius: 3px;
    background: rgba(214, 177, 114, 0.5);
    border: 2px solid var(--gold-dark);
}

.pp .chart-lg .sw.pass {
    background: none;
    border: 2px dashed var(--green);
}

.pp .chart-lg .sw.me {
    background: var(--gold);
    border-color: var(--gold);
}

/* ---------- กราฟแท่งกลุ่มคะแนน ---------- */

.pp .hist {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding-top: 26px;
}

.pp .hist .hb {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pp .hist .col {
    position: relative;
    display: flex;
    align-items: flex-end;
    width: 100%;
    height: 220px;
}

.pp .hist .col i {
    position: relative;
    display: block;
    width: 100%;
    min-height: 4px;
    border-radius: 8px 8px 3px 3px;
    background: #ece3d3;
}

.pp .hist .hb.me .col i {
    background: var(--gold);
    box-shadow: 0 6px 16px rgba(214, 177, 114, 0.45);
}

/* ป้าย "คุณ" อยู่เหนือแท่ง (em อยู่ใน <i>) */
.pp .hist .hb.me em {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, -6px);
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 11px;
    font-style: normal;
    white-space: nowrap;
}

.pp .hist span {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

/* ---------- รายการ (จุดเด่น / ประวัติ) ---------- */

.pp .list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pp .list > li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 6px;
    border-top: 1px solid var(--line2);
}

.pp .list > li:first-child {
    border-top: 0;
}

.pp .list .li-ic {
    flex: none;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-top: 2px;
    border-radius: 50%;
    font-size: 13px;
}

.pp .list .li-ic.ok  { background: var(--green-soft); color: var(--green); }
.pp .list .li-ic.bad { background: var(--red-soft);   color: var(--red); }

.pp .list b {
    display: block;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.45;
}

.pp .list p {
    margin: 2px 0 0;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.65;
    color: #666;
}

/* จุดเด่น / ต้องพัฒนาเพิ่มเติม ในหน้าแรก PRO (.panel.sw) บนมือถือ : การ์ดเตี้ยลง ตัวอักษรเล็กลง (เจ้าของเว็บขอ 2026-09-30) */
@media screen and (max-width: 600px) {
    .pp .panel.sw {
        padding: 14px 14px 8px;
    }

    .pp .panel.sw .panel-head {
        margin-bottom: 4px;
    }

    .pp .panel.sw .panel-head h3 {
        font-size: 17px;
    }

    .pp .panel.sw .panel-head h3 small {
        font-size: 12px;
    }

    .pp .panel.sw .list {
        gap: 0;
    }

    .pp .panel.sw .list > li {
        gap: 10px;
        padding: 8px 2px;
    }

    .pp .panel.sw .list .li-ic {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .pp .panel.sw .list b {
        font-size: 14px;
        line-height: 1.4;
    }

    .pp .panel.sw .list p {
        font-size: 12px;
        line-height: 1.5;
    }
}

/* แถวที่กดได้ทั้งแถว : [วง] ชื่อ/รายละเอียด  ตัวเลข  > */
.pp .rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pp .rows > li + li {
    border-top: 1px solid var(--line2);
}

.pp .rows a,
.pp .rows .row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 8px;
    border-radius: 14px;
    transition: background .15s;
}

.pp .rows a:hover {
    background: var(--cream);
}

.pp .rows .r-main {
    flex: 1;
    min-width: 0;
}

.pp .rows .r-main b {
    display: block;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.pp .rows .r-main small {
    display: block;
    font-size: 13px;
    font-weight: 300;
    color: var(--muted);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pp .rows .r-num {
    flex: none;
    text-align: right;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.pp .rows .r-num small {
    display: block;
    font-size: 12px;
    font-weight: 300;
    color: var(--muted);
}

.pp .rows .r-go {
    flex: none;
    color: #c9bda6;
    font-size: 13px;
}

/* ---------- อันดับ TOP 10 (แบบหน้าแรกเว็บครูผู้ช่วย) ---------- */

.pp .rank-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pp .rank-list li {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto 28px;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
}

.pp .rank-list li + li {
    border-top: 1px solid var(--line2);
}

.pp .rank-no {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f1ea;
    color: var(--gold-dark);
    font-size: 16px;
    font-weight: 600;
}

.pp .rank-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 16px;
}

.pp .rank-num {
    font-size: 19px;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pp .rank-trend {
    text-align: center;
    font-size: 13px;
    color: #c4c4c4;
}

.pp .rank-trend.up   { color: var(--green); }
.pp .rank-trend.down { color: var(--red); }

/* อันดับ 1-3 : เหรียญ  อันดับ 1 : แถวครีมขอบทอง */
.pp .rank-list li:nth-child(-n+3) .rank-no {
    background: var(--gold-soft);
}

.pp .rank-list li:first-child {
    margin-bottom: 4px;
    border: 1px solid var(--gold);
    background: var(--cream);
}

.pp .rank-list li:first-child .rank-no {
    background: var(--gold);
    color: #fff;
}

.pp .rank-list li:first-child .rank-name {
    font-weight: 500;
}

.pp .rank-list li:first-child .rank-num {
    color: var(--gold-dark);
    font-size: 22px;
}

.pp .rank-list li:nth-child(2) {
    border-top: 0;
}

/* แถวของผู้ใช้เอง */
.pp .rank-list li.me .rank-name {
    color: var(--gold-dark);
    font-weight: 600;
}

/* ---------- ตาราง ---------- */

.pp .tablewrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pp table.tb {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 15px;
}

.pp .tb th {
    padding: 10px 14px;
    background: #fbf6ec;
    color: var(--gold-dark);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
}

.pp .tb th:first-child { border-radius: 12px 0 0 12px; }
.pp .tb th:last-child  { border-radius: 0 12px 12px 0; }

.pp .tb td {
    padding: 12px 14px;
    border-top: 1px solid var(--line2);
    vertical-align: middle;
}

.pp .tb tr:first-child td {
    border-top: 0;
}

.pp .tb tbody tr:hover td {
    background: #fffaf2;
}

.pp .tb .r {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pp .tb .c {
    text-align: center;
}

/* ---------- ว่าง / หมายเหตุ ---------- */

.pp .empty {
    padding: 28px 12px;
    text-align: center;
    color: var(--muted);
    font-weight: 300;
    line-height: 1.7;
}

.pp .empty > i {
    display: block;
    margin-bottom: 8px;
    font-size: 28px;
    color: #e2d6c0;
}

.pp .note {
    margin: 12px 0 0;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.6;
    color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
    .pp .btn.shine::after {
        animation: none;
        display: none;
    }
    .pp .subj,
    .pp .subj .go i,
    .pp .btn {
        transition: none;
    }
}

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

@media screen and (max-width: 1100px) {
    .pp .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pp .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pp .hero h1 { font-size: 34px; }
    .pp .hero-total .num { font-size: 80px; }
}

@media screen and (max-width: 860px) {
    .pp .hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
        padding-top: 28px;
    }
    .pp .g2,
    .pp .g3 { grid-template-columns: minmax(0, 1fr); }
    .pp .sec { margin-bottom: 44px; }
    .pp .page-head { padding: 28px 0 22px; }
    .pp .page-head h1 { font-size: 30px; }
    .pp .sec-head h2 { font-size: 24px; }
}

@media screen and (max-width: 600px) {
    .pp .g5,
    .pp .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pp .grid { gap: 12px; }
    .pp .sec-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ไม่เกิน 700px : มีเมนูล่าง (.mnav) จึงเว้นด้านล่างของหน้า */
@media screen and (max-width: 700px) {
    .pp { padding-bottom: 110px; }
}

/* มือถือ : แถบเมนูบนสูง 50px  ล่างเว้นให้เมนูล่าง (.mnav สูง 64px + ขอบ) */
@media screen and (max-width: 480px) {
    .pp {
        padding: 50px 0 110px;
        font-size: 15px;
    }
    .pp .wrap { width: calc(100% - 24px); }
    .pp .sec { margin-bottom: 36px; }
    .pp .hero { padding: 18px 0 30px; }
    .pp .hero h1 { font-size: 26px; margin-top: 12px; }
    .pp .hero-lead { font-size: 15px; }
    .pp .hero-total .num { font-size: 64px; letter-spacing: -1px; }
    .pp .hero-total .unit { font-size: 17px; }
    .pp .progress-card { padding: 14px 16px; }
    .pp .progress-head { font-size: 13px; }
    .pp .progress-lg { font-size: 12px; gap: 4px 12px; }
    .pp .page-head { padding: 20px 0 18px; }
    .pp .page-head h1 { font-size: 25px; }
    .pp .page-head p { font-size: 14px; }
    .pp .sec-head h2 { font-size: 21px; }
    .pp .sec-head p { font-size: 13px; }
    .pp .chip { font-size: 13px; padding: 5px 12px; }
    .pp .card,
    .pp .panel { padding: 18px 14px; border-radius: 18px; }
    .pp .panel-head h3 { font-size: 18px; }
    .pp .dark { padding: 20px 18px; border-radius: 18px; }
    .pp .mission-ic { width: 46px; height: 46px; border-radius: 14px; font-size: 19px; }
    .pp .mission-head .t { font-size: 18px; }
    .pp .mission-head .s { font-size: 13px; }
    .pp .mission-topic { margin: 16px 0 14px; padding: 12px 14px; }
    .pp .mission-topic b { font-size: 17px; }
    .pp .subj { padding: 14px; border-radius: 18px; }
    .pp .subj .ic { width: 40px; height: 40px; border-radius: 12px; font-size: 17px; margin-bottom: 8px; }
    .pp .subj .part { top: 14px; right: 12px; }
    .pp .subj b { font-size: 15px; }
    .pp .subj small { font-size: 13px; }
    .pp .subj .go { margin-top: 10px; font-size: 13px; }
    .pp .stat { padding: 18px 16px; border-radius: 18px; }
    .pp .stat .value { font-size: 36px; }
    .pp .ring { --size: 76px; --th: 8px; }
    .pp .ring.sm { --size: 46px; --th: 5px; }
    .pp .insight { padding: 18px 16px; border-radius: 18px; }
    .pp .tcard { padding: 16px; border-radius: 18px; }
    .pp .hist { gap: 4px; }
    .pp .hist .col { height: 170px; }
    .pp .hist span { font-size: 10px; }
    .pp .rank-list li { grid-template-columns: 32px minmax(0, 1fr) auto 22px; gap: 8px; padding: 9px 6px; }
    .pp .rank-no { width: 30px; height: 30px; font-size: 14px; }
    .pp .rank-name { font-size: 15px; }
    .pp .rank-num { font-size: 17px; }
    .pp .rows a,
    .pp .rows .row { gap: 10px; padding: 10px 4px; }
    .pp .rows .r-main b { font-size: 15px; }
    .pp .alert { align-items: flex-start; padding: 14px 16px; gap: 12px; }
    .pp .alert-ic { width: 38px; height: 38px; font-size: 16px; border-radius: 12px; }
    .pp .alert .btn { width: 100%; }
}

/* ---------- นับถอยหลังสู่วันสอบ (การ์ดเข้มใน hero แบบหน้าแรกเว็บครูผู้ช่วย) ---------- */

.pp .cd-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pp .cd .mission-ic i {
    animation: pp-cd-flip 4s ease-in-out infinite;
}

@keyframes pp-cd-flip {
    0%, 42% { transform: rotate(0); }
    50%, 92% { transform: rotate(180deg); }
    100% { transform: rotate(360deg); }
}

.pp .cd-t {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    color: #f6e7c8;
}

.pp .cd-s {
    margin-top: 2px;
    font-size: 15px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.78);
}

.pp .cd-units {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
}

.pp .cd-u {
    padding: 12px 6px 10px;
    border: 1px solid rgba(214, 177, 114, 0.35);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    text-align: center;
}

.pp .cd-u b {
    display: block;
    font-size: 40px;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, #f8e6bd, var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.pp .cd-u span {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.72);
}

/* ถึงเวลาสอบแล้ว : ซ่อนตัวเลข เปลี่ยนหัวข้อเป็นข้อความวันสอบ */
.pp .cd-t2,
.pp .cd.done .cd-t1,
.pp .cd.done .cd-units {
    display: none;
}

.pp .cd.done .cd-t2 {
    display: inline;
}

@media (prefers-reduced-motion: reduce) {
    .pp .cd .mission-ic i { animation: none; }
}

@media screen and (max-width: 480px) {
    .pp .cd-t { font-size: 18px; }
    .pp .cd-s { font-size: 13px; }
    .pp .cd-units { gap: 8px; margin-top: 16px; }
    .pp .cd-u { padding: 8px 4px 6px; border-radius: 12px; }
    .pp .cd-u b { font-size: 28px; }
    .pp .cd-u span { font-size: 12px; }
}

/* การ์ดภารกิจในแถวเดียวกับอันดับ : สูงตามเนื้อหา ไม่ยืดตามตารางอันดับ */
.pp .grid > aside.dark {
    align-self: start;
}
