/* Bankhum School website
   Look: photo-led, generous white space, large two-weight Thai headlines, pill buttons with arrow circles.
   Palette: light grey pages with white cards, dark green footer; dark mode is deep green; gold only for focus and small highlights. */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a2a1e; --surface: #0f3727; --mist: #0d3123; --ink: #e9f3ee; --muted: #a3c2b4; --line: #1d4a39;
  --leaf: #14473a; --leaf-2: #1d5a48; --green: #4fd09f; --green-dark: #78ddb7; --forest: #b0ead0; --forest-2: #0f3727;
  --on-ink: #0a2a1e; --btn-fg: #052016; --topbar: rgba(10,42,30,.92); --night: #061c14; --sun-soft: #4a3f14; --body-2: #c0d7cc;
}
:root {
  --forest: #0b4a34; --forest-2: #0e5c41;
  --green: #0f7a5a; --green-dark: #0a5d45; --leaf: #e8f4ee; --leaf-2: #cfe7da;
  --sun: #f4c534; --sun-soft: #fff6d6;
  --ink: #151a17; --muted: #5d6963; --line: #dce2df; --mist: #e8ecea; --white: #fff; --night: #0b3426;
  --head: Kanit, "IBM Plex Sans Thai", system-ui, sans-serif;
  --body: "IBM Plex Sans Thai", Kanit, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #f1f3f2; --surface: #fff; --on-ink: #fff; --btn-fg: #fff; --topbar: rgba(241,243,242,.94); --body-2: #33433b;
  --wrap: 1240px;
  --r: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.8 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.3; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
@media (max-width: 600px) { .wrap { width: calc(100% - 32px); } }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: #fff; padding: 8px 14px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 999px;
  background: var(--green); color: var(--btn-fg); font: 500 1rem/1.2 var(--head); border: 0; transition: background .15s;
}
.btn:hover { background: var(--green-dark); color: var(--btn-fg); }
.btn-line-dark { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-line-dark:hover { background: var(--ink); color: var(--on-ink); }
.pill {
  display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 8px 0 20px; border-radius: 999px;
  border: 1.5px solid var(--ink); color: var(--ink); font: 500 .95rem var(--head); white-space: nowrap; transition: background .15s, color .15s;
}
.pill svg { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--ink); color: var(--on-ink); transition: transform .2s; }
.pill:hover { background: var(--ink); color: var(--on-ink); }
.pill:hover svg { background: var(--on-ink); color: var(--ink); transform: translateX(2px); }
.circ { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); transition: background .15s, color .15s; }
.circ:hover { background: var(--ink); color: var(--on-ink); }
.circ.sm { width: 34px; height: 34px; border-width: 1px; border-color: var(--line); }
.circ.sm svg { width: 16px; height: 16px; }
.link { background: none; border: 0; padding: 0; color: var(--green); font: 500 .98rem/1.4 var(--head); text-decoration: underline; text-underline-offset: 5px; }
.ibtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; min-width: 42px; padding: 0 14px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; color: var(--ink); font: 500 .95rem var(--head);
}
.ibtn:hover { border-color: var(--ink); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--topbar); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); transition: background .25s, border-color .25s, box-shadow .25s; }
.topbar.scrolled { box-shadow: 0 6px 24px rgba(0,0,0,.06); }
.topbar-inner { width: min(1400px, 100% - 48px); margin-inline: auto; height: 76px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-logo { width: 48px; height: 48px; object-fit: contain; flex: none; }
.brand-name { font: 600 1.08rem/1.25 var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.primary { display: flex; margin-left: auto; height: 100%; }
.primary a { display: flex; align-items: center; padding: 0 11px; color: var(--ink); font: 400 1rem var(--head); position: relative; white-space: nowrap; }
.primary a::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 18px; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.primary a:hover::after, .primary a[aria-current]::after { transform: scaleX(1); }
.primary a:hover { color: var(--ink); }
.actions { display: flex; gap: 8px; flex: none; }
.ibtn-portal { background: var(--green); color: var(--btn-fg); border-color: var(--green); }
.ibtn-portal:hover { background: var(--green-dark); border-color: var(--green-dark); color: var(--btn-fg); }
[data-theme-toggle] svg { display: none; }
[data-theme-pref="auto"] [data-theme-toggle] .ic-auto, :root:not([data-theme-pref]) [data-theme-toggle] .ic-auto,
[data-theme-pref="light"] [data-theme-toggle] .ic-sun, [data-theme-pref="dark"] [data-theme-toggle] .ic-moon { display: block; }
.ibtn-lang { gap: 3px; font-size: .85rem; padding: 0 12px; }
.ibtn-lang b { font-weight: 400; opacity: .5; }
.ibtn-lang i { font-style: normal; opacity: .35; }
:root:not([data-lang="en"]) .ibtn-lang .l-th, [data-lang="en"] .ibtn-lang .l-en { font-weight: 700; opacity: 1; }
.lang-note { display: none; margin: 10px 0 0; font-size: .88rem; color: var(--muted); }
[data-lang="en"] .lang-note { display: block; }
/* home: header sits on the photo until the page scrolls */
.topbar.overlay { position: fixed; left: 0; right: 0; background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.topbar.overlay .brand, .topbar.overlay .primary a { color: #fff; }
.topbar.overlay .ibtn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.topbar.overlay .ibtn-portal { background: #fff; color: var(--forest); border-color: #fff; }
.topbar.overlay.scrolled { background: var(--topbar); border-color: var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar.overlay.scrolled .brand, .topbar.overlay.scrolled .primary a { color: var(--ink); }
.topbar.overlay.scrolled .ibtn { background: var(--surface); border-color: var(--line); color: var(--ink); }
.topbar.overlay.scrolled .ibtn-portal { background: var(--green); border-color: var(--green); color: var(--btn-fg); }
@media (min-width: 1361px) { .ibtn-menu span { display: none; } .ibtn-menu { padding: 0; } }
@media (max-width: 1360px) { .primary { display: none; } .actions { margin-left: auto; } }
@media (max-width: 760px) {
  .actions .tool:not(.ibtn-lang) { display: none; }
  /* phones: language stays in the top bar as one short button showing the other language */
  .actions .ibtn-lang { width: 44px; padding: 0; font-size: .82rem; }
  .actions .ibtn-lang i, :root:not([data-lang="en"]) .actions .ibtn-lang .l-th, [data-lang="en"] .actions .ibtn-lang .l-en { display: none; }
  .actions .ibtn-lang b { opacity: 1; font-weight: 600; }
}
@media (max-width: 560px) {
  .topbar-inner { width: calc(100% - 24px); height: 64px; gap: 10px; }
  .brand-logo { width: 40px; height: 40px; }
  .brand-name { font-size: clamp(.82rem, 3.9vw, 1rem); }
  .ibtn-menu span { display: none; }
  .ibtn-menu { padding: 0; }
}

/* ---------- home: hero ---------- */
.hero { position: relative; min-height: min(100svh, 920px); display: flex; flex-direction: column; justify-content: flex-end; color: #fff; overflow: hidden; background: var(--night); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 75%; animation: settle 1.6s cubic-bezier(.2,.7,.2,1) both; }
.hero-shade { position: absolute; inset: 0; background: radial-gradient(ellipse 70% 45% at 50% 46%, rgba(6,18,12,.55), transparent 70%), linear-gradient(180deg, rgba(6,18,12,.72) 0%, rgba(6,18,12,.5) 35%, rgba(6,18,12,.55) 60%, rgba(6,18,12,.92) 100%); }
.hero-inner { position: relative; text-align: center; padding: 150px 0 36px; margin-top: auto; margin-bottom: auto; }
.hero h1 { margin: 0; font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: 1.12; letter-spacing: -.005em; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.hero h1 span { display: block; }
.h-light { font-weight: 300; }
.h-bold { font-weight: 700; }
.hero-sub { margin: 18px auto 0; max-width: 40em; font-size: 1.05rem; color: rgba(255,255,255,.85); }
.hero-tiles { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; padding-bottom: 40px; }
.hero-tiles a {
  display: flex; flex-direction: column; gap: 14px; justify-content: space-between; min-height: 112px; padding: 16px 18px; border-radius: 16px;
  color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font: 500 1rem/1.3 var(--head); transition: background .2s, transform .2s;
}
.hero-tiles a svg { width: 26px; height: 26px; }
.hero-tiles a:hover { background: rgba(255,255,255,.24); transform: translateY(-2px); color: #fff; }
@keyframes settle { from { transform: scale(1.06); } }
@media (max-width: 960px) { .hero-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) {
  .hero { min-height: 92svh; }
  .hero-inner { padding-top: 120px; }
  .hero-tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; padding-bottom: 24px; }
  .hero-tiles a { min-height: 84px; padding: 12px 14px; gap: 8px; font-size: .92rem; }
  .hero-tiles a svg { width: 22px; height: 22px; }
}

/* ---------- home: sections ---------- */
.sec { padding: 88px 0 0; }
.sec-tint { background: var(--mist); padding-bottom: 72px; margin-top: 88px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.sec-head h2 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 600; letter-spacing: -.005em; }
.sec-head.flat { margin-bottom: 18px; }
.sec-head.flat h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }

.rail {
  display: grid; grid-auto-flow: column; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 2px max(24px, calc((100% - var(--wrap)) / 2)) 4px; scroll-padding-inline: max(24px, calc((100% - var(--wrap)) / 2));
}
.rail::-webkit-scrollbar { display: none; }
.rail > a { scroll-snap-align: start; }
.rail-ctl { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.news-rail { grid-auto-columns: clamp(260px, 28vw, 360px); }
.ncard { display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.ncard:hover { color: var(--ink); border-color: var(--ink); }
.ncard-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--leaf); }
.ncard-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s; }
.ncard:hover .ncard-img img { transform: scale(1.04); }
.ncard-body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; flex: 1; }
.ncard-body small { color: var(--muted); font-size: .84rem; }
.ncard-body strong { font: 500 1.12rem/1.45 var(--head); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ncard .more { margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; gap: 8px; font: 500 .92rem var(--head); }
.ncard .more svg { width: 26px; height: 26px; padding: 5px; border: 1px solid var(--ink); border-radius: 50%; transition: transform .2s; }
.ncard:hover .more svg { transform: translateX(3px); background: var(--ink); color: var(--on-ink); }
.award-rail { grid-auto-columns: clamp(220px, 22vw, 290px); }
.award-rail a { border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 5; background: var(--leaf); }
.award-rail img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.award-rail a:hover img { transform: scale(1.04); }
@media (max-width: 640px) { .news-rail { grid-auto-columns: 82%; } .award-rail { grid-auto-columns: 66%; } .rail { gap: 12px; } .rail-ctl { display: none; } }

.intro { text-align: center; }
.intro-inner { max-width: 880px; }
.intro-age { margin: 0 0 8px; font: 300 1.6rem/1 var(--head); color: var(--green); }
.intro-age .num { font-weight: 700; font-size: 3.4em; letter-spacing: -.02em; vertical-align: -.12em; margin-right: .08em; }
.intro h2 { margin: 18px auto 30px; font-weight: 400; font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.55; }
.intro-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 64px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; }
.stats div { padding: 26px 24px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.stats div:first-child { border-left: 0; }
.stats strong { font: 600 1.6rem/1.3 var(--head); color: var(--forest); }
.stats div > span { color: var(--muted); font-size: .92rem; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } .stats div:nth-child(3) { border-left: 0; } .stats div:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 480px) { .stats div { padding: 18px 14px; } .stats strong { font-size: 1.25rem; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.split .embed { margin: 0; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 56px; } }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.links a, .apps a {
  display: flex; align-items: center; gap: 16px; padding: 14px 14px 14px 16px; border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); font: 400 1.05rem/1.4 var(--head); transition: border-color .15s, background .15s;
}
.links a:hover, .apps a:hover { border-color: var(--ink); color: var(--ink); }
.links a:hover .circ { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.links .circ { margin-left: auto; }
.li-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--leaf); color: var(--green); flex: none; }
.li-ic svg { width: 21px; height: 21px; }
.apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.apps a > svg:last-child { margin-left: auto; width: 16px; height: 16px; color: var(--muted); }
@media (max-width: 960px) { .apps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .apps { grid-template-columns: 1fr; } }

.notice { margin-top: 88px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; border-top: 1.5px solid var(--ink); padding-top: 24px; }
.notice h2 { margin: 0; font-size: 1.6rem; font-weight: 600; }
.notice-body p { margin: 0 0 .6em; max-width: 72ch; overflow-wrap: anywhere; }
.notice-body p:last-child { margin-bottom: 0; }
@media (max-width: 760px) { .notice { grid-template-columns: 1fr; gap: 8px; } }

.band { margin-top: 88px; background: var(--leaf); }
.band-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 72px 0; }
.band h2 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; line-height: 1.25; color: var(--forest); }
.band p { margin: 16px 0 28px; max-width: 34em; color: var(--body-2); }
.band-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.band-img { border-radius: var(--r); overflow: hidden; box-shadow: 0 24px 60px rgba(11,74,52,.18); }
@media (max-width: 860px) { .band-inner { grid-template-columns: 1fr; padding: 56px 0; } }

/* ---------- inner pages ---------- */
.page-head { background: var(--mist); padding: 48px 0 44px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .88rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs svg { width: 14px; height: 14px; opacity: .6; }
.page-head h1 { margin: 10px 0 0; font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 600; line-height: 1.2; max-width: 22em; letter-spacing: -.005em; }
.page-body { display: grid; gap: 48px; padding: 48px 0 24px; }
.page-body.has-side { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
.content { min-width: 0; }
.side { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow: auto; }
.side-box summary { list-style: none; font: 600 1.02rem var(--head); padding: 0 0 12px; display: flex; align-items: center; justify-content: space-between; }
.side-box summary::-webkit-details-marker { display: none; }
.side ul { list-style: none; margin: 0; padding: 0; border-left: 1.5px solid var(--line); }
.side ul ul { margin: 2px 0 6px 14px; }
.side li a { display: block; padding: 7px 0 7px 16px; margin-left: -1.5px; border-left: 1.5px solid transparent; color: var(--muted); font-size: .95rem; line-height: 1.45; }
.side li a:hover { color: var(--ink); }
.side li a[aria-current] { color: var(--ink); border-left-color: var(--ink); font-weight: 600; }
@media (max-width: 920px) {
  .page-head { padding: 32px 0 30px; }
  .page-body { padding-top: 24px; gap: 20px; }
  .page-body.has-side { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; overflow: visible; }
  .side-box { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
  .side-box summary { padding: 0; cursor: pointer; }
  .side-box summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform .2s; }
  .side-box[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
  .side-box[open] summary { padding-bottom: 10px; }
  .side-box nav { max-height: 50vh; overflow: auto; }
}

/* ---------- rich content ---------- */
.content > :first-child { margin-top: 0; }
.content p, .content li { max-width: 72ch; }
.content p { margin: .8em 0; overflow-wrap: anywhere; }
.content h2 { font-size: 1.65rem; font-weight: 600; margin: 1.6em 0 .5em; }
.content h3 { font-size: 1.3rem; font-weight: 600; margin: 1.4em 0 .4em; }
.content h4 { font: 400 1rem/1.85 var(--body); margin: .9em 0; max-width: 72ch; }
.content h4 strong, .content strong { font-weight: 600; }
.content ul, .content ol { padding-left: 1.3em; }
.content li { margin: .25em 0; }
.content .figure { margin: 1.6em 0; }
.content .figure img { max-height: 640px; width: auto; border-radius: 14px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 1.6em 0; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 14px; background: var(--leaf); }
.content img { cursor: zoom-in; }
.content a img { cursor: pointer; }
.table-wrap { overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--mist); font: 600 .95rem var(--head); }
tr:last-child td { border-bottom: 0; }
.embed { margin: 1.6em 0; }
.embed-frame { position: relative; border-radius: 14px; overflow: hidden; background: var(--mist); border: 1px solid var(--line); }
.embed-frame iframe { display: block; width: 100%; border: 0; height: 680px; }
.embed-video .embed-frame, .embed-slides .embed-frame { aspect-ratio: 16/9; background: #000; border: 0; }
.embed-video .embed-frame iframe, .embed-slides .embed-frame iframe { height: 100%; position: absolute; inset: 0; }
.embed-folder .embed-frame iframe { height: 560px; }
.embed-map .embed-frame iframe { height: 420px; }
.embed figcaption { display: flex; justify-content: space-between; gap: 12px; font-size: .86rem; margin-top: 8px; color: var(--muted); }
@media (max-width: 640px) { .embed-frame iframe { height: 500px; } .embed-folder .embed-frame iframe { height: 440px; } .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.note { color: var(--muted); background: var(--mist); border-radius: 12px; padding: 14px 18px; }

/* child pages + pager */
.children { margin-top: 40px; }
.content > .children:first-child { margin-top: 0; }
.children h2 { font-size: 1rem !important; color: var(--muted) !important; font-weight: 500 !important; margin: 0 0 10px !important; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rows li { max-width: none; margin: 0; }
.rows a { display: flex; align-items: center; gap: 16px; padding: 12px 16px 12px 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); }
.rows a:hover { border-color: var(--ink); color: var(--ink); }
.rows a > svg { margin-left: auto; color: var(--muted); width: 18px; }
.row-thumb { width: 60px; height: 60px; border-radius: 10px; overflow: hidden; flex: none; background: var(--leaf); }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.row-text strong { font: 500 1.06rem/1.45 var(--head); }
.row-text small { color: var(--muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { display: flex; align-items: center; gap: 12px; padding: 12px 4px; color: var(--ink); font: 500 1rem/1.4 var(--head); }
.pager a:hover { color: var(--green); }
.pager small { display: block; color: var(--muted); font: 400 .8rem var(--body); }
.pager .next { justify-content: flex-end; text-align: right; grid-column: 2; }

/* ---------- sheets (menu / search) ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10,14,12,.5); animation: fade .2s ease; }
.sheet-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(1040px, 100%); background: var(--surface); display: flex; flex-direction: column; animation: slide .28s cubic-bezier(.2,.8,.2,1); }
.sheet-tools { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 32px; border-bottom: 1px solid var(--line); font: 600 1.15rem var(--head); }
.mega { overflow: auto; padding: 28px 32px 48px; columns: 240px; column-gap: 40px; }
.mega-col { break-inside: avoid; margin-bottom: 28px; }
.mega-head { display: flex; align-items: center; gap: 6px; font: 600 1.05rem var(--head); color: var(--ink); padding-bottom: 6px; }
.mega svg { width: 13px; height: 13px; opacity: .55; }
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega li a { display: flex; align-items: center; gap: 6px; color: var(--muted); padding: 3px 0; font-size: .94rem; line-height: 1.45; }
.mega li a:hover { color: var(--ink); }
.mega ul.sub { padding-left: 12px; border-left: 1.5px solid var(--line); margin: 2px 0 6px 2px; max-height: 220px; overflow: auto; }
.mega ul.sub a { font-size: .87rem; }
.sheet-search { top: 80px; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); width: min(720px, 100% - 24px); max-height: calc(100vh - 100px); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.25); animation: drop .22s cubic-bezier(.2,.8,.2,1); }
.search-box { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.search-box > svg { color: var(--muted); }
.search-box input { flex: 1; border: 0; background: transparent; font: 400 1.15rem var(--body); outline: none; min-width: 0; color: var(--ink); }
.search-results { list-style: none; margin: 0; padding: 8px; overflow: auto; }
.search-results:empty { display: none; }
.search-results a { display: block; padding: 10px 14px; border-radius: 12px; color: var(--ink); font-family: var(--head); font-weight: 500; }
.search-results a:hover, .search-results a.active { background: var(--leaf); }
.search-results small { display: block; color: var(--muted); font: 400 .82rem/1.5 var(--body); }
.search-results mark { background: var(--sun-soft); color: inherit; border-radius: 3px; }
.search-results .none { padding: 14px; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -8px); } }
@media (min-width: 761px) { .sheet-tools { display: none; } }
@media (max-width: 640px) { .mega { columns: 1; padding: 16px 20px 32px; } .sheet-search { top: 12px; } .sheet-head { padding-left: 20px; } .sheet-head strong { font-size: 1rem; } }
body.lock { overflow: hidden; }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(8, 12, 10, .92); display: grid; place-items: center; padding: 16px; cursor: zoom-out; animation: fade .2s; }
.lightbox img { max-height: 92vh; max-width: 96vw; border-radius: 10px; }

/* ---------- footer ---------- */
.site-footer { margin-top: 96px; background: var(--night); color: rgba(255,255,255,.66); padding: 72px 0 28px; font-size: .95rem; }
.site-footer a { color: rgba(255,255,255,.9); }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1.3fr 1fr 1fr; gap: 40px; }
.site-footer h2 { font-size: 1rem; color: #fff; margin: 0 0 16px; font-weight: 600; }
.footer-logo { width: 72px; height: 72px; }
.footer-name { margin: 16px 0 6px; color: #fff; font: 600 1.25rem/1.4 var(--head); }
.footer-motto { margin: 0; font-size: .9rem; max-width: 26em; }
.footer-contact, .footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-contact li { display: flex; gap: 10px; }
.footer-contact svg { color: #6fd3ae; margin-top: 5px; width: 18px; height: 18px; }
.footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-top: 56px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .topbar, .site-footer, .side, .sheet, .pager { display: none !important; } body { background: #fff; } }

.credit a { font-weight: 600; }
/* dark mode details */
[data-theme="dark"] .embed-frame { background: var(--surface); }
[data-theme="dark"] .band-img { box-shadow: 0 24px 60px rgba(0,0,0,.4); }
[data-theme="dark"] .search-results mark { color: var(--ink); }
/* cards sit on the light grey page */
.links a, .apps a, .rows a { background: var(--surface); }
.stats div { background: var(--surface); }
.sec-tint .award-rail a { background: var(--surface); }

/* people cards (staff directory and similar pages) */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; margin: 1.6em 0; }
.person { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.person-img { aspect-ratio: 4 / 5; background: var(--leaf); overflow: hidden; }
.person-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 0 !important; max-height: none !important; }
.person figcaption { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; line-height: 1.45; }
.person strong { font: 500 1rem/1.4 var(--head); }
.person span { color: var(--muted); font-size: .88rem; }
.person a { margin-top: 6px; font: 500 .86rem var(--head); }
@media (max-width: 520px) { .people { grid-template-columns: repeat(2, 1fr); gap: 10px; } .person figcaption { padding: 10px; } .person strong { font-size: .92rem; } }

/* galleries keep each picture whole */
.gallery { align-items: start; }
.gallery img { aspect-ratio: auto; height: auto; object-fit: initial; }
.gallery a img { transition: opacity .15s; }
.gallery a:hover img { opacity: .9; }

/* back to top */
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.12); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { transform: rotate(-90deg); }

/* ---------- online services in two groups ---------- */
.app-groups { display: grid; gap: 34px; }
.app-group-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 500 1.15rem var(--head); color: var(--ink); }
.app-group-title svg { width: 22px; height: 22px; color: var(--green); }
.apps .app-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.apps .app-text small { font: 400 .8rem var(--body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-teachers .li-ic { background: var(--mist); color: var(--ink); }
.content .app-groups { margin-top: 8px; }
.content .apps { grid-template-columns: repeat(2, 1fr); }
.content .apps a { text-decoration: none; }
.content .app-group-title { font-size: 1.2rem; }
.app-more { margin: 26px 0 0; }
@media (max-width: 620px) { .content .apps { grid-template-columns: 1fr; } }

/* ---------- hotline button + panel ---------- */
.fabs { position: fixed; right: 18px; bottom: 18px; z-index: 31; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab { display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px;
  border: 0; border-radius: 999px; background: var(--green); color: var(--btn-fg); font: 500 1rem var(--head); box-shadow: 0 10px 28px rgba(8,60,40,.32); transition: transform .15s, background .15s; }
.fab:hover { background: var(--green-dark); transform: translateY(-2px); }
.fab svg { width: 21px; height: 21px; }
.fab-fb { height: 46px; padding: 0 18px 0 14px; background: var(--surface); color: var(--green); border: 1.5px solid var(--green); box-shadow: 0 8px 22px rgba(8,60,40,.18); font-size: .95rem; }
.fab-fb:hover { background: var(--leaf); color: var(--green-dark); }
.to-top { bottom: 136px; }
body.lock .fabs { visibility: hidden; }
@media (max-width: 520px) {
  .fabs { right: 14px; bottom: 14px; gap: 8px; }
  .fab { height: 48px; padding: 0 16px 0 13px; }
  .fab-fb { height: 42px; padding: 0 14px 0 12px; font-size: .9rem; }
  .to-top { right: 14px; bottom: 122px; }
}
@media print { .fabs, .to-top { display: none !important; } }

.sheet-hotline { top: auto; left: auto; right: 18px; bottom: 18px; width: min(410px, 100% - 24px); max-height: calc(100vh - 36px); border-radius: 22px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.28); animation: pop .22s cubic-bezier(.2,.8,.2,1); }
.hl-head { display: flex; align-items: center; gap: 12px; padding: 16px 12px 16px 18px; background: var(--night); color: #fff; }
.hl-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.hl-head strong { font: 500 1.08rem var(--head); }
.hl-head small { font-size: .82rem; opacity: .8; }
.hl-head .ibtn { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; }
.hl-logo { width: 40px; height: 40px; border-radius: 50%; background: #fff; padding: 2px; }
.hl-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 12px 14px 0; padding: 4px; background: var(--mist); border-radius: 999px; }
.hl-tabs button { border: 0; background: none; padding: 8px 10px; border-radius: 999px; font: 500 .95rem var(--head); color: var(--muted); }
.hl-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.hl-body { padding: 14px 16px 18px; overflow-y: auto; }
.hl-body[hidden] { display: none; }
.hl-body h3 { margin: 18px 0 8px; font: 500 .95rem var(--head); color: var(--muted); }
.hl-call { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--green); color: var(--btn-fg); }
.hl-call:hover { background: var(--green-dark); color: var(--btn-fg); }
.hl-call svg { width: 26px; height: 26px; }
.hl-call > span { display: flex; flex-direction: column; line-height: 1.35; }
.hl-call strong { font: 500 1.1rem var(--head); }
.hl-call small { font-size: .85rem; opacity: .9; }
.hl-ch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.hl-ch a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); font: 500 .88rem/1.25 var(--head); text-align: center; }
.hl-ch a:hover { border-color: var(--ink); color: var(--ink); }
.hl-dot { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--leaf); color: var(--green); font: 700 .7rem var(--body); }
.hl-dot svg { width: 18px; height: 18px; }
.hl-line { background: #06c755; color: #fff; font-size: .62rem; letter-spacing: .02em; }
.hl-fb { background: #0866ff; color: #fff; font: 700 1.1rem Arial, sans-serif; }
.hl-sos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.hl-sos a { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--mist); color: var(--ink); }
.hl-sos a:hover { background: var(--leaf-2); color: var(--ink); }
.hl-sos strong { font: 600 1.15rem var(--head); color: #c62828; }
:root[data-theme="dark"] .hl-sos strong { color: #ff8a80; }
.hl-sos small { font-size: .82rem; line-height: 1.3; color: var(--muted); }
.hl-form fieldset { border: 0; margin: 0; padding: 0; }
.hl-form legend, .hl-field > span { display: block; margin-bottom: 6px; font: 500 .92rem var(--head); }
.hl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hl-chips input { position: absolute; opacity: 0; pointer-events: none; }
.hl-chips label > span { display: inline-block; padding: 5px 13px; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; cursor: pointer; }
.hl-chips input:checked + span { background: var(--green); border-color: var(--green); color: var(--btn-fg); }
.hl-chips input:focus-visible + span { outline: 2px solid var(--sun); outline-offset: 2px; }
.hl-field { display: block; position: relative; margin-top: 14px; }
.hl-field textarea, .hl-field input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; font-size: .98rem; line-height: 1.6; resize: vertical; }
.hl-field textarea:focus, .hl-field input:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: transparent; }
.hl-count { position: absolute; right: 10px; bottom: 8px; font-size: .75rem; color: var(--muted); pointer-events: none; }
.hl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hl-note { margin: 10px 0 12px; font-size: .82rem; line-height: 1.5; color: var(--muted); }
.hl-send { width: 100%; justify-content: center; }
.hl-send:disabled { opacity: .6; cursor: wait; }
.hl-status { margin: 10px 0 0; font-size: .9rem; line-height: 1.5; min-height: 1.5em; }
.hl-status.ok { color: var(--green); }
.hl-status.err { color: #c62828; }
:root[data-theme="dark"] .hl-status.err { color: #ff8a80; }
@media (max-width: 520px) {
  .sheet-hotline { right: 0; left: 0; bottom: 0; width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; animation: rise .25s cubic-bezier(.2,.8,.2,1); }
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

/* ---------- statistics dashboard ---------- */
.st-sub { margin: 6px 0 0; color: var(--muted); font-size: .95rem; }
.st { padding-bottom: 72px; }
.st-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.st-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.st-tabs button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; font: 500 .95rem var(--head); color: var(--muted); }
.st-tabs button[aria-selected="true"] { background: var(--green); color: var(--btn-fg); }
.st-range { color: var(--muted); font-size: .92rem; }
.st-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.st-kpis div { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.st-kpis small { display: block; color: var(--muted); font-size: .9rem; }
.st-kpis strong { display: block; font: 600 2rem/1.3 var(--head); color: var(--ink); font-variant-numeric: tabular-nums; }
.st.loading .st-kpis strong, .st.loading .st-plot { opacity: .5; transition: opacity .2s; }
.st-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.st-card { padding: 18px 20px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.st-wide { grid-column: 1 / -1; }
.st-card h2 { margin: 0 0 12px; font: 500 1.05rem var(--head); }
.st-empty { margin: 18px 0; color: var(--muted); font-size: .92rem; }
.st-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.st-bars li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: .92rem; line-height: 1.4; }
.st-l { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.st-l a { color: var(--ink); }
.st-l a:hover { color: var(--green); }
.st-v { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; }
.st-v small { margin-left: 6px; color: var(--muted); font-weight: 400; }
.st-track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--mist); overflow: hidden; }
.st-track i { display: block; height: 100%; border-radius: 4px; background: var(--green); }
.st-col { position: relative; padding-left: 0; }
.st-col svg { width: 100%; height: 220px; display: block; overflow: visible; stroke: none; }
.st-col .st-gl { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.st-col .st-bar { fill: var(--green); opacity: .85; }
.st-col .st-today { opacity: 1; fill: var(--green-dark); }
.st-col .st-hit { fill: transparent; cursor: crosshair; }
.st-col .st-hit:hover { fill: rgba(127,127,127,.08); }
.st-yax, .st-xax { position: absolute; inset: 0; pointer-events: none; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-yax span { position: absolute; left: 0; transform: translateY(-110%); }
.st-xax span { position: absolute; bottom: 0; transform: translateX(-50%); white-space: nowrap; }
.st-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); z-index: 2; padding: 8px 12px; border-radius: 10px; background: var(--ink); color: var(--on-ink); font-size: .85rem; line-height: 1.5; display: flex; flex-direction: column; white-space: nowrap; pointer-events: none; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.st-tip[hidden] { display: none; }
.st-tip b { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .st-grid { grid-template-columns: 1fr; } .st-kpis { grid-template-columns: repeat(2, 1fr); } .st-kpis strong { font-size: 1.6rem; } }

/* never scroll sideways on phones */
.sec-head { flex-wrap: wrap; row-gap: 12px; }
body { overflow-x: clip; }

/* ---------- online services: Portal-style tiles ---------- */
.c-blue{--c:#2563eb}.c-green{--c:#16a34a}.c-orange{--c:#ea580c}.c-violet{--c:#7c3aed}.c-magenta{--c:#c026d3}
.c-red{--c:#e11d48}.c-yellow{--c:#ca8a04}.c-teal{--c:#0d9488}.c-pink{--c:#db2777}.c-indigo{--c:#4f46e5}
.qtile { --c-soft: color-mix(in srgb, var(--c) 10%, var(--surface)); --c-line: color-mix(in srgb, var(--c) 26%, var(--surface)); }
:root[data-theme="dark"] .qtile { --c-soft: color-mix(in srgb, var(--c) 22%, var(--surface)); --c-line: color-mix(in srgb, var(--c) 40%, var(--surface)); }
.app-group-title small { margin-left: 4px; font: 400 .85rem var(--body); color: var(--muted); }
.qtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.qtile { display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 124px; padding: 18px 10px 14px; text-align: center;
  border: 1px solid var(--c-line); border-radius: 18px; background: linear-gradient(160deg, var(--surface) 30%, var(--c-soft)); color: var(--ink);
  box-shadow: 0 6px 16px rgba(25,68,49,.05); transition: transform .18s, border-color .18s, box-shadow .18s; }
.qtile:hover { color: var(--ink); transform: translateY(-3px); border-color: var(--c); box-shadow: 0 14px 28px color-mix(in srgb, var(--c) 20%, transparent); }
.qtile:focus-visible { outline: 3px solid var(--c); outline-offset: 2px; }
.q-icon { width: 50px; height: 50px; flex: none; display: grid; place-items: center; border-radius: 15px; background: var(--c); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 35%, transparent); }
.q-icon svg { width: 25px; height: 25px; }
.q-label { font: 500 .95rem/1.35 var(--head); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 520px) {
  .qtiles { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .qtile { min-height: 108px; padding: 14px 4px 10px; gap: 8px; border-radius: 16px; }
  .q-icon { width: 44px; height: 44px; border-radius: 13px; }
  .q-icon svg { width: 22px; height: 22px; }
  .q-label { font-size: .82rem; }
}

/* featured: school email */
.app-feature { position: relative; overflow: hidden; display: flex; align-items: center; gap: 22px; padding: 26px 28px; border-radius: 24px;
  background: linear-gradient(120deg, #1a56db 0%, #2563eb 45%, #0e9f6e 130%); color: #fff; box-shadow: 0 18px 40px rgba(37,99,235,.28); transition: transform .2s, box-shadow .2s; isolation: isolate; }
.app-feature:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 24px 48px rgba(37,99,235,.36); }
.app-feature:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.af-icon { width: 76px; height: 76px; flex: none; display: grid; place-items: center; border-radius: 22px; background: #fff; color: #1a56db; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.af-icon svg { width: 40px; height: 40px; stroke-width: 1.7; }
.af-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.af-text small { font: 600 .78rem var(--body); letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.af-text strong { font: 600 clamp(1.35rem, 2.6vw, 1.9rem)/1.25 var(--head); margin: 2px 0 4px; }
.af-text > span { font-size: .95rem; opacity: .92; }
.af-cta { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; background: #fff; color: #1a56db; font: 500 1rem var(--head); }
.af-cta svg { width: 18px; height: 18px; }
.af-at { position: absolute; right: -10px; bottom: -70px; z-index: -1; font: 700 15rem/1 var(--head); color: rgba(255,255,255,.08); pointer-events: none; }
:root[data-theme="dark"] .app-feature { background: linear-gradient(120deg, #1e3a8a 0%, #1d4ed8 55%, #047857 140%); }
@media (max-width: 720px) {
  .app-feature { flex-wrap: wrap; gap: 14px 16px; padding: 20px; border-radius: 20px; }
  .af-icon { width: 58px; height: 58px; border-radius: 17px; }
  .af-icon svg { width: 30px; height: 30px; }
  .af-text { flex: 1; }
  .af-cta { width: 100%; justify-content: center; margin-left: 0; }
}
.content .app-feature, .content .qtile { text-decoration: none; }

/* ---------- Facebook page ---------- */
.fb-sec { padding-top: 24px; }
.fb-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px); gap: 56px; align-items: center; }
.fb-badge { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: #0866ff; color: #fff; font: 700 2rem/1 Arial, sans-serif; box-shadow: 0 10px 24px rgba(8,102,255,.3); }
.fb-intro h2 { margin: 18px 0 10px; font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 600; }
.fb-intro p { margin: 0 0 22px; color: var(--body-2); max-width: 46ch; }
.fb-intro p b { color: var(--ink); font-weight: 600; }
.fb-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fb-btn { background: #0866ff; color: #fff; }
.fb-btn:hover { background: #0656d6; color: #fff; }
.fb-btn svg { width: 17px; height: 17px; }
.fb-frame { position: relative; width: 100%; max-width: 500px; min-height: 480px; justify-self: center; border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; }
.fb-frame iframe { display: block; max-width: 100%; }
.fb-frame.loaded { min-height: 0; background: #fff; }
.fb-frame.loaded .fb-fallback { display: none; }
.fb-fallback { padding: 20px; text-align: center; }
@media (max-width: 900px) { .fb-split { grid-template-columns: 1fr; gap: 28px; } }

.hl-alt { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--mist); }
.hl-alt[hidden] { display: none; }
.hl-alt p { margin: 0 0 10px; font-size: .9rem; line-height: 1.5; }
.hl-alt-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hl-alt-btns .btn { justify-content: center; }
.hl-alt-fb { background: #0866ff; color: #fff; } .hl-alt-fb:hover { background: #0656d6; color: #fff; }
.hl-alt-line { background: #06c755; color: #fff; } .hl-alt-line:hover { background: #05a647; color: #fff; }

/* ---------- home: small statistics panel ---------- */
.mini-sec { padding-top: 0; }
.mini { padding: 22px 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.mini-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.mini-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font: 500 1.2rem var(--head); }
.mini-head h2 svg { width: 22px; height: 22px; color: var(--green); }
.mini-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, .9fr); gap: 22px; align-items: stretch; }
.mini small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.mini-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mini-kpis div { padding: 10px 14px; border-radius: 14px; background: var(--mist); }
.mini-kpis strong { display: block; font: 600 1.45rem/1.3 var(--head); font-variant-numeric: tabular-nums; color: var(--ink); }
.mini-chart, .mini-top { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mini-spark { flex: 1; min-height: 72px; display: flex; align-items: flex-end; }
.mini-spark svg { width: 100%; height: 72px; display: block; stroke: none; }
.mini-spark rect { fill: var(--green); opacity: .55; }
.mini-spark rect.now { opacity: 1; }
.mini-top ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: t; }
.mini-top li { display: flex; align-items: baseline; gap: 10px; font-size: .92rem; counter-increment: t; }
.mini-top li::before { content: counter(t); flex: none; width: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-top li a { flex: 1; min-width: 0; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-top li a:hover { color: var(--green); }
.mini-top li span { color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-top li.mini-wait { color: var(--muted); counter-increment: none; }
.mini-top li.mini-wait::before { content: none; }
.mini.off .mini-chart, .mini.off .mini-kpis { opacity: .45; }
@media (max-width: 960px) { .mini-body { grid-template-columns: 1fr 1fr; } .mini-kpis { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .mini { padding: 18px 16px; } .mini-body { grid-template-columns: 1fr; gap: 16px; } .mini-kpis { grid-template-columns: repeat(2, 1fr); } .mini-kpis strong { font-size: 1.25rem; } }

/* footer: staff login */
.admin-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; color: inherit; font-size: .82rem; opacity: .85; }
.admin-btn:hover { opacity: 1; color: #fff; border-color: rgba(255,255,255,.6); }
.admin-btn svg { width: 15px; height: 15px; }
/* keep the last footer row clear of the floating buttons */
.footer-base { padding-bottom: 76px; }
@media (max-width: 520px) { .footer-base { padding-bottom: 130px; } }

/* ---------- home: for teachers & staff (SIM) ---------- */
.staff-sec { padding-bottom: 24px; }
.staff-note { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; }
.staff-note svg { width: 16px; height: 16px; }
.staff-feature { background: linear-gradient(120deg, #0b4a34 0%, #0f7a5a 55%, #14a37a 120%); box-shadow: 0 18px 40px rgba(11,74,52,.28); }
.staff-feature:hover { box-shadow: 0 24px 48px rgba(11,74,52,.36); }
.staff-feature .af-icon, .staff-feature .af-cta { color: #0b4a34; }
.staff-feature .af-at { font-size: 11rem; bottom: -40px; right: 10px; letter-spacing: -.02em; }
:root[data-theme="dark"] .staff-feature { background: linear-gradient(120deg, #0b3a2a 0%, #0f6a4f 60%, #138f6b 130%); }
.staff-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.staff-links a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); }
.staff-links a:hover { border-color: var(--ink); color: var(--ink); }
.staff-links a > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.staff-links b { font: 500 1rem var(--head); }
.staff-links small { color: var(--muted); font-size: .82rem; }
.staff-links a > svg:last-child { margin-left: auto; width: 16px; height: 16px; color: var(--muted); }
@media (max-width: 860px) { .staff-links { grid-template-columns: 1fr; } }
.staff-btns { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ---------- home: for students (safety centre + good point) ---------- */
.student-sec { padding-bottom: 8px; }
.student-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.scard { position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; padding: 22px 22px; border-radius: 22px; color: #fff; isolation: isolate; transition: transform .2s, box-shadow .2s; }
.scard:hover { color: #fff; transform: translateY(-3px); }
.scard:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.scard-safe { background: linear-gradient(125deg, #6d28d9 0%, #9333ea 55%, #db2777 130%); box-shadow: 0 16px 36px rgba(109,40,217,.28); }
.scard-good { background: linear-gradient(125deg, #b45309 0%, #d97706 50%, #f59e0b 120%); box-shadow: 0 16px 36px rgba(180,83,9,.26); }
.scard-icon { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 18px; background: #fff; }
.scard-safe .scard-icon, .scard-safe .scard-cta { color: #6d28d9; }
.scard-good .scard-icon, .scard-good .scard-cta { color: #b45309; }
.scard-icon svg { width: 32px; height: 32px; stroke-width: 1.8; }
.scard-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.scard-text small { font: 600 .74rem var(--body); letter-spacing: .03em; opacity: .9; }
.scard-text strong { font: 600 1.3rem/1.3 var(--head); margin: 2px 0 4px; }
.scard-text > span { font-size: .9rem; opacity: .93; }
.scard-cta { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; background: #fff; font: 500 .95rem var(--head); }
.scard-cta svg { width: 16px; height: 16px; }
@media (max-width: 1100px) { .student-cards { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .scard { flex-wrap: wrap; padding: 18px; gap: 12px 14px; } .scard-icon { width: 52px; height: 52px; border-radius: 15px; } .scard-text { flex: 1; } .scard-cta { width: 100%; justify-content: center; margin-left: 0; } }

/* hotline panel: safety centre */
.hl-safe { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(125deg, #6d28d9, #9333ea); color: #fff; }
.hl-safe:hover { color: #fff; filter: brightness(1.06); }
.hl-safe > svg:first-child { width: 26px; height: 26px; flex: none; }
.hl-safe span { display: flex; flex-direction: column; line-height: 1.35; flex: 1; }
.hl-safe strong { font: 500 1.02rem var(--head); }
.hl-safe small { font-size: .82rem; opacity: .9; }
.hl-safe > svg:last-child { width: 18px; height: 18px; }

/* BANKHUM SIS (students & parents) */
.sis-feature { margin-bottom: 14px; background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 45%, #0ea5e9 120%); box-shadow: 0 18px 40px rgba(37,99,235,.28); }
.sis-feature .af-icon, .sis-feature .af-cta { color: #1d4ed8; }
.sis-feature .af-at { font-size: 11rem; bottom: -40px; right: 10px; }
:root[data-theme="dark"] .sis-feature { background: linear-gradient(120deg, #1e3a8a 0%, #1d4ed8 60%, #0369a1 130%); }
.student-sec { padding-top: 24px; }
