: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;
}

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);
}

.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);
}

.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: "";
}

.hero-visual img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center 58%;
    border-radius: 28px 28px 28px 7px;
}

.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);
}

.news-card > 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 {
    padding: 1.3rem;
}

.news-card-body > p:last-child {
    margin-bottom: 0;
    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;
}

.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-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);
}

.form-illustration {
    width: min(100%, 400px);
    max-height: 360px;
    margin-top: 1.5rem;
    object-fit: cover;
    object-position: center 46%;
    border: 8px solid rgba(255, 255, 255, 0.5);
    border-radius: 50% 50% 16px 50%;
    box-shadow: var(--shadow-soft);
}

.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;
}

.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;
}

.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 > 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;
}

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

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

.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-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;
}

.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;
}

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

.record-actions form {
    margin: 0;
}

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

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

.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 {
        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;
    }
}

@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);
    }

    .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;
    }

    .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;
    }

    .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);
    }
}

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

@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;
    }
}
