:root {
    --ink: #1d312d;
    --muted: #64736e;
    --green: #245c4e;
    --green-dark: #193f36;
    --mint: #eaf3ed;
    --cream: #f7f7f1;
    --peach: #f1d0b8;
    --line: #e5e9e3;
    --white: #fff;
    font-family: 'Aptos', 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--cream);
    font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.topbar { height: 80px; max-width: 1240px; margin: auto; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: 'Aptos Display', 'Segoe UI', sans-serif; font-size: 15px; font-weight: 800; letter-spacing: -.3px; white-space: nowrap; }
.brand-mark { width: 39px; height: 39px; border-radius: 14px; background: var(--green); color: #fff; display: grid; place-items: center; font: 800 17px 'Aptos Display', 'Segoe UI', sans-serif; transform: rotate(-5deg); }
.brand small { display: block; color: var(--muted); font: 500 10px 'Aptos', 'Segoe UI', sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.site-nav { display: flex; align-items: center; gap: 25px; color: #53625c; font-size: 13px; }
.site-nav > a:not(.button):hover { color: var(--nav-accent, var(--green)); }
.text-link:hover { color: var(--green); }
.site-nav .button { margin-left: 5px; }
.site-nav > a.nav-login { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; margin-left: -6px; border-radius: 50%; color: inherit; opacity: .7; transition: opacity .16s ease, background .16s ease; }
.site-nav > a.nav-login:hover, .site-nav > a.nav-login:focus-visible { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.nav-login svg { display: block; }
.button { border: 0; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 13px; padding: 13px 19px; background: var(--green); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; transition: background .16s ease, transform .16s ease; }
.button:hover { background: var(--green-dark); transform: translateY(-1px); }
.button-quiet { display: inline-flex; align-items: center; padding: 9px 13px; border-radius: 8px; color: var(--green); background: transparent; }
.button-quiet:hover { background: var(--mint); }
.site-main { max-width: 1240px; margin: 0 auto; padding: 0 34px 100px; }
.home-hero { position: relative; overflow: hidden; min-height: 428px; margin: 28px 0 95px; padding: 79px 75px 58px; border-radius: 23px; color: #fff; background: #245c4e; isolation: isolate; }
.home-hero::before { position: absolute; z-index: -2; content: ''; width: 520px; height: 520px; right: -80px; top: -190px; border-radius: 48% 52% 56% 44%; background: #2f7160; transform: rotate(20deg); }
.home-hero::after { position: absolute; z-index: -1; content: ''; width: 360px; height: 360px; right: 93px; bottom: -240px; border-radius: 50%; background: #eebd9f; opacity: .9; }
.home-hero .eyebrow { color: #d3eadc; }
.eyebrow { display: block; color: #477363; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; font-size: 10px; }
.home-hero h1 { margin: 16px 0 16px; max-width: 670px; font: 800 clamp(36px, 5vw, 58px)/1.07 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -2.7px; }
.home-hero h1 em { color: #f4c7a8; font-style: normal; }
.home-hero p { max-width: 500px; margin: 0 0 24px; color: #d2e0d9; font-size: 15px; line-height: 1.8; }
.home-hero .button { background: #f4c7a8; color: #244337; }
.home-hero .button:hover { background: #f7d8c3; }
.hero-note { position: absolute; right: 72px; bottom: 39px; color: #e3eee8; font-size: 11px; }
.hero-orbit { position: absolute; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; pointer-events: none; }
.orbit-one { width: 240px; height: 240px; right: 25px; top: 48px; }
.orbit-two { width: 300px; height: 300px; right: -5px; top: 18px; }
.home-section { margin: 0 0 90px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 0 0 24px; }
.section-heading h2 { margin: 8px 0 0; font: 800 30px/1.2 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -1.2px; }
.section-heading > p { color: var(--muted); font-size: 12px; }
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 19px; }
.content-subpages { margin: 28px 0; }
.subpage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 19px; }
.subpage-card { display: flex; flex-direction: column; }
.subpage-card .news-card-body { display: flex; flex: 1; flex-direction: column; }
.subpage-card h3 { margin-top: 0; }
.subpage-card h3 a:hover { color: var(--green); }
.subpage-card p { min-height: 0; }
.subpage-card .text-link { margin-top: auto; }
.news-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.news-card > img, .news-placeholder { display: block; width: 100%; height: 173px; object-fit: cover; background: #e5efe7; }
.news-placeholder { display: grid; place-items: center; color: #4a806f; font-size: 32px; }
.news-card-body { padding: 19px 19px 21px; }
.news-card-body .eyebrow { font-size: 9px; }
.news-card h3 { margin: 12px 0 8px; font: 700 17px/1.35 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -.35px; }
.news-card p { margin: 0 0 18px; min-height: 42px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.text-link { color: var(--green); font-size: 12px; font-weight: 700; }
.empty-state { min-height: 220px; padding: 38px; border: 1px dashed #cbd9cf; border-radius: 14px; background: rgba(255,255,255,.62); display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.empty-state h2, .empty-state h3 { margin: 12px 0 6px; font: 700 19px 'Aptos Display', 'Segoe UI', sans-serif; }
.empty-state p { max-width: 470px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.empty-icon { color: #5a9079; font-size: 28px; }
.empty-state .button { margin-top: 10px; }
.home-links { padding: 35px 39px 38px; border-radius: 17px; background: #edf2eb; }
.quick-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-links > a { display: flex; align-items: center; gap: 15px; padding: 16px 18px; border: 1px solid #dfe7df; border-radius: 11px; background: rgba(255,255,255,.75); }
.quick-links > a:hover { border-color: #9cbeaa; }
.quick-links > a > b { margin-left: auto; color: var(--green); }
.quick-icon { color: #6a9180; font: 700 12px 'Aptos Display', 'Segoe UI', sans-serif; }
.quick-links strong, .quick-links small { display: block; }
.quick-links strong { font: 700 13px 'Aptos Display', 'Segoe UI', sans-serif; }
.quick-links small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.quick-link-empty { grid-column: 1 / -1; padding: 16px; color: var(--muted); font-size: 12px; }
.page-hero { margin: 35px 0; padding: 45px; border-radius: 17px; background: #eaf3ed; }
.page-hero h1, .page-content > h1, .article-full h1 { margin: 10px 0; font: 800 40px/1.12 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -1.5px; }
.page-hero p { color: var(--muted); }
.teacher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.teacher-card { padding: 23px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.teacher-initials { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--mint); color: var(--green); font-size: 12px; font-weight: 700; }
.teacher-card h2 { margin: 14px 0 5px; font: 700 16px 'Aptos Display', 'Segoe UI', sans-serif; }
.teacher-card p, .teacher-card a { color: var(--muted); font-size: 12px; }
.teacher-card a { color: var(--green); }
.page-content { max-width: 900px; margin: 55px auto; }
.page-content > h1 { margin-bottom: 32px; }
.content-text { margin: 18px 0; line-height: 1.8; }
.content-text[data-align="center"] { text-align: center; }
.content-text[data-align="right"] { text-align: right; }
.content-text p { margin: .55em 0; }
.content-image { margin: 28px 0; }
.content-image img { display: block; max-width: 100%; max-height: 620px; border-radius: 12px; object-fit: cover; }
.content-image.align-center img { margin: auto; }
.content-image.align-right img { margin-left: auto; }
.content-image figcaption { margin-top: 8px; color: var(--muted); text-align: center; font-size: 11px; }
/* min() lets cards in a narrow column shrink instead of overflowing it. */
.content-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 15px; margin: 28px 0; }
.content-card { display: flex; min-width: 0; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
/* A card holds any blocks; the first and last sit flush with the padding. */
.content-card > :first-child { margin-top: 0; }
.content-card > :last-child { margin-bottom: 0; }
.content-card > .content-card-link { margin-top: auto; padding-top: 12px; }
.content-card h3 { margin: 0 0 9px; font: 700 16px 'Aptos Display', 'Segoe UI', sans-serif; }
/* Columns are a layout grid; the blocks inside bring their own look. */
/* --columns holds the widths in twelfths (column_template() in app/helpers.php). */
.content-columns { display: grid; grid-template-columns: var(--columns, repeat(2, minmax(0, 1fr))); gap: 28px; margin: 28px 0; }
.content-column { min-width: 0; }
.content-column > :first-child { margin-top: 0; }
.content-column > :last-child { margin-bottom: 0; }
@media (max-width: 760px) {
    .content-columns { grid-template-columns: minmax(0, 1fr); }
}
.content-card-link { color: var(--green); font-size: 12px; font-weight: 700; }
/* Sections (section_html() in app/helpers.php): anchor targets with a navigation at start and end.
   --anchor-offset keeps a sticky header from covering the start (set by assets/sections.js). */
.content-section { margin: 36px 0; scroll-margin-top: var(--anchor-offset, 16px); }
.content-section > :first-child { margin-top: 0; }
.content-section > :last-child { margin-bottom: 0; }
.content-section + .content-section { padding-top: 28px; border-top: 1px solid var(--line); }
.section-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 14px 0; font-size: 12px; font-weight: 700; }
.section-nav-top { margin-bottom: 18px; }
.section-nav-bottom { margin-top: 24px; padding-top: 12px; border-top: 1px dashed var(--line); }
.section-nav a { color: var(--green); text-decoration: none; }
.section-nav a:hover { text-decoration: underline; }
.section-nav a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 3px; }
.section-nav-back { justify-self: center; }
.section-nav-next { justify-self: end; }
/* Anchor list ("Sprungmarken"), as a list or a row of links. */
.content-anchors { margin: 24px 0; padding: 16px 20px; border-left: 3px solid var(--green); border-radius: 0 10px 10px 0; background: var(--mint); scroll-margin-top: var(--anchor-offset, 16px); }
.content-anchors-title { margin: 0 0 8px; font-weight: 700; }
.content-anchors ul { margin: 0; padding-left: 1.2em; line-height: 1.8; }
.content-anchors a { color: var(--green); font-weight: 600; }
.content-anchors.anchors-inline ul { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.content-anchors.anchors-inline a { display: inline-block; padding: 5px 12px; border: 1px solid currentColor; border-radius: 999px; background: #fff; font-size: 12px; line-height: 1.4; text-decoration: none; }
.content-anchors.anchors-inline a:hover { background: var(--green); color: #fff; }
.content-anchors-empty { padding: 12px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; }
@media (prefers-reduced-motion: no-preference) {
    html:has(.content-section, .content-anchors) { scroll-behavior: smooth; }
}
.table-wrap { max-width: 100%; overflow-x: auto; }
.table-wrap table, .block-preview table { width: 100%; border-collapse: collapse; }
.table-wrap td, .table-wrap th { padding: 12px; border: 1px solid var(--line); text-align: left; }
.table-wrap th { background: var(--mint); }
/* Table block with formats (table_block_html() in app/helpers.php). */
.content-table { margin: 24px 0; }
.content-table table { width: 100%; border-collapse: collapse; }
.content-table.is-auto table { width: auto; max-width: none; }
.content-table.is-auto.align-center table { margin-inline: auto; }
.content-table.is-auto.align-right table { margin-left: auto; }
.content-table th, .content-table td { border: var(--table-border-width, 1px) solid var(--table-border, var(--line)); vertical-align: top; overflow-wrap: break-word; }
.content-table th { background: var(--table-head-bg, var(--mint)); color: var(--table-head-color, inherit); font-weight: 400; }
.content-table.head-bold th { font-weight: 700; }
.content-table.head-upper thead th { font-size: .88em; letter-spacing: .05em; text-transform: uppercase; }
.content-table.head-line thead th { border-bottom: 3px solid var(--table-head-color, var(--green)); }
.content-table.is-striped tbody tr:nth-child(even) > td { background: #f3f6f2; }
.content-table.borders-rows th, .content-table.borders-rows td { border-width: 0 0 var(--table-border-width, 1px); }
.content-table.borders-outer table { border: var(--table-border-width, 1px) solid var(--table-border, var(--line)); }
.content-table.borders-outer th, .content-table.borders-outer td, .content-table.borders-none th, .content-table.borders-none td { border: 0; }
.content-table.borders-outer.head-line thead th, .content-table.borders-none.head-line thead th, .content-table.borders-rows.head-line thead th { border-bottom: 3px solid var(--table-head-color, var(--green)); }
.content-table.pad-sm th, .content-table.pad-sm td { padding: 5px 8px; }
.content-table.pad-lg th, .content-table.pad-lg td { padding: 18px 20px; }
.content-table.size-sm table { font-size: .875em; }
.content-table.size-lg table { font-size: 1.125em; }
.content-table td a, .content-table th a { color: var(--green); text-decoration: underline; }
.content-button { margin: 24px 0; }
.content-button.align-center { text-align: center; }
.content-button.align-right { text-align: right; }
.content-button a { display: inline-flex; gap: 10px; padding: 12px 17px; border-radius: 8px; background: var(--green); color: white; font-size: 13px; font-weight: 700; }
.content-accordion { margin: 28px 0; overflow: hidden; border: 1px solid #dcdfdc; border-radius: 4px; }
.accordion-item + .accordion-item { border-top: 1px solid #dcdfdc; }
.accordion-item summary { display: flex; align-items: center; gap: 10px; padding: 16px 22px; background: #eceeec; color: #4a524e; font-weight: 700; font-size: 17px; list-style: none; cursor: pointer; }
.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-item summary::before { flex: 0 0 auto; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 10px solid currentColor; content: ''; transition: transform .15s; }
.accordion-item[open] summary::before { transform: rotate(90deg); }
.accordion-item summary:hover { background: #e4e7e4; }
.accordion-item summary:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.accordion-item[open] summary { border-bottom: 1px solid #dcdfdc; }
.accordion-body { padding: 18px 22px 22px; background: #f9faf9; color: #555d59; line-height: 1.7; }
.accordion-body.content-text { margin: 0; }
.accordion-body > :first-child { margin-top: 0; }
.accordion-body > :last-child { margin-bottom: 0; }
.accordion-body ul, .accordion-body ol { margin: .3em 0; padding-left: 1.4em; }
/* Blocks below the text of a section (e.g. a table) */
.accordion-body.content-text + .accordion-blocks { padding-top: 0; }
.accordion-blocks > * { margin-top: 0; margin-bottom: 14px; }
.accordion-blocks > :last-child { margin-bottom: 0; }
.teacher-table { margin: 24px 0; }
.teacher-filter { margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.teacher-filter[hidden] { display: none; }
.teacher-search input { width: 100%; max-width: 360px; margin-bottom: 12px; padding: 9px 12px; border: 1px solid #d9e0da; border-radius: 8px; background: #fafbf9; color: inherit; font: inherit; font-size: 14px; }
.teacher-search input:focus { border-color: var(--green); outline: none; background: #fff; box-shadow: 0 0 0 3px rgba(36,92,78,.12); }
.teacher-subjects { display: flex; flex-wrap: wrap; gap: 6px; }
.teacher-subject { min-width: 44px; padding: 6px 11px; border: 1px solid #d9e0da; border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.teacher-subject:hover { border-color: var(--green); color: var(--green); }
.teacher-subject:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.teacher-subject[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: #fff; }
.teacher-subject[aria-pressed="true"]::before { margin-right: 4px; content: '✓'; }
.teacher-subject.is-empty { opacity: .4; }
.teacher-filter-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.teacher-reset { padding: 0; border: 0; background: none; color: var(--green); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.teacher-reset[hidden] { display: none; }
.teacher-table table { width: 100%; border-collapse: collapse; }
.teacher-table th { background: var(--mint); text-align: left; }
.teacher-table tbody tr:nth-child(even) td { background: #fafbf9; }
.teacher-table tr[hidden] { display: none; }
.teacher-subject-list span { display: inline-block; margin: 1px 2px 1px 0; padding: 1px 7px; border-radius: 5px; background: var(--mint); color: var(--green); font-size: 12px; font-weight: 700; }
.teacher-table .teacher-email { width: 1%; text-align: center; white-space: nowrap; }
.teacher-email a { display: inline-grid; width: 34px; height: 34px; place-items: center; border-radius: 8px; color: var(--green); }
.teacher-email a:hover { background: var(--mint); }
.teacher-none td { padding: 22px; color: var(--muted); text-align: center; font-style: italic; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.teacher-table .table-wrap { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.teacher-table .table-wrap td, .teacher-table .table-wrap th { border-width: 0 0 1px; }
.teacher-table tbody tr:last-child td { border-bottom: 0; }
.teacher-table-empty { color: var(--muted); font-style: italic; }
.content-divider { margin: 34px 0; border: 0; border-top: 1px solid var(--line); }
.homepage-edit-prompt { margin: 25px 0; padding: 22px; border: 1px solid #dfe8df; border-radius: 12px; background: #fff; }
.homepage-edit-prompt p { margin: 7px 0 14px; color: var(--muted); font-size: 13px; }
.frontend-edit-form { position: relative; }
.frontend-edit-bar { position: sticky; z-index: 4; bottom: 12px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; max-width: 1000px; margin: 18px auto 0; padding: 10px 12px; border: 1px solid #dce5dd; border-radius: 10px; background: rgba(255,255,255,.97); box-shadow: 0 6px 24px rgba(20,40,30,.12); }
.frontend-edit-bar > span { margin-right: auto; color: var(--muted); font-size: 11px; }
.frontend-edit-form [contenteditable="true"] { border-radius: 3px; outline: 1px dashed transparent; outline-offset: 3px; }
.frontend-edit-form [contenteditable="true"]:hover { outline-color: #9ab9a4; background: #f7fbf7; }
.frontend-edit-form [contenteditable="true"]:focus { outline: 2px solid #78a187; background: #f7fbf7; }
.article-full { max-width: 790px; margin: 55px auto; }
.article-full h1 { margin: 12px 0 16px; }
.article-cover { display: block; width: 100%; max-height: 460px; margin: 25px 0; border-radius: 14px; object-fit: cover; }
.article-summary { color: #53625c; font-size: 17px; line-height: 1.7; }
.article-body { margin: 30px 0; line-height: 1.9; white-space: normal; }
.article-event { display: inline-block; margin: 0 0 6px; padding: 8px 12px; border-radius: 8px; background: var(--mint); color: var(--green); font-size: 13px; }
.download-link { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 24px; padding: 12px 15px; border: 1px solid #dfe8df; border-radius: 8px; background: #edf4ee; color: var(--green); font-size: 12px; font-weight: 700; }
.download-link:hover { border-color: #b8cfbf; }
.footer { max-width: 1240px; margin: 0 auto; padding: 25px 34px 32px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 11px; }
.footer a:hover { color: var(--green); }
.notice { margin: 0 0 18px; padding: 12px 15px; border-radius: 8px; color: #2c634d; background: #e7f2e9; font-size: 13px; }
.notice-error { color: #913f35; background: #fff0ec; }
.notice-warning { color: #7a5a12; background: #fdf7e6; overflow-wrap: break-word; }
.setup-panel { max-width: 800px; margin: 50px auto; padding: 38px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.setup-panel h1 { margin: 8px 0 12px; font: 800 30px 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -1px; }
.setup-panel > p { color: var(--muted); line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px; margin-top: 27px; }
.form-grid label { display: flex; flex-direction: column; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 600; }
.form-grid input { padding: 11px; border: 1px solid #dce3dc; border-radius: 7px; background: #fff; }
.form-grid small { color: var(--muted); font-weight: 400; }
.form-section-title { grid-column: 1 / -1; margin: 10px 0 -7px; font: 700 16px 'Aptos Display', 'Segoe UI', sans-serif; }
.form-wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; align-items: center; }
/* Rich text and gallery */
.rich-text { line-height: 1.8; }
.rich-text::after { display: block; clear: both; content: ''; }
.rich-text > :first-child { margin-top: 0; }
.rich-text p { margin: 0 0 1em; }
.rich-text h2, .rich-text h3, .rich-text h4 { margin: 1.6em 0 .5em; font-family: 'Aptos Display', 'Segoe UI', sans-serif; line-height: 1.25; letter-spacing: -.5px; }
.rich-text h2 { font-size: 26px; }
.rich-text h3 { font-size: 21px; }
.rich-text h4 { font-size: 17px; }
.rich-text ul, .rich-text ol { margin: 0 0 1em; padding-left: 1.4em; }
.rich-text li { margin: .25em 0; }
.rich-text blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--green); color: #46564f; font-style: italic; }
.rich-text a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.rich-text hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line); }
.rich-text .text-center { text-align: center; }
.rich-text .text-right { text-align: right; }
.article-summary.rich-text { color: #53625c; font-size: 17px; line-height: 1.7; }
.article-summary.rich-text p:last-child { margin-bottom: 0; }
.article-body.rich-text { margin: 30px 0; line-height: 1.9; }
.article-body > .content-richtext { margin: 18px 0; }
.article-body > :first-child { margin-top: 0; }
.content-carousel { margin: 28px 0; }
.content-carousel .tpl-carousel { border-radius: 14px; }
.article-gallery { margin: 36px 0; }
.article-gallery h2 { margin: 0 0 14px; font: 800 22px 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -.6px; }
.content-files { margin: 24px 0; text-align: left; }
.content-files h2 { margin: 0 0 14px; font: 800 22px 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -.6px; }
.content-files ul { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.content-files a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid #dfe8df; border-radius: 8px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; }
.content-files a:hover { border-color: #b8cfbf; background: #edf4ee; }
.content-files img { width: 44px; height: 34px; flex: 0 0 auto; border-radius: 5px; object-fit: cover; }
.content-files .download-type { flex: 0 0 auto; min-width: 44px; text-align: center; }
.content-files-name { min-width: 0; flex: 1; overflow-wrap: break-word; }
.content-files small { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 400; }
.content-files-empty { margin: 0; color: var(--muted); font-size: 13px; }
.download-type { padding: 2px 6px; border-radius: 5px; background: var(--green); color: #fff; font-size: 10px; letter-spacing: .3px; text-transform: uppercase; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.gallery-grid a { display: block; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 10px; background: var(--mint); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.gallery-grid a:hover img, .gallery-grid a:focus-visible img { transform: scale(1.04); }
.lightbox { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(12,24,20,.92); color: #fff; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: calc(100vw - 140px); max-height: calc(100vh - 110px); border-radius: 8px; object-fit: contain; }
.lightbox-count { position: absolute; bottom: 18px; left: 0; right: 0; margin: 0; text-align: center; font-size: 12px; opacity: .8; }
.lightbox button { position: absolute; display: grid; width: 46px; height: 46px; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.26); }
.lightbox-close { top: 18px; right: 18px; }
img[data-zoom] { cursor: zoom-in; }
img[data-zoom]:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.image-zoom img { cursor: zoom-out; }
.image-zoom .lightbox-count:empty { display: none; }
.lightbox-prev { top: 50%; left: 18px; transform: translateY(-50%); }
.lightbox-next { top: 50%; right: 18px; transform: translateY(-50%); }
.news-card p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.nav-item { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.nav-toggle, .nav-caret { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.nav-toggle:hover, .nav-item.is-active > .nav-toggle, .nav-item.is-active > a { color: var(--nav-accent, var(--green)); }
.nav-item.is-active > .nav-toggle { font-weight: 700; }
.nav-toggle::after, .nav-caret::after { display: inline-block; margin-left: 5px; content: '▾'; font-size: .8em; transition: transform .15s; }
.nav-caret::after { margin-left: 0; }
.nav-item.is-open > :is(.nav-toggle, .nav-caret)::after { transform: rotate(180deg); }
.nav-submenu { position: absolute; z-index: 40; top: 100%; left: -12px; display: none; min-width: 210px; flex-direction: column; gap: 2px; margin-top: 10px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 12px 32px rgba(20,40,30,.14); text-align: left; }
.nav-submenu::before { position: absolute; top: -12px; left: 0; right: 0; height: 12px; content: ''; }
.nav-item:hover > .nav-submenu, .nav-item.is-open > .nav-submenu { display: flex; }
.nav-submenu a { padding: 9px 11px; border-radius: 8px; white-space: nowrap; }
.nav-submenu a:hover, .nav-submenu a:focus-visible { background: var(--mint); color: var(--nav-accent, var(--green)); }
.tpl-col.align-right .nav-submenu { left: auto; right: -12px; }
.nav-submenu .nav-group { padding: 9px 11px 3px; color: var(--muted); font-size: .85em; font-weight: 700; white-space: nowrap; }
.nav-submenu .nav-sub { margin-left: 12px; padding-block: 6px; font-size: .92em; }
.tpl-nav-vertical .nav-item { flex-wrap: wrap; }
.tpl-nav-vertical .nav-submenu { position: static; display: flex; width: 100%; min-width: 0; margin: 4px 0 0; padding: 0 0 0 12px; border: 0; border-left: 2px solid var(--line); border-radius: 0; background: none; color: inherit; box-shadow: none; }
.tpl-nav-vertical .nav-submenu a { padding: 5px 8px; }
.tpl-nav-vertical :is(.nav-toggle, .nav-caret)::after { display: none; }

/* Templates */
.template-shell { display: flex; min-height: 100vh; flex-direction: column; }
.template-shell > main { flex: 1; }
.template-shell > .notice { max-width: 1240px; margin: 12px auto; }
.tpl-section { --tpl-bg: transparent; width: 100%; background: var(--tpl-bg); }
.tpl-inner { max-width: 1240px; margin: 0 auto; padding: 0 34px; }
.tpl-width-full > .tpl-inner { max-width: none; }
.tpl-pad-none { padding-block: 0; }
.tpl-pad-small { padding-block: 16px; }
.tpl-pad-medium { padding-block: 40px; }
.tpl-pad-large { padding-block: 80px; }
.tpl-has-height { display: flex; min-height: var(--tpl-height); flex-direction: column; justify-content: center; }
.tpl-has-height > .tpl-inner { width: 100%; }
.tpl-bg-white { --tpl-bg: #fff; }
.tpl-bg-cream { --tpl-bg: var(--cream); }
.tpl-bg-mint { --tpl-bg: var(--mint); }
.tpl-bg-peach { --tpl-bg: #f6e2d3; }
.tpl-bg-green { --tpl-bg: var(--green); color: #fff; }
.tpl-bg-dark { --tpl-bg: var(--green-dark); color: #fff; }
.tpl-on-dark { color: #fff; }
:is(.tpl-bg-green, .tpl-bg-dark, .tpl-on-dark) :is(.eyebrow, .tpl-copyright, .brand small, .site-nav, .tpl-breadcrumb, .news-card-body .eyebrow, .tpl-event-list small) { color: rgba(255,255,255,.78); }
:is(.tpl-bg-green, .tpl-bg-dark, .tpl-on-dark) .site-nav > a:not(.button):hover { color: #fff; }
:is(.tpl-bg-green, .tpl-bg-dark, .tpl-on-dark) .button-quiet { color: #fff; }
:is(.tpl-bg-green, .tpl-bg-dark, .tpl-on-dark) .button-quiet:hover { background: rgba(255,255,255,.14); }
:is(.tpl-bg-green, .tpl-bg-dark, .tpl-on-dark) .brand-mark { background: #f4c7a8; color: var(--green-dark); }
:is(.tpl-bg-green, .tpl-bg-dark, .tpl-on-dark) :is(.news-card, .content-card) { color: var(--ink); }
.tpl-role-header { position: relative; z-index: 20; }
.tpl-role-header.tpl-bg-white { box-shadow: 0 1px 0 var(--line); }
.tpl-sticky { position: sticky; top: 0; }
.tpl-role-footer { margin-top: auto; font-size: 12px; }
.tpl-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.tpl-row + .tpl-row { margin-top: 24px; }
.tpl-gap-none { gap: 0; }
.tpl-gap-small { gap: 12px; }
.tpl-gap-large { gap: 48px; }
.tpl-valign-start { align-items: start; }
.tpl-valign-center { align-items: center; }
.tpl-valign-end { align-items: end; }
.tpl-col { display: flex; min-width: 0; grid-column: span var(--span, 12); flex-direction: column; gap: 18px; }
.tpl-col.align-center { align-items: center; text-align: center; }
.tpl-col.align-right { align-items: flex-end; text-align: right; }
.tpl-col > * { max-width: 100%; }
.tpl-col > .tpl-content, .tpl-col > .tpl-news, .tpl-col > .tpl-events, .tpl-col > .tpl-carousel, .tpl-col > .tpl-divider, .tpl-col > .tpl-spacer { align-self: stretch; }
.tpl-col .site-nav { flex-wrap: wrap; gap: 8px 22px; }
.tpl-col.align-right .site-nav { justify-content: flex-end; }
.tpl-col.align-center .site-nav { justify-content: center; }
.tpl-nav-vertical { flex-direction: column; align-items: flex-start; gap: 10px; }
.tpl-col.align-right .tpl-nav-vertical { align-items: flex-end; }
.site-nav a[aria-current="page"] { color: var(--nav-accent, var(--green)); font-weight: 700; }
/* Font of the main navigation (template editor) applies to the menu, not to the "Anmelden" button. */
.tpl-nav .button { font-family: 'Aptos', 'Segoe UI', sans-serif; font-style: normal; letter-spacing: normal; text-transform: none; font-variant: normal; }
.brand-logo { width: auto; max-width: 160px; height: 42px; object-fit: contain; }
.tpl-logo img { display: block; width: auto; max-width: 100%; }
.tpl-breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
.tpl-breadcrumb li + li::before { margin-right: 6px; content: '›'; opacity: .7; }
.tpl-breadcrumb a:hover { color: var(--green); text-decoration: underline; }
.tpl-breadcrumb [aria-current] { color: inherit; font-weight: 600; }
.tpl-subnav { font-size: 13px; }
.tpl-subnav-title { margin: 0 0 10px; font: 700 15px 'Aptos Display', 'Segoe UI', sans-serif; }
.tpl-subnav ul { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.tpl-subnav ul ul { margin: 2px 0 4px 12px; padding-left: 8px; border-left: 2px solid var(--line); }
.tpl-subnav li > :is(a, span) { display: block; padding: 6px 10px; border-radius: 8px; }
.tpl-subnav li > span { color: var(--muted); font-weight: 600; }
.tpl-subnav a:hover { background: var(--mint); color: var(--green); }
.tpl-subnav li.is-active > a { color: var(--green); }
.tpl-subnav a[aria-current="page"] { background: var(--mint); color: var(--green); font-weight: 700; }
:is(.tpl-bg-green, .tpl-bg-dark, .tpl-on-dark) .tpl-subnav :is(a:hover, a[aria-current="page"]) { background: rgba(255,255,255,.14); color: #fff; }
:is(.tpl-bg-green, .tpl-bg-dark, .tpl-on-dark) .tpl-subnav :is(li.is-active > a, li > span) { color: rgba(255,255,255,.85); }
.tpl-content > .page-content, .tpl-content > .article-full { margin-top: 24px; }
.tpl-content > .home-hero { margin-top: 0; }
.tpl-content-wide > :is(.page-content, .article-full) { max-width: 1200px; }
.tpl-content-full > :is(.page-content, .article-full) { max-width: none; }
.tpl-col:not([style*="--span:12"]) .tpl-content > :is(.page-content, .article-full) { max-width: none; }
/* Sub navigation the page content flows around; it keeps the width of its template column. */
.tpl-content > .has-subnav-float { max-width: none; }
.has-subnav-float::after { display: block; clear: both; content: ''; }
.has-subnav-float .rich-text::after { content: none; }
.tpl-subnav-float { width: calc(100% * var(--float-span, 3) / 12 - 24px); margin-bottom: 18px; }
.tpl-subnav-float-left { float: left; margin-right: 24px; }
.tpl-subnav-float-right { float: right; margin-left: 24px; }
.tpl-heading { margin: 0; font: 800 28px/1.2 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -1px; }
h3.tpl-heading { font-size: 19px; letter-spacing: -.4px; }
.tpl-text { margin: 0; }
.tpl-image { margin: 0; }
.tpl-image img { display: block; width: 100%; max-width: 100%; object-fit: cover; }
.tpl-image img.is-rounded { border-radius: 14px; }
.tpl-image figcaption { margin-top: 8px; color: var(--muted); font-size: 11px; }
.tpl-button { margin: 0; }
.tpl-button.is-outline a { border: 1px solid currentColor; background: transparent; color: var(--green); }
.tpl-copyright { margin: 0; color: var(--muted); }
.tpl-linklist strong { display: block; margin-bottom: 10px; font: 700 14px 'Aptos Display', 'Segoe UI', sans-serif; }
.tpl-linklist ul { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tpl-linklist-horizontal ul { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; }
.tpl-col.align-right .tpl-linklist ul { justify-content: flex-end; align-items: flex-end; }
.tpl-linklist a:hover { color: var(--green); text-decoration: underline; }
.tpl-block-title { margin: 0 0 16px; font: 800 24px/1.2 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -.9px; }
.tpl-empty { margin: 0; padding: 18px; border: 1px dashed #cbd9cf; border-radius: 12px; color: var(--muted); font-size: 13px; }
.tpl-news-grid { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
/* Articles can override the layout of a list, so cards and short entries may follow each other. */
:is(.article-grid, .tpl-news-list, .tpl-event-list) + :is(.article-grid, .tpl-news-list, .tpl-event-list) { margin-top: 12px; }
.news-card.no-image .news-card-body { padding-top: 21px; }
.tpl-news-list, .tpl-event-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; text-align: left; }
.tpl-news-list li, .tpl-event-list li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.tpl-news-list img { width: 64px; height: 52px; flex: 0 0 auto; border-radius: 8px; object-fit: cover; }
.tpl-news-list a, .tpl-event-list a, .tpl-news-list strong, .tpl-event-list strong { display: block; margin-top: 3px; font: 700 14px/1.35 'Aptos Display', 'Segoe UI', sans-serif; }
.tpl-news-list a:hover, .tpl-event-list a:hover { color: var(--green); }
.tpl-event-date { display: flex; width: 74px; flex: 0 0 auto; flex-direction: column; overflow: hidden; border-radius: 11px; background: var(--mint); color: var(--green); text-align: center; }
.tpl-event-date b { padding: 9px 4px 0; font: 800 19px/1 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -.3px; }
.tpl-event-date span { padding: 3px 4px 8px; font-size: 11px; font-weight: 700; }
.tpl-event-date em { padding: 4px; background: var(--green); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; }
.tpl-event-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.tpl-spacer { width: 100%; }
.tpl-divider { width: 100%; margin: 0; }
.tpl-carousel { position: relative; overflow: hidden; width: var(--carousel-width, 100%); margin-inline: auto; height: var(--carousel-height, 420px); border-radius: 20px; background: var(--green); text-align: left; }
.tpl-width-full .tpl-carousel { border-radius: 0; }
.tpl-carousel-track, .tpl-slide { position: absolute; inset: 0; margin: 0; }
.tpl-slide { visibility: hidden; opacity: 0; transition: opacity .6s ease, visibility .6s; }
.tpl-slide.is-active { visibility: visible; opacity: 1; }
.tpl-slide img { width: 100%; height: 100%; object-fit: cover; }
/* „Bilder vollständig zeigen“: ganzes Bild, bei Bedarf zentriert mit Rand links/rechts bzw. oben/unten */
.tpl-carousel.is-fit .tpl-slide img { object-fit: contain; object-position: center; }
.tpl-slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 70px 48px 44px; background: linear-gradient(transparent, rgba(16,36,30,.78)); color: #fff; }
.tpl-slide figcaption strong { max-width: 680px; font: 800 clamp(24px, 3.4vw, 40px)/1.1 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -1.2px; }
.tpl-slide figcaption span { max-width: 560px; color: #e3eee8; font-size: 14px; line-height: 1.6; }
.tpl-slide figcaption .button { margin-top: 6px; background: #f4c7a8; color: #244337; }
.tpl-carousel-prev, .tpl-carousel-next { position: absolute; top: 50%; display: grid; width: 42px; height: 42px; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--green-dark); font-size: 24px; line-height: 1; cursor: pointer; transform: translateY(-50%); }
.tpl-carousel-prev { left: 16px; }
.tpl-carousel-next { right: 16px; }
.tpl-carousel-prev:hover, .tpl-carousel-next:hover { background: #fff; }
.tpl-carousel-dots { position: absolute; right: 24px; bottom: 20px; display: flex; gap: 7px; }
.tpl-carousel-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 9px; background: rgba(255,255,255,.55); cursor: pointer; transition: width .2s; }
.tpl-carousel-dots button[aria-current] { width: 24px; background: #fff; }
@media (prefers-reduced-motion: reduce) {
    .tpl-slide { transition: none; }
}

@media (max-width: 760px) {
    .tpl-inner { padding: 0 18px; }
    .lightbox img { max-width: calc(100vw - 24px); }
    .lightbox-prev, .lightbox-next { top: auto; bottom: 10px; transform: none; }
    .tpl-pad-medium { padding-block: 28px; }
    .tpl-pad-large { padding-block: 48px; }
    .tpl-row { gap: 16px; }
    .tpl-col { grid-column: 1 / -1; }
    .tpl-subnav-float { float: none; width: auto; margin: 0 0 24px; }
    .tpl-col.align-right { align-items: flex-start; text-align: left; }
    .tpl-col.align-right .site-nav, .tpl-col.align-right .tpl-linklist ul { justify-content: flex-start; }
    .tpl-col .site-nav:not(.tpl-nav-vertical) { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
    .tpl-col .site-nav:not(.tpl-nav-vertical):has(.nav-item) { flex-wrap: wrap; overflow: visible; }
    .tpl-col.align-right .nav-submenu { left: -12px; right: auto; }
    .tpl-news-grid { grid-template-columns: 1fr; }
    .tpl-carousel { width: 100%; height: min(var(--carousel-height, 420px), 70vw); min-height: 220px; border-radius: 14px; }
    .tpl-slide figcaption { padding: 50px 20px 36px; }
    .tpl-slide figcaption span { display: none; }
    .tpl-carousel-prev, .tpl-carousel-next { width: 34px; height: 34px; font-size: 20px; }
}

@media (max-width: 760px) {
    .topbar { height: auto; min-height: 70px; padding: 14px 18px; flex-wrap: wrap; }
    .site-nav { width: 100%; overflow-x: auto; gap: 15px; padding-bottom: 3px; font-size: 12px; }
    .site-nav:has(.nav-item) { flex-wrap: wrap; overflow: visible; }
    .nav-submenu { min-width: 180px; }
    .site-nav .button, .site-nav > a.nav-login { margin-left: auto; white-space: nowrap; }
    .site-main { padding: 0 18px 65px; }
    .home-hero { min-height: 415px; margin: 12px 0 65px; padding: 55px 28px; }
    .home-hero h1 { font-size: 41px; letter-spacing: -2px; }
    .home-hero::before { right: -300px; }
    .hero-note { right: auto; left: 28px; bottom: 22px; }
    .article-grid, .teacher-grid { grid-template-columns: 1fr; }
    .news-card { display: grid; grid-template-columns: 115px 1fr; }
    .subpage-card.no-image { display: flex; }
    .news-card > img, .news-placeholder { height: 100%; min-height: 170px; }
    .section-heading { align-items: start; flex-direction: column; gap: 4px; }
    .section-heading h2 { font-size: 25px; }
    .home-links { padding: 24px 18px; }
    .quick-links { grid-template-columns: 1fr; }
    .footer { padding: 22px 18px; flex-wrap: wrap; }
    .page-hero { padding: 30px 23px; }
    .page-hero h1, .page-content > h1, .article-full h1 { font-size: 32px; }
    .page-content, .article-full { margin: 35px auto; }
    .form-grid { grid-template-columns: 1fr; }
    .frontend-edit-bar { align-items: stretch; flex-wrap: wrap; }
    .frontend-edit-bar > span { width: 100%; }
    .form-wide, .form-section-title { grid-column: auto; }
    .setup-panel { margin: 25px 0; padding: 25px 20px; }
}

/* Download area (download_area_html() in app/media.php) */
.download-area { margin: 28px 0; }
.download-area > h2 { margin: 0 0 12px; }
.download-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; padding: 0; list-style: none; font-size: 14px; }
.download-crumbs li + li::before { margin-right: 4px; color: var(--muted); content: '/'; }
.download-crumbs a { color: var(--green); font-weight: 700; }
.download-crumbs [aria-current] { color: var(--ink); font-weight: 700; }
.download-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.download-search input { min-width: 0; flex: 1 1 240px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.download-search .button { padding: 10px 16px; }
.download-search a { color: var(--green); font-size: 13px; }
.download-manage { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 14px; padding: 10px 12px; border: 1px dashed #b9cfc0; border-radius: 10px; background: #f4f9f5; font-size: 13px; }
.download-manage > span { font-weight: 700; }
.download-manage label { cursor: pointer; }
.download-manage small { width: 100%; color: var(--muted); }
.download-manage small.is-error { color: #a94635; }
.download-area.is-drop-target .download-table-wrap { outline: 3px dashed var(--green); outline-offset: 4px; }
.download-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.download-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.download-table th { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
.download-table td { padding: 10px 14px; border-bottom: 1px solid #eef1ee; vertical-align: middle; }
.download-table tr:last-child td { border-bottom: 0; }
.download-table td:not(:first-child) { color: var(--muted); white-space: nowrap; }
.download-table td:first-child a { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.download-table td:first-child a:hover { color: var(--green); }
.download-table td small { display: block; margin: 3px 0 0 50px; color: var(--muted); font-size: 12px; }
.download-icon { display: inline-grid; min-width: 40px; height: 24px; flex: 0 0 auto; padding: 0 4px; place-items: center; border-radius: 5px; background: #2f5fa6; color: #fff; font-size: 8px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.download-icon-pdf { background: #c0533f; }
.download-icon-sheet { background: #1f7a4d; }
.download-icon-slides { background: #c56a1c; }
.download-icon-image { background: #7a6bb5; }
.download-icon-folder { position: relative; min-width: 0; width: 30px; height: 22px; padding: 0; margin-top: 4px; border-radius: 3px 6px 6px 6px; background: #e3c46f; }
.download-icon-folder::before { position: absolute; top: -5px; left: 0; width: 12px; height: 6px; border-radius: 3px 3px 0 0; background: #d6b55a; content: ''; }
.download-empty { padding: 20px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
/* Map block (map_block_html() in app/map.php, assets/map.js) */
.map-block { margin: 28px 0; container-type: inline-size; }
.map-block > h2 { margin: 0 0 14px; }
.map-body { display: grid; gap: 18px; }
.map-block.layout-side .map-body { grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); align-items: stretch; }
.map-frame { position: relative; overflow: hidden; height: var(--map-height, 420px); border: 1px solid var(--line); border-radius: 16px; background-color: #e8eee6;
    /* A drawn map as background until Google's map is loaded: blocks, streets and a river. */
    background-image:
        linear-gradient(118deg, transparent 46%, #b9d4e3 46%, #b9d4e3 50%, transparent 50%),
        linear-gradient(0deg, transparent 47%, #fff 47%, #fff 51%, transparent 51%),
        linear-gradient(90deg, transparent 31%, #fff 31%, #fff 34%, transparent 34%, transparent 68%, #fff 68%, #fff 70%, transparent 70%),
        repeating-linear-gradient(0deg, transparent 0 38px, rgba(255,255,255,.7) 38px 40px),
        repeating-linear-gradient(90deg, transparent 0 54px, rgba(255,255,255,.7) 54px 56px),
        radial-gradient(circle at 78% 24%, #d6e6cf 0 60px, transparent 61px);
    box-shadow: 0 6px 24px rgba(25, 63, 54, .06); }
.map-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.map-consent { position: absolute; inset: 0; display: grid; padding: 16px; place-items: center; background: rgba(240, 245, 241, .55); backdrop-filter: blur(1px); }
.map-consent-box { display: grid; max-width: 380px; justify-items: center; gap: 8px; padding: 22px 24px; border-radius: 16px; background: rgba(255,255,255,.96); box-shadow: 0 12px 34px rgba(20, 45, 38, .16); text-align: center; }
.map-consent-box strong { font-size: 17px; }
.map-consent-box p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.map-consent-box p a { color: var(--green); text-decoration: underline; }
.map-consent-box .button { margin-top: 6px; cursor: pointer; }
.map-consent-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; background: #c0533f; transform: rotate(-45deg); box-shadow: inset 0 0 0 9px #c0533f, inset 0 0 0 15px #fff; }
.map-consent-remember { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; cursor: pointer; }
.map-card { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.map-card-name { font: 800 18px 'Aptos Display', 'Segoe UI', sans-serif; }
.map-card address { color: #3f4e49; font-style: normal; line-height: 1.6; }
.map-card-info { margin: 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.6; }
.map-card-info p { margin: 0 0 .5em; }
.map-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.map-revoke { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; }
.map-revoke[hidden] { display: none; }
.map-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
/* Map and address card side by side only when the block is wide enough (also inside columns). */
@container (max-width: 760px) {
    .map-block.layout-side .map-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .map-block.layout-side .map-body { grid-template-columns: minmax(0, 1fr); }
    .map-frame { height: min(var(--map-height, 420px), 70vh); }
}
/* School calendar (calendar_block_html() in app/calendar.php, assets/calendar.js) */
.school-calendar { --cal-line: #e3e8e3; --cal-soft: #f6f8f5; margin: 28px 0; }
.school-calendar > h2 { margin: 0 0 14px; }
/* Without specificity, so that the sizes of the single parts below win. */
:where(.school-calendar) button { font: inherit; cursor: pointer; }
.school-calendar-fallback ul { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.school-calendar-fallback li { padding: 10px 14px; border-bottom: 1px solid #eef1ee; }
.school-calendar-fallback li:last-child { border-bottom: 0; }
.school-calendar-fallback time { color: var(--green); font-weight: 700; }
.school-calendar-fallback span { color: var(--muted); font-size: 14px; }
.school-calendar-error, .cal-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav.is-list > button { display: none; }
.cal-arrow, .cal-today { height: 38px; border: 1px solid var(--cal-line); border-radius: 10px; background: #fff; color: var(--ink); }
.cal-arrow { width: 38px; font-size: 22px; line-height: 1; }
.cal-today { padding: 0 14px; font-size: 14px; font-weight: 700; }
.cal-arrow:hover, .cal-today:hover { border-color: var(--green); color: var(--green); }
.cal-title { margin: 0 0 0 10px; font: 800 22px 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -.4px; }
.cal-nav.is-list .cal-title { margin-left: 0; }
.cal-views { display: inline-flex; padding: 3px; border-radius: 11px; background: #e9eee9; }
.cal-views button { padding: 7px 16px; border: 0; border-radius: 8px; background: transparent; color: #4b5a55; font-size: 14px; font-weight: 700; }
.cal-views button[aria-pressed="true"] { background: #fff; color: var(--green-dark); box-shadow: 0 1px 3px rgba(20, 40, 35, .14); }
.cal-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cal-sources { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-source { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--cal-line); border-radius: 99px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; }
.cal-source[aria-pressed="false"] { color: #9aa5a0; text-decoration: line-through; }
.cal-source[aria-pressed="false"] .cal-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.cal-dot { display: inline-block; width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--c); }
.cal-search { min-width: 0; flex: 0 1 260px; padding: 8px 12px; border: 1px solid var(--cal-line); border-radius: 10px; background: #fff; }
.cal-search:focus { outline: 2px solid var(--green); outline-offset: 1px; }

/* Month */
.cal-month { overflow: hidden; border: 1px solid var(--cal-line); border-radius: 14px; background: #fff; box-shadow: 0 6px 24px rgba(25, 63, 54, .06); }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-weekdays span { padding: 10px 10px 8px; border-bottom: 1px solid var(--cal-line); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cal-day { display: flex; min-width: 0; min-height: 112px; flex-direction: column; gap: 3px; padding: 6px 6px 8px; border-right: 1px solid var(--cal-line); border-bottom: 1px solid var(--cal-line); cursor: pointer; transition: background .15s; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-grid > .cal-day:nth-last-child(-n+7) { border-bottom: 0; }
.cal-day:hover { background: #fafbf9; }
.cal-day.is-weekend { background: var(--cal-soft); }
.cal-day.is-holiday { background: repeating-linear-gradient(135deg, #fbf3ea 0 8px, #fdf8f2 8px 16px); }
.cal-day.is-other { background: #fbfbfa; }
.cal-day.is-other > * { opacity: .45; }
.cal-day.is-selected { box-shadow: inset 0 0 0 2px var(--green); }
.cal-daynum { display: grid; width: 28px; height: 28px; place-items: center; align-self: flex-start; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 14px; font-weight: 700; }
.cal-day.is-today .cal-daynum { background: var(--green); color: #fff; }
.cal-holiday { overflow: hidden; color: color-mix(in srgb, var(--c) 80%, #000); font-size: 11px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.cal-chip { display: flex; min-width: 0; align-items: baseline; gap: 5px; padding: 2px 6px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font-size: 12px; line-height: 1.35; text-align: left; }
.cal-chip::before { width: 7px; height: 7px; flex: 0 0 auto; align-self: center; border-radius: 50%; background: var(--c); content: ''; }
.cal-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-chip b { color: #5d6b66; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-chip:hover { background: color-mix(in srgb, var(--c) 12%, #fff); }
.cal-chip.is-span { background: color-mix(in srgb, var(--c) 16%, #fff); color: color-mix(in srgb, var(--c) 70%, #000); font-weight: 600; }
.cal-chip.is-span::before { display: none; }
.cal-chip.is-span:hover { background: color-mix(in srgb, var(--c) 26%, #fff); }
.cal-chip.is-continued { margin-left: -7px; padding-left: 13px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-chip.is-continuing { margin-right: -7px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-more { padding: 0 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.cal-agenda { margin-top: 16px; }
.cal-agenda h4, .cal-list-month h4 { margin: 0 0 8px; font: 800 16px 'Aptos Display', 'Segoe UI', sans-serif; }

/* Lists (agenda of a day, list view) */
.cal-items { overflow: hidden; border: 1px solid var(--cal-line); border-radius: 14px; background: #fff; }
.cal-item { display: flex; width: 100%; align-items: flex-start; gap: 14px; padding: 13px 16px; border: 0; border-bottom: 1px solid #eef1ee; background: #fff; color: var(--ink); text-align: left; }
.cal-item:last-child { border-bottom: 0; }
.cal-item:hover { background: #f8faf8; }
.cal-bar { width: 4px; align-self: stretch; flex: 0 0 auto; border-radius: 2px; background: var(--c); }
.cal-date { display: grid; width: 50px; height: 54px; flex: 0 0 auto; place-content: center; border-radius: 11px; background: color-mix(in srgb, var(--c) 14%, #fff); color: color-mix(in srgb, var(--c) 75%, #000); text-align: center; }
.cal-date b { font: 800 21px/1 'Aptos Display', 'Segoe UI', sans-serif; }
.cal-date small { margin-top: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.cal-item-main { display: grid; min-width: 0; flex: 1; gap: 3px; }
.cal-item-main strong { font-size: 15px; line-height: 1.35; }
.cal-item-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--muted); font-size: 13px; }
.cal-item-source { display: inline-flex; align-items: center; gap: 5px; }
.cal-item-desc { overflow: hidden; color: #5a6863; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.cal-item-files { flex: 0 0 auto; align-self: center; padding: 3px 8px; border-radius: 99px; background: var(--mint); color: var(--green); font-size: 12px; font-weight: 700; }
.cal-list { display: grid; gap: 22px; }
.cal-load { display: block; margin: 16px auto 0; }
.school-calendar.is-compact .cal-list { gap: 0; }

/* Week */
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--cal-line); border-radius: 14px; background: #fff; box-shadow: 0 6px 24px rgba(25, 63, 54, .06); }
.cal-week-day { display: flex; min-width: 0; min-height: 260px; flex-direction: column; gap: 5px; padding: 0 6px 10px; border-right: 1px solid var(--cal-line); }
.cal-week-day:last-child { border-right: 0; }
.cal-week-day.is-weekend { background: var(--cal-soft); }
.cal-week-day.is-holiday { background: repeating-linear-gradient(135deg, #fbf3ea 0 8px, #fdf8f2 8px 16px); }
.cal-week-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 -6px 4px; padding: 10px; border-bottom: 1px solid var(--cal-line); }
.cal-week-head span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.cal-week-head b { font-size: 15px; }
.cal-week-day.is-today .cal-week-head { box-shadow: inset 0 -3px 0 var(--green); }
.cal-week-day.is-today .cal-week-head b { color: var(--green); }
.cal-slot { display: grid; gap: 1px; padding: 7px 8px; border: 0; border-left: 3px solid var(--c); border-radius: 6px; background: color-mix(in srgb, var(--c) 9%, #fff); color: var(--ink); font-size: 12px; text-align: left; }
.cal-slot b { color: color-mix(in srgb, var(--c) 75%, #000); font-variant-numeric: tabular-nums; }
.cal-slot span { font-weight: 600; line-height: 1.3; overflow-wrap: break-word; }
.cal-slot small { color: var(--muted); }
.cal-slot:hover { background: color-mix(in srgb, var(--c) 18%, #fff); }
.cal-week .cal-chip.is-continued, .cal-week .cal-chip.is-continuing { margin: 0; padding-left: 6px; border-radius: 5px; }
.cal-week .cal-chip span { white-space: normal; }
.cal-week-empty { margin-top: 8px; color: #c2c9c5; text-align: center; }

/* Details */
.cal-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 30px 80px rgba(12, 30, 25, .3); }
.cal-dialog::backdrop { background: rgba(18, 34, 30, .45); backdrop-filter: blur(2px); }
.cal-detail { padding: 0 24px 22px; border-top: 6px solid var(--c); }
.cal-detail header { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 4px; }
.cal-detail-source { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.cal-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f4f1; color: var(--ink); font-size: 20px; cursor: pointer; }
.cal-close:hover { background: #e3e9e4; }
.cal-detail h3 { margin: 4px 0 12px; font: 800 24px/1.2 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -.4px; }
.cal-detail-when, .cal-detail-where { display: flex; gap: 10px; margin: 6px 0; color: #3f4e49; font-size: 15px; }
.cal-detail-text { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: #3f4e49; font-size: 15px; line-height: 1.6; }
.cal-detail-text p { margin: 0 0 .7em; }
.cal-detail-text a { color: var(--green); text-decoration: underline; overflow-wrap: break-word; }
.cal-detail-files { margin-top: 14px; }
.cal-detail-files h4 { margin: 0 0 8px; color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.cal-file { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; padding: 9px 12px; border: 1px solid #c9dccf; border-radius: 9px; background: var(--mint); color: var(--green-dark); font-size: 14px; font-weight: 700; overflow-wrap: break-word; }
.cal-file:hover { border-color: var(--green); }
.cal-file.is-pdf span { color: #c0533f; }
.cal-detail footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

@media (max-width: 760px) {
    .cal-title { font-size: 18px; }
    .cal-toolbar { flex-direction: column; align-items: stretch; }
    .cal-views { align-self: flex-start; }
    .cal-search { flex: 1 1 100%; }
    .cal-day { min-height: 58px; align-items: center; padding: 4px 2px 6px; }
    .cal-day > .cal-chip { width: 7px; height: 7px; padding: 0; margin: 0; border-radius: 50%; background: var(--c); font-size: 0; display: inline-block; }
    .cal-day > .cal-chip::before { display: none; }
    .cal-day { flex-flow: row wrap; justify-content: center; align-content: flex-start; gap: 3px; }
    .cal-daynum { flex: 0 0 auto; margin: 0 calc((100% - 28px) / 2) 2px; align-self: auto; }
    .cal-holiday, .cal-more { display: none; }
    .cal-weekdays span { padding: 8px 0; text-align: center; font-size: 11px; }
    .cal-week { grid-template-columns: 1fr; }
    .cal-week-day { min-height: 0; border-right: 0; border-bottom: 1px solid var(--cal-line); }
    .cal-week-day:last-child { border-bottom: 0; }
    .cal-week-empty { display: none; }
    .cal-item { gap: 12px; padding: 12px; }
    .cal-detail { padding: 0 18px 18px; }
}
/* Site search (search_block_html() in app/search.php) */
.site-search { margin: 28px 0; }
.site-search > h2 { margin: 0 0 12px; }
.site-search-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.site-search-form input, .site-search-input { min-width: 0; flex: 1 1 260px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; }
.site-search-form input:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: transparent; }
.site-search-form .button { padding: 12px 20px; }
.site-search-input { color: var(--muted); }
.site-search-note, .site-search-empty { color: var(--muted); font-size: 14px; }
.site-search-summary { margin: 0 0 10px; font-weight: 700; }
.site-search-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.site-search-filter a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; }
.site-search-filter a span { color: var(--muted); font-weight: 500; }
.site-search-filter a:hover { border-color: var(--green); }
.site-search-filter a[aria-current] { border-color: var(--green); background: var(--green); color: #fff; }
.site-search-filter a[aria-current] span { color: #d8e8de; }
.site-search-results { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.site-search-hit { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; padding: 14px 16px; border-bottom: 1px solid #eef1ee; }
.site-search-hit:last-child { border-bottom: 0; }
.site-search-type { grid-row: span 3; align-self: start; min-width: 74px; padding: 3px 6px; border-radius: 5px; background: var(--mint); color: var(--green); font-size: 11px; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.site-search-hit.is-article .site-search-type, .site-search-hit.is-category .site-search-type { background: #f6e6da; color: #8a4b22; }
.site-search-hit.is-file .site-search-type, .site-search-hit.is-folder .site-search-type { background: #e7ecf6; color: #2f4f8a; }
.site-search-hit.is-teacher .site-search-type { background: #efe9f7; color: #5b4a94; }
.site-search-title { color: var(--ink); font-weight: 700; overflow-wrap: break-word; }
.site-search-title:hover { color: var(--green); text-decoration: underline; }
.site-search-meta { color: var(--muted); font-size: 12px; }
.site-search-hit p { margin: 2px 0 0; color: #45544f; font-size: 14px; line-height: 1.5; }
.site-search mark { padding: 0 1px; border-radius: 3px; background: #fbe7a1; color: inherit; }
.site-search-pages { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 14px; }
.site-search-pages a, .site-search-pages span { min-width: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: center; font-size: 14px; }
.site-search-pages a:hover { border-color: var(--green); color: var(--green); }
.site-search-pages [aria-current] { border-color: var(--green); background: var(--green); color: #fff; font-weight: 700; }
@media (max-width: 560px) {
    .site-search-hit { grid-template-columns: 1fr; }
    .site-search-type { grid-row: auto; justify-self: start; min-width: 0; }
}
@media (max-width: 640px) {
    .download-table th:nth-child(3), .download-table td:nth-child(3) { display: none; }
}

/* Editorial bar for signed-in users (admin_bar_html() in app/helpers.php) */
.admin-bar { position: fixed; z-index: 50; top: 0; right: 0; left: 0; display: flex; min-height: 44px; align-items: center; gap: 6px 14px; padding: 0 16px; background: #173d33; color: #dfeee6; font: 500 13px/1.2 'Aptos', 'Segoe UI', sans-serif; box-shadow: 0 2px 10px rgba(10,30,22,.25); }
.has-admin-bar { padding-top: 44px; }
.has-admin-bar .tpl-sticky { top: 44px; }
.admin-bar a, .admin-bar button { padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: #dfeee6; font: inherit; white-space: nowrap; cursor: pointer; }
.admin-bar a:hover, .admin-bar button:hover, .admin-bar a:focus-visible, .admin-bar button:focus-visible { background: rgba(255,255,255,.12); color: #fff; }
.admin-bar-brand { padding-right: 6px; border-right: 1px solid rgba(255,255,255,.18); color: #9fd1b5; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.admin-bar-main, .admin-bar-new, .admin-bar-account { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.admin-bar-main { margin-right: auto; }
.admin-bar .admin-bar-primary { background: #f4c7a8; color: #173d33; font-weight: 700; }
.admin-bar .admin-bar-primary:hover { background: #f8d6be; color: #173d33; }
.admin-bar .admin-bar-primary.is-active { background: #9fd1b5; }
.admin-bar-note { margin-left: 6px; padding: 4px 8px; border-radius: 20px; background: rgba(244,199,168,.18); color: #f4c7a8; font-size: 12px; }
.admin-bar-user { padding: 0 6px; color: #9fd1b5; }
.admin-bar form { margin: 0; }
@media (max-width: 760px) {
    .admin-bar { flex-wrap: wrap; padding: 6px 10px; }
    .has-admin-bar { padding-top: 92px; }
    .has-admin-bar .tpl-sticky { top: 92px; }
    .admin-bar-brand, .admin-bar-user, .admin-bar-new { display: none; }
    .admin-bar-main { width: 100%; }
}


/* Block "Schulbücher" (app/schoolbooks.php, assets/schoolbooks.js) */
.schoolbooks { --sb-accent: var(--green); --sb-soft: var(--mint); --sb-line: #e3e8e3; margin: 28px 0; }
.schoolbooks > h2 { margin: 0 0 14px; }
.schoolbooks h3 { margin: 0; font: 800 19px/1.3 'Aptos Display', 'Segoe UI', sans-serif; letter-spacing: -.3px; }
:where(.schoolbooks) button { font: inherit; cursor: pointer; }
.schoolbooks-notice { margin-bottom: 16px; padding: 14px 18px; border-left: 4px solid #c56a1c; border-radius: 10px; background: #fdf5ec; }
.schoolbooks-error, .sb-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.schoolbooks-fallback h3 { margin-bottom: 12px; }
.sb-panel { padding: 22px 24px; border: 1px solid var(--sb-line); border-radius: 18px; background: #fff; box-shadow: 0 6px 24px rgba(25, 63, 54, .06); }
.sb-panel.is-current { --sb-accent: #2f5f8a; --sb-soft: #e8f0f7; }
.sb-warning { margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; background: #fdecea; color: #8c3a2c; font-weight: 600; }
.sb-progress { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; margin: 0 0 22px; padding: 0; list-style: none; counter-reset: none; }
.sb-progress-item { position: relative; }
.sb-progress-item + .sb-progress-item::before { position: absolute; top: 15px; right: 50%; left: -50%; height: 2px; background: var(--sb-line); content: ''; }
.sb-progress-item.is-done + .sb-progress-item::before, .sb-progress-item.is-active:not(:first-child)::before { background: var(--sb-accent); }
.sb-progress-item button { position: relative; display: flex; width: 100%; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.sb-progress-dot { position: relative; z-index: 1; display: grid; width: 32px; height: 32px; place-items: center; border: 2px solid var(--sb-line); border-radius: 50%; background: #fff; color: var(--muted); font-weight: 800; transition: background .15s, border-color .15s; }
.sb-progress-item.is-active .sb-progress-dot { border-color: var(--sb-accent); background: var(--sb-accent); color: #fff; }
.sb-progress-item.is-active button { color: var(--ink); }
.sb-progress-item.is-done .sb-progress-dot { border-color: var(--sb-accent); color: var(--sb-accent); font-size: 0; }
.sb-progress-item.is-done .sb-progress-dot::after { font-size: 15px; content: '✓'; }
.sb-steps { display: grid; gap: 22px; }
.sb-panel.is-open .sb-step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding-bottom: 22px; border-bottom: 1px solid #eef1ee; }
.sb-panel.is-open .sb-step:last-child { padding-bottom: 0; border-bottom: 0; }
.sb-step[hidden] { display: none !important; }
.sb-step-number { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--sb-soft); color: var(--sb-accent); font-weight: 800; }
.sb-help { max-width: 720px; margin: 6px 0 14px; color: var(--muted); line-height: 1.6; }
.sb-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.sb-choice { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 9px 16px; border: 1.5px solid var(--sb-line); border-radius: 11px; background: #fff; color: var(--ink); font-weight: 700; text-align: center; transition: border-color .15s, background .15s, color .15s; }
.sb-choice.is-grade { min-width: 50px; }
.sb-choice:hover { border-color: var(--sb-accent); color: var(--sb-accent); }
.sb-choice[aria-pressed="true"] { border-color: var(--sb-accent); background: var(--sb-accent); color: #fff; }
.sb-choice.is-current[aria-pressed="true"] { border-color: #2f5f8a; background: #2f5f8a; }
.sb-choice.is-disabled, .sb-choice:disabled { border-color: var(--sb-line); background: #f6f7f5; color: #a3ada8; cursor: not-allowed; }
.sb-outputs .sb-choice { flex: 1 1 200px; }
.sb-checks { display: grid; gap: 8px; }
.sb-check { display: flex; align-items: center; gap: 10px; width: fit-content; padding: 10px 14px; border: 1.5px solid var(--sb-line); border-radius: 11px; background: #fff; font-weight: 600; cursor: pointer; }
.sb-check:has(input:checked) { border-color: var(--sb-accent); background: var(--sb-soft); }
.sb-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--sb-accent); }
.sb-result { margin: 14px 0 0; color: var(--muted); }
.sb-result strong { color: var(--ink); }
.sb-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid #eef1ee; }
.sb-summary { color: var(--muted); font-size: 14px; font-weight: 600; }
.sb-nav-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sb-nav-button { min-height: 40px; padding: 8px 16px; border: 1px solid var(--sb-line); border-radius: 10px; background: #fff; color: var(--ink); font-weight: 700; }
.sb-nav-button:hover:not(:disabled) { border-color: var(--sb-accent); color: var(--sb-accent); }
.sb-nav-button.is-primary { border-color: var(--sb-accent); background: var(--sb-accent); color: #fff; }
.sb-nav-button.is-primary:hover:not(:disabled) { color: #fff; filter: brightness(.92); }
.sb-nav-button:disabled { opacity: .45; cursor: default; }
.sb-table-card, .sb-slideshow { margin-top: 18px; padding: 20px 22px; border: 1px solid var(--sb-line); border-radius: 18px; background: #fff; scroll-margin-top: 90px; }
.sb-card-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sb-card-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sb-card-count { padding: 5px 12px; border-radius: 99px; background: var(--mint); color: var(--green-dark); font-size: 13px; font-weight: 700; }
.sb-table-wrap { overflow-x: auto; border: 1px solid var(--sb-line); border-radius: 12px; }
.sb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sb-table th { padding: 0; background: var(--mint); text-align: left; white-space: nowrap; }
.sb-table th.sb-col-cover { padding: 10px 12px; }
.sb-sort { width: 100%; padding: 10px 12px; border: 0; background: none; color: var(--ink); font-weight: 700; text-align: left; }
.sb-sort:hover { color: var(--green); }
.sb-table td { padding: 12px; border-top: 1px solid #eef1ee; vertical-align: top; }
.sb-table tbody tr:nth-child(even) td { background: #fafbf9; }
.sb-col-cover { width: 72px; }
.sb-cover { display: block; padding: 0; border: 0; border-radius: 6px; background: none; box-shadow: 0 2px 8px rgba(20, 40, 35, .15); }
.sb-cover img { display: block; width: 56px; height: auto; border-radius: 6px; }
.sb-cover-none { display: grid; width: 56px; min-height: 74px; place-items: center; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); font-size: 11px; text-align: center; }
.sb-title { display: block; line-height: 1.4; }
.sb-note { margin: 6px 0 0; padding: 6px 10px; border-radius: 8px; background: #fdf5ec; color: #7a4a1c; font-size: 13px; }
.sb-alternatives { display: grid; gap: 6px; margin-top: 10px; padding: 10px 12px; border-left: 3px solid #c56a1c; border-radius: 8px; background: #fbf8f3; }
.sb-alternatives-label { color: #9a5a1e; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sb-alternative strong { display: block; font-size: 13px; }
.sb-alternative small { color: var(--muted); }
.sb-col-isbn { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sb-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.sb-badge { padding: 2px 9px; border-radius: 99px; background: var(--mint); color: var(--green-dark); font-size: 12px; font-weight: 700; white-space: nowrap; }
.sb-slideshow-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sb-slideshow-head span { color: var(--muted); font-size: 14px; }
.sb-dialog-close { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 1px solid var(--sb-line); border-radius: 50%; background: #fff; color: var(--ink); font-size: 24px; line-height: 1; }
.sb-slide-tabs { display: inline-flex; margin-bottom: 14px; padding: 3px; border-radius: 11px; background: #e9eee9; }
.sb-slide-tabs button { padding: 7px 16px; border: 0; border-radius: 8px; background: transparent; color: #4b5a55; font-weight: 700; }
.sb-slide-tabs button[aria-selected="true"] { background: #fff; color: var(--green-dark); box-shadow: 0 1px 3px rgba(20, 40, 35, .14); }
.sb-slide { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px 22px; align-items: start; }
.sb-slide-cover img { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 16px rgba(20, 40, 35, .18); }
.sb-slide-cover .sb-cover-none { width: 100%; min-height: 200px; }
.sb-slide-kind { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sb-slide-details p { margin: 6px 0 0; }
.sb-slide-barcode { grid-column: 1 / -1; padding: 12px; border: 1px solid var(--sb-line); border-radius: 12px; background: #fff; text-align: center; }
.sb-slide-barcode svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.sb-slideshow-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.sb-slideshow-nav .sb-nav-button { flex: 1 1 0; max-width: 220px; }
.sb-slideshow.is-fullscreen { position: fixed; z-index: 1000; inset: 0; display: flex; overflow-y: auto; flex-direction: column; margin: 0; padding: 16px; border: 0; border-radius: 0; touch-action: pan-y; }
.sb-slideshow.is-fullscreen .sb-slide { flex: 1; align-content: start; }
.sb-slideshow.is-fullscreen .sb-slideshow-nav { position: sticky; bottom: 0; padding-top: 10px; background: #fff; }
.sb-slideshow.is-fullscreen .sb-slideshow-nav .sb-nav-button { max-width: none; min-height: 50px; }
html.sb-locked, html.sb-locked body { overflow: hidden; }
.sb-cover-dialog { max-width: min(92vw, 560px); padding: 0; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.sb-cover-dialog::backdrop { background: rgba(20, 30, 28, .6); }
.sb-cover-dialog img { display: block; max-width: 100%; max-height: 85vh; }
.sb-cover-dialog .sb-dialog-close { position: absolute; top: 10px; right: 10px; }
@media (max-width: 760px) {
    .sb-panel, .sb-table-card { padding: 16px; border-radius: 14px; }
    .sb-progress-label { display: none; }
    .sb-progress-item.is-active .sb-progress-label { display: block; position: absolute; top: 38px; white-space: nowrap; }
    .sb-progress { margin-bottom: 34px; }
    .sb-panel.is-open .sb-step { grid-template-columns: minmax(0, 1fr); }
    .sb-step-number { display: none; }
    .sb-nav { flex-direction: column-reverse; align-items: stretch; }
    .sb-nav-actions .sb-nav-button { flex: 1 1 0; }
    .sb-slide { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
    /* The table becomes one card per material. */
    .sb-table-wrap { border: 0; }
    .sb-table thead { display: none; }
    .sb-table, .sb-table tbody, .sb-table tr, .sb-table td { display: block; }
    .sb-table tr { position: relative; min-height: 96px; margin-bottom: 12px; padding: 12px 12px 12px 84px; border: 1px solid var(--sb-line); border-radius: 12px; background: #fff; }
    .sb-table tbody tr:nth-child(even) td, .sb-table td { padding: 2px 0; border: 0; background: none; }
    .sb-table td.sb-col-cover { position: absolute; top: 12px; left: 12px; width: auto; }
    .sb-table td.sb-col-title { margin-bottom: 6px; }
    .sb-table td[data-label] { display: flex; gap: 8px; font-size: 13px; }
    .sb-table td[data-label]::before { min-width: 92px; color: var(--muted); font-weight: 600; content: attr(data-label); }
    .sb-col-isbn { white-space: normal; }
}

/* Notices that would lie above the kept scroll position after sending a form (assets/scroll-keep.js). */
.notice-float { position: fixed; z-index: 50; top: 16px; left: 50%; width: min(560px, calc(100vw - 32px)); transform: translateX(-50%); cursor: pointer; transition: opacity .3s, transform .3s; }
.notice-float .notice { margin: 0 0 8px; box-shadow: 0 8px 24px rgba(20,30,25,.16); }
.notice-float.is-leaving { opacity: 0; transform: translate(-50%, -8px); }

/* Notices (app/notices.php): banner with the current notices and the ticker. */
.notice-board { display: grid; gap: 8px; margin: 14px 0; }
.notice-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border: 1px solid var(--notice-line); border-left: 4px solid var(--notice-accent); border-radius: 10px; background: var(--notice-bg); color: #1d312d; line-height: 1.55; }
.notice-style-info { --notice-bg: #eaf3ed; --notice-line: #cfe2d5; --notice-accent: #245c4e; }
.notice-style-important { --notice-bg: #fff5d9; --notice-line: #f1dc9f; --notice-accent: #b7791f; }
.notice-style-urgent { --notice-bg: #fdecea; --notice-line: #f3c4bf; --notice-accent: #b42318; }
.notice-icon { display: inline-grid; flex: 0 0 auto; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--notice-accent); color: #fff; font-size: 13px; font-weight: 800; line-height: 1; }
.notice-body { flex: 1; min-width: 0; }
.notice-title { display: block; margin-bottom: 2px; }
.notice-text > :first-child { margin-top: 0; }
.notice-text > :last-child { margin-bottom: 0; }
.notice-text p { margin: .3em 0; }
.notice-text a { color: inherit; font-weight: 700; text-decoration: underline; }
.notice-board.is-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border: 1px dashed #b9cfc0; border-radius: 10px; color: #64736e; font-size: 13px; }
.notice-board.is-empty p { margin: 0; }
.notice-ticker { display: flex; align-items: center; gap: 4px; margin: 10px 0; padding: 0 6px 0 0; overflow: hidden; border-radius: 8px; background: var(--ticker-bg, #245c4e); color: #fff; font-size: 14px; }
.notice-ticker.is-empty { padding: 8px 14px; border: 1px dashed currentColor; opacity: .8; }
.notice-ticker.is-empty p { margin: 0; }
.notice-ticker-window { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.notice-ticker-track { display: flex; width: max-content; animation: notice-ticker var(--ticker-duration, 20s) linear infinite; }
/* Hovering or a focused link stops it; the pause button itself keeps working after being clicked. */
.notice-ticker-window:hover .notice-ticker-track, .notice-ticker-window:focus-within .notice-ticker-track, .notice-ticker.is-paused .notice-ticker-track { animation-play-state: paused; }
.notice-ticker-list { display: flex; flex: 0 0 auto; gap: 48px; margin: 0; padding: 9px 48px 9px 0; list-style: none; white-space: nowrap; }
.notice-ticker-list li { display: inline-flex; align-items: center; gap: 8px; }
.notice-ticker-list .notice-icon { width: 1.4em; height: 1.4em; border: 1px solid rgba(255,255,255,.6); font-size: .78em; font-style: normal; }
.notice-ticker-list a { color: inherit; text-decoration: underline; }
.notice-ticker-pause { flex: 0 0 auto; width: 30px; height: 30px; border: 1px solid currentColor; border-radius: 6px; background: transparent; color: inherit; font: 11px/1 system-ui, sans-serif; opacity: .8; cursor: pointer; }
.notice-ticker-pause:hover, .notice-ticker-pause:focus-visible { opacity: 1; outline: 2px solid currentColor; outline-offset: 1px; }
@keyframes notice-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
    .notice-ticker-track { width: auto; animation: none; }
    .notice-ticker-track > [aria-hidden="true"], .notice-ticker-pause { display: none; }
    .notice-ticker-list { min-width: 0 !important; flex-wrap: wrap; gap: 6px 32px; padding: 9px 14px; white-space: normal; }
    .notice-ticker-window { -webkit-mask-image: none; mask-image: none; }
}
.tpl-news-more { margin: 16px 0 0; text-align: center; }
.article-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 28px; }
.article-pager > :first-child { justify-self: start; }
.article-pager > :last-child { justify-self: end; }
.article-pager-status { color: var(--muted, #65746d); font-size: 13px; }
@media (max-width: 560px) {
    .article-pager { grid-template-columns: 1fr 1fr; }
    .article-pager-status { grid-column: 1 / -1; grid-row: 1; text-align: center; }
}
