/* ============================================================================
   Daló — Application Stylesheet
   Mobile-first, accessible, no external dependencies.
   ============================================================================ */

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
    color-scheme: light;

    /* Brand colours */
    --color-brand:         #315fbd;
    --color-brand-dark:    #244a98;
    --color-brand-light:   #e8effa;

    /* Neutrals */
    --color-bg:            #f6f4ed;
    --color-surface:       #ffffff;
    --color-border:        #d5d2ca;
    --color-text:          #111111;
    --color-text-muted:    #626774;

    /* Semantic */
    --color-error:         hsl(0, 72%, 48%);
    --color-error-bg:      hsl(0, 100%, 97%);
    --color-success:       hsl(142, 60%, 36%);
    --color-success-bg:    hsl(142, 60%, 96%);

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Typography */
    --font-family:  'Inter', system-ui, -apple-system, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --line-height:  1.6;

    /* Borders / Radii */
    --radius-sm:  0.25rem;
    --radius-md:  0.5rem;
    --radius-lg:  0.75rem;

    /* Shadows */
    --shadow-sm:  0 1px 3px hsl(220 20% 10% / 0.08);
    --shadow-md:  0 4px 16px hsl(220 20% 10% / 0.10);

    /* Transitions */
    --transition: 150ms ease;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --color-brand: #8bb8ff;
    --color-brand-dark: #b8d1fb;
    --color-brand-light: #263d5a;
    --color-bg: #14181d;
    --color-surface: #202832;
    --color-border: #46515f;
    --color-text: #eff3f8;
    --color-text-muted: #c0c6cf;
    --color-error: #ffb4ab;
    --color-error-bg: #401c20;
    --color-success: #a6d9ad;
    --color-success-bg: #15311f;
}

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

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    line-height: var(--line-height);
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100dvh;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* --------------------------------------------------------------------------
   Authentication page layout
   -------------------------------------------------------------------------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: var(--space-6) var(--space-4);
    background: linear-gradient(
        135deg,
        hsl(232, 72%, 96%) 0%,
        hsl(220, 20%, 97%) 100%
    );
}

.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-8) var(--space-8);
    width: 100%;
    max-width: 26rem;
    border: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   Daló manga-inspired public portal
   -------------------------------------------------------------------------- */
.portal-page {
    --portal-blue: #78aaff;
    --portal-ink: #111111;
    --portal-paper: #f6f4ed;
    background: var(--portal-ink);
    color: var(--portal-paper);
    font-family: Inter, system-ui, -apple-system, sans-serif;
}

.portal-page a { color: inherit; }
.portal-page a:focus-visible,
.portal-page button:focus-visible,
.portal-page input:focus-visible {
    outline: 3px solid var(--portal-blue);
    outline-offset: 3px;
}

