/* ═══════════════════════════════════════════════════════════════════════
   แนวโน้มนักเรียนและคาดการณ์ — student_trend.php · 15 ต.ค. 2569
   โรงเรียนเทศบาล ๑ กิตติขจร

   ★ ภาษาภาพเดียวกับรายงานวิเคราะห์บุคลากร (css/tb1-personal-report.css) — ส่วนพื้นฐาน (หัวหน้า การ์ดตัวเลข
     แถบเครื่องมือ แผง ตาราง คำอธิบายสัญลักษณ์ การ์ดข้อค้นพบ โหมดคมชัดสูง พิมพ์) ยกมาจากไฟล์นั้นแล้วเปลี่ยนคำนำหน้าเป็น en-
     จึงแก้หน้านี้ได้โดยไม่กระทบหน้ารายงานบุคลากร · ส่วนเฉพาะของหน้า (กราฟ ตารางรุ่น อัตราเลื่อนชั้น) อยู่ท้ายไฟล์
   ★ โทเคนทุกตัวชี้ไป --tb1-* โหมดมืดพลิกเอง
   ★ สีข้อมูล: ม.ต้น น้ำเงิน #2a78d6 / ม.ปลาย เขียวน้ำทะเล #1baf7a (มืด #3987e5 / #199e70)
     ตรวจด้วยเครื่องมือตรวจสีตาบอดสี: ผ่านทุกข้อ (เขียวน้ำทะเลบนพื้นสว่างคอนทราสต์ 2.7:1 จึงมีตัวเลขและตารางคู่เสมอ)
     อัตราเลื่อนชั้นสีสองขั้ว แดง (หาย) – เทา (คงที่) – น้ำเงิน (เพิ่ม) ตัวเลขอยู่ในทุกช่อง
   ★ ทุก selector ขึ้นต้นด้วย en- ไม่ชนกับหน้าอื่นหรือไฟล์กลาง
   ═══════════════════════════════════════════════════════════════════════ */

