/* =====================================================================
   SMM HSA Volunteer Portal — app.css
   ---------------------------------------------------------------------
   The static design system, served as one cached, versioned file (it
   used to be ~50KB of inline <style> re-sent with every page). Only the
   admin-derived color tokens stay inline, in views/partials/theme_head.php.

   Design language: elements of the J4M5 Design System (ui.j4m5.com),
   themed for St. Margaret Mary Catholic School —
     • Figtree throughout, in several weights (labels = Figtree caps).
     • Matte "print" surfaces with a fine risograph grain, over a warm
       mineral paper canvas — never pure white.
     • Halftone "offset ink" behind print cards instead of hard shadows.
     • Clear acrylic glass only for floating chrome (header, tab bar,
       sheets) — glass never sits on glass.
     • Organic, slightly asymmetric radii; pill-shaped controls.
     • School forest green is the single dominant gem; Knights gold is
       the accent ink (offsets, rules, focus).
   ===================================================================== */

/* ---------------------------------------------------------------------
   Fonts — self-hosted (SIL OFL; licenses alongside the files). No
   third-party font request on any page.
   --------------------------------------------------------------------- */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/memo/figtree-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/memo/figtree-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/memo/figtree-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/memo/figtree-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 800; font-display: swap; src: url('/assets/fonts/memo/figtree-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: italic; font-weight: 400; font-display: swap; src: url('/assets/fonts/memo/figtree-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'DM Serif Display'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/memo/dm-serif-display-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Serif Display'; font-style: italic; font-weight: 400; font-display: swap; src: url('/assets/fonts/memo/dm-serif-display-latin-400-italic.woff2') format('woff2'); }

/* ---------------------------------------------------------------------
   Static tokens (the color tokens come from theme_head.php)
   --------------------------------------------------------------------- */
:root {
    --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --body-font: var(--font);
    --heading-font: var(--font);
    --serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;

    /* Hairlines replace the old 2px ink borders; depth comes from
       material (grain, halftone offset) rather than heavy outlines. */
    --hairline: color-mix(in srgb, var(--text) 15%, transparent);
    --hairline-strong: color-mix(in srgb, var(--text) 26%, transparent);
    --border-w: 1px;

    /* Overprint inks — the halftone dots behind print cards. */
    --overprint: color-mix(in srgb, var(--forest) 55%, transparent);
    /* Watercolor paper texture (neutral; multiplied over the paper colour). */
    --paper-tile: url(/assets/img/art/paper-tile.webp);
    --overprint-gold: color-mix(in srgb, var(--gold) 80%, transparent);

    /* Organic, asymmetric radii (J4M5: card / tile / control / pill). */
    --radius: 18px;
    --r-card: 26px 20px 28px 18px / 20px 26px 18px 28px;
    --r-tile: 16px 12px 18px 12px / 12px 16px 12px 18px;
    --r-control: 13px 11px 13px 11px / 11px 13px 11px 13px;
    --r-pill: 999px;

    /* Kept for older call sites: a soft solid offset in place of the
       old hard ink shadow. */
    --lift: 3px 4px 0 color-mix(in srgb, var(--forest) 18%, transparent);
    --lift-sm: 2px 3px 0 color-mix(in srgb, var(--forest) 16%, transparent);
    --lift-gold: 3px 4px 0 var(--gold);
    --lift-gold-sm: 2px 3px 0 var(--gold);

    /* Risograph grain — a tiny tiled SVG noise, multiplied over paper. */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .14 0 0 0 0 .12 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");

    /* Acrylic glass for floating chrome. */
    --glass: color-mix(in srgb, var(--surface) 62%, transparent);
    --glass-strong: color-mix(in srgb, var(--surface) 82%, transparent);
    --glass-edge: color-mix(in srgb, var(--surface) 65%, var(--text) 8%);
    --glass-sheen: linear-gradient(180deg, color-mix(in srgb, #fff 32%, transparent), transparent 55%);
    --glass-shadow: 0 10px 30px -12px rgba(18, 28, 23, 0.28), 0 2px 6px -2px rgba(18, 28, 23, 0.12);
}
@media (prefers-color-scheme: dark) {
    :root {
        --hairline: color-mix(in srgb, var(--text) 13%, transparent);
        --hairline-strong: color-mix(in srgb, var(--text) 24%, transparent);
        --overprint: color-mix(in srgb, var(--forest) 70%, transparent);
        --paper-tile: none;
        --overprint-gold: color-mix(in srgb, var(--gold) 60%, transparent);
        --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 .95 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
        --glass-sheen: linear-gradient(180deg, color-mix(in srgb, #fff 7%, transparent), transparent 55%);
        --glass-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.6), 0 2px 6px -2px rgba(0, 0, 0, 0.4);
        --lift: 3px 4px 0 color-mix(in srgb, var(--forest) 45%, transparent);
        --lift-sm: 2px 3px 0 color-mix(in srgb, var(--forest) 40%, transparent);
    }
}

/* ---------------------------------------------------------------------
   Base
   --------------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--canvas);
    background-image: var(--grain);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
    font-family: var(--font);
    color: var(--heading);
    line-height: 1.15;
}
h1 { font-weight: 800; letter-spacing: -0.025em; }
h2 { font-weight: 700; letter-spacing: -0.015em; }
h3, h4 { font-weight: 700; letter-spacing: -0.005em; }
strong, b { font-weight: 700; }
.tabular, time, td { font-variant-numeric: tabular-nums; }

/* J4M5's "label": small caps-style eyebrow. Figtree here, not a slab. */
.label, .eyebrow {
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
}
.page-title {
    font-weight: 800;
    font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--heading);
}
.page-lede { color: var(--muted); font-size: 1.02rem; max-width: 62ch; }

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
    border-radius: 6px;
}
::selection { background: color-mix(in srgb, var(--gold) 45%, transparent); }

.skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 100;
    padding: 0.6rem 1rem; border-radius: var(--r-pill);
    background: var(--forest); color: var(--on-primary); font-weight: 700;
}
.skip-link:focus { top: 0.75rem; }

/* ---------------------------------------------------------------------
   Print surfaces (cards)
   A .card is a matte "print": paper color with grain, a hairline edge,
   and a halftone offset (the risograph's second ink, slightly out of
   register) sitting behind it. .card--flat drops the offset (cards
   inside lists, cards on cards). .card--primary uses gold ink.
   --------------------------------------------------------------------- */
.card {
    background-color: var(--surface);
    background-image: var(--grain), var(--paper-tile);
    background-size: auto, 512px 512px;
    background-blend-mode: normal, multiply;
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
}
/* :where() keeps this at zero specificity, so a Tailwind .fixed/.absolute
   on the same element still wins. */
:where(.card) { position: relative; }
.card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    transform: translate(6px, 7px);
    background-image: radial-gradient(circle at center, var(--overprint) 0 1.25px, transparent 1.6px);
    background-size: 4.5px 4.5px;
    opacity: 0.8;
    pointer-events: none;
}
.card--flat::after, .card .card::after, dialog .card::after, .no-offset::after,
.card.fixed::after, .card.absolute::after, .card.sticky::after { display: none; }
/* overflow:hidden would clip the halftone, so those cards get a quiet
   solid offset in the same ink instead. */
.card.overflow-hidden::after { display: none; }
.card.overflow-hidden:not(.card--flat) { box-shadow: 4px 5px 0 color-mix(in srgb, var(--forest) 22%, transparent); }
.card.fixed { box-shadow: var(--glass-shadow); }
.card--primary, .card--attention { border-color: color-mix(in srgb, var(--gold) 70%, transparent); }
.card--primary::after, .card--attention::after {
    background-image: radial-gradient(circle at center, var(--overprint-gold) 0 1.15px, transparent 1.45px);
}
/* A glass card — only for content floating over other content. */
.card--glass {
    background: var(--glass-strong);
    background-image: var(--glass-sheen);
    -webkit-backdrop-filter: blur(18px) saturate(1.35);
    backdrop-filter: blur(18px) saturate(1.35);
    box-shadow: var(--glass-shadow);
}
.card--glass::after { display: none; }
/* Floating notices (push opt-in, app update): never carry the overprint. */
.toast-card::after { display: none !important; }
.tile { border-radius: var(--r-tile); }

/* ---------------------------------------------------------------------
   Buttons — pills. Primary is the forest "gem" with a gold offset ink
   that closes when pressed (J4M5's press interaction).
   --------------------------------------------------------------------- */
