/* ==========================================================================
   My Swing Hub — Design System
   Tokens per design-system/myswinghub/MASTER.md
   Style: Dark Mode (OLED) + Glassmorphism | Typography: Classic Elegant
   ========================================================================== */

:root {
    /* Color */
    --bg: #0b0a0c;
    --bg-elevated: #121016;
    --bg-glass: rgba(26, 21, 32, 0.72);
    --gold: #d4af37;
    --gold-soft: #e8c877;
    --text: #f2ece3;
    --text-muted: #a99cae;
    --border: #2a2430;
    --danger: #dc2626;
    --success: #16a34a;

    /* Spacing */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    --space-3xl: 96px;

    /* Type */
    --font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Other */
    --radius: 10px;
    --radius-lg: 16px;
    --transition: 200ms ease-out;
    --container: 1140px;
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.02em;
    margin: 0 0 var(--space-md);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p { margin: 0 0 var(--space-md); }

a {
    color: var(--gold-soft);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover { color: var(--gold); }

/* Visible focus ring — never removed (a11y priority #1) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 4px;
}

img { max-width: 100%; height: auto; display: block; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --------------------------------------------------------------- Buttons */
/* Min 44x44px touch target (priority #2) */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    min-height: 44px;
    padding: 12px 28px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition),
                color var(--transition), transform var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-soft));
    color: #1a1420;
}

.btn-primary:hover {
    color: #1a1420;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--gold);
    color: var(--gold-soft);
}

.btn-block { width: 100%; }

/* ---------------------------------------------------------------- Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: var(--space-md);
}

.brand {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--gold);
    text-transform: uppercase;
}

.brand:hover { color: var(--gold-soft); }

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.site-nav a:not(.btn) {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
}

.site-nav a:not(.btn):hover { color: var(--text); }

.nav-links {
    display: none;
    gap: var(--space-lg);
}

@media (min-width: 900px) {
    .nav-links { display: flex; }
}

/* ------------------------------------------------------------------ Hero */

.hero {
    position: relative;
    text-align: center;
    padding: var(--space-3xl) 0;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: -40% 20% auto;
    height: 480px;
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.14), transparent 68%);
    pointer-events: none;
}

.hero > .container { position: relative; }

.eyebrow {
    display: inline-block;
    padding: 6px 16px;
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-elevated);
    color: var(--gold-soft);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero h1 { margin-bottom: var(--space-lg); }

.hero h1 em {
    font-style: italic;
    color: var(--gold);
}

.lead {
    max-width: 620px;
    margin: 0 auto var(--space-xl);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
}

.hero-note {
    margin-top: var(--space-lg);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* -------------------------------------------------------------- Sections */

.section { padding: var(--space-3xl) 0; }

.section-alt {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-head {
    max-width: 660px;
    margin: 0 auto var(--space-2xl);
    text-align: center;
}

.section-head p {
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ----------------------------------------------------------------- Cards */

.grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: 1fr;
}

@media (min-width: 700px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

.card {
    padding: var(--space-xl);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition), transform var(--transition);
}

.section-alt .card { background: var(--bg); }

.card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.card h3 { color: var(--text); }

.card p:last-child { margin-bottom: 0; }

.card p { color: var(--text-muted); font-size: 0.95rem; }

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--gold);
}

.card-icon svg { width: 22px; height: 22px; }

/* ----------------------------------------------------------- Steps (how) */

.step-num {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--gold);
    line-height: 1;
    margin-bottom: var(--space-sm);
}

/* ------------------------------------------------------------- Tiers */

.tier {
    display: flex;
    flex-direction: column;
    padding: var(--space-xl);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.tier-featured {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25);
}

.tier-badge {
    align-self: flex-start;
    padding: 4px 12px;
    margin-bottom: var(--space-md);
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.14);
    color: var(--gold-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tier-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: var(--space-xs);
}

.tier-price {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    color: var(--gold);
    line-height: 1.1;
    margin-bottom: var(--space-lg);
}

