/* =====================================================================
   Bernard Bout Book — Premium book-inspired design system
   Palette: maroon · gold · parchment · charcoal
   ===================================================================== */

:root {
    --maroon:        #7c1d2b;
    --maroon-dark:   #571017;
    --maroon-deep:   #3d0a10;
    --gold:          #c8a24a;
    --gold-soft:     #e6cf95;
    --gold-dark:     #9c7a2f;
    --parchment:     #f6efdf;
    --parchment-2:   #efe5cf;
    --cream:         #fbf7ec;
    --ink:           #2a2723;
    --ink-soft:      #55504a;
    --charcoal:      #23252b;
    --navy:          #1e2531;
    --line:          #dccfae;
    --line-soft:     #e8dcc0;
    --white:         #ffffff;
    --success:       #2f7d4f;
    --danger:        #b23b3b;
    --warning:       #b9822b;
    --info:          #35617d;

    --shadow-sm: 0 1px 2px rgba(61, 10, 16, .07), 0 2px 6px rgba(61, 10, 16, .05);
    --shadow-md: 0 4px 10px rgba(61, 10, 16, .08), 0 12px 28px rgba(61, 10, 16, .12);
    --shadow-lg: 0 10px 24px rgba(61, 10, 16, .14), 0 22px 60px rgba(61, 10, 16, .24);
    --gold-sheen: linear-gradient(90deg, transparent, rgba(230,207,149,.9) 20%, var(--gold) 50%, rgba(230,207,149,.9) 80%, transparent);

    --font-display: "Playfair Display", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --font-serif:   "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --font-sans:    "Inter", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;

    --radius: 12px;
    --radius-sm: 8px;
    --maxw: 1160px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
/* Ensure the HTML `hidden` attribute always wins over component display rules
   (e.g. .btn{display:inline-flex}), so toggled-off elements truly hide. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--ink);
    line-height: 1.6;
    background-color: var(--parchment);
    background-image:
        radial-gradient(circle at 12% 18%, rgba(200,162,74,.10), transparent 40%),
        radial-gradient(circle at 88% 12%, rgba(124,29,43,.08), transparent 42%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.18; color: var(--maroon-dark); margin: 0 0 .5em; letter-spacing: .2px; }
a { color: var(--maroon); text-decoration: none; }
a:hover { color: var(--maroon-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; }
p { margin: 0 0 1em; }
hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Skip link / a11y ---------- */
.skip-link { position: absolute; left: -999px; top: 0; background: var(--maroon); color: #fff; padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar / masthead ---------- */
.masthead {
    background: linear-gradient(160deg, var(--maroon) 0%, var(--maroon-dark) 60%, var(--maroon-deep) 100%);
    color: var(--cream);
    border-bottom: 3px solid var(--gold);
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.08), var(--shadow-md);
    position: sticky; top: 0; z-index: 100;
}
.masthead::after { content: ""; display: block; height: 1px; background: var(--gold-sheen); opacity: .55; }
.masthead .container { display: flex; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--cream); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--cream); padding: 3px; box-shadow: var(--shadow-sm); }
.brand-title { font-family: var(--font-display); font-size: 1.18rem; font-weight: 800; letter-spacing: .4px; line-height: 1; color: var(--cream); }
.brand-sub { font-size: .68rem; letter-spacing: 2.5px; text-transform: uppercase; color: var(--gold-soft); }

.nav-toggle { margin-left: auto; display: none; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: 1.4rem; line-height: 1; padding: 6px 12px; border-radius: 8px; cursor: pointer; }

/* One row, always: the links plus Sign Out are a single unwrapped line. If they
   ever stop fitting, the hamburger takes over (see the 1024px breakpoint) rather
   than letting the button drop onto a second row. */
