/* Colecroft site styles ("Brick & Blossom").

   The palette comes from the community: the black-and-gold entrance sign,
   Old Town's red brick and mortar, and the cherry blossom in the logo.
   Type: Cinzel (Roman capitals like the sign's carved letters) for the
   wordmark and small labels, Marcellus for headings, Atkinson
   Hyperlegible Next for reading and forms, Tangerine only for the "Old
   Town Alexandria" script the logo carries. All four are self-hosted
   (vendor/fonts; CSP font-src 'self').

   Every colour is a token on :root, redefined once for a dark device
   (prefers-color-scheme; there is no switch). Brick appears in three
   places only: the curb under the header, the arch around the hero photo
   and the footer wall.

   This file holds what every page shares, in this order: fonts, tokens,
   base, the brick and plaque ornaments, layout (header, maintenance
   notice, footer), components (buttons, chips, cards, forms, tabs, tables,
   rich text, alerts), the portal shell, the stand-alone sign-in shell, the
   confirm dialog, small layout helpers and print. Each group of pages has
   its own sheet loaded after this one: public.css (every page: page
   content, home, events, FAQ, errors), auth.css (sign-in pages), docs.css
   (documents), editor.css (signed-in users), portal.css (the /portal
   screens). maintenance.css is the stand-alone maintenance page. */

@font-face {
    font-family: "Atkinson Hyperlegible Next";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../vendor/fonts/atkinson-hyperlegible-next-v7-latin.woff2") format("woff2");
}
@font-face {
    font-family: "Atkinson Hyperlegible Next";
    font-style: italic;
    font-weight: 200 800;
    font-display: swap;
    src: url("../vendor/fonts/atkinson-hyperlegible-next-v7-latin-italic.woff2") format("woff2");
}
@font-face {
    font-family: "Cinzel";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../vendor/fonts/cinzel-v26-latin.woff2") format("woff2");
}
@font-face {
    font-family: "Marcellus";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../vendor/fonts/marcellus-v14-latin.woff2") format("woff2");
}
@font-face {
    font-family: "Tangerine";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../vendor/fonts/tangerine-v18-latin-700.woff2") format("woff2");
}

:root {
    /* Color */
    --paper:        #fcf9f8;   /* petal white, the page ground */
    --surface:      #ffffff;   /* cards, tables, inputs */
    --surface-2:    #f6efed;   /* table heads, wells, hover */
    --ink:          #2b1d1c;   /* the blossom tree's trunk */
    --ink-2:        #6b5956;   /* secondary text */
    --ink-3:        #72605c;   /* captions, placeholders (4.5:1 on the page and on cards) */
    --rule:         #eaddd9;
    --rule-strong:  #d6c4bf;

    --sign:         #1f1d1a;   /* the sign's black: primary actions */
    --sign-hover:   #3a3631;
    --action:       #a8325c;   /* primary buttons: the blossom, deepened */
    --action-hover: #8c2a4d;
    --action-ink:   #ffffff;
    --sign-ink:     #e6c77c;   /* gold leaf on the black */
    --sign-deep:    #7a5c14;   /* deep gold: links and accents on light ground */
    --sign-soft:    #f5edda;   /* pale gold wash */
    --gold:         #c39a3e;   /* rules, focus rings, ornaments */
    --stone:        #f4ead6;   /* limestone: sills and the footer lintel */
    --plaque:       #161411;   /* the sign itself, the same in both themes */
    --plaque-gold:  #d8b35f;

    --blossom:      #e2729a;
    --blossom-deep: #b23a66;
    --blossom-soft: #fbe6ee;

    --brick:        #a4442f;
    --mortar:       #ddcdc2;

    /* Fixed in both themes: text on surfaces that do not follow the theme
       (the stone footer lintel, a button on stone, a photo under its scrim,
       red on the dark selection bar). */
    --stone-ink:    #2b1d1c;
    --lintel-ink:   #3a2a26;   --lintel-head: #8a3a2a;   --lintel-link: #6f5312;
    --on-photo:     #fbf3ef;   --on-photo-2:  #eadcd6;   --on-photo-eyebrow: #ffd3e3;   --on-photo-link: #ffffff;
    --danger-on-ink: #ffb4ab;

    /* Semantic states, kept apart from the brand hues */
    --ok:           #276846;  --ok-soft:     #e2f2e8;
    --warn:         #94600a;  --warn-soft:   #fcf0d6;
    --danger:       #b4261b;  --danger-soft: #fbe5e2;

    --shadow-1: 0 1px 2px rgb(43 29 28 / 0.06), 0 1px 1px rgb(43 29 28 / 0.04);
    --shadow-2: 0 10px 30px -12px rgb(43 29 28 / 0.22), 0 2px 6px rgb(43 29 28 / 0.06);

    --brick-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='44'%3E%3Crect width='120' height='44' fill='%23ddcdc2'/%3E%3Crect x='2' y='2' width='56' height='18' rx='1' fill='%23a4442f'/%3E%3Crect x='62' y='2' width='56' height='18' rx='1' fill='%23933a27'/%3E%3Crect x='-28' y='24' width='56' height='18' rx='1' fill='%23b0503a'/%3E%3Crect x='32' y='24' width='56' height='18' rx='1' fill='%23a14530'/%3E%3Crect x='92' y='24' width='56' height='18' rx='1' fill='%23b0503a'/%3E%3C/svg%3E");

    /* Type */
    --font-display: "Marcellus", "Optima", "Candara", Georgia, serif;
    --font-sign:    "Cinzel", "Trajan Pro", "Optima", Georgia, serif;
    --font-caps:    "Cinzel", "Trajan Pro", "Optima", Georgia, serif;
    --font-body:    "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
    --font-mono:    ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --font-script:  "Tangerine", "Apple Chancery", "URW Chancery L", cursive;

    --fs-xs:   0.8125rem;
    --fs-sm:   0.9375rem;
    --fs-base: 1.0625rem;
    --fs-lg:   1.25rem;
    --fs-xl:   1.625rem;
    --fs-2xl:  2.25rem;
    --fs-3xl:  clamp(2.5rem, 2rem + 2.6vw, 3.75rem);

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;

    --wrap: 72rem;
    --gutter-l: max(16px, env(safe-area-inset-left, 0px));
    --gutter-r: max(16px, env(safe-area-inset-right, 0px));
    --cc-nav-h: 5.5rem;   /* site.js keeps this at the header's real height */

    color-scheme: light;
}

