:root {
    --bg-0: #0B0D10;
    --bg-1: #12151A;
    --surface: #161A21;
    --surface-2: #1C222C;
    --text: #F2F4F7;
    --muted: #9AA3B2;
    --accent: #C8F542;
    --accent-ink: #10140A;
    --danger: #FF6B6B;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --radius: 16px;
    --font-display: "Bebas Neue", sans-serif;
    --font-body: "Manrope", sans-serif;
}

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

html {
    background-color: var(--bg-0);
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

html,
body {
    margin: 0;
    height: 100%;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(200, 245, 66, 0.12), transparent 55%),
        radial-gradient(90% 60% at 100% 100%, rgba(60, 90, 140, 0.18), transparent 50%),
        linear-gradient(180deg, var(--bg-1), var(--bg-0));
    background-attachment: scroll;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.auth-body {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem max(1.25rem, env(safe-area-inset-bottom));
}

.auth-shell {
    width: min(100%, 420px);
    animation: rise 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-brand {
    margin-bottom: 1.5rem;
}

.brand-mark {
    margin: 0 0 0.85rem;
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 12vw, 3.6rem);
    letter-spacing: 0.04em;
    line-height: 0.9;
    color: var(--text);
}

.auth-logo {
    display: block;
    width: min(100%, 360px);
    height: auto;
    margin: 0 auto 0.35rem;
    object-fit: contain;
    animation: rise 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #000;
}

.brand-lockup .brand-mark {
    margin: 0;
    font-size: 1.8rem;
}

.auth-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-lead,
.page-lead {
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.45;
}

.auth-form {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    animation: rise 640ms 80ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.field {
    display: grid;
    gap: 0.45rem;
}

/* Author .field { display:grid } overrides the UA [hidden] rule — force hide. */
.field[hidden],
[hidden] {
    display: none !important;
}

.field-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.field-input {
    width: 100%;
    min-height: 52px;
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-input::placeholder {
    color: #6f7888;
}

.field-input:focus {
    border-color: color-mix(in srgb, var(--accent) 55%, white);
    box-shadow: 0 0 0 3px rgba(200, 245, 66, 0.18);
}

.password-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 0.85rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.section-head-row > .ghost-btn {
    align-self: center;
    flex-shrink: 0;
}

.ghost-btn:hover,
.ghost-btn:focus-visible {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
}

.remember {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--muted);
    font-size: 0.92rem;
    user-select: none;
}

.remember input {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--accent);
}

.btn-primary {
    min-height: 54px;
    margin-top: 0.25rem;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: var(--accent-ink);
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 160ms ease, filter 160ms ease;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

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

.btn-primary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.alert {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.4;
    animation: shake 420ms ease both;
}

.alert-error {
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.35);
    color: #ffb4b4;
}

.alert-success {
    background: rgba(200, 245, 66, 0.1);
    border: 1px solid rgba(200, 245, 66, 0.28);
    color: #dff9a0;
    animation: rise 420ms ease both;
}

.app-body {
    /* Locked app shell: only the content row scrolls.
       100dvh: iOS standalone computes the % height chain WITHOUT the bottom
       safe area (leaves a dead black strip under the nav); dvh spans the
       real dynamic viewport, including under the home indicator. */
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "topbar"
        "content"
        "bottomnav";
}

.topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding:
        calc(env(safe-area-inset-top, 0px) + 0.85rem)
        max(1.25rem, env(safe-area-inset-right, 0px))
        1rem
        max(1.25rem, env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--border);
    background: #0b0d10;
    z-index: 2;
}

