/* ============================================
   V2 STYLES — Glass morphism + theme tokens
   All accent colors reference var(--accent) etc.
   ============================================ */

* { font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif; }

body {
    background: linear-gradient(135deg, var(--bg-from) 0%, var(--bg-to) 100%);
    color: #fff;
    overflow: hidden;
    margin: 0;
}

/* Ambient gradient orbs — static to avoid GPU thrashing during scroll */
.orb-container { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; will-change: auto; }
.orb { position: absolute; border-radius: 50%; filter: blur(150px); }
.orb-1 { width: 500px; height: 500px; background: var(--orb-1); top: 10%; left: 10%; opacity: var(--orb-1-opacity); }
.orb-2 { width: 600px; height: 600px; background: var(--orb-2); top: 50%; right: 5%; opacity: var(--orb-2-opacity); }
.orb-3 { width: 400px; height: 400px; background: var(--orb-3); bottom: 10%; left: 20%; opacity: var(--orb-3-opacity); }

/* Glass morphism — no backdrop-filter for scroll perf */
.glass { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); }
.glass-darker { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); }

/* Content wrapper */
.v2-wrapper { position: relative; z-index: 10; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }

/* ---- Navigation ---- */
.navbar { position: relative; padding: 0.75rem 2rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.nav-brand { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px; text-decoration: none; color: #fff; display: inline-flex; align-items: center; gap: 0.5rem; }
.nav-brand-logo { width: 2.5rem; height: 2.5rem; display: block; }
.nav-links { display: flex; gap: 2rem; justify-content: center; position: absolute; left: 50%; transform: translateX(-50%); }
.nav-link { font-size: 0.9rem; font-weight: 500; color: rgba(255,255,255,0.7); cursor: pointer; transition: all 0.3s; padding: 0.4rem 0.75rem; border-radius: 6px; position: relative; text-decoration: none; }
.nav-link:hover { color: #fff; background: rgba(var(--accent-rgb), 0.1); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.25); }
.nav-link.active { color: #fff; }
.nav-link.active::after { content: ''; position: absolute; bottom: -2px; left: 0.25rem; right: 0.25rem; height: 2px; background: var(--accent); border-radius: 2px; }
.nav-user-name { font-size: 0.85rem; font-weight: 500; color: rgba(255,255,255,0.8); }
.auth-buttons { display: flex; gap: 0.75rem; align-items: center; }
.nav-settings-btn { position: relative; display: inline-flex; align-items: center; gap: 0.4rem; }
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 1; box-shadow: 0 0 8px rgba(var(--accent-rgb),0.5); }
.nav-badge:empty { display: none; }

/* ---- Buttons ---- */
.btn { padding: 0.5rem 1.25rem; border-radius: 0.6rem; font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: all 0.3s; border: none; font-family: inherit; }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: #fff; }
.btn-outline:hover { background: rgba(var(--accent-rgb),0.1); border-color: var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb),0.25); }
.btn-primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-darker) 100%); color: #fff; }
.btn-primary:hover { box-shadow: 0 0 20px rgba(var(--accent-rgb),0.4); transform: translateY(-1px); }

/* ---- Main layout ---- */
.main-content { flex: 1; display: flex; overflow: hidden; padding: 1rem 1.5rem; gap: 1rem; min-height: 0; }

/* ---- Calendar section ---- */
.calendar-section { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* Controls bar */
.controls-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; padding: 0.75rem 1rem; border-radius: 0.75rem; flex-shrink: 0; }
.controls-left, .controls-right { display: flex; gap: 0.5rem; align-items: center; }
.controls-center { text-align: center; font-weight: 600; font-size: 0.95rem; color: rgba(255,255,255,0.9); }
.control-btn { padding: 0.4rem 0.8rem; border-radius: 0.4rem; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1); color: #fff; cursor: pointer; font-weight: 500; transition: all 0.3s; font-size: 0.8rem; font-family: inherit; }
.control-btn:hover { background: rgba(var(--accent-rgb),0.15); border-color: var(--accent); }
.control-btn.today { background: rgba(var(--accent-rgb),0.2); border-color: var(--accent); }

/* ---- Calendar scroll wrapper ---- */
.calendar-scroll-wrapper { flex: 1; overflow-y: auto; overflow-x: hidden; border-radius: 0.75rem; min-height: 0; }
.calendar-scroll-wrapper::-webkit-scrollbar { width: 8px; }
.calendar-scroll-wrapper::-webkit-scrollbar-track { background: transparent; }
.calendar-scroll-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.calendar-scroll-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* ---- Day header row (sticky) ---- */
.day-headers { display: grid; grid-template-columns: 54px repeat(7, 1fr); position: sticky; top: 0; z-index: 30; background: var(--bg-sticky); border: 1px solid rgba(255,255,255,0.05); border-radius: 0.75rem; flex-shrink: 0; margin-bottom: 0.5rem; }
.day-header-cell { position: relative; padding: 0.6rem 0.25rem; text-align: center; font-weight: 600; font-size: 0.8rem; color: rgba(255,255,255,0.7); }
.day-header-cell .day-name { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.5); }
.day-header-cell .day-num { font-size: 0.95rem; margin-top: 2px; }
.day-header-cell.today { color: var(--accent); }
.day-header-cell.today .day-num { background: var(--accent); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.day-header-cell.today::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}
.time-header { font-size: 0.7rem; color: rgba(255,255,255,0.3); display: flex; align-items: center; justify-content: center; }

/* ---- Time grid ---- */
.time-grid { display: grid; grid-template-columns: 54px repeat(7, 1fr); position: relative; }

.time-label { font-size: 0.7rem; color: rgba(255,255,255,0.35); text-align: center; height: 60px; border-top: 1px solid rgba(255,255,255,0.04); position: relative; }
.time-label span { position: absolute; top: 25%; transform: translate(-50%, -50%); left: 50%; }

.day-cell { position: relative; height: 60px; border-top: 1px solid rgba(255,255,255,0.04); border-left: 1px solid rgba(255,255,255,0.04); }
.day-cell.today-col { background: rgba(var(--accent-rgb),0.03); }
.day-cell:hover { background: rgba(255,255,255,0.02); }
.day-cell::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid rgba(255,255,255,0.02); }

/* ---- Collapsed hours divider ---- */
.collapsed-divider {
    background: rgba(255,255,255,0.02);
    border-top: 1px dashed rgba(255,255,255,0.08);
    border-bottom: 1px dashed rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}
.collapsed-label {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.15);
    letter-spacing: 2px;
}