/* Evening in Old Town: warm dark brick, gold lit up, blossoms brighter. */
@media (prefers-color-scheme: dark) {
    :root {
        --paper: #191312; --surface: #221a19; --surface-2: #2b2120;
        --ink: #f3e8e5; --ink-2: #c3b0ab; --ink-3: #a3908c;
        --rule: #3a2d2b; --rule-strong: #4d3c39;
        --sign: #d9b866; --sign-hover: #e8cd86; --sign-ink: #17140f; --sign-deep: #e3c77e; --sign-soft: #352c1a; --gold: #d4ae5a; --stone: #e9dcc2;
        --action: #f08db2; --action-hover: #f5a9c6; --action-ink: #2b1d1c; --blossom: #f08db2; --blossom-deep: #f5a9c6; --blossom-soft: #3b2029;
        --brick: #c0583f; --mortar: #2a201e;
        --ok: #7fd1a1; --ok-soft: #173326; --warn: #f0c062; --warn-soft: #3a2c10; --danger: #ff8f84; --danger-soft: #3d1a17;
        --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
        --shadow-2: 0 14px 34px -14px rgb(0 0 0 / 0.7), 0 2px 6px rgb(0 0 0 / 0.3);
        --brick-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='44'%3E%3Crect width='120' height='44' fill='%23241b19'/%3E%3Crect x='2' y='2' width='56' height='18' rx='1' fill='%236e2e22'/%3E%3Crect x='62' y='2' width='56' height='18' rx='1' fill='%23602719'/%3E%3Crect x='-28' y='24' width='56' height='18' rx='1' fill='%23783426'/%3E%3Crect x='32' y='24' width='56' height='18' rx='1' fill='%23692c20'/%3E%3Crect x='92' y='24' width='56' height='18' rx='1' fill='%23783426'/%3E%3C/svg%3E");
        color-scheme: dark;
    }
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.15;
    margin: 0;
    text-wrap: balance;
    letter-spacing: 0.005em;
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0; }
a { color: var(--sign-deep); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blossom); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--blossom-soft); color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap {
    width: 100%;
    max-width: calc(var(--wrap) + 32px);
    margin-inline: auto;
    padding-left: var(--gutter-l);
    padding-right: var(--gutter-r);
}