.btn,
.btn-primary,
.btn--primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 46px;
    padding-inline: 1.15rem;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.005em;
    border-radius: var(--r-pill);
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 90ms ease, box-shadow 90ms ease, background-color 120ms ease, color 120ms ease;
}
.btn {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--hairline-strong);
    box-shadow: 2px 3px 0 color-mix(in srgb, var(--text) 14%, transparent);
}
.btn:hover { background: color-mix(in srgb, var(--forest) 7%, var(--surface)); }
.btn:active { transform: translate(2px, 3px); box-shadow: 0 0 0 transparent; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:disabled:active { transform: none; }
.btn--quiet, .btn--ghost { background: transparent; box-shadow: none; border-color: var(--hairline); }
.btn--quiet:active, .btn--ghost:active { transform: none; }
.btn--block { width: 100%; }
.btn--danger { background: var(--danger-bg); color: #fff; border-color: var(--danger-bg); box-shadow: 2px 3px 0 color-mix(in srgb, var(--danger-bg) 40%, transparent); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger-bg) 88%, black); }
.btn--sm { min-height: 38px; padding-inline: 0.85rem; font-size: 0.85rem; }
@media (pointer: coarse) { .btn--sm { min-height: 44px; } }
.btn--icon { width: 44px; padding: 0; border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%; }

.btn-primary,
.btn--primary {
    background-color: var(--forest);
    color: var(--on-primary);
    border: 1px solid color-mix(in srgb, var(--forest) 70%, black);
    box-shadow: 3px 4px 0 var(--gold);
}
.btn-primary:hover,
.btn--primary:hover { background-color: var(--forest-dark); color: var(--on-primary); filter: none; }
.btn-primary:active,
.btn--primary:active { transform: translate(3px, 4px); box-shadow: 0 0 0 var(--gold); }
.btn-primary:disabled,
.btn--primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary:disabled:active,
.btn--primary:disabled:active { transform: none; box-shadow: 3px 4px 0 var(--gold); }

@media (prefers-reduced-motion: reduce) {
    .btn, .btn-primary, .btn--primary { transition: none; }
    .btn:active, .btn-primary:active, .btn--primary:active { transform: none; }
}

/* ---------------------------------------------------------------------
   Badges — gem washes: deep ink on a light wash of the same gem.
   --------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.6rem;
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: var(--surface-2);
    color: var(--text);
    white-space: nowrap;
}
.badge--pending, .badge--gold { background: color-mix(in srgb, var(--gold) 28%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 55%, transparent); color: color-mix(in srgb, var(--gold) 35%, var(--text)); }
.badge--ok { background: color-mix(in srgb, var(--success) 16%, var(--surface)); border-color: color-mix(in srgb, var(--success) 40%, transparent); color: var(--success); }
.badge--danger { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.badge--forest { background: color-mix(in srgb, var(--forest) 13%, var(--surface)); border-color: color-mix(in srgb, var(--forest) 35%, transparent); color: var(--heading); }
.badge--birthday { background: color-mix(in srgb, var(--gold) 28%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 55%, transparent); font-size: 0.68rem; padding: 0.05rem 0.5rem; }

/* A sticker — the only rotated thing in the system. A watercolor blob
   (assets/img/art/sticker-*.webp) stretched under the label; the flat
   colour stays as the fallback. */
.sticker {
    display: inline-block;
    padding: 0.32rem 0.85rem;
    border-radius: 14px 18px 12px 16px / 16px 12px 18px 14px;
    background: var(--gold) url(../img/art/sticker-gold.webp) center / 100% 100% no-repeat;
    color: #1C2420;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transform: rotate(-2.5deg);
    box-shadow: 2px 2px 0 color-mix(in srgb, var(--text) 20%, transparent);
}
.sticker--r { transform: rotate(2deg); }
.sticker { box-shadow: none; filter: drop-shadow(1px 2px 0 color-mix(in srgb, var(--text) 14%, transparent)); }
.sticker--green { background-color: #16402D; background-image: url(../img/art/sticker-green.webp); color: #F5F3EE; }
.sticker--sage { background-color: #A9C2A8; background-image: url(../img/art/sticker-sage.webp); }
@supports (background-blend-mode: multiply) {
    /* The image carries the colour; drop the flat fill so the blob's
       organic edge shows instead of a pill. */
    .sticker, .sticker--green, .sticker--sage { background-color: transparent; }
}

/* Empty states: a small watercolor above the message. */
.empty-state { text-align: center; padding: 1.5rem 1rem 2rem; }
.empty-art {
    display: block;
    width: min(13.75rem, 62%);
    height: auto;
    margin: 0 auto 0.85rem;
}

/* Sign-in / register: the campus in watercolor (dusk in dark mode). */
.auth-page { justify-content: flex-start; }
.auth-scene { display: block; width: min(100% + 2rem, 56rem); margin: 0 -1rem -2.25rem; pointer-events: none; }
.auth-scene img { display: block; width: 100%; height: auto; }
@media (min-width: 640px) { .auth-page { justify-content: center; } .auth-scene { margin-top: -2rem; } }


/* Calendar: title + birthday pill sit inline, replacing FullCalendar's
   plain text-node title rendering — see calendar.js's eventContent. */
.fc-event-title-with-badges { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

/* Colored-dot marker (group/calendar identity). */
.dot {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 25%, transparent);
    vertical-align: -1px;
}

/* ---------------------------------------------------------------------
   Form controls — matte wells.
   .app-form styles its descendants; .app-input styles one control
   (many inputs live outside a <form>: filter bars, AJAX modals).
   --------------------------------------------------------------------- */
.app-form input[type='text'],
.app-form input[type='email'],
.app-form input[type='password'],
.app-form input[type='search'],
.app-form input[type='url'],
.app-form input[type='tel'],
.app-form input[type='date'],
.app-form input[type='time'],
.app-form input[type='datetime-local'],
.app-form input[type='number'],
.app-form select,
.app-form textarea,
.app-input {
    min-height: 46px;
    font: inherit;
    color: var(--text);
    background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-control);
    padding: 0.55rem 0.8rem;
    box-shadow: inset 0 1px 2px color-mix(in srgb, var(--text) 8%, transparent);
    transition: border-color 120ms ease, background-color 120ms ease;
}
.app-form input[type='text'],
.app-form input[type='email'],
.app-form input[type='password'],
.app-form input[type='search'],
.app-form input[type='url'],
.app-form input[type='tel'],
.app-form input[type='date'],
.app-form input[type='time'],
.app-form input[type='datetime-local'],
.app-form input[type='number'],
.app-form select,
.app-form textarea { width: 100%; }
/* .app-input deliberately sets NO width — layout utilities own it. */
.app-form input[type='checkbox'], .app-form input[type='radio'] { width: 22px; height: 22px; min-height: 0; accent-color: var(--forest); }
.app-form input:hover, .app-form select:hover, .app-form textarea:hover, .app-input:hover { border-color: color-mix(in srgb, var(--forest) 45%, transparent); }
.app-form input:focus, .app-form select:focus, .app-form textarea:focus, .app-input:focus {
    outline: 3px solid color-mix(in srgb, var(--gold) 75%, transparent);
    outline-offset: 1px;
    border-color: var(--forest);
    background: var(--surface);
}
.app-form input:disabled, .app-form select:disabled, .app-input:disabled { background: var(--surface-2); color: var(--muted); }
.app-form textarea, textarea.app-input { min-height: 6rem; resize: vertical; }
.app-form label { font-weight: 600; }
select.app-input, .app-form select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%235B5A50' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
}
@media (prefers-color-scheme: dark) {
    select.app-input, .app-form select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23AAB0A8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    }
}

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.field .hint { font-size: 0.8rem; color: var(--muted); margin: 0.25rem 0 0; }

/* ---------------------------------------------------------------------
   Flash / alerts — gem washes.
   --------------------------------------------------------------------- */
.flash {
    border: 1px solid var(--hairline);
    border-radius: var(--r-tile);
    padding: 0.8rem 1rem;
    font-weight: 600;
    background: var(--surface);
}
.flash--success {
    background: color-mix(in srgb, var(--success) 13%, var(--surface));
    border-color: color-mix(in srgb, var(--success) 40%, transparent);
    color: var(--success);
}
.flash--error {
    background: color-mix(in srgb, var(--danger) 12%, var(--surface));
    border-color: color-mix(in srgb, var(--danger) 40%, transparent);
    color: var(--danger);
}

/* Site-wide announcement banner (Admin > Site Settings). */
.site-banner { width: 100%; position: relative; z-index: 60; }
.site-banner-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    flex-wrap: wrap;
}
.site-banner-dismiss { margin-left: auto; background: none; border: none; cursor: pointer; opacity: 0.8; padding: 0.25rem; line-height: 1; }
.site-banner-dismiss:hover { opacity: 1; }

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.app-table { width: 100%; border-collapse: collapse; }
.app-table thead th {
    text-align: left;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--hairline-strong);
    padding: 0.65rem 0.9rem;
}
.app-table thead th:first-child,
.app-table tbody td:first-child { padding-left: 1.1rem; }
.app-table thead th:last-child,
.app-table tbody td:last-child { padding-right: 1.1rem; text-align: right; }
.app-table tbody td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--hairline);
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.app-table tbody tr:last-child td { border-bottom: none; }
.app-table tbody tr:hover td { background: color-mix(in srgb, var(--forest) 4%, transparent); }
@media (max-width: 639px) {
    .app-table--responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .app-table--responsive, .app-table--responsive tbody, .app-table--responsive tr, .app-table--responsive td { display: block; width: 100%; }
    .app-table--responsive tr { border-bottom: 1px solid var(--hairline-strong); padding: 0.5rem 0; }
    .app-table--responsive tr:last-child { border-bottom: none; }
    .app-table--responsive td {
        display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
        text-align: right; border-bottom: none !important; padding: 0.35rem 1.1rem !important;
    }
    .app-table--responsive td[data-label]::before {
        content: attr(data-label); font-weight: 700; font-size: 0.7rem; text-transform: uppercase;
        letter-spacing: 0.08em; color: var(--muted); text-align: left;
    }
}
.app-table--scroll-wrap { overflow-x: auto; }