/* ---- Event block ---- */
.event-block {
    position: absolute; border-radius: 4px; padding: 3px 5px;
    font-size: 0.68rem; font-weight: 600; color: #fff; cursor: pointer; overflow: hidden;
    border-left: 3px solid; background: rgba(255,255,255,0.08);
    border-top: 1px solid rgba(255,255,255,0.1); border-right: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: all 0.2s ease; z-index: 10; line-height: 1.3;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.event-block:hover { transform: scale(1.03); box-shadow: 0 0 14px rgba(255,255,255,0.2); z-index: 20; }
.evt-thumb {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}
/* Collab: each participating club's photo as an overlapping avatar stack. */
.evt-thumb-stack { display: flex; }
.evt-thumb-stack .evt-thumb {
    margin-left: -10px;
    border: 1.5px solid rgba(0,0,0,0.45);
    box-sizing: border-box;
}
.evt-thumb-stack .evt-thumb:first-child { margin-left: 0; }
.evt-info {
    min-width: 0;
    flex: 1;
}
.event-block .evt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-block .evt-time { font-size: 0.6rem; opacity: 0.75; white-space: nowrap; }
.evt-club {
    font-size: 0.65rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Midnight-crossing indicators ---- */
.event-block.continues-next-day {
    border-bottom: 3px dashed rgba(255,255,255,0.25);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.event-block.continued-from-prev-day {
    border-top: 3px dotted rgba(255,255,255,0.25);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* ---- Discord sync badge (calendar grid) ---- */
.evt-discord-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    opacity: 0.7;
    color: white;
    pointer-events: none;
    line-height: 1;
}

/* ---- Collab badge (calendar grid) ---- */
/* Stacks to the left of the Discord badge when both apply. */
.evt-collab-badge {
    position: absolute;
    top: 2px;
    right: 18px;
    opacity: 0.85;
    color: white;
    pointer-events: none;
    line-height: 1;
}

/* ---- Collab multi-color left stripe (calendar grid) ---- */
/* Replaces the single-color border-left when an event spans multiple clubs.
   Each participating club's color paints an equal vertical slice via the
   inline linear-gradient. Border-left is collapsed to 0 so the stripe sits
   flush at the outer edge; padding-left is bumped to keep text alignment
   identical to non-collab events. */
.event-block.is-collab {
    border-left-width: 0;
    padding-left: 8.5px;
}
.evt-collab-stripe {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3.5px;
    border-top-left-radius: inherit;
    border-bottom-left-radius: inherit;
    pointer-events: none;
}

/* ---- Collab divergence warning (event detail modal) ---- */
/* Fires when partner clubs' rows disagree on start/end times (e.g. their
   Discord guilds were edited independently). */
.modal-divergence-warning {
    margin: 12px 0;
    padding: 10px 12px;
    background: rgba(245, 158, 11, 0.10);
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
}
.modal-divergence-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f59e0b;
    margin-bottom: 6px;
}
.modal-divergence-hint {
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
}
.modal-divergence-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}
.modal-divergence-list li {
    padding: 3px 0;
}

/* ---- Collab section (event detail modal) ---- */
.modal-collab-section {
    margin: 12px 0;
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    border-left: 3px solid var(--accent, #6366f1);
}
.modal-collab-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary, rgba(255,255,255,0.75));
    display: flex;
    align-items: center;
    gap: 6px;
}
.modal-collab-list { list-style: none; padding: 0; margin: 0; }
.modal-collab-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.modal-collab-item a { color: inherit; text-decoration: none; }
.modal-collab-item a:hover { text-decoration: underline; }
.modal-collab-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.modal-collab-tag {
    font-size: 0.7rem;
    padding: 1px 6px;
    background: rgba(255,215,0,0.15);
    color: #ffd54a;
    border-radius: 4px;
    text-transform: lowercase;
}
.modal-collab-discord {
    color: rgba(255,255,255,0.55);
    display: inline-flex;
    align-items: center;
}

/* ---- Collab indicator (club detail upcoming list) ---- */
.upcoming-collab {
    display: inline-flex;
    align-items: center;
    color: rgba(255,255,255,0.55);
    margin-left: 4px;
}

/* ---- Collab link picker (detail modal → link with existing event) ---- */
.collab-link-candidates {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    max-height: 360px;
    overflow-y: auto;
}
.collab-link-candidate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
}
.collab-link-candidate-info {
    flex: 1;
    min-width: 0;
}
.collab-link-candidate-title {
    font-weight: 500;
    margin-bottom: 2px;
}
.collab-link-candidate-discord {
    margin-left: 4px;
    color: rgba(255, 255, 255, 0.6);
    display: inline-flex;
    vertical-align: middle;
}
.collab-link-candidate-meta {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

/* ---- Multi-select (collab invitee picker, etc.) ---- */
/* Native <details> + <summary> styled to match .form-select; the panel
   floats above the form so opening doesn't push other fields around. */
.multi-select {
    position: relative;
}
.multi-select-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
}
.multi-select-summary::-webkit-details-marker { display: none; }
.multi-select-summary::after {
    content: '▾';
    opacity: 0.6;
    font-size: 0.8em;
    transition: transform 0.15s ease;
}
.multi-select[open] > .multi-select-summary::after {
    transform: rotate(180deg);
}
.multi-select-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: rgba(20, 20, 28, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.multi-select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    user-select: none;
}
.multi-select-option:hover {
    background: rgba(255, 255, 255, 0.06);
}
.multi-select-option input[type="checkbox"] {
    cursor: pointer;
}
.multi-select-option.is-locked {
    cursor: default;
    opacity: 0.7;
}
.multi-select-option.is-locked:hover {
    background: transparent;
}
.multi-select-option.is-locked input[type="checkbox"] {
    cursor: not-allowed;
}
.multi-select-tag {
    font-size: 0.7rem;
    font-style: normal;
    color: var(--accent, #6366f1);
    margin-left: 4px;
    padding: 1px 6px;
    background: rgba(var(--accent-rgb, 99, 102, 241), 0.15);
    border-radius: 4px;
}

/* The hint paragraph uses margin-top:-8px to snuggle under regular inputs
   that have their own bottom margin. The <details> element above doesn't —
   override here so the hint has breathing room when it follows a multi-select. */
.multi-select + .settings-section-hint {
    margin-top: 6px;
}


/* ---- Discord synced event notice (detail modal) ---- */
.synced-event-notice {
    color: var(--text-secondary, rgba(255,255,255,0.5));
    font-style: italic;
    font-size: 13px;
}

/* ---- Current time line ---- */
.current-time-line { position: absolute; height: 2px; background: var(--accent); z-index: 25; pointer-events: none; box-shadow: 0 0 8px rgba(var(--accent-rgb),0.6); }
.current-time-line::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 6px rgba(var(--accent-rgb),0.8); }