.en {
    --en-ink: var(--tb1-ink-1, #0f172a);
    --en-ink-2: var(--tb1-ink-2, #334155);
    --en-muted: var(--tb1-ink-3, #5a697f);
    --en-page: var(--tb1-page, #f8fafc);
    --en-paper: var(--tb1-surface, #ffffff);
    --en-paper-alt: var(--tb1-surface-alt, #f1f5f9);
    --en-line: var(--tb1-border, #e2e8f0);
    --en-line-bold: var(--tb1-border-bold, #cbd5e1);
    --en-brand: var(--tb1-brand, #1d4ed8);
    --en-brand-soft: color-mix(in srgb, var(--tb1-brand, #1d4ed8) 10%, var(--tb1-surface, #ffffff));
    --en-brand-line: color-mix(in srgb, var(--tb1-brand, #1d4ed8) 35%, var(--tb1-border, #e2e8f0));
    --en-page-max: var(--tb1-page-max-width, 1440px);
    --en-gutter: var(--tb1-shell-gutter, 20px);
    --en-ease: cubic-bezier(.4, 0, .2, 1);
    --en-r: 16px;
    --en-rs: 12px;
    --en-serif: var(--tb1-font-display, 'Noto Sans Thai Looped', sans-serif);
    --en-sans: var(--tb1-font-body, 'Sarabun', sans-serif);
    --en-shadow: 0 14px 32px -24px rgba(15, 23, 42, .55), inset 0 1px 0 rgba(255, 255, 255, .6);
    --en-shadow-float: 0 22px 44px -26px rgba(15, 23, 42, .6), inset 0 1px 0 rgba(255, 255, 255, .6);
    --en-hero-a: color-mix(in srgb, var(--tb1-banner-1, #1d4ed8) 60%, var(--tb1-ink-surface, #0f172a));
    --en-hero-b: var(--tb1-banner-1, #1d4ed8);
    --en-hero-c: color-mix(in srgb, var(--tb1-banner-1, #1d4ed8) 78%, var(--tb1-accent-strong, #0284c7));
    --en-neutral: color-mix(in srgb, var(--tb1-ink-3, #5a697f) 80%, var(--tb1-surface, #ffffff));
    --en-warn: var(--tb1-warning, #f59e0b);
    --en-warn-fg: var(--tb1-text-warning, #b45309);
    --en-warn-bg: color-mix(in srgb, var(--tb1-warning, #f59e0b) 14%, var(--tb1-surface, #ffffff));
    --en-crit: var(--tb1-danger, #ef4444);
    --en-crit-fg: #b91c1c;
    --en-crit-bg: color-mix(in srgb, var(--tb1-danger, #ef4444) 11%, var(--tb1-surface, #ffffff));
    --en-ok: var(--tb1-success, #10b981);
    --en-ok-fg: var(--tb1-text-success, #047857);
    --en-ok-bg: color-mix(in srgb, var(--tb1-success, #10b981) 13%, var(--tb1-surface, #ffffff));
    --en-info: var(--tb1-info, #0ea5e9);
    --en-info-fg: var(--tb1-text-info, #0e7490);
    --en-info-bg: color-mix(in srgb, var(--tb1-info, #0ea5e9) 12%, var(--tb1-surface, #ffffff));
    --en-male: var(--tb1-male, #3b82f6);
    --en-female: var(--tb1-female, #ec4899);
    --en-tip-bg: var(--tb1-ink-surface, #0f172a);
    --en-tip-ink: #f8fafc;
    --en-hm-1: color-mix(in srgb, var(--en-brand) 5%, var(--en-paper));
    --en-hm-2: color-mix(in srgb, var(--en-brand) 12%, var(--en-paper));
    --en-hm-3: color-mix(in srgb, var(--en-brand) 20%, var(--en-paper));
    --en-hm-4: color-mix(in srgb, var(--en-brand) 28%, var(--en-paper));
    --en-hm-5: color-mix(in srgb, var(--en-brand) 35%, var(--en-paper));
    --en-hm-6: color-mix(in srgb, var(--en-brand) 43%, var(--en-paper));
}

:is(html.dark,
html.dark-mode,
html[data-theme="dark"],
body.dark-mode,
body[data-theme="dark"]) .en {
    --en-brand-soft: color-mix(in srgb, var(--tb1-brand, #60a5fa) 16%, var(--tb1-surface, #111c31));
    --en-shadow: 0 14px 32px -22px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .055);
    --en-shadow-float: 0 22px 44px -24px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .055);
    --en-neutral: color-mix(in srgb, var(--tb1-ink-3, #94a3b8) 72%, var(--tb1-surface, #111c31));
    --en-crit-fg: var(--tb1-text-danger, #fda4af);
    --en-tip-bg: #1b2a47;
    color-scheme: dark;
}

:is(html.dark,
html.dark-mode,
html[data-theme="dark"],
body.dark-mode,
.en-nav-a[aria-current="location"]) {
    color: #0b1324;
}

body.en-page {
    margin: 0;
    background: var(--tb1-page, #f8fafc);
    color: var(--tb1-ink-2, #334155);
}

html:has(body.en-page) {
    scroll-padding-top: var(--en-stick, 8.5rem);
}

main.en {
    padding: 0 var(--en-gutter) clamp(40px, 5vw, 72px);
    color: var(--en-ink-2);
}

main.en:focus {
    outline: none;
}

.en-wrap {
    max-width: calc(var(--en-page-max) - 2 * var(--en-gutter));
    margin-inline: auto;
}

.en :where(h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
dt,
figure) {
    margin: 0;
}

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

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

.en [hidden] {
    display: none !important;
}

.en-icon {
    display: block;
    flex: 0 0 auto;
}

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

.en :focus-visible {
    outline: 2px solid var(--en-brand);
    outline-offset: 2px;
}

.en-skip {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2000;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

body.en-page a.en-skip:focus {
    width: auto;
    height: auto;
    clip: auto;
    padding: 12px 18px;
    color: #ffffff;
    background: var(--tb1-banner-1, #1d4ed8);
    border-radius: 0 0 10px 0;
    text-decoration: underline;
}

html.tb1-contrast-high body.en-page a.en-skip:focus {
    color: #facc15;
    background: #000000;
    outline: 3px solid #facc15;
}

.en-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin-inline: calc(-1 * var(--en-gutter));
    padding: clamp(34px, 5vw, 58px) var(--en-gutter) clamp(92px, 9vw, 120px);
    color: #ffffff;
    text-align: center;
    background-color: var(--en-hero-b);
    background-image: linear-gradient(135deg, var(--en-hero-a) 0%, var(--en-hero-b) 52%, var(--en-hero-c) 100%);
}

.en-hero.is-plain {
    padding-bottom: clamp(34px, 5vw, 58px);
}

.en-hero::before,
.en-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.en-hero::before {
    background-image:
        radial-gradient(circle at 18% 40%, rgba(255, 255, 255, .09) 0%, transparent 48%),
        radial-gradient(circle at 84% 18%, rgba(255, 255, 255, .07) 0%, transparent 40%);
}

.en-hero::after {
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: linear-gradient(180deg, #000000 35%, transparent);
    mask-image: linear-gradient(180deg, #000000 35%, transparent);
}

.en-hero-in {
    max-width: 60rem;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.en-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: .88rem;
    font-weight: 500;
    color: #ffffff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.en-hero-eyebrow .en-icon {
    width: 17px;
    height: 17px;
}

.en-hero-title {
    margin-top: 16px;
    font-family: var(--en-serif);
    font-size: clamp(1.9rem, 4.6vw, 2.9rem);
    font-weight: 600;
    line-height: 1.25;
    color: #ffffff;
    text-wrap: balance;
}

.en-hero-sub {
    margin-top: 10px;
    max-width: 46rem;
    text-wrap: balance;
    font-size: clamp(.98rem, 1.5vw, 1.08rem);
    line-height: 1.75;
    color: #e0e7ff;
}

.en-hero-date {
    margin-top: 4px;
    font-size: .92rem;
    color: #e0e7ff;
}

.en-figs {
    position: relative;
    z-index: 1;
    margin-top: calc(-1 * clamp(66px, 7vw, 86px));
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(10px, 1.2vw, 16px);
}

.en-figs > li {
    min-width: 0;
    display: flex;
}

.en .en-fig {
    position: relative;
    overflow: hidden;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 18px 16px 16px;
    color: var(--en-muted);
    text-decoration: none;
    background: var(--en-paper);
    border: 1px solid var(--en-line);
    border-radius: var(--en-r);
    box-shadow: var(--en-shadow-float);
    transition: border-color .25s var(--en-ease), box-shadow .25s var(--en-ease);
}

.en .en-fig:hover {
    border-color: var(--en-brand-line);
    box-shadow: 0 26px 48px -26px rgba(15, 23, 42, .7), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.en .en-fig:focus-visible {
    outline-offset: 3px;
}

.en-fig::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--tb1-banner-1, #1d4ed8), var(--tb1-accent, #0ea5e9));
    transform-origin: left center;
}

.en-fig.is-warn::before {
    background: var(--en-warn);
}

.en-fig.is-crit::before {
    background: var(--en-crit);
}

.en-fig-k {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    font-size: .88rem;
    line-height: 1.45;
    color: var(--en-muted);
}

.en-fig-ic {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--tb1-banner-1, #1d4ed8), var(--tb1-accent-strong, #0284c7));
    border-radius: 11px;
}

.en-fig.is-warn .en-fig-ic {
    background: linear-gradient(135deg, #b45309, #d97706);
}

.en-fig.is-crit .en-fig-ic {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
}

.en-fig-v {
    margin-top: 2px;
    color: var(--en-muted);
    font-size: .95rem;
}

.en-fig-v b {
    font-family: var(--en-serif);
    font-size: clamp(1.6rem, 2.3vw, 2.05rem);
    font-weight: 600;
    line-height: 1.15;
    color: var(--en-ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.en-fig.is-warn .en-fig-v b {
    color: var(--en-warn-fg);
}

.en-fig.is-crit .en-fig-v b {
    color: var(--en-crit-fg);
}

.en-fig-s {
    font-size: .86rem;
    line-height: 1.5;
    color: var(--en-muted);
    overflow-wrap: anywhere;
}

.en-fig.is-warn .en-fig-s {
    color: var(--en-warn-fg);
    font-weight: 600;
}

.en-fig.is-crit .en-fig-s {
    color: var(--en-crit-fg);
    font-weight: 600;
}

.en-callout {
    margin-top: clamp(22px, 3vw, 32px);
    padding: 18px 22px;
    color: var(--en-ink-2);
    background: var(--en-paper);
    border: 1px solid var(--en-line);
    border-left: 5px solid var(--en-brand);
    border-radius: var(--en-rs);
    box-shadow: var(--en-shadow);
    line-height: 1.7;
}

.en-callout.is-warn {
    background: var(--en-warn-bg);
    border-color: var(--en-warn);
}

.en-callout-title {
    font-family: var(--en-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--en-ink);
}

.en-callout p {
    margin-top: 4px;
}

.en-callout ul {
    margin-top: 8px;
    padding-left: 1.3rem;
    list-style: disc;
}

.en-lock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px 2px 8px;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.5;
    color: #6d28d9;
    background: color-mix(in srgb, #7c3aed 9%, var(--en-paper));
    border: 1px solid color-mix(in srgb, #7c3aed 35%, var(--en-paper));
    border-radius: 999px;
    white-space: nowrap;
    vertical-align: middle;
}

.en-lock .en-icon {
    width: 13px;
    height: 13px;
}

:is(html.dark,
html.dark-mode,
html[data-theme="dark"],
body.dark-mode,
body[data-theme="dark"]) .en .en-lock {
    color: #c4b5fd;
}

.en-fig-lock {
    display: inline-flex;
    vertical-align: -2px;
    margin-left: 6px;
    color: #6d28d9;
}

.en-fig-lock .en-icon {
    width: 14px;
    height: 14px;
}

:is(html.dark,
html.dark-mode,
html[data-theme="dark"],
body.dark-mode,
body[data-theme="dark"]) .en .en-fig-lock {
    color: #c4b5fd;
}

.en-audience {
    margin-top: clamp(18px, 2.4vw, 26px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 12px 16px;
    font-size: .92rem;
    line-height: 1.6;
    color: var(--en-ink-2);
    background: color-mix(in srgb, #7c3aed 6%, var(--en-paper));
    border: 1px solid color-mix(in srgb, #7c3aed 28%, var(--en-line));
    border-radius: var(--en-rs);
}

.en-audience.is-preview {
    background: var(--en-brand-soft);
    border-color: var(--en-brand-line);
}

.en-audience p {
    flex: 1 1 18rem;
    min-width: 0;
}

.en-audience b {
    color: var(--en-ink);
}

.en-audience-ic {
    width: 34px;
    height: 34px;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    color: #6d28d9;
    background: var(--en-paper);
    border-radius: 10px;
}

.en-audience.is-preview .en-audience-ic {
    color: var(--en-brand);
}

:is(html.dark,
html.dark-mode,
html[data-theme="dark"],
body.dark-mode,
body[data-theme="dark"]) .en .en-audience-ic {
    color: #c4b5fd;
}

.en .en-audience .en-btn {
    text-decoration: none;
}

.en .en-link {
    color: var(--en-brand);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.en-tools {
    position: sticky;
    top: var(--en-nav-h, 57px);
    z-index: 20;
    margin-top: clamp(22px, 3vw, 34px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 8px 10px;
    background: color-mix(in srgb, var(--en-paper) 90%, transparent);
    border: 1px solid var(--en-line);
    border-radius: 999px;
    box-shadow: var(--en-shadow);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.en-nav {
    min-width: 0;
    flex: 1 1 auto;
}

.en-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.en .en-nav-a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 14px;
    font-size: .92rem;
    font-weight: 500;
    color: var(--en-ink-2);
    text-decoration: none;
    border-radius: 999px;
    white-space: nowrap;
    transition: background-color .2s var(--en-ease), color .2s var(--en-ease);
}

.en .en-nav-a:hover {
    color: var(--en-brand);
    background: var(--en-brand-soft);
}

.en .en-nav-a[aria-current="location"] {
    color: #ffffff;
    background: var(--en-brand);
}

.en-tools-act {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-left: auto;
}

.en-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 16px;
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    color: var(--en-ink-2);
    background: var(--en-paper);
    border: 1px solid var(--en-line-bold);
    border-radius: 999px;
    cursor: pointer;
    transition: border-color .2s, color .2s, background-color .2s;
}

.en-btn:hover {
    color: var(--en-brand);
    border-color: var(--en-brand);
}

.en-btn .en-icon {
    width: 18px;
    height: 18px;
}

.en-sec {
    margin-top: clamp(34px, 4.4vw, 56px);
}

.en-sec-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--en-line);
}

.en-sec-title {
    position: relative;
    padding-left: 16px;
    font-family: var(--en-serif);
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    font-weight: 600;
    line-height: 1.4;
    color: var(--en-ink);
    text-wrap: balance;
}

.en-sec-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: .2em;
    bottom: .2em;
    width: 5px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--tb1-banner-1, #1d4ed8), var(--tb1-accent, #0ea5e9));
    transform-origin: center top;
}

.en-sec-count {
    padding: 3px 12px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--en-brand);
    background: var(--en-brand-soft);
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

.en-sec-note {
    margin-top: 12px;
    font-size: .92rem;
    line-height: 1.6;
    color: var(--en-muted);
}

.en-grid-2 {
    margin-top: 18px;
    display: grid;
    gap: clamp(12px, 1.4vw, 18px);
    align-items: start;
}

.en-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.en-panel {
    min-width: 0;
    background: var(--en-paper);
    border: 1px solid var(--en-line);
    border-radius: var(--en-r);
    box-shadow: var(--en-shadow);
    overflow: hidden;
}

.en-sec > .en-panel {
    margin-top: 18px;
}

.en-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--en-line);
    background: linear-gradient(180deg, var(--en-paper-alt), var(--en-paper));
}

.en-panel-ic {
    width: 34px;
    height: 34px;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    color: var(--en-brand);
    background: var(--en-brand-soft);
    border-radius: 10px;
}

.en-panel-ic .en-icon {
    width: 18px;
    height: 18px;
}

.en-panel-title {
    font-family: var(--en-serif);
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--en-ink);
}

.en-panel-note {
    margin-left: auto;
    font-size: .86rem;
    line-height: 1.5;
    color: var(--en-muted);
}

.en-panel-body {
    position: relative;
    padding: 16px 20px 18px;
}

.en-note {
    margin-bottom: 14px;
    max-width: 72ch;
    font-size: .88rem;
    line-height: 1.65;
    color: var(--en-muted);
}

.en-empty {
    padding: 18px 0;
    font-size: .92rem;
    color: var(--en-muted);
}

.en-foot-note {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--en-line-bold);
    font-size: .84rem;
    line-height: 1.6;
    color: var(--en-muted);
}

.en-scroll {
    margin-top: 16px;
    overflow-x: auto;
    border-radius: 10px;
}

.en-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    font-size: .92rem;
}

.en-table th,
.en-table td {
    padding: 9px 12px;
    text-align: left;
    border-top: 1px solid var(--en-line);
}

.en-table thead th {
    padding-top: 6px;
    font-size: .84rem;
    font-weight: 600;
    color: var(--en-muted);
    border-top: 0;
    border-bottom: 1px solid var(--en-line-bold);
    white-space: nowrap;
}

.en-table tbody th {
    font-weight: 600;
    color: var(--en-ink);
}

.en-table .is-n {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.en-table tr {
    transition: opacity .25s, filter .25s;
}

.en-table tr.is-over > * {
    background: var(--en-warn-bg);
}

.en-plain {
    font-size: .86rem;
    color: var(--en-muted);
    white-space: nowrap;
}

.en-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--en-line);
    font-size: .84rem;
    color: var(--en-muted);
}

.en-legend b {
    color: var(--en-ink);
    font-variant-numeric: tabular-nums;
}

.en-sw {
    display: inline-block;
    width: 18px;
    height: 9px;
    margin-right: 7px;
    vertical-align: 1px;
    border-radius: 3px;
}

.en-sw.is-male {
    background: var(--en-male);
}

.en-sw.is-female {
    background: var(--en-female);
}

.en-sw.is-neutral {
    background: var(--en-neutral);
}

.en-sw.is-warn {
    background: var(--en-warn);
}

.en-about {
    margin-top: clamp(28px, 3.4vw, 40px);
    padding: 18px 22px;
    background: var(--en-paper-alt);
    border: 1px solid var(--en-line);
    border-radius: var(--en-r);
}

.en-about-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--en-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--en-ink);
}

.en-about-title .en-icon {
    color: var(--en-brand);
}

.en-about-list {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 28px;
}

.en-about-list li {
    font-size: .88rem;
    line-height: 1.65;
    color: var(--en-muted);
}

.en-about-list b {
    color: var(--en-ink);
}

.en-about-meta {
    margin-top: 12px;
    font-size: .82rem;
    color: var(--en-muted);
}

.en-tip {
    position: absolute;
    z-index: 30;
    max-width: 16rem;
    padding: 7px 11px;
    font-size: .84rem;
    line-height: 1.45;
    color: var(--en-tip-ink);
    background: var(--en-tip-bg);
    border-radius: 7px;
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5);
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 10px));
}

.en-tip b {
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.en-cards {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(10px, 1.2vw, 16px);
}

.en-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 16px 18px 16px 22px;
    background: var(--en-paper);
    border: 1px solid var(--en-line);
    border-radius: var(--en-r);
    box-shadow: var(--en-shadow);
    overflow: hidden;
}

.en-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--en-line-bold);
}

.en-card.is-crit::before {
    background: var(--en-crit);
}

.en-card.is-warn::before {
    background: var(--en-warn);
}

.en-card.is-info::before {
    background: var(--en-info);
}

.en-card.is-ok::before {
    background: var(--en-ok);
}

.en-card-lv {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .84rem;
    font-weight: 700;
}

.en-card-lv .en-icon {
    width: 17px;
    height: 17px;
}

.en-card.is-crit .en-card-lv {
    color: var(--en-crit-fg);
}

.en-card.is-warn .en-card-lv {
    color: var(--en-warn-fg);
}

.en-card.is-info .en-card-lv {
    color: var(--en-info-fg);
}

.en-card.is-ok .en-card-lv {
    color: var(--en-ok-fg);
}

.en-card-t {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--en-ink);
}

.en-card-v b {
    font-family: var(--en-serif);
    font-size: 1.55rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--en-ink);
    font-variant-numeric: tabular-nums;
}

.en-card.is-crit .en-card-v b {
    color: var(--en-crit-fg);
}

.en-card.is-warn .en-card-v b {
    color: var(--en-warn-fg);
}

.en-card-w {
    font-size: .9rem;
    line-height: 1.65;
    color: var(--en-muted);
}

.en .en-card-a {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    margin-top: 6px;
    padding: 4px 12px;
    font-size: .86rem;
    font-weight: 600;
    color: var(--en-brand);
    text-decoration: none;
    border: 1px solid var(--en-brand-line);
    border-radius: 999px;
    transition: background-color .2s, border-color .2s;
}

.en .en-card-a:hover {
    background: var(--en-brand-soft);
    border-color: var(--en-brand);
}

.en-card-a .en-icon {
    width: 16px;
    height: 16px;
    transition: transform .2s var(--en-ease);
}

.en .en-card-a:hover .en-icon {
    transform: translateX(3px);
}

@media (max-width: 1199.98px) {
    .en-figs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 979.98px) {
    .en-grid-2,
    .en-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .en-about-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .en-panel-note {
        margin-left: 0;
        flex-basis: 100%;
    }

    .en-tools {
        position: static;
        border-radius: var(--en-r);
        padding: 8px;
    }

    .en-nav {
        flex-basis: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .en-nav::-webkit-scrollbar {
        display: none;
    }

    .en-nav-list {
        flex-wrap: nowrap;
    }

    .en-tools-act {
        margin-left: 0;
        padding: 0 6px;
    }
}

@media (max-width: 640px) {
    .en-hero {
        padding-top: 28px;
    }

    .en-hero-sub {
        font-size: .95rem;
    }

    .en-figs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .en-figs > li:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .en .en-fig {
        padding: 16px 14px 14px;
    }

    .en-fig-ic {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .en-panel-head,
    .en-panel-body {
        padding-inline: 14px;
    }

    .en-card {
        padding: 14px 14px 14px 18px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .en-hero-in > * {
        animation: en-hero-rise .7s var(--en-ease) both;
    }

    .en-hero-in > :nth-child(2) {
        animation-delay: .06s;
    }

    .en-hero-in > :nth-child(3) {
        animation-delay: .12s;
    }

    .en-hero-in > :nth-child(4) {
        animation-delay: .16s;
    }

    .en-hero::before {
        animation: en-glow 1.8s var(--en-ease) both;
    }

    .en-rise {
        transition-property: translate;
        transition-duration: .75s;
        transition-timing-function: var(--en-ease);
        transition-delay: var(--en-d, 0s);
    }

    .en.en-motion [data-en-reveal]:not(.is-in) .en-rise,
    .en.en-motion [data-en-reveal].en-rise:not(.is-in) {
        translate: 0 26px;
    }

    .en-figs > :nth-child(2) {
        --en-d: .06s;
    }

    .en-figs > :nth-child(3) {
        --en-d: .12s;
    }

    .en-figs > :nth-child(4) {
        --en-d: .18s;
    }

    .en-figs > :nth-child(5) {
        --en-d: .24s;
    }

    .en-figs > :nth-child(6) {
        --en-d: .3s;
    }

    .en-grid-2 > :nth-child(2) {
        --en-d: .08s;
    }

    .en-fig::before {
        transition: transform .9s var(--en-ease) calc(var(--en-d, 0s) + .15s);
    }

    .en.en-motion .en-figs:not(.is-in) .en-fig::before {
        transform: scaleX(0);
    }

    .en-sec-title::before {
        transition: transform .5s var(--en-ease) .1s;
    }

    .en.en-motion .en-sec:not(.is-in) .en-sec-title::before {
        transform: scaleY(0);
    }
}

.en.en-arming *,
.en.en-arming *::before {
    transition: none !important;
}

@keyframes en-hero-rise {
    from {
        transform: translateY(16px);
    }

    to {
        transform: none;
    }
}

@keyframes en-glow {
    from {
        transform: scale(.9);
        opacity: .2;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

@keyframes en-pulse {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--en-warn) 55%, transparent);
    }

    100% {
        box-shadow: 0 0 0 10px color-mix(in srgb, var(--en-warn) 0%, transparent);
    }
}

@media (prefers-reduced-motion: reduce) {
    .en *,
    .en *::before,
    .en *::after {
        animation: none !important;
        transition: none !important;
    }
}

html.tb1-contrast-high .en {
    --en-neutral: #ffffff;
    --en-warn: #facc15;
    --en-crit: #facc15;
    --en-ok: #ffffff;
    --en-info: #ffffff;
    --en-male: #ffffff;
    --en-female: #facc15;
    --en-brand: #ffffff;
}

html.tb1-contrast-high .en-hero {
    background: #000000;
}

html.tb1-contrast-high .en-hero::before,
html.tb1-contrast-high .en-hero::after {
    display: none;
}

html.tb1-contrast-high .en-hero-eyebrow {
    background: #000000;
    border-color: #facc15;
}

html.tb1-contrast-high .en .en-fig,
html.tb1-contrast-high .en-panel,
html.tb1-contrast-high .en-tools,
html.tb1-contrast-high .en-about,
html.tb1-contrast-high .en-callout,
html.tb1-contrast-high .en-card,
html.tb1-contrast-high .en-fig-ic,
html.tb1-contrast-high .en-panel-ic,
html.tb1-contrast-high .en .en-btn,
html.tb1-contrast-high .en .en-card-a,
html.tb1-contrast-high .en-sec-count,
html.tb1-contrast-high .en-lock,
html.tb1-contrast-high .en-audience,
html.tb1-contrast-high .en-audience-ic {
    background: #000000;
    border-color: #ffffff;
    box-shadow: none;
}

html.tb1-contrast-high .en-fig-ic,
html.tb1-contrast-high .en-panel-ic,
html.tb1-contrast-high .en-audience-ic,
html.tb1-contrast-high .en-sec-count,
html.tb1-contrast-high .en-lock {
    color: #ffffff;
    border: 1px solid #ffffff;
}

html.tb1-contrast-high .en-fig-lock {
    color: #ffffff;
}

html.tb1-contrast-high .en-panel-head {
    background: #000000;
}

html.tb1-contrast-high .en-panel-head,
html.tb1-contrast-high .en-sec-head,
html.tb1-contrast-high .en-legend,
html.tb1-contrast-high .en-table th,
html.tb1-contrast-high .en-table td,
html.tb1-contrast-high .en-foot-note {
    border-color: #ffffff;
}

html.tb1-contrast-high .en-fig::before,
html.tb1-contrast-high .en-sec-title::before,
html.tb1-contrast-high .en-card::before {
    background: #ffffff;
}

html.tb1-contrast-high .en-card.is-crit::before,
html.tb1-contrast-high .en-card.is-warn::before {
    background: #facc15;
}

html.tb1-contrast-high .en-sw.is-unknown {
    background: #888888;
}

html.tb1-contrast-high .en .en-nav-a[aria-current="location"] {
    background: #facc15;
    border-color: #facc15;
}

html.tb1-contrast-high .en .en-nav-a[aria-current="location"] {
    color: #000000 !important;
}

html.tb1-contrast-high .en .en-nav-a:hover,
html.tb1-contrast-high .en .en-card-a:hover {
    background: #000000;
    box-shadow: inset 0 0 0 2px #facc15;
}

html.tb1-contrast-high .en .en-btn.is-primary {
    color: #000000 !important;
    background: #facc15;
    border-color: #facc15;
}

html.tb1-contrast-high .en .en-btn.is-primary * {
    color: #000000 !important;
}

html.tb1-contrast-high .en-tip {
    color: #ffffff;
    background: #000000;
    border: 1px solid #facc15;
}

html.tb1-contrast-high .en :focus-visible {
    outline-color: #facc15;
}

@media print {
    body.en-page {
        background: #ffffff;
    }

    .en {
        --en-ink: #0f172a;
        --en-ink-2: #334155;
        --en-muted: #475569;
        --en-paper: #ffffff;
        --en-paper-alt: #f1f5f9;
        --en-line: #cbd5e1;
        --en-line-bold: #94a3b8;
        --en-neutral: #94a3b8;
        --en-warn-fg: #b45309;
        --en-crit-fg: #b91c1c;
        color-scheme: light;
    }

    .en *,
    .en *::before,
    .en *::after {
        transition: none !important;
        animation: none !important;
    }

    .en-tools,
    .en-audience,
    .en-card-a,
    .en-fig-ic,
    .en-panel-ic,
    .en-hero::before,
    .en-hero::after,
    .en-tip {
        display: none !important;
    }

    main.en {
        padding: 0;
    }

    .en-hero {
        margin: 0;
        padding: 0 0 10px;
        color: #000000;
        text-align: left;
        background: #ffffff;
        border-bottom: 2px solid #000000;
    }

    .en-hero-in {
        max-width: none;
        align-items: flex-start;
    }

    .en-hero-eyebrow {
        padding: 0;
        color: #000000;
        background: none;
        border: 0;
    }

    .en-hero-eyebrow .en-icon {
        display: none;
    }

    .en-hero-title,
    .en-hero-sub,
    .en-hero-date {
        color: #000000;
    }

    .en-hero-title {
        margin-top: 4px;
        font-size: 1.6rem;
    }

    .en-figs {
        margin-top: 12px;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 8px;
    }

    .en .en-fig {
        padding: 10px 10px 8px;
    }

    .en .en-fig,
    .en-panel,
    .en-card {
        box-shadow: none !important;
        border-color: #999999;
    }

    .en [data-en-reveal],
    .en .en-rise {
        translate: none !important;
    }

    .en .en-fig::before,
    .en .en-sec-title::before {
        transform: none !important;
    }

    .en-fig::before,
    .en-sec-title::before,
    .en-card::before,
    .en-sw {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .en-sec {
        margin-top: 18px;
    }

    .en-sec-head {
        break-after: avoid;
    }

    .en-panel,
    .en .en-fig,
    .en-card,
    .en-about,
    .en-table tr {
        break-inside: avoid;
    }

    .en a {
        color: #000000 !important;
        text-decoration: none !important;
    }
}

.en-callout .en-btn {
    margin-top: 14px;
}

.en .en-empty-reset {
    display: inline-block;
    margin-top: 10px;
    color: var(--en-brand);
    font-weight: 600;
}

@media screen {
    .en-hero,
    .en-hero.is-plain {
        padding: 24px var(--en-gutter);
    }

    .en-hero-title {
        margin-top: 8px;
        font-size: clamp(1.6rem, 3vw, 2.2rem);
    }

    .en-hero-sub {
        margin-top: 8px;
        font-size: .98rem;
        line-height: 1.65;
    }

    .en-hero-date {
        margin-top: 6px;
        font-size: .85rem;
    }

    .en-figs {
        margin-top: 16px;
        gap: 10px;
    }

    .en .en-fig {
        padding: 12px;
    }

    .en-sec {
        margin-top: 24px;
    }

    .en-panel-head {
        padding: 10px 14px;
    }

    .en-panel-body {
        padding: 14px;
    }

    .en-grid-2 {
        gap: 14px;
    }

    .en-table th,
    .en-table td {
        padding: 10px 12px;
    }
}

@media screen and (max-width: 640px) {
    .en-hero,
    .en-hero.is-plain {
        padding: 18px var(--en-gutter);
    }

    .en-tools-act {
        width: 100%;
    }

    .en-tools-act .en-btn {
        flex: 1;
        min-height: 44px;
    }
}

@media screen and (min-width: 980px) {
    .en-grid-2 {
        align-items: stretch;
    }

    #sec-force .en-grid-2 {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    }

    #sec-age .en-grid-2,
    #sec-rank .en-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .en-grid-2 > .en-panel {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .en-grid-2 > .en-panel > .en-panel-head {
        flex: none;
        min-height: 54px;
    }

    .en-grid-2 > .en-panel > .en-panel-body {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }

    .en-grid-2 .en-legend {
        margin-top: auto;
        padding-top: 14px;
    }
}


/* ═══════════════════════════════════════════════════════════════════════
   ส่วนเฉพาะของหน้า
   ═══════════════════════════════════════════════════════════════════════ */

.en {
    --en-lo: #2a78d6;
    --en-up: #1baf7a;
    --en-d2: color-mix(in srgb, #d03b3b 30%, var(--en-paper));
    --en-d1: color-mix(in srgb, #d03b3b 14%, var(--en-paper));
    --en-mid: var(--en-paper-alt);
    --en-u1: color-mix(in srgb, #2a78d6 14%, var(--en-paper));
    --en-u2: color-mix(in srgb, #2a78d6 30%, var(--en-paper));
    --en-left: #d0635f;
    --en-grad: color-mix(in srgb, var(--en-ink-2) 45%, var(--en-paper));
}

:is(html.dark, html.dark-mode, html[data-theme="dark"], body.dark-mode, body[data-theme="dark"]) .en {
    --en-lo: #3987e5;
    --en-up: #199e70;
    --en-d2: color-mix(in srgb, #e66767 38%, var(--en-paper));
    --en-d1: color-mix(in srgb, #e66767 18%, var(--en-paper));
    --en-u1: color-mix(in srgb, #3987e5 20%, var(--en-paper));
    --en-u2: color-mix(in srgb, #3987e5 40%, var(--en-paper));
    --en-left: #e66767;
}

.en-icon {
    flex: none;
}

/* การ์ดตัวเลขใบที่ต้องลงมือ */
.en .en-fig.is-warn .en-fig-v b {
    color: var(--en-warn-fg);
}

/* ── กราฟ SVG ───────────────────────────────────────────────────────── */
.en-chart {
    position: relative;
}

.en-svg {
    display: block;
    width: 100%;
    min-width: 560px;
    height: auto;
    font-family: var(--en-sans);
}

.en-svg.is-mini {
    min-width: 0;
}

.en-grid {
    stroke: var(--en-line);
    stroke-width: 1;
}

.en-axis {
    stroke: var(--en-line-bold);
    stroke-width: 1.5;
}

.en-tick {
    font-size: 12px;
    fill: var(--en-muted);
}

.en-tick.is-live,
.en-tick.is-proj {
    font-weight: 700;
    fill: var(--en-ink-2);
}

.en-tick.is-sm,
.en-val.is-sm {
    font-size: 11.5px;
}

.en-val {
    font-size: 12.5px;
    font-weight: 700;
    fill: var(--en-ink);
    font-variant-numeric: tabular-nums;
}

.en-hit {
    fill: transparent;
}

.en-col:hover .en-hit,
.en-svg g[data-tip]:hover .en-hit {
    fill: color-mix(in srgb, var(--en-brand) 7%, transparent);
}

.en-bar.is-lo {
    fill: var(--en-lo);
}

.en-bar.is-up {
    fill: var(--en-up);
}

.en-bar.is-mono {
    fill: var(--en-lo);
}

.en-bar-live {
    fill: none;
    stroke: var(--en-ink-2);
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
}

.en-band {
    fill: color-mix(in srgb, var(--en-lo) 14%, transparent);
}

.en-line {
    fill: none;
    stroke: var(--en-ink-2);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.en-line.is-proj {
    stroke: var(--en-lo);
    stroke-dasharray: 6 5;
}

.en-dot {
    fill: var(--en-ink-2);
    stroke: var(--en-paper);
    stroke-width: 2;
}

.en-dot.is-live {
    fill: var(--en-paper);
    stroke: var(--en-ink-2);
    stroke-width: 2.5;
}

.en-dot.is-proj {
    fill: var(--en-lo);
}

.en-dot:hover {
    stroke: var(--en-ink);
}

.en-end {
    font-size: 12.5px;
    font-weight: 700;
    fill: var(--en-ink);
}

.en-end.is-muted {
    font-weight: 500;
    fill: var(--en-muted);
}

/* สัญลักษณ์ในคำอธิบาย */
.en-sw.is-lo { background: var(--en-lo); }
.en-sw.is-up { background: var(--en-up); }
.en-sw.is-live {
    background: transparent;
    border: 1.5px dashed var(--en-ink-2);
}

.en-sw.en-rate,
.en-sw.en-fl {
    box-shadow: inset 0 0 0 1px var(--en-line-bold);
}

.en-sw.en-ln {
    height: 0;
    border-radius: 0;
    border-top: 2px solid var(--en-ink-2);
}

.en-sw.en-ln.is-proj {
    border-top: 2px dashed var(--en-lo);
}

.en-sw.en-ln.is-band {
    height: 10px;
    border: 0;
    background: color-mix(in srgb, var(--en-lo) 14%, transparent);
}

/* ── ตาราง ──────────────────────────────────────────────────────────── */
.en-table small {
    display: block;
    font-size: .74rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--en-muted);
}

.en-table th small {
    font-weight: 500;
}

.en-table tfoot th,
.en-table tfoot td {
    border-top: 2px solid var(--en-line-bold);
}

.en-table .is-live {
    background: color-mix(in srgb, var(--en-brand) 5%, var(--en-paper));
}

.en-table thead .is-live,
.en-table thead .is-proj {
    color: var(--en-ink-2);
}

.en-table td.is-proj {
    background: color-mix(in srgb, var(--en-lo) 5%, var(--en-paper));
}

.en-table td.is-more small,
.en-table td.is-more b {
    color: var(--en-warn-fg);
}

.en-hist-table,
.en-fc-table,
.en-room-table,
.en-need-table {
    min-width: 560px;
}

/* คอลัมน์แรกติดซ้ายเวลาเลื่อนตารางด้านข้าง */
.en-hist-table tbody th, .en-hist-table thead th:first-child, .en-hist-table tfoot th,
.en-co-table tbody th, .en-co-table thead th:first-child,
.en-rate-table tbody th, .en-rate-table thead th:first-child,
.en-fc-table tbody th, .en-fc-table thead th:first-child, .en-fc-table tfoot th,
.en-room-table tbody th, .en-room-table thead th:first-child, .en-room-table tfoot th,
.en-need-table tbody th, .en-need-table thead th:first-child, .en-need-table tfoot th,
.en-live-table tbody th, .en-live-table thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--en-paper);
    box-shadow: inset -1px 0 0 var(--en-line);
}

/* รายรุ่น และอัตราเลื่อนชั้น: ช่องสี + ตัวเลขทุกช่อง */
.en-co-table,
.en-rate-table {
    min-width: 620px;
}

.en-co,
.en-rate {
    text-align: center !important;
    font-variant-numeric: tabular-nums;
    border-left: 2px solid var(--en-paper);
}

.en-co b,
.en-rate b {
    font-weight: 700;
    color: var(--en-ink);
}

.en-co small {
    color: var(--en-ink-2);
}

.en-co.is-d2, .en-rate.is-d2, .en-sw.en-rate.is-d2 { background: var(--en-d2); }
.en-co.is-d1, .en-rate.is-d1, .en-sw.en-rate.is-d1 { background: var(--en-d1); }
.en-co.is-mid, .en-rate.is-mid, .en-sw.en-rate.is-mid { background: var(--en-mid); }
.en-co.is-u1, .en-rate.is-u1, .en-sw.en-rate.is-u1 { background: var(--en-u1); }
.en-co.is-u2, .en-rate.is-u2, .en-sw.en-rate.is-u2 { background: var(--en-u2); }

.en-co.is-start {
    background: var(--en-paper-alt);
}

.en-co.is-proj,
.en-sw.en-rate.is-proj {
    background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--en-lo) 22%, var(--en-paper)) 0 3px, var(--en-paper) 3px 8px);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--en-lo) 45%, var(--en-paper));
}

.en-co.is-proj b {
    font-weight: 500;
    font-style: italic;
    color: var(--en-ink-2);
}

.en-co.is-empty {
    background: transparent;
}

.en-co.is-live,
.en-rate.is-live {
    box-shadow: inset 0 0 0 1.5px var(--en-ink-2);
}

.en-co-table .is-split,
.en-rate-table tbody tr:nth-child(3) > * {
    border-left-width: 3px;
}

.en-co-table .is-split {
    border-left: 3px solid var(--en-line-bold);
}

.en-rate-table thead .is-win {
    box-shadow: inset 0 -3px 0 var(--en-lo);
}

.en-rate.is-avg {
    border-left: 3px solid var(--en-line-bold);
}

.en-rate-table tbody tr:nth-child(3) > th {
    border-left-width: 0;
}

/* การเลื่อนชั้นจริง */
.en-live-table {
    min-width: 820px;
}

.en-live-table.is-pub {
    min-width: 600px;
}

@media (max-width: 600px) {
    /* มือถือ: แถบสัดส่วนสั้นลง ตัวเลขเห็นได้โดยเลื่อนน้อยที่สุด */
    .en-live-table .en-flow-bar {
        width: auto;
        min-width: 6rem;
    }

    .en-live-table.is-pub {
        min-width: 520px;
    }
}

.en-table .is-c {
    text-align: center;
}

.en-grp {
    padding-bottom: 2px !important;
    font-size: .8rem !important;
    color: var(--en-ink-2) !important;
    text-align: center !important;
    border-bottom: 2px solid var(--en-line-bold) !important;
}

.en-live-table .is-gap {
    border-left: 3px solid var(--en-line-bold);
}

.en-kv-v {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 6px;
    color: var(--en-ink-2);
}

.en-kv-v small {
    font-size: .8rem;
    color: var(--en-muted);
}

.en-flow-bar {
    width: 30%;
    min-width: 8rem;
}

.en-stack {
    display: flex;
    gap: 2px;
    height: 12px;
}

.en-stack i {
    display: block;
    width: var(--w);
    height: 100%;
    border-radius: 3px;
}

.en-stack .is-up, .en-sw.en-fl.is-up { background: var(--en-lo); }
.en-stack .is-stay, .en-sw.en-fl.is-stay { background: var(--en-line-bold); }
.en-stack .is-other { background: var(--en-muted); }
.en-stack .is-left, .en-sw.en-fl.is-left { background: var(--en-left); }
.en-stack .is-grad, .en-sw.en-fl.is-grad { background: var(--en-grad); }

/* ── คาดการณ์: ลองเปลี่ยนจำนวนรับ ───────────────────────────────────── */
.en-whatif {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--en-brand-line);
    border-radius: var(--en-rs);
    background: var(--en-brand-soft);
}

.en-whatif-t {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .98rem;
    font-weight: 600;
    color: var(--en-ink);
}

.en-whatif-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    font-size: .92rem;
    color: var(--en-ink-2);
}

.en-whatif-row input[type="range"] {
    flex: 1 1 14rem;
    min-width: 10rem;
    height: 32px;
    accent-color: var(--en-brand);
}

.en-whatif-row output {
    min-width: 3ch;
    font-family: var(--en-serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--en-ink);
    font-variant-numeric: tabular-nums;
}

.en-whatif-out {
    margin-top: 8px;
    font-size: .92rem;
    font-weight: 600;
    color: var(--en-ink);
}

.en-whatif-out:empty {
    display: none;
}

td.is-changed b {
    color: var(--en-brand);
}

.en-k {
    margin-top: 16px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--en-ink-2);
}

.en-assume {
    margin-top: 6px;
    padding-left: 1.2rem;
    list-style: disc;
    font-size: .88rem;
    line-height: 1.7;
    color: var(--en-muted);
}

.en-assume b {
    color: var(--en-ink-2);
}

/* พับได้ */
.en-more {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed var(--en-line-bold);
}

.en-more > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--en-brand);
    cursor: pointer;
    list-style: none;
}

.en-more > summary::-webkit-details-marker {
    display: none;
}

.en-more > summary::before {
    content: "";
    width: 7px;
    height: 7px;
    margin: 0 4px 0 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .2s var(--en-ease);
}

.en-more[open] > summary::before {
    transform: rotate(45deg);
}

.en-more .en-note {
    margin: 8px 0 0;
}

.en-bt-table {
    min-width: 420px;
}

.en-bt-table tr.is-live > * {
    background: color-mix(in srgb, var(--en-brand) 5%, var(--en-paper));
}

/* ── ห้องเรียนและครู ─────────────────────────────────────────────────── */
.en-kv {
    display: grid;
    gap: 8px;
}

.en-kv p {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
    padding: 8px 0;
    border-top: 1px solid var(--en-line);
    font-size: .92rem;
    color: var(--en-muted);
}

.en-kv p:first-child {
    border-top: 0;
}

.en-kv b {
    font-family: var(--en-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--en-ink);
    font-variant-numeric: tabular-nums;
}

.en-mini-list {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.en-mini-list li {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 5.4rem;
    padding: 6px 10px;
    font-size: .8rem;
    color: var(--en-muted);
    background: var(--en-paper-alt);
    border-radius: 8px;
}

.en-mini-list li.is-live {
    background: var(--en-brand-soft);
}

.en-mini-list b {
    font-size: .95rem;
    color: var(--en-ink);
    font-variant-numeric: tabular-nums;
}

.en-foot {
    margin-top: 12px;
    font-size: .86rem;
    color: var(--en-muted);
}

.en-need-wrap {
    margin-top: 18px;
}

.en-lockline {
    margin-top: 10px;
}

.en-grid-3 {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(12px, 1.4vw, 18px);
    align-items: start;
}

.en-panel.is-wide {
    margin-top: 18px;
}

.en-sec > .en-panel {
    margin-top: 18px;
}

/* คุณภาพข้อมูล */
.en-q {
    display: flex;
    flex-direction: column;
}

.en-q li {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 4px 14px;
    padding: 10px 0;
    border-top: 1px solid var(--en-line);
    font-size: .92rem;
    line-height: 1.65;
    color: var(--en-ink-2);
}

.en-q li:first-child {
    border-top: 0;
}

.en-q-src {
    font-weight: 700;
    color: var(--en-ink);
    font-variant-numeric: tabular-nums;
}

.en-lock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--en-ink-2);
    background: var(--en-paper-alt);
    border: 1px solid var(--en-line-bold);
    border-radius: 999px;
}

.en-lock .en-icon {
    width: 14px;
    height: 14px;
}

/* ── จอแคบ ──────────────────────────────────────────────────────────── */
@media (max-width: 1199.98px) {
    .en-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .en-grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .en-q li {
        grid-template-columns: minmax(0, 1fr);
    }

    /* กราฟเลื่อนในกรอบ ตัวอักษรในหน่วยของกราฟต้องโตขึ้นเมื่อกราฟถูกย่อ */
    .en-svg:not(.is-mini) .en-tick,
    .en-svg:not(.is-mini) .en-val,
    .en-svg:not(.is-mini) .en-end {
        font-size: 14px;
    }
}

/* ── คมชัดสูง ──────────────────────────────────────────────────────── */
html.tb1-contrast-high .en {
    --en-lo: #ffffff;
    --en-up: #facc15;
    --en-d2: #000000;
    --en-d1: #000000;
    --en-mid: #000000;
    --en-u1: #000000;
    --en-u2: #000000;
    --en-left: #facc15;
    --en-grad: #888888;
}

/* คอลัมน์ที่ติดซ้ายใช้พื้นของกระดาษ ซึ่งโหมดคมชัดสูงไม่ได้เปลี่ยนเป็นดำ ต้องตั้งเอง */
html.tb1-contrast-high .en-table tbody th,
html.tb1-contrast-high .en-table thead th:first-child,
html.tb1-contrast-high .en-table tfoot th {
    background: #000000;
    box-shadow: inset -1px 0 0 #ffffff;
}

html.tb1-contrast-high .en-co.is-d2,
html.tb1-contrast-high .en-rate.is-d2 {
    box-shadow: inset 0 0 0 2px #facc15;
}

html.tb1-contrast-high .en-co.is-d1,
html.tb1-contrast-high .en-rate.is-d1 {
    box-shadow: inset 0 0 0 1px #facc15;
}

html.tb1-contrast-high .en-co.is-u2,
html.tb1-contrast-high .en-rate.is-u2 {
    box-shadow: inset 0 0 0 2px #ffffff;
}

html.tb1-contrast-high .en-co b,
html.tb1-contrast-high .en-rate b,
html.tb1-contrast-high .en-co small {
    color: #ffffff;
}

html.tb1-contrast-high .en-tick,
html.tb1-contrast-high .en-val,
html.tb1-contrast-high .en-end {
    fill: #ffffff;
}

html.tb1-contrast-high .en-grid,
html.tb1-contrast-high .en-axis,
html.tb1-contrast-high .en-line,
html.tb1-contrast-high .en-bar-live {
    stroke: #ffffff;
}

html.tb1-contrast-high .en-dot {
    fill: #ffffff;
    stroke: #000000;
}

html.tb1-contrast-high .en-line.is-proj,
html.tb1-contrast-high .en-dot.is-proj {
    stroke: #facc15;
}

html.tb1-contrast-high .en-dot.is-proj {
    fill: #facc15;
}

html.tb1-contrast-high .en-band {
    fill: #333333;
}

html.tb1-contrast-high .en-whatif,
html.tb1-contrast-high .en-mini-list li,
html.tb1-contrast-high .en-lock,
html.tb1-contrast-high .en-more,
html.tb1-contrast-high .en-kv p,
html.tb1-contrast-high .en-q li {
    background: #000000;
    border-color: #ffffff;
}

html.tb1-contrast-high .en-table .is-live,
html.tb1-contrast-high .en-table td.is-proj,
html.tb1-contrast-high .en-bt-table tr.is-live > *,
html.tb1-contrast-high .en-co.is-proj,
html.tb1-contrast-high .en-co.is-start {
    background: #000000;
}

html.tb1-contrast-high .en-whatif-row output,
html.tb1-contrast-high .en-whatif-row label,
html.tb1-contrast-high .en-whatif-out,
html.tb1-contrast-high .en-kv b {
    color: #ffffff;
}

html.tb1-contrast-high .en-table td.is-more small,
html.tb1-contrast-high .en-table td.is-more b,
html.tb1-contrast-high .en-more > summary,
html.tb1-contrast-high td.is-changed b {
    color: #facc15;
}

/* ── พิมพ์ ─────────────────────────────────────────────────────────── */
@media print {
    .en-svg {
        min-width: 0;
        max-width: 17.5cm;
    }

    .en-scroll {
        overflow: visible;
    }

    .en-table {
        min-width: 0 !important;
        font-size: .76rem;
    }

    .en-whatif,
    .en-export,
    .en-print {
        display: none !important;
    }

    .en-co,
    .en-rate,
    .en-stack i,
    .en-sw,
    .en-bar,
    .en-band,
    .en-table .is-live,
    .en-table td.is-proj {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .en-panel,
    .en-card {
        break-inside: avoid;
    }

    .en-more > summary::before {
        display: none;
    }
}
