/* =============================================
   Skeetsurfer Board Shop — Global Styles
   ============================================= */

:root {
    --ocean:      #0077b6;
    --ocean-dark: #023e8a;
    --ocean-light:#90e0ef;
    --sand:       #f4e4bc;
    --sand-dark:  #d9c087;
    --coral:      #e07a5f;
    --white:      #ffffff;
    --gray-50:    #f8fafc;
    --gray-100:   #f1f5f9;
    --gray-200:   #e2e8f0;
    --gray-400:   #94a3b8;
    --gray-600:   #475569;
    --gray-800:   #1e293b;
    --success:    #22c55e;
    --danger:     #ef4444;
    --info:       #3b82f6;
    --radius:     12px;
    --shadow-sm:  0 1px 3px rgba(0,0,0,.1);
    --shadow-md:  0 4px 16px rgba(0,0,0,.12);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.16);
    --transition: .2s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--ocean); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Navbar ---- */
.navbar {
    background: var(--ocean-dark);
    padding: .9rem 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
}

.wave-icon { font-size: 1.6rem; }

.brand-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -.5px;
}

.brand-sub {
    font-size: .85rem;
    color: var(--ocean-light);
    font-weight: 400;
    margin-left: .2rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-left: auto;   /* push to right on desktop */
}

/* ---- nav-end: bell + hamburger (always visible in navbar top bar) ---- */
.nav-end         { display: flex; align-items: center; gap: .35rem; flex-shrink: 0; margin-left: .5rem; }
.nav-hamburger   { display: none; /* hidden on desktop */ }

.nav-user {
    color: var(--ocean-light);
    font-size: .9rem;
    margin-right: .25rem;
}

.nav-link {
    color: var(--white);
    font-size: .9rem;
    font-weight: 500;
    padding: .4rem .9rem;
    border-radius: 999px;
    transition: background var(--transition);
    text-decoration: none;
}

.nav-link:hover { background: rgba(255,255,255,.12); text-decoration: none; }

.nav-link-outline {
    border: 1.5px solid rgba(255,255,255,.5);
}

.nav-link-fill {
    background: var(--coral);
    color: var(--white);
}

.nav-link-fill:hover { background: #c9614a; }

/* ---- Notification bell ---- */
/* About dropdown */
.nav-about-wrap     { position: relative; display: inline-flex; align-items: center; }
.nav-about-btn      { background: none; cursor: pointer; }
.nav-about-btn:hover { border-color: var(--white); }
.nav-about-dropdown { position: absolute; left: 50%; transform: translateX(-50%);
                       top: calc(100% + 10px); width: 220px;
                       background: var(--ocean-dark); border-radius: 10px;
                       box-shadow: 0 8px 28px rgba(0,0,0,.35);
                       border: 1px solid rgba(255,255,255,.12);
                       z-index: 600; padding: .65rem 0; }
.nav-about-dropdown::before {
    content: '';
    position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
    border-left: 6px solid transparent; border-right: 6px solid transparent;
    border-bottom: 6px solid var(--ocean-dark);
}
.nav-about-row      { display: flex; justify-content: space-between; align-items: baseline;
                       gap: .5rem; padding: .35rem 1rem; }
.nav-about-label    { font-size: .73rem; font-weight: 600; text-transform: uppercase;
                       letter-spacing: .05em; color: rgba(255,255,255,.75); white-space: nowrap; }
.nav-about-value    { font-size: .82rem; color: var(--white); font-weight: 500;
                       text-align: right; }
.nav-about-mono     { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
                       font-size: .78rem; color: var(--ocean-light); }
.nav-about-link     { text-decoration: underline; text-underline-offset: 2px;
                       text-decoration-color: rgba(147,210,255,.4); cursor: pointer; }
.nav-about-link:hover { text-decoration-color: var(--ocean-light); }

.notif-bell         { position: relative; display: inline-flex; align-items: center; }
.notif-bell-btn     { background: none; border: none; cursor: pointer; font-size: 1.05rem;
                       position: relative; padding: .25rem .35rem; line-height: 1;
                       color: var(--white); border-radius: 6px; transition: background var(--transition); }
.notif-bell-btn:hover { background: rgba(255,255,255,.12); }
.notif-badge        { position: absolute; top: -3px; right: -5px;
                       background: #e03; color: #fff; border-radius: 999px;
                       font-size: .6rem; font-weight: 700; min-width: 16px; height: 16px;
                       display: flex; align-items: center; justify-content: center;
                       padding: 0 3px; pointer-events: none; line-height: 1; }
.notif-dropdown     { position: absolute; right: 0; top: calc(100% + 8px); width: 300px;
                       background: #fff; border-radius: 12px;
                       box-shadow: 0 8px 32px rgba(0,0,0,.18); border: 1px solid var(--gray-200);
                       z-index: 600; }
.notif-dropdown-header { display: flex; align-items: center; justify-content: space-between;
                           padding: .7rem 1rem .5rem; border-bottom: 1px solid var(--gray-200);
                           font-weight: 600; font-size: .84rem; color: var(--gray-800); }
.notif-mark-read    { background: none; border: none; color: var(--ocean);
                       font-size: .76rem; cursor: pointer; padding: 0; }
.notif-mark-read:hover { text-decoration: underline; }
.notif-list         { max-height: 300px; overflow-y: auto; }
.notif-item         { padding: .6rem 1rem; border-bottom: 1px solid var(--gray-100);
                       cursor: pointer; transition: background .15s; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover   { background: var(--gray-50); }
.notif-item.unread  { background: rgba(0,119,182,.05); }
.notif-msg          { font-size: .82rem; color: var(--gray-700); line-height: 1.4; }
.notif-item.unread .notif-msg { font-weight: 600; color: var(--gray-800); }
.notif-time         { font-size: .71rem; color: var(--gray-400); margin-top: .15rem; }
.notif-empty        { text-align: center; padding: 1.4rem 1rem; color: var(--gray-400);
                       font-size: .84rem; margin: 0; }

/* ---- Flash Messages ---- */
.flash-container {
    max-width: 700px;
    margin: 1.25rem auto 0;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 500;
}

.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

.flash-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    line-height: 1;
    opacity: .6;
    transition: opacity var(--transition);
}
.flash-close:hover { opacity: 1; }

/* ---- Hero ---- */
.hero {
    background: linear-gradient(135deg, var(--ocean-dark) 0%, var(--ocean) 60%, #48cae4 100%);
    padding: 6rem 2rem 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--gray-50);
    clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-content {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.accent { color: var(--sand); }

.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255,255,255,.85);
    margin-bottom: 2.25rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: .65rem 1.5rem;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: transparent;
    color: var(--gray-600);
    border-color: var(--gray-400);
}
.btn-primary:hover { background: var(--gray-100); color: var(--gray-800); border-color: var(--gray-600); text-decoration: none; }

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,.7);
}
.btn-outline:hover { background: rgba(255,255,255,.12); text-decoration: none; color: var(--white); }

.btn-lg { padding: .85rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: .4rem 1rem; font-size: .85rem; }

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* ---- Features ---- */
.features {
    padding: 4rem 2rem 5rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: .5rem; color: var(--gray-800); }
.feature-card p  { font-size: .9rem; color: var(--gray-600); line-height: 1.5; }

/* ---- Auth Pages ---- */
.auth-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background: linear-gradient(180deg, #e0f4ff 0%, var(--gray-50) 100%);
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--gray-200);
}

.auth-card-wide { max-width: 600px; }

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
.auth-header h2 { font-size: 1.6rem; font-weight: 800; color: var(--gray-800); margin-bottom: .3rem; }
.auth-header p  { color: var(--gray-600); font-size: .95rem; }

/* ---- Forms ---- */
.auth-form { display: flex; flex-direction: column; gap: 1.1rem; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group { display: flex; flex-direction: column; gap: .35rem; }

.form-group label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-600);
    letter-spacing: .3px;
}

.form-input {
    padding: .65rem .9rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: .95rem;
    color: var(--gray-800);
    background: var(--gray-50);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--ocean);
    box-shadow: 0 0 0 3px rgba(0,119,182,.15);
    background: var(--white);
}

.form-hint { font-size: .78rem; color: var(--gray-400); }