/* ---------------------------------------------------------------------
   Dark-mode-aware replacements for Tailwind's fixed slate utilities.
   --------------------------------------------------------------------- */
.bg-subtle { background-color: var(--surface-2); }
.hover-bg-subtle:hover { background-color: var(--surface-2); }
.text-ink { color: var(--text); }
.hover-text-ink:hover { color: var(--text); }
.text-ink-muted { color: var(--muted); }
.hover-text-ink-muted:hover { color: var(--muted); }
.border-subtle { border-color: var(--hairline) !important; }
.border-ink { border-color: var(--hairline-strong) !important; }

/* Utilities missing from the precompiled tailwind.css bundle. */
.pl-4 { padding-left: 1rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.border-l-4 { border-left-width: 4px; }
.cursor-grab { cursor: grab; }
.cursor-grab:active { cursor: grabbing; }
.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; }

.text-link { color: var(--heading); font-weight: 600; }
.text-link:hover { color: var(--forest-dark); text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-color-scheme: dark) { .text-link:hover { color: var(--forest); } }

/* Selected states (poll options, reactions, providers). */
.is-active-provider { border-color: var(--success) !important; background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.is-selected-option { border-color: var(--forest) !important; background: color-mix(in srgb, var(--forest) 12%, var(--surface)); }
.is-selected-option-text { color: var(--forest-dark); font-weight: 600; }
@media (prefers-color-scheme: dark) { .is-selected-option-text { color: var(--heading); } }
.is-selected-reaction { background: color-mix(in srgb, var(--forest) 15%, var(--surface)); color: var(--forest-dark); font-weight: 600; }
@media (prefers-color-scheme: dark) { .is-selected-reaction { color: var(--heading); } }
.poll-bar-fill { background: color-mix(in srgb, var(--forest) 25%, var(--surface)); }


/* ---------------------------------------------------------------
   Overflow menu (<details>-based) — used for post actions
   (Edit/Delete) and reusable anywhere a small 2-4 item menu is
   needed. Two tiny icon buttons squeezed into a card header could
   easily land under the 44px touch-target target; this
   consolidates them into one properly-sized trigger and gives the
   menu items themselves full-sized touch targets once open,
   rather than two cramped icons fighting for space.
   --------------------------------------------------------------- */
.overflow-menu { position: relative; display: inline-block; }
.overflow-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
}
.overflow-menu-trigger::-webkit-details-marker { display: none; } /* Chrome/Safari's default triangle marker */
.overflow-menu-trigger:hover { background: var(--surface-2); color: var(--text); }
.overflow-menu[open] .overflow-menu-trigger { background: var(--surface-2); color: var(--text); }
.overflow-menu-items {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 20;
    min-width: 10rem;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    box-shadow: var(--lift-sm);
    padding: 0.3rem;
}
.overflow-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 44px;
    padding: 0 0.75rem;
    border-radius: 10px;
    background: none;
    border: none;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    text-align: left;
}
.overflow-menu-item:hover { background: var(--surface-2); }
.overflow-menu-item--danger { color: var(--danger); }
.overflow-menu-item .overflow-menu-icon { width: 1.1rem; text-align: center; color: var(--muted); }
.overflow-menu-item--danger .overflow-menu-icon { color: var(--danger); }
/* ---------------------------------------------------------------
   Admin navigation — a sticky left sidebar at 960px and up, and a
   trigger button + slide-in drawer below it. Replaces an earlier
   horizontally-scrolling pill-chip row: that worked on a phone
   (where "swipe sideways through a short row" is a familiar
   pattern) but had no good desktop equivalent — chips just ran
   off the right edge of the window with nothing to indicate more
   were there, as a wide monitor has no "swipe" gesture at all.
   A sidebar sidesteps the problem entirely rather than trying to
   patch the scroll affordance: desktop has the width to spare for
   a permanent, always-fully-visible list, and mobile gets an
   explicit, discoverable menu instead of an implicit scroll.

   Deliberately NOT reusing .nav-desktop-only/.nav-mobile-only
   here — those are tuned for the header's own flex-row needs, and
   reusing them carelessly for a *different* element (one that
   needs flex-column, not flex-row) is exactly what caused the
   mobile tab bar to silently shrink-wrap in the previous round.
   These are dedicated, single-purpose toggles instead.
   --------------------------------------------------------------- */
.admin-sidebar { display: none; }
.admin-mobile-nav-trigger { display: flex; }
@media (min-width: 960px) {
    .admin-sidebar {
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
        position: sticky;
        top: 5.5rem; /* clears the sticky header pill */
        align-self: start;
        width: 220px;
        flex-shrink: 0;
    }
    .admin-mobile-nav-trigger { display: none; }
}

.admin-rail-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 44px;
    padding: 0 0.85rem;
    border-radius: 10px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.admin-rail-link .admin-rail-icon { width: 1.1rem; text-align: center; flex-shrink: 0; }
.admin-rail-link:hover { color: var(--text); background: var(--surface-2); }
.admin-rail-link.is-current {
    color: var(--on-primary);
    background: var(--forest);
}

/* Mobile: a trigger showing the current section (so there's never
   any doubt which part of Admin is open) plus a hamburger icon,
   opening a <dialog> that slides in from the left — distinct from
   the bottom-sheet "More" menu already used for primary nav, so
   the two don't read as the same control doing two different things. */
.admin-mobile-nav-trigger {
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 48px;
    padding: 0 1rem;
    margin-bottom: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    box-shadow: var(--lift-sm);
    font-weight: 650;
    color: var(--text);
    cursor: pointer;
}
.admin-mobile-nav-trigger .admin-mobile-nav-current { display: flex; align-items: center; gap: 0.6rem; }

#adminNavDrawer {
    border: none;
    margin: 0;
    padding: 0;
    max-width: min(320px, 85vw);
    width: 100%;
    height: 100%;
    max-height: 100vh;
    background: transparent;
}
#adminNavDrawer::backdrop { background: rgba(0, 0, 0, 0.45); }
#adminNavDrawer .admin-drawer-panel {
    height: 100%;
    overflow-y: auto;
    background: var(--surface);
    border-right: 1px solid var(--hairline);
    box-shadow: var(--lift);
    padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
