/* School CMS — Original Base Stylesheet (UTF-8, Mobile-first, 1280px & 1920px ready) */
:root {
    --brand-primary: #1d4ed8;
    --brand-primary-dark: #1e40af;
    --brand-primary-soft: rgba(29, 78, 216, 0.10);
    --brand-accent: #d97706;
    --brand-accent-soft: rgba(217, 119, 6, 0.14);
    --surface-bg: #f4f6fa;
    --surface-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #dbe3ee;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.08);
    --font-thai: "Sarabun", "Noto Sans Thai", "Tahoma", "Segoe UI", system-ui, -apple-system, sans-serif;
}

:root { color-scheme: light; } /* District Edition: light design; embedded pages follow it */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-thai);
    color: var(--text-main);
    background: var(--surface-bg);
    line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--brand-accent);
    outline-offset: 2px;
}

.container {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 20px;
}
@media (min-width: 1600px) {
    .container { max-width: 1420px; }
}
body.site-width-wide .container { max-width: 1680px; }
body.site-width-full .container { max-width: min(96%, 1860px); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-primary-dark); }
.btn-accent { background: var(--brand-accent); color: #fff; }
.btn-secondary { background: #e2e8f0; color: #1e293b; }
.btn-secondary:hover { background: #cbd5e1; }
.btn-outline { background: #fff; border-color: var(--brand-primary); color: var(--brand-primary); }
.btn-outline:hover { background: var(--brand-primary-soft); }
.btn-light-outline { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.6); color: #fff; }
.btn-light-outline:hover { background: rgba(255,255,255,0.24); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    border: 1px solid transparent;
    font-size: 14.5px;
}
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.alert-info a { color: #1d4ed8; font-weight: 600; }

/* Forms */
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-span-2 { grid-column: span 2; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-group label { font-weight: 600; font-size: 14.5px; color: #1e293b; }
.form-group .req { color: #dc2626; }
.form-group small { font-size: 12.5px; color: var(--text-muted); }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    color: var(--text-main);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--brand-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}
.color-input-row { display: flex; align-items: center; gap: 10px; }
.color-input-row input[type="color"] { width: 52px; height: 42px; padding: 2px; border: 1px solid #cbd5e1; border-radius: var(--radius-sm); cursor: pointer; background: #fff; }
.checkbox-row { display: flex; align-items: center; gap: 9px; margin: 8px 0; cursor: pointer; font-size: 14px; }
.checkbox-row input { width: 17px; height: 17px; flex-shrink: 0; }

/* Top Utility Bar */
.top-utility-bar {
    background: #0f172a;
    color: #e2e8f0;
    font-size: 13px;
    padding: 7px 0;
}
.top-utility-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.utility-actions { display: flex; align-items: center; gap: 14px; }
.utility-actions a { color: #fde68a; font-weight: 600; }

/* Header + School Logo Framing + Header Search */
.site-header { background: #fff; border-bottom: 1px solid var(--border-color); }
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
    flex-wrap: wrap;
}
.school-identity { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; min-width: 0; }
.school-identity:hover { text-decoration: none; }

.school-logo-wrap {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.school-logo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.school-logo-frame-circle {
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.school-logo-frame-rounded {
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: #fff;
    padding: 4px;
    box-shadow: var(--shadow-sm);
}
.school-logo-frame-rounded img { object-fit: contain; }
.school-logo-frame-none { background: transparent; }
.school-logo-frame-none img { object-fit: contain; }

.school-logo-fallback {
    width: 60px; height: 60px; border-radius: 14px;
    background: var(--brand-primary); color: #fff;
    display: grid; place-items: center; font-size: 26px; font-weight: 700; flex-shrink: 0;
}
.school-name-th { font-size: 22px; font-weight: 700; color: var(--brand-primary-dark); line-height: 1.25; }
.school-name-en { font-size: 13.5px; color: var(--text-muted); margin-top: 2px; }

.header-tools { display: flex; align-items: center; gap: 10px; }
.header-search {
    display: flex; align-items: center;
    border: 1px solid #cbd5e1; border-radius: var(--radius-sm); overflow: hidden; background: #fff;
}
.header-search input {
    border: 0; padding: 8px 12px; font-family: inherit; font-size: 14px; width: 220px; color: var(--text-main);
}
.header-search input:focus { outline: none; }
.header-search button {
    border: 0; background: var(--brand-primary); color: #fff; padding: 8px 14px;
    font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.header-search button:hover { background: var(--brand-primary-dark); }

.mobile-menu-toggle {
    display: none;
    background: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.site-nav { background: var(--brand-primary); }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; padding: 11px 14px; color: #fff; font-weight: 600; font-size: 14.5px; white-space: nowrap; transition: background-color 0.15s ease; }
.nav-link:hover, .nav-link.is-active { background: var(--brand-primary-dark); text-decoration: none; }
@media (max-width: 1440px) and (min-width: 821px) {
    .nav-link { padding: 10px 10px; font-size: 13.6px; gap: 5px; }
}
/* District Edition: at 1280 px a site with two information groups keeps its menu bar on one line */
@media (max-width: 1320px) and (min-width: 821px) {
    .nav-link { padding-left: 9px; padding-right: 9px; }
}

/* Announcement Ticker Bar */
.ticker-bar {
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    color: #78350f;
    font-size: 13.5px;
    padding: 7px 0;
    overflow: hidden;
}
.ticker-inner { display: flex; align-items: center; gap: 12px; }
.ticker-badge {
    background: var(--brand-accent); color: #fff;
    padding: 2px 10px; border-radius: 6px; font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.ticker-viewport { overflow: hidden; flex: 1; white-space: nowrap; }
.ticker-track { display: inline-block; padding-left: 100%; animation: scTicker 28s linear infinite; font-weight: 500; }
.ticker-track:hover { animation-play-state: paused; }
@keyframes scTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.site-main { padding: 22px 0 42px; min-height: 60vh; }

/* 3-Column & 2-Column Portal Grid */
.portal-grid {
    display: grid;
    gap: 20px;
    align-items: start;
}
.portal-grid.layout-3col {
    grid-template-columns: 265px minmax(0, 1fr) 265px;
}
.portal-grid.layout-2col-left {
    grid-template-columns: 285px minmax(0, 1fr);
}
.portal-grid.layout-2col-right {
    grid-template-columns: minmax(0, 1fr) 285px;
}
.portal-col-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.portal-col-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* Cards & Panels */
.panel-box {
    position: relative;
    min-width: 0;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--brand-primary-soft);
    flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 17.5px; color: var(--brand-primary-dark); }
.panel-more { font-size: 13.5px; font-weight: 600; }

/* Hero Welcome (optional block) */
.hero-banner {
    position: relative;
    background: linear-gradient(125deg, var(--brand-primary-dark) 0%, var(--brand-primary) 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 30px 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}
.hero-banner-has-bg {
    background-size: cover;
    background-position: center;
}
.hero-banner-image-only {
    padding: 0;
    overflow: hidden;
    background: transparent;
}
.hero-banner-image-only img {
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    display: block;
}
.hero-kicker { display: inline-block; background: rgba(255,255,255,0.16); padding: 4px 12px; border-radius: 999px; font-size: 12.5px; margin-bottom: 8px; }
.hero-title { margin: 0 0 8px; font-size: 28px; line-height: 1.25; }
.hero-motto { margin: 0 0 18px; font-size: 15.5px; opacity: 0.94; max-width: 720px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Slider Block */
.slider-box { padding: 0; overflow: hidden; }
.slider-stage { position: relative; min-height: 260px; background: var(--brand-primary-dark); color: #fff; overflow: hidden; }
.slider-slide {
    display: none;
    position: relative;
    min-height: 260px;
    background-size: cover;
    background-position: center;
}
.slider-slide.is-active { display: flex; align-items: flex-end; }
.slider-slide-scrim {
    width: 100%;
    padding: 28px 24px 22px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.80) 100%);
}
.slider-slide-title { margin: 0 0 6px; font-size: 22px; color: #fff; line-height: 1.3; }
.slider-slide-caption { margin: 0; font-size: 14px; color: #e2e8f0; max-width: 680px; }
.slider-slide-cover-link { position: absolute; inset: 0; z-index: 2; display: block; }
.slider-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border-radius: 50%; border: 0;
    background: rgba(15, 23, 42, 0.55); color: #fff; font-size: 20px;
    cursor: pointer; display: grid; place-items: center; z-index: 3;
}
.slider-arrow:hover { background: rgba(15, 23, 42, 0.85); }
.slider-prev { left: 12px; }
.slider-next { right: 12px; }
.slider-dots {
    display: flex; justify-content: center; gap: 7px; padding: 10px;
    background: #f8fafc; border-top: 1px solid var(--border-color);
}
.slider-dot {
    width: 9px; height: 9px; border-radius: 50%; border: 0;
    background: #cbd5e1; cursor: pointer; padding: 0;
}
.slider-dot.is-active { background: var(--brand-primary); width: 22px; border-radius: 999px; }

/* Director & Side Menu */
.director-box { text-align: center; }
.director-photo {
    width: 112px; height: 132px; margin: 0 auto 12px; border-radius: 12px;
    border: 1px solid var(--border-color); background: #f1f5f9;
    overflow: hidden; display: grid; place-items: center; font-size: 40px; color: var(--brand-primary);
}
.director-photo img { width: 100%; height: 100%; object-fit: cover; }
.director-name { font-weight: 700; font-size: 15.5px; color: var(--text-main); }
.director-pos { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.side-menu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.side-menu-list a {
    display: flex; justify-content: space-between; align-items: center; gap: 6px;
    padding: 7px 10px; border-radius: 8px; background: #f8fafc;
    color: var(--text-main); font-size: 13.5px; font-weight: 500;
    border: 1px solid transparent;
}
.side-menu-list a:hover { background: var(--brand-primary-soft); border-color: var(--border-color); text-decoration: none; color: var(--brand-primary-dark); }
/* third menu level in a menu block: the sub-menu is a button that opens its items (e.g. one per fiscal year) */
.side-menu-toggle {
    display: flex; justify-content: space-between; align-items: center; gap: 6px; width: 100%;
    padding: 7px 10px; border-radius: 8px; background: #f8fafc; cursor: pointer;
    color: var(--text-main); font: inherit; font-size: 13.5px; font-weight: 500; text-align: left;
    border: 1px solid transparent;
}
.side-menu-toggle:hover, .side-menu-toggle[aria-expanded="true"] { background: var(--brand-primary-soft); border-color: var(--border-color); color: var(--brand-primary-dark); }
.side-menu-toggle:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.side-menu-caret { font-size: 11px; transition: transform 0.15s ease; }
.side-menu-toggle[aria-expanded="true"] .side-menu-caret { transform: rotate(180deg); }
.side-sub-list { list-style: none; margin: 6px 0 2px 22px; padding: 0 0 0 10px; border-left: 2px solid var(--border-color); display: flex; flex-direction: column; gap: 4px; }
.side-sub-list[hidden] { display: none; }
.side-menu-list .side-sub-list a { display: block; padding: 7px 10px; min-height: 24px; background: #fff; font-size: 13.5px; }

/* Important Event Countdown (Horizontal Card) */
.countdown-card {
    background: linear-gradient(135deg, var(--brand-primary-soft), #fff);
    border-left: 5px solid var(--brand-primary);
}
.countdown-flex { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.countdown-label { font-size: 12px; font-weight: 700; color: var(--brand-accent); }
.countdown-title { margin: 2px 0 3px; font-size: 16.5px; color: var(--text-main); }
.countdown-date { font-size: 13px; color: var(--text-muted); }
.countdown-clock { display: grid; grid-template-columns: repeat(4, minmax(52px, 1fr)); gap: 7px; text-align: center; }
.cd-box { background: #fff; border: 1px solid var(--border-color); border-radius: 8px; padding: 6px 8px; }
.cd-box b { display: block; font-size: 18px; color: var(--brand-primary-dark); line-height: 1.2; }
.cd-box span { font-size: 11px; color: var(--text-muted); }

/* News Tabs & Cards */
.news-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.news-tab-btn {
    border: 0; border-radius: 999px; padding: 5px 12px; font-family: inherit;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    background: #f1f5f9; color: #334155;
}
.news-tab-btn.is-active { background: var(--brand-primary); color: #fff; }

.news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.news-card {
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    overflow: hidden; display: flex; flex-direction: column; background: #fff;
}
.news-card-cover {
    display: block; width: 100%; aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--brand-primary-dark), var(--brand-primary));
    position: relative; overflow: hidden; text-decoration: none;
}
.news-card-cover:hover { text-decoration: none; opacity: 0.96; }
/* cards without a picture keep the picture's 16:9 height, so titles line up across the row (owner 2026-12-04) */
.news-card-cover.is-text-header { aspect-ratio: 16 / 9; height: auto; }
.news-card-cover.is-text-header .news-card-cover-placeholder { font-size: 16px; padding: 12px 18px; }
.news-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card-cover-placeholder {
    height: 100%; display: flex; align-items: center; justify-content: center;
    color: #ffffff; font-weight: 700; font-size: 13.5px; line-height: 1.3;
    padding: 8px 14px; text-align: center;
}
.news-card-body { padding: 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.news-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
/* one line in the news cards: a long category name is shortened (full name in its title), so titles line up */
.news-card .news-card-meta { flex-wrap: nowrap; min-width: 0; }
.news-card .news-card-meta .badge { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.news-card .news-card-meta .news-date { flex-shrink: 0; white-space: nowrap; }
.news-date { color: var(--text-muted); margin-left: auto; }
.news-card-title { margin: 0; font-size: 15.5px; line-height: 1.4; }
/* news cards: the title always takes 3 lines; a longer one ends with ... (owner 2026-12-04), so every card has the same height */
.news-card .news-card-title { height: calc(3 * 1.4em); overflow: hidden; }
.news-card .news-card-title a { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-card-summary { margin: 0; font-size: 13.5px; color: #475569; flex: 1; }
.news-card-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); padding-top: 8px; border-top: 1px solid #f1f5f9; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-primary { background: var(--brand-primary-soft); color: var(--brand-primary-dark); }
.badge-accent { background: var(--brand-accent-soft); color: #92400e; }
.badge-new { background: #dcfce7; color: #166534; }

/* Media Showcase & Docs Split */
.media-strip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.media-widget-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.portal-col-side .media-widget-grid { display: flex; flex-direction: column; gap: 10px; }
.media-mini-card {
    display: block;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f8fafc;
    color: var(--text-main);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.media-mini-card:hover {
    transform: translateY(-2px);
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}
.media-mini-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    height: auto;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
}
.media-mini-thumb.is-video {
    background: linear-gradient(135deg, #dc2626, #ea580c);
}
.media-play-badge {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 13px;
    padding-left: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.media-mini-title {
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.split-2-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.split-2-grid > div { min-width: 0; }
.compact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.compact-list li { padding: 8px 10px; border-radius: 8px; background: #f8fafc; border: 1px solid #eef2f7; }

/* OIT, Calendar, Poll, Visitor Stats, Links */
.oit-card { border-top: 4px solid #059669; }
.oit-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 12px; }
.oit-item-pill { display: block; padding: 7px 10px; border-radius: 7px; background: #ecfdf5; color: #065f46; font-size: 13px; font-weight: 600; }

.event-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.event-item { display: flex; flex-direction: column; gap: 2px; padding-bottom: 9px; border-bottom: 1px dashed var(--border-color); }
.event-item:last-child { border-bottom: none; padding-bottom: 0; }
.event-date-chip { font-size: 12px; font-weight: 700; color: var(--brand-accent); }
.event-title { font-weight: 600; font-size: 14px; }
.event-loc { font-size: 12.5px; color: var(--text-muted); }

.poll-question { font-weight: 600; font-size: 14px; margin: 0 0 10px; }
.poll-preview-list { display: flex; flex-direction: column; gap: 8px; }
.poll-bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 3px; }
.poll-bar-track { height: 7px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.poll-bar-track span { display: block; height: 100%; background: var(--brand-primary); border-radius: 999px; }

.stats-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; text-align: center; }
.stats-mini-cell { background: #f8fafc; border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 6px; display: flex; flex-direction: column-reverse; }
.stats-mini-cell dd { margin: 0; font-size: 18px; font-weight: 700; color: var(--brand-primary-dark); line-height: 1.3; }
.stats-mini-cell dt { font-size: 12.5px; color: var(--text-muted); }
.stats-mini-total { grid-column: span 2; display: flex; justify-content: center; align-items: baseline; gap: 6px; background: var(--brand-primary-soft); border-radius: 8px; padding: 7px; font-size: 13px; }
.stats-mini-total dt { color: var(--text-main); }
.stats-mini-total dd { margin: 0; font-weight: 700; color: var(--brand-primary-dark); }
/* District Edition: online now and the last 7 days, as on the old website */
.stats-online { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; font-size: 13.5px; }
.stats-online small { color: var(--text-muted); }
.stats-online-dot { width: 9px; height: 9px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.stats-week-head { margin: 14px 0 6px; font-size: 13.5px; color: var(--text-main); }
.stats-week-head small { color: var(--text-muted); font-weight: 500; }
.stats-week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; align-items: end; height: 124px; }
.stats-week li { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.stats-week-bar { width: 70%; max-width: 22px; background: var(--brand-primary); border-radius: 3px 3px 0 0; order: 2; }
.stats-week-num { order: 1; font-size: 10px; color: var(--text-muted); white-space: nowrap; margin-bottom: 2px; }
.stats-week-day { order: 3; font-size: 10.5px; line-height: 1.25; text-align: center; color: var(--text-main); white-space: nowrap; margin-top: 3px; min-height: 26px; }
.stats-week li { position: relative; }
.stats-week li > .stats-week-bar { flex: none; }

.agency-links-stack { display: flex; flex-direction: column; gap: 8px; }
.agency-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 10px; }
.agency-link-card {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    width: 100%; height: 58px; padding: 8px 12px;
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    background: #f8fafc; font-weight: 600; font-size: 13px; line-height: 1.35;
    color: var(--text-main); text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.agency-link-card:hover {
    background: var(--brand-primary-soft);
    border-color: var(--brand-primary);
    color: var(--brand-primary-dark);
    text-decoration: none;
}
.agency-link-card > span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}
.agency-link-card small { color: var(--brand-primary); flex-shrink: 0; }

/* Content Pages, Lists, Pagination */
.content-article .breadcrumb { font-size: 13.5px; color: var(--text-muted); margin-bottom: 12px; }
.article-title { margin: 0 0 10px; font-size: 26px; color: var(--brand-primary-dark); line-height: 1.3; }
.article-meta { font-size: 13.5px; color: var(--text-muted); margin-bottom: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.article-lead { font-size: 16px; font-weight: 600; color: #334155; background: #f8fafc; padding: 14px; border-left: 4px solid var(--brand-primary); border-radius: 6px; }
.article-cover-hero { max-height: 420px; width: 100%; object-fit: cover; border-radius: var(--radius-md); margin-bottom: 18px; }
.article-body { line-height: 1.8; }
.article-body img { border-radius: 8px; margin: 12px 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.article-body th, .article-body td { border: 1px solid #cbd5e1; padding: 8px 10px; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.page-link {
    padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border-color);
    background: #fff; color: var(--text-main); font-weight: 600; font-size: 14px;
}
.page-link.is-active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }

.empty-state { text-align: center; padding: 26px 16px; background: #f8fafc; border-radius: var(--radius-sm); border: 1px dashed #cbd5e1; color: var(--text-muted); }
.text-muted { color: var(--text-muted); }

/* Popup Modal */
.popup-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.65); z-index: 100;
    display: flex; align-items: center; justify-content: center; padding: 18px;
}
.popup-backdrop[hidden] { display: none; }
.popup-modal {
    background: #fff; border-radius: 16px; max-width: 600px; width: 100%;
    overflow: hidden; box-shadow: 0 24px 50px rgba(15, 23, 42, 0.35);
}
.popup-head {
    background: var(--brand-primary); color: #fff; padding: 14px 18px;
    display: flex; justify-content: space-between; align-items: center;
}
.popup-head h3 { margin: 0; font-size: 17px; }
.popup-close { background: rgba(255,255,255,0.2); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 18px; }
.popup-body { padding: 18px; max-height: 70vh; overflow-y: auto; }
.popup-foot { padding: 12px 18px; background: #f8fafc; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }

/* Footer */
.site-footer { background: #0f172a; color: #cbd5e1; padding-top: 34px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-bottom: 28px; }
.footer-heading { color: #fff; margin: 0 0 10px; font-size: 16.5px; }
.footer-line { margin: 4px 0; font-size: 14px; }
.footer-line a { color: #93c5fd; }
/* District Edition: developer contact on the bottom line of the footer */
.footer-bottom-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 20px; text-align: center; }
.footer-dev { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 18px; }
.footer-dev-name { flex-basis: 100%; color: #cbd5e1; font-weight: 600; text-align: center; } /* the contacts go on the line below the name */
.footer-dev a { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; color: #93c5fd; }
.footer-dev svg { width: 14px; height: 14px; flex: none; }
.footer-line-badge { display: inline-flex; align-items: center; justify-content: center; padding: 1px 4px; border-radius: 4px; background: #06c755; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .02em; line-height: 1.3; }
.footer-bottom { background: #020617; padding: 14px 0; font-size: 13px; text-align: center; color: #94a3b8; }

/* Theme & Palette Shared Pickers */
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.select-card {
    display: block; border: 2px solid var(--border-color); border-radius: var(--radius-md);
    padding: 14px; background: #fff; cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.select-card input[type="radio"] { margin-bottom: 8px; }
.select-card.is-selected, .select-card:has(input:checked) {
    border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-soft);
}
.select-card-title { font-weight: 700; font-size: 15.5px; margin-bottom: 6px; }
.select-card-desc { font-size: 13.5px; color: var(--text-muted); }

.palette-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.palette-chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 12px; border: 1px solid var(--border-color); border-radius: 999px;
    background: #fff; cursor: pointer; font-family: inherit; font-size: 13.5px;
}
.palette-chip:hover { border-color: var(--brand-primary); }
.palette-chip .swatch { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }

.live-theme-preview { margin-top: 16px; border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; }
.ltp-header { background: var(--preview-primary, #1d4ed8); color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.ltp-title { font-weight: 700; }
.ltp-badge { font-size: 12px; background: rgba(255,255,255,0.2); padding: 3px 10px; border-radius: 999px; }
.ltp-body { padding: 14px 16px; background: #fff; }
.ltp-btn { display: inline-block; background: var(--preview-primary, #1d4ed8); color: #fff; padding: 6px 14px; border-radius: 6px; font-size: 13.5px; font-weight: 600; }
.ltp-pill { display: inline-block; background: var(--preview-accent, #d97706); color: #fff; padding: 6px 12px; border-radius: 999px; font-size: 13px; margin-left: 8px; }

.module-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.module-check-card {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    background: #fff; cursor: pointer;
}
.module-check-card input { margin-top: 4px; width: 18px; height: 18px; flex-shrink: 0; }
.mc-title { font-weight: 700; font-size: 14.5px; }
.mc-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.mc-tag { font-size: 11px; background: #fef3c7; color: #92400e; padding: 2px 7px; border-radius: 999px; margin-left: 4px; }

.logo-thumb-preview { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--text-muted); }
.logo-thumb-preview img { width: 52px; height: 52px; object-fit: contain; border: 1px solid var(--border-color); border-radius: 6px; padding: 3px; background: #fff; }

/* Responsive Breakpoints */
@media (max-width: 1140px) {
    /* owner 2026-12-02: three columns go straight to one, never to two (narrower side columns until then) */
    .portal-grid.layout-3col { grid-template-columns: 230px minmax(0, 1fr) 230px; gap: 16px; }
    .theme-grid { grid-template-columns: 1fr; }
}

@media (max-width: 999px) {
    .portal-grid.layout-3col { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
    .container { padding: 0 14px; }
    .portal-grid { grid-template-columns: 1fr !important; }
    .portal-grid.layout-3col .portal-col-right { grid-column: auto; display: flex; }
    .form-grid-2, .news-grid, .footer-grid, .module-check-grid, .split-2-grid { grid-template-columns: 1fr; }
    .media-strip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .media-widget-grid { grid-template-columns: 1fr; }
    .form-span-2 { grid-column: auto; }
    .school-name-th { font-size: 18px; }
    .header-search input { width: 160px; }
    .mobile-menu-toggle { display: inline-flex; }
    .site-nav { display: none; }
    .site-nav.is-open { display: block; }
    .nav-list { flex-direction: column; padding: 6px 0; }
}


/* Phase 2.5: Header Banner Modes, Block Header/Footer Images & Agency Banner Cards */
.site-header-overlay {
    position: relative;
    background-size: cover;
    background-position: center;
}
.site-header-overlay .site-header-inner {
    position: relative;
    z-index: 2;
    padding-top: 22px;
    padding-bottom: 22px;
}
.site-header-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.78) 0%, rgba(15, 23, 42, 0.45) 60%, rgba(15, 23, 42, 0.25) 100%);
    z-index: 1;
}
.site-header-overlay .school-name-th { color: #ffffff; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.site-header-overlay .school-name-en { color: #e2e8f0; }
.site-header-overlay .site-nav { position: relative; z-index: 2; }

.header-full-banner-wrap { background: #fff; }
.header-full-banner-link { display: block; }
.header-full-banner-link img { width: 100%; height: auto; display: block; }
body.site-width-full .header-full-banner-wrap .container { max-width: 100%; padding: 0; }
.nav-bar-flex { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* the search box keeps its size; long menus wrap instead of squeezing (and clipping) the search button */
.nav-bar-flex > .nav-list { flex: 1 1 auto; min-width: 0; }
.nav-inline-search { flex: 0 0 auto; }
.nav-inline-search input { width: 170px; padding: 6px 10px; font-size: 13px; }
.nav-inline-search button { padding: 6px 12px; font-size: 13px; background: var(--brand-primary-dark); }
.mobile-fullbanner-bar { display: none; }
@media (max-width: 820px) {
    .mobile-fullbanner-bar { display: block; }
    .nav-bar-flex { flex-direction: column; align-items: stretch; padding-bottom: 10px; }
    .nav-inline-search { width: 100%; }
    .nav-inline-search input { flex: 1; }
}

/* Block Header & Footer Custom Images */
.panel-head-banner {
    margin: -18px -18px 14px -18px;
    overflow: hidden;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom: 2px solid var(--brand-primary);
    position: relative;
}
.panel-head-banner img { width: 100%; max-height: 92px; object-fit: cover; display: block; }
.panel-head-banner-overlay {
    position: relative;
    margin: -18px -18px 14px -18px;
    overflow: hidden;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    min-height: 54px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
}
.panel-head-banner-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.35));
}
.panel-head-banner-overlay h2,
.panel-head-banner-overlay a { position: relative; z-index: 2; color: #fff !important; margin: 0; font-size: 16.5px; }

.panel-foot-banner {
    margin: 14px -18px -18px -18px;
    overflow: hidden;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.panel-foot-banner img { width: 100%; max-height: 76px; object-fit: cover; display: block; }

/* Agency Link Banner Card */
.agency-banner-card {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.agency-banner-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.agency-banner-card img { width: 100%; height: 100%; object-fit: cover; display: block; }


/* Phase 3: Contrast Fix, Sidebar Heading Balance & Phase 3 Modules CSS */
.slider-slide-scrim .badge,
.slider-slide-scrim .badge-accent {
    background: #fef3c7;
    color: #78350f;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.panel-head h2 { text-wrap: balance; }
.portal-col-side .panel-head h2 { font-size: 15px; line-height: 1.35; text-wrap: balance; }
@media (min-width: 1280px) {
    .portal-grid.layout-3col { grid-template-columns: 274px minmax(0, 1fr) 274px; }
}

/* Filter Tabs */
.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter-tab {
    padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
    background: #f1f5f9; color: #334155; border: 1px solid #dbe3ee;
}
.filter-tab:hover { background: #e2e8f0; text-decoration: none; }
.filter-tab.is-active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }

/* Personnel Grid */
.personnel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.person-card {
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    padding: 16px; text-align: center; background: #fff; box-shadow: var(--shadow-sm);
}
.person-photo {
    width: 112px; height: 132px; margin: 0 auto 12px; border-radius: 12px;
    background: #f1f5f9; border: 1px solid var(--border-color); overflow: hidden;
    display: grid; place-items: center; font-size: 38px; color: var(--brand-primary);
}
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-name { font-weight: 700; font-size: 15.5px; color: var(--text-main); }
.person-pos { font-size: 13.5px; color: var(--brand-primary-dark); font-weight: 600; margin-top: 3px; }
.person-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

/* Calendar Grid */
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-weekday { text-align: center; font-weight: 700; font-size: 13px; padding: 8px 4px; background: var(--brand-primary-soft); color: var(--brand-primary-dark); border-radius: 6px; }
.cal-cell {
    min-height: 82px; border: 1px solid var(--border-color); border-radius: 8px;
    padding: 6px; background: #fff; font-size: 12px; display: flex; flex-direction: column; gap: 4px;
}
.cal-cell.is-empty { background: #f8fafc; border-style: dashed; }
.cal-cell.is-today { border-color: var(--brand-primary); box-shadow: inset 0 0 0 1px var(--brand-primary); }
.cal-day-num { font-weight: 700; color: var(--text-main); }
.cal-event-chip {
    background: var(--brand-primary-soft); color: var(--brand-primary-dark);
    padding: 2px 5px; border-radius: 4px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 700px) {
    .cal-cell { min-height: 54px; padding: 4px; font-size: 11px; }
}

/* Photo Gallery & Lightbox */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 14px; }
.gallery-photo-btn {
    border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden;
    background: #fff; padding: 0; cursor: pointer; text-align: left; font-family: inherit;
}
.gallery-photo-btn img { width: 100%; height: 175px; object-fit: cover; display: block; }
.gallery-photo-cap { padding: 8px 10px; font-size: 13px; color: var(--text-main); }

.sc-lightbox {
    position: fixed; inset: 0; background: rgba(2, 6, 23, 0.88); z-index: 200;
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px;
}
.sc-lightbox[hidden] { display: none; }
.sc-lightbox-img { max-width: 92vw; max-height: 78vh; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.sc-lightbox-bar { color: #fff; margin-top: 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }
.sc-lightbox-btn { background: rgba(255,255,255,0.18); color: #fff; border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 700; }
.sc-lightbox-btn:hover { background: rgba(255,255,255,0.32); }

/* Video Embed */
.video-embed-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 12px; background: #0f172a; margin-bottom: 16px; }
.video-embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Publications Book Covers */
.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.pub-card { border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.pub-cover { height: 220px; background: linear-gradient(145deg, var(--brand-primary-dark), var(--brand-primary)); color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 16px; text-align: center; }
.pub-cover img { width: 100%; height: 100%; object-fit: cover; }
.pub-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

/* Self-Hosted Multi-Style Menu & Page Icons (Phase 3.5) */
.side-menu-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.side-menu-label > span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.sc-icon svg { display: block; }
.sc-icon-duotone { border-radius: 8px; }
.sc-icon-solid { border-radius: 999px; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14); }
.sc-icon-color { line-height: 1; font-style: normal; }
.sc-icon-img { border-radius: 6px; overflow: hidden; }
.sc-icon-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sc-icon-nav.sc-icon-line,
.sc-icon-nav.sc-icon-duotone { color: #ffffff !important; }
.sc-icon-nav.sc-icon-duotone { background: rgba(255, 255, 255, 0.2) !important; }
.sc-icon-nav.sc-icon-solid { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55); }

/* Phase 4 Modules Styling (Contact, Webboard, OIT, Alumni, Research) */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
@media (max-width: 820px) {
    .contact-grid { grid-template-columns: 1fr; }
}
.map-embed-wrap {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #e2e8f0;
}
.map-embed-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

.wb-topic-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-main);
    text-decoration: none;
}
.wb-topic-row:hover { background: var(--brand-primary-soft); text-decoration: none; }
.wb-topic-row:last-child { border-bottom: none; }
.wb-reply-card {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
}
.wb-official {
    background: var(--brand-primary-soft);
    border-color: var(--brand-primary);
}

.oit-item-card,
.research-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    background: #ffffff;
}
.oit-code-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #d1fae5;
    color: #065f46;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}

.alumni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.alumni-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    background: #ffffff;
    text-align: center;
}

/* ---------- Personnel Hierarchical Org Chart (UAT-006) ---------- */
.org-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
    padding: 10px 0 6px;
}
.org-tier {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.org-tier-sub::before,
.org-tier-branches::before {
    content: "";
    position: absolute;
    top: -26px;
    left: 50%;
    width: 2px;
    height: 26px;
    background: var(--brand-primary);
    opacity: 0.45;
}
.org-tier-label {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
    font-size: 12.5px;
    font-weight: 700;
}
.org-nodes-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    width: 100%;
}
.org-node {
    width: 250px;
    max-width: 100%;
}
.org-card-exec {
    border: 2px solid var(--brand-primary);
    box-shadow: 0 10px 24px rgba(29, 78, 216, 0.12);
}
.org-card-deputy {
    border: 1.5px solid var(--brand-accent);
}
.org-tier-branches {
    align-items: stretch;
    gap: 20px;
}
.org-branch-box {
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--brand-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    background: #f8fafc;
}
.org-branch-title {
    font-size: 16.5px;
    font-weight: 700;
    color: var(--brand-primary-dark);
    margin-bottom: 12px;
}
.org-branch-title span {
    font-size: 13.5px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ---------- Anti-Bot Field & PDPA Consent Banner (UAT-008) ---------- */
.antibot-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.antibot-box label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}
.antibot-box input {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14.5px;
}
.sc-pdpa-banner[hidden] {
    display: none !important;
}
.sc-pdpa-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 95;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.sc-pdpa-inner {
    pointer-events: auto;
    max-width: 960px;
    width: 100%;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13.5px;
    line-height: 1.5;
}
.sc-pdpa-inner a {
    color: #93c5fd;
    text-decoration: underline;
    margin-left: 6px;
    white-space: nowrap;
}
.sc-pdpa-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ---------- Unobtrusive Logged-In Per-Block Quick Edit (UAT-011) ---------- */
.utility-edit-toggle {
    background: rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 2px 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.utility-edit-toggle:hover {
    background: rgba(255, 255, 255, 0.24);
}
.sc-front-edit-pill {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 15;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff !important;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none !important;
    opacity: 0.38;
    backdrop-filter: blur(4px);
    transition: opacity 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
    white-space: nowrap;
}
.panel-box:hover > .sc-front-edit-pill,
.hero-banner:hover > .sc-front-edit-pill,
.sc-front-edit-pill:hover,
.sc-front-edit-pill:focus-visible {
    opacity: 1;
    background: #1d4ed8;
    transform: translateY(-1px);
}
body.sc-hide-edit-pills .sc-front-edit-pill {
    display: none !important;
}
/* the edit pill (signed-in editors only) sits top right: keep the block's "ทั้งหมด" link clear of it */
.panel-box > .sc-front-edit-pill + .panel-head {
    padding-right: 66px;
}
body.sc-hide-edit-pills .panel-box > .sc-front-edit-pill + .panel-head {
    padding-right: 0;
}
/* Google Calendar chosen as the calendar source (admin: ปฏิทินกิจกรรม → แหล่งปฏิทิน) */
.gcal-frame {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color-scheme: light;
}
.gcal-frame-block {
    height: 380px;
    margin-bottom: 10px;
}
.gcal-note {
    margin: 10px 0 0;
    font-size: 13.5px;
}
.split-2-grid .compact-list {
    max-height: 290px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}

/* Interactive Image Cropper Modal (Frontend forms e.g. Alumni) */
.sc-crop-trigger-btn {
    margin-left: 6px;
    white-space: nowrap;
}
.sc-crop-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2200;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.sc-crop-backdrop[hidden] {
    display: none !important;
}
.sc-crop-card {
    width: 100%;
    max-width: 760px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.sc-crop-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
}
.sc-crop-head h3 { margin: 0 0 2px; font-size: 16px; color: #0f172a; }
.sc-crop-sub { font-size: 12.5px; color: #64748b; }
.sc-crop-close {
    border: 0;
    background: #f1f5f9;
    color: #334155;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.sc-crop-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.sc-crop-preset-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.sc-crop-preset-btn.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}
.sc-crop-stage {
    position: relative;
    width: 100%;
    height: 360px;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    touch-action: none;
    cursor: grab;
}
.sc-crop-stage:active { cursor: grabbing; }
.sc-crop-controls {
    padding: 10px 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}
.sc-crop-zoom-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.sc-crop-ctrl-label { font-size: 12.5px; font-weight: 600; color: #334155; }
.sc-crop-zoom-row input[type="range"] { width: 140px; accent-color: #2563eb; }
.sc-crop-meta { font-size: 12.5px; color: #475569; font-weight: 600; }
.sc-crop-foot {
    padding: 12px 18px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
@media (max-width: 640px) {
    .sc-crop-stage { height: 270px; }
    .sc-crop-zoom-row input[type="range"] { width: 105px; }
    .cal-grid { gap: 3px; }
    .cal-weekday { font-size: 11px; padding: 6px 2px; }
    .cal-cell { min-height: 60px; padding: 4px; font-size: 11px; }
    .org-card, .org-branch-list { max-width: 100%; }
}

/* District Edition: one level of sub-menus in the main navigation (disclosure pattern) */
.nav-has-sub { position: relative; }
.nav-sub-toggle { background: none; border: 0; cursor: pointer; font-family: inherit; line-height: inherit; }
.nav-sub-toggle:focus-visible, .nav-link:focus-visible { outline: 3px solid #fff; outline-offset: -4px; }
.nav-sub-caret { font-size: 11px; transition: transform 0.15s ease; }
.nav-sub-toggle[aria-expanded="true"] { background: var(--brand-primary-dark); }
.nav-sub-toggle[aria-expanded="true"] .nav-sub-caret { transform: rotate(180deg); }
.nav-sub-list {
    position: absolute; top: 100%; left: 0; z-index: 60;
    min-width: 240px; max-width: min(360px, 92vw);
    list-style: none; margin: 0; padding: 6px 0;
    background: #fff; border: 1px solid #cbd5e1; border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}
.nav-sub-list[hidden] { display: none; }
.nav-sub-list.is-align-right { left: auto; right: 0; }
.nav-sub-link { display: block; padding: 10px 14px; color: #1e293b; font-size: 14px; line-height: 1.45; }
.nav-sub-link:hover, .nav-sub-link:focus-visible { background: var(--brand-primary-soft); color: var(--brand-primary-dark); text-decoration: none; }
.nav-sub-link:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: -2px; }
.nav-sub2-toggle { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; background: none; border: 0; cursor: pointer; font: inherit; font-size: 14px; text-align: left; }
.nav-sub2-toggle[aria-expanded="true"] { background: var(--brand-primary-soft); color: var(--brand-primary-dark); }
.nav-sub2-toggle[aria-expanded="true"] .nav-sub-caret { transform: rotate(180deg); }
.nav-sub2-list { list-style: none; margin: 0; padding: 0; }
.nav-sub2-list[hidden] { display: none; }
.nav-sub2-list .nav-sub-link { padding-left: 30px; }
@media (max-width: 820px) {
    .nav-sub2-toggle { color: #fff; padding-left: 34px; }
    .nav-sub2-toggle[aria-expanded="true"] { background: rgba(0, 0, 0, 0.22); color: #fff; }
    .nav-sub2-list .nav-sub-link { padding-left: 52px; }
    .nav-sub-toggle { width: 100%; }
    .nav-sub-list { position: static; max-width: none; box-shadow: none; border: 0; border-radius: 0; background: rgba(0, 0, 0, 0.16); }
    .nav-sub-link { color: #fff; padding-left: 34px; }
    .nav-sub-link:hover, .nav-sub-link:focus-visible { background: rgba(0, 0, 0, 0.22); color: #fff; }
    .nav-sub-link:focus-visible { outline-color: #fff; }
}

/* District Edition: blocks fed by other systems (IMIS Next, e-GP, MY Office, planning system) */
.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; }
.district-feed-list { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; }
.district-feed-list li { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; padding: 9px 2px; border-bottom: 1px dashed #cbd5e1; font-size: 14px; line-height: 1.5; }
.district-feed-list li:last-child { border-bottom: 0; }
.district-feed-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.district-feed-main a { font-weight: 600; }
.district-feed-date { color: #475569; font-size: 12.5px; font-weight: 600; }
.district-feed-meta { color: #475569; font-size: 12.5px; }
.district-feed-amount { white-space: nowrap; text-align: right; font-weight: 700; color: #0f172a; }
.district-feed-amount small { font-weight: 400; color: #475569; }
.district-feed-empty { margin: 4px 0 10px; color: #475569; font-size: 13.5px; }
.district-feed-source { margin: 6px 0 0; color: #475569; font-size: 12px; }
.district-status { display: inline-block; padding: 0 8px; margin-right: 6px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.district-status.is-open { background: #dcfce7; color: #14532d; }
.district-status.is-closed { background: #e2e8f0; color: #334155; }
.district-myoffice-frame { color-scheme: light; display: block; width: 100%; height: calc(var(--mo-list, 220px) + 84px); border: 0; } /* list + search bar (one line) */
@media (max-width: 600px) { .district-myoffice-frame { height: calc(var(--mo-list, 220px) + 108px); } } /* search bar on two lines */
.district-best-total { text-align: center; padding: 10px 6px; border-radius: 10px; background: var(--brand-primary-soft); margin-bottom: 8px; }
.district-best-total b { display: block; font-size: 28px; line-height: 1.2; color: var(--brand-primary-dark); }
.district-best-total span { display: block; font-size: 13px; color: #1e293b; }
.district-best-total small { display: block; margin-top: 4px; font-size: 12px; color: #475569; }
.district-best-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.district-best-grid div { padding: 7px 4px; text-align: center; border: 1px solid #e2e8f0; border-radius: 8px; }
.district-best-grid dt { font-size: 12px; color: #475569; }
.district-best-grid dd { margin: 0; font-weight: 700; color: #0f172a; }

/* District Edition: district home page list of office and school sites, link back to the district */
.utility-district-link { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.utility-district-link:hover, .utility-district-link:focus-visible { color: #fff; text-decoration-thickness: 2px; }
.district-sites-head { font-size: 15px; margin: 2px 0 8px; color: #0f172a; }
.district-office-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); grid-auto-rows: 1fr; gap: 8px; }
.district-office-list li { display: flex; }
.district-office-list a { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-weight: 600; line-height: 1.45; background: #fff; }
.district-office-list a:hover, .district-office-list a:focus-visible { border-color: var(--brand-primary); background: var(--brand-primary-soft); text-decoration: none; }
.district-school-list summary { cursor: pointer; padding: 10px 12px; border-radius: 8px; background: #f1f5f9; font-weight: 700; color: #0f172a; }
.district-school-list summary:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.district-school-list ul { list-style: none; margin: 10px 0 0; padding: 0; columns: 2 220px; column-gap: 16px; }
.district-school-list li { break-inside: avoid; padding: 4px 0; font-size: 14px; }

/* District Edition: news categories on one line and one row of news that moves by itself */
.news-tabs.is-rail { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; min-width: 0; padding-bottom: 4px; scrollbar-width: thin; }
.news-tabs.is-rail .news-tab-btn { flex: 0 0 auto; white-space: nowrap; }
.news-tab-btn:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.panel-head:has(.news-tabs.is-rail) > div { min-width: 0; max-width: 100%; flex-wrap: nowrap !important; }
.news-rail { position: relative; }
#home-news-grid.news-track {
    display: flex; grid-template-columns: none; gap: 14px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    padding-bottom: 6px; scrollbar-width: thin;
}
#home-news-grid.news-track:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 3px; }
.news-track > .news-card { flex: 0 0 calc(50% - 7px); scroll-snap-align: start; }
.news-rail-controls { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.news-rail-btn {
    min-width: 44px; min-height: 36px; padding: 4px 12px; border-radius: 999px;
    border: 1px solid #cbd5e1; background: #fff; color: #1e293b; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.news-rail-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary-dark); }
.news-rail-btn:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.news-rail-pause[aria-pressed="true"] { background: var(--brand-primary-soft); border-color: var(--brand-primary); color: var(--brand-primary-dark); }
@media (max-width: 820px) {
    .news-track > .news-card { flex-basis: 86%; }
}
@media (prefers-reduced-motion: reduce) {
    #home-news-grid.news-track { scroll-behavior: auto; }
}
.panel-head:has(.news-tabs.is-rail) .panel-more { white-space: nowrap; flex-shrink: 0; }

/* District Edition: photo and video blocks in a side column scroll up by themselves */
.portal-col-side .media-rail .media-widget-grid { max-height: 380px; overflow-y: auto; scroll-behavior: smooth; scrollbar-width: thin; padding-right: 2px; }
.media-rail .media-widget-grid:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 3px; }
.media-rail-controls { display: flex; justify-content: center; margin-top: 8px; }
.media-rail-controls[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
    .portal-col-side .media-rail .media-widget-grid { scroll-behavior: auto; }
}
.portal-col-side .media-rail .media-widget-grid > * { flex-shrink: 0; }
/* District Edition: drifting lists move by themselves, so no scrollbar is shown (still scrollable by wheel/touch) */
.portal-col-side .media-rail .media-widget-grid, #home-news-grid.news-track, .news-tabs.is-rail { scrollbar-width: none; -ms-overflow-style: none; }
.portal-col-side .media-rail .media-widget-grid::-webkit-scrollbar, #home-news-grid.news-track::-webkit-scrollbar, .news-tabs.is-rail::-webkit-scrollbar { display: none; }

/* District Edition: B.E.S.T. Data page and online reports pages */
.bd-sub { margin: 0 0 12px; color: #475569; font-size: 13.5px; }
.bd-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px; margin-bottom: 16px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.bd-filter label { display: block; margin-bottom: 4px; font-size: 12.5px; font-weight: 700; color: #334155; }
.bd-filter select { min-width: 190px; min-height: 40px; padding: 7px 10px; border: 1px solid #94a3b8; border-radius: 8px; background: #fff; font-family: inherit; font-size: 14px; color: #0f172a; }
.bd-filter select:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.bd-ref { margin-left: auto; align-self: center; padding: 6px 12px; border-radius: 999px; background: #e0f2fe; color: #075985; font-size: 13px; font-weight: 700; }
.bd-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.bd-summary-main { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; justify-content: center; padding: 20px 24px; border-radius: 12px; background: var(--brand-primary-dark); color: #fff; text-decoration: none; }
.bd-summary-main b { font-size: 46px; line-height: 1.1; }
.bd-summary-main strong { font-size: 19px; }
.bd-summary-main span { margin-top: 4px; font-size: 13px; }
.bd-summary-main:hover, .bd-summary-main:focus-visible { color: #fff; text-decoration: none; filter: brightness(1.08); }
.bd-card { display: flex; flex-direction: column; justify-content: center; min-height: 86px; padding: 10px; border: 1px solid #e2e8f0; border-bottom: 3px solid var(--brand-primary); border-radius: 10px; background: #fff; color: #1e293b; text-align: center; text-decoration: none; }
.bd-card b { font-size: 25px; line-height: 1.1; color: var(--brand-primary-dark); }
.bd-card span { margin-top: 5px; font-size: 12.5px; color: #475569; line-height: 1.35; }
.bd-card:hover, .bd-card:focus-visible { border-color: var(--brand-primary); background: var(--brand-primary-soft); text-decoration: none; }
.bd-group h2, .bd-dash h2, .bd-panel h2 { margin: 0 0 10px; font-size: 16px; color: #0f172a; }
.bd-size-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.bd-note { margin-top: 10px; padding: 10px 12px; border-left: 4px solid #d97706; background: #fffbeb; color: #713f12; font-size: 13px; line-height: 1.55; }
.bd-dashboard { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 12px; margin-bottom: 16px; }
.bd-dash { padding: 16px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.bd-donut-wrap { display: flex; align-items: center; justify-content: center; gap: 14px; }
.bd-donut { position: relative; display: grid; place-items: center; width: 130px; height: 130px; border-radius: 50%; background: conic-gradient(#1d6fb8 0 var(--male), #9333ea var(--male) 100%); }
.bd-donut::before { content: ""; position: absolute; width: 84px; height: 84px; border-radius: 50%; background: #fff; }
.bd-donut div { position: relative; text-align: center; }
.bd-donut b { display: block; font-size: 16px; color: #0f172a; }
.bd-donut span { font-size: 11px; color: #475569; }
.bd-legend p { margin: 6px 0; font-size: 13px; color: #334155; }
.bd-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: #1d6fb8; }
.bd-legend i.f { background: #9333ea; }
.bd-level { display: grid; grid-template-columns: 82px 1fr 52px; gap: 8px; align-items: center; margin: 9px 0; font-size: 13px; color: #334155; }
.bd-level div { height: 12px; border-radius: 8px; background: #e2e8f0; overflow: hidden; }
.bd-level i { display: block; height: 100%; background: var(--brand-primary); }
.bd-level b { text-align: right; color: #0f172a; }
.bd-focus { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bd-focus a { padding: 12px 6px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; text-align: center; text-decoration: none; color: #334155; }
.bd-focus a:hover, .bd-focus a:focus-visible { border-color: var(--brand-primary); background: var(--brand-primary-soft); }
.bd-focus b { display: block; font-size: 26px; line-height: 1.1; color: var(--brand-primary-dark); }
.bd-focus span { display: block; margin-top: 4px; font-size: 12px; }
.bd-layout { display: grid; grid-template-columns: 1fr 1.9fr; gap: 12px; }
.bd-panel { padding: 16px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; min-width: 0; }
.bd-size { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin: 8px 0; font-size: 13.5px; }
.bd-size a { color: #1e293b; text-decoration: none; }
.bd-size a:hover span, .bd-size a:focus-visible span { text-decoration: underline; }
.bd-size i { display: block; height: 10px; margin-top: 4px; border-radius: 6px; background: var(--brand-primary); }
.bd-scroll { overflow-x: auto; }
.bd-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 13.5px; }
.bd-table th { padding: 9px; text-align: left; background: #f1f5f9; color: #1e293b; vertical-align: top; }
.bd-table td { padding: 9px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.bd-table td.num { text-align: right; }
.bd-table small { color: #475569; }
.bd-tags span { display: inline-block; margin: 2px; padding: 2px 8px; border-radius: 999px; background: #e0f2fe; color: #075985; font-size: 12px; }
.bd-tags span.is-risk { background: #ffedd5; color: #9a3412; }
.bd-tags span.is-opp { background: #f3e8ff; color: #6b21a8; }
.bd-back { display: inline-block; margin: 0 0 12px; font-weight: 700; }
.bd-school { border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.bd-school-head { padding: 20px; background: var(--brand-primary-dark); color: #fff; }
.bd-school-head span { font-size: 12px; }
.bd-school-head h2 { margin: 4px 0; font-size: 24px; color: #fff; }
.bd-school-head p { margin: 0 0 8px; font-size: 13px; }
.bd-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; padding: 12px; background: #f8fafc; }
.bd-kpis div { padding: 10px; border-radius: 8px; background: #fff; text-align: center; border: 1px solid #e2e8f0; }
.bd-kpis dt { font-size: 12.5px; color: #475569; }
.bd-kpis dd { margin: 0; font-size: 22px; font-weight: 700; color: #0f172a; }
.bd-h3 { margin: 16px 16px 2px; font-size: 18px; }
.bd-school .bd-sub, .bd-school .bd-note { margin-left: 16px; margin-right: 16px; }
.bd-class-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 16px 16px; }
.bd-class-grid article { padding: 12px; border: 1px solid #e2e8f0; border-top: 3px solid var(--brand-primary); border-radius: 10px; text-align: center; }
.bd-class-grid h4 { margin: 0; font-size: 14px; }
.bd-class-grid strong { display: block; margin: 6px 0; font-size: 22px; color: var(--brand-primary-dark); }
.bd-class-grid small { font-size: 12px; font-weight: 400; }
.bd-class-grid p { margin: 2px 0; font-size: 12.5px; color: #475569; }
.district-report-list li { align-items: center; }
.district-report-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 12px 0; }
.district-report-facts div { padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 8px; }
.district-report-facts dt { font-size: 12.5px; color: #475569; }
.district-report-facts dd { margin: 2px 0 0; font-weight: 600; color: #0f172a; }
@media (max-width: 900px) {
    .bd-summary { grid-template-columns: repeat(2, 1fr); }
    .bd-size-cards, .bd-class-grid, .bd-kpis { grid-template-columns: repeat(2, 1fr); }
    .bd-dashboard, .bd-layout { grid-template-columns: 1fr; }
    .bd-ref { margin-left: 0; }
}

/* District Edition: custom blocks moved from the legacy site */
.district-embed { display: block; width: 100%; border: 0; border-radius: 8px; background: #f8fafc; }
.district-custom-html img { max-width: 100%; height: auto; }

/* District Edition: non-input field caption styled like a form label */
.form-group .form-label-like { font-weight: 600; font-size: 14.5px; color: #1e293b; }

/* District Edition: students per grade in the school students block */
.district-students-levels { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.district-students-levels th, .district-students-levels td { padding: 3px 6px; border-bottom: 1px solid #e2e8f0; text-align: right; vertical-align: top; }
.district-students-levels th[scope="row"], .district-students-levels thead th:first-child { text-align: left; }
.district-students-levels thead th { color: var(--text-muted); font-weight: 600; }
.district-students-levels tbody tr:nth-child(even) { background: #f8fafc; }
.district-students-levels td b { font-weight: 700; color: var(--text-main); }
.district-students-bar { display: block; height: 4px; margin-top: 3px; border-radius: 2px; background: #e2e8f0; overflow: hidden; }
.district-students-bar i { display: block; height: 100%; margin-left: auto; border-radius: 2px; background: var(--brand-primary); }

/* District Edition: procurement notices page */
.district-procurement-list { list-style: none; padding: 0; margin: 0 0 12px; }
.district-procurement-list li { padding: 10px 0; border-bottom: 1px solid #e2e8f0; }
.district-procurement-list small { display: block; color: var(--text-muted); }

/* ==========================================================================
   District Edition: content pages (school information, procurement, reports)
   One page header, one card, one badge style; colours follow the site theme.
   ========================================================================== */
.dp-page { padding: 26px 28px 30px; }
.dp-head { padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--border-color); }
.dp-head .breadcrumb { margin-bottom: 10px; font-size: 13.5px; color: var(--text-muted); }
.dp-eyebrow { display: block; margin-bottom: 4px; font-size: 13.5px; font-weight: 700; color: var(--brand-primary); }
.dp-head h1 { margin: 0; font-size: clamp(24px, 2.4vw, 30px); line-height: 1.3; color: var(--brand-primary-dark); }
.dp-lead { margin: 8px 0 0; color: var(--text-muted); font-size: 15px; }
.dp-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: 13.5px; }
.dp-chip svg { width: 15px; height: 15px; flex: none; }

/* sibling pages of one group (the six school information pages) */
.dp-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.dp-tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border: 1px solid var(--border-color); border-radius: 999px;
    background: #fff; color: var(--text-main); font-size: 14px; text-decoration: none; transition: border-color .15s, background-color .15s, color .15s; }
.dp-tabs a:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.dp-tabs a[aria-current="page"] { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; font-weight: 600; }

.dp-section + .dp-section { margin-top: 30px; }
.dp-section > h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 20px; color: var(--brand-primary-dark); }
.dp-section > h2::before { content: ""; flex: none; width: 4px; height: 1.1em; border-radius: 2px; background: var(--brand-primary); }
.dp-count { margin-left: auto; font-size: 13.5px; font-weight: 500; color: var(--text-muted); }

.dp-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 18px; text-align: center; color: var(--text-muted);
    background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: var(--radius-md); }
.dp-empty svg { width: 40px; height: 40px; color: #94a3b8; }
.dp-empty strong { color: var(--text-main); font-size: 16px; }
.dp-note { margin: 22px 0 0; font-size: 13.5px; color: var(--text-muted); }

/* list of notices / reports */
.dp-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.dp-item { position: relative; display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; background: #fff;
    border: 1px solid var(--border-color); border-radius: var(--radius-md); transition: border-color .15s, box-shadow .15s, transform .15s; }
.dp-item:hover { border-color: var(--brand-primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dp-item:focus-within { border-color: var(--brand-primary); }
.dp-date { flex: none; width: 66px; padding: 7px 0; text-align: center; border-radius: var(--radius-sm); background: var(--brand-primary-soft); color: var(--brand-primary-dark); line-height: 1.2; }
.dp-date b { display: block; font-size: 22px; }
.dp-date span { display: block; font-size: 12.5px; }
.dp-item-body { flex: 1; min-width: 0; }
.dp-item-top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.dp-item-title { display: block; font-size: 16.5px; font-weight: 600; line-height: 1.5; color: var(--text-main); text-decoration: none; }
.dp-item-title:hover { color: var(--brand-primary); text-decoration: underline; text-underline-offset: 3px; }
.dp-item-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* the whole card opens the link */
.dp-item-text { margin: 4px 0 0; color: #475569; font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dp-item-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13.5px; color: #475569; }
.dp-item-meta span { display: inline-flex; align-items: center; gap: 5px; }
.dp-item-meta svg { width: 15px; height: 15px; flex: none; color: #64748b; }
.dp-item-action { position: relative; z-index: 1; flex: none; align-self: center; }
.dp-item-action .btn { min-height: 40px; display: inline-flex; align-items: center; }
.dp-ext { display: inline-block; width: 14px; height: 14px; margin-left: 4px; vertical-align: -2px; opacity: .75; }

.dp-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.dp-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dp-badge.is-open { background: #dcfce7; color: #166534; }
.dp-badge.is-closed { background: #e2e8f0; color: #334155; }
.dp-badge.is-late { background: #fee2e2; color: #991b1b; }
.dp-badge.is-type { background: var(--brand-primary-soft); color: var(--brand-primary-dark); }
.dp-badge.is-type::before { display: none; }

/* school information: reading text */
.si-prose { max-width: 820px; margin-inline: auto; font-size: 16.5px; line-height: 1.9; }
/* the reading column sits in the centre of the page; the source note lines up with it (owner, 2026-12-02) */
.si-prose ~ .dp-note { max-width: 820px; margin-inline: auto; }
.si-prose + .si-prose { margin-top: 30px; }
.si-prose > h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 20px; color: var(--brand-primary-dark); }
.si-prose > h2::before { content: ""; flex: none; width: 4px; height: 1.1em; border-radius: 2px; background: var(--brand-primary); }
.si-prose img { margin: 16px auto; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.si-prose table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; }
.si-prose th, .si-prose td { padding: 8px 10px; border: 1px solid var(--border-color); vertical-align: top; text-align: left; }
.si-prose th { background: #f8fafc; }
.si-prose p { margin: 0 0 12px; }

/* school information: people (board, partners) */
.si-people > p:first-child { margin: 0 0 6px; color: var(--text-muted); }
.si-people h3 { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; font-size: 16px; color: var(--brand-primary-dark); }
.si-people h3::after { content: ""; flex: 1; height: 1px; background: var(--border-color); }
.si-people ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 0; padding: 0; list-style: none; }
/* four people per row; a shorter last row sits in the centre (owner, 2026-12-02) */
.si-people ul > li { flex: 0 0 calc((100% - 42px) / 4); min-width: 0; box-sizing: border-box; }
.si-people li { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 14px 18px; text-align: center; background: #fff;
    border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.si-people li img, .si-people li:not(:has(img))::before { width: 104px; height: 104px; margin-bottom: 8px; border-radius: 50%; object-fit: cover; }
.si-people li img { border: 3px solid var(--brand-primary-soft); }
.si-people li:not(:has(img))::before { content: ""; background: #eef2f7 no-repeat center 75% / 62% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='%2394a3b8'%3E%3Ccircle cx='32' cy='22' r='12'/%3E%3Cpath d='M10 60v-6a22 22 0 0 1 44 0v6z'/%3E%3C/svg%3E"); }
.si-people li strong { font-size: 16px; line-height: 1.4; }
.si-people li span { font-size: 14px; line-height: 1.45; color: var(--text-muted); }

/* school information: cards (facilities, achievements) */
.si-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 18px; align-items: start; }
.si-card { overflow: hidden; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.si-card > h2 { margin: 0; padding: 14px 18px; font-size: 17px; line-height: 1.45; color: var(--brand-primary-dark); border-bottom: 1px solid var(--border-color); background: #f8fafc; }
.si-card-body { padding: 14px 18px 18px; font-size: 15px; }
.si-card-body > ul:first-child { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.si-card-body > ul:first-child li { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: #f1f5f9; }
.si-card-body > ul:first-child img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .25s; }
.si-card-body > ul:first-child li:hover img { transform: scale(1.03); }
.si-card-body > ul:first-child span { position: absolute; left: 6px; bottom: 6px; padding: 1px 8px; border-radius: 999px; background: rgba(15, 23, 42, .75); color: #fff; font-size: 12px; }
.si-card-body table { width: 100%; border-collapse: collapse; }
.si-card-body th, .si-card-body td { padding: 7px 0; border-bottom: 1px solid #eef2f7; text-align: left; vertical-align: top; }
.si-card-body tbody th { width: 42%; font-weight: 500; color: #475569; }
.si-card-body tr:last-child th, .si-card-body tr:last-child td { border-bottom: 0; }
.si-card-body h4 { margin: 14px 0 4px; font-size: 14.5px; color: var(--brand-primary-dark); }
.si-card-body p { margin: 0 0 8px; }
.si-card-body thead th { padding: 6px; font-size: 13px; color: #475569; background: #f8fafc; }
.si-card-body tbody td { padding: 6px; }

/* report detail */
.dp-detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.dp-detail-main { font-size: 16px; line-height: 1.85; }
.dp-aside { position: sticky; top: 16px; padding: 18px; background: #f8fafc; border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.dp-aside dl { display: grid; gap: 12px; margin: 0 0 16px; }
.dp-aside dt { font-size: 13px; color: #475569; }
.dp-aside dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.dp-aside .btn { display: flex; width: 100%; justify-content: center; align-items: center; min-height: 44px; }

@media (max-width: 820px) {
    .dp-page { padding: 18px 16px 22px; }
    .dp-detail { grid-template-columns: 1fr; }
    .dp-aside { position: static; }
    .dp-item { flex-wrap: wrap; }
    .dp-item-action { width: 100%; }
    .dp-item-action .btn { width: 100%; justify-content: center; min-height: 44px; }
    .dp-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
    .dp-tabs a { white-space: nowrap; min-height: 44px; }
    .si-prose { font-size: 16px; }
    .si-people ul > li { flex-basis: calc((100% - 28px) / 3); }
}
@media (max-width: 480px) {
    .dp-date { width: 56px; }
    .si-people ul { gap: 10px; }
    .si-people ul > li { flex-basis: calc((100% - 10px) / 2); }
    .si-people li img, .si-people li:not(:has(img))::before { width: 80px; height: 80px; }
}
@media (prefers-reduced-motion: reduce) {
    .dp-item, .dp-item:hover, .si-card-body > ul:first-child img { transition: none; transform: none; }
}

/* District Edition: embedded pages of allowed services inside page content (Sanitizer + Embed) */
.article-body iframe, .si-prose iframe { display: block; width: 100%; min-height: 720px; margin: 12px 0; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: #fff; }
/* an embed with a height set by the editor keeps it; pages that report their height grow to fit (app.js) */
.article-body iframe[height], .si-prose iframe[height] { min-height: 0; }
/* wide tables (budget documents) scroll inside the page instead of pushing it sideways */
.article-body .table-scroll { overflow-x: auto; margin: 12px 0; -webkit-overflow-scrolling: touch; }
.article-body .table-scroll table { margin: 0; min-width: 640px; }
.article-body th { background: #f8fafc; }
@media (max-width: 820px) {
    .article-body iframe, .si-prose iframe { min-height: 560px; }
}

/* District Edition: show-all button under a long side-menu list */
.side-menu-more { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; margin-top: 8px; padding: 8px 12px;
    border: 1px dashed var(--border-color); border-radius: var(--radius-sm); background: #fff; color: var(--brand-primary); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.side-menu-more::after { content: "▾"; font-size: 12px; }
.side-menu-more[aria-expanded="true"]::after { content: "▴"; }
.side-menu-more:hover { border-style: solid; border-color: var(--brand-primary); background: var(--brand-primary-soft); }
.side-menu-more:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; }

/* District Edition: the Facebook page plugin is at most 500 px wide: centre it in a wide column */
.district-embed[src*="facebook.com/plugins/page.php"] { display: block; max-width: 500px; margin-left: auto; margin-right: auto; }
.fb-scale { overflow: hidden; border-radius: 8px; }

/* District Edition: search box above a long drop-down (select[data-searchable]) */
.select-search-input { display: block; width: 100%; max-width: 100%; margin: 0 0 6px; padding: 8px 10px; border: 1px solid #94a3b8; border-radius: 8px; font: inherit; font-size: 14px; background: #fff; color: #0f172a; box-sizing: border-box; }
.select-search-input:focus { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 1px; border-color: #2563eb; }

/* District Edition: card lists keep equal columns and centre a short last row, so one or two cards
   never sit alone at the left (owner, 2026-12-02: "อย่าให้เหมือนไม่ได้จัด") */
.cards-center { --cols: 4; --cards-gap: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--cards-gap); }
.cards-center > * { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--cards-gap)) / var(--cols)); min-width: 0; max-width: 100%; box-sizing: border-box; }
.personnel-grid.cards-center, .pub-grid.cards-center { --cols: 5; }
.cards-center.cards-2 { --cols: 2; }
@media (max-width: 1100px) {
    .cards-center { --cols: 3; }
    .personnel-grid.cards-center, .pub-grid.cards-center { --cols: 4; }
}
@media (max-width: 820px) {
    .cards-center, .personnel-grid.cards-center, .pub-grid.cards-center { --cols: 2; }
}
@media (max-width: 480px) {
    .cards-center, .personnel-grid.cards-center, .pub-grid.cards-center, .cards-center.cards-2 { --cols: 1; }
}

/* District Edition: groups on the same level of the organisation chart stand side by side as columns
   (a school's four administration groups, owner 2026-12-02), joined to the tier above by one bar */
.org-columns { position: relative; display: grid; grid-template-columns: repeat(var(--org-cols, 4), minmax(0, 1fr)); gap: 16px; width: 100%; align-items: stretch; }
.org-columns::before { content: ""; position: absolute; top: -13px; left: calc(100% / (2 * var(--org-cols, 4))); right: calc(100% / (2 * var(--org-cols, 4))); height: 2px; background: var(--brand-primary); opacity: .45; }
.org-column { position: relative; display: flex; flex-direction: column; min-width: 0; margin: 0; }
.org-column::before { content: ""; position: absolute; top: -17px; left: 50%; width: 2px; height: 13px; background: var(--brand-primary); opacity: .45; }
h3.org-branch-title { margin: 0 0 12px; text-align: center; line-height: 1.4; }
.org-column-list { display: flex; flex-direction: column; gap: 12px; }
.org-column-list .person-card { width: 100%; max-width: 260px; margin: 0 auto; box-sizing: border-box; }
.org-column-empty { margin: auto 0; padding: 18px 8px; text-align: center; color: var(--text-muted); font-size: 14px; border: 1px dashed var(--border-color); border-radius: var(--radius-sm); background: #fff; }
.org-tier-rest { align-items: stretch; gap: 20px; }
@media (max-width: 1100px) {
    .org-columns { grid-template-columns: repeat(min(2, var(--org-cols, 4)), minmax(0, 1fr)); }
    .org-columns::before, .org-column::before { display: none; }
}
@media (max-width: 600px) {
    .org-columns { grid-template-columns: minmax(0, 1fr); }
}

/* District Edition: "เว็บไซต์โรงเรียนในสังกัด" block (search, slowly scrolling list) */
.school-sites-tools { display: flex; gap: 6px; margin-bottom: 8px; }
.school-sites-search { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid #94a3b8; border-radius: 10px; font: inherit; font-size: 14.5px; background: #fff; color: var(--text-main); box-sizing: border-box; }
.school-sites-search:focus-visible { outline: 3px solid var(--brand-primary-soft); outline-offset: 1px; border-color: var(--brand-primary); }
.school-sites-pause { flex: none; min-height: 40px; padding: 0 10px; border: 1px solid var(--border-color); border-radius: 10px; background: #f8fafc; color: var(--brand-primary-dark); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.school-sites-pause[aria-pressed="true"] { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.school-sites-pause:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 2px; }
.school-sites-viewport { height: 340px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 10px; background: #fff; scrollbar-width: thin; }
.school-sites-list { list-style: none; margin: 0; padding: 4px 0; }
.school-sites-list li + li { border-top: 1px solid #eef2f7; }
.school-sites-list a { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 12px; color: var(--text-main); text-decoration: none; font-size: 14.5px; line-height: 1.45; }
.school-sites-list a::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-primary); opacity: .7; }
.school-sites-list a:hover { background: var(--brand-primary-soft); color: var(--brand-primary-dark); }
.school-sites-list a:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: -3px; }
.school-sites-name { flex: 1 1 auto; min-width: 0; }
.school-sites-ext { flex: none; color: var(--brand-primary); font-weight: 700; }
.school-sites-status { margin: 8px 2px 0; font-size: 13px; color: var(--text-muted); }

/* District Edition: a Google Slides embed keeps the slide's 16:9 shape at every width (plus its control bar),
   so no black bars appear above/below or beside the slide when the column changes size (owner 2026-12-02) */
.district-custom:has(> iframe[src*="docs.google.com/presentation"]) { container-type: inline-size; }
.district-custom > iframe[src*="docs.google.com/presentation"] { height: calc(56.25cqw + 37px) !important; }

/* "ทั้งหมด →" links at the bottom right of each block (owner 2026-12-03) */
.panel-foot-more { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--border-color); }
.panel-foot-more .panel-more { display: inline-flex; align-items: center; min-height: 24px; }

/* a download that is a set of files (front/downloads.php, 2026-12-04) */
.dl-set-list { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 4px; font-size: 14px; }
.dl-set-list a { font-weight: 600; }