.form-check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    color: var(--gray-600);
}

.form-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--ocean); }

.forgot-link { font-size: .85rem; color: var(--ocean); }
.forgot-link:hover { text-decoration: underline; }

/* Large centred OTP input */
.code-input {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 8px;
    padding: .75rem 1rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: .9rem;
    color: var(--gray-600);
}

/* Size/spacing tweaks for buttons inside auth forms */
.auth-form .btn-primary {
    margin-top: .25rem;
    font-size: 1rem;
    padding: .75rem;
}

/* ---- Dashboard ---- */
.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    width: 100%;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, var(--ocean-dark), var(--ocean));
    border-radius: var(--radius);
    padding: 2rem;
    color: var(--white);
}

.dashboard-welcome h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: .3rem; }
.dashboard-welcome p  { opacity: .85; font-size: .95rem; }

.dashboard-badge {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: rgba(255,255,255,.12);
    border-radius: var(--radius);
    padding: .9rem 1.25rem;
}

.badge-icon    { font-size: 2rem; }
.badge-title   { font-weight: 700; font-size: .95rem; }
.badge-sub     { font-size: .8rem; opacity: .75; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.dash-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.dash-card-icon { font-size: 2rem; margin-bottom: .75rem; }
.dash-card h3   { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; color: var(--gray-800); }

.info-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.info-list li { display: flex; justify-content: space-between; font-size: .9rem; gap: 1rem; }
.info-label { color: var(--gray-400); font-size: .85rem; }
.info-value { font-weight: 500; color: var(--gray-800); word-break: break-all; text-align: right; }

.empty-state { font-size: .9rem; color: var(--gray-400); margin-bottom: 1rem; line-height: 1.5; }

/* 2FA status badge */
.twofa-status   { font-size: .9rem; font-weight: 600; margin-bottom: 1rem; }
.twofa-on       { color: var(--success); }
.twofa-off      { color: var(--gray-400); margin-bottom: .5rem; }

/* btn-dark-outline is an alias for btn-primary — same style everywhere */
.btn-dark-outline {
    background: transparent;
    color: var(--gray-600);
    border-color: var(--gray-400);
}
.btn-dark-outline:hover {
    background: var(--gray-100);
    color: var(--gray-800);
    border-color: var(--gray-600);
    text-decoration: none;
}

.surf-report { text-align: center; margin-top: .5rem; }
.surf-stat   { display: flex; align-items: baseline; justify-content: center; gap: .25rem; }
.surf-num    { font-size: 3rem; font-weight: 900; color: var(--ocean); line-height: 1; }
.surf-unit   { font-size: 1.2rem; color: var(--ocean); font-weight: 600; }
.surf-detail { font-size: .85rem; color: var(--gray-600); margin-top: .5rem; }

/* ---- Admin nav link ---- */
.nav-link-admin {
    background: rgba(244,228,188,.15);
    color: var(--sand) !important;
    border: 1.5px solid rgba(244,228,188,.4);
}
.nav-link-admin:hover { background: rgba(244,228,188,.25); }

/* ---- Admin page ---- */
.admin-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    width: 100%;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--ocean-dark), var(--ocean));
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    color: var(--white);
}

.admin-header h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: .25rem; }
.admin-header p  { opacity: .8; font-size: .9rem; }

.admin-badge {
    background: rgba(244,228,188,.2);
    color: var(--sand);
    border: 1.5px solid rgba(244,228,188,.4);
    border-radius: 999px;
    padding: .35rem .9rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.admin-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.admin-form { display: flex; flex-direction: column; gap: 1rem; }

.user-count {
    background: var(--ocean);
    color: var(--white);
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    padding: .15rem .55rem;
}

/* ---- Users table ---- */
.table-wrap { overflow-x: auto; }

.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.user-table th {
    text-align: left;
    padding: .6rem .75rem;
    font-size: .75rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--gray-200);
}

.user-table td {
    padding: .75rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
    vertical-align: middle;
}

.user-table tr:last-child td { border-bottom: none; }
.user-table tr:hover td { background: var(--gray-50); }
.row-self td { background: #f0f9ff; }

.username-cell { color: var(--ocean); font-weight: 500; }
.text-muted    { color: var(--gray-400); font-size: .85rem; }

.role-badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
}

.role-admin { background: #fef3c7; color: #92400e; }
.role-user  { background: var(--gray-100); color: var(--gray-600); }

.row-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.btn-edit {
    background: none;
    border: 1.5px solid #fcd34d;
    color: #b45309;
    border-radius: 6px;
    padding: .3rem .7rem;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}
.btn-edit:hover { background: #b45309; color: var(--white); border-color: #b45309; text-decoration: none; }

.btn-setpw {
    background: none;
    border: 1.5px solid #86efac;
    color: #15803d;
    border-radius: 6px;
    padding: .3rem .7rem;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}
.btn-setpw:hover { background: #15803d; color: var(--white); border-color: #15803d; text-decoration: none; }

.btn-email {
    background: none;
    border: 1.5px solid #93c5fd;
    color: #1d4ed8;
    border-radius: 6px;
    padding: .3rem .7rem;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}
.btn-email:hover { background: #1d4ed8; color: var(--white); border-color: #1d4ed8; text-decoration: none; }

.btn-delete {
    background: none;
    border: 1.5px solid #fca5a5;
    color: var(--danger);
    border-radius: 6px;
    padding: .3rem .7rem;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-delete:hover { background: var(--danger); color: var(--white); border-color: var(--danger); }

.form-textarea {
    resize: vertical;
    min-height: 160px;
    font-family: inherit;
}

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

/* ---- Avatar widget ---- */
.avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.avatar-label {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 50%;
}

.avatar-img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--ocean);
    display: block;
    transition: opacity var(--transition);
}
.avatar-label:hover .avatar-img { opacity: .8; }

.avatar-placeholder {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--gray-100);
    border: 3px dashed var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    transition: border-color var(--transition), background var(--transition);
}
.avatar-label:hover .avatar-placeholder {
    border-color: var(--ocean);
    background: #e0f0ff;
}

.avatar-change-hint {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}
.avatar-label:hover .avatar-change-hint { opacity: 1; }

.avatar-file-input { display: none; }

.avatar-actions {
    display: flex;
    gap: .5rem;
    margin-top: .65rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Remove-button form sits inline with the Upload/Change label */
.avatar-actions form { display: contents; }

/* ---- Crop modal ---- */
.crop-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 1rem;
}

.crop-modal-inner {
    background: var(--white);
    border-radius: 12px;
    width: min(500px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,.45);
}

.crop-modal-header {
    padding: .9rem 1.25rem .65rem;
    border-bottom: 1px solid var(--gray-200);
}
.crop-modal-header h4 {
    margin: 0 0 .15rem;
    font-size: 1rem;
    color: var(--gray-800);
}
.crop-modal-header p {
    margin: 0;
    font-size: .78rem;
    color: var(--gray-500);
}

.crop-modal-body {
    flex: 1;
    min-height: 260px;
    max-height: 420px;
    overflow: hidden;
    background: #111;
}
.crop-modal-body img { display: block; max-width: 100%; }

.crop-modal-footer {
    padding: .9rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
}

/* ---- Footer ---- */
.footer {
    background: var(--ocean-dark);
    color: rgba(255,255,255,.7);
    padding: 1.25rem 2rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-size: .85rem;
}

/* ---- Crew directory ---- */
.crew-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 3rem 4rem;
    width: 100%;
}

.crew-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--ocean-dark), var(--ocean));
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    color: var(--white);
}
.crew-header h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: .25rem; }
.crew-header p  { opacity: .8; font-size: .9rem; }

.crew-count {
    background: rgba(255,255,255,.15);
    border: 1.5px solid rgba(255,255,255,.3);
    border-radius: 999px;
    padding: .35rem .9rem;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}

.crew-grid {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.crew-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: .75rem 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 1rem;
    transition: box-shadow var(--transition), transform var(--transition);
}
.crew-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.crew-card-self {
    border-color: var(--ocean);
    box-shadow: 0 0 0 2px rgba(0,119,182,.2);
}

.crew-avatar-wrap { flex-shrink: 0; }

