/* ──────────────────────────────────────────────────────────────────────────
   AcademicCalendar.php — ปฏิทินการศึกษา
   โรงเรียนเทศบาล ๑ กิตติขจร

   รอบ 24 ก.ย. 2569: ภาษาภาพเดียวกับ /zerodropout/ หน้าแรก และแดชบอร์ดบุคลากร
       หัวหน้าน้ำเงินไล่เฉดเต็มจอ เลขปีการศึกษาจาง ๆ เป็นลายน้ำ การ์ดกระจก "ตอนนี้ / กำหนดการถัดไป"
       พร้อมนับถอยหลัง แถบตัวเลขของปี แล้วแผงลอยทับขอบล่าง:
       ทั้งปีในแถบเดียว (ภาคเรียน วันสอบ วันหยุด วันนี้) · ปฏิทิน 12 เดือน · รายการพร้อมตัวกรอง

   ★ โทเคนของหน้าทุกตัวเป็น alias ที่ชี้ไป --tb1-* โหมดมืดจึงพลิกให้เอง
   ★ หน้านี้แนบ css/tb1-display-scale.css (ผ่าน nvabar) โหมดคอนทราสต์สูงพื้นฐานมาจากไฟล์นั้น
   ★ ช่องปฏิทินใช้สามระดับที่แยกด้วยรูปทรง (ขีดทึบ · กรอบ · ลายทแยง) สีประจำประเภทอยู่เฉพาะในรายการ
   ★ ธีมกลางบังคับ font-family บน span div li p a ด้วย !important ตัวเซริฟจึงอยู่ที่ h1–h4 และ b
   ★ ไม่มี opacity:0 เป็นสถานะพัก ที่ขยับได้มีแค่ตำแหน่งและความยาวแถบ (สคริปต์ติด ac-motion ก่อนเท่านั้น)
   ★ ห้ามตั้ง display บน <caption> (บทเรียนรอบก่อน: caption หลุดไปอยู่ใต้ thead)
   ★ ทุก selector ขึ้นต้นด้วย ac- ไม่ชนกับหน้าอื่นหรือไฟล์กลาง
   ────────────────────────────────────────────────────────────────────────── */

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

html:has(body.ac-page) {
    scroll-padding-top: 5rem;
}