#adminNavDrawer .admin-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
#adminNavDrawer .admin-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
}
#adminNavDrawer .admin-drawer-close:hover { background: var(--surface-2); color: var(--text); }
@media (prefers-reduced-motion: no-preference) {
    #adminNavDrawer[open] .admin-drawer-panel { animation: drawer-in 180ms ease-out; }
}
@keyframes drawer-in {
    from { transform: translateX(-16px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* The shared two-column shell every admin-only page's <main> uses:
   sidebar on the left, that page's own content on the right. On
   mobile this collapses to a single column — the sidebar is
   already display:none below 960px, and the trigger+drawer above
   takes its place instead. */
.admin-layout {
    display: block;
}
@media (min-width: 960px) {
    .admin-layout {
        display: flex;
        align-items: start;
        gap: 2rem;
    }
    .admin-layout > .admin-page-content {
        flex: 1;
        min-width: 0;
    }
}

/* ---------------------------------------------------------------
   Groups page: tab rail (left on desktop, wrapped chips on phones)
   + the roster list. The rail reuses .admin-rail-link so it looks
   exactly like the Admin sidebar; the shell is .admin-layout.
   --------------------------------------------------------------- */
.group-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
}
.group-rail .group-rail-link { border: 1px solid var(--line-soft); min-width: 0; }
.group-rail-divider { display: none; }
.group-rail-new { flex-basis: 100%; }
.group-rail-new summary { cursor: pointer; list-style: none; }
@media (min-width: 960px) {
    .group-rail {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0.3rem;
        position: sticky;
        top: 5.5rem;
        align-self: start;
        width: 240px;
        flex-shrink: 0;
        margin-bottom: 0;
        max-height: calc(100vh - 7rem);
        overflow-y: auto;
    }
    .group-rail .group-rail-link { border: 0; }
    .group-rail-divider { display: block; border: 0; border-top: 1px solid var(--line-soft); margin: 0.4rem 0.5rem; }
}
.roster-list { list-style: none; margin: 0; padding: 0; }
.roster-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--line-soft);
}
.roster-row:last-child { border-bottom: 0; }
.roster-row[hidden] { display: none; }
.roster-avatar {
    width: 2.5rem; height: 2.5rem; border-radius: 9999px; object-fit: cover;
    flex-shrink: 0; background: var(--surface-2);
}
.roster-avatar--initials {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700; color: var(--muted);
}
.roster-main { flex: 1; min-width: 0; }
.roster-name { font-weight: 600; color: var(--text); font-size: 0.95rem; }
.roster-badge {
    display: inline-block; margin-left: 0.4rem; padding: 0 0.45rem; border-radius: 9999px;
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--on-primary); background: var(--forest); vertical-align: middle;
}
.roster-badge--quiet { color: var(--muted); background: var(--surface-2); }
.roster-contact { display: flex; flex-wrap: wrap; gap: 0.1rem 1rem; font-size: 0.85rem; color: var(--muted); }
.roster-contact a { color: inherit; text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.roster-bio { margin-top: 0.2rem; font-size: 0.85rem; color: var(--muted); }

/* ---------------------------------------------------------------
   Feature styles carried over from before this refactor.
   Each fixes a specific real-world bug — see comments.
   --------------------------------------------------------------- */

/* Rendered post content (see views/feed/_post.php) — Tailwind's
   preflight strips default browser list/link styling, so this
   restores just enough for the announcement editor's allowed
   formatting (bold/italic/underline/lists/links/@mentions) to be
   visually legible without pulling in anything unrestricted. */
.rich-content p + p { margin-top: 0.5rem; }
.rich-content ul { list-style: disc; padding-left: 1.5rem; }
.rich-content ol { list-style: decimal; padding-left: 1.5rem; }
.rich-content li + li { margin-top: 0.125rem; }
/* Comfortable reading width for post bodies specifically — the
   feed column itself is wider than this on desktop (it has to be,
   to hold images/attachments/polls at a reasonable size), but
   paragraph text within it stays under ~75 characters per line.
   ch is the right unit here: it's defined as the width of "0" in
   the current font, so this tracks actual line length rather than
   an approximated pixel value that would drift if the font or its
   size ever changed. */
.js-post-content :is(p, li) { max-width: 75ch; }

.rich-content a:not(.mention-link) {
    color: var(--heading);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}
.rich-content a.mention-link {
    color: var(--heading);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.rich-content a.mention-link:hover { text-decoration: underline; }

/* Compose editor (TipTap) placeholder — matches the class/attribute
   names @tiptap/extension-placeholder actually renders. */
#composeEditor .is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    color: var(--muted);
    pointer-events: none;
    float: left;
    height: 0;
}
#composeEditor { cursor: text; }
/* Mobile Safari/Chrome apply their own default focus indicator to
   contenteditable elements with role="textbox" (which TipTap sets)
   — Tailwind's focus:outline-none only clears the `outline`
   property, which isn't always the mechanism these browsers use,
   so this explicitly covers every way a focus ring could render. */
#composeEditor,
#composeEditor:focus,
#composeEditor .ProseMirror,
#composeEditor .ProseMirror:focus,
#composeEditor .ProseMirror-focused {
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}
#composeEditor ul { list-style: disc; padding-left: 1.5rem; }
#composeEditor ol { list-style: decimal; padding-left: 1.5rem; }
#composeEditor p.is-empty:first-child { margin: 0; }

.editor-toolbar-btn {
    width: 1.85rem;
    height: 1.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid transparent;
    color: var(--muted);
    font-size: 0.75rem;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.editor-toolbar-btn:hover { background-color: var(--surface-2); color: var(--text); }
.editor-toolbar-btn.is-active {
    background-color: color-mix(in srgb, var(--forest) 12%, var(--surface));
    border-color: var(--line);
    color: var(--heading);
}

.mention-suggestion-popup {
    position: absolute;
    z-index: 60;
    min-width: 180px;
    max-height: 220px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--lift-sm);
    padding: 0.25rem;
}
.mention-suggestion-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    border-radius: 8px;
    color: var(--text);
    font-weight: 500;
}
.mention-suggestion-item:hover,
.mention-suggestion-item.is-selected { background-color: color-mix(in srgb, var(--forest) 12%, var(--surface)); }
.mention-suggestion-empty { padding: 0.5rem 0.625rem; font-size: 0.8125rem; color: var(--muted); }


/* ---------------------------------------------------------------------
   Navigation breakpoint: 960px (not Tailwind's md) — see nav.php.
   !important is deliberate: these are visibility toggles that must win
   over a component's own display.
   --------------------------------------------------------------------- */
.nav-desktop-only { display: none !important; }
.nav-mobile-only { display: flex !important; }
@media (min-width: 960px) {
    .nav-desktop-only { display: flex !important; }
    .nav-mobile-only { display: none !important; }
}

@media (max-width: 959px) {
    body { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
    /* Keep a focused composer/comment field clear of the fixed tab bar. */
    #composeEditor,
    .js-comment-input { scroll-margin-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)); }
    /* 16px+ stops iOS/Android zooming into a focused field. (This used to
       sit outside the media query because of a stray brace, so it also
       forced 16px on desktop.) */
    input, select, textarea, [contenteditable="true"] { font-size: 16px !important; }
}

/* Never let anything widen the page sideways. `clip`, not `hidden` —
   hidden would break position:sticky on the header. */
html, body { max-width: 100%; overflow-x: clip; }

/* ---------------------------------------------------------------------
   Acrylic glass chrome (header pill, tab bar, sheets)
   --------------------------------------------------------------------- */