.crew-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ocean);
    display: block;
}

.crew-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-100);
    border: 2px dashed var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.crew-col {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}
.crew-col-name  { min-width: 160px; }
.crew-col-email { flex: 1; }
.crew-col-since { white-space: nowrap; }

.crew-badges {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
    flex-shrink: 0;
}

.crew-you-badge {
    background: rgba(0,119,182,.12);
    color: var(--ocean);
    border: 1.5px solid rgba(0,119,182,.3);
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    padding: 1px 8px;
}

.crew-name     { font-weight: 700; font-size: 1rem; color: var(--gray-800); line-height: 1.3; }
.crew-username { font-size: .85rem; color: var(--ocean); font-weight: 500; }
.crew-email    { font-size: .8rem; color: var(--gray-600); word-break: break-all; margin-top: .1rem; }
.crew-since      { font-size: .75rem; color: var(--gray-400); margin-top: .35rem; }
.crew-last-login { font-size: .72rem; color: var(--gray-300); margin-top: .15rem; }

/* ---- Photo album ---- */
.album-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 3rem 4rem;
    width: 100%;
}

.album-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--ocean-dark), var(--ocean));
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    color: var(--white);
}
.album-header h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: .25rem; }
.album-header p  { opacity: .8; font-size: .9rem; }

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.photo-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    position: relative;
    transition: box-shadow var(--transition), transform var(--transition);
}
.photo-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.photo-thumb-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: pointer;
    background: var(--gray-100);
}
.photo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.photo-card:hover .photo-thumb { transform: scale(1.04); }

.photo-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}
.photo-card:hover .photo-thumb-overlay { opacity: 1; }
.photo-zoom-icon { font-size: 1.8rem; }

.photo-meta {
    padding: .75rem 1rem .85rem;
}

.photo-uploader-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .35rem;
}
.photo-uploader-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-200);
    flex-shrink: 0;
}
.photo-uploader-avatar-ph {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}
.photo-uploader-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.photo-uploader-name {
    font-weight: 600;
    font-size: .85rem;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.photo-upload-date {
    font-size: .75rem;
    color: var(--gray-400);
}
.photo-caption-text {
    font-size: .82rem;
    color: var(--gray-600);
    margin: .25rem 0 0;
    line-height: 1.4;
    word-break: break-word;
}

/* Delete button — top-right corner, owner/admin only */
.photo-delete-form {
    position: absolute;
    top: .45rem;
    right: .45rem;
    z-index: 2;
}
.photo-delete-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition), background var(--transition);
}
.photo-card:hover .photo-delete-btn { opacity: 1; }
.photo-delete-btn:hover { background: var(--danger); }

/* Empty state */
.album-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--gray-400);
}
.album-empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.album-empty p    { font-size: 1rem; margin-bottom: 1.25rem; }

/* ---- Upload modal ---- */
.upload-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 1rem;
}
.upload-modal-inner {
    background: var(--white);
    border-radius: var(--radius);
    width: min(480px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,.4);
}
.upload-modal-header {
    padding: 1rem 1.25rem .7rem;
    border-bottom: 1px solid var(--gray-200);
}
.upload-modal-header h4 { margin: 0 0 .15rem; font-size: 1rem; color: var(--gray-800); }
.upload-modal-header p  { margin: 0; font-size: .78rem; color: var(--gray-500); }

.upload-modal-body {
    padding: 1.1rem 1.25rem;
    overflow-y: auto;
}
.upload-modal-footer {
    padding: .9rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
}

.upload-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 2rem 1rem;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.upload-drop-zone:hover { border-color: var(--ocean); background: #f0f8ff; }
.upload-drop-icon { font-size: 2.2rem; }
.upload-drop-text { font-weight: 600; font-size: .9rem; color: var(--gray-800); }
.upload-drop-hint { font-size: .78rem; color: var(--gray-400); }

.upload-preview-wrap {
    text-align: center;
    margin-bottom: .5rem;
}
.upload-preview-img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid var(--gray-200);
}
.upload-preview-change {
    display: block;
    margin: .5rem auto 0;
    background: none;
    border: none;
    color: var(--ocean);
    font-size: .82rem;
    cursor: pointer;
    text-decoration: underline;
}

/* ---- Lightbox ---- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 950;
    padding: 1rem;
}
.lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 951;
    transition: background var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }
.lightbox-inner {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: min(1200px, 96vw);
    height: 88vh;           /* fixed height — gives children a concrete value to scroll against */
    border-radius: 10px;
    overflow: hidden;
    gap: 0;
}
.lightbox-photo-side {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.35);
    overflow: hidden;
}
.lightbox-img {
    max-width: 100%;
    max-height: 100%;       /* fills photo side, contained by object-fit */
    object-fit: contain;
    display: block;
}
.lightbox-info {
    width: 320px;
    flex-shrink: 0;
    height: 100%;           /* match container height so overflow-y scrolls */
    overflow-y: auto;
    box-sizing: border-box;
    background: rgba(30,30,30,.97);
    border-left: 1px solid rgba(255,255,255,.08);
    border-radius: 0 10px 10px 0;
    padding: 1rem 1.1rem 1.25rem;
}
.lightbox-uploader-row {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.lightbox-avatar-wrap { flex-shrink: 0; }
.lightbox-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.3);
}
.lightbox-avatar-ph {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.lightbox-uploader-name     { font-weight: 600; font-size: .9rem; color: #fff; }
.lightbox-uploader-username { font-size: .8rem; color: rgba(255,255,255,.6); }
.lightbox-date {
    margin-left: auto;
    font-size: .78rem;
    color: rgba(255,255,255,.5);
    white-space: nowrap;
}
.lightbox-caption {
    font-size: .88rem;
    color: rgba(255,255,255,.75);
    margin: .55rem 0 0;
    line-height: 1.5;
}

/* ---- Photo card tags + comment count ---- */
.photo-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    padding: .3rem 1rem .1rem;
}
.photo-tag {
    font-size: .72rem;
    color: var(--ocean);
    background: rgba(0,119,182,.08);
    border: 1px solid rgba(0,119,182,.2);
    border-radius: 999px;
    padding: 1px 7px;
}
.photo-comment-count {
    font-size: .75rem;
    color: var(--gray-400);
    padding: .15rem 1rem .65rem;
}

/* ---- Lightbox tags ---- */
.lightbox-tags-section {
    margin-top: .7rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.lb-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    min-height: 1.4rem;
    align-items: center;
}
.lb-tag {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    color: rgba(255,255,255,.85);
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    padding: 2px 9px;
}
.lb-tag-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,.55);
    cursor: pointer;
    font-size: .95rem;
    padding: 0;
    line-height: 1;
    transition: color var(--transition);
}
.lb-tag-remove:hover { color: var(--danger); }
.lb-tag-form {
    display: flex;
    gap: .5rem;
}
.lb-tag-form input {
    flex: 1;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: var(--radius);
    padding: .3rem .65rem;
    font-size: .82rem;
    color: #fff;
    outline: none;
    transition: border-color var(--transition);
}
.lb-tag-form input:focus { border-color: rgba(255,255,255,.5); }
.lb-tag-form input::placeholder { color: rgba(255,255,255,.4); }

/* ---- Lightbox comments ---- */
.lightbox-comments-section {
    margin-top: .85rem;
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: .7rem;
}
.lb-comments-header {
    font-size: .8rem;
    font-weight: 600;
    color: rgba(255,255,255,.65);
    margin-bottom: .55rem;
}
.lb-comments-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-height: 210px;
    overflow-y: auto;
    margin-bottom: .65rem;
    padding-right: .15rem;
}
.lb-comment {
    display: flex;
    gap: .55rem;
    align-items: flex-start;
}
.lb-comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255,255,255,.2);
    flex-shrink: 0;
}
.lb-comment-avatar-ph {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    flex-shrink: 0;
}
.lb-comment-body-wrap {
    flex: 1;
    min-width: 0;
}
.lb-comment-meta {
    font-size: .74rem;
    color: rgba(255,255,255,.5);
    margin-bottom: .18rem;
}
.lb-comment-meta strong { color: rgba(255,255,255,.85); }
.lb-comment-text {
    font-size: .84rem;
    color: rgba(255,255,255,.8);
    line-height: 1.45;
    word-break: break-word;
}
.lb-comment-delete {
    background: none;
    border: none;
    color: rgba(255,255,255,.3);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 .2rem;
    flex-shrink: 0;
    line-height: 1;
    transition: color var(--transition);
}
.lb-comment-delete:hover { color: var(--danger); }
.lb-comment-form {
    display: flex;
    gap: .5rem;
    align-items: flex-end;
}
.lb-comment-form textarea {
    flex: 1;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: var(--radius);
    padding: .4rem .65rem;
    font-size: .83rem;
    color: #fff;
    resize: none;
    outline: none;
    transition: border-color var(--transition);
}
.lb-comment-form textarea:focus { border-color: rgba(255,255,255,.5); }
.lb-comment-form textarea::placeholder { color: rgba(255,255,255,.4); }