.eyebrow {
    font-family: var(--font-caps);
    font-size: var(--fs-sm);
    letter-spacing: 0.14em;
    color: var(--blossom-deep);
}
.lede { font-size: var(--fs-lg); color: var(--ink-2); max-width: 38em; line-height: 1.5; }
.script {
    font-family: var(--font-script);
    font-weight: 700;
    line-height: 0.9;
    color: var(--blossom-deep);
}

/* The blossom mark: five petals, drawn as a mask so it takes any token. */
.blossom-mark {
    display: inline-block;
    width: 1em; height: 1em;
    flex: none;
    background: var(--blossom);
    -webkit-mask: var(--blossom-svg) center / contain no-repeat;
            mask: var(--blossom-svg) center / contain no-repeat;
}
:root {
    --blossom-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-12 -12 24 24'%3E%3Cg%3E%3Cpath id='p' d='M0-1.6C-3.4-3.2-4.6-7.4-2.6-10.2-1.7-11.4-.6-10.6 0-9.6.6-10.6 1.7-11.4 2.6-10.2 4.6-7.4 3.4-3.2 0-1.6Z'/%3E%3Cuse href='%23p' transform='rotate(72)'/%3E%3Cuse href='%23p' transform='rotate(144)'/%3E%3Cuse href='%23p' transform='rotate(216)'/%3E%3Cuse href='%23p' transform='rotate(288)'/%3E%3Ccircle r='1.6'/%3E%3C/g%3E%3C/svg%3E");
}

/* ── Brick ────────────────────────────────────────────────── */
/* A single course of brick under the header, like a curb. */
.curb {
    height: 11px;
    background: var(--brick-pattern) 0 -1px / 60px 22px repeat-x;
    border-top: 1px solid var(--mortar);
}
.brick-wall {
    background: var(--brick) var(--brick-pattern) 0 0 / 120px 44px;
}

/* A doorway arch in brick around a photo (Old Town's Federal doorways). */
.arch {
    position: relative;
    padding: 14px 14px 0;
    background: var(--brick-pattern) center top / 60px 22px;
    border-radius: 50% 50% 0 0 / 34% 34% 0 0;
    box-shadow: var(--shadow-2);
}
.arch img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 4.6;
    object-fit: cover;
    border-radius: 50% 50% 0 0 / 32% 32% 0 0;
}
.arch-sill {
    height: 14px;
    margin: 0 -10px;
    background: var(--stone);
    border-radius: 2px;
    box-shadow: 0 6px 14px -8px rgb(43 29 28 / 0.5);
}

/* ── The sign plaque: black, gold inset rule, gently arched top ── */
.plaque {
    position: relative;
    display: inline-grid;
    place-items: center;
    padding: 1.05em 1.9em 0.85em;
    background: var(--plaque);
    color: var(--plaque-gold);
    font-family: var(--font-sign);
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1;
    /* The top edge is one shallow arc across the whole width, like the sign. */
    border-radius: 50% 50% 3px 3px / 0.75em 0.75em 3px 3px;
    text-shadow: 0 1px 0 rgb(0 0 0 / 0.65), 0 -1px 0 rgb(255 236 190 / 0.18);
    box-shadow: 0 10px 22px -12px rgb(0 0 0 / 0.7);
}
.plaque::before {
    content: "";
    position: absolute;
    inset: 0.32em;
    border: 2px solid var(--plaque-gold);
    border-radius: 50% 50% 2px 2px / 0.6em 0.6em 2px 2px;
    pointer-events: none;
}

/* ── Header ───────────────────────────────────────────────── */
/* A jump to an anchor (the skip link, an event, a question) or a scroll to
   the editor stops below the sticky header; site.js keeps --cc-nav-h. */
html { scroll-padding-top: calc(var(--cc-nav-h) + 1rem); }

.skip-link {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
    position: fixed !important; top: 0.5rem; left: 0.5rem; z-index: 2000;
    width: auto; height: auto; margin: 0; padding: 0.5rem 0.9rem; clip: auto;
    background: var(--surface); color: var(--ink);
    border: 2px solid var(--ink); border-radius: var(--radius-sm);
}