/* ---- Overflow badge (+N more) ---- */
.overflow-badge {
    position: absolute;
    width: 32px;
    border-radius: 12px;
    background: rgba(var(--accent-rgb),0.2);
    border: 1px solid rgba(var(--accent-rgb),0.4);
    cursor: pointer;
    z-index: 22;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-height: 20px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(var(--accent-rgb),0.15);
}
.overflow-badge:hover {
    background: rgba(var(--accent-rgb),0.4);
    border-color: var(--accent);
    box-shadow: 0 0 14px rgba(var(--accent-rgb),0.4);
    transform: scale(1.1);
}
.overflow-badge-count {
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    writing-mode: horizontal-tb;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ---- Overflow popover ---- */
.overflow-popover {
    position: fixed;
    background: rgba(var(--accent-rgb),0.08);
    border: 1px solid rgba(var(--accent-rgb),0.2);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 15px rgba(var(--accent-rgb),0.1);
    z-index: 1001;
    min-width: 240px;
    max-width: 320px;
    max-height: 300px;
    overflow-y: auto;
    backdrop-filter: blur(20px);
}
.overflow-popover::-webkit-scrollbar { width: 4px; }
.overflow-popover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.overflow-popover-header {
    padding: 10px 14px;
    font-weight: 700;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    border-bottom: 1px solid rgba(var(--accent-rgb),0.15);
}
.overflow-popover-list {
    padding: 4px 0;
}
.overflow-popover-item {
    padding: 8px 14px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.overflow-popover-item:hover {
    background: rgba(var(--accent-rgb),0.1);
}
.overflow-item-title {
    font-weight: 600;
    font-size: 0.8rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.overflow-item-time {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
}
.overflow-item-club {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
}
/* ---- Sidebar ---- */
.sidebar { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; border-radius: 0.75rem; min-height: 0; }
.sidebar-header { padding: 1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.06); font-weight: 700; font-size: 1rem; letter-spacing: -0.3px; flex-shrink: 0; }
.sidebar-content { flex: 1; overflow-y: auto; padding: 0.5rem; display: flex; flex-direction: column; gap: 0.375rem; min-height: 0; }
.sidebar-content::-webkit-scrollbar { width: 6px; }
.sidebar-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.upcoming-item { position: relative; overflow: hidden; flex-shrink: 0; padding: 0.75rem; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 0.5rem; cursor: pointer; transition: all 0.2s; display: flex; gap: 0.6rem; align-items: flex-start; }
.upcoming-item:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); transform: translateX(3px); }
.upcoming-collab-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.upcoming-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.upcoming-details { flex: 1; min-width: 0; }
.upcoming-name-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.upcoming-collab-badge { flex-shrink: 0; opacity: 0.85; color: #fff; line-height: 1; display: flex; }
.upcoming-name { flex: 1; min-width: 0; font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-time { font-size: 0.75rem; color: rgba(255,255,255,0.6); margin-top: 2px; }
.upcoming-club { font-size: 0.7rem; color: rgba(255,255,255,0.45); margin-top: 1px; }

.empty-state { text-align: center; padding: 2rem 1rem; color: rgba(255,255,255,0.4); font-size: 0.85rem; }

/* ---- FAB ---- */
.fab { position: fixed; bottom: 1.5rem; right: 1.5rem; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-darker) 100%); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; line-height: 1; padding: 0 0 7px 0; box-shadow: 0 8px 32px rgba(var(--accent-rgb),0.4); transition: all 0.3s; z-index: 100; font-family: inherit; }
.fab:hover { transform: scale(1.1) translateY(-3px); box-shadow: 0 12px 40px rgba(var(--accent-rgb),0.5); }

/* ---- Footer ---- */
.v2-footer { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 2rem; border-top: 1px solid rgba(255,255,255,0.06); font-size: 0.75rem; color: rgba(255,255,255,0.5); flex-shrink: 0; }
.v2-footer-left { position: relative; display: flex; align-items: center; gap: 8px; }
.v2-footer-right { color: rgba(255,255,255,0.5); }
.v2-footer-center { position: absolute; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.45); white-space: nowrap; pointer-events: none; }
.v2-footer-sep { margin: 0 0.5rem; color: rgba(255,255,255,0.25); }
.v2-footer-center a { pointer-events: auto; color: rgba(255,255,255,0.55); text-decoration: none; transition: color 0.15s; }
.v2-footer-center a:hover { color: rgba(255,255,255,0.95); }
.footer-theme-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); font-size: 0.75rem; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; font-family: inherit; text-decoration: none; }
.footer-theme-btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.95); border-color: rgba(var(--accent-rgb), 0.4); }
.footer-theme-icon { width: 14px; height: 14px; color: var(--accent); }
.footer-discord-link .footer-theme-icon { display: inline-flex; width: auto; height: auto; }
.footer-theme-label { letter-spacing: 0.02em; }
.footer-theme-popover { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 90; padding: 12px; border-radius: 12px; background: rgba(15,18,26,0.96); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 12px 40px rgba(0,0,0,0.5); min-width: 260px; }

/* ---- Theme picker (shared: settings, footer popover, profile sheet) ---- */
.theme-picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.theme-swatch { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.1s; font-family: inherit; font-size: 0.85rem; text-align: left; }
.theme-swatch:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.16); }
.theme-swatch.is-active { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.12); color: #fff; }
.theme-swatch-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255,255,255,0.08), 0 0 8px rgba(0,0,0,0.4); }
.theme-swatch-label { font-weight: 500; letter-spacing: 0.01em; }
.settings-section-hint { font-size: 0.85rem; color: rgba(255,255,255,0.55); margin: -8px 0 16px; }
.profile-sheet-theme { padding: 8px 0 4px; }