/* =========================================================
   Feed / Posts
   ========================================================= */

.feed-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 4.5rem 4rem;   /* more side margin */
    width: 100%;
}

.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--ocean-dark), var(--ocean));
    border-radius: 16px;
    padding: 1.75rem 2rem;
    color: var(--white);
    box-shadow: 0 4px 20px rgba(0,119,182,.3);
}
.feed-header h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: .25rem; }
.feed-header p  { opacity: .75; font-size: .9rem; }

.feed-empty {
    text-align: center;
    padding: 5rem 1rem;
    color: var(--gray-400);
}
.feed-empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.feed-empty p    { font-size: 1rem; margin-bottom: 1.25rem; }

/* ---- Post card — frameless, shadow-only, modern rounding ---- */
.post-card {
    background: var(--white);
    border-radius: 16px;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,.07), 0 0 0 1px rgba(0,0,0,.04);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}
.post-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,.11), 0 0 0 1px rgba(0,0,0,.04);
    transform: translateY(-2px);
}

.post-header {
    display: flex;
    flex-direction: column;
    padding: 1.15rem 1.5rem .8rem;
    position: relative;
    gap: .35rem;
}
.post-header-topic  { }
.post-header-main   {
    display: flex;
    align-items: center;
    gap: .9rem;
}
.post-author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-100);
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.post-author-avatar-ph {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    border: 2px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.post-author-info {
    display: flex;
    flex-direction: column;
    gap: .08rem;
    min-width: 0;
}
.post-author-name     { font-weight: 700; font-size: .95rem; color: var(--gray-800); }
.post-author-username { font-size: .8rem; color: var(--ocean); font-weight: 500; }
.post-date {
    margin-left: auto;
    font-size: .75rem;
    color: var(--gray-400);
    white-space: nowrap;
    flex-shrink: 0;
}
/* ---- Post watch button ---- */
.post-watch-btn     { background: none; border: 1.5px solid var(--gray-200); border-radius: 999px;
                       padding: .2rem .7rem; font-size: .76rem; color: var(--gray-400);
                       cursor: pointer; transition: all var(--transition);
                       display: inline-flex; align-items: center; gap: .25rem;
                       flex-shrink: 0; }
.post-watch-btn:hover  { border-color: var(--ocean); color: var(--ocean); }
.post-watch-btn.watching { background: rgba(0,119,182,.08); border-color: rgba(0,119,182,.3);
                             color: var(--ocean); font-weight: 600; }

/* ---- Reactions ---- */
.post-reactions-section         { padding: .35rem 1.5rem .5rem; position: relative; }
.reaction-bar                   { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.reaction-pill                  { display: inline-flex; align-items: center; gap: .2rem;
                                   background: var(--gray-100); border: 1.5px solid var(--gray-200);
                                   border-radius: 999px; padding: .12rem .55rem; font-size: .88rem;
                                   cursor: pointer; transition: all var(--transition); color: var(--gray-700);
                                   line-height: 1.4; }
.reaction-pill:hover             { border-color: var(--ocean); background: rgba(0,119,182,.07); }
.reaction-pill.reacted           { background: rgba(0,119,182,.12); border-color: var(--ocean);
                                   color: var(--ocean); font-weight: 600; }
.rxn-count                      { font-size: .78rem; font-weight: 600; }
.reaction-add-btn               { display: inline-flex; align-items: center; justify-content: center;
                                   height: 28px; padding: 0 .45rem; border-radius: 999px;
                                   border: 1.5px solid var(--gray-200); background: var(--gray-100);
                                   cursor: pointer; font-size: 1rem; opacity: .65;
                                   transition: all var(--transition); flex-shrink: 0; }
.reaction-add-btn:hover          { border-color: var(--ocean); opacity: 1;
                                   background: rgba(0,119,182,.07); }
/* Emoji picker popup */
.emoji-picker                   { position: absolute; background: #fff;
                                   border: 1px solid var(--gray-200); border-radius: 12px;
                                   box-shadow: 0 6px 24px rgba(0,0,0,.13); padding: .4rem .45rem;
                                   display: grid; grid-template-columns: repeat(8, 1fr);
                                   gap: 1px; z-index: 300; bottom: calc(100% + 4px); left: 0; }
.emoji-picker button            { background: none; border: none; cursor: pointer; font-size: 1.15rem;
                                   padding: .18rem; border-radius: 5px; transition: background .12s;
                                   line-height: 1; }
.emoji-picker button:hover      { background: var(--gray-100); }

/* Lightbox reactions (dark background context) */
.lightbox-reactions-section     { padding: .5rem 0 .55rem; position: relative;
                                   border-bottom: 1px solid rgba(255,255,255,.08);
                                   margin-bottom: .4rem; }
.lb-reactions-header            { font-size: .7rem; font-weight: 600; color: rgba(255,255,255,.45);
                                   text-transform: uppercase; letter-spacing: .04em;
                                   margin-bottom: .3rem; }
.lightbox-reactions-section .reaction-pill   { background: rgba(255,255,255,.08);
                                               border-color: rgba(255,255,255,.15);
                                               color: rgba(255,255,255,.8); }
.lightbox-reactions-section .reaction-pill:hover  { background: rgba(255,255,255,.15);
                                                    border-color: rgba(255,255,255,.35); }
.lightbox-reactions-section .reaction-pill.reacted { background: rgba(0,119,182,.3);
                                                      border-color: var(--ocean-light);
                                                      color: var(--ocean-light); }
.lightbox-reactions-section .reaction-add-btn      { border-color: rgba(255,255,255,.2);
                                                      background: rgba(255,255,255,.07); }
.lightbox-reactions-section .reaction-add-btn:hover { border-color: var(--ocean-light);
                                                       background: rgba(0,119,182,.25); opacity: 1; }
.lightbox-reactions-section .emoji-picker          { background: #1e2d40;
                                                      border-color: rgba(255,255,255,.15);
                                                      bottom: auto; top: calc(100% + 4px); }
.lightbox-reactions-section .emoji-picker button:hover { background: rgba(255,255,255,.1); }

.post-delete-form { margin-left: .5rem; flex-shrink: 0; }
.post-delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--gray-300);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}
.post-delete-btn:hover { background: #fee2e2; color: var(--danger); }

.post-body {
    padding: .2rem 1.5rem 1.1rem;
    font-size: 1rem;
    color: var(--gray-800);
    white-space: pre-wrap;
    line-height: 1.72;
    word-break: break-word;
}

/* ---- Post image grid — edge-to-edge, no side padding ---- */
.post-images-grid {
    display: grid;
    gap: 2px;
    padding: 0 0 1.1rem;  /* images span full card width */
}
.post-images-1 { grid-template-columns: 1fr; }
.post-images-2 { grid-template-columns: 1fr 1fr; }
.post-images-3 { grid-template-columns: 1fr 1fr 1fr; }
.post-images-4 { grid-template-columns: 1fr 1fr; }

.post-image-item {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: zoom-in;
    border-radius: 0;   /* no rounding — card clips edges */
    background: var(--gray-100);
}
.post-image-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.post-image-item:hover .post-image-thumb { transform: scale(1.05); }

/* ---- Links & attachments ---- */
.post-links-section {
    padding: 0 1.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.post-link-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(0,119,182,.07);
    border: 1px solid rgba(0,119,182,.18);
    color: var(--ocean);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: .84rem;
    font-weight: 500;
    text-decoration: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background var(--transition), border-color var(--transition);
}
.post-link-pill:hover { background: rgba(0,119,182,.13); border-color: rgba(0,119,182,.35); color: var(--ocean); }

.post-attachments-section {
    padding: 0 1.5rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.post-attachment-item {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    padding: .45rem 1rem;
    font-size: .84rem;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    align-self: flex-start;
    transition: background var(--transition), border-color var(--transition);
}
.post-attachment-item:hover { background: var(--gray-100); border-color: var(--gray-400); color: var(--gray-800); }
.att-size { color: var(--gray-400); font-size: .76rem; font-weight: 400; }

/* ---- Post comments ---- */
.post-comments-section {
    border-top: 1px solid var(--gray-100);
    padding: 1rem 1.5rem 1.15rem;
    background: var(--gray-50);
}
.post-comments-header {
    font-size: .79rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: .75rem;
}
.post-comments-list {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    margin-bottom: .8rem;
}
.post-no-comments {
    font-size: .83rem;
    color: var(--gray-400);
    padding: .1rem 0;
    font-style: italic;
}
.post-comment {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
}
.post-comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--gray-200);
    flex-shrink: 0;
}
.post-comment-avatar-ph {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}
.post-comment-body-wrap {
    flex: 1;
    min-width: 0;
    background: var(--white);
    border-radius: 12px;
    padding: .5rem .75rem;
    border: 1px solid var(--gray-200);
}
.post-comment-meta {
    font-size: .74rem;
    color: var(--gray-400);
    margin-bottom: .2rem;
}
.post-comment-meta strong { color: var(--gray-700); font-weight: 600; }
.post-comment-text {
    font-size: .87rem;
    color: var(--gray-700);
    line-height: 1.5;
    word-break: break-word;
}
.post-comment-delete {
    background: none;
    border: none;
    color: var(--gray-300);
    cursor: pointer;
    font-size: 1rem;
    padding: .2rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: .25rem;
    transition: color var(--transition);
}
.post-comment-delete:hover { color: var(--danger); }
.post-comment-form {
    display: flex;
    gap: .6rem;
    align-items: flex-end;
    margin-top: .25rem;
}
.post-comment-form textarea {
    flex: 1;
    border: 1.5px solid var(--gray-200);
    border-radius: 12px;
    padding: .5rem .85rem;
    font-size: .86rem;
    color: var(--gray-800);
    background: var(--white);
    resize: none;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
}
.post-comment-form textarea:focus {
    border-color: var(--ocean);
    box-shadow: 0 0 0 3px rgba(0,119,182,.1);
}
.post-comment-form textarea::placeholder { color: var(--gray-400); }