/* The header is .site-nav: site.js measures it, and shrinks it once the
   page scrolls (html.is-scrolled), growing it back at the top. */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.site-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    padding-block: 0.85rem;
    transition: padding 0.3s;
}
.site-nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ink);
    text-decoration: none;
}
.site-nav-logo img { display: block; width: 52px; height: auto; transition: width 0.3s; }
.site-nav-wordmark { display: grid; line-height: 1; }
.site-nav-name { font-family: var(--font-sign); font-weight: 600; font-size: 1.6rem; letter-spacing: 0.04em; }
.site-nav-place {
    margin-top: 0.35rem;
    font-family: var(--font-caps);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    color: var(--ink-2);
}
.site-nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.site-nav-links form { margin: 0; }
.site-nav-link {
    position: relative;
    padding: 0.45rem 0.7rem;
    color: var(--ink-2);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: 500;
    border-radius: 999px;
}
.site-nav-link:hover { color: var(--ink); background: var(--surface-2); }
.site-nav-link.active { color: var(--ink); font-weight: 700; }
/* The page you're on carries the blossom. */
.site-nav-link.active::after {
    content: "";
    position: absolute;
    left: 50%; bottom: -0.3rem;
    width: 0.7rem; height: 0.7rem;
    translate: -50% 0;
    background: var(--blossom);
    -webkit-mask: var(--blossom-svg) center / contain no-repeat;
            mask: var(--blossom-svg) center / contain no-repeat;
}
.site-nav-links .btn { margin-left: 0.4rem; }
.site-nav-links .btn.active { font-weight: 700; }

html.is-scrolled .site-nav-row { padding-block: 0.3rem; }
html.is-scrolled .site-nav-logo img { width: 38px; }
html.is-scrolled .site-nav-place { display: none; }