/* Event Detail Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}
.modal-overlay:empty {
    display: none;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-content {
    max-width: 560px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 16px;
    position: relative;
    animation: slideUp 0.25s ease;
    background: rgba(var(--accent-rgb),0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(var(--accent-rgb),0.2);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 15px rgba(var(--accent-rgb),0.1);
}
.modal-content::-webkit-scrollbar { width: 8px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.modal-content::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 28px;
    font-weight: bold;
    line-height: 20px;
    padding: 0;
    z-index: 1;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #fff;
}
#event-detail-modal .modal-close,
#event-form-modal .modal-close {
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.9), 0 0 15px rgba(0, 0, 0, 0.7), 0 0 10px rgba(0, 0, 0, 0.6);
}
.modal-banner {
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}
.modal-banner img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.modal-body {
    padding: 24px;
}
.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}
.modal-links-actions { display: flex; gap: 10px; margin-left: auto; }
.modal-icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 10px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 5px; color: rgba(255,255,255,0.7); cursor: pointer; text-decoration: none; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.modal-icon-btn:hover { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.2); }
.modal-icon-btn svg { display: block; }
.modal-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}
.meta-icon {
    width: 24px;
    text-align: center;
    color: var(--accent);
}
.modal-description {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
}
.modal-description strong { font-weight: 700; }
.modal-description em { font-style: italic; }
.modal-description del { text-decoration: line-through; }
.modal-description u { text-decoration: underline; }
.modal-description code {
    background: rgba(255,255,255,0.1);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85em;
}
.modal-description pre {
    background: rgba(0,0,0,0.3);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}
.modal-description pre code {
    background: none;
    padding: 0;
}
.modal-description blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
    margin: 8px 0;
    opacity: 0.85;
}
.modal-description h4,
.modal-description h5,
.modal-description h6 {
    margin: 12px 0 4px;
    color: rgba(255,255,255,0.9);
}
.modal-description ul {
    margin: 4px 0;
    padding-left: 24px;
    list-style-type: disc;
}
.modal-description ol {
    margin: 4px 0;
    padding-left: 24px;
    list-style-type: decimal;
}
.modal-description a {
    color: var(--accent);
    text-decoration: underline;
}
.modal-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.modal-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    text-decoration: none;
    color: white;
    transition: filter 0.2s;
    border: 1px solid transparent;
    box-sizing: border-box;
}
.modal-link svg {
    flex-shrink: 0;
}
.modal-link.discord {
    background: var(--discord);
}
.modal-link.vrchat, .modal-link.vrchat-group {
    background: var(--vrchat);
    border-color: rgba(255,255,255,0.05);
}
.modal-link:hover {
    filter: brightness(1.3);
}
.modal-actions {
    display: flex;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.btn-danger {
    color: #f87171 !important;
    border-color: rgba(248,113,113,0.3) !important;
}
.btn-danger:hover {
    background: rgba(248,113,113,0.15) !important;
}

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 6px; font-weight: 500; }
.form-input { width: 100%; padding: 10px 14px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; color: #fff; font-size: 0.9rem; outline: none; transition: border-color 0.2s; box-sizing: border-box; color-scheme: dark; }
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: rgba(255,255,255,0.3); }
.form-error { color: #f87171; font-size: 0.85rem; margin-bottom: 12px; padding: 8px 12px; background: rgba(248,113,113,0.1); border-radius: 6px; }
.form-error:empty { display: none; }
.form-submit { width: 100%; padding: 12px; border: none; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.form-select { width: 100%; padding: 10px 14px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; color: #fff; font-size: 0.9rem; outline: none; transition: border-color 0.2s; box-sizing: border-box; color-scheme: dark; }
.form-select:focus { border-color: var(--accent); }
.form-select option { background: var(--bg-sticky); color: #fff; }
.form-select optgroup { background: var(--bg-sticky); color: rgba(255,255,255,0.5); font-style: normal; font-weight: 600; font-size: 0.85rem; padding: 4px 0; }
.form-select optgroup option { background: rgba(255,255,255,0.06); color: #fff; }
.form-select:disabled { opacity: 0.55; cursor: not-allowed; background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.6); }
.form-textarea { width: 100%; min-height: 80px; padding: 10px 14px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; color: #fff; font-size: 0.9rem; outline: none; transition: border-color 0.2s; box-sizing: border-box; resize: vertical; }
.form-textarea:focus { border-color: var(--accent); }
.form-textarea::placeholder { color: rgba(255,255,255,0.3); }

/* Event Form Modal */
.event-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.color-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.color-swatch { width: 28px; height: 28px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; transition: all 0.15s; }
.color-swatch:hover { border-color: #fff; transform: scale(1.15); }
.color-swatch.active { border-color: #fff; transform: scale(1.15); box-shadow: 0 0 12px rgba(255,255,255,0.4); }

/* ---- Clubs Page ---- */
.clubs-page {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}
.clubs-page::-webkit-scrollbar { width: 8px; }
.clubs-page::-webkit-scrollbar-track { background: transparent; }
.clubs-page::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* ---- Static content pages (About / Privacy / Terms) ---- */
.static-page { flex: 1; overflow-y: auto; padding: 32px 24px; }
.static-page::-webkit-scrollbar { width: 8px; }
.static-page::-webkit-scrollbar-track { background: transparent; }
.static-page::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.static-page-inner { max-width: 720px; margin: 0 auto; padding: 2rem 2.25rem; border-radius: 16px; color: rgba(255,255,255,0.8); line-height: 1.7; }
.static-page-inner h1 { font-size: 1.9rem; font-weight: 700; color: #fff; margin: 0 0 1rem; letter-spacing: -0.5px; }
.static-page-inner h2 { font-size: 1.15rem; font-weight: 600; color: rgba(255,255,255,0.95); margin: 1.75rem 0 0.5rem; }
.static-page-inner p { margin: 0 0 0.85rem; }
.static-page-inner ul { margin: 0 0 0.85rem; padding-left: 1.25rem; }
.static-page-inner li { margin: 0 0 0.5rem; }
.static-page-inner a { color: var(--accent); text-decoration: none; }
.static-page-inner a:hover { text-decoration: underline; }
.static-page-meta { font-size: 0.85rem; color: rgba(255,255,255,0.45); margin-top: -0.5rem; }
.static-page-nav { display: flex; gap: 1.25rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.08); }
.static-page-nav a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.9rem; transition: color 0.15s; }
.static-page-nav a:hover { color: #fff; }
.clubs-page::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

.clubs-header {
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 32px;
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.clubs-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
}

.clubs-subtitle {
    color: rgba(255,255,255,0.6);
    font-size: 1rem;
    margin: 0 0 16px 0;
}
.clubs-search {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.clubs-search .form-input {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
.clubs-search .form-input:focus {
    border-color: var(--accent);
}

.clubs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.club-card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.club-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--accent-rgb),0.3);
}

.club-card-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    flex-shrink: 0;
}

.club-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.club-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-rgb),0.15);
    font-size: 3rem;
    color: var(--accent);
    font-weight: 700;
    padding: 0 16px;
    text-align: center;
    overflow: hidden;
}

.club-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.club-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px 0;
}

.club-card-desc {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.club-card-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
}
.club-card-links .modal-link {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
}
.club-card-links .modal-link svg {
    width: 12px;
    height: 12px;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 48px;
    text-align: center;
    color: rgba(255,255,255,0.5);
}

/* ---- Settings Page ---- */
.settings-page { padding: 24px; width: min(700px, 100%); min-width: 33%; margin: 0 auto; overflow-y: auto; flex: 1; }
.settings-header { padding: 24px 32px; border-radius: 16px; margin-bottom: 24px; }
.settings-title { font-size: 1.8rem; font-weight: 700; margin: 0 0 4px; }
.settings-subtitle { font-size: 0.9rem; color: rgba(255,255,255,0.6); margin: 0; }
.settings-section { padding: 24px 32px; border-radius: 16px; margin-bottom: 16px; }
.settings-section-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 16px; }
.form-success { color: #4ade80; font-size: 0.85rem; margin-bottom: 12px; padding: 8px 12px; background: rgba(74,222,128,0.1); border-radius: 6px; }
.form-success:empty { display: none; }

/* ---- Club Detail Page ---- */
.club-detail-page { padding: 24px; overflow-y: auto; flex: 1; }
.club-detail-page::-webkit-scrollbar { width: 8px; }
.club-detail-page::-webkit-scrollbar-track { background: transparent; }
.club-detail-page::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.club-detail-page::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
.club-detail-page > * { max-width: 750px; margin-left: auto; margin-right: auto; }
.club-detail-header { padding: 24px 32px; border-radius: 16px; margin-bottom: 16px; }
.club-detail-top { display: flex; gap: 24px; align-items: flex-start; }
.club-detail-image { width: 120px; height: 120px; border-radius: 16px; overflow: hidden; flex-shrink: 0; }
.club-detail-image img { width: 100%; height: 100%; object-fit: cover; }
.club-detail-placeholder { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-darker) 100%); display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 700; }
.club-detail-info { flex: 1; }
.club-detail-name { font-size: 1.8rem; font-weight: 700; margin: 0 0 8px; }
.club-detail-desc { color: rgba(255,255,255,0.75); font-size: 0.9rem; margin-bottom: 12px; }
.club-detail-links { display: flex; gap: 12px; flex-wrap: wrap; }
.club-discord-linked { position: absolute; top: 12px; right: 48px; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: #5865F2; border-radius: 6px; color: #fff; cursor: default; opacity: 0.5; }
.club-discord-linked svg { display: block; }
.club-share-btn { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: rgba(255,255,255,0.7); cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.club-share-btn:hover { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.2); }
.club-share-btn svg { display: block; }
.club-detail-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.08); flex-wrap: wrap; }
.club-detail-section { padding: 24px 32px; border-radius: 16px; margin-bottom: 16px; }
.club-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.clubs-header .club-section-header { flex-direction: column; align-items: center; text-align: center; margin-bottom: 0; }
.club-section-title { font-size: 1.1rem; font-weight: 600; margin: 0; }