/* ---- Post image lightbox (simple, full-screen) ---- */
#post-img-lb {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 960;
    cursor: zoom-out;
}
#post-img-lb img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}
#post-img-lb-close {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 961;
    transition: background var(--transition);
}
#post-img-lb-close:hover { background: rgba(255,255,255,.3); }

/* ---- New post modal ---- */
.new-post-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 1rem;
}
.new-post-modal-inner {
    background: var(--white);
    border-radius: var(--radius);
    width: min(600px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,.4);
}
.new-post-modal-header {
    padding: 1rem 1.25rem .7rem;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}
.new-post-modal-header h4 { margin: 0 0 .15rem; font-size: 1rem; color: var(--gray-800); }
.new-post-modal-header p  { margin: 0; font-size: .78rem; color: var(--gray-500); }
.new-post-modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    max-height: calc(90vh - 140px); /* reserve space for header + footer */
}
.new-post-modal-footer {
    padding: .9rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    flex-shrink: 0;
}
.np-textarea {
    width: 100%;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}
.np-section { display: flex; flex-direction: column; gap: .4rem; }
.np-section-label { font-size: .82rem; font-weight: 600; color: var(--gray-600); }
.np-file-label { align-self: flex-start; cursor: pointer; }

/* Image previews in modal */
.np-image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.np-image-preview-item {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--gray-200);
}

/* Link input row */
.np-link-input-row {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}
.np-link-url-input   { flex: 2; min-width: 0; }
.np-link-title-input { flex: 1; min-width: 0; }

/* Link chips */
.np-link-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.np-link-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: rgba(0,119,182,.08);
    border: 1px solid rgba(0,119,182,.2);
    color: var(--ocean);
    border-radius: 999px;
    padding: 2px 10px 2px 10px;
    font-size: .8rem;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.np-chip-remove {
    background: none;
    border: none;
    color: var(--ocean);
    cursor: pointer;
    font-size: .9rem;
    padding: 0;
    line-height: 1;
    opacity: .7;
    flex-shrink: 0;
}
.np-chip-remove:hover { opacity: 1; }

/* Attachment list in modal */
.np-attachment-list {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.np-attachment-item {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: .35rem .8rem;
    font-size: .82rem;
    color: var(--gray-700);
    align-self: flex-start;
}

/* ==========================================================================
   Responsive — mobile-first breakpoints
   ========================================================================== */

/* ---- ≤ 768px  tablets and phones ---- */
@media (max-width: 768px) {

    /* Navbar: hamburger dropdown */
    .navbar         { padding: .75rem 1rem; flex-wrap: wrap; }
    .brand-sub      { display: none; }

    /* nav-end stays in the top bar; show hamburger */
    .nav-hamburger  {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--white);
        font-size: 1.35rem;
        padding: .25rem .4rem;
        border-radius: 6px;
        transition: background var(--transition);
        line-height: 1;
    }
    .nav-hamburger:hover { background: rgba(255,255,255,.12); }

    /* nav-links: hidden by default, full-width dropdown when .nav-open */
    .nav-links {
        order: 10;           /* render below the top bar */
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        margin-left: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height .28s ease, padding .28s ease;
        border-top: 0px solid rgba(255,255,255,.1);
    }
    .nav-open .nav-links {
        max-height: 480px;
        padding: .35rem 0 .75rem;
        border-top-width: 1px;
    }
    .nav-links .nav-link,
    .nav-links a {
        display: block;
        padding: .75rem 1.5rem;
        border-radius: 0;
        font-size: .97rem;
        border-bottom: 1px solid rgba(255,255,255,.05);
        text-align: left;
    }
    .nav-links .nav-link:hover,
    .nav-links a:hover { background: rgba(255,255,255,.1); }
    .nav-user {
        display: block !important;   /* show the greeting inside the dropdown */
        padding: .6rem 1.5rem .35rem;
        font-size: .88rem;
        border-bottom: 1px solid rgba(255,255,255,.05);
    }

    /* Notification dropdown: constrain so it doesn't overflow screen */
    .notif-dropdown { width: min(290px, 92vw); }

    /* Page-level padding */
    .feed-page    { padding: 1.5rem 1.25rem 3rem; }
    .crew-page    { padding: 1.5rem 1.25rem 3rem; }
    .album-page   { padding: 1.5rem 1.25rem 3rem; }
    .dashboard    { padding: 1.5rem 1.25rem 3rem; }

    /* Dashboard */
    .dashboard-header { flex-direction: column; align-items: flex-start; }

    /* Crew cards: let email + since columns hide, keep avatar + name + badges */
    .crew-card       { flex-wrap: wrap; gap: .55rem .7rem; padding: .75rem 1rem; }
    .crew-col-email  { display: none; }
    .crew-col-since  { display: none; }
    .crew-col-name   { min-width: 0; flex: 1; }
    .crew-badges     { margin-left: 0; width: 100%; }

    /* Feed header */
    .feed-header  { flex-direction: column; align-items: flex-start; gap: .5rem; }

    /* Crew header */
    .crew-header  { flex-direction: column; align-items: flex-start; gap: .5rem; }

    /* Album header */
    .album-header { flex-direction: column; align-items: flex-start; gap: .5rem; }

    /* Lightbox: switch to stacked column */
    .lightbox-inner      { flex-direction: column; width: 96vw; height: 92vh; }
    .lightbox-photo-side { flex: 0 0 48%; }
    .lightbox-info       { width: 100%; height: 0; flex: 1;
                            border-left: none;
                            border-top: 1px solid rgba(255,255,255,.08);
                            border-radius: 0 0 10px 10px; }
    .lb-comments-list    { max-height: 140px; }

    /* Hero (landing page) */
    .hero { padding: 4rem 1.25rem 4rem; }

    /* Forms */
    .form-row { grid-template-columns: 1fr; }
}