@media (max-width: 767.98px), (max-height: 500px) {
    /* On a phone, upright or on its side, the sticky bar is compact: the
       links under a smaller logo at the top of the page, and once it
       scrolls, the links alone (the logo, which Home repeats, is back at
       the top), so the bar takes a line or two of the screen. A link's
       room around it is padding, part of what a tap hits. */
    .site-nav-row { gap: 0.25rem 1rem; padding-block: 0.6rem 0.35rem; }
    .site-nav-logo img { width: 40px; }
    .site-nav-name { font-size: 1.35rem; }
    .site-nav-links { width: 100%; gap: 0 0.1rem; margin-inline: -0.5rem; }
    .site-nav-link { padding: 0.4rem 0.55rem; font-size: var(--fs-xs); }
    .site-nav-link.active::after { bottom: -0.15rem; width: 0.55rem; height: 0.55rem; }
    .site-nav-links .btn { margin-left: 0.25rem; }
    html.is-scrolled .site-nav-row { padding-block: 0.15rem; }
    html.is-scrolled .site-nav-logo { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .site-nav-row, .site-nav-logo img { transition: none; }
}

/* Maintenance mode is on: a notice above the page (admins) or on the
   sign-in pages (everyone else). */
.maintenance-banner {
    padding-block: 0.55rem;
    background: var(--warn-soft);
    color: var(--ink);
    border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
    font-size: var(--fs-sm);
}
.maintenance-banner .wrap {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 0.5rem 1rem; text-align: center;
}
.maintenance-banner.is-admin { background: var(--plaque); color: var(--stone); border-bottom-color: var(--plaque); }
.maintenance-banner.is-admin .btn { --btn-bg: var(--stone); --btn-fg: var(--stone-ink); --btn-bd: var(--stone); }

/* ── Page bodies ──────────────────────────────────────────── */
/* site-body: public pages. app-body: signed-in tools without the public
   page's reading column. auth-body: the stand-alone sign-in pages. All
   keep the footer at the bottom of a short page. */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body > main { flex: 1 0 auto; width: 100%; }
main:focus { outline: none; }
.site-content, .app-content {
    max-width: calc(var(--wrap) + 32px);
    margin-inline: auto;
    padding: 2rem var(--gutter-r) 0 var(--gutter-l);
}
.site-flash { margin-bottom: 1.25rem; }

/* ── Footer: a brick wall with the Colecroft sign on it ───── */
.site-footer { margin-top: 5rem; }

.footer-wall { padding-block: 3rem; }
.footer-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem 3rem;
    align-items: center;
}
/* Proportioned like the real sign: about three times as wide as it is tall. */
.footer-plaque { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); padding: 1.5em 1.8em 1.3em; box-shadow: none; }
.footer-lintel {
    background: var(--stone);
    color: var(--lintel-ink);
    border-radius: var(--radius-sm);
    padding: 1.4rem 1.6rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1.25rem 2rem;
    font-size: var(--fs-sm);
    box-shadow: 0 10px 24px -14px rgb(0 0 0 / 0.6);
}
.footer-lintel h2 {
    font-family: var(--font-caps);
    font-size: var(--fs-xs);
    letter-spacing: 0.16em;
    color: var(--lintel-head);
    margin-bottom: 0.45rem;
}
.footer-lintel a { color: var(--lintel-link); }
.footer-lintel ul { list-style: none; margin: 0; padding: 0; columns: 2 7rem; column-gap: 1.5rem; }
.footer-lintel li { padding-block: 0.1rem; break-inside: avoid; }
.footer-base {
    background: var(--plaque);   /* stays dark in both themes, under the brick */
    color: rgb(244 234 214 / 0.75);
    font-size: var(--fs-xs);
}
.footer-base .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 0.85rem; }
@media (max-width: 760px) {
    .footer-inner { grid-template-columns: 1fr; justify-items: center; }
    .footer-lintel { width: 100%; }
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    --btn-bg: var(--surface);
    --btn-fg: var(--ink);
    --btn-bd: var(--rule-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45em;
    min-height: 2.6rem;
    padding: 0.5rem 1.05rem;
    font: 600 var(--fs-sm) / 1.2 var(--font-body);
    color: var(--btn-fg);
    background: var(--btn-bg);
    border: 1px solid var(--btn-bd);
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    white-space: nowrap;
}
.btn:hover { --btn-bd: var(--ink-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--action); --btn-fg: var(--action-ink); --btn-bd: var(--action); }
.btn-primary:hover { --btn-bg: var(--action-hover); --btn-bd: var(--action-hover); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; color: var(--ink-2); }
.btn-ghost:hover { --btn-bg: var(--surface-2); --btn-bd: transparent; color: var(--ink); }
.btn-danger { --btn-fg: var(--danger); --btn-bd: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover { --btn-bg: var(--danger-soft); --btn-bd: var(--danger); }
.btn-sm { min-height: 2.1rem; padding: 0.3rem 0.8rem; font-size: var(--fs-xs); }
.btn-lg { min-height: 2.9rem; padding-inline: 1.3rem; font-size: var(--fs-base); }
.btn-block { width: 100%; }
.btn-icon { width: 2.1rem; min-height: 2.1rem; padding: 0; }
.btn .bi { font-size: 1.05em; }

/* ── Chips: status and access ─────────────────────────────── */
.chip {
    --chip-fg: var(--ink-2);
    --chip-bg: var(--surface-2);
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.15rem 0.6rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1.5;
    color: var(--chip-fg);
    background: var(--chip-bg);
    border-radius: 999px;
    white-space: nowrap;
}
.chip-ok     { --chip-fg: var(--ok);     --chip-bg: var(--ok-soft); }
.chip-warn   { --chip-fg: var(--warn);   --chip-bg: var(--warn-soft); }
.chip-danger { --chip-fg: var(--danger); --chip-bg: var(--danger-soft); }
.chip-sign   { --chip-fg: var(--sign-deep); --chip-bg: var(--sign-soft); }
.chip-dot::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }

/* Who can see a document or page: one consistent vocabulary */
.access { display: inline-flex; align-items: center; gap: 0.35em; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.access-public    { color: var(--ink-2); }
.access-residents { color: var(--sign-deep); }
.access-board     { color: var(--blossom-deep); }

/* ── Cards & panels (used by role, not everywhere) ────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}
.card-pad { padding: 1.4rem 1.5rem; }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--rule);
}
.card-head h2, .card-head h3 { font-size: var(--fs-lg); }
.card-foot {
    display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
    padding: 0.9rem 1.5rem;
    border-top: 1px solid var(--rule);
}
.well {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
}

/* ── Forms ────────────────────────────────────────────────── */
.field { display: grid; gap: 0.35rem; min-width: 0; }
.field > label, .label {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--ink);
}
.hint { font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.45; }
.input, .select, .textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.55rem 0.85rem;
    font: 400 var(--fs-base) / 1.4 var(--font-body);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent);
}
/* Validation: the control carries .is-invalid, the message sits under it
   in a .field-error. */
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.input.is-invalid:focus, .select.is-invalid:focus, .textarea.is-invalid:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent);
}
.check input.is-invalid { outline: 2px solid var(--danger); outline-offset: 1px; }
.field-error { font-size: var(--fs-xs); font-weight: 600; color: var(--danger); line-height: 1.45; }
.select {
    appearance: none;
    padding-right: 2.2rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
    background-position: calc(100% - 1.05rem) 52%, calc(100% - 0.75rem) 52%;
    background-size: 0.3rem 0.3rem;
    background-repeat: no-repeat;
}
.input-sm, .select-sm { min-height: 2.25rem; font-size: var(--fs-sm); padding-block: 0.35rem; }
.textarea { min-height: 7rem; resize: vertical; }
.input-icon { position: relative; }
.input-icon .bi { position: absolute; left: 0.8rem; top: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
.input-icon .input { padding-left: 2.3rem; }

.check { display: flex; align-items: flex-start; gap: 0.6rem; font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; margin: 0.2rem 0 0; accent-color: var(--sign); flex: none; }

/* A toggle switch for on/off settings */
.switch { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; cursor: pointer; }
.switch input {
    appearance: none;
    flex: none;
    width: 2.75rem; height: 1.6rem;
    margin: 0;
    border-radius: 999px;
    background: var(--rule-strong);
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}
.switch input::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: calc(1.6rem - 6px); height: calc(1.6rem - 6px);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-1);
    transition: translate 0.2s;
}
.switch input:checked { background: var(--sign); }
.switch input:checked::after { translate: 1.15rem 0; }