.portal-nav {
    position: relative;
    z-index: 2;
    min-height: 70px;
    padding: 0 clamp(1.25rem, 5vw, 5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #343434;
    background: #101010;
}

.portal-nav > nav { display: flex; align-items: center; gap: 1.75rem; }
.portal-nav > a:not(.portal-brand),
.portal-nav > nav a { color: #cfcec8; font-size: .82rem; text-decoration: none; }
.portal-nav > nav a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.portal-nav > nav a[aria-current="page"] { color: var(--portal-blue); font-weight: 700; }
.portal-brand { text-decoration: none; font-size: 1.65rem; font-weight: 900; letter-spacing: -.12em; }
.portal-brand span { color: var(--portal-blue); }
.portal-nav__login { padding: .55rem 1rem; border: 1px solid #585858; border-radius: 999px; }

.public-preview-unavailable { position: relative; display: inline-flex; align-items: center; cursor: not-allowed; color: #cfcec8; }
.portal-nav > nav .public-preview-unavailable { min-height: 44px; font-size: .82rem; white-space: nowrap; }
.public-preview-unavailable:focus-visible { outline: 3px solid var(--portal-blue); outline-offset: 3px; }
.public-preview-unavailable.portal-button:hover { transform: none; box-shadow: 4px 4px 0 #f6f4ed; }
.public-preview-tooltip { position: absolute; top: calc(100% + .5rem); right: 0; z-index: 10; width: 14rem; max-width: calc(100vw - 2.2rem); padding: .65rem .8rem; border: 1px solid #7caaff; border-radius: .4rem; background: #20252e; color: #f6f4ed; font-size: .8rem; font-weight: 400; line-height: 1.5; white-space: normal; visibility: hidden; opacity: 0; pointer-events: none; }
.public-preview-unavailable:hover > .public-preview-tooltip,
.public-preview-unavailable:focus > .public-preview-tooltip { visibility: visible; opacity: 1; }
.portal-actions .public-preview-tooltip { left: 0; right: auto; }
.public-preview-notice { margin-top: 1.5rem; color: #b9c9e5; font-size: .82rem; line-height: 1.6; }
.public-preview-notice--about { max-width: 74rem; margin: 1.5rem auto 0; padding: 0 1.4rem; }
.public-preview-message { max-width: 40rem; margin: 4rem auto; padding: 1.5rem; color: #f6f4ed; }
.public-preview-message p { margin-block: 1rem; }
.public-preview-message nav { display: flex; gap: 1.5rem; }
.public-preview-message a { color: #7caaff; }

.portal-hero {
    min-height: min(780px, calc(100dvh - 70px));
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    align-items: center;
    gap: 2rem;
    overflow: hidden;
    padding: clamp(3rem, 8vw, 7rem) clamp(1.5rem, 8vw, 8rem) 5rem;
    background-color: #111;
    background-image: radial-gradient(#f6f4ed 1px, transparent 1.5px);
    background-size: 8px 8px;
    background-blend-mode: soft-light;
}

.portal-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(90deg, #101010 0%, #101010 37%, rgb(16 16 16 / .80) 64%, rgb(16 16 16 / .20) 100%);
}

.portal-hero__copy { max-width: 38rem; }
.portal-eyebrow { color: var(--portal-blue); font-size: .67rem; font-weight: 800; letter-spacing: .19em; }
.portal-eyebrow span { display: inline-block; width: .5rem; height: .5rem; margin-right: .45rem; background: var(--portal-blue); transform: rotate(45deg); }
.portal-hero h1,
.portal-auth-backdrop h1 { margin: 1.25rem 0 1.15rem; font-size: clamp(3.25rem, 7.2vw, 6.4rem); line-height: .91; letter-spacing: -.075em; font-weight: 900; }
.portal-hero h1 em,
.portal-auth-backdrop h1 em { color: var(--portal-blue); font-style: normal; }
.portal-lede { max-width: 28rem; color: #c3c2bc; font-size: 1rem; line-height: 1.7; }
.portal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.3rem; margin-top: 2rem; }
.portal-button { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; padding: .85rem 1.15rem; background: var(--portal-blue); color: #111 !important; font-weight: 850; line-height: 1.25; text-align: center; white-space: normal; text-decoration: none; border: 1px solid #111; box-shadow: 4px 4px 0 #f6f4ed; }
.portal-button:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 #f6f4ed; }
.portal-button--secondary { background: transparent; color: #111 !important; border: 1px solid #315fbd; box-shadow: 4px 4px 0 #c8d6f5; }
.portal-button--secondary:hover { background: hsl(220, 60%, 97%); box-shadow: 6px 6px 0 #c8d6f5; }
.portal-link { color: #e3e1da; font-size: .8rem; text-underline-offset: .25rem; }
.portal-link span { color: var(--portal-blue); }

.portal-art { min-height: 390px; position: relative; transform: rotate(-1deg); }
.portal-panel { position: absolute; display: flex; flex-direction: column; justify-content: space-between; padding: 1.2rem; color: #111; background: var(--portal-paper); border: 2px solid #fff; box-shadow: 8px 9px 0 var(--portal-blue); overflow: hidden; }
.portal-panel::after { position: absolute; inset: 0; content: ""; opacity: .16; background-image: radial-gradient(#111 1px, transparent 1.5px); background-size: 6px 6px; pointer-events: none; }
.portal-panel span, .portal-panel small { position: relative; z-index: 1; }
.portal-panel span { font-weight: 950; line-height: .95; letter-spacing: -.04em; }
.portal-panel small { font-size: .55rem; font-weight: 900; letter-spacing: .13em; }
.portal-panel--one { width: 45%; height: 74%; top: 5%; left: 9%; transform: rotate(-8deg); }
.portal-panel--one span { font-size: clamp(1.5rem, 3vw, 2.6rem); }
.portal-panel--two { width: 45%; height: 43%; top: 9%; right: 1%; transform: rotate(8deg); background: var(--portal-blue); }
.portal-panel--two span { font-size: clamp(1.4rem, 2.6vw, 2.25rem); }
.portal-panel--three { width: 57%; height: 43%; bottom: 2%; left: 32%; transform: rotate(4deg); }
.portal-panel--three span { font-size: clamp(1.3rem, 2.5vw, 2.1rem); }
.portal-burst { position: absolute; right: 0; bottom: 16%; width: 6.2rem; height: 6.2rem; display: grid; place-content: center; clip-path: polygon(50% 0,61% 31%,91% 9%,72% 39%,100% 49%,70% 59%,92% 89%,61% 70%,50% 100%,40% 69%,9% 91%,30% 60%,0 50%,30% 40%,8% 10%,40% 30%); background: #fff; color: #111; text-align: center; font-size: .8rem; font-weight: 950; line-height: 1; }
.portal-hero__bottom { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: .65rem clamp(1.5rem, 8vw, 8rem); background: var(--portal-blue); color: #101010; font-size: .61rem; font-weight: 900; letter-spacing: .13em; }
.portal-bottom { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem clamp(1.5rem, 8vw, 8rem); color: #bdbbb4; font-size: .78rem; }
.portal-bottom p { margin: 0; }
.portal-bottom a { text-decoration: none; }
.portal-bottom a span { color: var(--portal-blue); }

.about-main {
    width: min(100% - 3rem, 60rem);
    margin-inline: auto;
    padding: clamp(3rem, 8vw, 6rem) 0 4rem;
}

.about-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
}

.about-identity {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.about-identity-copy { min-width: 0; }

.about-identity h1 {
    margin: .8rem 0 .65rem;
    font-size: clamp(2.25rem, 4.5vw, 3.8rem);
    line-height: 1.05;
    letter-spacing: -.065em;
    overflow-wrap: anywhere;
}

.about-identity .portal-eyebrow { line-height: 1.5; }
.about-role { margin: 0 0 1.5rem; color: var(--portal-blue); font-weight: 800; }
.about-bio { max-width: 48rem; color: #c3c2bc; font-size: 1.05rem; line-height: 1.8; }
.about-portrait { display: block; flex: 0 0 auto; width: 11rem; height: 11rem; object-fit: cover; border: 2px solid var(--portal-blue); border-radius: 50%; }
.about-story { max-width: 48rem; margin: 3rem 0 0; padding-top: 1.4rem; border-top: 1px solid #424242; }
.about-story h2 { margin: 0 0 1rem; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.04em; }
.about-story p { max-width: 42rem; color: #c3c2bc; line-height: 1.75; }

@media (max-width: 760px) {
    .about-main { width: min(100% - 2.5rem, 42rem); padding-block: 3rem; }
    .about-intro { grid-template-columns: 1fr; gap: 2rem; }
    .about-identity { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
    .about-portrait { width: 8rem; height: 8rem; }
    .about-bio { font-size: 1rem; }
    .about-story { margin-top: 3rem; }
}

.portal-auth-page { min-height: 100dvh; overflow-x: hidden; }
.portal-auth-stage { position: relative; min-height: calc(100dvh - 70px); display: grid; align-items: center; padding: 3rem clamp(1.5rem, 8vw, 8rem); overflow: hidden; }
.portal-auth-backdrop { position: relative; z-index: 0; max-width: 44rem; opacity: .83; }
.portal-auth-backdrop h1 { font-size: clamp(3.4rem, 7vw, 6rem); }
.portal-auth-context { display: grid; gap: .35rem; width: min(31rem, 75vw); margin-top: 2rem; padding: 1rem; color: #151515; background: var(--portal-blue); transform: rotate(-1deg); box-shadow: 6px 6px 0 #f6f4ed; }
.portal-auth-context b { font-size: .7rem; letter-spacing: .12em; }
.portal-auth-context span { font-weight: 700; }
.portal-auth-context i { font-size: .72rem; font-style: normal; }
.portal-scrim { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; padding: 1.5rem; background: rgb(0 0 0 / .67); }
.portal-modal { position: relative; width: min(27rem, 100%); max-height: calc(100dvh - 3rem); overflow: auto; padding: 1.8rem; color: #171717; background: var(--portal-paper); border: 2px solid #171717; box-shadow: 8px 8px 0 var(--portal-blue); }
.portal-modal__close { position: absolute; top: .55rem; right: .9rem; color: #333; font-size: 1.7rem; line-height: 1; text-decoration: none; }
.portal-modal__tag { display: inline-block; padding: .3rem .5rem; color: var(--portal-blue); background: #171717; font-size: .58rem; font-weight: 900; letter-spacing: .13em; }
.portal-modal h2 { margin: 1rem 0 .25rem; font-size: 2rem; line-height: 1; letter-spacing: -.06em; }
.portal-modal > p { margin: .5rem 0 1rem; color: #66645f; font-size: .83rem; }
.portal-form { display: grid; gap: .5rem; }
.portal-form label { margin-top: .4rem; color: #262626; font-size: .64rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.portal-form input { width: 100%; min-height: 2.8rem; padding: .65rem .75rem; border: 1px solid #aaa79e; border-radius: 0; background: #fff; color: #171717; font: inherit; font-size: .86rem; }
.portal-form button { display: flex; justify-content: space-between; margin-top: .8rem; padding: .85rem 1rem; border: 0; background: #171717; color: #fff; font: inherit; font-size: .82rem; font-weight: 850; cursor: pointer; }
.portal-form button span { color: var(--portal-blue); }
.portal-modal__foot { margin: 1.1rem 0 0 !important; padding-top: .85rem; border-top: 1px solid #d3d0c8; text-align: center; font-size: .76rem !important; }
.portal-modal__foot a { color: #171717; font-weight: 850; text-underline-offset: .17rem; }
.portal-modal__foot small { display: block; margin-top: .5rem; color: #77746d; font-size: .63rem; }
.portal-alert { margin: 1rem 0; padding: .7rem .8rem; border: 1px solid #d38d8d; background: #fff0ef; color: #852323; font-size: .76rem; }
.portal-alert--success { border-color: #8eb99b; background: #edf8f0; color: #235b31; }
.portal-alert p { margin: 0; }
.portal-alert p + p { margin-top: .3rem; }
.portal-auth-help { margin: .1rem 0 0 !important; text-align: right; font-size: .74rem !important; }
.portal-auth-help a { color: #172f61; font-weight: 750; text-underline-offset: .15rem; }
.portal-field-error { margin: -.2rem 0 .2rem; color: #a02323; font-size: .72rem; }
.portal-modal--signup { width: min(34rem, 100%); }
.portal-privacy { max-height: 10.5rem; overflow: auto; margin: .8rem 0; padding: .8rem; border: 1px solid #cfccc3; background: #fff; font-size: .66rem; line-height: 1.4; }
.portal-privacy h3 { margin: 0 0 .5rem; font-size: .78rem; }
.portal-privacy dl { display: grid; gap: .35rem; }
.portal-privacy dt { font-weight: 850; }
.portal-privacy dd { margin: 0; color: #55534d; }
.portal-privacy a { color: #172f61; }
.portal-signup-note { font-size: .67rem !important; }

@media (max-width: 760px) {
    .portal-nav { min-height: 60px; padding: .4rem 1.1rem; gap: .5rem 1rem; flex-wrap: wrap; }
    .portal-nav > nav { gap: .65rem; flex-wrap: wrap; }
    .portal-nav__login { padding-inline: .75rem; }
    .portal-hero { min-height: 880px; grid-template-columns: 1fr; align-content: start; gap: 1rem; padding: 4rem 1.4rem 4.2rem; }
    .portal-hero h1 { font-size: clamp(3.6rem, 15vw, 5.6rem); }
    .portal-lede { font-size: .92rem; }
    .portal-art { min-height: 330px; width: min(100%, 27rem); margin: 0 auto; }
    .portal-panel--one { width: 42%; }
    .portal-panel--two { width: 42%; }
    .portal-panel--three { width: 55%; }
    .portal-hero__bottom { padding-inline: 1rem; font-size: .52rem; }
    .portal-bottom { flex-direction: column; padding: 1rem 1.4rem; }
    .portal-auth-stage { min-height: calc(100dvh - 60px); padding: 2rem 1.2rem; }
    .portal-auth-backdrop h1 { font-size: 3.6rem; }
    .portal-modal { padding: 1.4rem; }
    .portal-auth-stage--signup { align-items: start; }
    .portal-auth-stage--signup .portal-scrim { place-items: start center; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-page *, .portal-page *::before, .portal-page *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.portal-dashboard-page { --color-brand: #315fbd; --color-brand-dark: #244a98; }
.dashboard-profile-link { color: var(--color-text); font-size: .82rem; text-decoration: none; }
.dashboard-profile-link:hover { text-decoration: underline; }
.dashboard-content { width: min(100% - 2rem, 76rem); margin: 0 auto; padding: 2.5rem 0 4rem; }
.dashboard-welcome { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; margin-bottom: 3rem; padding: 2.5rem clamp(1.25rem, 4vw, 3rem); color: #f6f4ed; background: #111; border-bottom: 5px solid #78aaff; }
.dashboard-welcome h1 { margin: .75rem 0; font-size: clamp(2.8rem, 6vw, 4.6rem); line-height: .92; letter-spacing: -.07em; }
.dashboard-welcome h1 em { color: #78aaff; font-style: normal; }
.dashboard-welcome > div > p:last-child { max-width: 30rem; color: #c3c2bc; }
.dashboard-section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 1rem; }
.dashboard-section-head .portal-eyebrow { margin: 0; color: #315fbd; }
.dashboard-section-head h2 { margin: .2rem 0 0; font-size: 1.8rem; letter-spacing: -.04em; }
.dashboard-section-head > span { color: var(--color-text-muted); font-size: .8rem; }
.dashboard-event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.dashboard-event-card { min-width: 0; padding: 1rem; border: 1px solid var(--color-border); background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / .035); }
.dashboard-event-card__bar { display: flex; justify-content: space-between; gap: .5rem; padding-bottom: .55rem; border-bottom: 1px solid #e2e3e6; color: #315fbd; font-size: .57rem; font-weight: 850; letter-spacing: .1em; }
.dashboard-event-card__date { margin: .9rem 0 .25rem; color: #315fbd; font-size: .72rem; font-weight: 750; }
.dashboard-event-card h3 { margin: 0; font-size: 1.2rem; line-height: 1.15; letter-spacing: -.035em; overflow-wrap: anywhere; }
.dashboard-event-card__location, .dashboard-event-card__owner { margin: .45rem 0 0; color: #626774; font-size: .77rem; }
.dashboard-event-card__counts { padding-top: .65rem; border-top: 1px solid #e3e4e8; color: #383b42; font-size: .72rem; }
.dashboard-event-card__actions { display: flex; flex-wrap: wrap; gap: .45rem 1rem; margin-top: 1rem; font-size: .76rem; font-weight: 750; }
.dashboard-event-card__actions a { color: #234f9e; text-underline-offset: .15rem; }
.dashboard-event-card__actions span { color: #2f7048; }
.dashboard-event-card__actions .is-muted { color: #7a7d84; font-weight: 500; }
.dashboard-empty { padding: 2rem; border: 1px dashed #bfc4cf; text-align: center; }
.dashboard-empty h3 { margin: 0 0 .5rem; }
.dashboard-empty p { margin: 0 0 1.2rem; color: var(--color-text-muted); }
.dashboard-empty__hint { margin-top: 1.2rem; color: var(--color-text-muted); font-size: .82rem; }
.profile-content { width: min(100% - 2rem, 48rem); margin: 0 auto; padding: 2.5rem 0 4rem; }
.profile-content .page-header { margin-bottom: 1.2rem; }
.profile-privacy { max-height: none; margin: 1rem 0; font-size: .76rem; }
.profile-privacy h2 { margin: 0 0 .4rem; font-size: .9rem; }
.profile-privacy p { margin: 0; }
.portal-profile-form { display: grid; gap: .55rem; padding: 1.4rem; border: 1px solid var(--color-border); background: #fff; }
.portal-profile-form label { margin-top: .4rem; font-size: .78rem; font-weight: 750; }
.portal-profile-form input { width: 100%; min-height: 2.7rem; padding: .65rem .75rem; border: 1px solid #c7cbd3; background: #fff; color: #171717; font: inherit; }
.portal-profile-form .portal-button { justify-self: start; cursor: pointer; }
.portal-profile-form .form-note { margin: .3rem 0; color: var(--color-text-muted); font-size: .76rem; }
.profile-back-link { margin-top: 1.5rem; font-size: .82rem; }
.profile-back-link a { color: #234f9e; }
.portal-event-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin: 1rem 0; }
.portal-event-stats > div { display: grid; gap: .2rem; padding: 1rem; background: #111; color: #fff; }
.portal-event-stats strong { color: #78aaff; font-size: 1.4rem; }
.portal-event-stats span { color: #d0d0d0; font-size: .74rem; }
/* FR-08 live-count status row */
.stat-status-row { margin: -.4rem 0 .6rem; min-height: 1.2rem; }
.stat-status { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .04em; }
.stat-status--ok   { color: hsl(142, 55%, 34%); }
.stat-status--stale { color: hsl(30, 80%, 38%); }
.portal-manage-card { padding: 1.4rem; border: 1px solid var(--color-border); background: #fff; }
.portal-manage-card > h2 { margin: 0; font-size: 1.35rem; }
.portal-manage-card > p { color: var(--color-text-muted); font-size: .82rem; }
.portal-manage-card .portal-profile-form { padding: 1rem 0; border: 0; }
.portal-assignment-list { display: grid; gap: .6rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.portal-assignment-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem; border: 1px solid #e0e2e6; }
.portal-assignment-list li > div { display: grid; gap: .15rem; min-width: 0; }
.portal-assignment-list li span { color: var(--color-text-muted); font-size: .76rem; overflow-wrap: anywhere; }
.portal-danger-zone { margin-top: 1rem; padding: 1.4rem; border: 2px solid #9d2929; background: #fff; box-shadow: 4px 4px 0 #efcaca; }
.portal-danger-zone h2 { margin: 0; color: #7c2020; font-size: 1.25rem; }
.portal-danger-zone > p { color: var(--color-text-muted); font-size: .82rem; }
.danger-zone-form { display: grid; gap: .65rem; max-width: 32rem; }
.danger-zone-form label { font-size: .8rem; }
.danger-zone-form input { width: 100%; min-height: 2.75rem; padding: .65rem .75rem; border: 1px solid #9d2929; background: #fff; color: #171717; font: inherit; }
.danger-zone-warning { margin: 0; color: #7c2020; font-size: .76rem; }
.danger-zone-button { justify-self: start; min-height: 2.75rem; padding: .7rem 1rem; border: 1px solid #6c1515; background: #7c2020; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.danger-zone-button:hover { background: #5d1717; }
.danger-zone-button:focus-visible { outline: 3px solid #315fbd; outline-offset: 3px; }
.account-registration-summary { margin-bottom: 1rem; }
.account-registration-summary p { color: var(--color-text-muted); font-size: .86rem; }
.tickets-content { width: min(100% - 2rem, 58rem); margin: 0 auto; padding: 2.5rem 0 4rem; }
.ticket-list { display: grid; gap: 1rem; }
.ticket-card, .ticket-qr-result, .ticket-empty { padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid #191919; background: #fff; box-shadow: 4px 4px 0 #78aaff; }
.ticket-card { border-top: 4px solid #111; }
.ticket-card__date { margin: 0 0 .35rem; color: #315fbd; font-size: .78rem; font-weight: 800; }
.ticket-card h2, .ticket-qr-result h2, .ticket-empty h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.035em; }
.ticket-card__location, .ticket-card__status, .ticket-card__action p, .ticket-qr-result > p:not(.portal-eyebrow), .ticket-empty p { color: #626774; font-size: .84rem; }
.ticket-card__status { display: inline-block; padding: .35rem .55rem; border: 1px solid #315fbd; color: #234f9e; font-weight: 750; }
.ticket-card__action { margin-top: .75rem; }
.ticket-card__action .portal-button { font: inherit; cursor: pointer; }
.ticket-card__action p { margin: .55rem 0 0; }
.ticket-qr-result { margin-bottom: 1.25rem; border-top: 4px solid #315fbd; }
.ticket-qr-result .portal-eyebrow { margin: 0 0 .35rem; color: #315fbd; }
.ticket-qr-result img { width: min(100%, 17.5rem); height: auto; margin: 1rem auto; border: 1px solid #d5d2ca; }
.ticket-empty { text-align: center; }
.ticket-empty .portal-button { display: inline-block; margin-top: .5rem; }
.tickets-back-link { margin-top: 1.5rem; font-size: .82rem; }
.tickets-back-link a { color: #234f9e; }

/* Authenticated views carry the landing page's ink, paper, and blue system. */
.app-page {
    --portal-blue: #78aaff;
    --portal-ink: #111;
    --portal-paper: #f6f4ed;
    background: var(--portal-paper);
    color: #171717;
    font-family: Inter, system-ui, -apple-system, sans-serif;
}
.app-page .topbar {
    min-height: 70px;
    padding: .7rem clamp(1rem, 5vw, 5rem);
    background: #101010;
    border: 0;
    border-bottom: 2px solid var(--portal-blue);
    box-shadow: none;
}
.app-page .topbar__brand {
    color: var(--portal-paper);
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: -.1em;
    text-decoration: none;
}
.app-page .topbar__nav { gap: clamp(.65rem, 1.8vw, 1.5rem); }
.app-page .topbar__nav > a { color: #d5d2ca; text-decoration: none; }
.app-page .topbar__nav > a:hover { color: var(--portal-blue); }
.app-page .topbar__user { color: #f6f4ed; }
.app-page .topbar .btn--ghost {
    color: #f6f4ed;
    border-color: #55534d;
    background: transparent;
}
.app-page .topbar .btn--ghost:hover { border-color: var(--portal-blue); color: var(--portal-blue); }
.app-page :focus-visible { outline: 3px solid #315fbd; outline-offset: 3px; }
.app-page .page-header { margin-bottom: 1.5rem; }
.app-page .page-header .portal-eyebrow { margin-bottom: .45rem; color: #315fbd; }
.app-page .page-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; letter-spacing: -.06em; }
.app-page .page-subtitle { max-width: 44rem; font-size: .92rem; }
.app-page .card,
.app-page .event-form,
.dashboard-event-card,
.portal-manage-card,
.portal-profile-form {
    border-radius: 0;
    border: 1px solid #191919;
    box-shadow: 4px 4px 0 var(--portal-blue);
}
.app-page .btn--primary { border-radius: 0; background: #111; color: #fff; }
.app-page .btn--primary:hover { background: #315fbd; }
.app-page .btn--ghost { border-radius: 0; }
.dashboard-welcome {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, .9fr);
    align-items: center;
    min-height: 22rem;
    padding: 2rem clamp(1.25rem, 4vw, 3rem);
    border-bottom: 5px solid var(--portal-blue);
    background-color: #101010;
    background-image: radial-gradient(#f6f4ed 1px, transparent 1.5px);
    background-size: 8px 8px;
    background-blend-mode: soft-light;
}
.dashboard-welcome__copy h1 { font-weight: 950; }
.dashboard-welcome__copy .portal-button { display: inline-block; margin-top: 1rem; }
.dashboard-welcome-art { min-height: 18rem; width: 100%; margin: 0; }
.dashboard-welcome-art .portal-panel--one { height: 76%; }
.dashboard-welcome-art .portal-panel--three { height: 42%; }
.dashboard-event-card {
    border-top: 4px solid #111;
    box-shadow: 3px 3px 0 #78aaff;
}
.dashboard-event-card__actions span:not(.is-muted) { color: #234f9e; }
.dashboard-empty {
    border: 1px dashed #315fbd;
    background: #fff;
}
.profile-content > .page-header {
    margin-bottom: 1.5rem;
    padding: 1.6rem 1.8rem;
    color: #f6f4ed;
    background: #111;
    border-bottom: 4px solid #78aaff;
}
.profile-content > .page-header .portal-eyebrow { color: #78aaff; }
.profile-content > .page-header .page-title { color: #f6f4ed; }
.profile-content > .page-header .page-subtitle { color: #c3c2bc; }
.portal-profile-form { gap: 1rem; padding: clamp(1rem, 3vw, 1.7rem); }
.profile-field label { display: block; font-size: .78rem; font-weight: 800; }
.profile-optional { color: #6b6a66; font-size: .68rem; font-weight: 500; }
.profile-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.profile-field--wide { grid-column: 1 / -1; }
.profile-field > input,
.profile-field > textarea {
    width: 100%;
    min-height: 2.75rem;
    margin-top: .35rem;
    padding: .65rem .75rem;
    border: 1px solid #77756e;
    border-radius: 0;
    background: #fff;
    color: #171717;
    font: inherit;
}
.profile-field > input:focus, .profile-field > textarea:focus { border-color: #315fbd; }
.profile-field .form-note { margin-top: .3rem; color: #66645f; font-size: .72rem; }
.portal-profile-form > .form-note { padding-top: .8rem; border-top: 1px solid #d5d2ca; }
.portal-profile-form > .portal-button { margin-top: .25rem; }
.avatar-picker { min-inline-size: 0; margin: 0; padding: 0 0 1.5rem; border: 0; border-bottom: 1px solid var(--color-border); }
.avatar-picker legend { padding: 0; font-size: 1.1rem; font-weight: 800; }
.avatar-picker .form-hint { margin: .5rem 0 1rem; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem .5rem; }
.portal-profile-form .avatar-option { display: grid; justify-items: center; align-content: start; gap: .4rem; position: relative; margin: 0; cursor: pointer; }
.portal-profile-form .avatar-option input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); }
.avatar-option img { width: min(100%, 4.5rem); height: auto; aspect-ratio: 1; border: 3px solid transparent; border-radius: 50%; background: #f6f4ed; }
.avatar-option span { max-width: 100%; font-size: .72rem; text-align: center; overflow-wrap: anywhere; }
.avatar-option input:checked + img { border-color: #315fbd; }
.avatar-option input:checked ~ span::after { content: " ✓"; }
.avatar-option input:focus-visible + img { outline: 3px solid #315fbd; outline-offset: 3px; }
html[data-theme="dark"] .avatar-option input:checked + img { border-color: #8bb8ff; }
html[data-theme="dark"] .avatar-option input:focus-visible + img { outline-color: #8bb8ff; }
html[data-theme="dark"] .app-page .portal-field-error { color: #ffb4ab; }
.app-page .topbar__user { display: inline-flex; align-items: center; gap: .5rem; }
.topbar__avatar { flex: 0 0 32px; width: 32px; height: 32px; border: 1px solid #78aaff; border-radius: 50%; background: #f6f4ed; }
.topbar__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 580px) {
    .avatar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.profile-content .alert { border-radius: 0; }
.portal-manage-card { background: #fff; }
.facilitator-page .card { border-radius: 0; border-top: 3px solid #111; }
.event-form.card { border-top: 4px solid #111; }
.registration-share-link { border-left: 4px solid #315fbd; padding: .7rem 1rem; background: #fff; }
.registration-share-link a { color: #234f9e; }

@media (max-width: 860px) {
    .dashboard-event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-welcome { grid-template-columns: minmax(0, 1fr) minmax(16rem, .8fr); }
}
@media (max-width: 580px) {
    .dashboard-content { width: min(100% - 1.25rem, 76rem); padding-top: 1rem; }
    .dashboard-welcome { display: grid; align-items: start; margin-bottom: 2rem; padding: 1.3rem; }
    .dashboard-welcome > .portal-button { justify-self: start; }
    .dashboard-event-grid { grid-template-columns: 1fr; }
    .dashboard-section-head h2 { font-size: 1.45rem; }
    .profile-content { width: min(100% - 1.25rem, 48rem); padding-top: 1.5rem; }
    .portal-assignment-list li { align-items: start; }
    .topbar__nav { gap: .6rem; }
    .dashboard-profile-link { font-size: .72rem; }
    .app-page .topbar { min-height: 60px; padding-inline: 1rem; }
    .app-page .topbar__user { max-width: 7rem; font-size: .7rem; }
    .dashboard-welcome { grid-template-columns: 1fr; min-height: auto; padding: 1.3rem; }
    .dashboard-welcome-art { min-height: 16rem; width: min(100%, 24rem); }
    .dashboard-welcome-art .portal-panel { padding: .75rem; }
    .dashboard-welcome-art .portal-panel--one { height: 62%; }
    .dashboard-welcome-art .portal-panel--three { height: 37%; bottom: 0; }
    .dashboard-welcome-art .portal-panel--one span,
    .dashboard-welcome-art .portal-panel--two span,
    .dashboard-welcome-art .portal-panel--three span { font-size: clamp(1rem, 6vw, 1.4rem); }
    .dashboard-welcome-art .portal-burst { display: none; }
    .profile-fields-grid { grid-template-columns: 1fr; }
    .profile-field--wide { grid-column: auto; }
    .profile-content > .page-header { padding: 1.2rem; }
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.brand {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-brand);
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--color-text-muted);
    margin-top: var(--space-1);
    font-size: var(--font-size-sm);
}

/* --------------------------------------------------------------------------
   Application page layout
   -------------------------------------------------------------------------- */
.app-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

/* Top navigation bar */
.topbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-3) var(--space-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar__brand {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-brand);
    letter-spacing: -0.01em;
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.topbar__user {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 12rem;
}

.topbar__logout-form {
    margin: 0;
}

/* Page content area */
.page-content {
    flex: 1;
    padding: var(--space-8) var(--space-5);
    max-width: 48rem;
    margin-inline: auto;
    width: 100%;
}

.page-header {
    margin-bottom: var(--space-8);
}

.page-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--color-text-muted);
    margin-top: var(--space-1);
    font-size: var(--font-size-sm);
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    padding: var(--space-8);
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.alert {
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-6);
    font-size: var(--font-size-sm);
}

.alert--error {
    background: var(--color-error-bg);
    border: 1px solid hsl(0, 72%, 85%);
    color: var(--color-error);
}

.alert--success {
    background: var(--color-success-bg);
    border: 1px solid hsl(142, 60%, 78%);
    color: var(--color-success);
}

.alert__list {
    margin: 0;
    padding-left: var(--space-5);
}

.alert__list li + li {
    margin-top: var(--space-1);
}

/* --------------------------------------------------------------------------
   Form components
   -------------------------------------------------------------------------- */
.auth-form,
.event-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

/* Side-by-side row (date + time) */
.form-row {
    display: flex;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.form-group--half {
    flex: 1 1 10rem;
    min-width: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.form-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text);
}

.required {
    color: var(--color-error);
    margin-left: var(--space-1);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-md);
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px hsl(232, 72%, 52%, 0.18);
}

.form-group--error .form-input {
    border-color: var(--color-error);
}

.form-group--error .form-input:focus {
    box-shadow: 0 0 0 3px hsl(0, 72%, 48%, 0.15);
}

.form-input--narrow {
    max-width: 12rem;
}

.form-error {
    font-size: var(--font-size-sm);
    color: var(--color-error);
}

.form-hint {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.form-note {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   Student registration and privacy notice
   -------------------------------------------------------------------------- */
.section-title {
    font-size: var(--font-size-lg);
    line-height: 1.3;
    margin-bottom: var(--space-3);
}

.event-summary {
    margin-bottom: var(--space-6);
}

.event-facts,
.privacy-facts {
    display: grid;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.event-facts > div,
.privacy-facts > div {
    display: grid;
    gap: var(--space-1);
}

.event-facts dt,
.privacy-facts dt {
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.event-facts dd,
.privacy-facts dd {
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

.privacy-notice {
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-brand);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
}

.privacy-notice a,
.registration-share-link a {
    color: var(--color-brand-dark);
    overflow-wrap: anywhere;
}

.alert--warning {
    background: hsl(42, 100%, 96%);
    border: 1px solid hsl(42, 80%, 75%);
    color: hsl(30, 80%, 25%);
}

.qr-result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
}

.registration-qr {
    width: min(17.5rem, 100%);
    height: auto;
    padding: var(--space-3);
    background: hsl(0, 0%, 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.qr-result .alert {
    margin: 0;
}

.registration-share-link {
    margin: calc(var(--space-6) * -1) 0 var(--space-6);
    overflow-wrap: anywhere;
}

.registration-share-link span {
    display: block;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* --------------------------------------------------------------------------
   Facilitator check-in
   -------------------------------------------------------------------------- */
.facilitator-page {
    max-width: 52rem;
}

.facilitator-event,
.facilitator-section {
    margin-bottom: var(--space-6);
}

.qr-reader {
    width: min(100%, 28rem);
    margin: var(--space-4) auto;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #111;
}

.qr-reader video {
    width: 100% !important;
    object-fit: cover;
}

.checkin-status {
    min-height: 1.5rem;
    margin-top: var(--space-4);
    font-weight: 600;
}

.checkin-status--success { color: hsl(145, 60%, 28%); }
.checkin-status--warning { color: hsl(30, 80%, 25%); }
.checkin-status--error { color: var(--color-error); }
.checkin-status--pending { color: hsl(215, 75%, 35%); }

.manual-search-row {
    align-items: end;
}

.manual-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
}

.manual-result span {
    overflow-wrap: anywhere;
}

.manual-results:empty {
    display: none;
}

.form-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    align-items: center;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-md);
    font-family: inherit;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition),
                box-shadow var(--transition), color var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn:focus-visible {
    outline: 3px solid hsl(232, 72%, 52%, 0.5);
    outline-offset: 2px;
}

/* Primary */
.btn--primary {
    background: var(--color-brand);
    color: hsl(0, 0%, 100%);
    border-color: var(--color-brand);
}

.btn--primary:hover {
    background: var(--color-brand-dark);
    border-color: var(--color-brand-dark);
}

.btn--primary:active {
    transform: translateY(1px);
}

/* Ghost (for topbar sign-out) */
.btn--ghost {
    background: transparent;
    color: var(--color-text-muted);
    border-color: var(--color-border);
}

.btn--ghost:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

/* Full-width */
.btn--full {
    width: 100%;
}

/* Small */
.btn--sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
}

/* --------------------------------------------------------------------------
   Responsive adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 400px) {
    .auth-card {
        padding: var(--space-6) var(--space-5);
    }

    .card {
        padding: var(--space-6) var(--space-5);
    }

}

/* Daló theme, account navigation, and quiet campus page art */
body.app-page {
    position: relative;
    isolation: isolate;
    color: var(--color-text);
    background-color: var(--portal-paper, #f6f4ed);
}

body.app-page::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background-image: url("campus-route.svg"), radial-gradient(circle, rgb(17 17 17 / .045) .7px, transparent 1px);
    background-position: center top, 0 0;
    background-repeat: no-repeat, repeat;
    background-size: 100% 100%, 14px 14px;
    opacity: .58;
}

html[data-theme="dark"] body.app-page {
    --portal-blue: #8bb8ff;
    --color-brand: #8bb8ff;
    --color-brand-dark: #b8d1fb;
    background-color: #14181d;
    color: #eff3f8;
}

html[data-theme="dark"] body.app-page::before {
    background-image: url("campus-route.svg"), radial-gradient(circle, rgb(255 255 255 / .045) .7px, transparent 1px);
    filter: brightness(2.2);
    opacity: .28;
}

html[data-theme="dark"] .portal-dashboard-page {
    --color-brand: #8bb8ff;
    --color-brand-dark: #b8d1fb;
}

.app-page .topbar {
    flex-wrap: wrap;
    gap: .5rem 1rem;
    padding: .55rem clamp(1rem, 4vw, 3.5rem);
}

.app-page .topbar__brand {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.app-page .topbar__nav {
    flex: 0 1 auto;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
    gap: .15rem clamp(.25rem, 1vw, .75rem);
}

.app-page .topbar__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: .4rem .45rem;
    border-bottom: 2px solid transparent;
    color: #d5d2ca;
    font-size: .78rem;
    text-decoration: none;
    white-space: nowrap;
}

.app-page .topbar__link:hover,
.app-page .topbar__link[aria-current="page"] {
    color: var(--portal-blue);
}

.app-page .topbar__link[aria-current="page"] {
    border-bottom-color: var(--portal-blue);
    font-weight: 800;
}

.app-page .topbar__user {
    max-width: 14rem;
    min-height: 44px;
    padding: .25rem .5rem;
    border: 1px solid #343941;
    border-radius: .65rem;
    background: #171a1e;
    color: #f6f4ed;
    font-size: .78rem;
    text-decoration: none;
}

.topbar__account-actions { display: flex; align-items: center; gap: .5rem; padding-left: 1rem; border-left: 1px solid #383838; }
.app-page .topbar__user:hover { background: #202328; }
.app-page .topbar__user[aria-current="page"] { border-color: #78aaff; background: rgb(120 170 255 / .1); }

.app-page .topbar .btn--ghost {
    min-height: 44px;
    padding: .45rem .75rem;
    border-radius: .5rem;
}

.theme-toggle {
    display: inline-grid;
    flex: 0 0 44px;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: .65rem;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.theme-toggle [data-theme-icon] {
    display: none;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle [data-theme-icon="moon"] { display: block; }
html[data-theme="dark"] .theme-toggle [data-theme-icon="moon"] { display: none; }
html[data-theme="dark"] .theme-toggle [data-theme-icon="sun"] { display: block; }
.theme-toggle:hover { border-color: rgb(120 170 255 / .35); background: rgb(120 170 255 / .12); }

.app-page .theme-toggle {
    color: #f6f4ed;
}

.app-page :focus-visible,
.portal-auth-page :focus-visible {
    outline: 3px solid #315fbd;
    outline-offset: 3px;
}

.event-form.card {
    width: min(100%, 44rem);
    margin-inline: auto;
    padding: clamp(1rem, 4vw, 2rem);
    gap: 1.25rem;
}

.event-form .form-input,
.portal-form input,
.portal-profile-form input,
.profile-field > input,
.profile-field > textarea,
.danger-zone-form input {
    min-height: 2.9rem;
}

.event-form .form-group--half {
    min-width: 0;
}

.event-form .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
}

.dashboard-event-card__date,
.dashboard-event-card__location {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
}

.dashboard-event-card__date svg,
.dashboard-event-card__location svg {
    flex: 0 0 1rem;
    width: 1rem;
    height: 1rem;
    margin-top: .1rem;
    fill: none;
    stroke: #315fbd;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.dashboard-event-card__date span,
.dashboard-event-card__location span {
    min-width: 0;
    overflow-wrap: anywhere;
}

html[data-theme="dark"] .dashboard-event-card__date svg,
html[data-theme="dark"] .dashboard-event-card__location svg {
    stroke: #8bb8ff;
}

html[data-theme="dark"] .app-page .card,
html[data-theme="dark"] .app-page .event-form,
html[data-theme="dark"] .dashboard-event-card,
html[data-theme="dark"] .ticket-card,
html[data-theme="dark"] .ticket-qr-result,
html[data-theme="dark"] .ticket-empty,
html[data-theme="dark"] .portal-manage-card,
html[data-theme="dark"] .portal-profile-form,
html[data-theme="dark"] .portal-danger-zone {
    border-color: #46515f;
    background-color: #202832;
    color: #eff3f8;
}

html[data-theme="dark"] .dashboard-event-card__bar,
html[data-theme="dark"] .dashboard-event-card__counts,
html[data-theme="dark"] .dashboard-event-card__location,
html[data-theme="dark"] .dashboard-event-card__owner,
html[data-theme="dark"] .ticket-card__location,
html[data-theme="dark"] .ticket-card__status,
html[data-theme="dark"] .ticket-card__action p,
html[data-theme="dark"] .ticket-qr-result > p:not(.portal-eyebrow),
html[data-theme="dark"] .ticket-empty p,
html[data-theme="dark"] .portal-manage-card > p,
html[data-theme="dark"] .profile-optional,
html[data-theme="dark"] .profile-field .form-note,
html[data-theme="dark"] .portal-profile-form .form-note {
    color: #c0c6cf;
}

html[data-theme="dark"] .dashboard-event-card__bar,
html[data-theme="dark"] .dashboard-event-card__counts,
html[data-theme="dark"] .portal-profile-form > .form-note,
html[data-theme="dark"] .portal-assignment-list li {
    border-color: #46515f;
}

html[data-theme="dark"] .dashboard-event-card__actions a,
html[data-theme="dark"] .profile-back-link a,
html[data-theme="dark"] .tickets-back-link a,
html[data-theme="dark"] .ticket-card__date,
html[data-theme="dark"] .ticket-qr-result .portal-eyebrow,
html[data-theme="dark"] .dashboard-section-head .portal-eyebrow {
    color: #a9c9fa;
}

html[data-theme="dark"] .dashboard-empty,
html[data-theme="dark"] .registration-share-link {
    border-color: #46515f;
    background-color: #202832;
    color: #eff3f8;
}

html[data-theme="dark"] .dashboard-empty p,
html[data-theme="dark"] .dashboard-empty__hint,
html[data-theme="dark"] .account-registration-summary p {
    color: #c0c6cf;
}

html[data-theme="dark"] .profile-field > input,
html[data-theme="dark"] .profile-field > textarea,
html[data-theme="dark"] .portal-profile-form input,
html[data-theme="dark"] .danger-zone-form input,
html[data-theme="dark"] .form-input {
    border-color: #596575;
    background-color: #151a20;
    color: #eff3f8;
}

html[data-theme="dark"] .portal-assignment-list li {
    background: #18212b;
}

html[data-theme="dark"] .portal-danger-zone {
    border-color: #a74e54;
    box-shadow: 4px 4px 0 #48272b;
}

html[data-theme="dark"] .portal-danger-zone h2,
html[data-theme="dark"] .portal-danger-zone .danger-zone-warning {
    color: #ffb4ab;
}

html[data-theme="dark"] .portal-danger-zone > p {
    color: #c0c6cf;
}

html[data-theme="dark"] .app-page .btn--primary {
    background: #8bb8ff;
    color: #111;
}

html[data-theme="dark"] .app-page .btn--ghost {
    border-color: #6a7685;
    color: #eff3f8;
}

html[data-theme="dark"] .profile-content > .page-header {
    background: #080a0d;
}

html[data-theme="dark"] .portal-event-stats strong {
    color: #8bb8ff;
}

html[data-theme="dark"] .portal-event-stats span {
    color: #d5dce5;
}

html[data-theme="dark"] .stat-status--ok { color: #91d7a1; }
html[data-theme="dark"] .stat-status--stale { color: #ffd08c; }
html[data-theme="dark"] .checkin-status--success { color: #91d7a1; }
html[data-theme="dark"] .checkin-status--warning { color: #ffd08c; }
html[data-theme="dark"] .checkin-status--pending { color: #a9c9fa; }

html[data-theme="dark"] .app-page :focus-visible,
html[data-theme="dark"] .portal-auth-page :focus-visible {
    outline-color: #8bb8ff;
}

html[data-theme="dark"] .dashboard-event-card__date,
html[data-theme="dark"] .profile-content > .page-header .portal-eyebrow {
    color: #a9c9fa;
}

html[data-theme="dark"] .dashboard-event-card__actions span:not(.is-muted) {
    color: #a9c9fa;
}

html[data-theme="dark"] .registration-share-link a {
    color: #a9c9fa;
}

html[data-theme="dark"] .alert--error {
    border-color: #704044;
    background-color: #401c20;
    color: #ffb4ab;
}

html[data-theme="dark"] .alert--success {
    border-color: #315a3a;
    background-color: #15311f;
    color: #a6d9ad;
}

html[data-theme="dark"] .alert--warning {
    border-color: #725326;
    background-color: #332813;
    color: #ffd08c;
}

.portal-modal > .theme-toggle {
    position: absolute;
    top: .45rem;
    right: 2.7rem;
    color: #171717;
}

html[data-theme="dark"] .portal-auth-page {
    --portal-blue: #8bb8ff;
}

html[data-theme="dark"] .portal-auth-page .portal-modal {
    border-color: #46515f;
    background: #202832;
    box-shadow: 8px 8px 0 #8bb8ff;
    color: #eff3f8;
}

html[data-theme="dark"] .portal-auth-page .portal-modal > p {
    color: #c0c6cf;
}

html[data-theme="dark"] .portal-auth-page .portal-modal__close,
html[data-theme="dark"] .portal-auth-page .portal-modal__foot a {
    color: #eff3f8;
}

html[data-theme="dark"] .portal-auth-page .portal-modal__foot {
    border-color: #46515f;
    color: #c0c6cf;
}

html[data-theme="dark"] .portal-auth-page .portal-modal__foot small,
html[data-theme="dark"] .portal-auth-page .portal-privacy dd {
    color: #c0c6cf;
}

html[data-theme="dark"] .portal-auth-page .portal-form label {
    color: #e1e6ed;
}

html[data-theme="dark"] .portal-auth-page .portal-form input,
html[data-theme="dark"] .portal-auth-page .portal-privacy {
    border-color: #596575;
    background: #14181d;
    color: #eff3f8;
}

html[data-theme="dark"] .portal-auth-page .portal-form button {
    background: #10151b;
    color: #eff3f8;
}

html[data-theme="dark"] .portal-auth-page .portal-form button span,
html[data-theme="dark"] .portal-auth-page .portal-privacy a,
html[data-theme="dark"] .portal-auth-page .portal-auth-help a {
    color: #a9c9fa;
}

html[data-theme="dark"] .portal-auth-page .portal-alert {
    border-color: #704044;
    background: #401c20;
    color: #ffb4ab;
}

html[data-theme="dark"] .portal-auth-page .portal-alert--success {
    border-color: #315a3a;
    background: #15311f;
    color: #a6d9ad;
}

html[data-theme="dark"] .portal-auth-page .portal-field-error {
    color: #ffb4ab;
}

html[data-theme="dark"] .portal-auth-page .theme-toggle {
    color: #eff3f8;
}

@media (max-width: 860px) {
    .app-page .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .app-page .topbar__nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }

    .app-page .topbar__link { flex: 1; justify-content: center; }
    .topbar__account-actions { grid-column: 2; grid-row: 1; border-left: 0; padding-left: 0; }
}

@media (max-width: 580px) {
    .app-page .topbar {
        gap: .2rem;
        padding: .4rem .75rem;
    }

    .app-page .topbar__nav > a {
        min-width: 0;
        padding-inline: .25rem;
        font-size: .75rem;
    }

    .topbar__account-actions { gap: .2rem; }
    .app-page .topbar__user { padding: .25rem; }
    .topbar__name { display: none; }
    .app-page .topbar .btn--ghost { width: 100%; padding-inline: .35rem; font-size: .72rem; white-space: nowrap; }

    .app-page .dashboard-content,
    .app-page .tickets-content,
    .app-page .profile-content {
        width: min(100% - 1.25rem, 76rem);
    }

    .app-page .page-content {
        width: min(100% - 1.25rem, 48rem);
        padding: 1.25rem 0 2.5rem;
    }

    .event-form .form-row {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .event-form .form-group--half {
        flex-basis: 100%;
    }

    .event-form .form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .event-form .form-actions > * {
        width: 100%;
        min-height: 2.75rem;
    }

    .portal-modal > .theme-toggle {
        right: 2.45rem;
    }

    body.app-page::before {
        opacity: .34;
    }

    html[data-theme="dark"] body.app-page::before {
        opacity: .2;
    }
}