/* ---- ≤ 480px  small phones ---- */
@media (max-width: 480px) {

    /* Tighter page padding */
    .feed-page    { padding: 1rem .75rem 2.5rem; }
    .crew-page    { padding: 1rem .75rem 2.5rem; }
    .album-page   { padding: 1rem .75rem 2.5rem; }
    .dashboard    { padding: 1rem .75rem 2.5rem; }

    /* Post header: allow wrapping so watch btn + delete don't squish author */
    .post-header        { padding: .85rem .9rem .65rem; gap: .4rem .6rem; flex-wrap: wrap; }
    .post-author-info   { flex: 1; min-width: 110px; }
    .post-date          { font-size: .7rem; }
    /* Watch button: show only the 🔔 emoji to save space */
    .post-watch-btn .watch-label { display: none; }
    .post-watch-btn     { padding: .15rem .4rem; min-width: 30px; min-height: 30px;
                           font-size: .9rem; justify-content: center; }
    .post-delete-form   { margin-left: 0; }

    /* Post body / sections: tighter padding */
    .post-body                { padding: .1rem .9rem .8rem; }
    .post-links-section       { padding: 0 .9rem .7rem; }
    .post-attachments-section { padding: 0 .9rem .7rem; }
    .post-comments-section    { padding: .7rem .9rem .85rem; }
    .post-images-grid         { padding: 0 0 .9rem; }

    /* Image grid: 3-col → 2-col (3 images at ~125px each is too small) */
    .post-images-3 { grid-template-columns: 1fr 1fr; }

    /* Photo grid: smaller minimum for 2-up on 375px */
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

    /* New post modal — link input row stacks vertically */
    .np-link-input-row    { flex-direction: column; align-items: stretch; gap: .5rem; }
    .np-link-url-input    { flex: none; width: 100%; }
    .np-link-title-input  { flex: none; width: 100%; }
}


/* ---- Landscape mobile: short viewport fix for lightbox ---- */
@media (orientation: landscape) and (max-height: 480px) {
    .lightbox-inner      { flex-direction: row; height: 96vh; width: 98vw; }
    .lightbox-photo-side { flex: 1; }
    .lightbox-info       { width: 220px; height: 100%;
                            border-left: 1px solid rgba(255,255,255,.08);
                            border-top: none;
                            border-radius: 0 10px 10px 0; }
}


/* ==========================================================================
   PROFILE PAGE
   ========================================================================== */