.form-grid { display: grid; gap: 1.1rem 1.25rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

/* ── Tabs & breadcrumbs ───────────────────────────────────── */
.tabs {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    border-bottom: 1px solid var(--rule);
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs a {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.7rem 0.9rem;
    margin-bottom: -1px;
    color: var(--ink-2);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: 600;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--blossom-deep); }
.tabs .count { font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.crumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: var(--fs-xs); color: var(--ink-3); list-style: none; padding: 0; margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--rule-strong); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap {
    position: relative; /* contains .visually-hidden labels so they can't widen the page */
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
}
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th {
    text-align: left;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ink-2);
    background: var(--surface-2);
    padding: 0.65rem 1rem;
    white-space: nowrap;
    border-bottom: 1px solid var(--rule);
}
.table td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table tr.is-selected td { background: color-mix(in srgb, var(--sign-soft) 70%, transparent); }
.table .col-check { width: 2.5rem; padding-right: 0; }
.table .col-actions { text-align: right; white-space: nowrap; }
.table input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--sign); margin: 0; vertical-align: middle; }
.cell-title { font-weight: 600; color: var(--ink); text-decoration: none; }
a.cell-title:hover { color: var(--sign-deep); text-decoration: underline; }
.cell-sub { display: block; font-size: var(--fs-xs); color: var(--ink-2); font-weight: 400; overflow-wrap: anywhere; }

/* ── Event list: the compact list on the home page and the portal overview ── */
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }

/* ── Inline editing (admins and page editors) ─────────────── */
.editable { position: relative; border-radius: var(--radius); }
.edit-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.edit-bar .btn-sm { min-height: 1.9rem; }

/* ── Rich text from the editor ────────────────────────────── */
.prose { max-width: 40rem; font-size: var(--fs-base); line-height: 1.7; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: var(--fs-xl); margin-top: 1.8em; }
.prose h3 { font-size: var(--fs-lg); margin-top: 1.5em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.5em; }
.prose ul { list-style: none; padding-left: 1.6em; }
.prose ul > li { position: relative; }
.prose ul > li + li { margin-top: 0.35em; }
.prose ul > li::before {
    content: "";
    position: absolute;
    left: -1.45em; top: 0.42em;
    width: 0.8em; height: 0.8em;
    background: var(--blossom);
    -webkit-mask: var(--blossom-svg) center / contain no-repeat;
            mask: var(--blossom-svg) center / contain no-repeat;
}
.prose ol { padding-left: 1.4em; }
.prose ol > li::marker { color: var(--blossom-deep); font-weight: 700; }
.prose blockquote {
    margin-inline: 0;
    padding: 0.2em 0 0.2em 1.1em;
    border-left: 3px solid var(--blossom);
    color: var(--ink-2);
}
.prose a { font-weight: 500; }
.prose dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; }
.prose dt { font-weight: 600; }
.prose dd { margin: 0; }

