/* ============================================
   Dashboard Styles
   ============================================ */

/* Psalm 139 verse banner — injected under .dash-nav by dash-menu.js on every
 * dashboard page. The troop number TX-0139 was chosen for Psalm 139, and this
 * banner rotates through a curated set of verses from the chapter so families
 * see a fresh line each visit. The whole banner is clickable; tapping it
 * opens the .dash-verse-dialog explaining the TX-0139 → Psalm 139 connection.
 * Rendered as a <button> for keyboard + screen-reader accessibility, with
 * default button chrome reset so it still reads visually as a banner strip. */
.dash-verse-banner {
    display: block;
    width: 100%;
    background: #f7f4ed;
    border: 0;
    border-bottom: 1px solid var(--gray-200);
    padding: 14px 24px;
    margin: 0;
    text-align: inherit;
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.dash-verse-banner:hover,
.dash-verse-banner:focus-visible {
    background: #f0ebdc;
    outline: none;
}
.dash-verse-banner:focus-visible {
    box-shadow: inset 0 0 0 2px var(--crimson);
}
[data-theme="dark"] .dash-verse-banner { background: #201D1A; }
[data-theme="dark"] .dash-verse-banner:hover,
[data-theme="dark"] .dash-verse-banner:focus-visible { background: #2A2724; }
.dash-verse-content {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}
.dash-verse-text {
    font-style: italic;
    font-size: 0.95rem;
    color: var(--brown-dark);
    line-height: 1.55;
    margin: 0 0 4px;
}
.dash-verse-ref {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
    margin: 0;
}
@media (max-width: 600px) {
    .dash-verse-banner { padding: 12px 16px; }
    .dash-verse-text { font-size: 0.88rem; }
}

/* Modal opened by tapping the verse banner — explains the TX-0139 connection
 * to Psalm 139 for any family curious about the troop name. Native <dialog>
 * + form method="dialog" close button, click-outside-to-dismiss, Esc to
 * close, focus trap — all built in. */
.dash-verse-dialog {
    border: 0;
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 460px;
    width: calc(100vw - 32px);
    box-shadow: var(--shadow-lg);
    color: var(--brown-dark);
    background: var(--white);
}
.dash-verse-dialog::backdrop {
    background: rgba(30, 27, 22, 0.55);
}
.dash-verse-dialog form[method="dialog"] {
    margin: 0;
    text-align: right;
    padding: 8px 8px 0;
}
.dash-verse-dialog-close {
    border: 0;
    background: transparent;
    color: var(--gray-500);
    font-size: 1.5rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.dash-verse-dialog-close:hover,
.dash-verse-dialog-close:focus-visible {
    background: var(--gray-100);
    color: var(--brown-dark);
    outline: none;
}
.dash-verse-dialog-content {
    padding: 4px 28px 28px;
}
.dash-verse-dialog-content h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--brown-dark);
    margin: 0 0 14px;
}
.dash-verse-dialog-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--gray-700);
    margin: 0 0 14px;
}
.dash-verse-dialog-link {
    margin-top: 18px !important;
}
.dash-verse-dialog-link a {
    color: var(--crimson);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
    font-weight: 600;
}
.dash-verse-dialog-link a:hover {
    color: var(--crimson-dark);
}

:root {
    --crimson: #BA272C;
    --crimson-dark: #8E1E22;
    --tl-blue: #004B87;
    --green-forest: #2D5E2A;
    --brown-dark: #3E2E18;
    --brown: #5C4A2F;
    --cream: #D8CCB7;
    --white: #FAFAF7;
    --gray-100: #F0EDE6;
    --gray-200: #DDD8CE;
    --gray-500: #8C8578;
    --gray-700: #4A453D;
    --gray-900: #1E1B16;

    --tl-green: #2D5E2A;
    --brand-green: #2D5E2A;
    --tl-border: #e0e0e0;
    --clay: #876237;

    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-md: 0 4px 16px rgba(30,27,22,0.10);
    --shadow-lg: 0 8px 32px rgba(30,27,22,0.14);
}

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

/* The body is hidden until auth-guard verifies the session, so during a page
 * load the only thing painting is <html>. Give it the app background (html
 * carries data-theme, so the var resolves per-theme) — otherwise every
 * navigation flashes a white screen. */
html {
    background: var(--gray-100);
}

/* Text-size preference (settings gear): scales every rem-based size on the
 * page. Medium = browser default 16px. */
html[data-font="small"] { font-size: 14.5px; }
html[data-font="large"] { font-size: 17.5px; }

body {
    font-family: var(--font-body);
    background: var(--gray-100);
    color: var(--gray-900);
    min-height: 100vh;
    visibility: hidden;
}
body.authenticated {
    visibility: visible;
}

/* Fast-path reveal (see theme-boot.js): when the last auth verification is
 * fresh, show the page immediately instead of hiding it behind this
 * navigation's re-verification round-trip. Spinner suppressed too. */
html.tl-fastauth body {
    visibility: visible;
}
html.tl-fastauth body:not(.authenticated)::after {
    display: none;
}

/* Loading spinner while auth-guard holds the page hidden. A pseudo-element may
 * override its parent's visibility:hidden, so this is visible even though the
 * body isn't. The delayed fade keeps fast loads from flashing a spinner. */