.profile-page          { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ---- Hero Banner ---- */
.profile-hero          { background: linear-gradient(135deg, #1d4ed8, #2563eb);
                          border-radius: var(--radius); padding: 2rem;
                          display: flex; justify-content: space-between;
                          align-items: flex-start; gap: 1.5rem; flex-wrap: wrap;
                          color: var(--white); }
.profile-hero-left     { display: flex; align-items: flex-start; gap: 1.25rem; flex: 1; }
.profile-hero-avatar   { width: 72px; height: 72px; border-radius: 50%;
                          object-fit: cover; border: 3px solid rgba(255,255,255,.8);
                          flex-shrink: 0; }
.profile-hero-initials { width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
                          background: var(--ocean-dark); border: 3px solid rgba(255,255,255,.5);
                          display: flex; align-items: center; justify-content: center;
                          font-size: 1.6rem; font-weight: 800; color: var(--white); }
.profile-hero-meta     { display: flex; flex-direction: column; gap: .2rem; }
.profile-hero-name     { font-size: 1.65rem; font-weight: 800; line-height: 1.1; }
.profile-hero-username { font-size: .95rem; opacity: .75; font-weight: 500; }
.profile-hero-since    { font-size: .8rem; opacity: .65; margin-top: .15rem; }
.profile-hero-bio      { font-size: .9rem; opacity: .85; margin-top: .4rem;
                          max-width: 480px; line-height: 1.5; }
.profile-hero-right    { display: flex; flex-direction: column; align-items: flex-end;
                          gap: .6rem; flex-shrink: 0; }
.profile-hero-badge    { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
                          border-radius: 999px; padding: .3rem .9rem; font-size: .8rem;
                          font-weight: 600; white-space: nowrap; }
.profile-edit-btn      { background: transparent; border: 1.5px solid rgba(255,255,255,.65);
                          border-radius: 999px; padding: .4rem 1rem; font-size: .83rem;
                          font-weight: 600; color: var(--white); cursor: pointer;
                          transition: all var(--transition); white-space: nowrap;
                          text-decoration: none; display: inline-block; }
.profile-edit-btn:hover { background: rgba(255,255,255,.15); border-color: var(--white); }
.profile-acct-btn      { background: rgba(255,255,255,.12); }
.profile-acct-btn:hover { background: rgba(255,255,255,.25); }

/* ---- Edit mode widgets (inside hero) ---- */
.profile-edit-textarea { width: 100%; background: rgba(255,255,255,.12);
                          border: 1px solid rgba(255,255,255,.3); border-radius: 8px;
                          padding: .5rem .7rem; color: var(--white); font-size: .88rem;
                          resize: vertical; margin-top: .4rem; }
.profile-edit-textarea::placeholder { color: rgba(255,255,255,.5); }
.profile-bio-counter   { font-size: .72rem; opacity: .6; text-align: right; margin-top: .15rem; }

/* ---- Two-column layout ---- */
.profile-layout        { display: flex; gap: 1.5rem; align-items: flex-start;
                          margin-top: 1.5rem; }
.profile-sidebar       { width: 280px; flex-shrink: 0;
                          display: flex; flex-direction: column; gap: 1rem; }
.profile-main          { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1.5rem; }

/* ---- Sidebar cards ---- */
.profile-sidebar-card  { background: var(--white); border-radius: var(--radius);
                          border: 1px solid var(--gray-200); padding: 1.25rem;
                          box-shadow: var(--shadow-sm); }
.profile-card-title    { font-size: .72rem; font-weight: 700; color: #64748b;
                          text-transform: uppercase; letter-spacing: .06em;
                          margin-bottom: .75rem; }

/* About list */
.profile-about-list    { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.profile-about-list li { display: flex; align-items: flex-start; gap: .5rem; font-size: .88rem; }
.profile-about-icon    { flex-shrink: 0; width: 18px; }
.profile-about-value   { color: var(--gray-700); }
.profile-empty         { color: var(--gray-400); }
.profile-empty-hint    { color: var(--gray-400); font-size: .82rem; font-style: italic; }

/* Sidebar edit inputs */
.profile-edit-input    { width: 100%; border: 1px solid var(--gray-200); border-radius: 8px;
                          padding: .35rem .6rem; font-size: .88rem; color: var(--gray-800);
                          outline: none; transition: border-color var(--transition); }
.profile-edit-input:focus { border-color: #2563eb; }

/* Interests */
.profile-interests-wrap { display: flex; flex-wrap: wrap; gap: .4rem; }
.interest-tag          { background: #eff6ff; color: #1d4ed8; border-radius: 20px;
                          padding: .2rem .65rem; font-size: .75rem; font-weight: 500; }
.interest-tag-editable { display: inline-flex; align-items: center; gap: .25rem; }
.interest-remove       { background: none; border: none; cursor: pointer; font-size: .85rem;
                          color: #1d4ed8; opacity: .6; padding: 0; line-height: 1;
                          transition: opacity var(--transition); }
.interest-remove:hover { opacity: 1; }
.profile-tag-input-wrap{ display: flex; flex-direction: column; gap: .5rem; }
.profile-edit-hint     { font-size: .72rem; color: var(--gray-400); }

/* Favorites */
.fav-row               { display: flex; align-items: center; gap: .5rem;
                          padding: .3rem 0; font-size: .88rem; color: var(--gray-700); }
.fav-row:not(:last-child) { border-bottom: 1px solid var(--gray-100); }
.fav-icon              { flex-shrink: 0; width: 20px; font-size: 1rem; }
.fav-label             { color: var(--gray-400); font-size: .78rem; width: 46px; flex-shrink: 0; }
.fav-value             { flex: 1; font-weight: 500; }
.fav-edit-row          { display: flex; align-items: center; gap: .5rem; margin-bottom: .45rem; }

/* ---- Section (main) cards ---- */
.profile-section-card  { background: var(--white); border-radius: var(--radius);
                          border: 1px solid var(--gray-200); padding: 1.25rem 1.5rem;
                          box-shadow: var(--shadow-sm); }
.profile-section-header { display: flex; justify-content: space-between;
                           align-items: center; margin-bottom: 1rem; }
.profile-section-title  { font-size: 1rem; font-weight: 700; color: var(--gray-800); }
.profile-see-all        { font-size: .8rem; color: #2563eb; text-decoration: none; font-weight: 500; }
.profile-see-all:hover  { text-decoration: underline; }

/* ---- Featured photos grid ---- */
.featured-grid         { display: grid; grid-template-columns: repeat(3, 1fr);
                          gap: .6rem; margin-bottom: .85rem; }
.featured-thumb-link   { display: block; aspect-ratio: 1/1; border-radius: 8px; overflow: hidden; }
.featured-thumb        { width: 100%; height: 100%; object-fit: cover;
                          transition: transform .25s; display: block; }
.featured-thumb-link:hover .featured-thumb { transform: scale(1.04); }
.featured-placeholder  { aspect-ratio: 1/1; border-radius: 8px;
                          background: var(--gray-100); border: 2px dashed var(--gray-200);
                          display: flex; flex-direction: column; align-items: center;
                          justify-content: center; gap: .25rem; }
.featured-placeholder-icon { font-size: 1.6rem; opacity: .3; }
.featured-placeholder-hint { font-size: .72rem; color: var(--gray-400); text-align: center;
                               padding: 0 .4rem; }
.select-featured-btn   { width: 100%; background: #2563eb; color: var(--white);
                          border: none; border-radius: 8px; padding: .65rem;
                          font-size: .88rem; font-weight: 600; cursor: pointer;
                          transition: background var(--transition); }
.select-featured-btn:hover { background: #1d4ed8; }

/* ---- Activity feed ---- */
.activity-row          { display: flex; align-items: center; gap: .75rem;
                          padding: .6rem 0; border-bottom: 1px solid var(--gray-100); }
.activity-row:last-child { border-bottom: none; }
.activity-avatar       { width: 32px; height: 32px; border-radius: 50%;
                          object-fit: cover; flex-shrink: 0; }
.activity-avatar-ph    { background: var(--ocean-dark); color: var(--white);
                          display: flex; align-items: center; justify-content: center;
                          font-size: .85rem; font-weight: 700; }
.activity-content      { flex: 1; display: flex; align-items: center; gap: .5rem;
                          flex-wrap: wrap; min-width: 0; }
.activity-badge        { font-size: .7rem; font-weight: 600; border-radius: 999px;
                          padding: .15rem .55rem; flex-shrink: 0; }
.activity-badge-photo  { background: #eff6ff; color: #1d4ed8; }
.activity-badge-post   { background: #f0fdf4; color: #15803d; }
.activity-badge-comment { background: #f0fdf4; color: #15803d; }
.activity-desc         { font-size: .85rem; color: var(--gray-700);
                          white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-ts           { font-size: .75rem; color: var(--gray-400); flex-shrink: 0;
                          white-space: nowrap; }
.activity-loading,
.activity-empty        { color: var(--gray-400); font-size: .85rem;
                          padding: .75rem 0; text-align: center; }

/* ---- Edit save/cancel bar ---- */
.profile-edit-bar      { position: sticky; bottom: 1.5rem; display: flex;
                          justify-content: flex-end; gap: .75rem; margin-top: 1.5rem;
                          background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
                          padding: .75rem 1.25rem; border-radius: var(--radius);
                          border: 1px solid var(--gray-200); box-shadow: var(--shadow-md); }
.profile-save-btn      { background: #2563eb; color: var(--white); border: none;
                          border-radius: 999px; padding: .4rem 1.1rem;
                          font-size: .85rem; font-weight: 600; cursor: pointer;
                          transition: background var(--transition); }
.profile-save-btn:hover { background: #1d4ed8; }

/* ---- Featured photos modal ---- */
.featured-modal-inner  { width: min(640px, 96%); }
.featured-modal-inner .upload-modal-body { max-height: 480px; }
.featured-select-grid  { display: grid; grid-template-columns: repeat(4, 1fr);
                          gap: .5rem; padding: .25rem .5rem; }
.featured-select-item  { position: relative; aspect-ratio: 1/1; border-radius: 8px;
                          overflow: hidden; cursor: pointer; border: 3px solid transparent;
                          transition: border-color var(--transition); }
.featured-select-item.selected { border-color: #2563eb; }
.featured-select-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-select-check { position: absolute; inset: 0; background: rgba(37,99,235,.35);
                          display: flex; align-items: center; justify-content: center;
                          font-size: 1.5rem; color: var(--white); font-weight: 900;
                          opacity: 0; transition: opacity var(--transition); }
.featured-select-item.selected .featured-select-check { opacity: 1; }
.featured-select-counter { color: var(--gray-400); font-size: .82rem; margin-right: auto; }
.featured-select-section { margin-bottom: .75rem; }
.featured-select-label   { font-size: .72rem; font-weight: 700; text-transform: uppercase;
                            letter-spacing: .06em; color: #94a3b8;
                            padding: .5rem .5rem .25rem; }
.featured-select-owner   { position: absolute; bottom: 0; left: 0; right: 0;
                            background: linear-gradient(transparent, rgba(0,0,0,.55));
                            color: #fff; font-size: .65rem; font-weight: 600;
                            padding: .25rem .35rem .2rem; line-height: 1.2;
                            pointer-events: none; }

/* ---- Crew card fix (now an <a> element) ---- */
a.crew-card            { text-decoration: none; color: inherit; }
a.crew-card:hover      { text-decoration: none; }

/* ---- Responsive: sidebar stacks above main content ---- */
@media (max-width: 768px) {
    .profile-layout  { flex-direction: column; }
    .profile-sidebar { width: 100%; }
    .featured-select-grid { grid-template-columns: repeat(3, 1fr); }
    .profile-hero-name { font-size: 1.3rem; }
}

/* ── Admin Broadcast Email card ──────────────────────────────────────── */
.broadcast-desc {
    font-size: .875rem;
    color: #64748b;
    margin: 0 0 1rem;
    line-height: 1.5;
}
.broadcast-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: .9rem;
}
.broadcast-label {
    font-size: .8rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.broadcast-input {
    width: 100%;
}
.broadcast-textarea {
    width: 100%;
    resize: vertical;
    font-family: inherit;
    font-size: .9rem;
    padding: .55rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.55;
    transition: border-color .15s;
}
.broadcast-textarea:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
}
.broadcast-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.broadcast-status {
    font-size: .875rem;
    font-weight: 500;
    flex: 1;
}
.broadcast-status.broadcast-ok  { color: #16a34a; }
.broadcast-status.broadcast-err { color: #dc2626; }

/* ── Quill rich-text editor (broadcast card) ─────────────────────────── */
.broadcast-editor-wrap              { border: 1px solid #d1d5db; border-radius: 8px;
                                      overflow: hidden; background: #f8fafc; }
.broadcast-editor-wrap .ql-toolbar  { border: none; border-bottom: 1px solid #d1d5db;
                                      background: #fff; padding: .4rem .6rem;
                                      font-family: inherit; }
.broadcast-editor-wrap .ql-toolbar button,
.broadcast-editor-wrap .ql-toolbar .ql-picker { color: #374151; }
.broadcast-editor-wrap .ql-toolbar button:hover,
.broadcast-editor-wrap .ql-toolbar button.ql-active { color: #2563eb; }
.broadcast-editor-wrap .ql-toolbar .ql-stroke      { stroke: currentColor; }
.broadcast-editor-wrap .ql-toolbar .ql-fill        { fill:  currentColor; }
.broadcast-editor-wrap .ql-container               { border: none; font-family: inherit;
                                                      font-size: .9rem; }
.broadcast-editor-wrap .ql-editor                  { min-height: 180px; padding: .75rem;
                                                      color: #1e293b; line-height: 1.65; }
.broadcast-editor-wrap .ql-editor.ql-blank::before { color: #94a3b8; font-style: normal; }
.broadcast-editor-wrap .ql-editor:focus             { background: #fff; }

/* ── Sent Emails sidebar card ──────────────────────────────────────── */
.sent-email-row             { padding: .55rem .25rem; border-bottom: 1px solid var(--gray-100);
                               cursor: pointer; border-radius: 6px; transition: background var(--transition); }
.sent-email-row:last-child  { border-bottom: none; }
.sent-email-row:hover       { background: var(--gray-50); }
.sent-email-subject         { font-size: .84rem; font-weight: 600; color: var(--gray-800);
                               white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
                               margin-bottom: .18rem; }
.sent-email-meta            { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.sent-email-date            { font-size: .72rem; color: var(--gray-400); }
.sent-email-counts          { font-size: .72rem; color: #15803d; font-weight: 500;
                               display: flex; align-items: center; gap: .3rem; }
.sent-email-fail-badge      { background: #fef2f2; color: #dc2626; border-radius: 999px;
                               padding: .1rem .45rem; font-size: .68rem; font-weight: 600; }

/* ── Broadcast Email Detail Modal ──────────────────────────────────── */
.email-detail-modal-inner                 { width: min(680px, 96%); }
.email-detail-modal-inner .upload-modal-body { max-height: 540px; overflow-y: auto; }
.email-detail-body                        { font-size: .9rem; line-height: 1.7;
                                            color: var(--gray-800); padding-bottom: 1rem; }
.email-detail-body p                      { margin-bottom: .75rem; }
.email-detail-body ul,
.email-detail-body ol                     { padding-left: 1.4rem; margin-bottom: .75rem; }
.email-detail-body a                      { color: var(--ocean); }
.email-detail-body h1,
.email-detail-body h2,
.email-detail-body h3                     { margin-bottom: .5rem; color: var(--gray-800); }
.email-detail-failures                    { margin-top: 1rem; border-top: 1px solid var(--gray-200);
                                            padding-top: .75rem; }
.email-detail-failures-title              { font-size: .75rem; font-weight: 700; text-transform: uppercase;
                                            letter-spacing: .05em; color: #dc2626; margin-bottom: .4rem; }
.email-detail-failures-list               { list-style: none; display: flex; flex-direction: column;
                                            gap: .3rem; padding: 0; }
.email-detail-failures-list li            { font-size: .8rem; color: var(--gray-600); }
.email-detail-failures-list strong        { color: var(--gray-800); }

/* ── Collapsible post cards ────────────────────────────────────────── */
.post-header                { cursor: pointer; user-select: none; }
.post-collapse-chevron      { font-size: .78rem; color: var(--gray-400);
                               transition: transform .2s ease; flex-shrink: 0;
                               margin-right: .1rem; }
.post-card.collapsed .post-collapse-chevron  { transform: rotate(-90deg); }
.post-body-wrap             { }
.post-card.collapsed .post-body-wrap         { display: none; }
.post-card.collapsed        { transform: none !important; }
/* Hide topic row in header when post is expanded (shown in body instead) */
.post-card:not(.collapsed) .post-header-topic { display: none; }

/* ── SMS / Phone 2FA ────────────────────────────────────────────────── */
.twofa-method-group         { display: flex; flex-direction: column; gap: .45rem;
                               margin-bottom: .9rem; }
.twofa-method-label         { display: flex; align-items: center; gap: .45rem;
                               font-size: .9rem; font-weight: 500; color: var(--gray-800);
                               cursor: pointer; }
.twofa-method-label input[type="radio"] { accent-color: var(--ocean);
                               width: 1rem; height: 1rem; flex-shrink: 0; }
.twofa-method-disabled      { opacity: .5; cursor: not-allowed; }
.twofa-method-hint          { font-size: .78rem; color: var(--gray-400); font-weight: 400; }
.twofa-switch-form          { display: flex; flex-direction: column; gap: .45rem;
                               margin-top: .5rem; padding: .75rem;
                               background: var(--gray-50); border-radius: 8px;
                               border: 1px solid var(--gray-200); }
.twofa-switch-btn           { align-self: flex-start; margin-top: .25rem; }
.twofa-enable-form          { display: flex; flex-direction: column; gap: .65rem; }
.twofa-phone-section        { margin-top: .25rem; }
.twofa-divider              { border: none; border-top: 1px solid var(--gray-200);
                               margin: 1.25rem 0 1rem; }
.twofa-sub-heading          { font-size: .9rem; font-weight: 700; color: var(--gray-800);
                               margin-bottom: .75rem; }
.twofa-phone-verified       { font-size: .9rem; color: var(--success); font-weight: 600;
                               margin-bottom: .6rem; }
.twofa-verify-form          { display: flex; flex-direction: column; gap: .5rem; }
.twofa-verify-form .form-input { font-size: 1.1rem; font-weight: 700; text-align: center;
                               letter-spacing: .15em; max-width: 160px; }
.twofa-phone-form           { display: flex; flex-direction: column; gap: .5rem; }
.twofa-phone-form .form-input { max-width: 220px; }

/* ── Post header preview (shown only when collapsed) ───────────────── */
.post-preview {
    font-size: .82rem;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    margin: 0 .75rem;
}
.post-card:not(.collapsed) .post-preview { display: none; }

/* ── Post topic badge (collapsed header) ───────────────────────────── */
.post-topic-badge {
    display: inline-block;
    background: var(--ocean-light);
    color: var(--ocean-dark);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .18rem .55rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}
/* ── Post topic title (expanded view) ──────────────────────────────── */
.post-topic-row {
    padding: .85rem 1.5rem 0;
}
.post-topic-row .post-topic-badge {
    font-size: .78rem;
    padding: .25rem .75rem;
}

/* ---- Release Notes page ---- */
.rn-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}
.rn-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}
.rn-header h2 { margin: 0 0 .25rem; }
.rn-header p  { margin: 0; color: var(--gray-500); }
.rn-current-build {
    font-size: .78rem;
    color: var(--gray-400);
    white-space: nowrap;
    padding-top: .35rem;
}
.rn-current-build code {
    font-size: .78rem;
    background: var(--gray-100);
    padding: .1rem .4rem;
    border-radius: 4px;
    color: var(--gray-600);
}
.rn-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.rn-card-latest {
    border-color: var(--ocean);
    box-shadow: 0 0 0 2px rgba(37,99,235,.12);
}
.rn-card-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}
.rn-card-latest .rn-card-header {
    background: #eff6ff;
    border-bottom-color: rgba(37,99,235,.15);
}
.rn-version-wrap {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
}
.rn-version {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-800);
    font-family: monospace;
}
.rn-badge { display: inline-block; border-radius: 999px; font-size: .7rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: .18rem .6rem; }
.rn-badge-latest { background: var(--ocean); color: #fff; }
.rn-meta {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}
.rn-title { font-weight: 600; color: var(--gray-700); font-size: .95rem; }
.rn-date  { font-size: .78rem; color: var(--gray-400); }
.rn-change-list {
    list-style: none;
    margin: 0;
    padding: .5rem 0;
}
.rn-change {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    padding: .55rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    line-height: 1.45;
}
.rn-change:last-child { border-bottom: none; }
.rn-change-icon { font-size: .9rem; flex-shrink: 0; }
.rn-change-label {
    flex-shrink: 0;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .15rem .5rem;
    border-radius: 999px;
    white-space: nowrap;
}
.rn-label-feature     { background: #eff6ff; color: #1d4ed8; }
.rn-label-fix         { background: #fef3c7; color: #92400e; }
.rn-label-improvement { background: #f0fdf4; color: #15803d; }
.rn-label-security    { background: #fdf4ff; color: #7e22ce; }
.rn-change-desc { font-size: .875rem; color: var(--gray-700); }
@media (max-width: 600px) {
    .rn-header { flex-direction: column; }
    .rn-card-header { gap: .75rem; }
    .rn-change { padding: .55rem 1rem; }
}