/* ---- Calendar Image Generator ---- */
.cal-image-help { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin: 0 0 18px; line-height: 1.5; }
.cal-image-grid { display: flex; flex-direction: column; gap: 20px; }
.cal-image-controls { display: flex; flex-direction: column; gap: 14px; }
.cal-image-bg-status { margin-top: 6px; font-size: 0.78rem; color: rgba(255,255,255,0.55); }
.cal-image-actions { display: flex; gap: 10px; margin-top: 4px; }
/* Animated toggle switch for the calendar-image option checkboxes. */
.cal-switch { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: rgba(255,255,255,0.8); cursor: pointer; user-select: none; }
.cal-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cal-switch-track { position: relative; flex: 0 0 auto; width: 38px; height: 22px; border-radius: 999px; background: rgba(255,255,255,0.18); transition: background 0.2s ease; }
.cal-switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.4); transition: transform 0.2s ease; }
.cal-switch input:checked + .cal-switch-track { background: var(--accent); }
.cal-switch input:checked + .cal-switch-track::after { transform: translateX(16px); }
.cal-switch input:focus-visible + .cal-switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-switch-text { line-height: 1.3; }
.cal-image-color { height: 38px; padding: 4px; cursor: pointer; }
.cal-image-range { width: 100%; cursor: pointer; }
/* Card-theme swatch picker: a labelled wide swatch is the "use club color"
   default; a conic gradient marks the custom-color swatch. */
.cal-swatch-default { position: relative; width: auto; min-width: 78px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
/* The wide pill keeps its border/glow when active but skips the scale-up the
   square swatches use, which would otherwise overlap the next swatch. */
.cal-swatch-default:hover, .cal-swatch-default.active { transform: none; }
.cal-swatch-default::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: rgba(0,0,0,0.30); }
.cal-swatch-default span { position: relative; z-index: 1; font-size: 0.7rem; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.cal-swatch-custom { background: conic-gradient(from 0deg, #f43f5e, #f97316, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #f43f5e); }
.cal-image-border-row { align-items: end; }
.cal-image-preview { position: relative; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.08); min-height: 180px; display: flex; align-items: center; justify-content: center; }
.cal-image-preview img { display: block; width: 100%; height: auto; cursor: zoom-in; }
/* Overlay (not a sibling) so the "Generating…" / empty state sits on top of any
   previously-generated image instead of pushing it aside in the flex row. */
.cal-image-preview-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.7); background: rgba(8,10,18,0.6); }
.cal-image-modal { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.82); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.cal-image-modal img { max-width: 80vw; max-height: 80vh; width: auto; height: auto; border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,0.6); }
.cal-image-modal-close { position: fixed; top: 18px; right: 24px; background: none; border: none; color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; opacity: 0.8; }
.cal-image-modal-close:hover { opacity: 1; }