body:not(.authenticated)::after {
    content: '';
    visibility: visible;
    position: fixed;
    top: 50%;
    left: 50%;
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
    border-radius: 50%;
    border: 3px solid var(--gray-200);
    border-top-color: var(--crimson);
    opacity: 0;
    animation: dashspin 0.8s linear infinite, dash-loading-fade 0.25s ease 0.35s forwards;
}
@keyframes dash-loading-fade { to { opacity: 1; } }

/* Cross-document view transitions (Chrome 126+/Safari 18.2+): keep the old
 * page on screen until the new one first renders, then crossfade — removes the
 * blank gap between dashboard pages. Older browsers ignore this at-rule. */
@view-transition {
    navigation: auto;
}

/* Persistent app chrome. Two pieces make the top nav and bottom tab bar feel
 * like they never leave the screen between pages:
 * 1. visibility:visible — they paint immediately, overriding the body's
 *    pre-auth visibility:hidden (they contain nothing sensitive), so they're
 *    in the page's FIRST render and thus in the view-transition snapshot.
 * 2. view-transition-name — each bar becomes its own transition group; since
 *    the outgoing and incoming snapshots are pixel-identical, the crossfade is
 *    invisible and the bars appear to simply stay put. */
.dash-nav {
    visibility: visible;
    view-transition-name: dash-nav;
}
.tl-tabbar {
    visibility: visible;
    view-transition-name: tl-tabbar;
}

/* Bottom tab bar (mounted by tabbar-boot.js during parse; see that file).
 * Styles live here — render-blocking CSS — so the bar is styled in the first
 * paint. Previously injected as a <style> by dash-menu.js, which arrived too
 * late and made the bar flash unstyled/absent on every navigation. */