.glass,
.masthead {
    background-color: var(--glass);
    background-image: var(--glass-sheen);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid var(--glass-edge);
    box-shadow: var(--glass-shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass, .masthead { background-color: var(--surface); }
}
@media (prefers-reduced-transparency: reduce) {
    .glass, .masthead, .mobile-tab-bar { background-color: var(--surface) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: env(safe-area-inset-top, 0px) max(0.75rem, env(safe-area-inset-right, 0px)) 0 max(0.75rem, env(safe-area-inset-left, 0px));
}
.header-pill {
    max-width: 74rem;
    margin: 0.6rem auto 0;
    border-radius: var(--r-pill);
    padding: 0.4rem 0.5rem 0.4rem 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Brand: the house-and-heart mark + "Home and School Association" with
   "St. Margaret Mary Catholic School" beneath it. */
.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    text-decoration: none;
    color: var(--heading);
}
.brand-mark {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--hairline);
    object-fit: contain;
    padding: 4px;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.brand-title {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.015em;
    color: var(--heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-sub {
    margin-top: 2px;
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-title-short { display: none; }
/* Phones and small tablets: "SMM HSA" instead of the full name. */
@media (max-width: 959px) {
    .brand-mark { width: 36px; height: 36px; }
    .brand-title { font-size: 1.05rem; }
    .brand-title-full { display: none; }
    .brand-title-short { display: inline; }
    .brand-sub { font-size: 0.7rem; letter-spacing: 0; text-transform: none; font-weight: 600; }
}
@media (max-width: 360px) {
    .brand-sub { font-size: 0.64rem; }
}
/* Older templates still use these two. */
.brand-badge { background-color: var(--forest); }
.text-brand { color: var(--forest); }
.wordmark { font-weight: 800; font-size: 1.15rem; color: var(--heading); text-decoration: none; white-space: nowrap; }

.topnav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 40px;
    border-radius: var(--r-pill);
    padding: 0.3rem 0.85rem;
    font-weight: 600;
    font-size: 0.93rem;
    color: var(--muted);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.topnav-link:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.topnav-link.is-current {
    color: var(--on-primary);
    background: var(--forest);
    box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent);
}

.header-icon-btn,
.header-account-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%;
    border: 1px solid var(--hairline);
    background: var(--surface);
    color: var(--text);
    font-weight: 800;
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
}
.header-icon-btn:hover, .header-account-btn:hover { background: color-mix(in srgb, var(--forest) 9%, var(--surface)); }
.header-account-btn { background: var(--forest); color: var(--on-primary); border-color: transparent; }
.header-account-btn:hover { background: var(--forest-dark); }

/* ---------------------------------------------------------------------
   Mobile tab bar — floating glass pill, 5 slots (News, Calendar,
   Sign-Ups, Groups, More).
   --------------------------------------------------------------------- */
.mobile-tab-bar-wrap {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 0 max(0.75rem, env(safe-area-inset-right, 0px)) max(0.6rem, env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px));
    pointer-events: none;
}
/* Overrides .nav-mobile-only's display:flex (which would shrink-wrap the bar). */
.mobile-tab-bar-wrap.nav-mobile-only { display: block !important; }
@media (min-width: 960px) { .mobile-tab-bar-wrap.nav-mobile-only { display: none !important; } }
.mobile-tab-bar {
    pointer-events: auto;
    max-width: 28rem;
    margin: 0 auto;
    border-radius: 30px;
    background-color: var(--glass-strong);
    background-image: var(--glass-sheen);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid var(--glass-edge);
    box-shadow: var(--glass-shadow);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    padding: 0.3rem;
}
.mobile-tab-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 50px;
    border-radius: 24px;
    color: var(--muted);
    text-decoration: none;
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mobile-tab-item .mobile-tab-icon { font-size: 1.15rem; line-height: 1; }
.mobile-tab-item .mobile-tab-label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-tab-item[aria-current="page"] { color: var(--on-primary); background: var(--forest); }

/* ---------------------------------------------------------------------
   Sheets (More, Search, Memo contents) — native <dialog>.
   --------------------------------------------------------------------- */
.sheet,
#moreSheet {
    border: none;
    padding: 0;
    background: transparent;
    max-width: 28rem;
    width: calc(100% - 1.5rem);
    margin-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    color: var(--text);
}
.sheet::backdrop,
#moreSheet::backdrop { background: rgba(14, 20, 17, 0.42); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sheet-panel,
#moreSheet .more-sheet-panel {
    background-color: var(--surface);
    background-image: var(--grain);
    border: 1px solid var(--hairline);
    border-radius: 26px 22px 26px 22px;
    box-shadow: var(--glass-shadow);
    padding: 0.75rem;
}
#moreSheet .more-sheet-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 50px;
    padding: 0 0.85rem;
    border-radius: 16px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
}
#moreSheet .more-sheet-item:hover { background: var(--surface-2); }
#moreSheet .more-sheet-item[aria-current="page"] { background: color-mix(in srgb, var(--forest) 12%, var(--surface)); color: var(--heading); }
#moreSheet .more-sheet-item .more-sheet-icon { width: 1.5rem; text-align: center; color: var(--muted); }
#moreSheet .more-sheet-divider { border: none; border-top: 1px solid var(--hairline); margin: 0.4rem 0; }
@media (prefers-reduced-motion: no-preference) {
    #moreSheet[open] .more-sheet-panel, .sheet[open] .sheet-panel { animation: sheet-up 200ms cubic-bezier(.2,.8,.2,1); }
}
@keyframes sheet-up {
    from { transform: translateY(14px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ---------------------------------------------------------------------
   Site footer — verse, the school wordmark, copyright.
   --------------------------------------------------------------------- */
.site-footer {
    margin-top: 3.5rem;
    padding: 2.25rem 1rem 2rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--hairline);
}
.site-footer .verse { max-width: 34rem; margin: 0 auto 1.6rem; }
.site-footer .verse blockquote p {
    font-family: var(--serif);
    font-size: 1.12rem;
    line-height: 1.45;
    color: var(--heading);
}
.site-footer .verse figcaption {
    margin-top: 0.45rem;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}
.site-footer .verse figcaption span { margin: 0 0.3rem; color: var(--gold); }
.footer-logo { display: block; width: 168px; max-width: 60%; height: auto; margin: 0 auto 0.85rem; }
.footer-sprig { display: block; width: 9rem; height: auto; margin: 0.9rem auto 0.6rem; opacity: 0.95; }
.footer-rule {
    width: 44px; height: 3px; margin: 0 auto 1.4rem; border-radius: 3px;
    background: var(--gold);
}
.site-footer button, .site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }


/* Admin > Site Settings: banner icon / color preset pickers. Real
   radio inputs (keyboard + screen-reader friendly) visually hidden
   behind a tappable face; the checked one gets a ring. */
.banner-choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.banner-choice { position: relative; cursor: pointer; }
.banner-choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.banner-choice-face {
    display: flex; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0 0.85rem;
    border-radius: 10px; border: 2px solid var(--line-soft); font-size: 0.8rem; font-weight: 600;
    color: var(--text); background: var(--surface);
}
.banner-choice-face--color { border-color: transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
.banner-choice-tick { visibility: hidden; }
.banner-choice input:checked + .banner-choice-face { outline: 3px solid var(--forest); outline-offset: 2px; }
.banner-choice input:checked + .banner-choice-face .banner-choice-tick { visibility: visible; }
.banner-choice input:focus-visible + .banner-choice-face { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Desktop account menu: the summary is the round initials button. */
details.overflow-menu > summary.header-account-btn { list-style: none; }
details.overflow-menu > summary.header-account-btn::-webkit-details-marker { display: none; }


/* =====================================================================
   The Monday Memo (views/monday_memo/public.php, archive.php)
   ---------------------------------------------------------------------
   A printed-newsletter feel, worthy of the school: a nameplate between
   gold rules, a numbered "In this issue" contents, numbered stories in
   a two-column magazine flow, serif headlines (DM Serif Display) over
   Figtree body copy. Paper is a print card with grain + halftone.
   Getting around: a sticky contents rail on wide screens; elsewhere a
   floating glass "Contents" button that opens the list as a sheet.
   ===================================================================== */
body.memo-page {
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.68;
}
.memo-page strong, .memo-page b { font-weight: 700; }
.memo-page .btn-primary { font-weight: 700; }

.memo-shell {
    max-width: 62rem;
    margin: 0 auto;
    padding: max(1.25rem, env(safe-area-inset-top, 0px)) 1rem 1rem;
}
@media (min-width: 1200px) {
    .memo-shell.has-rail {
        max-width: 80rem;
        display: grid;
        grid-template-columns: 15.5rem minmax(0, 1fr);
        gap: 2.5rem;
        align-items: start;
    }
}

/* ---------- The paper ---------- */
.memo-paper {
    position: relative;
    background-color: var(--surface);
    background-image: var(--grain), var(--paper-tile);
    background-size: auto, 512px 512px;
    background-blend-mode: normal, multiply;
    border: 1px solid var(--hairline);
    border-radius: 34px 26px 38px 24px / 26px 34px 24px 38px;
    padding: clamp(1.4rem, 4vw, 3.25rem) clamp(1.1rem, 4.5vw, 3.5rem) clamp(1.4rem, 3vw, 2.5rem);
}
.memo-paper::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    transform: translate(8px, 10px);
    background-image: radial-gradient(circle at center, var(--overprint-gold) 0 1.3px, transparent 1.65px);
    background-size: 5px 5px;
    opacity: 0.75;
    pointer-events: none;
}

/* ---------- Masthead / nameplate ---------- */
.memo-masthead { position: relative; isolation: isolate; text-align: center; margin-bottom: 1.1rem; }
.memo-masthead.has-season { padding-top: clamp(1.6rem, 5vw, 2.6rem); }
.memo-wordmark { display: block; width: min(13.5rem, 58%); height: auto; margin: 0 auto 0.7rem; }
.memo-kicker {
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.15rem;
}
.memo-nameplate {
    font-family: var(--serif);
    font-size: clamp(2.6rem, 1.6rem + 5vw, 4.6rem);
    line-height: 1;
    letter-spacing: -0.015em;
    color: var(--heading);
    margin: 0 0 0.35rem;
}
.memo-from {
    font-style: italic;
    font-size: clamp(0.86rem, 0.8rem + 0.25vw, 0.98rem);
    color: var(--muted);
    margin: 0 0 0.1rem;
}
.memo-double-rule {
    height: 6px;
    border-top: 2px solid var(--gold);
    border-bottom: 1px solid var(--gold);
    max-width: 34rem;
    margin: 0 auto;
}
.memo-issue-title {
    font-family: var(--serif);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.65rem);
    letter-spacing: 0;
    color: var(--heading);
    margin: 0 0 0.1rem;
}
.memo-issue-line {
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.memo-issue-line span { margin: 0 0.35rem; color: var(--gold); }
/* Archive heading reuses this. */
.memo-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem);
    letter-spacing: -0.01em;
    line-height: 1.05;
    color: var(--heading);
}

/* ---------- Actions ---------- */
.memo-actions { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 1.75rem; }
@media (min-width: 1200px) { .memo-shell.has-rail .memo-actions--inline { display: none; } }
.memo-action-btn {
    display: inline-flex; align-items: center; gap: 0.5rem; min-height: 42px; padding: 0 1.05rem;
    font: 700 0.85rem var(--font); color: var(--text); cursor: pointer; text-decoration: none;
    border-radius: 999px; border: 1px solid var(--hairline-strong); background: transparent;
    transition: background-color .15s ease;
}
.memo-action-btn:hover { background: color-mix(in srgb, var(--forest) 8%, transparent); }
.memo-action-btn .fas { color: var(--gold); }