/* ---- Members List ---- */
.members-table { display: flex; flex-direction: column; gap: 8px; }
.member-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: rgba(255,255,255,0.04); border-radius: 10px; }
.member-info { display: flex; flex-direction: column; gap: 2px; }
.member-name { font-weight: 600; font-size: 0.9rem; }
.member-username { font-size: 0.8rem; color: rgba(255,255,255,0.5); }
.member-role-area { display: flex; gap: 8px; align-items: center; }
.member-role-select { width: auto; padding: 4px 8px; font-size: 0.8rem; }
.role-badge { font-size: 0.75rem; padding: 3px 8px; border-radius: 6px; font-weight: 600; text-transform: capitalize; }
.role-owner { background: rgba(234,179,8,0.2); color: #eab308; }
.role-admin { background: rgba(139,92,246,0.2); color: #a78bfa; }
.role-editor { background: rgba(34,197,94,0.2); color: #4ade80; }
.role-member { background: rgba(148,163,184,0.2); color: #94a3b8; }

/* ---- Club Upcoming Events ---- */
.club-upcoming-grid { display: grid; grid-template-columns: 1fr; gap: 0.375rem; }

/* ---- Admin Page ---- */
.admin-page { padding: 24px; width: min(900px, 100%); min-width: 33%; margin: 0 auto; overflow-y: auto; flex: 1; }
.admin-page::-webkit-scrollbar { width: 8px; }
.admin-page::-webkit-scrollbar-track { background: transparent; }
.admin-page::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.admin-page::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
.admin-header { padding: 24px 32px; border-radius: 16px; margin-bottom: 24px; text-align: center; }
.admin-title { font-size: 1.8rem; font-weight: 700; margin: 0 0 4px; }
.admin-subtitle { font-size: 0.9rem; color: rgba(255,255,255,0.6); margin: 0; }
.admin-section { padding: 24px 32px; border-radius: 16px; }
.admin-section:not(:last-child) { margin-bottom: 24px; }
.tz-fix-table { display: grid; grid-template-columns: 1.2fr 1.2fr 1.3fr 1.3fr 1.3fr auto; gap: 8px 16px; }
.tz-fix-row { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: start; padding: 12px 16px; background: rgba(255,255,255,0.04); border-radius: 10px; font-size: 0.85rem; }
.tz-fix-row.tz-fix-header { background: transparent; padding: 6px 16px; font-weight: 600; font-size: 0.85rem; color: rgba(255,255,255,0.7); }
.tz-fix-row > div { min-width: 0; }
.tz-fix-row small { font-size: 0.78rem; color: rgba(255,255,255,0.65); display: block; }
.tz-fix-row .form-select-sm { padding: 0.35rem 0.6rem; font-size: 0.8rem; width: 100%; }
.tz-fix-actions-cell { display: flex; flex-direction: column; gap: 4px; align-items: stretch; min-width: 130px; }
.admin-users-table { display: grid; grid-template-columns: 1fr 80px 120px auto; gap: 8px 24px; }
.admin-user-row { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: center; padding: 12px 20px; background: rgba(255,255,255,0.04); border-radius: 10px; }
.admin-user-info { display: flex; flex-direction: column; gap: 2px; }
.admin-user-name { font-weight: 600; font-size: 0.9rem; }
.admin-user-username { font-size: 0.8rem; color: rgba(255,255,255,0.5); }
.admin-user-role { display: flex; align-items: center; justify-content: center; min-width: 60px; }
.admin-user-date { font-size: 0.8rem; color: rgba(255,255,255,0.4); white-space: nowrap; }
.admin-user-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---- Transfer ---- */
.transfer-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: rgba(255,255,255,0.04); border-radius: 10px; margin-bottom: 8px; }
.transfer-info { display: flex; flex-direction: column; gap: 2px; }
.transfer-actions { display: flex; gap: 6px; }

/* ---- Discord Link Code ---- */
.link-code-display { display: flex; gap: 12px; align-items: center; padding: 16px; background: rgba(255,255,255,0.04); border-radius: 10px; }
.link-code { font-size: 1rem; font-family: monospace; word-break: break-all; flex: 1; }
.link-step { padding: 16px 0; }
.link-step + .link-step { border-top: 1px solid rgba(255,255,255,0.08); }
.link-step-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.link-step-number { width: 24px; height: 24px; border-radius: 50%; background: rgba(var(--accent-rgb), 0.2); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; }
.link-step-title { font-weight: 600; font-size: 0.95rem; }
.link-step-desc { opacity: 0.7; font-size: 0.85rem; margin: 0 0 12px 0; }
.link-step-expiry { margin-top: 10px; font-size: 0.8rem; opacity: 0.5; }
.link-step-instructions { margin-top: 14px; padding: 12px; background: rgba(255,255,255,0.04); border-radius: 8px; font-size: 0.85rem; }
.link-step-instructions ol { margin: 8px 0 10px 20px; padding: 0; line-height: 1.7; }
.link-step-instructions code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px; font-size: 0.82rem; }
.link-step-hint { margin: 8px 0 0; font-size: 0.82rem; opacity: 0.6; }
.btn-discord { background: #5865F2; color: #fff; }
.btn-discord:hover { background: #4752C4; box-shadow: 0 0 16px rgba(88,101,242,0.4); transform: translateY(-1px); }

/* ---- Extra button sizes ---- */
.btn-xs { padding: 0.25rem 0.65rem; font-size: 0.75rem; }
.form-select-sm { padding: 4px 8px; font-size: 0.8rem; }

/* ---- Responsive ---- */
@media (max-width: 1024px) { .sidebar { display: none; } }
@media (max-width: 768px) {
    .nav-links { gap: 1rem; font-size: 0.8rem; }
    .auth-buttons { gap: 0.5rem; }
    /* .btn shrink rule removed — the mobile block below sets a 44px tap target */
    .main-content { padding: 0.75rem; gap: 0.5rem; }
    .controls-bar { flex-direction: column; gap: 0.5rem; }
    .navbar { padding: 0.75rem 1rem; }
    .clubs-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
    .clubs-page { padding: 12px; }
    .club-detail-top { flex-direction: column; }
    .club-detail-image { width: 80px; height: 80px; }
    .settings-page, .club-detail-page, .admin-page { padding: 12px; }
}

/* ---- Discord Config Modal ---- */
.discord-config-server { display: flex; align-items: center; gap: 10px; padding: 12px; background: rgba(88,101,242,0.1); border-radius: 10px; margin-bottom: 16px; }
.discord-config-server-name { font-weight: 600; font-size: 0.95rem; }
.discord-config-server-id { font-size: 0.75rem; color: rgba(255,255,255,0.4); }
.discord-settings-list { display: flex; flex-direction: column; gap: 10px; }
.discord-setting-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: rgba(255,255,255,0.04); border-radius: 10px; gap: 16px; }
.discord-setting-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.discord-setting-label { font-weight: 600; font-size: 0.9rem; }
.discord-setting-desc { font-size: 0.8rem; color: rgba(255,255,255,0.5); }
.discord-setting-row input[type="checkbox"] { flex-shrink: 0; }
.discord-setting-row input[type="checkbox"]:checked { background-color: #5865F2; }
.discord-config-danger { margin-top: 20px; padding-top: 16px; padding-bottom: 16px; border-top: 1px solid rgba(255,255,255,0.08); }

/* Green toggle switch for admin checkbox */
#admin-is-admin:checked {
    background-color: oklch(.696 .17 162.48);
}

/* ---- Connection banner ---- */
.connection-banner {
    position: fixed; top: 0; left: 0; right: 0; z-index: 500;
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    padding: 0.55rem 1.5rem;
    background: rgba(220, 50, 50, 0.85);
    backdrop-filter: blur(12px);
    color: #fff; font-size: 0.85rem; font-weight: 600;
    transform: translateY(-100%); opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.connection-banner.visible { transform: translateY(0); opacity: 1; }
.connection-banner-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.3rem; height: 1.3rem; border-radius: 50%;
    background: rgba(255,255,255,0.2); font-size: 0.75rem; font-weight: 800;
    flex-shrink: 0;
}
.connection-banner-btn {
    padding: 0.25rem 0.75rem; border-radius: 0.4rem; border: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.15); color: #fff; font-size: 0.8rem; font-weight: 600;
    cursor: pointer; transition: background 0.2s;
}
.connection-banner-btn:hover { background: rgba(255,255,255,0.3); }

/* ============================================
   MOBILE-FIRST ADDITIONS — Step 2 of mobile rebuild
   See MOBILE_REBUILD_PROGRESS.md. These rules are additive — desktop ≥1200px
   still uses everything above. Mobile <1200px gets the tab bar, bottom-sheet
   profile menu, and hidden desktop chrome.
   ============================================ */

/* ---- Visibility utilities (desktop default, mobile override) ---- */
/* !important keeps these from being clobbered by component-specific display rules
   that come later in the file (e.g. `.nav-profile-btn { display: inline-flex }`). */
.nav-mobile-only { display: none !important; }
.nav-desktop-only { display: inline-flex; }

/* ---- Navbar groupings (replaces old .auth-buttons for new .nav-actions) ---- */
.nav-brand-group { display: flex; align-items: center; }
.nav-actions { display: flex; gap: 0.75rem; align-items: center; }

/* ---- Mobile profile button (in navbar, mobile only) ---- */
.nav-profile-btn {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(var(--accent-rgb), 0.18);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s, box-shadow 0.25s;
}
.nav-profile-btn:hover { background: rgba(var(--accent-rgb), 0.3); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.35); }
.nav-profile-avatar { font-size: 0.95rem; font-weight: 700; text-transform: uppercase; line-height: 1; }
.nav-profile-icon { width: 20px; height: 20px; }

/* ---- Mobile tab bar — hidden by default, shown <1200px ---- */
.mobile-tabbar { display: none; }

/* ---- Profile sheet — hidden by default; Datastar toggles via data-show ---- */
.profile-sheet-overlay {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: flex-end; justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.18s ease;
}
.profile-sheet {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(180deg, rgba(30, 35, 50, 0.98), rgba(20, 24, 36, 0.98));
    border-top: 1px solid rgba(255,255,255,0.08);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    position: relative;
    max-height: 80dvh;
    overflow-y: auto;
    animation: profileSheetSlide 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes profileSheetSlide {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
.profile-sheet-close {
    position: absolute; top: 8px; right: 10px;
    width: 40px; height: 40px;
    background: transparent; border: none;
    color: rgba(255,255,255,0.6);
    font-size: 1.7rem; line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}
.profile-sheet-close:hover { color: #fff; background: rgba(255,255,255,0.06); }
.profile-sheet-header { margin: 4px 0 16px; padding-right: 40px; }
.profile-sheet-name { font-size: 1.15rem; font-weight: 700; color: #fff; }
.profile-sheet-actions { display: flex; flex-direction: column; gap: 8px; padding-right: 40px; }
.profile-sheet-link {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 0.6rem;
    background: transparent;
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    color: #fff;
    font-size: 0.95rem; font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.profile-sheet-link:hover,
.profile-sheet-link:active {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.25);
}
.profile-sheet-link-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-darker) 100%);
    border-color: transparent;
}
.profile-sheet-link-primary:hover,
.profile-sheet-link-primary:active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-darker) 100%);
    border-color: transparent;
    box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.4);
}
.profile-sheet-link-danger {
    color: #ff7676;
    border-color: rgba(255, 118, 118, 0.4);
}
.profile-sheet-link-danger:hover,
.profile-sheet-link-danger:active {
    background: rgba(255, 118, 118, 0.08);
    border-color: #ff7676;
    box-shadow: none;
}