.tl-tabbar { display: none; }
@media (max-width: 768px) {
    /* Leave room for the floating pill (its height + lift + safe area). */
    body.authenticated,
    html.tl-fastauth body { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
    /* Floating rounded pill lifted off the bottom edge (iOS-style), so the
     * phone's rounded screen corners don't clip it. */
    .tl-tabbar {
        display: flex;
        position: fixed;
        left: 14px;
        right: 14px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
        z-index: 900;
        background: rgba(255, 255, 255, 0.86);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        border: 1px solid var(--gray-200, #e5e2da);
        border-radius: 30px;
        box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18);
        padding: 8px 8px;
    }
    body.tl-hide-tabbar .tl-tabbar { display: none; }
    .tl-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 8px 0 7px;
        margin: 0 2px;
        background: none;
        border: none;
        cursor: pointer;
        text-decoration: none;
        position: relative;
        color: var(--gray-500, #8C8578);
        font-family: inherit;
        font-size: 11px;
        font-weight: 600;
        border-radius: 20px;
        transition: background 0.15s, color 0.15s;
    }
    .tl-tab svg {
        width: 26px;
        height: 26px;
        stroke: currentColor;
        stroke-width: 2;
        fill: none;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .tl-tab.active { color: #004B87; background: rgba(0, 75, 135, 0.10); }
    .tl-tab-badge {
        position: absolute;
        top: 3px;
        left: calc(50% + 7px);
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border-radius: 9px;
        background: #C8102E;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 17px;
        text-align: center;
        box-sizing: border-box;
    }
}
[data-theme="dark"] .tl-tabbar { background: rgba(28, 25, 20, 0.9); border-color: #3a352d; }
[data-theme="dark"] .tl-tab { color: #b8b2a6; }
[data-theme="dark"] .tl-tab.active { color: #7fb0e0; background: rgba(127, 176, 224, 0.16); }
/* Directional page transitions (mobile widths). theme-boot.js stamps
 * data-tl-nav on <html> before first paint: "fwd" for a tapped link (new page
 * slides in from the RIGHT, old slides away left) and "back" for history
 * traversal (reverse). The pinned bars have their own view-transition-names,
 * so they sit still while only the content pane slides. Without the stamp
 * (direct loads, reloads) the default crossfade applies. */
@media (max-width: 768px) {
    :root[data-tl-nav="fwd"]::view-transition-old(root) {
        animation: tl-page-out-left 0.28s cubic-bezier(0.3, 0.7, 0.4, 1) both;
    }
    :root[data-tl-nav="fwd"]::view-transition-new(root) {
        animation: tl-page-in-right 0.28s cubic-bezier(0.3, 0.7, 0.4, 1) both;
        z-index: 2;
    }
    :root[data-tl-nav="back"]::view-transition-old(root) {
        animation: tl-page-out-right 0.28s cubic-bezier(0.3, 0.7, 0.4, 1) both;
        z-index: 2;
    }
    :root[data-tl-nav="back"]::view-transition-new(root) {
        animation: tl-page-in-left 0.28s cubic-bezier(0.3, 0.7, 0.4, 1) both;
    }
}
@keyframes tl-page-in-right { from { transform: translateX(100%); } to { transform: none; } }
@keyframes tl-page-out-left { from { transform: none; opacity: 1; } to { transform: translateX(-28%); opacity: 0.7; } }
@keyframes tl-page-in-left { from { transform: translateX(-28%); opacity: 0.7; } to { transform: none; opacity: 1; } }
@keyframes tl-page-out-right { from { transform: none; } to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}

/* --- Nav --- */
.dash-nav {
    background: var(--gray-900);
    padding: 0 24px;
    /* With viewport-fit=cover the page draws under the iPhone status bar —
     * extend the nav's dark box up through it so the app reads as one dark
     * header from the physical top of the screen. */
    padding-top: max(env(safe-area-inset-top, 0px), var(--tl-safe-top, 0px));
    height: calc(56px + max(env(safe-area-inset-top, 0px), var(--tl-safe-top, 0px)));
}

/* Fixed dark strip pinned over the status-bar zone so page content scrolling
 * past the (non-fixed) nav disappears behind it instead of colliding with the
 * clock/battery. Height is 0 everywhere except notched phones with
 * viewport-fit=cover, so desktop and Android are unaffected. */
html::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: max(env(safe-area-inset-top, 0px), var(--tl-safe-top, 0px));
    background: #1E1B16;
    z-index: 950;
    pointer-events: none;
}
html[data-theme="dark"]::after {
    background: #111;
}
.dash-nav-inner {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.dash-nav-brand {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.04em;
}
.dash-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.dash-nav-user {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    transition: color 0.15s;
}
.dash-nav-user[data-click-wired]:hover {
    color: #fff;
    text-decoration: underline;
}
.dash-nav-link {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.2s;
}
.dash-nav-link:hover {
    color: #fff;
}
.dash-nav-signout {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    font-family: var(--font-body);
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}
.dash-nav-signout:hover {
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

/* --- Main content --- */
.dash-main {
    padding: 48px 24px;
}
.dash-container {
    max-width: 1140px;
    margin: 0 auto;
}
.dash-main h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--brown-dark);
    margin-bottom: 8px;
}
.dash-welcome {
    font-size: 1rem;
    color: var(--gray-500);
    margin-bottom: 40px;
}

/* Add-a-Trailman prompt — appears at the top of the dashboard and the family
   page when a family has zero trailmen. The whole card is the click target. */
.dash-add-trailman {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    margin-bottom: 24px;
    padding: 22px 26px;
    background: linear-gradient(135deg, #FFF7E0 0%, #FFEEC2 100%);
    border: none;
    border-left: 6px solid #BA272C;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(186, 39, 44, 0.12);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.1s, box-shadow 0.1s;
}
.dash-add-trailman:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(186, 39, 44, 0.18);
}
.dash-add-trailman-body {
    flex: 1;
    min-width: 0;
}
.dash-add-trailman-title {
    margin: 0 0 4px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: #7A1418;
}
.dash-add-trailman-text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #4A453D;
}
.dash-add-trailman-cta {
    flex-shrink: 0;
    background: #BA272C;
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
[data-theme="dark"] .dash-add-trailman {
    background: linear-gradient(135deg, #4A3A1F 0%, #3D2D14 100%);
    border-left-color: #E04B52;
}
[data-theme="dark"] .dash-add-trailman-title { color: #FFE2A8; }
[data-theme="dark"] .dash-add-trailman-text { color: #C4B8A4; }
@media (max-width: 600px) {
    .dash-add-trailman {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .dash-add-trailman-cta { text-align: center; }
}

/* --- Widgets --- */
.dash-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}
@media (max-width: 800px) {
    .dash-widgets { grid-template-columns: 1fr; }
}

.dash-widget {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 22px 24px;
    /* Without min-width:0, a long unbreakable child (e.g. an event location)
       expands the widget past its grid cell on narrow screens. */
    min-width: 0;
    overflow-wrap: anywhere;
}
[data-theme="dark"] .dash-widget { background: #2A2826; }

/* Sign-Up Checklist widget — full-width, prominent. The point is to nudge people
   to finish onboarding, so it should stand out and stay above other widgets. */
.dash-widget-checklist {
    margin-bottom: 24px;
    padding: 26px 28px;
    background: linear-gradient(135deg, #FFF7E0 0%, #FFEEC2 100%);
    border-left: 6px solid #BA272C;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(186, 39, 44, 0.12);
}
.dash-widget-checklist .dash-widget-head {
    border-bottom-color: rgba(186, 39, 44, 0.18);
}
.dash-widget-checklist .dash-widget-head h2 {
    color: #7A1418;
    font-size: 1.1rem;
}
.dash-widget-checklist .dash-widget-link {
    color: #BA272C;
}
[data-theme="dark"] .dash-widget-checklist {
    background: linear-gradient(135deg, #4A3A1F 0%, #3D2D14 100%);
    border-left-color: #E04B52;
}
[data-theme="dark"] .dash-widget-checklist .dash-widget-head h2 { color: #FFE2A8; }
[data-theme="dark"] .dash-widget-checklist .dash-widget-link { color: #E04B52; }

/* Donate widget — soft CTA, distinct from content widgets. */
.dash-widget-donate {
    background: linear-gradient(135deg, #F4EFE5 0%, #E8DFCB 100%);
    border-left: 4px solid #BA272C;
}
.dash-widget-donate .dash-widget-head h2 { color: #3E2E18; }
.dash-donate-pitch {
    margin: 0 0 8px;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #4A453D;
}
.dash-donate-pitch strong { color: #3E2E18; }
.dash-donate-tax {
    margin: 0 0 14px;
    font-size: 0.78rem;
    color: var(--gray-500);
}
.dash-donate-btn {
    display: inline-block;
    background: #BA272C;
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: background 0.15s;
}
.dash-donate-btn:hover { background: #9E1D22; }
[data-theme="dark"] .dash-widget-donate {
    background: linear-gradient(135deg, #2F2620 0%, #1F1814 100%);
}
[data-theme="dark"] .dash-widget-donate .dash-widget-head h2 { color: #F4EFE5; }
[data-theme="dark"] .dash-donate-pitch { color: #C4B8A4; }
[data-theme="dark"] .dash-donate-pitch strong { color: #FFE2A8; }

/* Planning Hub widget (admin only) — quiet, "behind the scenes" styling. */
.dash-widget-planning { border-left: 4px solid var(--gray-300); }
.dash-plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
}
.dash-plan-row:last-child { border-bottom: none; }
.dash-plan-row:hover { background: var(--gray-100); }
.dash-plan-title {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.92rem;
}
.dash-plan-status {
    flex-shrink: 0;
    font-family: var(--font-heading);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.dash-plan-status-active  { background: #FFF1D6; color: #876237; }
.dash-plan-status-pending { background: #F0EDE6; color: #8C8578; }
.dash-plan-status-done    { background: #E3F1E3; color: #3F7A45; }
[data-theme="dark"] .dash-plan-title { color: #E8DFCB; }
[data-theme="dark"] .dash-plan-status-active  { background: #4A3A1E; color: #FFE2A8; }
[data-theme="dark"] .dash-plan-status-pending { background: #3A3833; color: #B8B0A2; }
[data-theme="dark"] .dash-plan-status-done    { background: #2C3F2E; color: #A8D4AC; }

/* My Payments widget — preview of recent payments */
.dash-mypay-total {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 0 0 10px;
}
.dash-mypay-total strong {
    color: var(--brown-dark);
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
}
.dash-mypay-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
}
.dash-mypay-row:last-child { border-bottom: none; }
.dash-mypay-info { flex: 1; min-width: 0; }
.dash-mypay-desc {
    color: var(--brown-dark);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-mypay-date {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-top: 2px;
}
.dash-mypay-amt {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    color: var(--brown-dark);
    white-space: nowrap;
}

.dash-widget-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
}
.dash-widget-head h2 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brown-dark);
    margin: 0;
}
.dash-widget-link {
    font-size: 0.82rem;
    color: var(--tl-blue);
    text-decoration: none;
    font-weight: 600;
}
.dash-widget-link:hover { text-decoration: underline; }
.dash-widget-loading,
.dash-widget-empty {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin: 4px 0;
}
/* Spinner row shown in each widget body until its data arrives */
.dash-widget-loading { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.dash-spinner {
    width: 15px; height: 15px; flex: none;
    border: 2px solid var(--gray-200);
    border-top-color: var(--tl-blue);
    border-radius: 50%;
    animation: dashspin 0.8s linear infinite;
}
@keyframes dashspin { to { transform: rotate(360deg); } }

/* --- Event rows --- */
/* Anchors (each row links to its event page /e/{code}) styled as plain rows. */
.dash-event-row {
    display: flex;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
}
.dash-event-row:last-child { border-bottom: none; }
.dash-event-row:hover { background: var(--gray-100); }
.dash-event-date {
    flex-shrink: 0;
    width: 90px;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--tl-blue);
    font-size: 0.88rem;
}
.dash-event-info { min-width: 0; }
.dash-event-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.dash-event-meta {
    font-size: 0.82rem;
    color: var(--gray-500);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
}
.dash-event-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
}
.dash-event-type.type-meeting    { background: var(--tl-blue); }
.dash-event-type.type-campout    { background: #876237; }
.dash-event-type.type-trail      { background: #2D5E2A; }
.dash-event-type.type-service    { background: var(--crimson); }
.dash-event-type.type-fellowship { background: #7A4E8C; }
.dash-event-type.type-leadership { background: #1E3A5F; }
.dash-event-type.type-other      { background: var(--gray-500); }

/* --- Recent message rows (dashboard widget) --- */
.dash-msg-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
}
.dash-msg-row:last-child { border-bottom: none; }
.dash-msg-row:hover { background: var(--gray-100); }
.dash-msg-avatar {
    flex: none; width: 34px; height: 34px; border-radius: 50%;
    background: var(--tl-blue); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-heading); font-weight: 600; font-size: 0.92rem;
}
.dash-msg-avatar-group { background: #2D5E2A; font-size: 0.85rem; }
.dash-msg-avatar-support { background: var(--tl-blue); font-size: 0.85rem; }
.dash-msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-msg-name { font-weight: 600; color: var(--gray-900); font-size: 0.92rem; }
.dash-msg-preview {
    color: var(--gray-500); font-size: 0.84rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-msg-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.dash-msg-time { color: var(--gray-500); font-size: 0.74rem; }
.dash-msg-unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--crimson, #BA272C); }
.dash-msg-row.is-unread .dash-msg-name,
.dash-msg-row.is-unread .dash-msg-preview { color: var(--gray-900); font-weight: 700; }

/* --- Announcement rows (dashboard widget) --- */
.dash-ann-row {
    display: flex;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
}
.dash-ann-row:last-child { border-bottom: none; }
.dash-ann-row:hover { background: var(--gray-100); }
.dash-ann-date {
    flex-shrink: 0;
    width: 90px;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--tl-blue);
    font-size: 0.88rem;
}
.dash-ann-info { min-width: 0; }
.dash-ann-title {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.dash-ann-status {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 10px;
}
.dash-ann-status-unpublished { background: #F0EDE6; color: #8C8578; }
.dash-ann-status-private    { background: #FFF1D6; color: #876237; }

/* --- Checklist rows --- */
.dash-checklist-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
}
.dash-checklist-row:last-child { border-bottom: none; }
.dash-checklist-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.95rem;
    flex: 1;
    min-width: 120px;
}
.dash-checklist-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 180px;
    justify-content: flex-end;
}
.dash-checklist-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    max-width: 140px;
}
.dash-checklist-fill {
    height: 100%;
    background: var(--tl-blue);
    transition: width 0.3s;
}
.dash-checklist-count {
    font-size: 0.82rem;
    color: var(--gray-500);
    white-space: nowrap;
}
.dash-checklist-tag {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #fff4d6;
    color: #8a6508;
    padding: 3px 10px;
    border-radius: 10px;
}
/* Completed / settled states — completed members stay on the card. Chips stay
   light in both themes (matching the amber default above); only the green count
   text needs a dark-mode lightening for contrast on the gold card. */
.dash-checklist-fill.is-done { background: #2D5E2A; }
.dash-checklist-count.is-done { color: #2D5E2A; font-weight: 600; }
.dash-checklist-tag.is-done  { background: #E3F0E1; color: #2D5E2A; }
.dash-checklist-tag.is-info  { background: #E8F0FA; color: #1E5AA8; }
.dash-checklist-tag.is-muted { background: #ECE8E0; color: #7A7468; }
[data-theme="dark"] .dash-checklist-count.is-done { color: #A8D4AC; }
/* --- Action cards: items requiring the viewer's attention --- */
.dash-actions {
    margin-bottom: 32px;
}
.dash-actions-heading {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-700);
    margin: 0 0 12px;
    font-weight: 600;
}
.dash-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.dash-action-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
    border-left: 4px solid var(--gray-300);
    display: block;
    transition: box-shadow 0.2s, transform 0.1s;
}
.dash-action-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.dash-action-card-amber { border-left-color: #D4A017; }
.dash-action-card-blue  { border-left-color: #1A5490; }
.dash-action-card-red   { border-left-color: #C93939; }
.dash-action-card-green { border-left-color: #2D5E2A; }
.dash-action-card-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--brown-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}
.dash-action-card-detail {
    font-size: 0.92rem;
    color: var(--gray-900);
    margin-top: 6px;
    line-height: 1.4;
}
.dash-action-card-cta {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tl-blue, #1a5490);
    margin-top: 10px;
    letter-spacing: 0.02em;
}
.dash-action-card-amber .dash-action-card-cta { color: #876237; }
.dash-action-card-red .dash-action-card-cta { color: #C93939; }
.dash-action-card-green .dash-action-card-cta { color: #2D5E2A; }

/* --- Settings gear --- */
.settings-gear {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}
.settings-gear:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* --- Settings panel --- */
.settings-panel {
    position: fixed;
    top: 56px;
    right: 16px;
    width: 260px;
    background: var(--settings-bg, #fff);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 900;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.settings-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.settings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brown-dark);
    border-bottom: 1px solid var(--gray-200);
}
.settings-panel-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--gray-500);
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}
.settings-panel-close:hover {
    color: var(--gray-900);
}
.settings-section {
    padding: 14px 18px 18px;
}
.settings-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    margin-bottom: 10px;
}
.settings-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.settings-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--gray-700);
    transition: background 0.15s;
}
.settings-option:hover {
    background: var(--gray-100);
}
.settings-option input {
    accent-color: var(--tl-blue);
}
.settings-option-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--gray-200);
    flex-shrink: 0;
}
.settings-swatch-light {
    background: #FAFAF7;
}
.settings-swatch-dark {
    background: #1E1B16;
}
.settings-swatch-system {
    background: linear-gradient(135deg, #FAFAF7 50%, #1E1B16 50%);
}

/* --- View-As section --- */
.settings-view-as {
    border-top: 1px solid var(--gray-200);
}
.settings-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 10px;
    line-height: 1.4;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .dash-main h1 {
        font-size: 1.5rem;
    }
    .settings-panel {
        right: 8px;
        width: calc(100vw - 16px);
        max-width: 300px;
    }

    /* Tighter top nav on phones — drop redundant inline items (the hamburger
       drawer covers them) and let the brand fit on one line. Longhand only:
       the padding shorthand would wipe the safe-area padding-top set above. */
    .dash-nav { padding-left: 12px; padding-right: 12px; }
    .dash-nav-brand {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
        flex: 1;
    }
    .dash-nav-right { gap: 8px; }
    /* Hide the inline "Manage Members" admin link + leader name — both live
       in the hamburger drawer on mobile, no need to duplicate up top.
       !important: the admin-reveal JS shows these via inline style.display,
       which otherwise beats this rule — admins got a crammed nav with the
       brand truncated to "G…" on phones. */
    .dash-nav-link,
    .dash-nav-user { display: none !important; }
    /* Sign Out moved into the drawer bottom on phones (rarely used). */
    .dash-nav-signout { display: none; }

    /* Less padding on phones so widgets get more room. */
    .dash-main { padding: 24px 12px; }
    .dash-widget { padding: 18px 16px; }
    .dash-widget-checklist { padding: 20px 18px; }
}

/* ============================================
   Dark Mode
   ============================================ */
[data-theme="dark"] {
    /* Native form controls, scrollbars, and pickers render dark (audit R4). */
    color-scheme: dark;
    --crimson: #D44348;
    --crimson-dark: #BA272C;
    --tl-blue: #3A8FD6;
    --brown-dark: #D8CCB7;
    --brown: #C4B89E;
    --cream: #3E2E18;
    --white: #1A1816;
    --gray-100: #242220;
    --gray-200: #3A3734;
    --gray-500: #9A948B;
    --gray-700: #C4BFB6;
    --gray-900: #EDEAE5;
    /* Previously-unflipped/undefined palette vars (audit R1/R6). */
    --green-forest: #7FB069;
    --tl-green: #7FB069;
    --brand-green: #81C784;
    --tl-border: #3A3734;

    --shadow-md: 0 4px 16px rgba(0,0,0,0.30);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.40);

    --settings-bg: #2A2826;
}

/* Nav stays dark in both modes — just tweak if needed */
[data-theme="dark"] .dash-nav {
    background: #111;
}

/* Cards, modals, and white backgrounds */
[data-theme="dark"] .dash-card,
[data-theme="dark"] .event-item,
[data-theme="dark"] .family-member,
[data-theme="dark"] .checklist-trailman,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .subscribe-section,
[data-theme="dark"] .admin-card,
[data-theme="dark"] .sem-month,
[data-theme="dark"] .sem-unscheduled,
[data-theme="dark"] .view-btn:not(.active) {
    background: #2A2826;
}

/* Form inputs */
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .family-select,
[data-theme="dark"] .role-select,
[data-theme="dark"] .subscribe-copy-row input {
    background: #1A1816;
    color: var(--gray-900);
    border-color: var(--gray-200);
}

/* Checklist checkmark */
[data-theme="dark"] .checklist-checkmark {
    background: #1A1816;
}

/* Status badges */
[data-theme="dark"] .event-status-idea {
    background: #3A2040;
    color: #CE93D8;
}
[data-theme="dark"] .event-status-planning {
    background: #3A3020;
    color: #D4A55A;
}
[data-theme="dark"] .event-status-published-tbd {
    background: #1A2A3A;
    color: #64B5F6;
}
[data-theme="dark"] .event-status-published-confirmed {
    background: #1A2A1A;
    color: #81C784;
}
[data-theme="dark"] .status-pending {
    background: #3A3020;
    color: #D4A55A;
}
[data-theme="dark"] .status-accepted {
    background: #1A2A1A;
    color: #81C784;
}

/* Messages */
[data-theme="dark"] .event-message.error,
[data-theme="dark"] .member-message.error,
[data-theme="dark"] .admin-message.error {
    background: #2A1A1A;
    border-color: rgba(212,67,72,0.3);
}
[data-theme="dark"] .event-message.success,
[data-theme="dark"] .member-message.success,
[data-theme="dark"] .admin-message.success {
    background: #1A2A1A;
    border-color: rgba(129,199,132,0.3);
}

/* Leader notes */
[data-theme="dark"] .event-item-notes {
    background: #2A2230;
    color: #CE93D8;
    border-left-color: #7B1FA2;
}

/* Family group */
[data-theme="dark"] .family-group {
    background: #1A1816;
}

/* Modal overlay */
[data-theme="dark"] .modal-overlay {
    background: rgba(0,0,0,0.6);
}

/* --- Hamburger menu button --- */
.dash-menu-btn {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 12px;
    transition: background 0.2s;
    position: relative;
}
.dash-menu-btn:hover { background: rgba(255,255,255,0.08); }
.dash-menu-btn span:not(.dash-menu-badge) {
    display: block;
    height: 2px;
    width: 100%;
    /* Literal, not var(--white): the nav is dark in BOTH themes, but --white
       flips to near-black in dark mode which made the bars invisible. */
    background: #FAFAF7;
    border-radius: 2px;
}
.dash-menu-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #d93434;
    color: #fff;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    border: 2px solid var(--gray-900, #222);
    box-sizing: content-box;
    pointer-events: none;
}
/* The badge ring should match the nav bar behind it — in dark mode the nav is
   #111 but --gray-900 flips to a light tone, so pin it explicitly. */
[data-theme="dark"] .dash-menu-badge {
    border-color: #111;
}

/* --- Slide-out drawer --- */
.dash-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 900;
}
.dash-drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.dash-drawer {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 280px;
    max-width: 85vw;
    background: var(--white);
    box-shadow: 2px 0 24px rgba(0,0,0,0.2);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 910;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.dash-drawer.open { transform: translateX(0); }
.dash-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Keep the title/close button clear of the status bar (see html::after). */
    padding: calc(16px + max(env(safe-area-inset-top, 0px), var(--tl-safe-top, 0px))) 20px 16px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-900);
    color: #fff;
}
.dash-drawer-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.dash-drawer-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.dash-drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
}
.dash-drawer-link {
    display: block;
    padding: 12px 20px;
    font-size: 0.95rem;
    color: var(--gray-900);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.dash-drawer-link:hover {
    background: var(--gray-100);
    color: var(--tl-blue);
}
.dash-drawer-link.active {
    background: var(--gray-100);
    border-left-color: var(--tl-blue);
    color: var(--tl-blue);
    font-weight: 600;
}
.dash-drawer-link.indent { padding-left: 36px; font-size: 0.88rem; }
/* Sign Out pinned to the drawer's bottom (the drawer is a flex column). */
.dash-drawer-signout {
    margin-top: auto;
    border: 0;
    border-top: 1px solid var(--gray-200);
    background: none;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    text-align: left;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--crimson);
    cursor: pointer;
}
.dash-drawer-signout:hover { background: var(--gray-100); }

/* --- Collapsible "Two sites, two jobs" card ------------------------------- */
/* The title row stays visible as a one-line bar; everything else hides when
 * .collapsed. Chevron flips to show state. */
.platform-info-title {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
.platform-info-title::after {
    content: '▾';
    float: right;
    color: var(--gray-500);
    transition: transform 0.15s;
}
.platform-info.collapsed .platform-info-title { margin-bottom: 0; }
.platform-info.collapsed .platform-info-title::after { transform: rotate(-90deg); }
.platform-info.collapsed .platform-info-lead,
.platform-info.collapsed .platform-info-grid,
.platform-info.collapsed .platform-info-actions,
.platform-info.collapsed .platform-info-close { display: none; }
.platform-info.collapsed { padding-top: 14px; padding-bottom: 14px; }

/* --- Minimized sign-up checklist widget (family all done) ----------------- */
.dash-widget-toggle {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    transition: transform 0.15s;
}
.dash-widget-collapsed .dash-widget-toggle { transform: rotate(-90deg); }
.dash-widget-collapsed .dash-widget-body { display: none; }
.dash-widget-collapsed .dash-widget-head { margin-bottom: 0; }
.dash-drawer-badge {
    display: inline-block;
    min-width: 20px;
    padding: 1px 7px;
    margin-left: 8px;
    background: #d93434;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    border-radius: 10px;
    vertical-align: middle;
}
.dash-drawer-heading {
    padding: 14px 20px 4px;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
}

[data-theme="dark"] .dash-drawer { background: #1a1a1a; }
[data-theme="dark"] .dash-drawer-link { color: #eee; }
[data-theme="dark"] .dash-drawer-link:hover { background: #2a2a2a; }
[data-theme="dark"] .dash-drawer-link.active { background: #2a2a2a; }

.dash-card-badge {
    display: inline-block;
    background: #b33;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* --- Two-platform info card: Grace Trail Life vs Trail Life Connect ---
   Shown (static) at the top of the checklist, and as a per-user dismissible
   card at the top of the dashboard (cleared via the gtlTlcAck flag). */
.platform-info {
    position: relative;
    background: #f7f5ef;
    border: 1px solid #e3ddcf;
    border-left: 4px solid #2e5931;
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 24px;
}
.platform-info-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.15rem;
    margin: 0 0 6px;
    color: #2e5931;
}
.platform-info-lead { margin: 0 0 16px; color: #444; font-size: 0.95rem; line-height: 1.5; }
.platform-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.platform-info-col {
    background: var(--white);
    border: 1px solid #e7e2d6;
    border-radius: 8px;
    padding: 14px 16px;
}
.platform-info-name { font-weight: 700; color: #2e5931; font-size: 1rem; margin-bottom: 2px; }
.platform-info-url { font-size: 0.82rem; color: #888; margin-bottom: 8px; word-break: break-word; }
.platform-info-url a { color: #1a5490; }
.platform-info-desc { margin: 0; font-size: 0.92rem; line-height: 1.5; color: #444; }
.platform-info-actions { margin-top: 16px; }
.platform-info-btn {
    background: #2e5931;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.platform-info-btn:hover { background: #24481f; }
.platform-info-close {
    position: absolute; top: 8px; right: 12px;
    background: none; border: none; font-size: 1.6rem; line-height: 1;
    color: #999; cursor: pointer; padding: 0;
}
.platform-info-close:hover { color: #555; }
@media (max-width: 640px) {
    .platform-info-grid { grid-template-columns: 1fr; }
}

[data-theme="dark"] .platform-info { background: #1f1f1f; border-color: #333; }
[data-theme="dark"] .platform-info-col { background: #161616; border-color: #333; }
[data-theme="dark"] .platform-info-lead,
[data-theme="dark"] .platform-info-desc { color: #ccc; }
[data-theme="dark"] .platform-info-title,
[data-theme="dark"] .platform-info-name { color: #7fb069; }

/* --- Global member/trailman search (admins + leaders, injected by dash-search.js) --- */
.dash-search-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}
.dash-search-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.dash-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(20, 17, 12, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12vh 16px 0;
}
.dash-search-panel {
    width: 100%;
    max-width: 520px;
    background: var(--white);
    border-radius: var(--radius-lg, 10px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    overflow: hidden;
}
.dash-search-panel input[type="search"] {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--gray-200, #e5e1da);
    padding: 16px 18px;
    font-size: 1rem;
    font-family: var(--font-body, 'Open Sans', sans-serif);
    outline: none;
}
.dash-search-results {
    max-height: 50vh;
    overflow-y: auto;
}
.dash-search-hint {
    padding: 14px 18px;
    font-size: 0.85rem;
    color: var(--gray-500, #8a8377);
}
.dash-search-result {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 18px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100, #f2efe9);
}
.dash-search-result:hover,
.dash-search-result.active {
    background: var(--gray-100, #f5f2ec);
}
.dash-search-type {
    flex-shrink: 0;
    font-family: 'Oswald', sans-serif;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 9px;
    color: #fff;
}
.dash-search-type-trailman { background: var(--tl-blue, #1F497D); }
.dash-search-type-user     { background: #6B5B3E; }
.dash-search-name { font-weight: 600; font-size: 0.92rem; }
.dash-search-meta {
    font-size: 0.78rem;
    color: var(--gray-500, #8a8377);
    margin-left: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45%;
}


/* === Dark-mode legibility sweep (audit 2026-07-14, fixed 2026-08-05) ====== */
/* Success confirmations were #2D5E2A dark-green on dark cards (audit R1/#61). */
[data-theme="dark"] .admin-message.success,
[data-theme="dark"] .event-message.success,
[data-theme="dark"] .member-message.success { color: #81C784; }
/* Dashboard widget pills that never got dark pairs (#49). */
[data-theme="dark"] .dash-ann-status-public { background: #1A2A1A; color: #81C784; }
[data-theme="dark"] .dash-ann-status-private { background: #1A2A3A; color: #64B5F6; }
[data-theme="dark"] .dash-ann-status-unpublished,
[data-theme="dark"] .dash-checklist-tag { background: #3A3020; color: #D4A55A; }
/* Platform card link on the dark card (#50). */
[data-theme="dark"] .platform-info-url a { color: #7fb0e0; }
/* Search panel input: pin bg+color so it isn't UA-light (#48). */
.dash-search-input { background: var(--white); color: var(--gray-900); }
/* Drawer header stays dark-on-dark styled (#47). */
[data-theme="dark"] .dash-drawer-header { background: #111; }
/* Generic dark badge palette (audit fix-order #4) for pastel pills reused
 * by page sheets via the classes below. */

/* Security + Notification Settings use .admin-card without admin.css — give
 * the card its own complete look so dark mode isn't a bare slab (#56), and
 * theme their note/remove styles (#55). */
.sec-card-base, /* marker comment — rules below apply on all pages */
.admin-card { border-radius: var(--radius-lg); }
[data-theme="dark"] .ns-note, [data-theme="dark"] .sec-note { background: #3A3020; color: #E8D48A; }
[data-theme="dark"] .sec-remove { color: var(--crimson); }


/* --- Pull-to-refresh indicator (tabbar-boot.js) --------------------------- */
/* Sits under the fixed header strip and rides down with the finger. */
.tl-ptr {
    position: fixed;
    top: calc(max(env(safe-area-inset-top, 0px), var(--tl-safe-top, 0px)) + 44px);
    left: 50%;
    transform: translate(-50%, 0);
    z-index: 940;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.tl-ptr-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--gray-200);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}
/* Past the trigger point — crimson says "let go and I'll refresh". */
.tl-ptr.ready .tl-ptr-circle { color: var(--crimson); }
.tl-ptr.spinning .tl-ptr-circle {
    color: var(--crimson);
    animation: dashspin 0.7s linear infinite;
}


/* --- Supplies-you're-bringing card ------------------------------------------
   Appears only when an upcoming event has items with your name on them; the
   quartermaster's version of the checklist card. */
.dash-widget-supplies { border-left: 4px solid var(--green-forest); margin-bottom: 24px; }
.dash-supplies-event { padding: 4px 0 10px; }
.dash-supplies-event + .dash-supplies-event { border-top: 1px solid var(--gray-200); padding-top: 14px; }
.dash-supplies-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.dash-supplies-title { font-weight: 700; color: var(--brown-dark); font-size: 0.98rem; }
.dash-supplies-date { color: var(--gray-500); font-size: 0.85rem; white-space: nowrap; }
.dash-supplies-items { list-style: none; margin: 0 0 10px; padding: 0; }
.dash-supplies-items li { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; font-size: 0.93rem; color: var(--gray-900); }
.dash-supplies-items li::before { content: "\25A2"; color: var(--gray-500); }
.dash-supplies-items li.is-packed { color: var(--gray-500); }
.dash-supplies-items li.is-packed::before { content: "\2713"; color: var(--green-pine); font-weight: 700; }
.dash-supplies-items li.is-packed .dash-supplies-name { text-decoration: line-through; }
.dash-supplies-qty { font-weight: 700; color: var(--tl-blue); }
.dash-supplies-more { color: var(--gray-500); font-size: 0.85rem; }
.dash-supplies-cta {
    display: inline-block; font-weight: 600; font-size: 0.88rem;
    color: var(--tl-blue); text-decoration: none;
}
.dash-supplies-cta:hover { text-decoration: underline; }