/* ---------- "In this issue" ---------- */
.memo-contents {
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    padding: 1.1rem 0 1.2rem;
    margin: 0 0 2rem;
}
.memo-contents-title, .memo-rail-title {
    font-family: var(--font);
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--heading);
    margin: 0 0 0.6rem;
}
.memo-contents-title { text-align: center; }
.memo-contents-list { list-style: none; margin: 0; padding: 0; }
.memo-contents > .memo-contents-list { columns: 1; column-gap: 2.5rem; }
@media (min-width: 640px) { .memo-contents > .memo-contents-list { columns: 2; } }
.memo-contents-list li { break-inside: avoid; }
.memo-contents-list a {
    display: flex; align-items: baseline; gap: 0.75rem;
    padding: 0.45rem 0.25rem; border-radius: 10px;
    color: var(--text); text-decoration: none; line-height: 1.35;
}
.memo-contents-list a:hover { background: color-mix(in srgb, var(--forest) 7%, transparent); }
.memo-contents-list a:hover .memo-contents-text { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--gold); }
.memo-contents-num {
    font-family: var(--serif);
    font-size: 1.05rem;
    color: var(--gold);
    min-width: 1.6rem;
    font-variant-numeric: lining-nums tabular-nums;
}
.memo-contents-text { font-weight: 600; font-size: 0.98rem; }

/* Desktop rail */
.memo-rail { display: none; }
@media (min-width: 1200px) {
    .memo-rail {
        display: block;
        position: sticky;
        top: 1.25rem;
        max-height: calc(100vh - 2.5rem);
        overflow-y: auto;
        padding: 1.1rem 0.9rem;
        border-radius: 24px 20px 26px 18px;
        background-color: var(--glass);
        background-image: var(--glass-sheen);
        -webkit-backdrop-filter: blur(18px) saturate(1.4);
        backdrop-filter: blur(18px) saturate(1.4);
        border: 1px solid var(--glass-edge);
        box-shadow: var(--glass-shadow);
    }
    .memo-rail .memo-rail-title { padding-left: 0.4rem; }
    .memo-contents-list--rail a { font-size: 0.92rem; padding: 0.4rem 0.45rem; }
    .memo-contents-list--rail .memo-contents-text { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
    .memo-contents-list--rail a[aria-current] { background: color-mix(in srgb, var(--forest) 11%, transparent); }
    .memo-contents-list--rail a[aria-current] .memo-contents-text { color: var(--heading); }
    .memo-rail-actions { display: grid; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--hairline); }
    .memo-rail-actions .memo-action-btn { justify-content: center; }
}

/* Floating Contents button + sheet (phones, tablets, narrow desktops) */
.memo-fab {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    z-index: 45;
    display: inline-flex; align-items: center; gap: 0.5rem;
    min-height: 50px; padding: 0 1.2rem;
    font: 700 0.92rem var(--font); color: var(--text); cursor: pointer;
    border-radius: 999px;
    background-color: var(--glass-strong);
    background-image: var(--glass-sheen);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid var(--glass-edge);
    box-shadow: var(--glass-shadow);
}
.memo-fab .fas { color: var(--gold); }
.memo-fab[hidden] { display: none; }
@media (min-width: 1200px) { .has-rail ~ .memo-fab { display: none; } }
@media (prefers-reduced-motion: no-preference) {
    .memo-fab:not([hidden]) { animation: memo-fab-in 220ms cubic-bezier(.2,.8,.2,1); }
}
@keyframes memo-fab-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.memo-sheet .sheet-panel { padding: 1rem 0.85rem 0.85rem; max-height: min(75vh, 40rem); overflow-y: auto; }
.memo-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0.3rem 0.35rem; }
.memo-sheet-close {
    width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer;
}
.memo-sheet-close:hover { background: var(--surface-2); color: var(--text); }
.memo-contents-list--sheet a { min-height: 46px; align-items: center; }
.memo-sheet-top {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 46px;
    margin-top: 0.4rem; border-top: 1px solid var(--hairline); font-weight: 700; font-size: 0.9rem;
    color: var(--muted); text-decoration: none;
}

/* ---------- Body: two-column magazine flow ---------- */
.memo-columns { column-gap: 3rem; counter-reset: memo-story; }
@media (min-width: 768px) {
    .memo-columns { column-count: 2; column-rule: 1px solid var(--hairline); }
}
.memo-full { column-span: all; break-inside: avoid; margin-bottom: 1.75rem; }
.memo-full--label { margin-bottom: 0.35rem; }
/* A dates list that belongs to the story above it (e.g. "Save the dates"
   under a lunch-packing story) stays in that story's column. */
.memo-story .memo-substory { clear: both; margin-top: 1.1rem; }
.memo-story .memo-substory .memo-eyebrow { margin-bottom: 0.1rem; }
.memo-story > .memo-dates { clear: both; }
.memo-story { break-inside: avoid-column; margin-bottom: 2rem; }
.memo-entry + .memo-entry { margin-top: 0.85rem; }

/* Story headline: a small gold numeral, then the serif headline. The
   numbers match "In this issue" (only story headings carry an id). */
.memo-heading,
.memo-copy h2 {
    display: block;
    font-family: var(--serif);
    font-weight: 400;
    font-style: normal;
    font-size: clamp(1.45rem, 1.25rem + 0.7vw, 1.75rem);
    line-height: 1.15;
    letter-spacing: -0.005em;
    color: var(--heading);
    margin: 0 0 0.6rem;
    scroll-margin-top: 1.25rem;
}
.memo-heading[id]::before,
.memo-copy h2[id]::before {
    counter-increment: memo-story;
    content: "No. " counter(memo-story, decimal-leading-zero);
    display: block;
    font-family: var(--font);
    font-weight: 800;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.35rem;
}
.memo-copy h3 {
    font-family: var(--font);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.3;
    color: var(--heading);
    margin: 1em 0 0.3em;
}
.memo-copy h2:first-child, .memo-copy h3:first-child { margin-top: 0; }

/* Section labels ("Weekly Calendar", "Dates to Note") — a label with a
   hairline running out to the edge. */
.memo-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-family: var(--font);
    font-weight: 800;
    font-size: 0.74rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--heading);
    margin: 0;
}
.memo-eyebrow::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--gold) 70%, transparent); }

/* Lead story: a serif drop cap on its first paragraph. */
.memo-story--lead .memo-copy > p:first-of-type::first-letter {
    float: left;
    font-family: var(--serif);
    font-size: 3.4em;
    line-height: 0.82;
    padding: 0.06em 0.1em 0 0;
    color: var(--heading);
}

/* rich_text copy (sanitized p/strong/em/u/ul/ol/li/a/h2/h3). */
.memo-copy { color: var(--text); }
.memo-copy p { margin-bottom: 0.7em; }
.memo-copy p:last-child { margin-bottom: 0; }
.memo-copy ul { list-style: disc; padding-left: 1.25rem; margin: 0.5em 0 0.8em; }
.memo-copy ol { list-style: decimal; padding-left: 1.25rem; margin: 0.5em 0 0.8em; }
.memo-copy li { margin-bottom: 0.3em; }
.memo-copy li::marker { color: var(--gold); }
.memo-copy a { color: var(--heading); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--gold) 80%, transparent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.memo-copy a:hover { color: var(--forest-dark); }
/* A lone-link paragraph renders as a button INSIDE .memo-copy — these
   selectors outrank ".memo-copy a" so its label stays readable. */
.memo-copy a.btn-primary,
.memo-copy a.btn-primary:hover { color: var(--on-primary); text-decoration: none; }

/* Pull-quotes (mission statement, prayer) */
.memo-quote {
    position: relative;
    border-left: 2px solid var(--gold);
    padding: 0.15rem 0 0.15rem 1.25rem;
    margin: 0.25rem 0;
}
.memo-quote-mark {
    font-family: var(--serif);
    font-size: 3rem;
    line-height: 0;
    color: var(--gold);
    vertical-align: -0.6rem;
    margin-right: 0.2rem;
}
.memo-quote-text {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.08rem, 0.98rem + 0.45vw, 1.28rem);
    line-height: 1.5;
    color: var(--heading);
}

/* Weekly calendar / dates to note: a tidy two-column table. */
.memo-dates { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.memo-dates li {
    display: grid;
    grid-template-columns: 5.4rem minmax(0, 1fr);
    gap: 0.9rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--hairline);
    font-size: 0.97rem;
    line-height: 1.45;
}
.memo-dates li:last-child { border-bottom: 0; }
.memo-date-day { display: flex; align-items: baseline; gap: 0.4rem; white-space: nowrap; }
.memo-date-dow { font-weight: 700; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); width: 1.9rem; }
.memo-date-md { font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; }
.memo-date-text { color: var(--text); }
@media (max-width: 420px) {
    .memo-dates li { grid-template-columns: 1fr; gap: 0.1rem; }
}

/* Images and media */
/* Each entry contains its own floated photo with a clearfix -- not
   overflow:hidden (clipped buttons, and stories split across columns in
   print) and not flow-root (a new formatting context sits beside the
   story's spot art as a narrow column instead of letting the text wrap
   around it and fill the space underneath). */
