:root {
    --cream: #f5efe6;
    --paper: #fffaf2;
    --paper-strong: #fffdf8;
    --terracotta: #c0392b;
    --terracotta-dark: #8f2b21;
    --olive: #4a6b3a;
    --olive-dark: #304b25;
    --wood: #5c4033;
    --wood-dark: #34231c;
    --gold-warm: #d59b2a;
    --ink: #2f2925;
    --muted: #6f6259;
    --line: rgba(92, 64, 51, 0.18);
    --shadow: 0 18px 50px rgba(74, 51, 39, 0.12);
    --shadow-soft: 0 9px 28px rgba(74, 51, 39, 0.09);
    --radius: 24px;
    --radius-small: 14px;
    --shell: 1180px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 118px;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background-color: var(--cream);
    background-image:
        radial-gradient(circle at 8% 14%, rgba(192, 57, 43, 0.055) 0 3px, transparent 4px),
        radial-gradient(circle at 86% 30%, rgba(74, 107, 58, 0.065) 0 2px, transparent 3px),
        radial-gradient(ellipse at 12% 5%, rgba(255, 255, 255, 0.62), transparent 34%),
        linear-gradient(110deg, transparent 0 48%, rgba(92, 64, 51, 0.025) 49%, transparent 50%);
    background-size: 46px 46px, 58px 58px, auto, 180px 180px;
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

:lang(zh-CN) body {
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
    line-height: 1.75;
}

:lang(zh-CN) h1,
:lang(zh-CN) h2,
:lang(zh-CN) h3,
:lang(zh-CN) .brand strong {
    font-family: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
    letter-spacing: 0;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: var(--terracotta-dark);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--terracotta);
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid #0d6ea6;
    outline-offset: 3px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    color: var(--wood-dark);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.12;
}

h1 {
    margin-bottom: 1rem;
    font-size: clamp(2.5rem, 8vw, 5rem);
    letter-spacing: -0.045em;
}

h2 {
    margin-bottom: 0.8rem;
    font-size: clamp(2rem, 5vw, 3.35rem);
    letter-spacing: -0.032em;
}

h3 {
    margin-bottom: 0.55rem;
    font-size: 1.35rem;
}

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

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 12px;
    left: 12px;
    padding: 0.75rem 1rem;
    color: #fff;
    background: var(--wood-dark);
    border-radius: 8px;
    transform: translateY(-160%);
}

.skip-link:focus {
    color: #fff;
    transform: translateY(0);
}

.page-shell,
.header-inner,
.footer-inner {
    width: min(calc(100% - 32px), var(--shell));
    margin-inline: auto;
}

.narrow {
    max-width: 760px;
}

.section-space {
    padding-block: 4rem 5.5rem;
}

.eyebrow {
    margin-bottom: 0.75rem;
    color: var(--terracotta-dark);
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.17em;
    line-height: 1.4;
    text-transform: uppercase;
}

.site-header {
    position: sticky;
    z-index: 100;
    top: 0;
    background: rgba(245, 239, 230, 0.95);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 6px 24px rgba(52, 35, 28, 0.05);
    backdrop-filter: blur(16px);
}

.header-inner {
    display: flex;
    min-height: 84px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.7rem 1rem;
    padding-block: 8px;
}

.brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 0.7rem;
    color: var(--wood-dark);
    text-decoration: none;
}

.brand:hover {
    color: var(--wood-dark);
}

.brand img {
    width: auto;
    height: 64px;
    flex: 0 0 auto;
}

.brand span {
    display: grid;
    line-height: 1.05;
}

.brand strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.14rem;
}

.brand small {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.7rem 0 0.45rem;
    border-top: 1px solid var(--line);
    order: 3;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    order: 2;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    background: rgba(255, 253, 248, 0.82);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(52, 35, 28, 0.06);
}

.language-switcher a {
    min-width: 38px;
    padding: 0.34rem 0.48rem;
    color: var(--wood);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-decoration: none;
}

.language-switcher a:hover {
    color: var(--terracotta-dark);
    background: rgba(192, 57, 43, 0.08);
}

.language-switcher a.is-active {
    color: #fff;
    background: var(--terracotta);
}

.site-nav a,
.site-nav .link-button {
    display: block;
    width: 100%;
    padding: 0.62rem 0.7rem;
    color: var(--wood);
    background: transparent;
    border: 0;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.site-nav a:hover,
.site-nav a.is-current,
.site-nav .link-button:hover {
    color: var(--terracotta-dark);
    background: rgba(192, 57, 43, 0.08);
}

.site-nav a.is-current {
    box-shadow: inset 3px 0 0 var(--terracotta);
}

.site-nav .nav-sign-in {
    color: #fff;
    background: var(--terracotta);
}

.site-nav .nav-sign-in:hover,
.site-nav .nav-sign-in.is-current {
    color: #fff;
    background: var(--terracotta-dark);
}

.logout-form {
    margin: 0;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--wood-dark);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
}

.nav-toggle-lines,
.nav-toggle-lines::before,
.nav-toggle-lines::after {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 3px;
    content: "";
    transition: transform 180ms ease, opacity 180ms ease;
}

.nav-toggle-lines {
    position: relative;
}

.nav-toggle-lines::before {
    position: absolute;
    top: -6px;
}