.topnav { margin-left: auto; display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.topnav a { white-space: nowrap; color: var(--gold-soft); padding: 8px 9px; border-radius: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .2px; text-transform: uppercase; }
.topnav a:hover, .topnav a.active { color: #fff; background: rgba(255,255,255,.12); text-decoration: none; }
.topnav .btn { flex: none; margin-left: 6px; padding: 7px 12px; text-transform: none; }

/* ---------- Bookmark ribbon sub-nav ---------- */
.chapter-nav { background: var(--cream); border-bottom: 1px solid var(--line); }
.chapter-nav .container { display: flex; gap: 4px; overflow-x: auto; padding-top: 6px; padding-bottom: 6px; scrollbar-width: thin; }
.chapter-nav a {
    white-space: nowrap; font-size: .78rem; font-weight: 600; color: var(--ink-soft);
    padding: 7px 14px; border-radius: 999px; letter-spacing: .3px;
}
.chapter-nav a:hover { color: var(--maroon); background: var(--parchment-2); text-decoration: none; }
.chapter-nav a.active { color: #fff; background: var(--maroon); }

/* ---------- Layout ---------- */
main { flex: 1 0 auto; padding: 32px 0 56px; }
.page-narrow { max-width: 860px; }

/* ---------- Chapter header ---------- */
.chapter-header { text-align: center; margin: 8px auto 34px; max-width: 780px; position: relative; }
.chapter-eyebrow {
    display: inline-block; font-family: var(--font-sans); font-size: .72rem; font-weight: 700;
    letter-spacing: 3px; text-transform: uppercase; color: var(--gold-dark);
    padding: 4px 0; margin-bottom: 6px;
}
.chapter-header h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); margin-bottom: .3em; }
.chapter-header p.lede { font-family: var(--font-serif); font-size: 1.12rem; color: var(--ink-soft); font-style: italic; }
.rule-ornament { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px auto 0; color: var(--gold-dark); }
.rule-ornament::before, .rule-ornament::after { content: ""; height: 1px; width: min(120px, 22vw); background: linear-gradient(90deg, transparent, var(--gold-dark)); }
.rule-ornament::after { background: linear-gradient(90deg, var(--gold-dark), transparent); }

/* ---------- Cards / pages ---------- */
.card {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    position: relative;
}
.card.page-card { background:
    linear-gradient(90deg, rgba(124,29,43,.05), transparent 5%),
    var(--cream); border-left: 3px solid var(--gold); }
.card h2, .card h3 { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-sans); font-weight: 700; font-size: .9rem; letter-spacing: .3px;
    padding: 11px 20px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
    text-decoration: none; transition: transform .08s ease, box-shadow .15s ease, background .15s ease, filter .15s ease;
    background: linear-gradient(170deg, #8e2635, var(--maroon) 40%, var(--maroon-dark));
    color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.16), var(--shadow-sm);
}
.btn:hover { text-decoration: none; color: #fff; filter: brightness(1.08); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.16), var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-gold { background: linear-gradient(160deg, var(--gold), var(--gold-dark)); color: #3a2c08; }
.btn-gold:hover { color: #2a2005; filter: brightness(1.05); }
.btn-outline { background: transparent; color: var(--maroon); border-color: var(--maroon); box-shadow: none; }
.btn-outline:hover { background: var(--maroon); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { background: var(--parchment-2); color: var(--ink); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8f2c2c; }
.btn-sm { padding: 7px 14px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700;
    letter-spacing: .4px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
    border: 1px solid transparent; white-space: nowrap;
}
.badge-blades { font-size: .8em; }
.badge-weapon { background: #efe3c8; color: #6a5312; border-color: var(--gold-soft); }
.weapon-foil   { background: #e7eef5; color: #2b5170; border-color: #bcd2e4; }
.weapon-epee   { background: #e9f1e8; color: #2e6136; border-color: #c2dcbf; }
.weapon-saber  { background: #f6e7e3; color: #8a3a29; border-color: #e4c3b8; }
.weapon-multiple { background: #efe3c8; color: #6a5312; border-color: var(--gold-soft); }
/* Captaincy — a small metallic "medal": bright-to-deep gold sheen, a top
   highlight line, and a drop shadow so it lifts off dark portrait cards. */
.badge-captain { gap: 5px; font-weight: 800; letter-spacing: .6px; }
.badge-captain span[aria-hidden] { font-size: .82em; line-height: 1; }
.captain-captain {
    background: linear-gradient(155deg, #fbeaa8 0%, #e9c96e 26%, var(--gold) 52%, #b6862c 82%, #9c7226 100%);
    color: #4a2f08; border-color: rgba(120, 86, 26, .6);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .3);
    box-shadow: 0 2px 7px rgba(61, 10, 16, .38), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.captain-captain span[aria-hidden] { color: #6b4a12; }
.captain-co_captain {
    background: linear-gradient(155deg, #fdf6e6 0%, #ecdcb4 55%, #d8c088 100%);
    color: #6a5312; border-color: var(--gold-soft);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
    box-shadow: 0 2px 5px rgba(61, 10, 16, .22), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.captain-co_captain span[aria-hidden] { color: #a07f2f; }
.badge-level { background: #eee; color: #444; }
.level-novice  { background: #eef1f4; color: #4a5b6b; }
.level-jv      { background: #e9eef9; color: #33518f; }
.level-varsity { background: var(--maroon); color: #fff; }
.level-coach   { background: linear-gradient(160deg, var(--gold), var(--gold-dark)); color: #3a2c08; }
.badge-status { }
.status-eligible, .status-overridden_eligible, .badge-eligible { background: #e4f2e8; color: #226b41; border-color: #b8dcc4; }
.status-ineligible, .status-overridden_ineligible, .badge-ineligible { background: #f8e6e6; color: #a13232; border-color: #e6c2c2; }
.badge-present  { background: #e4f2e8; color: #226b41; }
.badge-late     { background: #fdf1dc; color: #8a6114; }
.badge-excused  { background: #e9eef9; color: #33518f; }
.badge-absent   { background: #f8e6e6; color: #a13232; }
.badge-available { background: #e4f2e8; color: #226b41; }
.badge-signed_out { background: #fdf1dc; color: #8a6114; }
.badge-maintenance { background: #e9eef9; color: #33518f; }
.badge-lost, .badge-retired { background: #ecebe8; color: #6a655d; }
.badge-featured { background: linear-gradient(160deg, var(--gold), var(--gold-dark)); color: #3a2c08; }
.badge-pending { background: #fdf1dc; color: #8a6114; }
.badge-approved { background: #e4f2e8; color: #226b41; }
.badge-rejected { background: #f8e6e6; color: #a13232; }
.badge-override { background: var(--charcoal); color: var(--gold-soft); }

/* ---------- Competition availability (RSVP) ----------
   Answer buttons carry a circular colored "medallion" icon — green check,
   amber question mark, red cross — always visible so the meaning reads at a
   glance; the whole button tints and gains a soft ring once selected. */
.rsvp-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.rsvp-btn, .rsvp-pill {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    font-family: var(--font-sans); font-weight: 700; letter-spacing: .3px;
    border-radius: 999px; border: 1px solid var(--line);
    background: linear-gradient(175deg, var(--white), var(--cream));
    color: var(--ink-soft);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.85), var(--shadow-sm);
    transition: transform .1s ease, box-shadow .18s ease, border-color .18s ease,
                background .18s ease, color .18s ease;
}
.rsvp-btn  { font-size: .88rem; padding: 8px 18px 8px 9px; }
.rsvp-pill { font-size: .8rem;  padding: 5px 14px 5px 6px; gap: 7px; }
.rsvp-btn:hover, .rsvp-pill:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.85), var(--shadow-md);
}
.rsvp-btn:active, .rsvp-pill:active { transform: translateY(0); }
/* Medallion icon. */
.rsvp-ico {
    width: 22px; height: 22px; border-radius: 50%; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: .78rem; font-weight: 800; line-height: 1;
    text-shadow: 0 1px 1px rgba(30,10,14,.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 1px 3px rgba(30,10,14,.3);
}
.rsvp-pill .rsvp-ico { width: 19px; height: 19px; font-size: .68rem; }
.rsvp-ico svg { width: 60%; height: 60%; display: block; }
.rsvp-going     .rsvp-ico { background: linear-gradient(160deg, #5cc283, #2e8b57 55%, #1d6a40); }
.rsvp-maybe     .rsvp-ico { background: linear-gradient(160deg, #f0c568, #c99b2e 55%, #97711e); }
.rsvp-not_going .rsvp-ico { background: linear-gradient(160deg, #e57f72, #c14f4f 55%, #93302f); }
/* Hover hint + selected state per answer. */
.rsvp-going:hover,     .rsvp-going.selected     { border-color: #4aa672; color: #1d6a40; }
.rsvp-maybe:hover,     .rsvp-maybe.selected     { border-color: #d4a83f; color: #7d5a11; }
.rsvp-not_going:hover, .rsvp-not_going.selected { border-color: #c96060; color: #8f2c2c; }
.rsvp-going.selected {
    background: linear-gradient(175deg, #f3faf5, #e2f1e7);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 0 0 3px rgba(46,139,87,.15), var(--shadow-sm);
}
.rsvp-maybe.selected {
    background: linear-gradient(175deg, #fdf9ee, #fbf0d8);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 0 0 3px rgba(201,155,46,.16), var(--shadow-sm);
}
.rsvp-not_going.selected {
    background: linear-gradient(175deg, #fcf1f0, #f7e4e4);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 0 0 3px rgba(182,74,74,.14), var(--shadow-sm);
}
.rsvp-btn.selected, .rsvp-pill.selected { font-weight: 800; }
/* Compact row embedded in the dashboard's Next Competition card. */
.rsvp-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--gold-soft); }
.rsvp-inline-q { font-weight: 800; font-size: .78rem; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 7px; }
.rsvp-inline-form { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.rsvp-inline-status { font-size: .8rem; margin: 8px 0 0; }
/* "?" info button — small gold medallion that opens the explainer modal. */
.rsvp-info {
    width: 20px; height: 20px; border-radius: 50%; flex: none;
    border: 1px solid rgba(120,86,26,.45);
    background: linear-gradient(160deg, #fbeaa8, #e9c96e 45%, var(--gold));
    color: #4a2f08; font-size: .7rem; font-weight: 800; cursor: pointer; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    text-shadow: 0 1px 0 rgba(255,255,255,.35);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 3px rgba(61,10,16,.25);
    transition: transform .1s ease, box-shadow .15s ease, filter .15s ease;
}
.rsvp-info:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), var(--shadow-sm); }
.rsvp-link { background: none; border: none; padding: 0; cursor: pointer; color: var(--maroon); font-size: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.rsvp-link:hover { color: var(--maroon-dark); }
.rsvp-note-row { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.rsvp-note-row input { flex: 1 1 200px; min-width: 0; }
/* Calendar detail modal section. */
.cal-rsvp {
    margin: 4px 0 12px; padding: 14px;
    border: 1px solid var(--gold-soft); border-radius: var(--radius);
    background: linear-gradient(90deg, rgba(200,162,74,.08), transparent 40%), var(--parchment-2);
}
.cal-rsvp-q { font-weight: 700; font-size: .88rem; margin-bottom: 10px; }
.cal-rsvp-q .muted { font-weight: 400; font-size: .8rem; }
.cal-rsvp-msg { font-size: .8rem; margin-top: 6px; min-height: 1em; }
/* Admin response badges. */
.rsvp-badge-going     { background: #e4f2e8; color: #226b41; border-color: #b8dcc4; }
.rsvp-badge-maybe     { background: #fdf1dc; color: #8a6114; border-color: #ecd3a0; }
.rsvp-badge-not_going { background: #f8e6e6; color: #a13232; border-color: #e6c2c2; }
.rsvp-badge-none      { background: #ecebe8; color: #6a655d; border-color: #dcd9d3; }
@media (max-width: 640px) {
    .rsvp-inline-form { width: 100%; }
    .rsvp-pill, .rsvp-btn { flex: 1 1 0; justify-content: center; }
}

/* ---------- Stat cards / bout cards ---------- */
.stat-card {
    background: linear-gradient(165deg, var(--white), var(--cream));
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
a.stat-card { transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease; }
a.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--gold-soft); text-decoration: none; }
.stat-card::after { content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle, rgba(200,162,74,.16), transparent 70%); }
.stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: 1.4px; color: var(--ink-soft); font-weight: 700; }
.stat-value { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; color: var(--maroon-dark); line-height: 1.1; margin-top: 2px; }
.stat-sub { font-size: .82rem; color: var(--ink-soft); }
.stat-card.accent { background: linear-gradient(160deg, var(--maroon), var(--maroon-dark)); border-color: var(--maroon-dark); }
.stat-card.accent .stat-label { color: var(--gold-soft); }
.stat-card.accent .stat-value, .stat-card.accent .stat-sub { color: #fff; }
/* Compact stat cards used inside the weapon/category panels on the stats page,
   where four cards share a third-width column. Shrinks type and spacing so
   labels and numbers fit instead of being clipped by the card's overflow. */
.stat-mini-grid { gap: 10px; }
.stat-mini { padding: 12px 12px; overflow: visible; }
.stat-mini::after { display: none; }
.stat-mini .stat-label { font-size: .62rem; letter-spacing: .5px; overflow-wrap: break-word; }
.stat-mini .stat-value { font-size: 1.5rem; }
.stat-mini .stat-sub { font-size: .72rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--cream); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 520px; }
table.data th { text-align: left; font-family: var(--font-sans); font-size: .72rem; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-soft); background: var(--parchment-2); padding: 12px 14px; border-bottom: 2px solid var(--line); position: sticky; top: 0; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr:nth-child(even) { background: rgba(200,162,74,.05); }
table.data tbody tr:hover { background: rgba(200,162,74,.11); }
table.data tbody tr:last-child td { border-bottom: none; }
.table-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 6px; color: var(--ink); }
label .req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=search], input[type=file], select, textarea {
    width: 100%; font-family: var(--font-sans); font-size: .95rem; color: var(--ink);
    padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--white); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(200,162,74,.25); }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.help { font-size: .8rem; color: var(--ink-soft); margin-top: 4px; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin: 0 0 18px; }
legend { font-family: var(--font-display); font-weight: 700; color: var(--maroon-dark); padding: 0 8px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }

/* Weekday key-day picker (eligibility rule) */
.day-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.day-chip { position: relative; margin: 0; cursor: pointer; user-select: none; }
.day-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.day-chip span {
    display: inline-block; min-width: 46px; text-align: center;
    padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px;
    font-size: .85rem; font-weight: 600; background: var(--white);
    color: var(--ink-soft); transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.day-chip input:checked + span {
    background: var(--maroon); border-color: var(--maroon); color: var(--white);
}
.day-chip input:focus-visible + span { outline: 2px solid var(--gold-dark); outline-offset: 2px; }

/* Linked-account picker (team member form) */
.radio-stack { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.radio-row { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; cursor: pointer; }
.radio-row input { width: auto; }
.account-panel[hidden] { display: none; }
.account-panel { padding: 12px; margin-top: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--parchment-2); }
.user-pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.user-pick { padding: 6px 8px; border-radius: var(--radius-sm); }
.user-pick:hover { background: var(--white); }

/* ---------- Flash / alerts ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid; font-weight: 500; display: flex; gap: 10px; align-items: flex-start; box-shadow: var(--shadow-sm); animation: flash-in .25s ease; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flash.flash-hide { opacity: 0; transform: translateY(-6px); transition: opacity .3s ease, transform .3s ease; }
.flash .flash-close { margin-left: auto; background: none; border: none; color: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; opacity: .55; padding: 0 2px; flex: 0 0 auto; }
.flash .flash-close:hover { opacity: 1; }
.flash-success { background: #e8f4ec; border-color: #b8dcc4; color: #1f6a3f; }
.flash-error   { background: #fbe9e9; border-color: #e6c2c2; color: #9d2f2f; }
.flash-info    { background: #e9eff6; border-color: #c3d5e6; color: #2f5670; }
.flash-warning { background: #fbf1de; border-color: #ecd6a6; color: #886017; }

/* ---------- Empty & loading states ---------- */
.empty-state { text-align: center; padding: 48px 24px; color: var(--ink-soft); }
.empty-state .icon { font-size: 2.6rem; opacity: .5; }
.empty-state h3 { color: var(--ink-soft); font-family: var(--font-display); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--maroon); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Team member cards ---------- */
.member-card {
    position: relative; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); overflow: hidden;
    transition: transform .22s cubic-bezier(.2,.7,.25,1), box-shadow .28s ease, border-color .28s ease;
    display: flex; flex-direction: column;
}
/* Gilt inner frame — a thin gold hairline that reads as premium matting */
.member-card::after {
    content: ""; position: absolute; inset: 0; border-radius: var(--radius); pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(200,162,74,.28); opacity: .6; transition: opacity .28s ease, box-shadow .28s ease;
}
.member-card:hover {
    transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--gold-soft);
}
.member-card:hover::after { opacity: 1; box-shadow: inset 0 0 0 1px rgba(200,162,74,.6); }
.member-card .photo {
    aspect-ratio: 1/1; background: linear-gradient(160deg, var(--parchment-2), var(--line-soft));
    position: relative; overflow: hidden;
}
.member-card .photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.25,1); }
.member-card:hover .photo img { transform: scale(1.05); }
/* Light sweep across the portrait on hover */
.member-card .photo::before {
    content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.28) 46%, rgba(230,207,149,.35) 50%, transparent 66%);
    transform: translateX(-120%); transition: transform .7s ease;
}
.member-card:hover .photo::before { transform: translateX(120%); }
.member-card .photo .corner-badge { position: absolute; top: 10px; left: 10px; z-index: 3; }
.member-card .photo .corner-badge.right { left: auto; right: 10px; }

/* ---- No-photo treatment: heraldic monogram over a tinted silhouette ---- */
.member-card.no-photo .photo { background: radial-gradient(120% 120% at 30% 20%, var(--maroon) 0%, var(--maroon-dark) 45%, var(--maroon-deep) 100%); }
.member-card.no-photo .photo img { mix-blend-mode: luminosity; opacity: .9; }
.member-card.no-photo .photo::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(70% 60% at 22% 45%, rgba(200,162,74,.22), transparent 60%);
    box-shadow: inset 0 0 0 1px rgba(200,162,74,.35), inset 0 0 40px rgba(61,10,16,.55);
}
.member-card.no-photo .monogram {
    position: absolute; z-index: 2; top: 50%; left: 20px; transform: translateY(-58%);
    font-family: var(--font-display); font-weight: 800; font-size: clamp(3rem, 8vw, 4.4rem); line-height: 1; letter-spacing: 1px;
    background: linear-gradient(155deg, #f4e2ad 0%, var(--gold) 48%, var(--gold-dark) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 2px 4px rgba(20,4,7,.55)); transition: transform .35s cubic-bezier(.2,.7,.25,1);
}
.member-card.no-photo:hover .monogram { transform: translateY(-58%) scale(1.06); }
.member-card.no-photo .awaiting {
    position: absolute; z-index: 2; bottom: 12px; left: 0; right: 0; text-align: center;
    font-family: var(--font-sans); font-size: .62rem; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
    color: var(--gold-soft); text-shadow: 0 1px 3px rgba(20,4,7,.6);
}
.member-card.no-photo .awaiting::before, .member-card.no-photo .awaiting::after {
    content: "\2726"; color: var(--gold); opacity: .8; margin: 0 8px; font-size: .7em; vertical-align: 1px;
}

.member-card .body { padding: 14px 16px 18px; text-align: center; }
.member-card .name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--maroon-dark); margin: 0; }
/* Gold flourish under the name */
.member-card .name::after {
    content: ""; display: block; width: 0; height: 2px; margin: 6px auto 0; border-radius: 2px;
    background: var(--gold-sheen); transition: width .3s ease;
}
.member-card:hover .name::after { width: 42px; }
.member-card .meta { font-size: .82rem; color: var(--ink-soft); margin: 2px 0 10px; }
.member-card .badges { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.member-card .quote { font-family: var(--font-serif); font-style: italic; font-size: .86rem; color: var(--ink-soft); margin-top: 10px; }

/* ---------- Filters bar ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 22px; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.filters .form-group { margin: 0; flex: 1 1 150px; }
.filters label { font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 20px; }
.tabs a, .tabs button { background: none; border: none; font-family: var(--font-sans); font-weight: 700; font-size: .86rem; color: var(--ink-soft); padding: 10px 16px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.active, .tabs button.active { color: var(--maroon); border-bottom-color: var(--gold); text-decoration: none; }

/* ---------- Hero (landing) ---------- */
.hero { position: relative; text-align: center; color: var(--cream); padding: 72px 20px 84px; overflow: hidden;
    background: radial-gradient(circle at 50% -10%, var(--maroon) 0%, var(--maroon-dark) 55%, var(--maroon-deep) 100%); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .08;
    background-image: repeating-linear-gradient(90deg, #fff 0 1px, transparent 1px 42px); }
.hero-logo { width: 132px; height: 132px; border-radius: 50%; background: var(--cream); padding: 8px; box-shadow: var(--shadow-lg); position: relative; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 6vw, 4.2rem); margin: 22px 0 6px; text-shadow: 0 2px 20px rgba(0,0,0,.3); }
.hero .subtitle { font-family: var(--font-serif); font-style: italic; font-size: clamp(1.05rem, 2.4vw, 1.4rem); color: var(--gold-soft); position: relative; }
.hero .hero-actions { margin-top: 28px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; position: relative; }
.hero-crest { position: relative; display: inline-block; }
.hero-crest .blade { position: absolute; top: 50%; width: 150px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold-soft)); }
.hero-crest .blade.l { right: 100%; margin-right: 18px; }
.hero-crest .blade.r { left: 100%; margin-left: 18px; background: linear-gradient(90deg, var(--gold-soft), transparent); }
@media (max-width: 640px){ .hero-crest .blade { display: none; } }

/* ---------- Feature chapters grid (landing) ---------- */
.chapter-tile { display: block; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .18s; height: 100%; }
.chapter-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; border-color: var(--gold-soft); }
.chapter-tile .num { font-family: var(--font-display); font-size: .8rem; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-dark); }
.chapter-tile .icon { font-size: 1.8rem; }
.chapter-tile h3 { margin: 6px 0 6px; }
.chapter-tile p { color: var(--ink-soft); font-size: .9rem; margin: 0; }

/* ---------- Photo gallery (masonry) ---------- */
.masonry { columns: 4 240px; column-gap: 16px; }
.masonry .photo-card { break-inside: avoid; margin-bottom: 16px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--cream); box-shadow: var(--shadow-sm); cursor: pointer; position: relative; }
.masonry .photo-card img { width: 100%; display: block; }
.masonry .photo-card .cap { padding: 8px 12px; font-size: .82rem; color: var(--ink-soft); }
.masonry .photo-card .feat { position: absolute; top: 8px; right: 8px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(30,10,14,.9); display: none; align-items: center; justify-content: center; z-index: 300; padding: 24px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 8px; box-shadow: var(--shadow-lg); border: 4px solid var(--cream); }
.lightbox .cap { position: absolute; bottom: 20px; color: var(--cream); text-align: center; width: 100%; font-family: var(--font-serif); font-style: italic; }
.lightbox .close { position: absolute; top: 18px; right: 24px; color: #fff; font-size: 2rem; cursor: pointer; background: none; border: none; }

/* ---------- Glossary ---------- */
.alpha-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; }
.alpha-nav a { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--cream); border: 1px solid var(--line); font-weight: 700; font-size: .82rem; }
.alpha-nav a:hover { background: var(--maroon); color: #fff; text-decoration: none; }
.term-card { background: var(--cream); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); padding: 16px 18px; }
.term-card h4 { margin: 0 0 4px; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.term-card .cat { font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gold-dark); font-weight: 700; }

/* ---------- Timeline (history) ---------- */
.timeline { position: relative; margin: 20px 0; padding-left: 28px; border-left: 2px solid var(--gold-soft); }
.timeline .event { position: relative; margin-bottom: 26px; }
.timeline .event::before { content: ""; position: absolute; left: -35px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--maroon); border: 2px solid var(--gold); }
.timeline .year { font-family: var(--font-display); font-weight: 800; color: var(--maroon); }

/* ---------- Do / Don't cards ---------- */
.dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.do-card, .dont-card { border-radius: var(--radius); padding: 16px 18px; border: 1px solid; }
.do-card { background: #edf6f0; border-color: #bfe0cd; }
.dont-card { background: #fbecec; border-color: #e8c6c6; }
.do-card h4, .dont-card h4 { margin: 0 0 8px; }
.do-card h4 { color: #1f6a3f; } .dont-card h4 { color: #a13232; }
.do-card ul, .dont-card ul { margin: 0; padding-left: 20px; }

/* ---------- Checklist ---------- */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.checklist li::before { content: "✓"; color: var(--gold-dark); font-weight: 800; flex: 0 0 auto; }

/* ---------- QR display ---------- */
.qr-panel { text-align: center; }
.qr-panel .qr-box { display: inline-block; background: #fff; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.qr-panel .qr-box canvas, .qr-panel .qr-box img { display: block; }
.qr-code-text { font-family: var(--font-display); font-size: 2rem; letter-spacing: 6px; color: var(--maroon); background: var(--cream); border: 2px dashed var(--gold); border-radius: 10px; padding: 12px 20px; display: inline-block; }

/* ---------- Prose (page_content) ---------- */
.prose { font-family: var(--font-serif); font-size: 1.05rem; color: var(--ink); }
.prose h2 { font-size: 1.6rem; margin-top: 1.4em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose blockquote { border-left: 3px solid var(--gold); margin: 1em 0; padding: .4em 1.2em; background: var(--parchment-2); font-style: italic; }
.prose p:first-letter { }
.dropcap::first-letter { font-family: var(--font-display); font-size: 3.4rem; font-weight: 800; float: left; line-height: .8; padding: 6px 10px 0 0; color: var(--maroon); }

/* ---------- Coach note ---------- */
.coach-note { background: var(--charcoal); color: var(--cream); border-radius: var(--radius); padding: 18px 22px; border-left: 4px solid var(--gold); }
.coach-note h4 { color: var(--gold-soft); margin: 0 0 6px; }
.coach-note p { margin: 0; color: #e7e2d6; }

/* ---------- Admin sidebar layout ---------- */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.admin-side {
    background: linear-gradient(172deg, var(--maroon) 0%, var(--maroon-dark) 55%, var(--maroon-deep) 100%);
    border: 1px solid var(--maroon-deep); border-top: 3px solid var(--gold);
    border-radius: var(--radius); padding: 12px 10px 16px;
    align-self: start; position: sticky; top: 96px;
    max-height: calc(100vh - 120px); overflow-y: auto;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 0 0 1px rgba(200,162,74,.16), var(--shadow-md);
    scrollbar-width: thin; scrollbar-color: rgba(200,162,74,.55) transparent;
}
.admin-side::-webkit-scrollbar { width: 8px; }
.admin-side::-webkit-scrollbar-thumb { background: rgba(200,162,74,.45); border-radius: 8px; }

.admin-side .side-head {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--font-display); font-weight: 800; font-size: .95rem; letter-spacing: 1px;
    color: var(--gold-soft); text-align: center; padding: 8px 6px 12px;
    border-bottom: 1px solid rgba(230,207,149,.22); margin-bottom: 6px;
    text-shadow: 0 1px 3px rgba(20,4,7,.5);
}
.admin-side .side-head .fleur { color: var(--gold); font-size: .8em; opacity: .8; }

/* Which season the admin area is showing — a fixed point of reference on
   every page, and unmistakably different once it is an archive. */
.admin-side .side-season {
    display: block; text-align: center; padding: 8px 10px 10px; margin-bottom: 6px;
    border-radius: 8px; background: rgba(255,255,255,.07);
    border: 1px solid rgba(230,207,149,.22); color: var(--gold-soft);
}
.admin-side .side-season:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.admin-side .side-season-label {
    display: block; font-size: .66rem; letter-spacing: 1.2px; text-transform: uppercase; opacity: .75;
}
.admin-side .side-season-name {
    display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.02rem; color: #fff;
}
.admin-side .side-season-note {
    display: block; font-size: .68rem; letter-spacing: .6px; text-transform: uppercase; opacity: .9;
}
.admin-side .side-season-archive {
    background: rgba(185,130,43,.22); border-color: var(--gold);
}

/* Which season the book is open to, in the masthead — so a fencer on any
   page can see the year their record belongs to without leaving it. */
.mast-season {
    display: flex; flex-direction: column; align-items: center; line-height: 1.15;
    padding: 5px 12px; border-radius: 8px; color: var(--gold-soft);
    background: rgba(255,255,255,.07); border: 1px solid rgba(230,207,149,.22);
}
a.mast-season:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.mast-season-label { font-size: .6rem; letter-spacing: 1.6px; text-transform: uppercase; opacity: .8; }
.mast-season-name { font-family: var(--font-display); font-weight: 800; font-size: .95rem; color: #fff; white-space: nowrap; }
.mast-season-archive { background: rgba(185,130,43,.3); border-color: var(--gold); }

/* Global banner while a finished season is open for review. */
.season-archive-banner {
    background: var(--gold-dark); color: #241a05; padding: .5rem 0; font-size: .92rem;
}
.season-archive-banner .container {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

.admin-side .side-group { border-top: 1px solid rgba(230,207,149,.14); }
.admin-side .side-group:first-of-type { border-top: none; }
.admin-side .side-group > summary {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: 8px;
    font-size: .66rem; text-transform: uppercase; letter-spacing: 1.7px; font-weight: 800;
    color: var(--gold-soft); padding: 11px 10px 7px;
    transition: color .15s;
}
.admin-side .side-group > summary::-webkit-details-marker { display: none; }
.admin-side .side-group > summary:hover { color: #fff; }
.admin-side .side-group > summary .chev { margin-left: auto; color: var(--gold); font-size: 1.05rem; line-height: 1; opacity: .75; transition: transform .18s ease; }
.admin-side .side-group[open] > summary .chev { transform: rotate(90deg); }

.admin-side .side-links { display: flex; flex-direction: column; gap: 2px; padding-bottom: 9px; }
.admin-side .side-links a {
    display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
    color: #f0e8d6; font-size: .88rem; font-weight: 500;
    border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.admin-side .side-links a .ico { flex: 0 0 22px; text-align: center; font-size: .98rem; line-height: 1; }
.admin-side .side-links a .lbl { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-side .side-links a:hover { background: rgba(255,255,255,.09); color: #fff; text-decoration: none; }
.admin-side .side-links a.active {
    background: linear-gradient(90deg, rgba(200,162,74,.28), rgba(200,162,74,.10));
    border-color: rgba(200,162,74,.4); color: #fff; font-weight: 700;
    box-shadow: inset 3px 0 0 var(--gold), inset 0 1px 0 rgba(255,255,255,.08);
    text-shadow: 0 1px 2px rgba(20,4,7,.4);
}
.admin-side .side-links a .badge { margin-left: auto; flex: 0 0 auto; box-shadow: 0 1px 3px rgba(20,4,7,.4); }

/* ---------- Admin dashboard sections ---------- */
.admin-section-title {
    display: flex; align-items: center; gap: 14px;
    font-family: var(--font-sans); font-size: .74rem; font-weight: 800;
    letter-spacing: 2.2px; text-transform: uppercase; color: var(--gold-dark);
    margin: 30px 0 14px;
}
.admin-section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.flex-between + .admin-section-title { margin-top: 14px; }

.attention-list { display: flex; flex-direction: column; gap: 10px; }
.attention-item {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    background: var(--cream); border: 1px solid var(--line); border-left: 4px solid var(--warning);
    border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: var(--shadow-sm);
}
.attention-item.urgent { border-left-color: var(--danger); background: #fdf6f4; }
.attention-item .icon { font-size: 1.2rem; flex: 0 0 auto; }
.attention-item .what { flex: 1 1 200px; font-size: .92rem; }
.attention-item .what strong { font-family: var(--font-display); font-size: 1.15rem; color: var(--maroon-dark); margin-right: 2px; }
.attention-item .btn { flex: 0 0 auto; margin-left: auto; }
.all-clear {
    display: flex; align-items: center; gap: 10px;
    background: #e8f4ec; border: 1px solid #b8dcc4; color: #1f6a3f;
    border-radius: var(--radius-sm); padding: 12px 16px; font-weight: 600; font-size: .92rem;
}

/* ---------- Modal (confirm) ---------- */
dialog.modal { border: none; border-radius: var(--radius); padding: 0; box-shadow: var(--shadow-lg); max-width: 440px; width: 92%; background: var(--cream); }
dialog.modal::backdrop { background: rgba(30,10,14,.55); }
dialog.modal .modal-body { padding: 24px; }
dialog.modal h3 { margin-top: 0; }

/* ---------- Misc ---------- */
.muted { color: var(--ink-soft); }
.text-center { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:32px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.flex { display: flex; } .flex-between { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap: wrap; }
.gap-1{gap:8px}.gap-2{gap:16px}
.tag { display:inline-block; font-size:.72rem; background:var(--parchment-2); border:1px solid var(--line); border-radius:999px; padding:2px 9px; color:var(--ink-soft); }
.pill-row { display:flex; gap:8px; flex-wrap:wrap; }
.win { color: var(--success); font-weight: 700; }
.loss { color: var(--danger); font-weight: 700; }
.divider-fleur { text-align:center; color: var(--gold-dark); margin: 28px 0; font-size: 1.2rem; }
.divider-fleur::before, .divider-fleur::after { content: "⚜"; margin: 0 12px; opacity: .6; }

/* ---------- Help tips (inline "?" tooltips) ---------- */
.help-tip { display: inline-block; position: relative; margin-left: 6px; vertical-align: middle; line-height: 1; }
.help-tip > button {
    width: 18px; height: 18px; border-radius: 50%; padding: 0;
    border: 1px solid var(--gold-dark); color: var(--gold-dark); background: transparent;
    font-family: var(--font-sans); font-size: .68rem; font-weight: 800; line-height: 1;
    cursor: help; display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.help-tip > button:hover, .help-tip > button:focus { background: var(--gold-dark); color: #fff; }
.help-tip .tip {
    position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%) translateY(3px);
    width: max-content; max-width: 260px; background: var(--charcoal); color: #f0ead9;
    font-family: var(--font-sans); font-size: .78rem; font-weight: 400; font-style: normal;
    line-height: 1.5; letter-spacing: normal; text-transform: none; text-align: left; white-space: normal;
    padding: 10px 13px; border-radius: 8px; border-bottom: 2px solid var(--gold);
    box-shadow: var(--shadow-md); z-index: 150;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.help-tip .tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--gold); }
.help-tip:hover .tip, .help-tip:focus-within .tip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
th .help-tip .tip, td .help-tip .tip { max-width: 220px; }

/* ---------- Help panels ("How this works") ---------- */
details.help-panel {
    background: linear-gradient(165deg, #fdf9ee, var(--cream));
    border: 1px solid var(--gold-soft); border-left: 4px solid var(--gold);
    border-radius: var(--radius); box-shadow: var(--shadow-sm); margin: 0 0 20px;
}
details.help-panel > summary {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: 10px; padding: 12px 18px;
    font-family: var(--font-sans); font-weight: 700; font-size: .88rem; color: var(--maroon-dark);
}
details.help-panel > summary::-webkit-details-marker { display: none; }
details.help-panel > summary .help-glyph { color: var(--gold-dark); font-size: .95rem; }
details.help-panel > summary .chev { margin-left: auto; color: var(--gold-dark); font-size: 1.15rem; transition: transform .18s ease; }
details.help-panel[open] > summary .chev { transform: rotate(90deg); }
details.help-panel > summary:hover { color: var(--maroon); }
details.help-panel .help-body { padding: 12px 2px 16px; margin: 0 18px; font-size: .9rem; color: var(--ink-soft); border-top: 1px dashed var(--line); }
details.help-panel .help-body p { margin: 0 0 .8em; }
details.help-panel .help-body p:last-child, details.help-panel .help-body ul:last-child, details.help-panel .help-body dl:last-child { margin-bottom: 0; }
details.help-panel .help-body ul { margin: 0 0 .8em; padding-left: 1.3em; }
details.help-panel .help-body dt { font-weight: 700; color: var(--ink); margin-top: 8px; }
details.help-panel .help-body dt:first-child { margin-top: 0; }
details.help-panel .help-body dd { margin: 1px 0 6px; }
details.help-panel .help-body dl { margin: 0 0 .8em; }
details.help-panel .help-body strong { color: var(--ink); }

/* ---------- Numbered steps (help & guide) ---------- */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 1em; }
ol.steps > li { counter-increment: step; position: relative; padding: 0 0 20px 46px; }
ol.steps > li::before {
    content: counter(step); position: absolute; left: 0; top: -2px;
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(170deg, #8e2635, var(--maroon-dark)); color: #fff;
    font-family: var(--font-display); font-weight: 700; font-size: .9rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px var(--gold-soft), var(--shadow-sm);
}
ol.steps > li::after { content: ""; position: absolute; left: 14.5px; top: 34px; bottom: 4px; width: 1px; background: var(--line); }
ol.steps > li:last-child { padding-bottom: 4px; }
ol.steps > li:last-child::after { display: none; }
ol.steps > li > strong:first-child { display: block; color: var(--maroon-dark); font-family: var(--font-display); font-size: 1.02rem; }

/* ---------- Keyboard / code chips ---------- */
kbd, .kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .8em; background: var(--parchment-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; color: var(--ink); white-space: nowrap; }

/* ---------- Help & Guide page ---------- */
.guide-toc { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 26px; }
.guide-toc a { font-size: .8rem; font-weight: 700; letter-spacing: .4px; color: var(--maroon); background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 7px 15px; transition: background .15s, color .15s, border-color .15s; }
.guide-toc a:hover { background: var(--maroon); color: #fff; border-color: var(--maroon); text-decoration: none; }
.guide-section { margin-bottom: 34px; scroll-margin-top: 96px; }
.guide-section > h2 { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.guide-section > h2 .sec-icon { font-size: 1.2rem; }

/* ---------- Footer ---------- */
footer.site { background: var(--charcoal); color: #cfc9bd; border-top: 3px solid var(--gold); margin-top: auto; padding: 30px 0; font-size: .86rem; }
footer.site .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
footer.site a { color: var(--gold-soft); }
footer.site .foot-brand { font-family: var(--font-display); color: var(--cream); font-size: 1.05rem; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { position: static; max-height: none; overflow-y: visible; }
    .admin-side .side-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .masonry { columns: 3 200px; }
}
/* Below this the full link set can no longer share the row with the brand and
   the season chip, so the masthead collapses to the drawer. */
@media (max-width: 1024px) {
    .nav-toggle { display: block; }
    .topnav { display: none; flex-direction: column; align-items: stretch; width: 100%; order: 3; padding-bottom: 8px; }
    .topnav.open { display: flex; }
    .topnav a { width: 100%; }
    .topnav .btn { margin-left: 0; margin-top: 6px; }
    .masthead .container { flex-wrap: wrap; }
}
@media (max-width: 720px) {
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .dodont { grid-template-columns: 1fr; }
    .masonry { columns: 2 140px; }
    .chapter-header p.lede { font-size: 1rem; }
}
@media (max-width: 420px) {
    .brand-sub { display: none; }
    .mast-season { padding: 4px 8px; }
    .mast-season-label { display: none; }
    .mast-season-name { font-size: .82rem; }
    .masonry { columns: 1; }
}

/* =====================================================================
   Calendar
   ===================================================================== */
.cal-hero {
    background: radial-gradient(circle at 50% -20%, var(--maroon) 0%, var(--maroon-dark) 60%, var(--maroon-deep) 100%);
    color: var(--cream); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 30px 28px; margin-bottom: 26px; border: 1px solid var(--maroon-deep); position: relative; overflow: hidden;
}
.cal-hero::before { content: ""; position: absolute; inset: 0; opacity: .07; background-image: repeating-linear-gradient(90deg, #fff 0 1px, transparent 1px 40px); }
.cal-hero-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cal-hero .subtitle { font-family: var(--font-serif); font-style: italic; color: var(--gold-soft); }
.cal-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.calendar { margin-bottom: 8px; }
.cal-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav .btn { min-width: 38px; }
.cal-title { font-family: var(--font-display); font-weight: 800; color: var(--maroon-dark); font-size: 1.3rem; margin-left: 6px; min-width: 180px; }
.cal-views { display: flex; gap: 2px; background: var(--parchment-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-left: auto; }
.cal-view-btn { border: none; background: none; font-family: var(--font-sans); font-weight: 700; font-size: .8rem; color: var(--ink-soft); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.cal-view-btn:hover { color: var(--maroon); }
.cal-view-btn.active { background: var(--maroon); color: #fff; box-shadow: var(--shadow-sm); }
.cal-toolbar > .btn:last-child { margin-left: 4px; }

.cal-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.cal-filter { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: .76rem; font-weight: 700; letter-spacing: .2px; color: var(--ink-soft); background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; opacity: .5; transition: opacity .15s, border-color .15s, background .15s; }
.cal-filter .cal-filter-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--chip, var(--maroon)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.cal-filter.on { opacity: 1; color: var(--ink); background: var(--white); border-color: var(--chip); }
.cal-filter:not(.on) { text-decoration: line-through; }
.cal-legend { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--ink-soft); margin-left: auto; }

.cal-elig { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: var(--success); color: #fff; font-size: .6rem; font-weight: 800; margin-left: 3px; box-shadow: 0 0 0 1.5px var(--cream); flex: 0 0 auto; }

.cal-surface { position: relative; }
.cal-viewport { overflow-x: auto; }
.cal-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(251,247,236,.6); border-radius: var(--radius); }
.cal-loading[hidden] { display: none; }

/* Month grid */
.cal-month { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--cream); box-shadow: var(--shadow-sm); min-width: 640px; }
.cal-dow-row { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--maroon); }
.cal-dow { padding: 8px 6px; text-align: center; font-size: .7rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-soft); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day { min-height: 116px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 4px 5px 6px; background: var(--white); position: relative; transition: background .12s; }
.cal-day:nth-child(7n) { border-right: none; }
.cal-day.out { background: repeating-linear-gradient(135deg, #f5f1e6, #f5f1e6 6px, #f1ecdd 6px, #f1ecdd 12px); }
.cal-day.out .cal-day-num { color: var(--ink-soft); opacity: .6; }
.cal-day.today { background: #fdfaf0; box-shadow: inset 0 0 0 2px var(--gold); }
.calendar[data-config-id] .cal-day[data-add-date] { cursor: pointer; }
.cal-day[data-add-date]:hover { background: #fbf4e2; }
.cal-day-num { text-align: right; font-family: var(--font-display); font-weight: 700; font-size: .9rem; color: var(--ink); padding: 1px 2px; }
.cal-day.today .cal-day-num span { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; background: var(--maroon); color: #fff; border-radius: 50%; font-size: .8rem; }
.cal-day-events { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.cal-chip { display: flex; align-items: center; gap: 4px; width: 100%; text-align: left; border: none; cursor: pointer; font-family: var(--font-sans); font-size: .72rem; font-weight: 600; line-height: 1.25; color: var(--chip-text, #fff); background: var(--chip, var(--maroon)); border-radius: 5px; padding: 2px 6px; overflow: hidden; }
.cal-chip:hover { filter: brightness(1.07); }
.cal-chip.canceled { opacity: .5; text-decoration: line-through; }
.cal-chip-dot { display: none; }
.cal-chip-time { font-weight: 700; opacity: .9; flex: 0 0 auto; }
.cal-chip-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip .cal-elig { box-shadow: 0 0 0 1.5px rgba(255,255,255,.5); margin-left: auto; }
.cal-more { border: none; background: none; color: var(--maroon); font-size: .7rem; font-weight: 700; cursor: pointer; padding: 1px 4px; text-align: left; }
.cal-more:hover { text-decoration: underline; }

/* Week grid */
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; min-width: 720px; }
.cal-week-col { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.cal-week-col.today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow-sm); }
.cal-week-head { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 10px; background: var(--parchment-2); border-bottom: 1px solid var(--line); }
.cal-week-col.today .cal-week-head { background: var(--maroon); color: #fff; }
.cal-week-dow { font-size: .7rem; text-transform: uppercase; letter-spacing: .8px; font-weight: 800; color: var(--ink-soft); }
.cal-week-col.today .cal-week-dow { color: var(--gold-soft); }
.cal-week-date { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.cal-week-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 90px; }
.cal-week-empty { color: var(--line); text-align: center; padding: 12px 0; }
[data-add-date].cal-week-head { cursor: pointer; }

/* List / day / agenda shared item */
.cal-list, .cal-day-view .cal-list { display: flex; flex-direction: column; gap: 8px; }
.cal-list-item { display: flex; gap: 10px; align-items: stretch; text-align: left; width: 100%; border: 1px solid var(--line); background: var(--cream); border-radius: var(--radius-sm); padding: 0; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .1s, box-shadow .15s; }
.cal-list-item:hover { transform: translateX(2px); box-shadow: var(--shadow-md); }
.cal-list-item.canceled { opacity: .6; }
.cal-list-bar { width: 5px; background: var(--chip, var(--maroon)); flex: 0 0 auto; }
.cal-list-main { padding: 9px 12px; display: flex; flex-direction: column; gap: 1px; }
.cal-list-title { font-weight: 700; color: var(--maroon-dark); font-size: .95rem; }
.cal-list-meta { font-size: .8rem; color: var(--ink-soft); }
.cal-day-view { max-width: 640px; }

.cal-agenda { display: flex; flex-direction: column; gap: 8px; }
.cal-agenda-day { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.cal-agenda-day:first-child { margin-top: 0; }
.cal-agenda-dow { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--gold-dark); }
.cal-agenda-date { font-family: var(--font-display); font-weight: 800; color: var(--maroon-dark); }
.cal-agenda-day.today .cal-agenda-date { color: var(--maroon); }
.cal-agenda-day.today::after { content: "Today"; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: #fff; background: var(--maroon); border-radius: 999px; padding: 1px 8px; }

/* Calendar modals */
.cal-form-modal { max-width: 640px; }
.cal-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.cal-type-badge, .cal-detail-type .cal-type-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--chip-text, #fff); background: var(--chip, var(--maroon)); border-radius: 999px; padding: 4px 11px; }
.cal-detail-list { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 6px 0 4px; }
.cal-detail-list dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft); font-weight: 700; }
.cal-detail-list dd { margin: 0; color: var(--ink); }
.cal-level-checks { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.cal-chk { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: .88rem; margin: 0; cursor: pointer; }
.cal-chk input { width: auto; }
.cal-toggle-row { display: flex; gap: 18px; flex-wrap: wrap; margin: 6px 0 4px; }

/* Recurring weekday picker */
.cal-weekday-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-weekday { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-weight: 700; font-size: .82rem; color: var(--ink-soft); cursor: pointer; margin: 0; user-select: none; }
.cal-weekday input { position: absolute; opacity: 0; width: 0; }
.cal-weekday.on, .cal-weekday:has(input:checked) { background: var(--maroon); color: #fff; border-color: var(--maroon-dark); }

/* =====================================================================
   Metrics dashboard
   ===================================================================== */
.m-kpi-grid { grid-template-columns: repeat(5, 1fr); }
.m-kpi .stat-value { display: flex; align-items: baseline; gap: 2px; }
.m-kpi-dash { color: var(--ink-soft); font-weight: 400; margin: 0 2px; }
.m-kpi-donut { display: flex; align-items: center; justify-content: center; padding: 8px; }
.m-donut { width: 118px; height: 118px; }
.m-donut-num { font-family: var(--font-display); font-weight: 800; font-size: 26px; fill: var(--maroon-dark); }
.m-donut-sub { font-size: 10px; fill: var(--ink-soft); text-transform: uppercase; letter-spacing: 1px; }

.m-spotlight { display: flex; align-items: center; gap: 18px; border-left: 4px solid var(--gold); }
.m-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold-soft); background: var(--parchment-2); flex: 0 0 auto; }
.m-spotlight .m-avatar { width: 72px; height: 72px; }
.m-streak-badge { background: linear-gradient(160deg, #ffb347, #e8710a); color: #3a1e02; }

/* Trend chart */
.m-chart-scroll { overflow-x: auto; }
.m-trend { width: 100%; min-width: 480px; height: auto; }
.m-grid { stroke: var(--line-soft); stroke-width: 1; }
.m-axis { fill: var(--ink-soft); font-size: 11px; font-family: var(--font-sans); }
.m-trend-area { fill: rgba(124,29,43,.10); }
.m-trend-line { fill: none; stroke: var(--maroon); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.m-trend-dot { fill: var(--maroon); stroke: var(--cream); stroke-width: 2; }
.m-trend-label { fill: var(--maroon-dark); font-family: var(--font-display); font-weight: 800; font-size: 13px; }
.m-trend-xlabels { display: flex; justify-content: space-between; font-size: .76rem; color: var(--ink-soft); padding-right: 16px; margin-top: 2px; }

/* Legends, swatches, bars, meters */
.m-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.m-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--ink); }
.m-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
.m-bar { display: inline-block; width: 90px; max-width: 42vw; height: 9px; background: var(--parchment-2); border-radius: 999px; overflow: hidden; vertical-align: middle; }
.m-bar-fill { display: block; height: 100%; border-radius: 999px; }
.m-bar-val { font-variant-numeric: tabular-nums; font-weight: 700; margin-left: 8px; font-size: .85rem; }
.m-meter { display: block; width: 100%; height: 7px; background: var(--parchment-2); border-radius: 999px; overflow: hidden; margin: 4px 0 2px; }
.m-meter-fill { display: block; height: 100%; border-radius: 999px; }
.m-weapon-table td, .m-weapon-table th { padding: 9px 10px; }

/* Mini breakdown cards */
.m-mini-label { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gold-dark); font-weight: 700; margin-bottom: 6px; }
.m-mini-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.m-mini { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.m-mini-h { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft); font-weight: 700; }
.m-mini-v { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--maroon-dark); line-height: 1.1; }
.m-mini-s { font-size: .78rem; color: var(--ink-soft); }

/* Ranking / leaderboards */
.m-rank { list-style: none; counter-reset: rank; padding: 0; margin: 0; }
.m-rank-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.m-rank-item:last-child { border-bottom: none; }
.m-rank-no { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: .85rem; background: var(--parchment-2); color: var(--ink-soft); border: 1px solid var(--line); }
.m-rank-no.r1 { background: linear-gradient(160deg, var(--gold), var(--gold-dark)); color: #3a2c08; border-color: var(--gold-dark); }
.m-rank-no.r2 { background: linear-gradient(160deg, #e7e7ea, #b9bcc4); color: #35383f; border-color: #a9adb6; }
.m-rank-no.r3 { background: linear-gradient(160deg, #e2b184, #b9793f); color: #3d2409; border-color: #a86c37; }
.m-rank-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.m-rank-name { font-weight: 700; color: var(--maroon-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-rank-meta { margin-top: 1px; }
.m-rank-stat { flex: 0 0 auto; font-size: .9rem; color: var(--ink); text-align: right; }

.m-scorer { list-style: none; padding: 0; margin: 0; }
.m-scorer li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.m-scorer-name { flex: 1 1 40%; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-scorer-val { flex: 0 0 auto; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--maroon-dark); }
.m-scorer .m-bar { flex: 1 1 auto; }

.m-improved { list-style: none; padding: 0; margin: 0; }
.m-improved li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.m-improved li:last-child { border-bottom: none; }
.m-improved-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.m-improved-name { font-weight: 700; color: var(--ink); }
.m-improved-delta { font-size: .8rem; color: var(--success); font-weight: 600; }

.m-streak-list { list-style: none; padding: 0; margin: 0; }
.m-streak-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.m-streak-list li:last-child { border-bottom: none; }
.m-streak-name { flex: 1 1 auto; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-streak-flames { flex: 0 0 auto; letter-spacing: -3px; }
.m-streak-n { flex: 0 0 auto; font-weight: 800; color: #e8710a; font-size: .85rem; }

.m-elig-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-elig { text-align: center; border-radius: var(--radius-sm); padding: 14px; border: 1px solid; }
.m-elig.eligible { background: #e4f2e8; border-color: #b8dcc4; }
.m-elig.ineligible { background: #f8e6e6; border-color: #e6c2c2; }
.m-elig-n { font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1; }
.m-elig.eligible .m-elig-n { color: #226b41; }
.m-elig.ineligible .m-elig-n { color: #a13232; }
.m-elig-l { font-size: .74rem; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; color: var(--ink-soft); }

.m-upcoming { list-style: none; padding: 0; margin: 0; }
.m-upcoming li { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.m-upcoming li:last-child { border-bottom: none; }
.m-up-date { flex: 0 0 auto; font-family: var(--font-display); font-weight: 800; color: var(--maroon); min-width: 54px; }
.m-up-name { color: var(--ink); }

/* Recurring preview */
.m-preview-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.m-preview-chip { display: inline-flex; gap: 5px; align-items: baseline; background: var(--parchment-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: .82rem; }
.m-preview-chip strong { color: var(--maroon); }

/* Metrics + calendar responsive */
@media (max-width: 960px) {
    .m-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .m-mini-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
    .cal-views { margin-left: 0; width: 100%; justify-content: space-between; }
    .cal-toolbar > .btn:last-child, .cal-nav { width: auto; }
    .cal-title { min-width: 0; font-size: 1.1rem; }
    .m-kpi-grid { grid-template-columns: 1fr 1fr; }
    .m-mini-row { grid-template-columns: 1fr 1fr 1fr; }
    .cal-day { min-height: 92px; }
    .cal-chip-time { display: none; }
    .cal-hero { padding: 22px 18px; }
}
@media (max-width: 460px) {
    .m-kpi-grid { grid-template-columns: 1fr 1fr; }
    .cal-day-num { font-size: .78rem; }
    .cal-chip-title { font-size: .68rem; }
}

/* =====================================================================
   Awards — the Trophy Case
   A struck-metal medallion (conic sheen + milled rim), mounted on a gilt
   card, filed under an engraved season band. Tiers restyle the metal
   only, so gold/silver/bronze/honor read as one family.
   ===================================================================== */

/* ---------- Medallion ---------- */
.award-medal {
    position: relative; flex: none; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    /* Conic sweep = light catching a struck face as it turns. */
    background:
        conic-gradient(from 210deg,
            #fff6d8 0deg, var(--metal-hi) 40deg, var(--metal-mid) 100deg,
            var(--metal-lo) 165deg, var(--metal-mid) 230deg, var(--metal-hi) 300deg,
            #fff6d8 360deg);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, .38),          /* milled rim highlight */
        inset 0 0 0 3px var(--metal-rim),                   /* rim */
        inset 0 -6px 12px rgba(40, 20, 4, .28),             /* underside shading */
        0 3px 8px rgba(61, 10, 16, .34);
    transition: transform .35s cubic-bezier(.2, .7, .25, 1), box-shadow .3s ease;
}
/* Inner engraved ring, so the glyph sits in a recessed field. */
.award-medal::after {
    content: ""; position: absolute; inset: 14%; border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(40, 20, 4, .38), 0 1px 0 rgba(255, 255, 255, .4);
}
.award-medal .medal-face { position: relative; z-index: 1; line-height: 1; filter: drop-shadow(0 1px 1px rgba(40, 20, 4, .4)); }

/* Tier = which metal is struck. */
.medal-gold   { --metal-hi: #f6dc95; --metal-mid: #d8ad4e; --metal-lo: #9a7327; --metal-rim: rgba(122, 88, 26, .7); }
.medal-silver { --metal-hi: #f4f6f8; --metal-mid: #c3cbd3; --metal-lo: #8b959f; --metal-rim: rgba(105, 115, 125, .6); }
.medal-bronze { --metal-hi: #f0c9a4; --metal-mid: #c98a55; --metal-lo: #8d5730; --metal-rim: rgba(112, 68, 38, .65); }
.medal-honor  { --metal-hi: #f3e6cd; --metal-mid: #cbb894; --metal-lo: #8e7c5c; --metal-rim: rgba(110, 96, 70, .55); }

.medal-lg { width: 74px; height: 74px; font-size: 1.85rem; }
.medal-sm { width: 42px; height: 42px; font-size: 1.05rem; }
.medal-xs { width: 30px; height: 30px; font-size: .8rem; }

/* ---------- Trophy hall banner ---------- */
.trophy-hall {
    position: relative; overflow: hidden; border-radius: var(--radius);
    padding: 34px 28px 30px; margin-bottom: 24px; text-align: center;
    color: var(--cream);
    background: radial-gradient(circle at 50% -20%, var(--maroon) 0%, var(--maroon-dark) 55%, var(--maroon-deep) 100%);
    border: 1px solid var(--maroon-deep);
    box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(200, 162, 74, .35);
}
/* Radiating light behind the title, like a display case spotlight. */
.trophy-hall::before {
    content: ""; position: absolute; inset: -40% -10% auto; height: 180%; opacity: .16;
    background: repeating-conic-gradient(from 0deg at 50% 0%,
        var(--gold-soft) 0deg 4deg, transparent 4deg 14deg);
    pointer-events: none;
}
.trophy-hall > * { position: relative; }
.trophy-hall h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0; color: var(--cream); }
.trophy-hall .lede { color: var(--gold-soft); margin: .4em auto 0; max-width: 56ch; font-size: .95rem; }
.trophy-hall .rule { display: block; width: 180px; height: 2px; margin: 14px auto 20px; background: var(--gold-sheen); }
.trophy-stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.trophy-stat {
    min-width: 104px; padding: 10px 16px; border-radius: var(--radius-sm);
    background: rgba(20, 5, 8, .34); border: 1px solid rgba(200, 162, 74, .34);
}
.trophy-stat .n { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; color: var(--gold-soft); line-height: 1.1; }
.trophy-stat .l { font-size: .64rem; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(246, 239, 223, .78); font-weight: 700; }

/* ---------- Season band ---------- */
.season-band { display: flex; align-items: center; gap: 14px; margin: 30px 0 16px; }
.season-band:first-child { margin-top: 6px; }
.season-band .yr {
    font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--maroon-dark);
    white-space: nowrap;
}
.season-band .yr .fleur { color: var(--gold-dark); margin-right: 8px; font-size: .85em; }
.season-band .line { flex: 1; height: 2px; background: var(--gold-sheen); opacity: .75; }
.season-band .n { font-size: .72rem; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }

/* ---------- Award card ---------- */
.award-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.award-card {
    position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 24px 20px 20px; border-radius: var(--radius); overflow: hidden;
    background: linear-gradient(168deg, var(--white), var(--cream) 55%, var(--parchment-2));
    border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    transition: transform .24s cubic-bezier(.2, .7, .25, 1), box-shadow .3s ease, border-color .3s ease;
}
/* Gilt matting, matching the roster's member cards. */
.award-card::after {
    content: ""; position: absolute; inset: 0; border-radius: var(--radius); pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(200, 162, 74, .3); opacity: .6; transition: opacity .3s ease, box-shadow .3s ease;
}
/* Tier-tinted wash bleeding down from behind the medallion. */
.award-card::before {
    content: ""; position: absolute; top: -60px; left: 50%; width: 220px; height: 180px;
    transform: translateX(-50%); pointer-events: none; opacity: .5;
    background: radial-gradient(circle, var(--wash, rgba(200, 162, 74, .3)), transparent 68%);
}
.award-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--gold-soft); }
.award-card:hover::after { opacity: 1; box-shadow: inset 0 0 0 1px rgba(200, 162, 74, .62); }
.award-card:hover .award-medal { transform: translateY(-2px) rotate(-4deg) scale(1.05); }
.award-card.tier-gold   { --wash: rgba(216, 173, 78, .38); }
.award-card.tier-silver { --wash: rgba(160, 174, 187, .34); }
.award-card.tier-bronze { --wash: rgba(201, 138, 85, .32); }
.award-card.tier-honor  { --wash: rgba(184, 166, 132, .3); }

.award-card .award-name { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; color: var(--maroon-dark); margin: 14px 0 0; }
/* Engraved ribbon carrying the placement/qualifier. */
.award-ribbon {
    display: inline-block; margin-top: 8px; padding: 3px 14px; border-radius: 999px;
    font-size: .68rem; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase;
    background: linear-gradient(160deg, var(--maroon), var(--maroon-dark));
    color: var(--gold-soft); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 3px rgba(61, 10, 16, .3);
}
.award-card .award-season { font-size: .72rem; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; margin-top: 10px; }
.award-card .award-note { font-family: var(--font-serif); font-style: italic; font-size: .84rem; color: var(--ink-soft); margin: 10px 0 0; }

/* Recipient strip along the bottom of the card. */
.award-recipient {
    display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px;
    width: 100%; border-top: 1px dashed var(--gold-soft); text-align: left;
}
.award-recipient img {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none;
    border: 1px solid var(--gold-soft); box-shadow: 0 1px 4px rgba(61, 10, 16, .22);
}
.award-recipient .who { min-width: 0; }
.award-recipient .nm { font-weight: 700; font-size: .92rem; color: var(--maroon-dark); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.award-recipient .mt { font-size: .74rem; color: var(--ink-soft); }
a.award-recipient:hover .nm { text-decoration: underline; }

/* ---------- Compact shelf (profile page + dashboard) ---------- */
.award-shelf { display: flex; flex-direction: column; gap: 10px; }
.award-shelf-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
    background: linear-gradient(140deg, var(--white), var(--cream));
    border: 1px solid var(--line-soft); transition: border-color .2s ease, transform .16s ease, box-shadow .2s ease;
}
.award-shelf-item:hover { border-color: var(--gold-soft); transform: translateX(2px); box-shadow: var(--shadow-sm); }
.award-shelf-item .txt { min-width: 0; }
.award-shelf-item .nm { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--maroon-dark); }
.award-shelf-item .mt { font-size: .76rem; color: var(--ink-soft); }
.award-shelf-item .yr {
    margin-left: auto; flex: none; font-size: .7rem; font-weight: 800; letter-spacing: .8px;
    color: var(--ink-soft); text-transform: uppercase;
}

/* Award count chip on a roster/profile header. */
.award-count {
    display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800;
    letter-spacing: .6px; text-transform: uppercase; padding: 4px 12px; border-radius: 999px;
    background: linear-gradient(155deg, #fbeaa8, #e9c96e 45%, var(--gold)); color: #4a2f08;
    border: 1px solid rgba(120, 86, 26, .5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 3px rgba(61, 10, 16, .25);
}

/* Tier chips (filters + admin tables). */
.badge-tier { border-width: 1px; }
.tier-gold   { background: linear-gradient(155deg, #fbeaa8, #e9c96e 50%, var(--gold)); color: #4a2f08; border-color: rgba(120, 86, 26, .5); }
.tier-silver { background: linear-gradient(155deg, #f7f9fb, #dbe1e7 50%, #c3cbd3); color: #3f4952; border-color: #b3bcc5; }
.tier-bronze { background: linear-gradient(155deg, #f6ddc6, #ddab7f 50%, #c98a55); color: #5a3418; border-color: #b98a63; }
.tier-honor  { background: linear-gradient(155deg, #f7f1e3, #e3d8bf 50%, #cbb894); color: #5b5138; border-color: #c3b493; }

@media (max-width: 640px) {
    .award-grid { grid-template-columns: 1fr; }
    .trophy-stat { min-width: 84px; padding: 8px 12px; }
    .trophy-stat .n { font-size: 1.35rem; }
    .season-band .yr { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .award-card, .award-medal, .award-shelf-item { transition: none; }
    .award-card:hover { transform: none; }
    .award-card:hover .award-medal { transform: none; }
    .award-shelf-item:hover { transform: none; }
}

/* ---------- Print ---------- */
@media (max-width: 720px) {
    .help-tip .tip { max-width: 200px; }
}

@media print {
    .masthead, .chapter-nav, footer.site, .no-print, .btn, .filters, .admin-side,
    details.help-panel, .help-tip, .flash .flash-close, .guide-toc { display: none !important; }
    .admin-shell { display: block; }
    body { background: #fff; }
    .card, .stat-card { box-shadow: none; border-color: #ccc; }
}