.topbar .brand-mark {
    margin: 0;
    font-size: 1.8rem;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.user-neon {
    font-family: var(--font-display);
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    color: #7DF9FF;
    text-shadow:
        0 0 6px rgba(125, 249, 255, 0.85),
        0 0 16px rgba(125, 249, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 42vw;
}

.user-menu {
    position: relative;
    min-width: 0;
}

.user-menu-toggle {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0.15rem 0.2rem;
    margin: 0;
    cursor: pointer;
    text-align: left;
    max-width: 42vw;
}

.user-menu-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

.user-menu-panel {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    z-index: 40;
    min-width: 9.5rem;
    padding: 0.35rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #12151a;
    box-shadow: var(--shadow);
}

.user-menu-panel[hidden] {
    display: none !important;
}

.user-menu-item {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #ffb4b4;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0.55rem 0.75rem;
    text-align: left;
}

.user-menu-item:hover,
.user-menu-item:focus-visible {
    background: rgba(255, 107, 107, 0.12);
}

.topbar-back {
    flex-shrink: 0;
}

.brand-link {
    text-decoration: none;
    color: inherit;
}

.admin-nav {
    grid-area: bottomnav;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.25rem;
    padding:
        0.55rem
        max(0.55rem, env(safe-area-inset-right, 0px))
        calc(0.55rem + env(safe-area-inset-bottom, 0px))
        max(0.55rem, env(safe-area-inset-left, 0px));
    background: #0c0e12;
    border-top: 1px solid var(--border);
    z-index: 2;
}

.admin-nav-link {
    min-height: 44px;
    display: grid;
    place-items: center;
    padding: 0.35rem 0.25rem;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.admin-nav-link.is-active {
    color: var(--accent-ink);
    background: var(--accent);
}

.page {
    grid-area: content;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 1.5rem 1.25rem 2rem;
    max-width: 720px;
    width: 100%;
}

.member-body .page {
    /* Let JS own horizontal pans; browser keeps vertical scroll. */
    touch-action: pan-y;
    will-change: transform;
}

.member-body .page.is-swiping {
    pointer-events: none;
}

.page-wide {
    max-width: 860px;
    margin: 0 auto;
}

.page-title {
    margin: 0;
    font-size: clamp(1.6rem, 5vw, 2rem);
    letter-spacing: -0.02em;
}

.section-head {
    margin-bottom: 1rem;
}

.section-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.profile-summary {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(22, 26, 33, 0.72);
}

.profile-summary-line {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.98rem;
}

.profile-summary-line span {
    color: var(--muted);
}

.profile-summary .data-meta {
    margin-top: 0.35rem;
}

.measure-summary-line {
    align-items: baseline;
    row-gap: 0.35rem;
}

.dot-sep {
    color: var(--muted);
}

.change-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.data-item-stack {
    align-items: flex-start;
}

.section-title {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.panel-section + .panel-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.admin-form {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 0.5rem;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.field-file {
    padding: 0.65rem;
}

.field-input option {
    background: var(--surface-2);
    color: var(--text);
}

.action-grid {
    display: grid;
    gap: 0.85rem;
}

.action-tile {
    display: grid;
    gap: 0.35rem;
    padding: 1.1rem 1.15rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(28, 34, 44, 0.95), rgba(18, 21, 26, 0.9));
    color: inherit;
    text-decoration: none;
    transition: border-color 160ms ease, transform 160ms ease;
}

.action-tile:hover,
.action-tile:focus-visible {
    border-color: rgba(200, 245, 66, 0.35);
    transform: translateY(-1px);
}

.action-kicker {
    font-family: var(--font-display);
    letter-spacing: 0.06em;
    color: var(--accent);
    font-size: 1.2rem;
}

.action-tile strong {
    font-size: 1.05rem;
}

.action-tile span:last-child {
    color: var(--muted);
    font-size: 0.9rem;
}

.data-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.data-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(22, 26, 33, 0.72);
}

.data-item-media {
    align-items: center;
}

.data-grow {
    flex: 1;
    min-width: 0;
}

.data-title {
    margin: 0;
    font-weight: 700;
    font-size: 0.98rem;
}

.data-meta {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    background: var(--surface-2);
    flex-shrink: 0;
}

.thumb-empty {
    background:
        linear-gradient(135deg, rgba(200, 245, 66, 0.12), transparent 55%),
        var(--surface-2);
}

.empty-state {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.day-block + .day-block {
    margin-top: 1.25rem;
}

.day-title {
    margin: 0 0 0.65rem;
    font-family: var(--font-display);
    letter-spacing: 0.04em;
    font-size: 1.55rem;
    color: var(--accent);
}

.day-title a {
    color: inherit;
    text-decoration: none;
}

.day-title .day-chip-cta {
    margin-left: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    letter-spacing: 0;
    vertical-align: middle;
}

.assign-add {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.assign-add .section-title {
    margin-bottom: 0.75rem;
}

.assign-sync .admin-form {
    margin-top: 0.5rem;
}

.inline-form {
    margin: 0;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
}

.ghost-danger {
    color: #ffb4b4;
    border-color: rgba(255, 107, 107, 0.28);
}

.field-hint {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.eyebrow {
    margin: 0 0 0.4rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.eyebrow a {
    color: var(--accent);
    text-decoration: none;
}

.member-nav {
    grid-template-columns: repeat(2, 1fr);
}

.day-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.day-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 72px;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
}

.day-chip-num {
    font-family: var(--font-display);
    font-size: 1.45rem;
    letter-spacing: 0.03em;
}

.day-chip-cta {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
}

.day-chip.is-done {
    border-color: rgba(200, 245, 66, 0.35);
    background: rgba(200, 245, 66, 0.08);
}

.day-chip-check {
    width: 1.6rem;
    height: 1.6rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 800;
}

.workout-card {
    display: grid;
    gap: 1.1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(22, 26, 33, 0.85);
    animation: rise 420ms ease both;
    scroll-margin: 18vh;
    transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.workout-feed {
    display: grid;
    gap: 1.75rem;
    padding-bottom: 2rem;
}

.workout-card.is-active {
    border-color: rgba(200, 245, 66, 0.35);
    box-shadow: 0 0 0 1px rgba(200, 245, 66, 0.12), 0 18px 40px rgba(0, 0, 0, 0.28);
}

.session-complete {
    display: grid;
    justify-items: stretch;
    padding: 0.5rem 0 1.5rem;
}

.session-complete .btn-primary,
.session-complete .btn-link {
    width: 100%;
    min-height: 54px;
}

.workout-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-items: stretch;
    min-height: 280px;
}

.workout-media {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 0.65rem;
    min-width: 0;
}

.workout-hero {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    border-radius: 14px;
    background: var(--surface-2);
    display: block;
}

.workout-hero-btn {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 180px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    border-radius: 14px;
    overflow: hidden;
}

.workout-hero-btn-video {
    cursor: zoom-in;
}

.workout-hero-frame {
    width: 100%;
    height: 100%;
    min-height: 180px;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    display: block;
    pointer-events: none;
}

.workout-hero-frame .workout-video {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.workout-hero-btn:hover .workout-hero,
.workout-hero-btn:focus-visible .workout-hero {
    transform: scale(1.03);
}

.workout-hero-btn .workout-hero {
    min-height: 180px;
    transition: transform 280ms ease;
}

.thumb-video {
    display: grid;
    place-items: center;
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 700;
    background:
        linear-gradient(145deg, rgba(200, 245, 66, 0.16), transparent 60%),
        var(--surface-2);
}

.media-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(5, 7, 10, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 320ms ease,
        visibility 320ms ease,
        background 320ms ease,
        backdrop-filter 320ms ease,
        -webkit-backdrop-filter 320ms ease;
    cursor: zoom-out;
}

.image-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background: rgba(5, 7, 10, 0.42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.image-lightbox img,
.image-lightbox .lightbox-video {
    max-width: min(92vw, 720px);
    max-height: min(78vh, 720px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    transform: scale(0.92) translateY(10px);
    opacity: 0;
    transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1), opacity 280ms ease;
    background: #000;
}

.image-lightbox .lightbox-video {
    width: min(92vw, 720px);
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.image-lightbox.is-open img,
.image-lightbox.is-open .lightbox-video {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.workout-hero-empty {
    background:
        linear-gradient(145deg, rgba(200, 245, 66, 0.16), transparent 60%),
        var(--surface-2);
}

.workout-meta {
    min-width: 0;
}

.step-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.workout-name {
    margin: 0.1rem 0;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    line-height: 1.15;
}

.prev-weight {
    margin: 0.35rem 0 0;
    color: #c7d0de;
    font-size: 0.82rem;
}

.prev-weight strong {
    color: var(--accent);
}

.plate-ui {
    display: grid;
    gap: 0.45rem;
    justify-items: center;
    align-content: center;
    padding: 0.75rem 0.45rem;
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 20%, rgba(200, 245, 66, 0.08), transparent 55%),
        #0e1116;
    border: 1px solid var(--border);
    min-width: 0;
}

.bar-stage {
    width: min(100%, 220px);
    height: 56px;
    display: grid;
    grid-template-columns: 1fr 12px 40px 12px 1fr;
    align-items: center;
    gap: 0;
}

.plate-stack {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 48px;
    overflow: hidden;
}

.plate-stack-left {
    justify-content: flex-end;
}

.plate-stack-right {
    justify-content: flex-start;
}

.disc {
    width: 8px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.bar-sleeve {
    height: 14px;
    background: linear-gradient(180deg, #9aa3b2, #5c6573);
    border-radius: 2px;
}

.bar-center {
    height: 20px;
    background: linear-gradient(180deg, #d7dde8, #8b93a3);
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.weight-readout {
    margin: 0;
    font-family: var(--font-display);
    font-size: 2.2rem;
    letter-spacing: 0.04em;
    line-height: 1;
}

.weight-unit {
    font-size: 0.95rem;
    color: var(--muted);
}

.save-status {
    margin: 0;
    min-height: 1em;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
}

.plate-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
}

.plate-btn {
    min-width: 42px;
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.plate-btn:active {
    transform: scale(0.97);
    border-color: rgba(200, 245, 66, 0.5);
}

.plate-actions,
.session-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.plate-actions .ghost-btn {
    min-height: 36px;
    padding: 0 0.55rem;
    font-size: 0.8rem;
}

.btn-link {
    display: inline-grid;
    place-items: center;
    text-decoration: none;
    padding: 0 1rem;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.stat-card {
    padding: 0.85rem 0.7rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: grid;
    gap: 0.2rem;
}

.stat-label,
.stat-meta {
    color: var(--muted);
    font-size: 0.75rem;
}

.stat-value {
    font-size: 1.05rem;
    font-weight: 700;
}

.delta-badge {
    flex-shrink: 0;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
}

.delta-badge.is-up {
    color: var(--accent-ink);
    background: var(--accent);
    border-color: transparent;
}

.delta-badge.is-down {
    color: #ffb4b4;
    border-color: rgba(255, 107, 107, 0.35);
}

@media (min-width: 720px) {
    .app-body {
        grid-template-areas:
            "topbar"
            "bottomnav"
            "content";
        grid-template-rows: auto auto minmax(0, 1fr);
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .admin-nav {
        grid-template-columns: repeat(6, max-content);
        justify-content: start;
        gap: 0.5rem;
        padding: 0.75rem 1.25rem;
        border-top: 0;
        border-bottom: 1px solid var(--border);
        background: rgba(11, 13, 16, 0.9);
    }

    .member-nav {
        grid-template-columns: repeat(2, max-content);
    }

    .admin-nav-link {
        padding: 0.55rem 0.9rem;
        font-size: 0.88rem;
    }

    .page {
        overflow: visible;
    }

    .action-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .day-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@media (min-width: 640px) {
    .auth-form {
        padding: 1.5rem;
    }
}

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

    .image-lightbox img,
    .image-lightbox .lightbox-video {
        transform: none !important;
    }
}