/* ★ ลิงก์ข้ามไปเนื้อหาซ่อนด้วย clip ไม่ใช่ left:-9999px ซึ่งไปโดนตัวตรวจล้นแนวนอน */
body.ac-page a.ac-skip {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10000;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

body.ac-page a.ac-skip:focus {
    width: auto;
    height: auto;
    padding: 10px 18px;
    clip-path: none;
    color: #ffffff;
    background: var(--tb1-banner-1, #1d4ed8);
    border-radius: 0 0 10px 0;
    font-weight: 600;
    text-decoration: none;
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

main.ac {
    display: block;
}

main.ac:focus {
    outline: none;
}

/* ── โทเคนของหน้า ─────────────────────────────────────────────────────── */
.ac {
    --ac-paper: var(--tb1-surface, #ffffff);
    --ac-paper-alt: var(--tb1-surface-alt, #f1f5f9);
    --ac-ink: var(--tb1-ink-1, #0f172a);
    --ac-ink-2: var(--tb1-ink-2, #334155);
    --ac-muted: var(--tb1-ink-3, #5a697f);
    --ac-line: var(--tb1-border, #e2e8f0);
    --ac-line-bold: var(--tb1-border-bold, #cbd5e1);
    --ac-field-line: color-mix(in srgb, var(--tb1-ink-3, #5a697f) 85%, var(--tb1-surface, #ffffff));
    --ac-brand: var(--tb1-brand, #1d4ed8);
    --ac-brand-soft: color-mix(in srgb, var(--tb1-brand, #1d4ed8) 10%, var(--tb1-surface, #ffffff));
    --ac-brand-line: color-mix(in srgb, var(--tb1-brand, #1d4ed8) 35%, var(--tb1-border, #e2e8f0));
    --ac-on-brand: var(--tb1-on-brand, #ffffff);
    /* ★ text-danger ของโหมดสว่าง (#dc2626) บนพื้นแดงอ่อนได้ 4.2:1 ไม่ผ่าน AA จึงใช้เฉดเข้มกว่า */
    --ac-err: #b91c1c;
    --ac-err-soft: color-mix(in srgb, #dc2626 8%, var(--tb1-surface, #ffffff));
    --ac-err-line: color-mix(in srgb, #dc2626 35%, var(--tb1-border, #e2e8f0));
    --ac-ok: var(--tb1-text-success, #047857);
    --ac-ok-soft: color-mix(in srgb, #10b981 11%, var(--tb1-surface, #ffffff));
    --ac-ok-line: color-mix(in srgb, #10b981 40%, var(--tb1-border, #e2e8f0));
    --ac-warn: #92400e;
    --ac-warn-soft: color-mix(in srgb, #f59e0b 13%, var(--tb1-surface, #ffffff));
    --ac-warn-line: color-mix(in srgb, #f59e0b 45%, var(--tb1-border, #e2e8f0));
    --ac-on-hero-2: #e0e7ff;
    --ac-gold-text: #fde68a;
    --ac-serif: var(--tb1-font-display, "Noto Sans Thai Looped", sans-serif);
    --ac-sans: var(--tb1-font-body, "Sarabun", system-ui, sans-serif);
    --ac-ease: cubic-bezier(.4, 0, .2, 1);
    --ac-spring: cubic-bezier(.22, 1, .36, 1);
    --ac-gap: clamp(16px, 2vw, 24px);
    --ac-gutter: var(--tb1-shell-gutter, 20px);
    --ac-shadow: var(--tb1-shadow-card, 0 0 16px rgba(15, 23, 42, .05));
    --ac-shadow-float: 0 24px 48px -30px rgba(15, 23, 42, .45);
    --ac-hero-a: color-mix(in srgb, var(--tb1-banner-1, #1d4ed8) 60%, var(--tb1-ink-surface, #0f172a));
    --ac-hero-b: var(--tb1-banner-1, #1d4ed8);
    --ac-hero-c: color-mix(in srgb, var(--tb1-banner-1, #1d4ed8) 78%, var(--tb1-accent-strong, #0284c7));
    --ac-primary: var(--tb1-banner-1, #1d4ed8);
    --ac-primary-2: color-mix(in srgb, var(--tb1-banner-1, #1d4ed8) 70%, #020617);

    color: var(--ac-ink-2);
    font-family: var(--ac-sans);
    font-size: var(--tb1-fs-sm, 1rem);
    line-height: 1.6;
}

:is(html.dark, html.dark-mode, html[data-theme="dark"],
    body.dark-mode, body[data-theme="dark"]) .ac {
    --ac-err: var(--tb1-text-danger, #fda4af);
    --ac-err-soft: color-mix(in srgb, #f87171 12%, var(--tb1-surface, #111c31));
    --ac-err-line: color-mix(in srgb, #f87171 40%, var(--tb1-border, #1e2d4a));
    --ac-ok-soft: color-mix(in srgb, #34d399 12%, var(--tb1-surface, #111c31));
    --ac-ok-line: color-mix(in srgb, #34d399 40%, var(--tb1-border, #1e2d4a));
    --ac-warn: var(--tb1-text-warning, #fbbf24);
    --ac-warn-soft: color-mix(in srgb, #f59e0b 13%, var(--tb1-surface, #111c31));
    --ac-warn-line: color-mix(in srgb, #f59e0b 42%, var(--tb1-border, #1e2d4a));
    --ac-brand-soft: color-mix(in srgb, var(--tb1-brand, #60a5fa) 16%, var(--tb1-surface, #111c31));
    --ac-field-line: color-mix(in srgb, var(--tb1-ink-3, #94a3b8) 70%, var(--tb1-surface, #111c31));
    --ac-shadow: var(--tb1-shadow-card, none);
    --ac-shadow-float: 0 30px 60px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06);
    /* โหมดมืด: banner เป็นกรมท่าเข้ม เติมน้ำเงินสดที่ปลายไล่เฉดให้หัวหน้ามีมิติ แบบเดียวกับหน้าแรก */
    --ac-hero-a: #050d22;
    --ac-hero-c: color-mix(in srgb, #1d4ed8 42%, var(--tb1-banner-1, #0e1f45));
    /* ปุ่มหลักบนแผงสีเข้ม: กรมท่าแทบกลืนกับพื้นแผง จึงใช้น้ำเงินสด (ตัวขาวได้ 5.2:1) */
    --ac-primary: #2563eb;
    --ac-primary-2: #1d4ed8;
    color-scheme: dark;
}

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

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

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

/* ธีมรวมตั้ง display ให้ element หลายชนิด [hidden] ต้องชนะเสมอ */
.ac [hidden] {
    display: none !important;
}

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

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

.ac-icon {
    display: block;
    flex: none;
    width: 1.15em;
    height: 1.15em;
}

.ac-wrap {
    width: 100%;
    max-width: var(--tb1-page-max-width, 1440px);
    margin-inline: auto;
    padding-inline: var(--ac-gutter);
}

/* ── ปุ่ม ───────────────────────────────────────────────────────────────── */
.ac-acts {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.ac .ac-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.75rem;
    padding: 0 1.2rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: var(--tb1-fs-sm, 1rem);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s var(--ac-ease), border-color .2s var(--ac-ease), box-shadow .2s var(--ac-ease), color .2s var(--ac-ease);
}

.ac .ac-btn:active {
    transform: translateY(1px);
}

.ac .ac-btn-lg {
    min-height: 3.1rem;
    padding: 0 1.6rem;
    font-size: var(--tb1-fs-md, 1.125rem);
}

/* ปุ่มบนพื้นน้ำเงิน: สีคงที่ทั้งสองโหมดเพราะพื้นเข้มทั้งสองโหมด */
.ac .ac-btn-light {
    color: var(--tb1-banner-1, #1d4ed8);
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 12px 26px -16px rgba(2, 6, 23, .7);
}

.ac .ac-btn-light:hover {
    background: #eef2ff;
    border-color: #eef2ff;
}

/* ★ พื้นขาว .12 บนน้ำเงิน ตัวขาวยังเกิน 4.5:1 ชี้แล้วพื้นเข้มขึ้น (ถ้าสว่างขึ้นจะต่ำกว่า 4.5:1) */
.ac .ac-btn-glass {
    color: #ffffff;
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .45);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.ac .ac-btn-glass:hover {
    background: rgba(2, 6, 23, .2);
    border-color: #ffffff;
}

/* ปุ่มหลักบนพื้นกระดาษ: น้ำเงินเข้มของ banner (โหมดมืดใช้น้ำเงินสด) ตัวขาวผ่านเสมอ */
.ac .ac-btn-primary {
    color: #ffffff;
    background-color: var(--ac-primary);
    background-image: linear-gradient(135deg, var(--ac-primary) 0%, var(--ac-primary-2) 100%);
    border-color: var(--ac-primary);
    box-shadow: 0 16px 30px -18px color-mix(in srgb, var(--ac-primary) 85%, transparent);
}

.ac .ac-btn-primary:hover {
    background-color: var(--ac-primary-2);
    background-image: none;
    border-color: var(--ac-primary-2);
    box-shadow: 0 20px 34px -18px color-mix(in srgb, var(--ac-primary) 95%, transparent);
}

.ac .ac-btn-primary[aria-disabled="true"],
.ac .ac-btn-primary:disabled {
    cursor: progress;
}

.ac .ac-btn-line {
    color: var(--ac-brand);
    background: var(--ac-paper);
    border-color: var(--ac-brand-line);
}

.ac .ac-btn-line:hover {
    background: var(--ac-brand-soft);
    border-color: var(--ac-brand);
}

.ac .ac-link {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    color: var(--ac-brand);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── สีประจำประเภท (เฉพาะในรายการ) และระดับบนช่องปฏิทิน ─────────────────────
   ★ ทุกสีเป็นสีตัวอักษรบนกระดาษ ผ่าน 4.5:1 ทั้งสองโหมด ไม่ถมพื้นด้วยสีเดียวกับตัวอักษร
     (บทเรียนรอบก่อน: ชิป "วันหยุด" ที่ถมพื้น 8% ตกจาก 5.02 เหลือ 4.43:1) */
.ac {
    /* ★ 4 ต.ค. 2569: ชุดเดียวกับปฏิทินหน้าแรก (alert / text-warning / brand / text-success) ภาคเรียนคงม่วง */
    --ac-k-study: #1d4ed8;
    --ac-k-exam: #b45309;
    --ac-k-act: #047857;
    --ac-k-off: #b91c1c;
    --ac-k-term: #6d28d9;
    --ac-today: var(--ac-primary);
}

:is(html.dark, html.dark-mode, html[data-theme="dark"],
    body.dark-mode, body[data-theme="dark"]) .ac {
    --ac-k-study: #60a5fa;
    --ac-k-exam: #fcd34d;
    --ac-k-act: #6ee7b7;
    --ac-k-off: #fda4af;
    --ac-k-term: #c4b5fd;
    --ac-today: #60a5fa;
}

.ac .is-k-study {
    --ac-kc: var(--ac-k-study);
}

.ac .is-k-exam {
    --ac-kc: var(--ac-k-exam);
}

.ac .is-k-act {
    --ac-kc: var(--ac-k-act);
}

.ac .is-k-off {
    --ac-kc: var(--ac-k-off);
}

.ac .is-k-term {
    --ac-kc: var(--ac-k-term);
}

/* ═══════════════════════════════════════════════════════════════════════
   หัวหน้า: น้ำเงินไล่เฉดเต็มจอ เลขปีการศึกษาเป็นลายน้ำ
   ═══════════════════════════════════════════════════════════════════════ */

.ac-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(26px, 3.4vw, 48px) clamp(92px, 8vw, 118px);
    color: #ffffff;
    /* ★ สีพื้นทึบอยู่ใต้ไล่เฉด ตัวตรวจคอนทราสต์อ่านค่านี้ และเป็นสีที่เห็นจริงตรงกลางหัวหน้า */
    background-color: var(--ac-hero-b);
    background-image: linear-gradient(135deg, var(--ac-hero-a) 0%, var(--ac-hero-b) 52%, var(--ac-hero-c) 100%);
}

.ac-hero.is-plain {
    padding-bottom: clamp(80px, 7vw, 100px);
}

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

.ac-hero::before {
    background-image:
        radial-gradient(circle at 14% 22%, rgba(255, 255, 255, .09) 0%, transparent 42%),
        radial-gradient(circle at 58% 118%, rgba(56, 189, 248, .12) 0%, transparent 46%);
}

/* ตารางเส้นบางแบบกระดาษปฏิทิน (ตกแต่ง) */
.ac-hero::after {
    background-image:
        linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 64px 56px;
    -webkit-mask-image: linear-gradient(180deg, #000000 30%, transparent);
    mask-image: linear-gradient(180deg, #000000 30%, transparent);
}

.ac-hero-fx {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.ac-orb {
    position: absolute;
    display: block;
    border-radius: 50%;
}

.ac-orb.is-a {
    top: -14rem;
    right: -10rem;
    width: 38rem;
    height: 38rem;
    background: radial-gradient(circle, rgba(96, 165, 250, .24) 0%, rgba(96, 165, 250, 0) 68%);
}

.ac-orb.is-b {
    bottom: -12rem;
    left: -10rem;
    width: 30rem;
    height: 30rem;
    background: radial-gradient(circle, rgba(56, 189, 248, .14) 0%, rgba(56, 189, 248, 0) 68%);
}

:is(html.dark, html.dark-mode, html[data-theme="dark"], body.dark-mode) .ac-orb.is-a {
    background: radial-gradient(circle, rgba(59, 130, 246, .32) 0%, rgba(59, 130, 246, 0) 68%);
}

/* เลขปีเป็นลายน้ำ: ตัวกลวง (ขอบขาวจาง) ไม่ใช่ข้อความที่ต้องอ่าน จึงอยู่ใน aria-hidden */
.ac-watermark {
    position: absolute;
    right: clamp(-2rem, 2vw, 3rem);
    bottom: clamp(3.5rem, 6vw, 5.5rem);
    font-family: var(--ac-serif);
    font-size: clamp(7rem, 4rem + 11vw, 15rem);
    font-weight: 700;
    line-height: .8;
    letter-spacing: -.02em;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, .13);
    white-space: nowrap;
    user-select: none;
}

.ac-hero :focus-visible {
    outline-color: #ffffff;
}

.ac-hero-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 26px clamp(28px, 3.6vw, 60px);
}

@media (min-width: 1024px) {
    .ac-hero-top {
        grid-template-columns: minmax(0, 1fr) minmax(21rem, 27rem);
    }
}

.ac-hero-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.ac-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.ac-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 3px 14px;
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 500;
    line-height: 1.4;
    color: #ffffff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* ★ ตัวทองบนกระจกขาวได้แค่ 4.3:1 ในโหมดสว่าง ป้ายเตือนจึงเป็นกระจกเข้ม (เกิน 6:1) */
.ac-tag.is-warn {
    font-weight: 600;
    color: var(--ac-gold-text);
    background: rgba(2, 6, 23, .26);
    border-color: rgba(253, 230, 138, .45);
}

.ac-title {
    font-family: var(--ac-serif);
    font-size: var(--tb1-fs-3xl, clamp(1.875rem, 1.4rem + 1.6vw, 2.5rem));
    font-weight: 600;
    line-height: 1.15;
    color: #ffffff;
    text-wrap: balance;
    text-shadow: 0 2px 20px rgba(2, 6, 23, .3);
}

.ac-title-y {
    display: block;
    margin-top: 4px;
    font-size: .52em;
    font-weight: 500;
    color: #dbeafe;
}

.ac-lead {
    max-width: 40rem;
    margin-top: 12px;
    font-size: var(--tb1-fs-md, 1.125rem);
    line-height: 1.7;
    color: var(--ac-on-hero-2);
}

/* ── ตัวเลือกปีการศึกษา: ชิปกระจก ลิงก์ธรรมดา ─────────────────────────── */
.ac-years {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 20px;
}

.ac-years-k {
    font-size: var(--tb1-fs-xs, .875rem);
    color: var(--ac-on-hero-2);
}

.ac-years-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ac .ac-year {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 2.5rem;
    padding: 0 6px 0 14px;
    color: #ffffff;
    text-decoration: none;
    background: rgba(2, 6, 23, .18);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    transition: background-color .2s var(--ac-ease), border-color .2s var(--ac-ease);
}

.ac .ac-year b {
    font-size: var(--tb1-fs-sm, 1rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ac-year-n {
    min-width: 1.9rem;
    padding: 1px 8px;
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 600;
    text-align: center;
    color: #ffffff;
    background: rgba(255, 255, 255, .14);
    border-radius: 999px;
}

.ac .ac-year:hover {
    background: rgba(2, 6, 23, .32);
    border-color: #ffffff;
}

/* ปีที่เปิดอยู่: ชิปขาวทึบ ตัวน้ำเงิน (สถานะ "ยืนอยู่ปีไหน") */
.ac .ac-year[aria-current="page"] {
    color: var(--tb1-banner-1, #1d4ed8);
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 12px 26px -16px rgba(2, 6, 23, .7);
}

.ac .ac-year[aria-current="page"] .ac-year-n {
    color: #ffffff;
    background: var(--tb1-banner-1, #1d4ed8);
}

.ac-hero-main .ac-acts {
    margin-top: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════
   การ์ดกระจกขวา: ตอนนี้ และกำหนดการถัดไป
   ═══════════════════════════════════════════════════════════════════════ */

.ac-next {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    color: #ffffff;
    background: rgba(2, 6, 23, .3);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: var(--tb1-radius-lg, 22px);
    box-shadow: 0 30px 60px -32px rgba(2, 6, 23, .85), inset 0 1px 0 rgba(255, 255, 255, .14);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.ac-next-sec + .ac-next-sec {
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .16);
}

.ac-next-k {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-family: var(--ac-serif);
    font-size: var(--tb1-fs-md, 1.125rem);
    font-weight: 600;
    color: #ffffff;
}

/* จุด "สด" หน้าคำว่าตอนนี้ (ตกแต่ง) */
.ac-live {
    display: inline-block;
    width: 9px;
    height: 9px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, .22);
}

.ac-now {
    display: grid;
    gap: 6px;
}

.ac .ac-now-a,
.ac .ac-next-a {
    display: grid;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--tb1-radius-md, 16px);
    transition: background-color .2s var(--ac-ease), border-color .2s var(--ac-ease);
}

.ac .ac-now-a {
    grid-template-columns: 2.3rem minmax(0, 1fr);
    gap: 10px;
    padding: 8px 12px 8px 8px;
}

.ac .ac-now-a:hover,
.ac .ac-next-a:hover {
    background: rgba(2, 6, 23, .22);
    border-color: rgba(255, 255, 255, .5);
}

.ac-now-ic {
    display: grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    color: #1d4ed8;
    background: linear-gradient(150deg, #ffffff 0%, #dbeafe 100%);
    border-radius: 12px;
}

.ac-now-t {
    display: grid;
    min-width: 0;
    line-height: 1.45;
}

.ac-now-t b {
    font-size: var(--tb1-fs-sm, 1rem);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.ac-now-t span {
    font-size: var(--tb1-fs-xs, .875rem);
    color: var(--ac-on-hero-2);
}

.ac-next-more,
.ac-next-none {
    font-size: var(--tb1-fs-xs, .875rem);
    line-height: 1.6;
    color: var(--ac-on-hero-2);
}

.ac-next-more {
    margin-top: 6px;
}

.ac .ac-next-a {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 12px 14px 12px 12px;
}

/* นับถอยหลัง: แผ่นขาวตัวเลขใหญ่ */
.ac-count {
    display: grid;
    place-items: center;
    align-content: center;
    min-width: 5.2rem;
    padding: 8px 10px;
    color: #1e3a8a;
    text-align: center;
    background: linear-gradient(160deg, #ffffff 0%, #dbeafe 100%);
    border-radius: var(--tb1-radius-md, 16px);
    box-shadow: 0 16px 30px -18px rgba(2, 6, 23, .9);
}

.ac-count b {
    font-family: var(--ac-serif);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}

.ac-count-k {
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 600;
    line-height: 1.3;
}

.ac-next-t {
    display: grid;
    justify-items: start;
    gap: 4px;
    min-width: 0;
}

.ac-next-t > b {
    font-family: var(--ac-serif);
    font-size: var(--tb1-fs-md, 1.125rem);
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.ac-next-when {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--tb1-fs-xs, .875rem);
    color: var(--ac-on-hero-2);
}

.ac-next-when .ac-icon {
    width: .95rem;
    height: .95rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   แถบตัวเลขของปี: กระจกเข้มแถวเดียว (แบบเดียวกับแดชบอร์ด)
   ═══════════════════════════════════════════════════════════════════════ */

.ac-band {
    margin-top: clamp(24px, 2.6vw, 34px);
}

.ac-stats {
    display: grid;
    grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
    overflow: hidden;
    background: rgba(2, 6, 23, .28);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: var(--tb1-radius-lg, 22px);
    box-shadow: 0 30px 60px -34px rgba(2, 6, 23, .85), inset 0 1px 0 rgba(255, 255, 255, .12);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* เส้นคั่นเป็นเงานอกด้านซ้ายและบนของทุกช่อง ขอบแถบตัดส่วนที่ล้นทิ้ง เหลือเฉพาะเส้นระหว่างช่อง */
.ac-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    padding: 16px clamp(14px, 1.4vw, 22px) 18px;
    box-shadow: -1px 0 0 0 rgba(255, 255, 255, .16), 0 -1px 0 0 rgba(255, 255, 255, .16);
}

.ac-stat-ic {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 4px;
    color: #1d4ed8;
    background: linear-gradient(150deg, #ffffff 0%, #dbeafe 100%);
    border-radius: 13px;
    box-shadow: 0 14px 26px -16px rgba(2, 6, 23, .9);
}

.ac-stat-k {
    font-size: var(--tb1-fs-xs, .875rem);
    line-height: 1.4;
    color: var(--ac-on-hero-2);
}

.ac-stat-v {
    font-size: var(--tb1-fs-sm, 1rem);
    line-height: 1.25;
    color: var(--ac-on-hero-2);
}

.ac-stat-v b {
    font-family: var(--ac-serif);
    font-size: clamp(1.6rem, 1.15rem + 1.1vw, 2.15rem);
    font-weight: 600;
    line-height: 1.15;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.ac-stat-s {
    font-size: var(--tb1-fs-xs, .875rem);
    line-height: 1.45;
    color: var(--ac-on-hero-2);
}

.ac-meter {
    display: block;
    width: 100%;
    height: 8px;
    margin-top: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, .16);
    border-radius: 999px;
}

.ac-meter-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #93c5fd 0%, #ffffff 100%);
    border-radius: 999px;
    transform-origin: left center;
}

/* ═══════════════════════════════════════════════════════════════════════
   ส่วนเนื้อหา: แผงแรกลอยทับขอบล่างของหัวหน้า
   ═══════════════════════════════════════════════════════════════════════ */

.ac-body {
    position: relative;
    z-index: 1;
    display: grid;
    gap: var(--ac-gap);
    margin-top: -68px;
    padding-bottom: clamp(40px, 5vw, 72px);
}

.ac-panel {
    min-width: 0;
    background: var(--ac-paper);
    border: 1px solid var(--ac-line);
    border-radius: var(--tb1-radius-lg, 22px);
    box-shadow: var(--ac-shadow-float);
}

.ac-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ac-line);
    border-radius: 22px 22px 0 0;
    background: linear-gradient(180deg, var(--ac-brand-soft) 0%, var(--ac-paper) 100%);
}

.ac-panel-ic {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.6rem;
    height: 2.6rem;
    color: #ffffff;
    background: linear-gradient(145deg, var(--ac-hero-c) 0%, var(--ac-hero-b) 100%);
    border-radius: 14px;
    box-shadow: 0 12px 22px -14px rgba(15, 23, 42, .8);
}

.ac-panel-title {
    flex: 1 1 16rem;
    min-width: 0;
    font-family: var(--ac-serif);
    font-size: var(--tb1-fs-lg, 1.25rem);
    font-weight: 600;
    line-height: 1.4;
    color: var(--tb1-heading, var(--ac-ink));
}

.ac-panel-sub {
    display: block;
    margin-top: 1px;
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 400;
    line-height: 1.5;
    color: var(--ac-muted);
}

.ac-panel-body {
    padding: 18px 20px 22px;
}

/* ── ประกาศ ─────────────────────────────────────────────────────────────── */
.ac-note {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    color: var(--ac-ink-2);
    background: var(--ac-paper);
    border: 1px solid var(--ac-line);
    border-radius: var(--tb1-radius-md, 16px);
    box-shadow: var(--ac-shadow-float), inset 5px 0 0 var(--ac-note-bar, var(--ac-brand));
}

.ac-note.is-warn {
    --ac-note-bar: #d97706;
    background: var(--ac-warn-soft);
    border-color: var(--ac-warn-line);
}

.ac-note-ic {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.4rem;
    height: 2.4rem;
    color: #ffffff;
    background: var(--ac-primary);
    border-radius: 50%;
}

.ac-note.is-warn .ac-note-ic {
    color: #422006;
    background: #fbbf24;
}

.ac-note p {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding-top: 2px;
}

.ac-note b {
    font-family: var(--ac-serif);
    font-size: var(--tb1-fs-md, 1.125rem);
    font-weight: 600;
    line-height: 1.45;
    color: var(--ac-ink);
}

.ac-note span {
    font-size: var(--tb1-fs-sm, 1rem);
    line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════════════════
   ทั้งปีในแถบเดียว
   ═══════════════════════════════════════════════════════════════════════ */

.ac-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.ac-term {
    display: grid;
    gap: 0 10px;
    grid-template-columns: auto auto;
    align-items: baseline;
    padding: 6px 12px;
    font-size: var(--tb1-fs-xs, .875rem);
    line-height: 1.5;
    color: var(--ac-ink-2);
    background: var(--ac-paper);
    border: 1px solid var(--ac-line);
    border-radius: var(--tb1-radius-sm, 10px);
}

.ac-term b {
    font-weight: 700;
    color: var(--ac-k-term);
}

.ac-term-n {
    grid-column: 1 / -1;
    font-size: var(--tb1-fs-xs, .875rem);
    color: var(--ac-muted);
}

.ac-term.is-now {
    border-color: var(--ac-k-term);
    box-shadow: inset 0 0 0 1px var(--ac-k-term);
}

.ac-term.is-none {
    display: block;
    color: var(--ac-muted);
}

.ac-tl {
    position: relative;
    display: grid;
    gap: 10px;
}

.ac-tl-months {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 4px;
}

.ac .ac-tl-m a {
    display: grid;
    justify-items: center;
    gap: 0;
    min-height: 3rem;
    padding: 6px 2px;
    color: var(--ac-ink);
    text-decoration: none;
    background: var(--ac-paper-alt);
    border-radius: var(--tb1-radius-sm, 10px);
    transition: background-color .2s var(--ac-ease), color .2s var(--ac-ease);
}

.ac-tl-m b {
    font-size: var(--tb1-fs-sm, 1rem);
    font-weight: 700;
    line-height: 1.3;
}

.ac-tl-m span {
    font-size: var(--tb1-fs-xs, .875rem);
    line-height: 1.4;
    color: var(--ac-muted);
    white-space: nowrap;
}

.ac .ac-tl-m.is-empty a {
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--ac-line);
}

.ac .ac-tl-m a:hover {
    color: var(--ac-brand);
    background: var(--ac-brand-soft);
}

.ac .ac-tl-m a:hover b {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* แกนเดือนแบบตัวอักษร (จอแคบเท่านั้น): จอแคบกว่า 480px ลิงก์หัวเดือนสิบสองอันเล็กเกินเป้ากด 24px
   จึงซ่อนลิงก์แล้วใช้แกนตัวอักษรใต้แทร็กแทน (ปฏิทินรายเดือนอยู่ถัดลงไปทันที) */
.ac-tl-axis {
    display: none;
}

/* แทร็กของเส้นเวลา: แถบภาคเรียนด้านบน ขีดรายวันด้านล่าง เส้นวันนี้พาดทั้งแทร็ก */
.ac-tl-track {
    position: relative;
    height: 4.2rem;
    background:
        linear-gradient(90deg, var(--ac-line) 1px, transparent 1px) 0 0 / calc(100% / 12) 100%,
        var(--ac-paper-alt);
    border-radius: var(--tb1-radius-md, 16px);
    overflow: hidden;
}

.ac-tl-bar {
    position: absolute;
    top: 8px;
    height: 1.7rem;
    padding: 0 10px;
    overflow: hidden;
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 600;
    line-height: 1.7rem;
    color: #ffffff;
    white-space: nowrap;
    text-overflow: ellipsis;
    background: linear-gradient(90deg, #6d28d9 0%, #4f46e5 100%);
    border-radius: 999px;
    box-shadow: 0 10px 20px -12px rgba(76, 29, 149, .9);
    transform-origin: left center;
}

.ac-tl-bar.is-now {
    background: linear-gradient(90deg, #5b21b6 0%, #1d4ed8 100%);
}

.ac-tl-tick {
    position: absolute;
    bottom: 8px;
    width: 3px;
    height: 1.2rem;
    margin-left: -1px;
    background: var(--ac-k-study);
    border-radius: 2px;
}

.ac-tl-tick.is-exam {
    height: 1.5rem;
    background: var(--ac-k-exam);
}

.ac-tl-tick.is-off {
    height: .9rem;
    background: var(--ac-k-off);
}

.ac-tl-today {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--ac-today);
}

.ac-tl-today b {
    position: absolute;
    top: 50%;
    left: 50%;
    padding: 0 7px;
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 700;
    line-height: 1.6;
    color: #ffffff;
    white-space: nowrap;
    background: var(--ac-primary);
    border-radius: 999px;
    translate: -50% -50%;
}

/* ═══════════════════════════════════════════════════════════════════════
   ปฏิทินทั้งปี: 12 เดือน
   ═══════════════════════════════════════════════════════════════════════ */

.ac-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    margin-left: auto;
    font-size: var(--tb1-fs-xs, .875rem);
    color: var(--ac-ink-2);
}

.ac-legend li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ac-months {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
    gap: 16px;
}

/* ★ 4 ต.ค. 2569: หน้าตาเดียวกับปฏิทินหน้าแรก (css/tb1-home.css หัวข้อปฏิทิน)
   ตารางมีเส้นช่อง มุมมน เงาเบา หัววันพื้นฟ้าอ่อนมีเส้นสีประจำวันแบบไทย
   จุดใต้วันที่หนึ่งจุดต่อหนึ่งประเภท วันหยุดตัวเลขแดงบนพื้นแดงอ่อน วันสอบพื้นอำพันอ่อน วันนี้พื้นน้ำเงิน
   ทุกสีผูกกับข้อมูล สีประเภทชุดเดียวกับรายการด้านล่าง (--ac-k-*) */
.ac-month {
    min-width: 0;
}

.ac-grid {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--ac-paper);
    border: 1px solid var(--ac-line);
    border-radius: var(--tb1-radius-md, 16px);
    box-shadow: 0 12px 26px -22px rgba(15, 23, 42, .5);
    transition: border-color .2s var(--ac-ease), box-shadow .2s var(--ac-ease);
}

.ac-month:hover .ac-grid {
    border-color: var(--ac-brand-line);
}

/* เดือนที่ไม่มีกำหนดการ: พื้นจาง */
.ac-month.is-empty .ac-grid {
    background: var(--ac-paper-alt);
    box-shadow: none;
}

/* เดือนนี้: กรอบสีวันนี้ และป้าย "เดือนนี้" เป็นตัวอักษร */
.ac-month.is-now .ac-grid {
    border-color: var(--ac-today);
    box-shadow: 0 0 0 1px var(--ac-today), 0 12px 26px -20px rgba(15, 23, 42, .55);
}

.ac-grid caption {
    padding: 0 2px 8px;
    text-align: left;
    caption-side: top;
}

.ac-cap {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
}

.ac-cap b {
    font-family: var(--ac-serif);
    font-size: var(--tb1-fs-lg, 1.25rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--ac-ink);
}

.ac-cap-y {
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 500;
    color: var(--ac-muted);
}

.ac-cap-n {
    align-self: center;
    margin-left: auto;
    padding: 1px 9px;
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 600;
    line-height: 1.5;
    color: var(--ac-brand);
    background: var(--ac-brand-soft);
    border: 1px solid var(--ac-brand-line);
    border-radius: 999px;
}

.ac-month.is-empty .ac-cap-n {
    color: var(--ac-muted);
    background: transparent;
    border-color: var(--ac-line);
}

.ac-cap-now {
    align-self: center;
    padding: 0 8px;
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 700;
    line-height: 1.6;
    color: #ffffff;
    background: var(--ac-primary);
    border-radius: 999px;
}

.ac-grid th {
    --wd: var(--ac-line);
    padding: 6px 0 7px;
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 700;
    text-align: center;
    color: var(--ac-ink-2);
    background: var(--ac-brand-soft);
    border-left: 1px solid var(--ac-line);
    box-shadow: inset 0 -3px 0 var(--wd);
}

.ac-grid th:first-child {
    border-left: 0;
}

.ac .ac-wd-0 { --wd: #ef4444; }
.ac .ac-wd-1 { --wd: #eab308; }
.ac .ac-wd-2 { --wd: #ec4899; }
.ac .ac-wd-3 { --wd: #22c55e; }
.ac .ac-wd-4 { --wd: #f97316; }
.ac .ac-wd-5 { --wd: #0ea5e9; }
.ac .ac-wd-6 { --wd: #8b5cf6; }

.ac-grid td {
    padding: 0;
    text-align: center;
    vertical-align: top;
    border-left: 1px solid var(--ac-line);
    border-top: 1px solid var(--ac-line);
}

.ac-grid td:first-child {
    border-left: 0;
}

.ac .ac-d {
    position: relative;
    display: block;
    width: 100%;
    height: 2.75rem;
    padding-top: .38rem;
    font-size: var(--tb1-fs-sm, 1rem);
    font-weight: 500;
    line-height: 1.5;
    color: var(--ac-ink-2);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.ac .ac-d.is-we {
    color: var(--ac-muted);
    background: color-mix(in srgb, var(--ac-paper-alt) 55%, var(--ac-paper));
}

.ac-pad {
    background: color-mix(in srgb, var(--ac-paper-alt) 55%, var(--ac-paper));
}

.ac-month.is-empty :is(.ac-d.is-we, .ac-pad) {
    background: transparent;
}

/* วันที่มีกำหนดการเป็นลิงก์ไปรายการ ชี้แล้วพื้นฟ้าและกรอบน้ำเงิน */
.ac a.ac-d {
    color: var(--ac-ink);
    transition: background-color .2s var(--ac-ease), box-shadow .2s var(--ac-ease);
}

.ac a.ac-d:hover {
    background: color-mix(in srgb, var(--ac-brand) 14%, var(--ac-paper));
    box-shadow: inset 0 0 0 2px var(--ac-brand);
}

/* วันหยุด: ตัวเลขแดงบนพื้นแดงอ่อน วันสอบ: พื้นอำพันอ่อน (วันที่มีทั้งสองอย่างแสดงเป็นวันหยุด) */
.ac a.ac-d.is-off {
    font-weight: 700;
    color: var(--ac-k-off);
    background: color-mix(in srgb, var(--ac-k-off) 11%, var(--ac-paper));
}

.ac a.ac-d.is-exam {
    color: var(--ac-ink);
    background: color-mix(in srgb, var(--ac-k-exam) 14%, var(--ac-paper));
}

.ac a.ac-d.is-off:hover,
.ac a.ac-d.is-exam:hover {
    box-shadow: inset 0 0 0 2px var(--ac-brand);
}

.ac-pips {
    position: absolute;
    left: 0;
    right: 0;
    bottom: .34rem;
    display: flex;
    justify-content: center;
    gap: 3px;
    pointer-events: none;
}

.ac .ac-pip {
    display: block;
    width: .44rem;
    height: .44rem;
    border-radius: 50%;
    background: var(--ac-kc, var(--ac-brand));
    box-shadow: 0 0 0 1.5px var(--ac-paper);
}

.ac-multi {
    position: absolute;
    top: 3px;
    right: 4px;
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 700;
    line-height: 1;
    color: var(--ac-muted);
}

/* วันนี้: พื้นน้ำเงินเต็มช่อง กรอบขาวจางด้านใน (ไม่ใช้วงนอกช่อง ตารางตัดขอบไว้) */
.ac .ac-d.is-today,
.ac a.ac-d.is-today {
    font-weight: 700;
    color: #ffffff;
    background: var(--ac-primary);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3);
}

.ac a.ac-d.is-today:hover {
    background: color-mix(in srgb, #000000 18%, var(--ac-primary));
    box-shadow: inset 0 0 0 2px #ffffff;
}

.ac .ac-d.is-today .ac-pip {
    background: #ffffff;
    box-shadow: none;
}

.ac .ac-d.is-today .ac-multi {
    color: #ffffff;
}

.ac-key {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 5px;
}

.ac-key.is-today {
    background: var(--ac-primary);
}

.ac-key-k {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ac-kc, var(--ac-brand));
}

/* ═══════════════════════════════════════════════════════════════════════
   รายการกำหนดการ
   ═══════════════════════════════════════════════════════════════════════ */

.ac-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin-bottom: 18px;
    padding: 12px 14px;
    background: var(--ac-paper-alt);
    border: 1px solid var(--ac-line);
    border-radius: var(--tb1-radius-md, 16px);
}

.ac-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ac .ac-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 2.4rem;
    padding: 0 14px;
    font: inherit;
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 600;
    color: var(--ac-ink-2);
    background: var(--ac-paper);
    border: 1.5px solid var(--ac-line-bold);
    border-radius: 999px;
    cursor: pointer;
    transition: background-color .2s var(--ac-ease), border-color .2s var(--ac-ease), color .2s var(--ac-ease);
}

.ac .ac-filter span {
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 600;
    color: var(--ac-muted);
}

.ac .ac-filter:hover {
    border-color: var(--ac-kc, var(--ac-brand));
}

.ac .ac-filter[aria-pressed="true"] {
    color: #ffffff;
    background: var(--ac-primary);
    border-color: var(--ac-primary);
}

.ac .ac-filter[aria-pressed="true"] span {
    color: #ffffff;
}

.ac-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    background: var(--ac-kc, var(--ac-brand));
    border-radius: 50%;
}

.ac .ac-filter[aria-pressed="true"] .ac-dot {
    box-shadow: 0 0 0 2px #ffffff;
}

.ac-hide-past {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 2.4rem;
    font-size: var(--tb1-fs-xs, .875rem);
    color: var(--ac-ink-2);
    cursor: pointer;
}

.ac-hide-past input {
    width: 24px;
    height: 24px;
    margin: 0;
    accent-color: var(--ac-primary);
}

.ac-shown {
    margin-left: auto;
    font-size: var(--tb1-fs-xs, .875rem);
    color: var(--ac-muted);
}

.ac-none {
    padding: 18px;
    font-size: var(--tb1-fs-sm, 1rem);
    text-align: center;
    color: var(--ac-muted);
    background: var(--ac-paper-alt);
    border-radius: var(--tb1-radius-md, 16px);
}

.ac-mgroup + .ac-mgroup {
    margin-top: 22px;
}

.ac-mon-h {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
    padding-left: 16px;
    font-family: var(--ac-serif);
    font-size: var(--tb1-fs-lg, 1.25rem);
    font-weight: 600;
    line-height: 1.4;
    color: var(--tb1-heading, var(--ac-ink));
}

.ac-mon-h::before {
    content: "";
    position: absolute;
    top: .25em;
    bottom: .25em;
    left: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--ac-k-act) 0%, var(--ac-hero-b) 100%);
    border-radius: 3px;
}

.ac-mon-n {
    font-family: var(--ac-sans);
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 500;
    color: var(--ac-muted);
}

.ac-evs {
    display: grid;
    gap: 8px;
}

.ac-ev {
    display: grid;
    grid-template-columns: 4.4rem minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding: 12px 16px 12px 12px;
    background: var(--ac-paper);
    border: 1px solid var(--ac-line);
    border-radius: var(--tb1-radius-md, 16px);
    box-shadow: inset 4px 0 0 var(--ac-kc, var(--ac-brand));
    transition: background-color .2s var(--ac-ease), box-shadow .2s var(--ac-ease);
    scroll-margin-top: 5.5rem;
}

.ac-ev:hover {
    background: color-mix(in srgb, var(--ac-kc, var(--ac-brand)) 5%, var(--ac-paper));
}

/* รายการที่ถูกเปิดจากลิงก์ในช่องวัน: กรอบสีวันนี้ชั่วครู่ (ไม่มีสคริปต์ก็เห็นกรอบ) */
.ac-ev:target {
    border-color: var(--ac-today);
    box-shadow: inset 4px 0 0 var(--ac-kc, var(--ac-brand)), 0 0 0 3px color-mix(in srgb, var(--ac-today) 35%, transparent);
}

.ac-tile {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 4rem;
    padding: 6px 4px;
    color: var(--ac-ink);
    text-align: center;
    background: var(--ac-paper-alt);
    border: 1px solid var(--ac-line);
    border-radius: var(--tb1-radius-sm, 10px);
}

.ac-tile b {
    font-family: var(--ac-serif);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ac-tile span {
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 600;
    color: var(--ac-muted);
}

.ac-ev.is-now .ac-tile {
    color: #ffffff;
    background: var(--ac-primary);
    border-color: var(--ac-primary);
}

.ac-ev.is-now .ac-tile span {
    color: #ffffff;
}

.ac-ev-body {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.ac-ev-t,
.ac-ev-t b {
    font-family: var(--ac-serif);
    font-size: var(--tb1-fs-md, 1.125rem);
    font-weight: 600;
    line-height: 1.5;
    color: var(--tb1-heading, var(--ac-ink));
    overflow-wrap: anywhere;
}

.ac-ev.is-past .ac-ev-t {
    color: var(--ac-ink-2);
}

.ac-ev-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    font-size: var(--tb1-fs-xs, .875rem);
    color: var(--ac-muted);
}

/* ชิปประเภท: ข้อความ + ไอคอน + กรอบสีประเภท บนพื้นกระดาษ (ไม่ถมพื้นด้วยสีเดียวกับตัวอักษร) */
.ac-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 1px 10px 1px 8px;
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 700;
    line-height: 1.6;
    color: var(--ac-kc, var(--ac-brand));
    background: var(--ac-paper);
    border: 1.5px solid var(--ac-kc, var(--ac-brand));
    border-radius: 999px;
}

.ac-chip .ac-icon {
    width: .95rem;
    height: .95rem;
}

/* ชิปบนการ์ดกระจกของหัวหน้า: ตัวขาว กรอบขาวจาง */
.ac-chip.is-on-glass {
    color: #ffffff;
    background: rgba(2, 6, 23, .2);
    border-color: rgba(255, 255, 255, .45);
}

.ac-when {
    color: var(--ac-ink-2);
    font-variant-numeric: tabular-nums;
}

.ac-state {
    padding: 0 9px;
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 700;
    line-height: 1.6;
    border-radius: 999px;
}

.ac-state.is-now {
    color: #ffffff;
    background: var(--ac-primary);
}

.ac-state.is-soon {
    color: var(--ac-brand);
    background: var(--ac-brand-soft);
    box-shadow: inset 0 0 0 1px var(--ac-brand-line);
}

.ac-state.is-past {
    color: var(--ac-muted);
    box-shadow: inset 0 0 0 1px var(--ac-line-bold);
}

.ac-place {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: var(--tb1-fs-xs, .875rem);
    color: var(--ac-ink-2);
}

.ac-place .ac-icon {
    margin-top: .15em;
    width: 1rem;
    height: 1rem;
    color: var(--ac-muted);
}

.ac-ev-d {
    font-size: var(--tb1-fs-sm, 1rem);
    line-height: 1.7;
    color: var(--ac-ink-2);
    overflow-wrap: anywhere;
}

/* ── รูปและไฟล์แนบของกิจกรรม (29 ก.ย. 2569) ─────────────────────────────── */
.ac-ev-files {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.ac-ev-pics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ac-ev-pics a {
    display: block;
    overflow: hidden;
    border: 1px solid var(--ac-line);
    border-radius: var(--tb1-radius-sm, 10px);
}

.ac-ev-pics img {
    display: block;
    width: 112px;
    height: 84px;
    object-fit: cover;
    transition: transform .2s ease;
}

.ac-ev-pics a:hover img,
.ac-ev-pics a:focus-visible img {
    transform: scale(1.05);
}

.ac-ev-pics a:focus-visible,
.ac-ev-docs a:focus-visible {
    outline: 3px solid var(--ac-brand);
    outline-offset: 2px;
}

.ac-ev-docs {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ac-ev-docs a {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    max-width: 100%;
    padding: 6px 12px 6px 8px;
    color: var(--ac-brand);
    background: var(--ac-brand-soft);
    border-radius: var(--tb1-radius-sm, 10px);
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 600;
    text-decoration: none;
}

.ac-ev-docs a:hover .ac-doc-n {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ac-ev-docs .ac-icon {
    width: 1.1rem;
    height: 1.1rem;
    flex: none;
}

.ac-doc-n {
    min-width: 0;
    overflow-wrap: anywhere;
}

.ac-doc-s {
    color: var(--ac-ink-2);
    font-size: var(--tb1-fs-xs, .875rem);
    font-weight: 500;
}

@media (max-width: 480px) {
    .ac-ev-pics img {
        width: 88px;
        height: 66px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ac-ev-pics img {
        transition: none;
    }
}

@media print {
    .ac-ev-pics {
        display: none;
    }
}

html.tb1-contrast-high .ac-ev-pics a {
    border: 2px solid #ffffff;
}

html.tb1-contrast-high .ac-ev-docs a {
    color: #facc15;
    background: #000000;
    border: 2px solid #facc15;
}

html.tb1-contrast-high .ac-doc-s {
    color: #ffffff;
}

/* ── ท้ายหน้า ───────────────────────────────────────────────────────────── */
.ac-foot {
    padding: 16px 20px;
    font-size: var(--tb1-fs-xs, .875rem);
    line-height: 1.7;
    color: var(--ac-ink-2);
    background: var(--ac-paper);
    border: 1px solid var(--ac-line);
    border-radius: var(--tb1-radius-md, 16px);
}

.ac-foot-t {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--tb1-heading, var(--ac-ink));
}

.ac-foot-t .ac-icon {
    color: var(--ac-brand);
}

.ac-foot ul {
    display: grid;
    gap: 4px;
    padding-left: 1.2rem;
    list-style: disc;
}

.ac-foot li::marker {
    color: var(--ac-muted);
}

/* ═══════════════════════════════════════════════════════════════════════
   ช่วงจอ
   ═══════════════════════════════════════════════════════════════════════ */

/* แถบตัวเลข: 4–5 ช่อง จัดแถวตามจำนวนจริง ไม่ปล่อยช่องเดียวค้างท้ายแถว */
@media (max-width: 1099.98px) {
    .ac-stats[data-n="5"] {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .ac-stats[data-n="5"] > .ac-stat:nth-child(-n + 3) {
        grid-column: span 2;
    }

    .ac-stats[data-n="5"] > .ac-stat:nth-child(n + 4) {
        grid-column: span 3;
    }
}

@media (max-width: 639.98px) {
    .ac-stats,
    .ac-stats[data-n] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* :nth-child(n) ยกความเฉพาะให้เท่ากฎ span ของ data-n="5" ด้านบน ไม่งั้นกฎนั้นชนะ
       แล้วช่องที่ span 2–3 บนกริดสองคอลัมน์จะสร้างคอลัมน์แฝง ทุกช่องกลายเป็นเต็มแถวซ้อนลงมา */
    .ac-stats[data-n] > .ac-stat:nth-child(n) {
        grid-column: auto;
    }

    .ac-stats[data-n] > .ac-stat:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .ac-stat {
        padding: 14px 14px 16px;
    }
}

/* ปฏิทิน 12 เดือน: 4 × 3 บนจอกว้าง (ทั้งปีเห็นในสามแถว) */
@media (min-width: 1200px) {
    .ac-months {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* รายการ: สองคอลัมน์บนจอกว้าง รายการหนึ่งมีเนื้อความสั้น แถวเต็มจอจึงเหลือที่ว่างครึ่งแถว
   (ลำดับอ่านยังเป็นซ้ายไปขวาทีละแถว ตรงกับลำดับวันที่) */
@media (min-width: 1100px) {
    .ac-evs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }
}

@media (max-width: 1023.98px) {
    .ac-hero-top {
        align-items: start;
    }

    .ac-watermark {
        bottom: auto;
        top: 1rem;
        font-size: clamp(6rem, 3rem + 14vw, 10rem);
    }
}

@media (max-width: 759.98px) {
    .ac-hero {
        padding-bottom: 84px;
    }

    .ac-body {
        margin-top: -60px;
    }

    .ac-panel-head {
        padding: 14px 16px;
    }

    .ac-panel-body {
        padding: 14px 14px 18px;
    }

    .ac-terms,
    .ac-legend {
        flex-basis: 100%;
        margin-left: 0;
    }

    /* เส้นเวลาบนจอแคบ: หัวเดือนเหลือชื่อเดือน (จำนวนวันอยู่ในปฏิทินรายเดือนอยู่แล้ว) */
    .ac-tl-months {
        gap: 2px;
    }

    .ac .ac-tl-m a {
        min-height: 2.75rem;
        padding: 6px 0;
        border-radius: 8px;
    }

    .ac-tl-m b {
        font-size: var(--tb1-fs-xs, .875rem);
    }

    .ac-tl-m span {
        display: none;
    }

    .ac-tl-bar {
        padding: 0 6px;
        font-size: var(--tb1-fs-xs, .875rem);
    }

    .ac-ev {
        grid-template-columns: 3.6rem minmax(0, 1fr);
        gap: 10px;
        padding: 10px 12px 10px 10px;
    }

    .ac-tile b {
        font-size: var(--tb1-fs-md, 1.125rem);
    }

    .ac-shown {
        flex-basis: 100%;
        margin-left: 0;
    }

    .ac-next {
        padding: 14px;
        border-radius: var(--tb1-radius-lg, 22px);
    }

    .ac-note {
        padding: 14px 16px;
    }
}

@media (max-width: 479.98px) {
    .ac-title {
        font-size: 2rem;
    }

    .ac-tl-months {
        display: none;
    }

    .ac-tl-axis {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        font-size: var(--tb1-fs-xs, .875rem);
        font-weight: 600;
        line-height: 1.4;
        text-align: center;
        color: var(--ac-muted);
    }

    .ac-hero-main .ac-acts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .ac-hero-main .ac-acts .ac-btn {
        padding-inline: .8rem;
    }

    .ac-hero-main .ac-acts .ac-btn:only-child {
        grid-column: 1 / -1;
    }

    .ac .ac-next-a {
        grid-template-columns: minmax(0, 1fr);
    }

    .ac-count {
        grid-auto-flow: column;
        justify-content: start;
        gap: 8px;
        min-width: 0;
        padding: 8px 14px;
    }

    .ac-count b {
        font-size: 1.7rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   การเคลื่อนไหว
   ★ ทุกอย่างมองเห็นได้ตั้งแต่แรก ที่ขยับมีแค่ตำแหน่งและความยาวแถบ (ไม่มี opacity 0 เป็นสถานะพัก)
   ★ มีผลเฉพาะเมื่อสคริปต์ติดคลาส ac-motion ที่ .ac-shell แล้วเท่านั้น
   ★ ทุกแอนิเมชันเล่นครั้งเดียวแล้วจบ
   ═══════════════════════════════════════════════════════════════════════ */

@keyframes ac-up {
    from {
        transform: translate3d(0, 18px, 0);
    }

    to {
        transform: none;
    }
}

@keyframes ac-drift {
    from {
        transform: translate3d(60px, -40px, 0) scale(.9);
    }

    to {
        transform: none;
    }
}

@keyframes ac-drift-b {
    from {
        transform: translate3d(-50px, 40px, 0) scale(.9);
    }

    to {
        transform: none;
    }
}

@keyframes ac-watermark {
    from {
        transform: translate3d(0, 40px, 0);
    }

    to {
        transform: none;
    }
}

/* วงแสงบีบเข้าหา "วันนี้" หนึ่งครั้ง (box-shadow ไม่ใช่ scale: ไม่ดันผังให้เลื่อนแนวนอน) */
/* วันนี้: วงขาวด้านในบีบเข้าหาขอบครั้งเดียว (ตารางตัดขอบ วงนอกช่องจึงมองไม่เห็น) */
@keyframes ac-today {
    from {
        box-shadow: inset 0 0 0 1.4rem rgba(255, 255, 255, 0);
    }

    40% {
        box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .55);
    }

    to {
        box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3);
    }
}

@keyframes ac-live {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, .6);
    }

    100% {
        box-shadow: 0 0 0 4px rgba(74, 222, 128, .22);
    }
}

.ac-motion .ac-hero-main > * {
    animation: ac-up .7s var(--ac-spring) backwards;
}

.ac-motion .ac-hero-main > :nth-child(2) {
    animation-delay: .06s;
}

.ac-motion .ac-hero-main > :nth-child(3) {
    animation-delay: .12s;
}

.ac-motion .ac-hero-main > :nth-child(4) {
    animation-delay: .18s;
}

.ac-motion .ac-hero-main > :nth-child(5) {
    animation-delay: .24s;
}

.ac-motion .ac-orb.is-a {
    animation: ac-drift 1.8s var(--ac-spring) backwards;
}

.ac-motion .ac-orb.is-b {
    animation: ac-drift-b 2.2s var(--ac-spring) .1s backwards;
}

.ac-motion .ac-watermark {
    animation: ac-watermark 1.6s var(--ac-spring) .1s backwards;
}

.ac-motion .ac-live {
    animation: ac-live 1.2s var(--ac-ease) 3;
}

/* ส่วนที่เลื่อนเข้ามาในจอ: ยกขึ้นจากด้านล่าง ลูกในส่วนนั้นตามมาทีละตัว */
.ac-motion [data-ac-reveal] {
    transition: transform .75s var(--ac-spring);
}

.ac-motion [data-ac-reveal]:not(.is-in) {
    transform: translate3d(0, 28px, 0);
}

.ac-motion [data-ac-reveal] :is(.ac-stat, .ac-month) {
    transition: transform .6s var(--ac-spring), border-color .2s var(--ac-ease), box-shadow .2s var(--ac-ease);
    transition-delay: calc(min(var(--k, 0), 11) * 45ms + 100ms), 0s, 0s;
}

.ac-motion [data-ac-reveal]:not(.is-in) :is(.ac-stat, .ac-month) {
    transform: translate3d(0, 16px, 0);
}

/* แถบภาคเรียนและแถบความคืบหน้าของปี: ยืดออกจากซ้ายเมื่อเข้ามาในจอ */
.ac-motion [data-ac-reveal] :is(.ac-tl-bar, .ac-meter-fill) {
    transition: transform 1s var(--ac-spring) .3s;
}

.ac-motion [data-ac-reveal]:not(.is-in) :is(.ac-tl-bar, .ac-meter-fill) {
    transform: scaleX(0);
}

.ac-motion .ac-month.is-now .ac-d.is-today {
    animation: ac-today 1.4s var(--ac-ease) .6s backwards;
}

/* เฟรมแรกหลังติดคลาส: กระโดดไปตำแหน่งเริ่มโดยไม่เล่นทรานสิชันย้อนกลับ */
.ac-motion.ac-arming [data-ac-reveal],
.ac-motion.ac-arming [data-ac-reveal] * {
    transition: none !important;
}

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

    .ac [data-ac-reveal],
    .ac [data-ac-reveal] * {
        transform: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   โหมดคอนทราสต์สูง
   ไฟล์กลางบังคับพื้นดำ ตัวอักษรขาว ลิงก์และปุ่มเหลือง ที่นี่เขียนเฉพาะสิ่งที่ไฟล์กลางไม่รู้จัก
   ★ ช่องปฏิทินเหลือขาว-ดำ-เหลือง ระดับยังแยกได้ด้วยรูปทรง (ขีดทึบ · กรอบ · ลายทแยง)
   ═══════════════════════════════════════════════════════════════════════ */

html.tb1-contrast-high body.ac-page {
    background: #000000;
}

html.tb1-contrast-high .ac {
    --ac-shadow: none;
    --ac-shadow-float: none;
    --ac-on-hero-2: #ffffff;
    --ac-gold-text: #facc15;
    --ac-k-study: #ffffff;
    --ac-k-exam: #facc15;
    --ac-k-act: #ffffff;
    --ac-k-off: #facc15;
    --ac-k-term: #ffffff;
    --ac-today: #facc15;
}

html.tb1-contrast-high .ac-hero {
    background: #000000 !important;
    border-bottom: 3px solid #ffffff;
}

html.tb1-contrast-high .ac .ac-hero {
    padding-bottom: 36px;
}

html.tb1-contrast-high .ac .ac-body {
    margin-top: 28px;
}

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

html.tb1-contrast-high .ac :where(.ac-tag, .ac-next, .ac-now-ic, .ac-count, .ac-stats, .ac-stat-ic, .ac-meter, .ac-panel,
    .ac-panel-head, .ac-panel-ic, .ac-note, .ac-note-ic, .ac-term, .ac-tl-track, .ac-tl-bar, .ac-cap-now,
    .ac-key, .ac-tools, .ac-none, .ac-ev, .ac-tile, .ac-chip, .ac-state, .ac-foot, .ac-year-n, .ac-live) {
    background: #000000 !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

html.tb1-contrast-high .ac :where(.ac-tag, .ac-now-ic, .ac-count, .ac-stat-ic, .ac-panel-ic, .ac-note-ic, .ac-term, .ac-tl-bar,
    .ac-cap-now, .ac-tile, .ac-chip, .ac-state, .ac-year-n, .ac-meter) {
    border: 1px solid #ffffff !important;
}

html.tb1-contrast-high .ac :where(.ac-next, .ac-panel, .ac-note, .ac-tools, .ac-ev, .ac-foot, .ac-tl-track) {
    border: 1px solid #ffffff !important;
}

html.tb1-contrast-high .ac .ac-tag.is-warn,
html.tb1-contrast-high .ac .ac-tag.is-warn * {
    color: #facc15 !important;
    border-color: #facc15 !important;
}

html.tb1-contrast-high .ac .ac-note.is-warn,
html.tb1-contrast-high .ac .ac-month.is-now .ac-grid,
html.tb1-contrast-high .ac .ac-term.is-now,
html.tb1-contrast-high .ac .ac-ev.is-now,
html.tb1-contrast-high .ac .ac-ev:target {
    border: 3px solid #facc15 !important;
}

/* ลิงก์ที่มีกรอบของตัวเอง: พื้นดำ ขอบเหลือง ชี้แล้วกลับสี */
html.tb1-contrast-high .ac :where(a.ac-btn, a.ac-year, a.ac-now-a, a.ac-next-a) {
    color: #facc15 !important;
    background: #000000 !important;
    border: 2px solid #facc15 !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

html.tb1-contrast-high .ac .ac-year[aria-current="page"] {
    border-width: 4px !important;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

html.tb1-contrast-high .ac :where(a.ac-btn, a.ac-year, a.ac-now-a, a.ac-next-a, .ac-tl-m a, a.ac-d):hover,
html.tb1-contrast-high .ac :where(a.ac-btn, a.ac-year, a.ac-now-a, a.ac-next-a, .ac-tl-m a, a.ac-d):hover * {
    color: #000000 !important;
    background: #facc15 !important;
    border-color: #facc15 !important;
}

html.tb1-contrast-high .ac :focus-visible,
html.tb1-contrast-high .ac-hero :focus-visible {
    outline: 3px solid #facc15;
    outline-offset: 3px;
}

/* ── เส้นเวลา ───────────────────────────────────────────────────────────── */
html.tb1-contrast-high .ac .ac-tl-m a {
    background: #000000 !important;
    box-shadow: inset 0 0 0 1px #ffffff !important;
}

html.tb1-contrast-high .ac .ac-tl-tick {
    background: #ffffff !important;
}

html.tb1-contrast-high .ac .ac-tl-tick.is-exam,
html.tb1-contrast-high .ac .ac-tl-tick.is-off {
    background: #facc15 !important;
}

html.tb1-contrast-high .ac .ac-tl-today {
    background: #facc15 !important;
}

html.tb1-contrast-high .ac .ac-tl-today b {
    color: #000000 !important;
    background: #facc15 !important;
}

html.tb1-contrast-high .ac .ac-meter-fill {
    background: #ffffff !important;
}

/* ── ช่องปฏิทิน ─────────────────────────────────────────────────────────── */
html.tb1-contrast-high .ac a.ac-d,
html.tb1-contrast-high .ac a.ac-d.is-off {
    background: #000000 !important;
    box-shadow: inset 0 0 0 1px #ffffff !important;
}

html.tb1-contrast-high .ac a.ac-d:hover,
html.tb1-contrast-high .ac a.ac-d.is-off:hover {
    color: #000000 !important;
    background: #facc15 !important;
    box-shadow: inset 0 0 0 2px #facc15 !important;
}

html.tb1-contrast-high .ac a.ac-d:hover .ac-pip {
    background: #000000 !important;
}

html.tb1-contrast-high .ac :where(.ac-pip, .ac-key-k) {
    background: #facc15 !important;
    box-shadow: none !important;
}

/* คอนทราสต์สูง: ไม่มีสีประจำวันและพื้นย้อม วันหยุดขีดเส้นใต้แทนพื้นแดง */
html.tb1-contrast-high .ac .ac-grid {
    background: #000000 !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
}

html.tb1-contrast-high .ac .ac-grid th {
    color: #ffffff !important;
    background: #000000 !important;
    box-shadow: inset 0 -3px 0 #ffffff !important;
}

html.tb1-contrast-high .ac :where(.ac-grid td, .ac-grid th) {
    border-color: #ffffff !important;
}

html.tb1-contrast-high .ac :where(.ac-d.is-we, .ac-pad) {
    background: #000000 !important;
}

html.tb1-contrast-high .ac a.ac-d.is-off {
    text-decoration: underline;
    text-underline-offset: 3px;
}

html.tb1-contrast-high .ac .ac-cap-n {
    color: #ffffff !important;
    background: #000000 !important;
    border-color: #ffffff !important;
}

html.tb1-contrast-high .ac .ac-d.is-today {
    color: #facc15 !important;
    background: #000000 !important;
    box-shadow: inset 0 0 0 3px #facc15 !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

html.tb1-contrast-high .ac .ac-key {
    border: 1px solid #ffffff !important;
}

html.tb1-contrast-high .ac .ac-key.is-today {
    border: 3px solid #facc15 !important;
}

html.tb1-contrast-high .ac .ac-mon-h::before,
html.tb1-contrast-high .ac .ac-dot {
    background: #facc15 !important;
}

html.tb1-contrast-high .ac .ac-title,
html.tb1-contrast-high .ac .ac-lead {
    text-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   ฉบับพิมพ์: ปฏิทิน 12 เดือนบนหน้าแรก (4 × 3) ตามด้วยรายการ ขาวดำอ่านง่าย
   ═══════════════════════════════════════════════════════════════════════ */
@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    body.ac-page {
        background: #ffffff;
    }

    body.ac-page a.ac-skip,
    .ac-hero-fx,
    .ac-hero::before,
    .ac-hero::after,
    .ac-acts,
    .ac-years,
    .ac-next,
    .ac-band,
    .ac-tl-panel,
    .ac-tools,
    .ac-none {
        display: none !important;
    }

    .ac {
        --ac-paper: #ffffff;
        --ac-paper-alt: #ffffff;
        --ac-ink: #000000;
        --ac-ink-2: #1f2937;
        --ac-muted: #374151;
        --ac-line: #9ca3af;
        --ac-brand: #1e3a8a;
        --ac-brand-soft: #eef2ff;
        --ac-on-hero-2: #1f2937;
        --ac-shadow: none;
        --ac-shadow-float: none;
        color: #000000;
    }

    .ac-wrap {
        max-width: none;
        padding-inline: 0;
    }

    .ac-hero {
        padding: 0 0 8px;
        color: #000000;
        background: none !important;
        border-bottom: 2px solid #000000;
    }

    .ac-hero-top {
        display: block;
    }

    .ac-tag {
        color: #000000;
        background: none;
        border-color: #9ca3af;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .ac-title,
    .ac-title-y {
        color: #000000;
        text-shadow: none;
    }

    .ac-title {
        font-size: 1.6rem;
    }

    .ac-lead {
        margin-top: 4px;
        font-size: var(--tb1-fs-xs, .875rem);
    }

    .ac-body {
        display: block;
        margin-top: 10px;
        padding-bottom: 0;
    }

    .ac-body > * + * {
        margin-top: 10px;
    }

    .ac-panel-head {
        padding: 6px 0;
        background: none;
        border: 0;
    }

    .ac-panel-ic {
        display: none;
    }

    .ac-panel,
    .ac-note,
    .ac-foot {
        border: 0;
        border-radius: 0;
    }

    .ac-panel-body {
        padding: 0;
    }

    .ac-months {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    .ac-month {
        break-inside: avoid;
    }

    .ac-grid {
        border-radius: 6px;
        box-shadow: none;
    }

    .ac .ac-d {
        height: 1.45rem;
        padding-top: .08rem;
        font-size: var(--tb1-fs-xs, .875rem);
    }

    .ac-grid th {
        padding: 1px 0 2px;
        font-size: var(--tb1-fs-xs, .875rem);
    }

    .ac-cap b {
        font-size: var(--tb1-fs-xs, .875rem);
    }

    .ac-pips {
        bottom: .1rem;
        gap: 1px;
    }

    .ac .ac-pip {
        width: .28rem;
        height: .28rem;
        box-shadow: none;
    }

    .ac-cap-n,
    .ac-multi {
        display: none;
    }

    .ac-list-panel {
        break-before: page;
    }

    .ac-ev,
    .ac-mon-h {
        break-inside: avoid;
    }

    .ac-ev {
        box-shadow: inset 3px 0 0 #6b7280;
    }

    /* สีที่เป็นข้อมูลต้องติดกระดาษ ยืนยันรูปแบบของสัญลักษณ์แต่ละชนิดซ้ำให้ครบ (บทเรียนรอบก่อน) */
    .ac-pip,
    .ac-key,
    .ac-key-k,
    .ac-grid th,
    .ac .ac-d.is-today,
    a.ac-d,
    .ac-tile {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .ac .ac-d.is-today,
    .ac a.ac-d.is-today {
        color: #000000;
        background: #ffffff;
        box-shadow: inset 0 0 0 2px #000000;
    }

    .ac .ac-d.is-today .ac-pip {
        background: #000000;
    }

    .ac [data-ac-reveal],
    .ac [data-ac-reveal] *,
    .ac .ac-hero-main > * {
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }
}