/* ── Feedback ─────────────────────────────────────────────── */
.alert {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    font-size: var(--fs-sm);
    background: var(--sign-soft);
    color: var(--ink);
}
.alert > .bi { font-size: 1.1rem; color: var(--sign-deep); margin-top: 0.05rem; }
.alert-success { background: var(--ok-soft); }
.alert-success > .bi { color: var(--ok); }
.alert-warning { background: var(--warn-soft); }
.alert-warning > .bi { color: var(--warn); }
.alert-danger { background: var(--danger-soft); }
.alert-danger > .bi { color: var(--danger); }
.alert a { color: inherit; font-weight: 600; }

.empty {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--ink-2);
}
.empty .blossom-mark { width: 2rem; height: 2rem; opacity: 0.6; }

.avatar {
    display: inline-grid;
    place-items: center;
    width: 2.25rem; height: 2.25rem;
    flex: none;
    border-radius: 50%;
    background: var(--blossom-soft);
    color: var(--blossom-deep);
    font-weight: 700;
    font-size: var(--fs-xs);
    letter-spacing: 0.02em;
}

/* ── Portal shell ─────────────────────────────────────────── */
.portal-shell {
    flex: 1 0 auto;
    display: grid;
    grid-template-columns: 16.5rem minmax(0, 1fr);
    width: 100%;
}
.portal-side {
    position: sticky;
    top: var(--cc-nav-h);
    align-self: start;
    max-height: calc(100vh - var(--cc-nav-h));
    overflow-y: auto;
    padding: 1rem 1rem 1.25rem max(1rem, env(safe-area-inset-left, 0px));
    border-right: 1px solid var(--rule);
}
.side-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.4rem 0.6rem 0.8rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--rule);
}
.side-user strong { display: block; font-size: var(--fs-sm); line-height: 1.2; overflow-wrap: anywhere; }
.side-user .avatar { font-size: 1.1rem; }
.side-user div { min-width: 0; }
.side-user div span { display: block; font-size: var(--fs-xs); color: var(--ink-2); }
.side-nav { display: grid; gap: 0.1rem; }
.side-group {
    margin: 0.75rem 0 0.2rem 0.6rem;
    font-family: var(--font-caps);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    color: var(--ink-3);
}
.side-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.38rem 0.6rem;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
    border-radius: var(--radius-sm);
}
.side-link .bi { font-size: 1.05rem; width: 1.1rem; text-align: center; color: var(--ink-3); }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link[aria-current="page"] { background: var(--blossom-soft); color: var(--ink); font-weight: 600; }
.side-link[aria-current="page"] .bi { color: var(--blossom-deep); }
.side-sub { display: grid; gap: 0.05rem; margin: 0.1rem 0 0.3rem 1.75rem; padding-left: 0.6rem; border-left: 1px solid var(--rule); }
.side-sub .side-link { padding-block: 0.22rem; font-size: var(--fs-xs); }

.portal-main {
    padding: 2rem var(--gutter-r) 4rem clamp(16px, 3vw, 2.75rem);
    min-width: 0;
}
.portal-inner { max-width: 68rem; display: grid; gap: 1.75rem; }
/* Grid children may shrink, so wide tables scroll inside .table-wrap instead of widening the page. */
.portal-inner > * { min-width: 0; }
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
}
.page-head > * { min-width: 0; }   /* tabs inside scroll, they don't widen the page */
.page-head h1 { font-size: var(--fs-2xl); margin-top: 0.35rem; }
.page-head .lede { font-size: var(--fs-base); margin-top: 0.4rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

@media (max-width: 920px) {
    .portal-shell { grid-template-columns: minmax(0, 1fr); }
    .portal-side {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--rule);
        padding: 0.75rem var(--gutter-r) 0.75rem var(--gutter-l);
        overflow-x: auto;
        max-height: none;
    }
    .side-user { display: none; }
    .side-nav { display: flex; gap: 0.25rem; }
    .side-group { display: none; }
    .side-sub { display: contents; }
    .side-sub .side-link { padding-block: 0.5rem; font-size: var(--fs-sm); }
    .side-link { white-space: nowrap; }
    .portal-main { padding-left: var(--gutter-l); }
}