/* ---- Upcoming standalone page (/v2/upcoming) ---- */
.upcoming-page {
    flex: 1;
    min-height: 0;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    overflow: hidden;
}
.upcoming-page-inner {
    width: 100%;
    max-width: 640px;
    max-height: 100%;
    min-height: 0;
    border-radius: 0.9rem;
    padding: 1.25rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    overflow: hidden;
}
.upcoming-page-header { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.upcoming-page-title { margin: 0; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.3px; }
.upcoming-page-sub { margin: 0; font-size: 0.8rem; color: rgba(255,255,255,0.55); }
.upcoming-page-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Custom scrollbar to match the rest of the V2 UI */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.upcoming-page-list::-webkit-scrollbar { width: 6px; }
.upcoming-page-list::-webkit-scrollbar-track { background: transparent; }
.upcoming-page-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.upcoming-page-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* ---- Calendar desktop/mobile split (step 4a) ---- */
/* Desktop wrapper takes over the role .main-content played before — flex row
   containing the calendar-section and the sidebar. */
.calendar-desktop {
    display: flex;
    flex: 1;
    gap: 1rem;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}
.calendar-mobile { display: none; }

/* Mobile-only calendar chrome — defined here (not inside the media query) so the
   selectors stay in source order with the rest of the calendar block. They only
   render on screen <1200px because their parent .calendar-mobile is hidden. */
.day-strip {
    display: flex;
    gap: 4px;
    padding: 0.4rem;
    flex-shrink: 0;
    align-items: stretch;
    /* Match desktop's .day-headers chrome */
    background: var(--bg-sticky);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 0.75rem;
}
.day-strip-tz {
    width: 46px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.4);
}
.day-strip-day {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    position: relative;
}
.day-strip-day:hover { color: #fff; background: rgba(255,255,255,0.05); }
.day-strip-day.today { color: var(--accent); }
/* Today's day number gets the same accent circle treatment as desktop */
.day-strip-day.today .day-strip-num {
    background: var(--accent);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* Selected (active) day: same visual weight as hover so it feels familiar */
.day-strip-day.active {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}
.day-strip-day.today.active { color: var(--accent); }
.day-strip-name { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.75; }
.day-strip-num { font-size: 1.05rem; font-weight: 700; line-height: 1; }
.day-strip-bar {
    position: absolute;
    bottom: 2px;
    left: 0.5rem; right: 0.5rem;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.mobile-cal-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.6rem;
    flex-shrink: 0;
}
.mobile-cal-controls .control-btn { padding: 0.45rem 0.8rem; }
.mobile-cal-week {
    flex: 1;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Carousel viewport — clips horizontally; vertical scroll lives inside each pane */
.day-pane-scroll {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border-radius: 0.6rem;
    /* Hint to the browser that the inner transform will be animated */
    touch-action: pan-y;
}
/* The strip — all 7 panes laid out side-by-side; --active-day drives the
   translate. Inline style on the element sets the initial value; data-effect
   keeps it synced afterwards. */
.day-pane-container {
    display: flex;
    width: 100%;
    height: 100%;
    /* --active-day: integer index (0..6) of the currently visible pane.
       --drag-offset: pixel offset applied during an in-progress touch drag. */
    transform: translateX(calc(var(--active-day, 0) * -100% + var(--drag-offset, 0px)));
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
}
/* While the user is dragging, kill the CSS transition so the strip follows
   the finger 1:1. Released → class is removed → transition re-engages and the
   strip animates to its snapped position. */
.day-pane-container.dragging { transition: none; }
/* Each pane is a full-viewport-width column; scrolls vertically on its own */
.day-pane {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}
.day-pane::-webkit-scrollbar { width: 6px; }
.day-pane::-webkit-scrollbar-track { background: transparent; }
.day-pane::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.day-pane-grid {
    display: grid;
    grid-template-columns: 54px 1fr;
    grid-template-rows: repeat(24, 60px);
    position: relative;
}
.day-pane-grid .current-time-line { left: 54px; right: 0; width: auto; }

/* ---- Mobile viewport (<1200px) ---- */
@media (max-width: 1199px) {
    .nav-mobile-only { display: inline-flex !important; }
    .nav-desktop-only { display: none !important; }

    /* Calendar / Clubs nav links live in the bottom tab bar on mobile */
    .nav-links { display: none; }

    /* Reveal tab bar */
    .mobile-tabbar {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 100;
        background: rgba(10, 12, 20, 0.88);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        border-top: 1px solid rgba(255,255,255,0.08);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .mobile-tab {
        flex: 1;
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 3px;
        min-height: 56px;
        padding: 8px 4px;
        text-decoration: none;
        color: rgba(255,255,255,0.55);
        font-size: 0.7rem;
        transition: color 0.2s;
        position: relative;
    }
    .mobile-tab:hover { color: #fff; }
    .mobile-tab.active { color: var(--accent); }
    .mobile-tab.active::after {
        content: '';
        position: absolute;
        bottom: 2px;
        left: 1rem;
        right: 1rem;
        height: 2px;
        background: var(--accent);
        border-radius: 2px;
    }
    .mobile-tab-icon { width: 22px; height: 22px; }
    .mobile-tab-label { font-weight: 600; letter-spacing: 0.02em; }

    /* Hide footer on mobile — the tab bar replaces it visually */
    .v2-footer { display: none !important; }

    /* Push content above the tab bar so nothing hides behind it */
    .v2-wrapper {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
    }

    /* Forms: stack .form-row pairs on phones */
    .form-row { flex-direction: column; gap: 12px; }
    .form-row .form-group { flex: 1; width: 100%; }

    /* Mobile modals: stay centered (mirror desktop). Reserve room below for
       the fixed tab bar so the modal can never sit on top of it or get
       visually clipped on short viewports. z-index bumped above the tab bar
       (100) for safety. */
    .modal-overlay {
        z-index: 150;
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }
    .modal-content {
        max-height: calc(85dvh - 56px - env(safe-area-inset-bottom, 0px));
    }

    /* Profile sheet covers the tab bar (its overlay is z-index 200, tab bar
       is z-index 100). Let the sheet extend to the viewport bottom so the
       tab bar doesn't peek through underneath. */

    /* Upcoming standalone page — full bleed on mobile */
    .upcoming-page { padding: 0.75rem 0.75rem 1rem; }
    .upcoming-page-inner { padding: 1rem 1rem 1.25rem; border-radius: 0.75rem; }
    .upcoming-page-title { font-size: 1.2rem; }

    /* Upcoming list: touch feedback + a little breathing room */
    .upcoming-page-list { gap: 0.6rem; }
    .upcoming-item { padding: 0.85rem 0.9rem; }
    /* Press-down feedback on tap (hover doesn't fire on touch) */
    .upcoming-item:active {
        transform: scale(0.985);
        background: rgba(255,255,255,0.08);
        border-color: rgba(255,255,255,0.18);
    }
    /* The translateX hover is a desktop affordance; on touch it sticks after a tap */
    .upcoming-item:hover { transform: none; }

    /* Calendar split: hide desktop, show mobile (single-day view) */
    .calendar-desktop { display: none !important; }
    .calendar-mobile {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 0;
        min-height: 0;
        gap: 0.5rem;
    }

    /* Trim .main-content padding so the calendar gets more vertical room */
    .main-content { padding: 0.75rem; gap: 0.5rem; }

    /* ---- Admin: tables become stacked cards (step 6) ---- */
    /* Tighter section padding so the cards aren't crammed */
    .admin-section { padding: 16px; }
    .admin-header { padding: 18px 20px; }
    .club-section-header { flex-direction: column; align-items: stretch; gap: 12px; }

    /* Users list */
    .admin-users-table {
        display: flex;
        flex-direction: column;
        gap: 10px;
        grid-template-columns: none;
    }
    .admin-user-row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "info role"
            "date date"
            "actions actions";
        grid-column: auto;
        gap: 10px 12px;
        padding: 14px 16px;
    }
    .admin-user-info    { grid-area: info; }
    .admin-user-role    { grid-area: role; justify-content: flex-end; }
    .admin-user-date    { grid-area: date; }
    .admin-user-actions { grid-area: actions; justify-content: stretch; flex-wrap: wrap; }
    .admin-user-actions .btn { flex: 1; min-width: 0; }

    /* TZ-fix admin: stack each row as a card, hide the header row (labels don't
       map cleanly to a card layout — fields are still scannable in order) */
    .tz-fix-table {
        display: flex;
        flex-direction: column;
        gap: 12px;
        grid-template-columns: none;
    }
    .tz-fix-row {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        grid-column: auto;
        gap: 8px;
        padding: 14px 16px;
    }
    .tz-fix-row.tz-fix-header { display: none; }
    .tz-fix-actions-cell {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
        min-width: 0;
        gap: 8px;
    }
    .tz-fix-actions-cell .btn { flex: 1; min-width: 120px; }

    /* ---- Touch-target audit (step 7) ---- */
    /* Bump all button sizes so they hit the 44px guideline on phones */
    .btn    { min-height: 44px; padding: 0.7rem 1.25rem; }
    .btn-sm { min-height: 40px; padding: 0.55rem 1rem; }
    .btn-xs { min-height: 40px; padding: 0.55rem 0.9rem; font-size: 0.8rem; }
    .control-btn { min-height: 40px; }
    /* Form controls also tappable */
    .form-input, .form-select { min-height: 44px; }

    /* FAB sits above the tab bar + iOS safe-area so it isn't covered */
    .fab {
        bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 1rem);
        right: 1rem;
    }

    /* Navbar respects the top safe-area (iPhone notch / Dynamic Island) */
    .navbar { padding-top: calc(0.75rem + env(safe-area-inset-top, 0px)); }

    /* Left/right safe-area for landscape mode on notched phones */
    .v2-wrapper {
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
    }
}

/* ---- Broken external image handling ---- */
/* Collapse mode: wrapper disappears entirely when the inner image fails (e.g. event banner). */
[data-img-fallback="collapse"].img-broken { display: none; }

/* Placeholder mode: wrapper keeps its size and swaps the image for a hidden placeholder span. */
.club-detail-image > .club-image-placeholder { display: none; }
.club-detail-image[data-img-fallback="placeholder"].img-broken {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-darker) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
}
.club-detail-image[data-img-fallback="placeholder"].img-broken > img { display: none; }
.club-detail-image[data-img-fallback="placeholder"].img-broken > .club-image-placeholder { display: block; }

/* Club card (browse-all-clubs page) placeholder fallback: swap to first-letter placeholder. */
.club-card-image > .club-card-placeholder-fallback { display: none; }
.club-card-image[data-img-fallback="placeholder"].img-broken {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-rgb), 0.15);
    font-size: 3rem;
    color: var(--accent);
    font-weight: 700;
    padding: 0 16px;
    text-align: center;
}
.club-card-image[data-img-fallback="placeholder"].img-broken > img { display: none; }
.club-card-image[data-img-fallback="placeholder"].img-broken > .club-card-placeholder-fallback { display: block; }