.memo-entry::after { content: ""; display: table; clear: both; }
.memo-copy > .text-center.memo-entry::after { clear: none; }
.memo-copy .btn-primary { max-width: 100%; white-space: normal; text-align: center; }
.memo-inline-figure { margin: 0 0 0.5rem 0; }
.memo-inline-figure--left { float: left; margin-right: 1rem; }
.memo-inline-figure--right { float: right; margin-left: 1rem; }
.memo-inline-img { width: 42%; min-width: 110px; max-width: 200px; border-radius: 20px 16px 22px 14px; }
/* Watercolor art (Core\MemoArt). Each piece is painted on the memo's own
   paper colour with an organic silhouette: in light mode it melts into
   the page; in dark mode it reads as a pasted-in watercolor print. */
.memo-ornament {
    display: block;
    width: min(12.5rem, 50%);
    height: auto;
    margin: 0.55rem auto 0.6rem;
}
/* The season band is a quiet backdrop behind the logo and nameplate:
   pinned to the top of the paper, faded out downward and at the sides. */
.memo-season {
    position: absolute;
    z-index: -1;
    top: calc(-1 * clamp(1.4rem, 4vw, 3.25rem));
    left: 50%;
    translate: -50% 0;
    width: min(100% + 2rem, 40rem);
    max-width: none;
    height: auto;
    margin: 0;
    opacity: 0.42;
    pointer-events: none;
    -webkit-mask-image: radial-gradient(ellipse 70% 95% at 50% 0%, #000 45%, transparent 100%);
            mask-image: radial-gradient(ellipse 70% 95% at 50% 0%, #000 45%, transparent 100%);
}
@media (min-width: 768px) { .memo-season { opacity: 0.3; } }
@media (prefers-color-scheme: dark) {
    .memo-season { opacity: 0.16; }
    .memo-spot { filter: drop-shadow(5px 6px 0 color-mix(in srgb, var(--overprint-gold) 55%, transparent)); }
    .memo-ornament { filter: brightness(1.45) saturate(0.9); }
}
.memo-spot {
    float: right;
    width: clamp(5.5rem, 22vw, 8rem);
    height: auto;
    margin: 0.15rem 0 0.6rem 0.9rem;
    shape-outside: margin-box;
}
.memo-story.has-spot::after { content: ""; display: block; clear: both; }
.memo-story--lead.has-spot .memo-spot { width: clamp(6.5rem, 26vw, 9.5rem); }

/* Flyers and embedded PDFs get room to breathe from the buttons/text
   above them and the next story below. */
.memo-media { margin: 1.75rem auto 1.25rem; text-align: center; }
.memo-media:first-child { margin-top: 0; }
.memo-media + .memo-media { margin-top: 1.5rem; }
.memo-media figcaption { margin-top: 0.4rem; }
.memo-media--half { width: 100%; }
.memo-media--quarter { width: 60%; margin-inline: auto; }
.memo-media-img { width: 100%; border-radius: 28px 22px 30px 20px / 22px 28px 20px 30px; }
.memo-pdf-embed { width: 100%; border-radius: 18px; border: 1px solid var(--hairline); background: var(--surface-2); }
.memo-pdf-embed--full { height: min(80vh, 900px); }
.memo-pdf-embed--half { height: 480px; }
.memo-pdf-embed--quarter { height: 300px; }
.memo-entry img.w-full { border-radius: 22px 18px 24px 16px; }

/* Colophon */
.memo-colophon { text-align: center; margin-top: 1.5rem; font-size: 0.82rem; color: var(--muted); }
.memo-colophon .memo-double-rule { margin-bottom: 1rem; }
.memo-colophon p + p { margin-top: 0.35rem; }
.memo-colophon a { color: var(--heading); font-weight: 700; text-decoration: none; }
.memo-colophon a:hover { text-decoration: underline; }

/* ---------- Archive (views/monday_memo/archive.php) ---------- */
.archive-shell { max-width: 50rem; margin: 0 auto; padding: max(1.5rem, env(safe-area-inset-top, 0px)) 1rem 1rem; }
.archive-head { text-align: center; margin-bottom: 2rem; }
.archive-years { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem; margin: 1.1rem 0 0; }
.archive-years a {
    min-height: 38px; display: inline-flex; align-items: center; padding: 0 0.95rem; border-radius: 999px;
    border: 1px solid var(--hairline-strong); font-weight: 700; font-size: 0.85rem; color: var(--text); text-decoration: none;
    font-variant-numeric: tabular-nums;
}
.archive-years a:hover { background: color-mix(in srgb, var(--forest) 8%, transparent); }
.archive-year { margin-bottom: 2.25rem; scroll-margin-top: 1rem; }
.archive-year-title {
    display: flex; align-items: center; gap: 1rem;
    font-family: var(--serif); font-weight: 400; font-size: 2.1rem; color: var(--heading);
    margin-bottom: 0.25rem; font-variant-numeric: lining-nums;
}
.archive-year-title::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--gold) 70%, transparent); }
.archive-month { margin-top: 1.1rem; }
.archive-month-title { font-weight: 800; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.archive-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.archive-item {
    position: relative;
    display: grid;
    grid-template-columns: 4.25rem minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.15rem;
    text-decoration: none;
    color: inherit;
    top: 0; left: 0;
    /* Lift with top/left, not transform: a transform makes the card its own
       stacking context, which pulls the halftone ::after (z-index -1) in
       front of the card's paper. */
    transition: top .14s ease, left .14s ease;
}
.archive-item:hover { top: -3px; left: -2px; }
.archive-item:hover::after { transform: translate(8px, 10px); }
.archive-date {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 4.25rem; height: 4.25rem;
    border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%;
    background: color-mix(in srgb, var(--forest) 10%, var(--surface));
    color: var(--heading);
}
.archive-date-mon { font-weight: 800; font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.archive-date-day { font-family: var(--serif); font-size: 1.75rem; line-height: 1; font-variant-numeric: lining-nums; }
.archive-item-title { font-family: var(--serif); font-size: 1.3rem; line-height: 1.2; color: var(--heading); }
.archive-item-stories { margin-top: 0.25rem; font-size: 0.88rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.archive-item-arrow { color: var(--gold); }
.archive-item .sticker { position: absolute; top: -0.65rem; right: 1rem; }
@media (max-width: 479px) {
    .archive-item { grid-template-columns: 3.6rem minmax(0, 1fr); padding: 0.9rem 1rem; }
    .archive-date { width: 3.6rem; height: 3.6rem; }
    .archive-date-day { font-size: 1.45rem; }
    .archive-item-arrow { display: none; }
}

/* ---------- Print / Save as PDF — matches the page ---------- */
@page { size: letter; margin: 0.5in; }
@media print {
    html, body { background: #fff !important; }
    body { padding: 0 !important; }
    body.memo-page { font-size: 10.5pt; line-height: 1.5; background-image: none !important; }
    body.memo-page, body.memo-page * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .memo-rail, .memo-fab, .memo-sheet, .memo-actions, .site-banner, .no-print, .site-footer, .skip-link { display: none !important; }
    .memo-shell, .memo-shell.has-rail { display: block; max-width: none; padding: 0; }
    .memo-paper { border: 0; padding: 0; background: none; }
    .memo-paper::after, .card::after { display: none; }
    .memo-contents { margin-bottom: 1rem; }
    .memo-columns { column-count: 2; column-gap: 1.75rem; }
    /* Long stories may flow across columns and pages; only small units stay whole. */
    .memo-story, .memo-entry { break-inside: auto; }
    .memo-entry.text-center, .memo-copy > .text-center, .memo-quote:not(.memo-quote--long), .memo-media, .memo-dates li, .memo-inline-figure, .memo-spot { break-inside: avoid; }
    .memo-full { break-inside: auto; }
    .memo-copy p { orphans: 3; widows: 3; }
    .memo-heading, .memo-copy h2, .memo-copy h3, .memo-eyebrow { break-after: avoid; }
    .memo-copy a { text-decoration: none; }
    .memo-copy a.btn-primary { box-shadow: none !important; }
    .memo-pdf-embed { display: none; }
    .memo-masthead.has-season { padding-top: 0.25in; }
    .memo-season { top: 0; width: 6.5in; opacity: 0.35; filter: none; }
    .memo-spot { width: 0.85in; filter: none; }
    .memo-ornament { width: 1.8in; filter: none; }
}
.memo-quote--long .memo-quote-text { font-family: var(--font); font-size: 1.02rem; line-height: 1.65; color: var(--text); }
.memo-quote--long .memo-quote-mark { font-size: 2.4rem; }

/* =====================================================================
   Search (views/search/index.php)
   ===================================================================== */
.search-form { position: relative; display: flex; gap: 0.5rem; align-items: center; }
.search-form-icon { position: absolute; left: 1.05rem; color: var(--muted); pointer-events: none; }
.search-input { flex: 1; min-width: 0; min-height: 54px !important; padding-left: 2.7rem !important; border-radius: 999px !important; font-size: 1.05rem; }
.search-submit { min-height: 54px !important; padding-inline: 1.4rem !important; }
@media (max-width: 479px) { .search-submit { padding-inline: 1rem !important; } }
.search-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.25rem 0 1.5rem; }
.search-filter {
    display: inline-flex; align-items: center; gap: 0.45rem; min-height: 40px; padding: 0 0.95rem; border-radius: 999px;
    border: 1px solid var(--hairline-strong); font-weight: 700; font-size: 0.88rem; color: var(--text); text-decoration: none;
}
.search-filter:hover { background: color-mix(in srgb, var(--forest) 8%, transparent); }
.search-filter.is-current { background: var(--forest); color: var(--on-primary); border-color: var(--forest); }
.search-filter-count { font-size: 0.75rem; font-weight: 800; opacity: 0.75; font-variant-numeric: tabular-nums; }
.search-section { margin-bottom: 2rem; }
.search-section-title { display: flex; align-items: center; gap: 0.55rem; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--heading); margin-bottom: 0.6rem; }
.search-section-title .fas { color: var(--gold); }
.search-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.search-result {
    display: grid; gap: 0.2rem; padding: 0.9rem 1.1rem; text-decoration: none; color: inherit;
    background-color: var(--surface); background-image: var(--grain);
    border: 1px solid var(--hairline); border-radius: var(--r-tile);
    position: relative; top: 0;
    transition: border-color .15s ease, top .12s ease;
}
.search-result:hover { border-color: color-mix(in srgb, var(--forest) 45%, transparent); top: -1px; }
.search-result--event { grid-template-columns: 3.4rem minmax(0, 1fr); gap: 0.9rem; align-items: start; }
.search-result--event > span:last-child { display: grid; gap: 0.15rem; }
.search-result-title { font-weight: 700; color: var(--heading); }
.search-result-meta { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.search-result-snippet { font-size: 0.93rem; color: var(--text); line-height: 1.5; }
.search-result mark, .search-result-title mark { background: color-mix(in srgb, var(--gold) 40%, transparent); color: inherit; border-radius: 3px; padding: 0 0.1em; }
.search-date {
    display: flex; flex-direction: column; align-items: center; justify-content: center; width: 3.4rem; height: 3.4rem;
    border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%; background: color-mix(in srgb, var(--forest) 10%, var(--surface));
    font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold);
}
.search-date strong { font-size: 1.25rem; letter-spacing: 0; color: var(--heading); line-height: 1; }
.kbd { display: inline-block; min-width: 1.4em; padding: 0 0.35em; border: 1px solid var(--hairline-strong); border-bottom-width: 2px; border-radius: 6px; font: 700 0.8rem var(--font); text-align: center; }

/* =====================================================================
   Calendar — FullCalendar themed to match (views/calendar/index.php).
   Its toolbar arrows are an icon font loaded as a data: URL; the CSP's
   font-src now allows data:, which is what had made them vanish.
   ===================================================================== */
#calendar {
    --fc-border-color: var(--hairline);
    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: color-mix(in srgb, var(--surface-2) 70%, transparent);
    --fc-list-event-hover-bg-color: color-mix(in srgb, var(--forest) 7%, transparent);
    --fc-today-bg-color: color-mix(in srgb, var(--gold) 14%, transparent);
    --fc-event-border-color: transparent;
    --fc-now-indicator-color: var(--danger);
    --fc-small-font-size: 0.8rem;
    font-size: 0.95rem;
}
#calendar .fc-toolbar.fc-header-toolbar { margin-bottom: 1.1rem; gap: 0.6rem; flex-wrap: wrap; }
#calendar .fc-toolbar-title { font-family: var(--font); font-weight: 800; font-size: clamp(1.15rem, 1rem + 0.8vw, 1.55rem); letter-spacing: -0.02em; color: var(--heading); }
#calendar .fc-button {
    min-height: 42px; padding: 0 0.95rem; border-radius: 999px !important; border: 1px solid var(--hairline-strong) !important;
    background: var(--surface) !important; color: var(--text) !important; box-shadow: none !important;
    font: 700 0.88rem var(--font); text-transform: none; text-shadow: none;
}
#calendar .fc-button:hover { background: color-mix(in srgb, var(--forest) 8%, var(--surface)) !important; }
#calendar .fc-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
#calendar .fc-button:disabled { opacity: 0.45; }
#calendar .fc-button-group { gap: 0.3rem; }
#calendar .fc-prev-button, #calendar .fc-next-button { width: 42px; padding: 0; }
#calendar .fc-button-active, #calendar .fc-button-primary:not(:disabled).fc-button-active {
    background: var(--forest) !important; color: var(--on-primary) !important; border-color: var(--forest) !important;
}
#calendar .fc-today-button { margin-left: 0.4rem; }
#calendar .fc-icon { font-size: 1.15em; }