.nav-toggle-lines::after {
    position: absolute;
    top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::before {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::after {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 899px) {
    .js .nav-toggle {
        display: inline-flex;
    }

    .js .site-nav {
        display: none;
    }

    .js .site-nav.is-open {
        display: flex;
    }
}

.flash-stack {
    display: grid;
    gap: 0.6rem;
    padding-top: 1rem;
}

.flash,
.validation-summary {
    padding: 0.9rem 1rem;
    border-radius: var(--radius-small);
    border: 1px solid transparent;
}

.flash-success {
    color: #1d4a22;
    background: #eaf5e6;
    border-color: #aacaa5;
}

.flash-error,
.validation-summary {
    color: #762219;
    background: #fff0ec;
    border-color: #dfaea6;
}

.flash-info {
    color: #5b4615;
    background: #fff6d9;
    border-color: #d9c47b;
}

.validation-summary {
    margin-bottom: 1.25rem;
}

.validation-summary ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.hero {
    display: grid;
    gap: 2.2rem;
    align-items: center;
    padding-block: 3.2rem 4.5rem;
}

.hero-copy {
    max-width: 690px;
}

.hero h1 {
    max-width: 780px;
}

.hero-lead,
.page-hero > div:first-child > p:last-child,
.dashboard-hero > div:first-child > p:last-child,
.admin-hero > div:first-child > p:last-child {
    max-width: 690px;
    color: var(--muted);
    font-size: clamp(1.05rem, 2.5vw, 1.28rem);
    line-height: 1.65;
}

.button-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0.72rem 1.15rem;
    color: #fff;
    background: var(--terracotta);
    border: 2px solid var(--terracotta);
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(192, 57, 43, 0.18);
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
    color: #fff;
    background: var(--terracotta-dark);
    border-color: var(--terracotta-dark);
    box-shadow: 0 10px 24px rgba(143, 43, 33, 0.22);
    transform: translateY(-1px);
}

.button-secondary {
    color: var(--wood-dark);
    background: transparent;
    border-color: rgba(92, 64, 51, 0.35);
    box-shadow: none;
}

.button-secondary:hover {
    color: var(--terracotta-dark);
    background: rgba(255, 255, 255, 0.55);
    border-color: var(--terracotta);
}

.button-small {
    min-height: 40px;
    padding: 0.55rem 0.95rem;
    font-size: 0.9rem;
}

.button-tiny {
    min-height: 34px;
    padding: 0.42rem 0.78rem;
    font-size: 0.78rem;
}

.button-full {
    width: 100%;
}

.button-danger {
    color: #fff;
    background: #93281f;
    border-color: #93281f;
    box-shadow: none;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1.2rem;
    margin: 1.5rem 0 0;
    padding: 0;
    color: var(--olive-dark);
    font-size: 0.9rem;
    font-weight: 800;
    list-style: none;
}

.hero-points li::before {
    margin-right: 0.45rem;
    color: var(--terracotta);
    content: "✦";
}

.hero-visual {
    position: relative;
    width: min(100%, 470px);
    margin: 0 auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(92, 64, 51, 0.16);
    border-radius: 36px 36px 36px 10px;
    box-shadow: var(--shadow);
    transform: rotate(0.6deg);
    overflow: visible;
}

.hero-visual::before {
    position: absolute;
    z-index: -1;
    inset: -18px 14% 14% -18px;
    background: rgba(74, 107, 58, 0.13);
    border-radius: 45% 55% 34% 66%;
    content: "";
}

.watercolour-scene {
    position: relative;
    min-height: clamp(390px, 52vw, 560px);
    overflow: hidden;
    background:
        radial-gradient(ellipse at 18% 10%, rgba(213, 155, 42, 0.23), transparent 34%),
        radial-gradient(ellipse at 86% 44%, rgba(192, 57, 43, 0.15), transparent 31%),
        linear-gradient(145deg, #fffaf2, #efe2ce);
    border-radius: 28px 28px 28px 7px;
}

.watercolour-scene::before,
.watercolour-scene::after {
    position: absolute;
    content: "";
    opacity: 0.45;
    filter: blur(2px);
}

.watercolour-scene::before {
    width: 64%;
    height: 44%;
    left: -11%;
    bottom: 8%;
    background: rgba(74, 107, 58, 0.35);
    border-radius: 43% 57% 64% 36% / 52% 44% 56% 48%;
    transform: rotate(11deg);
}

.watercolour-scene::after {
    width: 58%;
    height: 34%;
    right: -16%;
    top: 8%;
    background: rgba(192, 57, 43, 0.17);
    border-radius: 66% 34% 42% 58%;
    transform: rotate(-14deg);
}

.paint-wash,
.paint-sun,
.paint-leaf,
.paint-pencil,
.open-book {
    position: absolute;
    display: block;
}

.paint-wash { opacity: 0.58; filter: blur(5px); }
.paint-wash-gold { width: 72%; height: 21%; top: 22%; left: -8%; background: rgba(213, 155, 42, 0.28); border-radius: 48% 52% 40% 60%; transform: rotate(-8deg); }
.paint-wash-green { width: 64%; height: 26%; right: -16%; bottom: 18%; background: rgba(74, 107, 58, 0.24); border-radius: 55% 45% 61% 39%; transform: rotate(9deg); }

.paint-sun {
    width: clamp(86px, 22%, 120px);
    aspect-ratio: 1;
    top: 12%;
    right: 13%;
    background: rgba(213, 155, 42, 0.52);
    border: 9px solid rgba(255, 250, 242, 0.45);
    border-radius: 50%;
    box-shadow: 0 0 34px rgba(213, 155, 42, 0.28);
}

.paint-leaf {
    width: 58px;
    height: 128px;
    background: rgba(74, 107, 58, 0.58);
    border-radius: 90% 8% 90% 8%;
    box-shadow: 38px 30px 0 rgba(74, 107, 58, 0.34), 7px 71px 0 rgba(74, 107, 58, 0.46);
}

.paint-leaf-one { left: 9%; top: 13%; transform: rotate(-30deg) scale(0.72); }
.paint-leaf-two { right: 8%; bottom: 16%; transform: rotate(148deg) scale(0.6); }

.paint-pencil {
    z-index: 2;
    width: 18px;
    height: 185px;
    right: 23%;
    bottom: 13%;
    background: linear-gradient(90deg, #8f2b21, #c0392b 48%, #8f2b21);
    border-radius: 3px;
    box-shadow: 0 5px 12px rgba(52, 35, 28, 0.18);
    transform: rotate(23deg);
}

.paint-pencil::before {
    position: absolute;
    top: -22px;
    border-right: 9px solid transparent;
    border-bottom: 24px solid var(--wood);
    border-left: 9px solid transparent;
    content: "";
}

.open-book {
    z-index: 3;
    width: 76%;
    height: 31%;
    left: 12%;
    bottom: 12%;
    background: linear-gradient(98deg, #fffdf8 0 49%, #eadfce 49.5% 50.5%, #fffaf2 51% 100%);
    border: 2px solid rgba(92, 64, 51, 0.2);
    border-radius: 8px 8px 28px 28px;
    box-shadow: 0 22px 30px rgba(52, 35, 28, 0.17);
    transform: perspective(500px) rotateX(19deg) rotate(-2deg);
}

.open-book::before,
.open-book::after {
    position: absolute;
    width: 31%;
    height: 3px;
    top: 31%;
    background: rgba(74, 107, 58, 0.28);
    box-shadow: 0 16px 0 rgba(192, 57, 43, 0.2), 0 32px 0 rgba(92, 64, 51, 0.16);
    content: "";
}

.open-book::before { left: 10%; }
.open-book::after { right: 10%; }

.hero-visual figcaption {
    position: absolute;
    right: -7px;
    bottom: 24px;
    max-width: 245px;
    padding: 0.8rem 1rem;
    color: var(--wood);
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-radius: 15px 3px 15px 15px;
    box-shadow: var(--shadow-soft);
    font-size: 0.78rem;
    line-height: 1.45;
}

.hero-visual figcaption span {
    display: block;
    color: var(--terracotta-dark);
    font-weight: 800;
}

.section-heading,
.admin-section-heading,
.panel-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    margin-bottom: 1.75rem;
}

.section-heading > p {
    max-width: 480px;
    margin-bottom: 0.2rem;
    color: var(--muted);
}

.section-heading h2,
.admin-section-heading h2,
.panel-heading h2 {
    margin-bottom: 0;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--terracotta-dark);
    font-weight: 800;
    text-decoration: none;
}

.text-link:hover span {
    transform: translateX(3px);
}

.quick-links-section {
    padding-bottom: 5.5rem;
}

.quick-grid {
    display: grid;
    gap: 1rem;
}

.quick-card {
    position: relative;
    min-height: 255px;
    padding: 1.5rem;
    overflow: hidden;
    color: var(--ink);
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.quick-card::after {
    position: absolute;
    right: -35px;
    bottom: -55px;
    width: 150px;
    height: 150px;
    border: 28px solid currentColor;
    border-radius: 50%;
    opacity: 0.06;
    content: "";
}

.quick-card:hover {
    color: var(--ink);
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.quick-card p {
    color: var(--muted);
}

.quick-card .card-number {
    display: inline-grid;
    width: 40px;
    height: 40px;
    margin-bottom: 2rem;
    place-items: center;
    color: #fff;
    background: var(--olive);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
}

.quick-card-red .card-number { background: var(--terracotta); }
.quick-card-gold .card-number { color: var(--wood-dark); background: #e8bd55; }
.quick-card-wood .card-number { background: var(--wood); }

.news-section {
    padding-block: 5rem;
    color: #fff;
    background-color: var(--wood-dark);
    background-image:
        radial-gradient(circle at 12% 0, rgba(213, 155, 42, 0.16), transparent 28%),
        radial-gradient(circle at 90% 100%, rgba(74, 107, 58, 0.22), transparent 36%);
}

.section-heading-light h2,
.news-card h3,
.empty-state-dark h3 {
    color: #fffaf2;
}

.section-heading-light .eyebrow,
.light-link {
    color: #f3c971;
}

.news-grid {
    display: grid;
    gap: 1rem;
}

.news-card {
    overflow: hidden;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.news-card:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(243, 201, 113, 0.55);
    transform: translateY(-3px);
}

.news-card-link {
    display: flex;
    height: 100%;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.news-card-link:hover {
    color: inherit;
}

.news-card-link:focus-visible {
    outline-color: #f3c971;
    outline-offset: -4px;
}

.news-card-link > img,
.news-card-pattern {
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.news-card-pattern {
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.36);
    background:
        linear-gradient(135deg, rgba(192, 57, 43, 0.35), rgba(74, 107, 58, 0.3)),
        repeating-linear-gradient(45deg, transparent 0 18px, rgba(255, 255, 255, 0.04) 19px 20px);
}

.news-card-pattern span {
    font-family: Georgia, serif;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.news-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.3rem;
}

.news-card-body > p:not(.news-date) {
    color: rgba(255, 255, 255, 0.72);
}

.news-date {
    color: #f3c971;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.news-card-read {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
    padding-top: 0.7rem;
    color: #f3c971;
    font-weight: 800;
}

.news-card-read span {
    transition: transform 160ms ease;
}

.news-card-link:hover .news-card-read span,
.news-card-link:focus-visible .news-card-read span {
    transform: translateX(4px);
}

.news-detail {
    padding-block: clamp(2.5rem, 7vw, 5.5rem);
}

.news-detail-header {
    max-width: 900px;
    margin-bottom: 2rem;
}

.news-detail-header h1 {
    font-size: clamp(2.45rem, 7vw, 4.8rem);
    overflow-wrap: anywhere;
}

.news-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 2rem;
    color: var(--olive-dark);
    font-weight: 800;
    text-decoration: none;
}

.news-back-link:hover {
    color: var(--terracotta-dark);
}

.news-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.news-detail-meta p {
    margin-bottom: 0;
}

.news-detail-layout {
    display: grid;
    gap: 1.2rem;
    max-width: 980px;
}

.news-detail-media {
    width: 100%;
    height: auto;
    min-height: 210px;
    margin: 0;
    overflow: hidden;
    background: var(--wood-dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.news-detail-media img {
    width: 100%;
    max-height: 620px;
    object-fit: cover;
}

.news-detail-media.news-card-pattern {
    height: clamp(240px, 42vw, 460px);
}

.news-detail-content {
    padding: clamp(1.4rem, 5vw, 3rem);
    overflow-wrap: anywhere;
    background: rgba(255, 253, 248, 0.94);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.news-detail-content p {
    margin-bottom: 0;
    font-size: clamp(1rem, 2vw, 1.12rem);
    line-height: 1.85;
}

.news-detail-footer {
    margin-top: 1.5rem;
}

.invitation {
    display: grid;
    gap: 1.25rem;
    align-items: center;
    padding-block: 4.5rem;
}

.invitation-mark {
    display: grid;
    width: 92px;
    height: 92px;
    place-items: center;
    color: var(--terracotta-dark);
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--line);
    border-radius: 26px 4px 26px 26px;
    font-family: Georgia, serif;
    font-size: 2.8rem;
    box-shadow: var(--shadow-soft);
}

.invitation h2,
.invitation p:last-child {
    margin-bottom: 0;
}

.page-hero,
.dashboard-hero,
.admin-hero {
    display: grid;
    gap: 2rem;
    align-items: center;
    padding-block: 3.5rem;
}

.page-hero h1,
.dashboard-hero h1,
.admin-hero h1 {
    font-size: clamp(2.6rem, 7vw, 4.6rem);
}

.crest-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    padding: 1.5rem;
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.crest-panel img {
    width: auto;
    height: 145px;
}

.crest-panel p {
    display: grid;
    margin-bottom: 0;
}

.crest-panel strong {
    color: var(--wood-dark);
    font-family: Georgia, serif;
    font-size: 1.3rem;
}

.crest-panel span {
    color: var(--muted);
}

.content-grid,
.values-grid,
.dashboard-grid {
    display: grid;
    gap: 1rem;
}

.panel {
    padding: 1.4rem;
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.prose-panel {
    padding: clamp(1.5rem, 5vw, 3rem);
}

.prose-panel p:not(.eyebrow) {
    color: var(--muted);
    font-size: 1.02rem;
}

.panel-green {
    background: #eef3e9;
}

.values-section {
    padding-block: 5rem;
}

.values-grid article {
    padding: 1.4rem;
    border-top: 3px solid var(--terracotta);
    background: rgba(255, 255, 255, 0.4);
}

.values-grid article > span {
    color: var(--terracotta-dark);
    font-size: 0.75rem;
    font-weight: 800;
}

.values-grid article p {
    margin-bottom: 0;
    color: var(--muted);
}

.callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem 2rem;
    margin-bottom: 5rem;
    padding: clamp(1.5rem, 5vw, 2.6rem);
    background: var(--paper-strong);
    border-left: 6px solid var(--olive);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.callout h2 {
    margin-bottom: 0;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.library-emblem {
    display: grid;
    min-height: 225px;
    padding: 2rem;
    place-content: center;
    color: #fff;
    background: var(--olive-dark);
    border-radius: 50% 50% 48% 12%;
    box-shadow: var(--shadow);
    transform: rotate(2deg);
}

.library-emblem span {
    color: #f5cc72;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.library-emblem strong {
    font-family: Georgia, serif;
    font-size: 2rem;
    line-height: 1.08;
}

.ebook-grid {
    display: grid;
    gap: 1.25rem;
}

.ebook-card {
    display: grid;
    overflow: hidden;
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.ebook-cover {
    display: grid;
    min-height: 255px;
    align-content: space-between;
    padding: 1.4rem;
    color: #fff;
    background: var(--olive-dark);
    background-image: radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.18), transparent 27%);
}

.ebook-cover-2 { background-color: var(--terracotta-dark); }
.ebook-cover-3 { color: var(--wood-dark); background-color: #e0bd6b; }
.ebook-cover-4 { background-color: var(--wood); }

.ebook-cover span,
.ebook-cover small {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ebook-cover strong {
    max-width: 230px;
    font-family: Georgia, serif;
    font-size: 1.8rem;
    line-height: 1.08;
}

.ebook-cover-image {
    min-height: 0;
    padding: 0;
    background: #e8dfcf;
}

.ebook-cover-image img {
    width: 100%;
    height: 100%;
    min-height: 255px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.ebook-body {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    padding: 1.35rem;
}

.ebook-body > p:not(.meta) {
    color: var(--muted);
}

.ebook-body .button,
.file-unavailable {
    margin-top: auto;
}

.meta,
.file-unavailable {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.empty-state {
    padding: clamp(2rem, 6vw, 4rem);
    text-align: center;
    background: rgba(255, 255, 255, 0.44);
    border: 1px dashed rgba(92, 64, 51, 0.32);
    border-radius: var(--radius);
}

.empty-state h3,
.empty-state p:last-child {
    margin-bottom: 0;
}

.empty-state p:last-child {
    color: var(--muted);
}

.empty-state-dark {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.25);
}

.empty-state-dark p:last-child {
    color: rgba(255, 255, 255, 0.7);
}

.empty-state-compact {
    padding: 1.5rem;
}

.empty-icon {
    margin-bottom: 0.45rem;
    color: var(--terracotta);
    font-size: 2rem;
}

.form-page {
    display: grid;
    gap: 2rem;
    align-items: start;
    padding-block: 3.5rem 5rem;
}

.form-intro {
    position: relative;
}

.form-intro > p:not(.eyebrow) {
    color: var(--muted);
    font-size: 1.06rem;
}

.form-assurance,
.contact-note {
    margin-top: 2rem;
    padding: 1.2rem;
    background: rgba(74, 107, 58, 0.1);
    border-left: 4px solid var(--olive);
    border-radius: 0 var(--radius-small) var(--radius-small) 0;
}

.form-assurance p {
    margin: 0.3rem 0 0;
    color: var(--muted);
}

.login-watercolour-card {
    position: relative;
    display: grid;
    width: min(100%, 410px);
    min-height: 280px;
    place-items: end start;
    overflow: hidden;
    margin-top: 1.5rem;
    padding: 1.4rem;
    color: var(--wood-dark);
    background: linear-gradient(145deg, #fffaf2, #ebddc9);
    border: 8px solid rgba(255, 255, 255, 0.5);
    border-radius: 50% 50% 16px 42%;
    box-shadow: var(--shadow-soft);
}

.login-watercolour-card strong { position: relative; z-index: 4; font-family: Georgia, serif; }
.login-wash { position: absolute; width: 78%; height: 55%; top: -7%; right: -10%; background: rgba(192, 57, 43, 0.17); border-radius: 48% 52% 60% 40%; filter: blur(5px); transform: rotate(12deg); }
.login-branch { position: absolute; width: 150px; height: 42px; left: -18px; top: 68px; background: var(--olive); border-radius: 90% 8%; opacity: 0.55; transform: rotate(-25deg); box-shadow: 52px 35px 0 rgba(74, 107, 58, 0.33), 94px -9px 0 rgba(74, 107, 58, 0.27); }
.login-book { position: absolute; width: 68%; height: 42%; right: 8%; bottom: 18%; background: linear-gradient(96deg, #fffdf8 0 49%, #ddcdb8 50%, #fffaf2 51%); border: 2px solid var(--line); border-radius: 6px 6px 24px 24px; box-shadow: 0 18px 24px rgba(52, 35, 28, 0.14); transform: rotate(-5deg); }

.setup-notice {
    margin: 1rem 0 1.4rem;
    padding: 1rem;
    color: var(--wood-dark);
    background: rgba(213, 155, 42, 0.13);
    border: 1px solid rgba(213, 155, 42, 0.42);
    border-left: 4px solid var(--gold-warm);
    border-radius: var(--radius-small);
}

.setup-notice p { margin: 0.35rem 0 0; font-size: 0.88rem; }
.setup-notice code { overflow-wrap: anywhere; }

.profile-photo-preview {
    width: 112px;
    height: 112px;
    margin-top: 0.45rem;
    object-fit: cover;
    background: #eee5d8;
    border: 4px solid var(--paper-strong);
    border-radius: 50%;
    box-shadow: var(--shadow-soft);
}

.profile-photo-preview[hidden] { display: none; }

form[data-profile-photo-form][data-photo-processing="true"] button[type="submit"] {
    cursor: wait;
    opacity: 0.65;
}

.form-panel {
    padding: clamp(1.3rem, 5vw, 2.25rem);
}

.form-panel > h2 {
    font-size: 2rem;
}

.form-note {
    color: var(--muted);
}

.field,
.field-row {
    display: grid;
    gap: 0.42rem;
}

.form-fieldset {
    min-width: 0;
    margin: 0 0 0.35rem;
    padding: 0;
    border: 0;
}

.form-fieldset legend {
    width: 100%;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    color: var(--terracotta-dark);
    border-bottom: 1px solid var(--line);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.optional-label {
    margin-left: 0.25rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
}

.phone-input-group {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}

.phone-input-group select,
.phone-input-group input {
    min-width: 0;
}

.field {
    margin-bottom: 1.05rem;
}

.field-row {
    grid-template-columns: minmax(0, 1fr);
}

.field label {
    color: var(--wood-dark);
    font-size: 0.88rem;
    font-weight: 800;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    min-height: 48px;
    padding: 0.72rem 0.82rem;
    color: var(--ink);
    background: #fffefb;
    border: 1px solid rgba(92, 64, 51, 0.32);
    border-radius: 11px;
}

.field textarea {
    min-height: 130px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--terracotta);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
    outline: 0;
}

.field input:disabled {
    color: var(--muted);
    background: #eee9e1;
}

.field small {
    color: var(--muted);
    font-size: 0.76rem;
}

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-note ul {
    margin: 0.6rem 0 0;
    padding-left: 1.15rem;
}

.tutorial-contacts-section {
    padding-block: 0 2rem;
}

.tutorial-contact-grid {
    display: grid;
    gap: 1rem;
}

.tutorial-contact-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    padding: 1.2rem;
    border-top: 4px solid var(--olive);
}

.tutorial-contact-card .eyebrow,
.tutorial-contact-card h3,
.tutorial-contact-card p {
    margin-bottom: 0.25rem;
}

.tutorial-contact-card p:last-child {
    overflow-wrap: anywhere;
}

.tutorial-contact-card .button-row {
    grid-column: 1 / -1;
    margin-top: 0.25rem;
}

.tutorial-contact-avatar {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    color: #fff;
    background: var(--terracotta);
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 1.55rem;
}

.whatsapp-button {
    background: #287a4b;
    border-color: #287a4b;
}

.whatsapp-button:hover,
.whatsapp-button:focus-visible {
    background: #1f633d;
    border-color: #1f633d;
}

.calendar-key {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem 1.2rem;
    padding: 1.1rem 1.3rem;
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    box-shadow: var(--shadow-soft);
}

.calendar-key span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 800;
}

.key-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.key-class { background: var(--olive); }
.key-exam { background: var(--terracotta); }

.event-list {
    display: grid;
    gap: 0.9rem;
}

.event-card {
    display: grid;
    gap: 1rem;
    align-items: center;
    padding: 1.2rem;
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-left: 5px solid var(--olive);
    border-radius: var(--radius-small);
    box-shadow: var(--shadow-soft);
}

.event-card:has(.event-badge-exam) {
    border-left-color: var(--terracotta);
}

.event-past {
    opacity: 0.66;
}

.event-date {
    display: grid;
    width: 74px;
    min-height: 88px;
    place-content: center;
    text-align: center;
    background: var(--cream);
    border-radius: 14px;
}

.event-date span,
.event-date small {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.event-date strong {
    color: var(--wood-dark);
    font-family: Georgia, serif;
    font-size: 2rem;
    line-height: 1;
}

.event-main h3,
.event-main > p:last-child {
    margin-bottom: 0;
}

.event-main > p:last-child {
    color: var(--muted);
}

.event-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.event-badge,
.record-type {
    display: inline-flex;
    padding: 0.25rem 0.55rem;
    color: #fff;
    background: var(--olive);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.event-badge-exam { background: var(--terracotta); }
.event-status { color: var(--muted); font-size: 0.76rem; font-weight: 700; }
.event-time { margin-bottom: 0.45rem; color: var(--terracotta-dark); font-size: 0.84rem; font-weight: 800; }
.registered-mark { display: inline-flex; color: var(--olive-dark); font-size: 0.86rem; font-weight: 800; white-space: nowrap; }

.student-chip,
.master-chip {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
}

.student-chip { max-width: 100%; }

.student-chip > span,
.master-chip > span {
    display: grid;
    width: 45px;
    height: 45px;
    place-items: center;
    color: #fff;
    background: var(--olive);
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 1.3rem;
}

.student-avatar {
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
    object-fit: cover;
    border: 2px solid rgba(74, 107, 58, 0.28);
    border-radius: 50%;
}

.grade-badge {
    display: inline-flex;
    width: fit-content;
    padding: 0.3rem 0.62rem;
    color: #fff;
    background: var(--terracotta);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
}

.student-preview-card {
    display: grid;
    gap: 1.15rem;
    align-items: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(232, 222, 195, 0.58));
}

.student-preview-photo img,
.student-preview-photo span {
    display: grid;
    width: 112px;
    height: 112px;
    place-items: center;
    object-fit: cover;
    color: #fff;
    background: var(--olive);
    border: 5px solid rgba(255, 255, 255, 0.86);
    border-radius: 28% 52% 42% 48%;
    box-shadow: var(--shadow-soft);
    font-family: Georgia, serif;
    font-size: 2.5rem;
}

.student-preview-card h2 { margin-bottom: 0.6rem; }
.student-preview-card > div:last-child > p:last-child { margin: 0; color: var(--muted); }

.student-preview-facts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.8rem;
    margin-bottom: 0.75rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.grade-readonly {
    display: grid;
    gap: 0.18rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    background: rgba(74, 107, 58, 0.08);
    border: 1px solid rgba(74, 107, 58, 0.22);
    border-radius: var(--radius-small);
}

.grade-readonly span,
.grade-readonly small { color: var(--muted); }
.grade-readonly span { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.grade-readonly strong { color: var(--olive-dark); font-family: Georgia, serif; font-size: 1.35rem; }
.grade-readonly small { font-size: 0.76rem; }

.master-chip > span { background: var(--terracotta); }

.master-status-stack {
    display: grid;
    width: min(100%, 430px);
    gap: 0.65rem;
    justify-self: center;
}

.admin-control-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    box-shadow: var(--shadow-soft);
}

.admin-control-status > span {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    color: #fff;
    background: var(--olive);
    border-radius: 50%;
    font-weight: 900;
}

.admin-control-status.is-locked > span { background: var(--terracotta); }

.admin-control-status div {
    display: grid;
    line-height: 1.25;
}

.admin-control-status small {
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-control-status strong {
    color: var(--wood-dark);
    font-size: 0.9rem;
}

.student-chip div,
.master-chip div {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.student-chip strong { overflow-wrap: anywhere; }

.student-chip small,
.master-chip small {
    color: var(--muted);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.dashboard-grid {
    align-items: start;
    padding-bottom: 5rem;
}

.dashboard-side {
    display: grid;
    gap: 1rem;
}

.panel-heading h2 {
    font-size: 2rem;
}

.registration-list {
    display: grid;
    gap: 0.75rem;
}

.registration-row {
    display: grid;
    gap: 0.85rem;
    align-items: center;
    padding: 1rem;
    background: var(--cream);
    border-radius: var(--radius-small);
}

.registration-row time {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.registration-row time strong {
    color: var(--terracotta-dark);
    font-family: Georgia, serif;
    font-size: 1.8rem;
}

.registration-row time span,
.registration-row p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.registration-row h3 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.admin-help-banner {
    display: grid;
    gap: 1.2rem;
    margin-bottom: 1.35rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    background:
        radial-gradient(circle at 92% 8%, rgba(213, 155, 42, 0.18), transparent 34%),
        linear-gradient(135deg, rgba(238, 243, 233, 0.95), rgba(255, 253, 248, 0.92));
    border: 1px solid rgba(74, 107, 58, 0.26);
    border-left: 6px solid var(--olive);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.admin-help-banner h2 {
    margin-bottom: 0.6rem;
    font-size: clamp(1.6rem, 4vw, 2.35rem);
}

.admin-help-banner p:last-child {
    max-width: 760px;
    margin-bottom: 0;
    color: var(--muted);
}

.admin-help-key {
    display: grid;
    gap: 0.55rem;
}

.admin-help-key span {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--wood-dark);
    font-size: 0.82rem;
    font-weight: 800;
}

.admin-help-key strong {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    color: #fff;
    background: var(--terracotta);
    border-radius: 50%;
    font-size: 0.72rem;
}

.admin-nav {
    display: flex;
    gap: 0.5rem;
    padding-bottom: 1rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.admin-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.8rem;
    color: var(--wood-dark);
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.admin-nav a span {
    display: grid;
    min-width: 24px;
    min-height: 24px;
    place-items: center;
    color: #fff;
    background: var(--terracotta);
    border-radius: 50%;
    font-size: 0.68rem;
}

.admin-section {
    padding-block: 3.5rem;
    border-top: 1px solid var(--line);
}

.admin-layout {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.admin-editor {
    position: sticky;
    top: 122px;
}

.admin-editor h3,
.admin-security-form h3 {
    font-size: 1.65rem;
}

.bilingual-fields {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.language-fieldset {
    min-width: 0;
    padding: 1rem;
    background: rgba(255, 253, 248, 0.66);
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
}

.language-fieldset legend {
    padding-inline: 0.45rem;
    color: var(--wood-dark);
    font-size: 0.82rem;
    font-weight: 800;
}

.language-fieldset-zh {
    background: rgba(213, 155, 42, 0.08);
    border-color: rgba(143, 91, 22, 0.24);
}

.translation-fallback-note {
    margin: -0.3rem 0 1rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.admin-records {
    display: grid;
    gap: 0.75rem;
}

.admin-record {
    display: grid;
    gap: 1rem;
    padding: 1.1rem;
    background: rgba(255, 253, 248, 0.88);
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
}

.admin-record h3 {
    margin-top: 0.5rem;
    font-size: 1.15rem;
}

.admin-record p,
.admin-record small {
    color: var(--muted);
}

.admin-record p {
    margin-bottom: 0.35rem;
}

.admin-ebook-summary {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.admin-ebook-summary > img {
    width: 72px;
    height: 96px;
    flex: 0 0 72px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.admin-cover-preview {
    width: min(180px, 100%);
    aspect-ratio: 3 / 4;
    margin-bottom: 1rem;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    box-shadow: var(--shadow-soft);
}

.record-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.admin-record > .record-actions,
.student-admin-card > .student-record-actions {
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(92, 64, 51, 0.24);
}

.record-actions form {
    margin: 0;
}

.forced-password {
    border-top: 6px solid var(--terracotta);
}

.unlock-steps {
    display: grid;
    gap: 0.55rem;
    margin: 1.25rem 0 1.5rem;
    padding: 0;
    counter-reset: unlock-step;
    list-style: none;
}

.unlock-steps li {
    position: relative;
    min-height: 34px;
    padding-left: 46px;
    color: var(--muted);
    counter-increment: unlock-step;
}

.unlock-steps li::before {
    position: absolute;
    top: -2px;
    left: 0;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #fff;
    background: var(--terracotta);
    border-radius: 50%;
    content: counter(unlock-step);
    font-size: 0.75rem;
    font-weight: 900;
}

.admin-security-form {
    max-width: 760px;
}

.student-admin-grid {
    display: grid;
    gap: 1rem;
}

.student-account-editor {
    margin-bottom: 1rem;
    border-top: 5px solid var(--terracotta);
}

.student-account-editor-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.1rem;
}

.student-account-editor-heading h3 {
    margin-bottom: 0;
    font-size: 1.65rem;
}

.student-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.student-stat {
    display: grid;
    gap: 0.25rem;
    min-height: 112px;
    align-content: center;
    padding: 1rem;
    background: rgba(255, 253, 248, 0.9);
    border: 1px solid var(--line);
    border-top: 4px solid var(--olive);
    border-radius: var(--radius-small);
    box-shadow: var(--shadow-soft);
}

.student-stat:nth-child(2n) { border-top-color: var(--terracotta); }
.student-stat span { color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.student-stat strong { color: var(--wood-dark); font-family: Georgia, serif; font-size: 2rem; line-height: 1; }

.student-directory-toolbar {
    display: grid;
    gap: 0.85rem;
    align-items: end;
    margin-bottom: 0.8rem;
    padding: 1rem;
}

.student-directory-toolbar .field { margin: 0; }

.student-view-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.student-view-control > span {
    width: 100%;
    color: var(--wood-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.view-button {
    padding: 0.55rem 0.75rem;
    color: var(--wood-dark);
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
}

.view-button.is-active {
    color: #fff;
    background: var(--olive);
    border-color: var(--olive);
}

.student-export { justify-self: start; }
.student-result-count { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.82rem; }
.student-result-count strong { color: var(--wood-dark); }

.student-admin-card { padding: 1.25rem; }

.student-admin-heading {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.student-admin-heading img,
.student-admin-heading > span {
    display: grid;
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    place-items: center;
    object-fit: cover;
    color: #fff;
    background: var(--olive);
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 1.7rem;
}

.student-admin-heading h3 { margin-bottom: 0.2rem; }
.student-admin-heading small { color: var(--muted); }
.student-admin-heading .grade-badge { margin-bottom: 0.45rem; }

.student-details { display: grid; gap: 0; margin: 0; }
.student-details > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 0.65rem; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.student-details dt { color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.student-details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }

.grade-admin-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.grade-admin-form > label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--wood-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.grade-admin-form > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
}

.grade-admin-form select { min-width: 112px; }
.grade-admin-form-table { min-width: 190px; margin: 0; padding: 0; border: 0; }

.student-record-actions {
    margin-top: 0.8rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
}

.student-table-actions {
    min-width: 150px;
}

.table-student {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.table-student img,
.table-student span {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    object-fit: cover;
    color: #fff;
    background: var(--olive);
    border-radius: 50%;
    font-family: Georgia, serif;
}

.student-directory-table td,
.student-directory-table th { vertical-align: middle; }
.student-table-address { min-width: 220px; max-width: 320px; white-space: normal; }

.table-panel {
    padding: 0;
    overflow: hidden;
}

.table-scroll {
    max-width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

th,
td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

thead th {
    color: var(--wood-dark);
    background: #eee5d8;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

tbody tr:nth-child(even) {
    background: rgba(245, 239, 230, 0.5);
}

.site-footer {
    color: rgba(255, 255, 255, 0.77);
    background: #241812;
}

.footer-inner {
    display: grid;
    gap: 1.5rem;
    padding-block: 2.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.footer-brand img {
    width: auto;
    height: 60px;
}

.footer-brand strong {
    color: #fffaf2;
    font-family: Georgia, serif;
    font-size: 1.15rem;
}

.footer-brand p,
.copyright {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.1rem;
}

.site-footer nav a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.84rem;
    text-decoration: none;
}

.site-footer nav a:hover {
    color: #f3c971;
}

@media (min-width: 620px) {
    .quick-grid,
    .news-grid,
    .values-grid,
    .ebook-grid,
    .tutorial-contact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .field-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .event-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .event-action {
        grid-column: 2;
    }

    .registration-row {
        grid-template-columns: 110px minmax(0, 1fr) auto;
    }

    .admin-record {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .record-actions {
        align-self: center;
        justify-content: flex-end;
    }

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

    .student-preview-card { grid-template-columns: auto minmax(0, 1fr); }
    .student-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .student-directory-toolbar { grid-template-columns: minmax(0, 1.35fr) minmax(180px, 0.8fr); }
    .student-view-control,
    .student-export { align-self: end; }
}

@media (min-width: 760px) {
    .page-shell,
    .header-inner,
    .footer-inner {
        width: min(calc(100% - 64px), var(--shell));
    }

    .hero,
    .page-hero,
    .dashboard-hero,
    .admin-hero,
    .form-page {
        grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    }

    .registration-page {
        grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
    }

    .field-row-three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .registration-page .phone-input-group {
        grid-template-columns: minmax(210px, 0.95fr) minmax(180px, 1.05fr);
    }

    .admin-help-banner {
        grid-template-columns: minmax(0, 1.45fr) minmax(230px, 0.55fr);
        align-items: center;
    }

    .hero {
        padding-block: 4.5rem 6rem;
    }

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

    .invitation {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .ebook-card {
        grid-template-columns: 42% minmax(0, 1fr);
    }

    .ebook-cover {
        min-height: 340px;
    }

    .ebook-cover-image img { min-height: 340px; }

    .event-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .event-action {
        grid-column: auto;
    }

    .footer-inner {
        grid-template-columns: minmax(260px, 1fr) auto;
        align-items: center;
    }

    .copyright {
        grid-column: 1 / -1;
    }
}

@media (min-width: 900px) {
    .header-inner {
        min-height: 112px;
        flex-wrap: nowrap;
    }

    .brand img {
        height: 98px;
    }

    .brand strong {
        font-size: 1.3rem;
    }

    .site-nav {
        width: auto;
        align-items: center;
        flex-direction: row;
        gap: 0.1rem;
        padding: 0;
        border-top: 0;
        margin-left: auto;
        order: 2;
    }

    .header-controls {
        order: 3;
    }

    .site-nav a,
    .site-nav .link-button {
        width: auto;
        padding: 0.55rem 0.62rem;
        text-align: center;
    }

    .site-nav a.is-current {
        box-shadow: inset 0 -3px 0 var(--terracotta);
    }

    .site-nav .nav-sign-in {
        margin-left: 0.2rem;
        padding-inline: 0.9rem;
        border-radius: 999px;
    }

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

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

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

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

    .dashboard-grid {
        grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.7fr);
    }

    .admin-layout {
        grid-template-columns: minmax(310px, 0.72fr) minmax(0, 1.28fr);
    }

    .student-stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .student-directory-toolbar { grid-template-columns: minmax(260px, 1.4fr) minmax(180px, 0.75fr) auto auto; }
}

@media (min-width: 1120px) {
    .site-nav a,
    .site-nav .link-button {
        padding-inline: 0.75rem;
        font-size: 0.92rem;
    }
}

.human-check {
    padding: 1rem;
    background: rgba(213, 155, 42, 0.1);
    border: 1px solid rgba(143, 91, 22, 0.24);
    border-radius: var(--radius-small);
}

.human-check label {
    color: var(--wood-dark);
    font-weight: 800;
}

.human-check input {
    max-width: 9rem;
    background: var(--paper-strong);
}

.form-privacy-note {
    margin: 0.2rem 0 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.security-report-strip {
    padding-top: 1rem;
}

.security-report-strip .panel {
    border-left: 5px solid var(--gold-warm);
}

.security-report-strip h2 {
    font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.policy-consent {
    padding: 0.9rem 1rem;
    background: rgba(74, 107, 58, 0.08);
    border: 1px solid rgba(74, 107, 58, 0.2);
    border-radius: var(--radius-small);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.checkbox-label input {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
    margin-top: 0.25rem;
    accent-color: var(--olive-dark);
}

.checkbox-label label {
    margin: 0;
    font-weight: 700;
}

.checkbox-label p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.legal-hero {
    align-items: center;
}

.legal-meta {
    display: grid;
    gap: 0.15rem;
    align-self: center;
    padding: 1.15rem 1.3rem;
    color: var(--wood-dark);
    background: rgba(255, 253, 248, 0.78);
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    box-shadow: var(--shadow-soft);
}

.legal-meta span {
    color: var(--muted);
    font-size: 0.9rem;
}

.legal-page {
    display: grid;
    gap: 2rem;
    padding-bottom: clamp(4rem, 8vw, 7rem);
}

.legal-summary {
    border-top: 5px solid var(--olive);
}

.legal-summary h2 {
    font-size: clamp(1.8rem, 4vw, 2.65rem);
}

.legal-content {
    max-width: 840px;
    padding: clamp(1.25rem, 4vw, 2.4rem);
    background: rgba(255, 253, 248, 0.76);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.legal-content h2 {
    margin-top: 2.15rem;
    padding-top: 1.6rem;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    border-top: 1px solid var(--line);
}

.legal-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.legal-content h3 {
    margin-top: 1.25rem;
    font-size: 1.2rem;
}

.legal-content li + li {
    margin-top: 0.4rem;
}

@media (min-width: 900px) {
    .legal-page {
        grid-template-columns: minmax(250px, 0.62fr) minmax(0, 1.38fr);
        align-items: start;
    }

    .legal-summary {
        position: sticky;
        top: 136px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media print {
    .site-header,
    .site-footer,
    .button,
    .admin-nav,
    .record-actions,
    .event-action {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    .panel,
    .event-card,
    .admin-record {
        box-shadow: none;
    }
}