/* When the event-detail-modal warning is anchored above .modal-content, stack
   the overlay vertically so the warning sits above the card rather than beside it. */
#event-detail-modal.modal-overlay { flex-direction: column; }
#event-detail-modal.modal-overlay > .img-broken-warning {
    width: 90%;
    max-width: 560px;
    box-sizing: border-box;
}

/* Inline editor-only warning inserted after a broken image's container. */
.img-broken-warning {
    margin: 0.5rem auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #f5b942;
    background: rgba(245, 185, 66, 0.08);
    border: 1px solid rgba(245, 185, 66, 0.35);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.img-broken-fix-btn {
    background: rgba(245, 185, 66, 0.15);
    color: #f5b942;
    border: 1px solid rgba(245, 185, 66, 0.5);
    border-radius: 6px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: auto;
}
.img-broken-fix-btn:hover { background: rgba(245, 185, 66, 0.25); }

/* Sticky bottom-center toast for editors. One per unique target per page load. */
.img-broken-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.94);
    color: #fff;
    padding: 10px 16px 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(245, 185, 66, 0.45);
    font-size: 14px;
    z-index: 99999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100vw - 32px);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.img-broken-toast.visible { opacity: 1; }
.img-broken-toast + .img-broken-toast { bottom: 80px; }
.img-broken-toast + .img-broken-toast + .img-broken-toast { bottom: 136px; }
.img-broken-toast-msg { cursor: pointer; }
.img-broken-toast-msg:hover { text-decoration: underline; }
.img-broken-toast-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.img-broken-toast-close:hover { color: #fff; }