/* Phones: title on its own line, then arrows/today and the view switch. */
@media (max-width: 639px) {
    #calendar .fc-header-toolbar { display: grid !important; grid-template-columns: auto auto; justify-content: space-between; }
    #calendar .fc-header-toolbar .fc-toolbar-chunk:nth-child(2) { grid-column: 1 / -1; order: -1; text-align: center; }
    #calendar .fc-button { min-height: 44px; padding: 0 0.75rem; }
    #calendar .fc-prev-button, #calendar .fc-next-button { width: 44px; }
}

/* List view */
#calendar .fc-list { border: 0; }
#calendar .fc-list-day-cushion {
    background: transparent; padding: 1rem 0.25rem 0.35rem;
    font-weight: 800; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--heading);
}
#calendar .fc-list-day-cushion a { color: inherit; text-decoration: none; }
#calendar .fc-list-day > th { border-bottom: 1px solid color-mix(in srgb, var(--gold) 60%, transparent) !important; }
#calendar .fc-list-event td { padding: 0.75rem 0.4rem; border-color: var(--hairline); }
#calendar .fc-list-event-time { color: var(--muted); font-size: 0.85rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
#calendar .fc-list-event-title a { color: var(--text); font-weight: 600; text-decoration: none; }
#calendar .fc-list-event:hover .fc-list-event-title a { color: var(--heading); }
#calendar .fc-list-event { cursor: pointer; }
#calendar .fc-list-empty { background: transparent; color: var(--muted); }
@media (max-width: 479px) {
    #calendar .fc-list-event-time { white-space: normal; width: 4.6rem; font-size: 0.78rem; }
}

/* Month + week grids */
#calendar .fc-scrollgrid { border-radius: 16px; overflow: hidden; }
#calendar .fc-col-header-cell-cushion { padding: 0.5rem 0; font-weight: 800; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
#calendar .fc-daygrid-day-number { font-weight: 700; font-size: 0.85rem; color: var(--text); text-decoration: none; padding: 0.35rem 0.5rem; }
#calendar .fc-day-today .fc-daygrid-day-number { background: var(--forest); color: var(--on-primary); border-radius: 999px; min-width: 1.75rem; text-align: center; margin: 0.25rem; padding: 0.15rem 0.45rem; }
#calendar .fc-daygrid-event { border-radius: 8px; padding: 1px 4px; font-weight: 600; font-size: 0.78rem; }
#calendar .fc-daygrid-more-link { font-weight: 700; color: var(--heading); }
#calendar .fc-timegrid-event { border-radius: 8px; }
#calendar .fc-popover { background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--glass-shadow); }
#calendar .fc-popover-header { background: var(--surface-2); border-radius: 14px 14px 0 0; }

/* Calendar filter bar — a quiet row, not a heavy card. */
.cal-filters { display: grid; gap: 0.6rem; }
@media (min-width: 768px) { .cal-filters { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.cal-filter-search { position: relative; }
.cal-filter-search .fas { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cal-filter-search input { padding-left: 2.6rem; border-radius: 999px; }
.cal-filter-selects { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.cal-filter-selects select { flex: 1 1 9rem; border-radius: 999px; }
@media (min-width: 768px) { .cal-filter-selects select { flex: 0 0 auto; min-width: 10rem; } }
#calendarFilterResultCount { grid-column: 1 / -1; }

/* Tailwind's .hidden loses to component classes that set display (they
   load later at equal specificity), so a "hidden" Clear button showed
   anyway. Two-class selectors win without touching responsive
   utilities like "hidden sm:inline". */
.btn.hidden, .btn-primary.hidden, .card.hidden, .badge.hidden, .flash.hidden, .app-input.hidden { display: none; }

/* Feed reactions: five equal slots that always fit (on a 390px phone
   "Care" used to be clipped off the right edge). */
.react-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.25rem; }
.react-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.35rem;
    min-height: 40px; padding: 0 0.25rem; border-radius: 999px;
    font-size: 0.78rem; font-weight: 600; white-space: nowrap; overflow: hidden;
}
@media (max-width: 400px) {
    .react-btn { flex-direction: column; gap: 0.1rem; font-size: 0.66rem; min-height: 46px; }
}
.prayer-clamp { display: -webkit-box; -webkit-line-clamp: 10; -webkit-box-orient: vertical; overflow: hidden; }