.tier-price span {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.tier-features {
    list-style: none;
    margin: 0 0 var(--space-xl);
    padding: 0;
    flex-grow: 1;
}

.tier-features li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    color: var(--text-muted);
    font-size: 0.93rem;
}

.tier-features svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    color: var(--gold);
}

/* ------------------------------------------------------------------ FAQ */

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    min-height: 44px;
    padding: var(--space-lg) 0;
    font-family: var(--font-heading);
    font-size: 1.08rem;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: "+";
    flex-shrink: 0;
    color: var(--gold);
    font-size: 1.5rem;
    font-family: var(--font-body);
    transition: transform var(--transition);
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item p {
    padding-bottom: var(--space-lg);
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ----------------------------------------------------------------- Forms */
/* Visible labels, inline errors (priority #8) */

.form-panel {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: var(--space-xl);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.field { margin-bottom: var(--space-lg); }

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88rem;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition);
}

.field textarea {
    resize: vertical;
    line-height: 1.5;
}

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--text-muted); }

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

.field-error {
    display: block;
    margin-top: 6px;
    color: var(--danger);
    font-size: 0.82rem;
}

.field-invalid input { border-color: var(--danger); }

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--gold);
}

.alert {
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    background: rgba(220, 38, 38, 0.1);
    color: #fca5a5;
    font-size: 0.9rem;
}

.alert-success {
    border-color: var(--success);
    background: rgba(22, 163, 74, 0.1);
    color: #86efac;
}

.form-footer {
    margin-top: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ------------------------------------------------------------- Age gate */

.gate-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-lg);
    background:
        radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.1), transparent 60%),
        var(--bg);
}

/* <main> is the flex child here — keep it transparent to the centering. */
.gate-body main {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.gate-card {
    width: 100%;
    max-width: 500px;
    padding: var(--space-2xl) var(--space-xl);
    background: var(--bg-glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.gate-card .brand {
    display: block;
    font-size: 2rem;
    margin-bottom: var(--space-xs);
}

.gate-tagline {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: var(--space-xl);
}

.gate-terms {
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(212, 175, 55, 0.05);
    text-align: left;
}

.gate-terms p {
    margin-bottom: var(--space-sm);
    font-size: 0.88rem;
    color: var(--text-muted);
}

.gate-terms ul {
    margin: 0;
    padding-left: var(--space-lg);
}

.gate-terms li {
    margin-bottom: 6px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.gate-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* ---------------------------------------------------------- Member area */

.page-head {
    padding: var(--space-2xl) 0 var(--space-xl);
    border-bottom: 1px solid var(--border);
}

.page-head p { color: var(--text-muted); margin-bottom: 0; }

.badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.12);
    color: #86efac;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-verified svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- Footer */

.site-footer {
    padding: var(--space-2xl) 0 var(--space-xl);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.88rem;
}

.footer-grid {
    display: grid;
    gap: var(--space-xl);
    grid-template-columns: 1fr;
    margin-bottom: var(--space-xl);
}

@media (min-width: 700px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-grid h4 {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: var(--space-md);
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li { margin-bottom: var(--space-xs); }

.footer-links a { color: var(--text-muted); }

.footer-links a:hover { color: var(--gold-soft); }

.footer-bottom {
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.82rem;
}

/* ----------------------------------------------------------- Legal pages */

.legal {
    max-width: 760px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg) var(--space-3xl);
}

.legal p, .legal li { color: var(--text-muted); }

.legal .notice {
    padding: var(--space-md);
    border-left: 3px solid var(--gold);
    background: var(--bg-elevated);
    color: var(--text);
}

/* Long-form legal text: generous rhythm, because these get read carefully
   by the few people who read them at all. */
.legal h2 {
    font-size: 1.25rem;
    margin: var(--space-xl) 0 var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.legal h3 {
    font-size: 1.02rem;
    margin: var(--space-lg) 0 var(--space-xs);
}

.legal p, .legal li { line-height: 1.75; }

.legal ul, .legal ol {
    margin: 0 0 var(--space-md);
    padding-left: 1.4em;
}

.legal li { margin-bottom: var(--space-xs); }

.legal strong { color: var(--text); }

/* ------------------------------------------------------------ Photo grids */

.photo-grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.photo-tile {
    margin: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.photo-tile img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--bg);
}

.photo-tile figcaption {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: var(--space-sm) var(--space-md) 0;
}

.photo-tag {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.14);
    color: var(--gold-soft);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.photo-tag-private {
    background: rgba(169, 156, 174, 0.16);
    color: var(--text-muted);
}

.photo-tag-primary {
    background: rgba(22, 163, 74, 0.16);
    color: #86efac;
}

.photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: var(--space-sm) var(--space-md) var(--space-md);
}

.btn-sm {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-danger:hover {
    border-color: var(--danger);
    color: #fca5a5;
}

/* Access list */

.access-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.access-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
}

.access-list li:last-child { border-bottom: none; }

.member-avatar {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: var(--space-md);
    background: var(--bg);
}

.member-avatar-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border);
    color: var(--text-muted);
}

.member-avatar-empty svg { width: 40px; height: 40px; }

/* ------------------------------------------------------------- Action row */

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.action-row .btn svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------ Safety panel */

/* Collapsed by default: blocking and reporting must be easy to reach but must
   not loom over an ordinary profile visit. */
.safety-panel {
    margin-top: var(--space-2xl);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
}

.safety-panel > summary {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: 44px;
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--text-muted);
    list-style: none;
}