/* Toolbar that appears when rows are selected */
.select-bar {
    position: sticky;
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem 0.6rem 1.1rem;
    background: var(--ink);
    color: var(--paper);
    border-radius: 999px;
    box-shadow: var(--shadow-2);
    font-size: var(--fs-sm);
}
.select-bar .btn { --btn-bg: transparent; --btn-fg: var(--paper); --btn-bd: color-mix(in srgb, var(--paper) 30%, transparent); }
.select-bar .btn:hover { --btn-bg: color-mix(in srgb, var(--paper) 12%, transparent); }
.select-bar .btn-danger { --btn-fg: var(--danger-on-ink); }
.select-bar .sep { width: 1px; align-self: stretch; background: color-mix(in srgb, var(--paper) 25%, transparent); margin-inline: 0.25rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Stand-alone sign-in pages ────────────────────────────── */
/* No main menu: the logo (a link home) beside a card holding the form,
   over a strip of the brick wall. */
.auth-top { padding-block: 1.1rem 0; }
.auth-top a { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--fs-sm); text-decoration: none; }
.auth-top a:hover { text-decoration: underline; }
.auth-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
    gap: 2.5rem 4rem;
    align-items: center;
    padding-block: 2rem 4rem;
}
.auth-welcome { display: grid; gap: 1.1rem; justify-items: start; min-width: 0; }
.auth-logo {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.5rem 1.75rem;
    align-items: end;
    color: var(--ink);
    text-decoration: none;
}
.auth-logo img { display: block; width: clamp(7rem, 14vw, 12.5rem); height: auto; }
.auth-logo-name { display: block; font-family: var(--font-sign); font-weight: 600; font-size: clamp(2.25rem, 1.6rem + 3vw, 4rem); line-height: 0.95; letter-spacing: 0.03em; }
.auth-logo .script { display: block; margin-top: 0.15em; padding-bottom: 0.4rem; font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.75rem); }
.auth-welcome .lede { max-width: 27em; font-size: var(--fs-base); }
.auth-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; font-size: var(--fs-sm); color: var(--ink-2); }
.auth-perks li { display: flex; align-items: center; gap: 0.6rem; }
.auth-panel { display: grid; gap: 1rem; min-width: 0; }
.auth-wall { height: 4.5rem; }
@media (max-width: 820px) {
    .auth-main { grid-template-columns: 1fr; padding-block: 1rem 2.5rem; }
    .auth-logo { grid-template-columns: 4.5rem minmax(0, 1fr); gap: 0.25rem 1rem; }
    .auth-logo img { width: 4.5rem; }
    .auth-welcome .lede, .auth-perks { display: none; }
}

/* ── Confirm dialog (site.js: ccConfirm, data-confirm) ────── */
.confirm-dialog {
    width: min(28rem, calc(100vw - 2rem));
    padding: 1.5rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
}
.confirm-dialog::backdrop { background: rgb(25 16 15 / 0.55); }
.confirm-dialog-message { font-size: var(--fs-base); line-height: 1.5; overflow-wrap: anywhere; }
.confirm-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-top: 1.4rem; }

/* ── Small layout helpers ─────────────────────────────────── */
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.cluster-tight { gap: 0.25rem; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }
.stack { display: grid; gap: 1.1rem; align-content: start; }
.stack-sm { display: grid; gap: 0.6rem; align-content: start; }
.stack > *, .stack-sm > * { min-width: 0; }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.nowrap { white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 1rem; }

/* ── Print: the page's own content, no navigation or brick ── */
@media print {
    :root {
        --paper: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --ink-2: #333; --ink-3: #555;
        --rule: #bbb; --rule-strong: #888; --sign-deep: #000; --blossom-deep: #000;
    }
    body { display: block; font-size: 11pt; }
    .site-nav, .site-footer, .skip-link, .maintenance-banner, .site-flash, .edit-bar,
    .portal-side, .sub-nav, .page-actions, .btn, .select-bar, .hero-petals { display: none !important; }
    .site-content, .app-content, .portal-main { max-width: none; padding: 0; }
    .card, .table-wrap { box-shadow: none; border-color: var(--rule); }
    a { color: inherit; }
    .page-content a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
    h1, h2, h3 { break-after: avoid; }
    tr, li, .event-card { break-inside: avoid; }
}