.safety-panel > summary::-webkit-details-marker { display: none; }

.safety-panel > summary:hover { color: var(--text); }

.safety-panel > summary:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
    border-radius: var(--radius-lg);
}

.safety-panel > summary svg { width: 18px; height: 18px; flex-shrink: 0; }

.safety-body {
    padding: 0 var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--border);
    padding-top: var(--space-lg);
}

.safety-note {
    margin: 0 0 var(--space-md);
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 62ch;
}

.safety-rule {
    border: 0;
    border-top: 1px solid var(--border);
    margin: var(--space-lg) 0;
}

/* ---------------------------------------------------------- Message lists */

.thread-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.thread-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    min-height: 44px;
    padding: var(--space-lg);
    margin-bottom: var(--space-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: border-color var(--transition);
}

.thread-item:hover {
    border-color: rgba(212, 175, 55, 0.4);
    color: var(--text);
}

.thread-main { min-width: 0; }

.thread-name {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    margin-bottom: 2px;
}

.thread-preview {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thread-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.unread-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--gold);
    color: #1a1420;
    font-size: 0.74rem;
    font-weight: 700;
}

/* --------------------------------------------------------- Message thread */

.message-thread {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.message {
    max-width: 78%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.message p {
    margin: 0 0 4px;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.message time {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.message-mine {
    align-self: flex-end;
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.35);
}

.message-theirs {
    align-self: flex-start;
    background: var(--bg-elevated);
}

.message-form .field { margin-bottom: var(--space-sm); }

/* Nav unread indicator */

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--gold);
    color: #1a1420;
    font-size: 0.7rem;
    font-weight: 700;
}

/* --------------------------------------------------------- Reduced motion */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------- Unconfirmed email banner */

.verify-banner {
    background: rgba(212, 175, 55, 0.12);
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--gold-soft);
    font-size: 0.9rem;
    padding: var(--space-sm) 0;
    text-align: center;
}

.verify-banner a {
    color: var(--gold);
    text-decoration: underline;
}

/* ------------------------------------------------------ Danger controls */

.danger-zone {
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    background: rgba(220, 38, 38, 0.06);
    padding: var(--space-lg);
    margin-top: var(--space-xl);
}

.danger-zone h3 { color: #fca5a5; margin-top: 0; }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: 1px solid var(--danger);
}

.btn-danger:hover { background: #b91c1c; color: #fff; }

/* ------------------------------------------------ Photo moderation state */

.photo-pending {
    outline: 2px dashed var(--gold);
    outline-offset: -2px;
}

.photo-state {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-soft);
}

.photo-state.is-rejected {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
}

/* ==========================================================================
   Back office
   Intentionally plainer and denser than the member site — this is a work
   tool, not a place to linger.
   ========================================================================== */

.staff-body {
    background: #0d0d10;
    font-family: var(--font-body, Inter, system-ui, sans-serif);
}

.staff-header {
    background: #16161c;
    border-bottom: 2px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 20;
}

.staff-bar {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-sm) var(--space-lg);
}

.staff-brand {
    font-weight: 700;
    color: var(--gold);
    text-decoration: none;
    white-space: nowrap;
}

.staff-brand span {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
}

.staff-nav {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    flex: 1;
}

.staff-nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.staff-nav a:hover { color: var(--gold-soft); border-bottom-color: var(--gold); }

.staff-who {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.staff-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

.staff-footer {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg);
    color: var(--text-muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
}

.staff-panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.staff-panel h2 { margin-top: 0; font-size: 1.1rem; }

/* Centred card for sign-in, two-factor and first-run setup. */
.staff-card {
    max-width: 420px;
    margin: 8vh auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-xl);
}

.staff-card h1 { font-size: 1.4rem; margin-top: 0; }

/* Dense data table */
.staff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.staff-table th,
.staff-table td {
    text-align: left;
    padding: 10px var(--space-sm);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.staff-table th {
    color: var(--text-muted);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

.staff-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.table-scroll { overflow-x: auto; }

.pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.pill.is-ok { background: rgba(22, 163, 74, 0.15); color: #86efac; }
.pill.is-warn { background: rgba(212, 175, 55, 0.15); color: var(--gold-soft); }
.pill.is-bad { background: rgba(220, 38, 38, 0.15); color: #fca5a5; }
.pill.is-muted { background: rgba(255, 255, 255, 0.07); color: var(--text-muted); }

/* Permission tick-list */
.perm-group { margin-bottom: var(--space-lg); }
.perm-group h4 {
    margin: 0 0 var(--space-sm);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-soft);
}

.perm-item {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
    padding: 6px 0;
    font-size: 0.88rem;
}

.perm-item input { margin-top: 3px; accent-color: var(--gold); flex-shrink: 0; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md);
}

.stat .num { font-size: 1.9rem; font-weight: 700; color: var(--gold); line-height: 1.1; }
.stat .lbl { font-size: 0.76rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.totp-secret {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    word-break: break-all;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-sm);
    display: block;
    margin-bottom: var(--space-md);
}

/* The QR keeps its white quiet zone whatever the surrounding theme does —
   scanners need the contrast, and a dark card behind it breaks them. */
.totp-qr {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.totp-qr svg {
    width: 100%;
    max-width: 240px;
    height: auto;
    border-radius: var(--radius);
    /* Bridges the gap between the code and the card behind it. */
    box-shadow: 0 0 0 8px #fff;
    margin: 8px;
}

.totp-manual {
    margin-bottom: var(--space-md);
}

.totp-manual > summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.totp-manual > summary:hover {
    color: var(--gold);
}

/* Editing a legal document is a long sit-down job, so give it room and a
   monospaced face where the markup marks stay visible. */
.page-editor {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88rem;
    line-height: 1.65;
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md);
    resize: vertical;
    margin-bottom: var(--space-md);
}

.page-editor:focus {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

.review-notes {
    margin: 0;
    padding-left: 1.2em;
}

.review-notes li {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: var(--space-sm);
}

/* A standing, deliberately ugly reminder that a safety control is disabled. */
.staff-alarm {
    background: var(--danger);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 600;
    text-align: center;
    padding: var(--space-sm) var(--space-lg);
}

.staff-alarm code {
    background: rgba(0, 0, 0, 0.25);
    padding: 1px 5px;
    border-radius: 4px;
}
