/* ==========================================================================
   RishteyPk design system
   1. Tokens  2. Base  3. Layout & utilities  4. Components  5. Site chrome
   6. Pages   7. Member area  8. Legacy compatibility  9. Motion & print
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
    --brand: #d81a56;
    --brand-strong: #b0124a;
    --brand-ink: #8c0f3b;
    --brand-50: #fff3f7;
    --brand-100: #ffe1ea;
    --brand-200: #ffc2d4;
    --gold: #a87a1c;
    --gold-50: #fbf5e7;

    --ink-900: #1c1622;
    --ink-800: #2c2533;
    --ink-700: #433b4b;
    --ink-500: #6a6273;
    --ink-400: #8d8596;
    --ink-300: #bdb6c4;

    --surface: #ffffff;
    --surface-2: #faf7f9;
    --surface-3: #f3edf1;
    --line: #ebe3e9;
    --line-strong: #d9cfd6;

    --success: #0f7a55;
    --success-50: #e8f6ef;
    --warning: #a15c07;
    --warning-50: #fff5e5;
    --danger: #c42424;
    --danger-50: #fdeeee;
    --info: #1f57c3;
    --info-50: #edf3ff;

    --focus: 0 0 0 3px rgba(216, 26, 86, 0.35);
    --shadow-1: 0 1px 2px rgba(28, 22, 34, 0.05), 0 1px 3px rgba(28, 22, 34, 0.07);
    --shadow-2: 0 6px 20px rgba(28, 22, 34, 0.08);
    --shadow-3: 0 20px 48px rgba(28, 22, 34, 0.14);

    --r-sm: 8px;
    --r: 12px;
    --r-lg: 18px;
    --r-xl: 26px;
    --r-pill: 999px;

    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px;

    --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;

    --header-h: 68px;
    --container: 1200px;
    --gutter: 16px;

    /* Legacy variable names used by older views */
    --primary: var(--brand);
    --primary-hover: var(--brand-strong);
    --primary-rgb: 216, 26, 86;
    --secondary: #4f46e5;
    --dark: var(--ink-900);
    --light: var(--surface-2);
    --text-main: var(--ink-700);
    --text-muted: var(--ink-500);
    --bg-main: var(--surface-2);
    --white: var(--surface);
    --border: var(--line);
    --glass-bg: var(--surface);
    --glass-shadow: var(--shadow-1);
    --input-bg: var(--surface);
    --footer-bg: var(--surface);
    --footer-text: var(--ink-500);

    color-scheme: light;
}

:root[data-theme="dark"] {
    --brand: #ff5c8d;
    --brand-strong: #ff7aa2;
    --brand-ink: #ffb3c8;
    --brand-50: #2a1520;
    --brand-100: #3a1a29;
    --brand-200: #5a2440;
    --gold: #e0b45a;
    --gold-50: #2a2213;

    --ink-900: #f6f2f7;
    --ink-800: #e9e3eb;
    --ink-700: #d3cbd7;
    --ink-500: #a69dad;
    --ink-400: #8b8293;
    --ink-300: #5d5563;

    --surface: #1b1620;
    --surface-2: #131016;
    --surface-3: #241e2a;
    --line: #2f2836;
    --line-strong: #40374a;

    --success: #4cc69a;
    --success-50: #11281f;
    --warning: #f0b25a;
    --warning-50: #2c210f;
    --danger: #ff7b7b;
    --danger-50: #2e1515;
    --info: #86aaff;
    --info-50: #141d33;

    --focus: 0 0 0 3px rgba(255, 92, 141, 0.45);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-3: 0 24px 56px rgba(0, 0, 0, 0.55);
    --primary-rgb: 255, 92, 141;

    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --brand: #ff5c8d; --brand-strong: #ff7aa2; --brand-ink: #ffb3c8;
        --brand-50: #2a1520; --brand-100: #3a1a29; --brand-200: #5a2440;
        --gold: #e0b45a; --gold-50: #2a2213;
        --ink-900: #f6f2f7; --ink-800: #e9e3eb; --ink-700: #d3cbd7; --ink-500: #a69dad; --ink-400: #8b8293; --ink-300: #5d5563;
        --surface: #1b1620; --surface-2: #131016; --surface-3: #241e2a; --line: #2f2836; --line-strong: #40374a;
        --success: #4cc69a; --success-50: #11281f; --warning: #f0b25a; --warning-50: #2c210f;
        --danger: #ff7b7b; --danger-50: #2e1515; --info: #86aaff; --info-50: #141d33;
        --focus: 0 0 0 3px rgba(255, 92, 141, 0.45);
        --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.45); --shadow-3: 0 24px 56px rgba(0, 0, 0, 0.55);
        --primary-rgb: 255, 92, 141;
        color-scheme: dark;
    }
}

@media (min-width: 768px) { :root { --gutter: 24px; } }

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink-700);
    background: var(--surface-2);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body > main { flex: 1 0 auto; }
img, svg, video { max-width: 100%; height: auto; display: block; }
img { border-style: none; }
h1, h2, h3, h4, h5, h6 { color: var(--ink-900); line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-5) 0; }
ul, ol { padding-left: 1.25rem; }
::selection { background: var(--brand-100); color: var(--ink-900); }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }

/* 3. Layout & utilities ---------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: 760px; }
.container-wide { max-width: 1320px; }
.section { padding-block: clamp(40px, 6vw, 80px); }
.section-tight { padding-block: clamp(28px, 4vw, 48px); }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.stack > * + * { margin-top: var(--stack, var(--s-4)); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--gap, var(--s-3)); align-items: center; }
.between { justify-content: space-between; }
.grid { display: grid; gap: var(--gap, var(--s-5)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(var(--min, 240px), 1fr)); }
.grid-cards { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); } }
@media (min-width: 1080px) { .grid-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sr-only, .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ink-900); color: var(--surface); padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600; }
.skip-link:focus { top: 12px; color: var(--surface); }
.muted { color: var(--ink-500); }
.small { font-size: 0.875rem; }
.xsmall { font-size: 0.78rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin-bottom: var(--s-3); }
.section-head { max-width: 680px; margin: 0 auto var(--s-6); text-align: center; }
.section-head p { color: var(--ink-500); margin: 0; }
.section-head.left { margin-inline: 0; text-align: left; }
.section-head-row { display: flex; align-items: end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.section-head-row h2 { margin: 0; }

/* 4. Components ------------------------------------------------------------ */

/* Buttons */
.btn {
    --btn-bg: var(--surface); --btn-fg: var(--ink-900); --btn-bd: var(--line-strong);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 18px; border-radius: var(--r-pill);
    background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
    font-weight: 600; font-size: 0.95rem; line-height: 1.2; text-decoration: none; white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
    -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { text-decoration: none; color: var(--btn-fg); border-color: var(--ink-400); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .65; pointer-events: none; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; --btn-bd: var(--brand); box-shadow: 0 6px 16px rgba(var(--primary-rgb), .25); }
.btn-primary:hover { --btn-bg: var(--brand-strong); --btn-bd: var(--brand-strong); color: #fff; }
:root[data-theme="dark"] .btn-primary { --btn-fg: #1b0a12; }
.btn-soft { --btn-bg: var(--brand-50); --btn-fg: var(--brand-ink); --btn-bd: var(--brand-100); }
.btn-soft:hover { --btn-bg: var(--brand-100); border-color: var(--brand-200); }
.btn-outline { --btn-bg: transparent; --btn-fg: var(--brand); --btn-bd: var(--brand); }
.btn-outline:hover { --btn-bg: var(--brand-50); color: var(--brand-strong); border-color: var(--brand-strong); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--ink-700); }
.btn-ghost:hover { --btn-bg: var(--surface-3); border-color: transparent; }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: var(--danger); }
.btn-danger:hover { filter: brightness(.94); color: #fff; }
.btn-danger-soft { --btn-bg: var(--danger-50); --btn-fg: var(--danger); --btn-bd: transparent; }
.btn-success { --btn-bg: var(--success); --btn-fg: #fff; --btn-bd: var(--success); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { min-height: 52px; padding: 14px 26px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn .spinner { width: 16px; height: 16px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Forms */
.field { display: grid; gap: 6px; min-width: 0; }
.field + .field { margin-top: 0; }
.form-grid { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .span-2 { grid-column: 1 / -1; } }
.label, .field > label { font-weight: 600; font-size: 0.9rem; color: var(--ink-800); }
.label .req, .field > label .req { color: var(--brand); margin-left: 2px; }
.label .opt, .field > label .opt { font-weight: 500; color: var(--ink-400); font-size: 0.8rem; margin-left: 4px; }
.input, .select, .textarea,
.form-control {
    width: 100%; min-height: 46px; padding: 10px 14px;
    background: var(--surface); color: var(--ink-900);
    border: 1px solid var(--line-strong); border-radius: var(--r);
    font-size: 1rem; line-height: 1.4;
    transition: border-color .15s ease, box-shadow .15s ease;
    appearance: none;
}
.textarea, textarea.form-control { min-height: 120px; resize: vertical; }
.select, select.form-control {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236a6273' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
.input::placeholder, .textarea::placeholder, .form-control::placeholder { color: var(--ink-400); }
.input:hover, .select:hover, .textarea:hover, .form-control:hover { border-color: var(--ink-400); }
.input:focus, .select:focus, .textarea:focus, .form-control:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.hint { font-size: 0.82rem; color: var(--ink-500); margin: 0; }
.error-text { font-size: 0.85rem; color: var(--danger); margin: 0; display: flex; gap: 6px; align-items: center; }
.input-group { display: flex; align-items: stretch; }
.input-group > :first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 0 0 auto; width: auto; }
.input-group > :last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; flex: 1; min-width: 0; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 52px; }
.password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 38px; padding: 0 10px; border: 0; background: transparent; color: var(--ink-500); border-radius: var(--r-sm); font-size: 0.82rem; font-weight: 600; }
.password-toggle:hover { color: var(--brand); }
.choice-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); font-weight: 600; color: var(--ink-800); transition: .15s; text-align: center; }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand); }
.choice input:focus-visible + span { box-shadow: var(--focus); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 700; color: var(--ink-900); margin-bottom: var(--s-3); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card-body { padding: var(--s-5); }
.card-pad { padding: var(--s-5); }
@media (min-width: 768px) { .card-pad-lg { padding: var(--s-6); } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.05rem; }
.card-link { display: block; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card-link:hover { text-decoration: none; color: inherit; border-color: var(--brand-200); box-shadow: var(--shadow-2); transform: translateY(-2px); }

/* Badges & chips */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 0.75rem; font-weight: 700; line-height: 1.5; background: var(--surface-3); color: var(--ink-700); white-space: nowrap; }
.badge-brand { background: var(--brand-50); color: var(--brand-ink); }
.badge-gold { background: var(--gold-50); color: var(--gold); }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-info { background: var(--info-50); color: var(--info); }
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--brand); color: #fff; font-size: 0.7rem; font-weight: 800; line-height: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); color: var(--ink-700); font-size: 0.88rem; font-weight: 500; }
.chip:hover { border-color: var(--brand-200); color: var(--brand); text-decoration: none; }
.chip[aria-current], .chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .n { color: var(--ink-400); font-size: 0.8rem; }
.chip[aria-current] .n { color: rgba(255,255,255,.8); }

/* Alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r); border: 1px solid transparent; font-size: 0.95rem; }
.alert > i { margin-top: 3px; }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert-success { background: var(--success-50); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-error, .alert-danger { background: var(--danger-50); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warning { background: var(--warning-50); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-info { background: var(--info-50); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.flash-stack { display: grid; gap: var(--s-2); margin-bottom: var(--s-4); }

/* Toasts (JS feedback for background actions) */
.toast-region { position: fixed; z-index: 2000; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
@media (max-width: 767px) { body.has-tabbar .toast-region { bottom: calc(80px + env(safe-area-inset-bottom)); } }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r); background: var(--ink-900); color: var(--surface); box-shadow: var(--shadow-3); font-size: 0.93rem; font-weight: 500; animation: toast-in .2s ease-out; }
.toast-success i { color: #5fd3a4; } .toast-error i { color: #ff8f8f; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; font-size: 1.1rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Breadcrumbs */
.breadcrumbs { font-size: 0.85rem; color: var(--ink-500); margin-bottom: var(--s-4); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--ink-300); }
.breadcrumbs a { color: var(--ink-500); }
.breadcrumbs [aria-current] { color: var(--ink-800); font-weight: 600; }

/* Pagination */
.pager { display: flex; justify-content: center; gap: var(--s-3); margin-top: var(--s-6); flex-wrap: wrap; align-items: center; }
.pager .muted { font-size: 0.9rem; }

/* Empty state */
.empty { text-align: center; padding: var(--s-7) var(--s-5); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.empty .empty-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto var(--s-4); border-radius: 50%; background: var(--brand-50); color: var(--brand); font-size: 1.4rem; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--ink-500); max-width: 420px; margin: 0 auto var(--s-4); }

/* Spinner & skeleton */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500); background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }

/* Dialog / modal */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-xl); width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 48px); background: var(--surface); color: var(--ink-700); box-shadow: var(--shadow-3); }
dialog.modal::backdrop { background: rgba(20, 12, 18, 0.55); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: var(--s-5); }
.modal-foot { display: flex; gap: var(--s-3); justify-content: flex-end; padding: var(--s-4) var(--s-5); border-top: 1px solid var(--line); flex-wrap: wrap; }

/* Progress */
.progress { height: 8px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #f0729a); border-radius: inherit; transition: width .4s ease; }
.ring { --p: 0; --size: 96px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring::before { content: ""; grid-area: 1 / 1; width: calc(var(--size) - 16px); height: calc(var(--size) - 16px); border-radius: 50%; background: var(--surface); }
.ring strong { grid-area: 1 / 1; position: relative; font-size: 1.35rem; color: var(--ink-900); }

/* Avatar */
.avatar { width: var(--size, 40px); height: var(--size, 40px); border-radius: 50%; object-fit: cover; background: var(--surface-3); flex-shrink: 0; }
.avatar-lg { --size: 72px; }
.is-blurred { filter: blur(14px); transform: scale(1.08); }

/* FAQ */
.faq { display: grid; gap: var(--s-3); max-width: 820px; margin-inline: auto; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--ink-900); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--brand); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 20px 18px; color: var(--ink-700); }

/* Prose (blog & CMS content) */
.prose { color: var(--ink-700); font-size: 1.05rem; line-height: 1.8; max-width: 72ch; }
.prose h2 { font-size: 1.5rem; margin: 2em 0 .6em; }
.prose h3 { font-size: 1.2rem; margin: 1.6em 0 .5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }
.prose img { border-radius: var(--r); margin: 1.5em 0; }
.prose blockquote { margin: 1.5em 0; padding: 1em 1.25em; border-left: 4px solid var(--brand); background: var(--brand-50); border-radius: 0 var(--r) var(--r) 0; color: var(--ink-800); }
.prose a { text-decoration: underline; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }

/* 5. Site chrome ----------------------------------------------------------- */
.topbar { display: none; background: #26101c; color: #d9cbd3; font-size: .8rem; }
@media (min-width: 960px) { .topbar { display: block; } }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 34px; }
.topbar p { margin: 0; display: flex; align-items: center; gap: 8px; }
.topbar p i { color: #ff7aa2; }
.topbar p span { color: #c9a24b; }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar a, .topbar .link-btn { color: #d9cbd3; font-weight: 600; font-size: .8rem; }
.topbar a:hover, .topbar .link-btn:hover { color: #fff; text-decoration: none; }
.topbar i { margin-right: 4px; }
.site-header { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(170%) blur(16px); -webkit-backdrop-filter: saturate(170%) blur(16px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s, background-color .2s; }
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 8px 24px -18px rgba(40, 10, 25, .35); }
.site-header .bar { height: var(--header-h); display: flex; align-items: center; gap: var(--s-5); transition: height .2s; }
@media (min-width: 960px) { :root { --header-h: 76px; } .site-header.is-scrolled .bar { height: 64px; } }
/* Header blended into the page hero at the very top; separates on scroll. */
body.hdr-blend .site-header:not(.is-scrolled) { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom-color: transparent; box-shadow: none; }
body.hdr-blend .site-header.is-scrolled { background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 10px 30px -18px rgba(40, 10, 25, .45); }
body.hdr-blend .site-header { position: fixed; left: 0; right: 0; }
/* The hero grows by the header height; its background paints under the header. */
body.hdr-blend #main > :is(.h-hero, .c-hero, .l-hero, .b-hero, .p-hero):first-child { border-top: var(--header-h) solid transparent; background-origin: border-box; }
@media (min-width: 960px) { body.hdr-blend .site-header .bar { height: 88px; } body.hdr-blend { --header-h: 88px; } body.hdr-blend .site-header.is-scrolled .bar { height: 68px; } }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-900); font-weight: 800; font-size: 1.2rem; flex-shrink: 0; }
.brand:hover { text-decoration: none; color: var(--ink-900); }
.brand img { height: 36px; width: auto; transition: height .2s; }
.site-header.is-scrolled .brand img { height: 32px; }
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand .logo-light { display: none; } :root:not([data-theme="light"]) .brand .logo-dark { display: block; } }
.main-nav { display: none; gap: 6px; margin-left: 12px; }
.main-nav a { position: relative; padding: 10px 14px; color: var(--ink-700); font-weight: 600; font-size: .96rem; border-radius: 10px; }
.main-nav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px; background: #c9a24b; transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.main-nav a:hover { color: var(--ink-900); text-decoration: none; }
.main-nav a:hover::after { transform: scaleX(1); }
.main-nav a[aria-current] { color: var(--brand); }
.main-nav a[aria-current]::after { transform: scaleX(1); background: var(--brand); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.hdr-icon { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-700); }
.hdr-icon:hover { background: var(--surface-3); color: var(--ink-900); text-decoration: none; }
.hdr-icon .count-badge { position: absolute; top: 2px; right: 0; box-shadow: 0 0 0 2px var(--surface); }
.hdr-login { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-pill); color: var(--ink-800); font-weight: 600; font-size: .93rem; }
.hdr-login:hover { background: var(--surface-3); text-decoration: none; color: var(--ink-900); }
.hdr-join { padding-inline: 18px; }
.theme-toggle .when-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .when-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle .when-light { display: none; }
.menu-toggle { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink-800); }
.desktop-only { display: none !important; }
@media (min-width: 960px) {
    .main-nav { display: flex; }
    .menu-toggle { display: none; }
    .desktop-only { display: inline-flex !important; }
}
@media (min-width: 960px) and (max-width: 1100px) { .main-nav a { padding: 10px 10px; } .main-nav a::after { left: 10px; right: 10px; } }

/* User menu (details/summary: works without JS) */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--ink-800); }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary .avatar { --size: 32px; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 8px; z-index: 50; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r-sm); color: var(--ink-700); font-weight: 500; background: none; border: 0; text-align: left; font-size: 0.93rem; }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--ink-900); text-decoration: none; }
.menu a i, .menu button i { width: 18px; color: var(--ink-400); }
.menu hr { margin: 6px 0; }
.menu .menu-head { padding: 8px 12px 10px; }
.menu .menu-head strong { display: block; color: var(--ink-900); }

/* Mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 300; display: none; }
.drawer.is-open { display: block; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(20, 12, 18, 0.5); animation: fade .2s; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); background: var(--surface); box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: slide-in .22s ease-out; overflow-y: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer nav { padding: 8px; display: grid; gap: 2px; }
.drawer nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); color: var(--ink-800); font-weight: 600; }
.drawer nav a i { width: 20px; color: var(--ink-400); text-align: center; }
.drawer nav a:hover, .drawer nav a[aria-current] { background: var(--brand-50); color: var(--brand-ink); text-decoration: none; }
.drawer nav a[aria-current] i { color: var(--brand); }
.drawer .drawer-label { padding: 14px 14px 4px; font-size: 0.72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-400); }
.drawer-foot { margin-top: auto; padding: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes fade { from { opacity: 0; } }
body.drawer-open { overflow: hidden; }

/* Bottom tab bar (mobile) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; color: var(--ink-500); font-size: 0.7rem; font-weight: 600; }
.tabbar a i { font-size: 1.2rem; }
.tabbar a:hover { text-decoration: none; color: var(--ink-900); }
.tabbar a[aria-current] { color: var(--brand); }
.tabbar .count-badge { position: absolute; top: 6px; left: calc(50% + 6px); }
body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
@media (min-width: 960px) { .tabbar { display: none; } body.has-tabbar { padding-bottom: 0; } }

/* Impersonation banner */
.impersonation { background: var(--ink-900); color: var(--surface); font-size: 0.9rem; }
.impersonation .container { display: flex; gap: 12px; align-items: center; justify-content: center; padding-block: 8px; flex-wrap: wrap; }
.impersonation a { color: var(--surface); font-weight: 700; text-decoration: underline; }

/* Footer */
.site-footer { position: relative; margin-top: auto; padding-top: 64px; color: #cbbcc5; font-size: .93rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23c9a24b' stroke-opacity='.08' stroke-width='1'%3E%3Cpath d='M28 4l24 24-24 24L4 28z'/%3E%3Ccircle cx='28' cy='28' r='9'/%3E%3Cpath d='M0 0l56 56M56 0L0 56'/%3E%3C/g%3E%3C/svg%3E"),
        radial-gradient(900px 300px at 50% 0%, #4a1630, transparent 70%), #1f0d17; }
.footer-arch { position: absolute; top: -28px; left: 50%; transform: translateX(-50%); width: 120px; height: 56px; border-radius: 120px 120px 0 0; background: #1f0d17; border: 1.5px solid rgba(201, 162, 75, .6); border-bottom: 0; display: grid; place-items: center; }
.footer-arch span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #c9a24b; color: #2a1220; margin-top: 10px; }
.footer-cta { display: grid; gap: 18px; align-items: center; padding: 26px 28px; margin-bottom: 48px; border-radius: 24px; background: rgba(255,255,255,.04); border: 1px solid rgba(201, 162, 75, .35); }
@media (min-width: 860px) { .footer-cta { grid-template-columns: 1fr auto; } }
.footer-kicker { margin: 0 0 6px; font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #c9a24b; }
.site-footer .footer-cta h2 { margin: 0; color: #fff; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); text-transform: none; letter-spacing: -0.01em; }
.footer-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-btn-gold { --btn-bg: #c9a24b; --btn-fg: #2a1220; --btn-bd: #c9a24b; }
.footer-btn-gold:hover { --btn-bg: #d8b45f; --btn-bd: #d8b45f; color: #2a1220; }
.footer-btn-ghost { --btn-bg: transparent; --btn-fg: #f0e6eb; --btn-bd: rgba(255,255,255,.25); }
.footer-btn-ghost:hover { --btn-bg: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.4); }
.footer-grid { display: grid; gap: 32px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-brand { grid-column: 1 / -1; }
@media (min-width: 1000px) { .footer-brand { grid-column: auto; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px; } }
.footer-brand .brand img { height: 38px; }
.footer-brand p { margin: 14px 0 18px; color: #b5a5ae; max-width: 380px; line-height: 1.7; }
.footer-brand-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.site-footer h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: #c9a24b; margin: 6px 0 16px; font-family: var(--font-sans); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer ul a { color: #cbbcc5; position: relative; transition: color .15s, padding .15s; }
.site-footer ul a:hover { color: #fff; text-decoration: none; padding-left: 4px; }
.footer-more { color: #ff9fbd !important; font-weight: 600; }
.footer-more i { font-size: .75rem; margin-left: 4px; }
.social { display: flex; gap: 8px; }
.social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #f0e6eb; }
.social a:hover { background: #c9a24b; border-color: #c9a24b; color: #2a1220; text-decoration: none; }
.footer-bottom { margin-top: 48px; padding-block: 20px; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; font-size: .85rem; color: #a8979f; }
.footer-made i { color: #ff7aa2; margin-right: 4px; }
.footer-top { color: #cbbcc5; font-weight: 600; }
.footer-top:hover { color: #fff; text-decoration: none; }
.footer-top i { margin-right: 4px; }
body.has-tabbar .site-footer { padding-bottom: 0; }

/* 6. Pages ----------------------------------------------------------------- */

/* Hero */
.hero { position: relative; isolation: isolate; color: #fff; background: #2b0f1c; overflow: hidden; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, center); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(30, 8, 18, 0.55) 0%, rgba(30, 8, 18, 0.72) 55%, rgba(30, 8, 18, 0.88) 100%); }
.hero.no-media { background: radial-gradient(1200px 500px at 15% -10%, #e2306d 0%, transparent 60%), radial-gradient(900px 500px at 100% 0%, #7a1440 0%, transparent 60%), #3a0f22; }
.hero-inner { padding-block: clamp(48px, 9vw, 120px) clamp(40px, 7vw, 96px); max-width: 860px; }
.hero h1 { color: #fff; font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 1.3rem + 3.6vw, 3.6rem); letter-spacing: -0.02em; margin-bottom: var(--s-4); }
.hero p.lead { font-size: clamp(1rem, .95rem + .4vw, 1.2rem); color: rgba(255,255,255,.88); max-width: 620px; margin-bottom: var(--s-6); }
.hero .eyebrow { color: #ffc7d8; }
.hero-proof { display: flex; flex-wrap: wrap; gap: var(--s-5); margin-top: var(--s-5); color: rgba(255,255,255,.85); font-size: 0.92rem; }
.hero-proof strong { color: #fff; font-size: 1.15rem; display: block; }

.search-panel { background: var(--surface); color: var(--ink-700); border-radius: var(--r-xl); padding: var(--s-4); box-shadow: var(--shadow-3); }
.search-panel form { display: grid; gap: var(--s-3); grid-template-columns: 1fr 1fr; }
.search-panel .field label, .search-panel .field .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }
.search-panel .span-all { grid-column: 1 / -1; }
.age-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.age-pair span { color: var(--ink-400); font-size: .85rem; }
@media (min-width: 900px) {
    .search-panel { padding: var(--s-4) var(--s-4) var(--s-4) var(--s-5); }
    .search-panel form { grid-template-columns: 1.1fr 1.2fr 1.4fr auto; align-items: end; }
    .search-panel .span-all { grid-column: auto; }
}

/* Stats strip */
.stats-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
@media (min-width: 768px) { .stats-strip { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); }
.stat strong { display: block; font-size: 1.6rem; color: var(--ink-900); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-500); font-size: .88rem; }

/* Steps / features */
.steps { display: grid; gap: var(--s-4); counter-reset: step; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s-5); } }
.step-card { position: relative; padding: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.step-card::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-weight: 800; margin-bottom: var(--s-3); }
.step-card h3 { margin-bottom: 6px; }
.step-card p { margin: 0; color: var(--ink-500); font-size: .95rem; }
.feature-grid { display: grid; gap: var(--s-4); }
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .feature-grid { grid-template-columns: repeat(4, 1fr); } }
.feature { padding: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.feature .ic { width: 44px; height: 44px; border-radius: var(--r); display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-size: 1.15rem; margin-bottom: var(--s-3); }
.feature h3 { font-size: 1.02rem; margin-bottom: 6px; }
.feature p { color: var(--ink-500); font-size: .92rem; margin: 0; }

/* Browse tiles */
.tile-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: flex; align-items: center; gap: var(--s-3); padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink-800); font-weight: 600; min-width: 0; }
.tile:hover { text-decoration: none; color: var(--ink-900); border-color: var(--brand-200); box-shadow: var(--shadow-2); }
.tile img, .tile .ic { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.tile span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile small { display: block; color: var(--ink-500); font-weight: 500; font-size: .8rem; }

/* CTA band */
.cta-band { border-radius: var(--r-xl); padding: clamp(28px, 5vw, 56px); background: linear-gradient(135deg, #8c0f3b, var(--brand) 60%, #f0729a); color: #fff; display: grid; gap: var(--s-4); align-items: center; }
@media (min-width: 860px) { .cta-band { grid-template-columns: 1fr auto; } }
.cta-band h2 { color: #fff; margin-bottom: 6px; font-family: var(--font-display); font-weight: 600; }
.cta-band p { margin: 0; color: rgba(255,255,255,.88); }
.cta-band .btn { --btn-bg: #fff; --btn-fg: var(--brand-ink); --btn-bd: #fff; }
:root[data-theme="dark"] .cta-band .btn { --btn-fg: #8c0f3b; }

/* Profile card — arched "mehrab" card */
.pcard { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 999px 999px 22px 22px; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.pcard:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -18px rgba(80, 10, 40, .35); border-color: var(--brand-200); }
.pcard.is-featured { border: 1.5px solid #c9a24b; box-shadow: 0 0 0 3px rgba(201, 162, 75, .14); }
.pcard-media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface-3); border-radius: 999px 999px 0 0; margin: 6px 6px 0; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.pcard:hover .pcard-media img { transform: scale(1.04); }
.pcard-media .is-blurred { filter: blur(16px); transform: scale(1.1); }
.pcard-media::after { content: ""; position: absolute; inset: 62% 0 0; background: linear-gradient(180deg, rgba(24, 8, 16, 0), rgba(24, 8, 16, .5) 45%, rgba(24, 8, 16, .78)); pointer-events: none; }
.pcard-role { position: absolute; z-index: 2; top: 14%; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.94); color: #2c2533; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; box-shadow: var(--shadow-1); white-space: nowrap; }
.pcard.is-featured .pcard-role { background: #c9a24b; color: #2a1220; }
.pcard-lock { position: absolute; z-index: 2; top: 42%; left: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.9); color: var(--brand); }
.pcard-over { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 14px 14px 12px; color: #fff; }
.pcard-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.22rem; line-height: 1.15; color: #fff; display: flex; align-items: center; gap: 8px; min-width: 0; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.pcard-title a { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pcard-title a:hover { text-decoration: none; }
.pcard-title .age { flex-shrink: 0; font-family: var(--font-sans); font-weight: 700; font-size: .74rem; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.22); backdrop-filter: blur(4px); text-shadow: none; }
.pcard-city { margin: 3px 0 0; font-size: .84rem; color: rgba(255,255,255,.92); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.pcard-city i { color: #f6a6bf; margin-right: 3px; }
.pcard-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 12px 14px 12px; }
.pcard-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pcard-tags li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .78rem; font-weight: 600; color: var(--ink-700); }
.pcard-tags li i { color: var(--brand); font-size: .72rem; flex-shrink: 0; }
.pcard-tags li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-ms { margin: 0; font-size: .8rem; color: var(--ink-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-foot { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard-link { font-size: .84rem; font-weight: 700; color: var(--brand); display: inline-flex; align-items: center; gap: 6px; transition: gap .2s; }
.pcard-link i { font-size: .75rem; }
.pcard:hover .pcard-link { gap: 10px; }
.pcard-save { position: relative; z-index: 2; width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--brand); display: grid; place-items: center; transition: background-color .15s, color .15s, border-color .15s; }
.pcard-save:hover { background: var(--brand-50); border-color: var(--brand-200); }
.pcard-save[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 479px) {
    .pcard-media { margin: 4px 4px 0; }
    .pcard-over { padding: 10px 10px 9px; }
    .pcard-title { font-size: 1.05rem; }
    .pcard-title .age { font-size: .66rem; padding: 1px 6px; }
    .pcard-role { font-size: .64rem; padding: 3px 9px; top: 12%; }
    .pcard-body { padding: 10px 10px 10px; gap: 6px; }
    .pcard-tags li:nth-child(n+2) { display: none; }
    .pcard-link { font-size: 0; gap: 0; }
    .pcard-link::before { content: "View"; font-size: .8rem; margin-right: 6px; }
    .pcard-save { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) { .pcard, .pcard-media img { transition: none; } .pcard:hover { transform: none; } }

/* Listing page header */
.page-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: var(--s-6) var(--s-5); }
.page-hero h1 { margin-bottom: 6px; }
.page-hero p { color: var(--ink-500); margin: 0; max-width: 680px; }
.page-hero .with-image { display: flex; gap: var(--s-4); align-items: center; }
.page-hero .with-image img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--brand-100); }
.page-arch { flex-shrink: 0; display: grid; place-items: center; width: 64px; height: 78px; border-radius: 999px 999px 12px 12px; background: linear-gradient(160deg, var(--brand-50), var(--brand-100)); border: 1.5px solid #c9a24b; font-family: var(--font-display); font-weight: 600; font-size: 2rem; color: var(--brand); padding-top: 8px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: var(--s-5) 0; }

/* Profile detail */
.profile-layout { display: grid; gap: var(--s-5); padding-block: var(--s-5) var(--s-7); }
@media (min-width: 960px) { .profile-layout { grid-template-columns: 340px minmax(0, 1fr); align-items: start; } .profile-aside { position: sticky; top: calc(var(--header-h) + 16px); } }
.profile-aside .card { overflow: hidden; }
.profile-photo { position: relative; aspect-ratio: 1 / 1; background: var(--surface-3); overflow: hidden; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo button { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.profile-photo .privacy-note { position: absolute; inset: auto 12px 12px; background: rgba(28,22,34,.78); color: #fff; padding: 8px 12px; border-radius: var(--r); font-size: .82rem; text-align: center; }
.profile-id { padding: var(--s-5); }
.profile-id h1 { font-size: 1.5rem; margin-bottom: 4px; }
.profile-id .sub { color: var(--ink-500); margin-bottom: var(--s-4); }
.key-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s-4); }
.profile-actions { display: grid; gap: 10px; }
.profile-actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-section { padding: var(--s-5); }
.detail-section + .detail-section { border-top: 1px solid var(--line); }
.detail-section h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-4); }
.detail-section h2 i { color: var(--brand); width: 20px; text-align: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 2px var(--s-5); margin: 0; }
.facts div { padding: 10px 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.facts dt { font-size: .78rem; color: var(--ink-500); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 2px 0 0; color: var(--ink-900); font-weight: 600; overflow-wrap: anywhere; }
.about-text { white-space: pre-line; color: var(--ink-700); line-height: 1.75; margin: 0; }
.notice-box { padding: var(--s-4); background: var(--surface-2); border-radius: var(--r); color: var(--ink-700); font-size: .93rem; }

/* Blog */
.blog-grid { display: grid; gap: var(--s-5); }
@media (min-width: 640px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }
.bcard { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.bcard:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -22px rgba(80, 10, 40, .4); border-color: var(--brand-100); }
.bcard-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, var(--brand-50), var(--gold-50)); margin: 8px 8px 0; border-radius: 18px; }
.bcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.bcard:hover .bcard-media img { transform: scale(1.05); }
.bcard-fallback { display: grid; place-items: center; width: 100%; height: 100%; font-size: 2rem; color: var(--brand); }
.bcard-date { position: absolute; top: 10px; left: 10px; display: grid; place-items: center; min-width: 50px; padding: 6px 8px 7px; border-radius: 14px; background: rgba(255,255,255,.95); color: #6a6273; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1.1; box-shadow: var(--shadow-1); }
.bcard-date strong { display: block; font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0; color: #b0124a; }
.bcard-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 16px 20px 18px; }
.bcard-topic { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.bcard-topic span { color: var(--ink-400); font-weight: 600; letter-spacing: .02em; text-transform: none; font-size: .8rem; }
.bcard-topic span i { margin-right: 3px; }
.bcard h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; line-height: 1.28; letter-spacing: -0.005em; }
.bcard h3 a { color: var(--ink-900); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: color .15s; }
.bcard h3 a::after { content: ""; position: absolute; inset: 0; }
.bcard:hover h3 a { color: var(--brand); }
.bcard-excerpt { margin: 0; color: var(--ink-500); font-size: .92rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bcard-more { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; align-items: center; justify-content: space-between; font-size: .88rem; font-weight: 700; color: var(--ink-800); }
.bcard-arrow { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-size: .8rem; transition: background-color .2s, color .2s, transform .2s; }
.bcard:hover .bcard-arrow { background: var(--brand); color: #fff; transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .bcard, .bcard-media img, .bcard-arrow { transition: none; } .bcard:hover { transform: none; } }
.article-head { max-width: 820px; margin-inline: auto; padding-top: var(--s-6); }
.article-head h1 { font-family: var(--font-display); font-weight: 600; }
.article-meta { display: flex; flex-wrap: wrap; gap: var(--s-4); color: var(--ink-500); font-size: .9rem; margin-bottom: var(--s-5); }
.article-cover { max-width: 1000px; margin: 0 auto var(--s-6); border-radius: var(--r-xl); overflow: hidden; aspect-ratio: 16 / 8; background: var(--surface-3); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-body { max-width: 760px; margin-inline: auto; }

/* Auth (login, sign-up, verification) — header-less split screen */
.auth-body { background: var(--surface-2); }
.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; }
@media (min-width: 1000px) { .auth-shell { grid-template-columns: minmax(420px, 46%) 1fr; } }

.auth-main { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding: 0 var(--gutter) 32px; }
.auth-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; }
.auth-logo img { height: 32px; width: auto; }
.auth-logo .logo-dark { display: none; }
:root[data-theme="dark"] .auth-logo .logo-light { display: none; }
:root[data-theme="dark"] .auth-logo .logo-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-logo .logo-light { display: none; } :root:not([data-theme="light"]) .auth-logo .logo-dark { display: block; } }
@media (min-width: 1000px) { .auth-shell .auth-logo { visibility: hidden; } .auth-topbar { padding: 24px 16px 0; } }
.auth-topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.auth-back { font-weight: 600; }
.auth-back i { font-size: .8rem; }
.auth-card { width: 100%; max-width: 460px; margin: auto; padding: 8px 0; }
@media (min-width: 560px) { .auth-card { padding: 34px 36px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 60px -32px rgba(80, 10, 40, .35); } }
.auth-card h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 1.4rem + 1vw, 2.1rem); letter-spacing: -0.01em; margin-bottom: 6px; }
.auth-card .lede { color: var(--ink-500); margin-bottom: var(--s-5); }
.auth-card form { display: grid; gap: var(--s-4); }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; gap: 4px; margin-bottom: 24px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.auth-switch a { text-align: center; padding: 10px 12px; border-radius: 999px; font-weight: 700; font-size: .93rem; color: var(--ink-500); }
.auth-switch a:hover { color: var(--ink-900); text-decoration: none; }
.auth-switch a[aria-current] { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-1); }
.auth-alt { text-align: center; color: var(--ink-500); margin-top: var(--s-5); font-size: .95rem; }
.auth-solo { min-height: 100vh; display: flex; flex-direction: column; padding: 0 var(--gutter); }
.auth-solo .auth-topbar { padding-inline: 0; }
.auth-solo .auth-logo { visibility: visible !important; }
.auth-solo .auth-main { min-height: 0; flex: 1; padding: 0; }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 1.5rem !important; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 7. Member area ----------------------------------------------------------- */
.member-shell { padding-block: var(--s-5) var(--s-7); }
.member-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); justify-content: space-between; margin-bottom: var(--s-5); }
.member-head h1 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); margin: 0; }
.member-head p { margin: 4px 0 0; color: var(--ink-500); }
.member-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: var(--s-5); padding-bottom: 2px; }
.member-nav::-webkit-scrollbar { display: none; }
.member-nav a { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); color: var(--ink-700); font-weight: 600; font-size: .9rem; }
.member-nav a:hover { text-decoration: none; border-color: var(--brand-200); color: var(--ink-900); }
.member-nav a[aria-current] { background: var(--ink-900); border-color: var(--ink-900); color: var(--surface); }
.member-nav .count-badge { margin-left: 2px; }
.dash-grid { display: grid; gap: var(--s-5); }
@media (min-width: 1000px) { .dash-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
@media (min-width: 640px) { .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-tile { display: block; padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: inherit; }
.stat-tile:hover { text-decoration: none; color: inherit; border-color: var(--brand-200); }
.stat-tile .v { font-size: 1.6rem; font-weight: 800; color: var(--ink-900); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-tile .l { font-size: .85rem; color: var(--ink-500); margin-top: 4px; }
.stat-tile .ic { color: var(--brand); margin-bottom: 8px; }
.completion { display: flex; gap: var(--s-5); align-items: center; }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.todo-list a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r); color: var(--ink-800); }
.todo-list a:hover { background: var(--surface-2); text-decoration: none; }
.todo-list .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px dashed var(--line-strong); flex-shrink: 0; display: grid; place-items: center; color: var(--ink-400); font-size: .75rem; }
.todo-list .is-done .dot { border: 0; background: var(--success-50); color: var(--success); }
.todo-list .is-done span.t { color: var(--ink-400); text-decoration: line-through; }
.todo-list small { display: block; color: var(--ink-500); font-size: .8rem; }
.todo-list .go { margin-left: auto; color: var(--ink-300); }
.list-rows { list-style: none; margin: 0; padding: 0; }
.list-rows > li { display: flex; align-items: center; gap: var(--s-3); padding: 12px var(--s-5); border-bottom: 1px solid var(--line); }
.list-rows > li:last-child { border-bottom: 0; }
.list-rows .grow { flex: 1; min-width: 0; }
.list-rows .grow strong, .list-rows .grow a.name { display: block; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-rows .grow small { color: var(--ink-500); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Profile editor */
.editor { display: grid; gap: var(--s-5); }
@media (min-width: 1000px) { .editor { grid-template-columns: 260px minmax(0, 1fr); align-items: start; } .editor-nav { position: sticky; top: calc(var(--header-h) + 16px); } }
.editor-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.editor-nav::-webkit-scrollbar { display: none; }
@media (min-width: 1000px) { .editor-nav { flex-direction: column; overflow: visible; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; } }
.editor-nav a { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r); color: var(--ink-700); font-weight: 600; font-size: .92rem; background: var(--surface); border: 1px solid var(--line); }
@media (min-width: 1000px) { .editor-nav a { border: 0; background: transparent; } }
.editor-nav a i.s { width: 18px; text-align: center; color: var(--ink-400); }
.editor-nav a .state { margin-left: auto; font-size: .8rem; color: var(--success); }
.editor-nav a:hover { text-decoration: none; background: var(--surface-2); color: var(--ink-900); }
.editor-nav a[aria-current] { background: var(--brand-50); color: var(--brand-ink); border-color: var(--brand-100); }
.editor-nav a[aria-current] i.s { color: var(--brand); }
.editor-panel .card-head p { margin: 2px 0 0; color: var(--ink-500); font-size: .9rem; }
.form-section + .form-section { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.form-section h3 { font-size: 1rem; margin-bottom: var(--s-4); }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: flex-end; padding: var(--s-4) var(--s-5); border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.photo-picker { display: grid; gap: var(--s-5); }
@media (min-width: 720px) { .photo-picker { grid-template-columns: 220px 1fr; align-items: start; } }
.photo-current { aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); }
.photo-current img { width: 100%; height: 100%; object-fit: cover; }
.dropzone { display: grid; place-items: center; text-align: center; gap: 6px; padding: var(--s-5); border: 2px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface-2); cursor: pointer; transition: .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-50); }
.dropzone i { font-size: 1.5rem; color: var(--brand); }
.avatar-options { display: flex; gap: var(--s-3); }
.avatar-options label { position: relative; cursor: pointer; }
.avatar-options input { position: absolute; opacity: 0; }
.avatar-options img { width: 72px; height: 72px; border-radius: 50%; border: 3px solid transparent; }
.avatar-options input:checked + img { border-color: var(--brand); }
.avatar-options input:focus-visible + img { box-shadow: var(--focus); }

/* Messages (dashboard/messages.php keeps its own layout styles) */
.chat-bubble { max-width: 75%; padding: 10px 14px; border-radius: 16px; background: var(--surface-3); color: var(--ink-900); }
.chat-bubble.me { background: var(--brand); color: #fff; margin-left: auto; }

/* Ads: reserved space prevents layout shift; clearly labelled */
.ad-slot { margin: var(--s-6) auto; max-width: 100%; min-height: 280px; text-align: center; overflow: hidden; }
.ad-slot .ad-label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-400); margin-bottom: 6px; }
.ad-slot ins { min-height: 250px; }
@media (min-width: 768px) { .ad-slot { min-height: 120px; } .ad-slot ins { min-height: 90px; } }
.grid-cards > .ad-slot, .blog-grid > .ad-slot { grid-column: 1 / -1; margin: var(--s-2) 0; }

/* Member area: app-style header & footer -------------------------------- */
.m-header { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.m-top { display: flex; align-items: center; gap: 12px; height: 62px; }
.m-brand { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; color: var(--ink-900); font-weight: 800; }
.m-brand:hover { text-decoration: none; color: var(--ink-900); }
.m-brand img { height: 28px; width: auto; }
.m-brand .logo-dark { display: none; }
:root[data-theme="dark"] .m-brand .logo-light { display: none; }
:root[data-theme="dark"] .m-brand .logo-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .m-brand .logo-light { display: none; } :root:not([data-theme="light"]) .m-brand .logo-dark { display: block; } }
.m-area { align-items: center; padding: 4px 10px; border-radius: var(--r-pill); background: var(--brand-50); color: var(--brand-ink); font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--brand-100); }
.m-search { display: none; flex: 1; max-width: 420px; margin: 0 auto; position: relative; align-items: center; }
.m-search i { position: absolute; left: 14px; color: var(--ink-400); pointer-events: none; }
.m-search input { width: 100%; min-height: 40px; padding: 8px 14px 8px 40px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); font-size: .92rem; color: var(--ink-900); }
.m-search input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); background: var(--surface); }
@media (min-width: 760px) { .m-search { display: flex; } }
.m-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.m-icon { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-700); }
.m-icon:hover { background: var(--surface-3); color: var(--ink-900); text-decoration: none; }
.m-icon .count-badge { position: absolute; top: 1px; right: -2px; box-shadow: 0 0 0 2px var(--surface); }
.m-icon .when-dark { display: none; }
:root[data-theme="dark"] .m-icon .when-dark { display: inline; }
:root[data-theme="dark"] .m-icon .when-light { display: none; }
.m-user > summary { border: 0; background: transparent; padding: 3px 6px 3px 3px; gap: 8px; }
.m-user > summary:hover { background: var(--surface-3); }
.m-avatar { --p: 0; position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line) 0); }
.m-avatar img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--surface); }
.m-user-name { font-weight: 700; color: var(--ink-900); }
.m-user .menu { min-width: 260px; }
.m-menu-progress { margin-top: 10px; display: grid; gap: 4px; }
.m-menu-progress .progress { height: 6px; }
.m-menu-btn { width: 40px; height: 40px; border-radius: 12px; }
@media (min-width: 960px) { .m-menu-btn { display: none; } }
@media (max-width: 959px) { .m-user { display: none; } }

.m-tabs { border-top: 1px solid var(--line); }
.m-tabs .container { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.m-tabs .container::-webkit-scrollbar { display: none; }
.m-tabs a { position: relative; flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; color: var(--ink-500); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.m-tabs a i { font-size: .9rem; }
.m-tabs a:hover { color: var(--ink-900); text-decoration: none; }
.m-tabs a[aria-current] { color: var(--brand); }
.m-tabs a[aria-current]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
.m-tabs .count-badge { min-width: 18px; height: 18px; font-size: .65rem; }
.m-progress { display: block; height: 3px; background: var(--line); }
.m-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #c9a24b); border-radius: 0 3px 3px 0; }
body.member-area { --header-h: 108px; }
body.member-area .member-shell { padding-top: 24px; }

.m-footer { margin-top: auto; border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0 20px; font-size: .9rem; }
.m-help { display: grid; gap: 14px; }
@media (min-width: 860px) { .m-help { grid-template-columns: 1fr 1fr; } }
.m-help-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.m-help-card > div { flex: 1; min-width: 0; }
.m-help-card strong { color: var(--ink-900); display: block; }
.m-help-card p { margin: 2px 0 0; color: var(--ink-500); font-size: .85rem; }
.m-help-ic { flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-size: 1.05rem; }
.m-help-ic-gold { background: var(--gold-50); color: var(--gold); }
@media (max-width: 520px) { .m-help-card { flex-wrap: wrap; } .m-help-card .btn { width: 100%; } }
.m-foot-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-500); font-size: .84rem; }
.m-foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.m-foot-links a { color: var(--ink-500); }
.m-foot-links a:hover { color: var(--brand); }

/* Custom suggestion dropdown (replaces native datalist popup) */
.combo { position: relative; width: 100%; }
.combo-list { position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; right: 0; min-width: 200px; max-height: 280px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-3); }
.combo-list li { padding: 9px 12px; border-radius: 10px; cursor: pointer; color: var(--ink-800); font-weight: 500; font-size: .95rem; }
.combo-list li:hover, .combo-list li[aria-selected="true"] { background: var(--brand-50); color: var(--brand-ink); }
.combo-list mark { background: none; color: var(--brand); font-weight: 700; }

/* 8. Legacy compatibility (older views not yet rebuilt) ------------------- */
.glass-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.form-group { display: grid; gap: 6px; margin-bottom: var(--s-4); }
.form-group > label { font-weight: 600; font-size: .9rem; color: var(--ink-800); }
.text-muted { color: var(--ink-500) !important; }
.text-primary { color: var(--brand) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-center { text-align: center; } .text-right { text-align: right; }
.text-sm { font-size: .875rem; } .text-xs { font-size: .75rem; } .text-4xl { font-size: 2.25rem; }
.fw-bold { font-weight: 700; }
.flex { display: flex; } .flex-1 { flex: 1; } .align-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); }
.mb-2 { margin-bottom: var(--s-2); } .mb-3 { margin-bottom: var(--s-3); } .mb-4 { margin-bottom: var(--s-4); }
.mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); }
.p-0 { padding: 0; } .p-4 { padding: var(--s-5); }
.w-100, .full-width { width: 100%; }
.small { font-size: .875rem; }
.btn-outline-danger { --btn-bg: transparent; --btn-fg: var(--danger); --btn-bd: var(--danger); }
.btn-link { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--brand); }
.badge-pill { border-radius: var(--r-pill); }
.table-responsive { overflow-x: auto; }
.dash-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); }
.dash-group-box { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s-4); margin-bottom: var(--s-4); }
.dashboard-container { padding-block: var(--s-5) var(--s-7); }
.list-group { display: grid; gap: 2px; }
.empty-state { text-align: center; padding: var(--s-7) var(--s-4); color: var(--ink-500); }
.empty-state i { font-size: 2rem; color: var(--ink-300); margin-bottom: var(--s-3); display: block; }
.profiles-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .profiles-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .profiles-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.main-content { display: block; }

/* 9. Motion & print -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
    .site-header, .site-footer, .tabbar, .drawer, .toast-region, .no-print { display: none !important; }
    body { background: #fff; padding: 0 !important; }
    /* Member profiles are printable only through the admin panel. */
    body.no-public-print.page-profile main { display: none !important; }
    body.no-public-print.page-profile::before { content: "Printing member profiles is not available."; display: block; padding: 48px; font: 16px/1.5 sans-serif; color: #000; }
}

/* Small phones: the tab bar already offers "Join", so keep the header to logo, theme and menu. */
@media (max-width: 479px) { .site-header .hdr-join { display: none; } .brand img { height: 32px; } }
/* Blended hero pages: the hero already sits below the header, so trim its own top padding. */
@media (min-width: 960px) { body.hdr-blend .h-hero { padding-top: 32px; } }



/* ---- Auth card v2 (login / sign-up) ---- */
@media (min-width: 1000px) { .auth-main { position: relative; } .auth-main .auth-topbar { position: absolute; top: 0; left: var(--gutter); right: var(--gutter); } .auth-main { justify-content: center; padding-top: 72px; padding-bottom: 24px; } }
.auth-card-x { position: relative; }
@media (min-width: 560px) {
    .auth-card-x { max-width: 470px; margin-top: 44px; padding: 44px 36px 26px; border-radius: 30px; border-color: color-mix(in srgb, var(--brand) 14%, var(--line));
        background: radial-gradient(420px 160px at 50% 0%, color-mix(in srgb, var(--brand) 6%, transparent), transparent 70%), var(--surface);
        box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 40px 80px -44px rgba(80, 10, 40, .45); }
    .auth-card-wide { max-width: 560px; }
}
.auth-emblem { display: none; }
@media (min-width: 560px) {
    .auth-emblem { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); display: grid; place-items: center; width: 52px; height: 62px; padding-top: 6px;
        border-radius: 999px 999px 14px 14px; background: radial-gradient(60px 50px at 50% 20%, #7a1c47, transparent 75%), #26101c; color: #f3dfae; font-size: 1.1rem;
        border: 2px solid #c9a24b; box-shadow: 0 0 0 6px var(--surface-2), 0 14px 26px -12px rgba(60, 8, 32, .6); }
}
.auth-card-x .auth-switch { margin-bottom: 22px; background: var(--surface-2); }
.auth-card-x .auth-switch a[aria-current] { background: var(--brand); color: #fff; box-shadow: 0 8px 18px -10px var(--brand); }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head h1 { margin-bottom: 6px; }
.auth-card-x .auth-head .lede { margin: 0 auto; max-width: 380px; font-size: .95rem; line-height: 1.55; }
.auth-card-x form { gap: 14px; }
.auth-card-x label, .auth-card-x .label { font-size: .86rem; font-weight: 700; color: var(--ink-800); }
.auth-card-x .input { height: 50px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid var(--line); font-size: .98rem; transition: border-color .2s, box-shadow .2s, background-color .2s; }
.auth-card-x .input::placeholder { color: var(--ink-400); }
.auth-card-x .input:hover { border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); }
.auth-card-x .input:focus { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); outline: none; }
.auth-card-x .input:-webkit-autofill, .auth-card-x .input:-webkit-autofill:hover, .auth-card-x .input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 40px var(--surface-2) inset; -webkit-text-fill-color: var(--ink-900); caret-color: var(--ink-900); transition: background-color 9999s; }
.input-ic { position: relative; }
.input-ic > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-400); font-size: .92rem; pointer-events: none; transition: color .2s; z-index: 1; }
.input-ic:focus-within > i { color: var(--brand); }
.input-ic .input { padding-left: 44px; }
.auth-card-x .password-toggle { right: 8px; padding: 0 12px; min-height: 34px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: .78rem; }
.auth-forgot { font-weight: 600; }
.auth-submit { margin-top: 4px; height: 52px; font-size: 1rem; gap: 10px; box-shadow: 0 14px 28px -14px var(--brand); }
.auth-submit i { transition: transform .2s; }
.auth-submit:hover i { transform: translateX(4px); }
.auth-card-x .auth-alt { margin: 18px 0 0; padding-top: 16px; border-top: 1px dashed var(--line); font-size: .92rem; }
.auth-card-x .auth-alt a { font-weight: 700; }
.auth-secure { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 0; font-size: .78rem; color: var(--ink-400); }
.auth-secure i { color: #c9a24b; }
.auth-row { display: grid; gap: 14px; }
@media (min-width: 560px) { .auth-row { grid-template-columns: 1fr 1fr; } }
.auth-card-x .choice span { min-height: 46px; }
.auth-more summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 700; font-size: .88rem; }
.auth-more summary::-webkit-details-marker { display: none; }
.auth-more summary i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 999px; background: var(--brand-50); font-size: .65rem; transition: transform .2s; }
.auth-more[open] summary i { transform: rotate(45deg); }
.auth-more summary span { color: var(--ink-400); font-weight: 500; }
.auth-terms { text-align: center; }
/* Short laptop screens: tighten so the sign-up form fits without scrolling. */
@media (min-width: 1000px) and (max-height: 860px) {
    .auth-card-x { margin-top: 36px; padding-top: 38px; padding-bottom: 20px; }
    .auth-card-x .auth-switch { margin-bottom: 16px; }
    .auth-card-x .auth-switch a { padding: 8px 12px; }
    .auth-head { margin-bottom: 14px; }
    .auth-head h1 { font-size: 1.7rem; }
    .auth-card-wide .auth-head .lede { display: none; }
    .auth-card-x form { gap: 11px; }
    .auth-card-x .input { height: 46px; }
    .auth-card-x .choice span { min-height: 42px; }
    .auth-submit { height: 48px; }
    .auth-card-x .auth-alt { margin-top: 12px; padding-top: 12px; }
}
.auth-row { align-items: start; }
@media (max-width: 559px) {
    .auth-card-x form { gap: 11px; }
    .auth-card-x .input { height: 46px; }
    .auth-card-x .choice span { min-height: 42px; }
    .auth-head { margin-bottom: 14px; }
    .auth-card-wide .auth-head .lede { display: none; }
    .auth-card-x .auth-switch { margin-bottom: 16px; }
}
/* Centre the card vertically; leave room above it for the topbar and arch emblem. */
@media (min-width: 560px) { .auth-card-x { margin-block: auto; } }
@media (min-width: 1000px) { .auth-main { padding-top: 112px; } }
@media (min-width: 1000px) and (max-height: 860px) { .auth-main { padding-top: 100px; padding-bottom: 16px; } }
/* Auth pages: the brand panel stays put; only the form side scrolls. */
body.hdr-blend #main > .p-doc:first-child > .p-hero { border-top: var(--header-h) solid transparent; background-origin: border-box; }
/* Auth topbar: "Back to website" on the left; theme toggle lives in the card. */
.auth-topbar .auth-back { order: -1; }
.auth-topbar .auth-logo { order: 0; }
@media (min-width: 1000px) { .auth-shell .auth-topbar .auth-logo { display: none; } }
@media (max-width: 999px) { .auth-topbar { justify-content: flex-start; } .auth-topbar .auth-logo { margin-left: auto; } }
@media (max-width: 420px) { .auth-topbar .auth-back span { display: none; } .auth-topbar .auth-back { padding-inline: 12px; } }
.auth-card-theme { position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-700); cursor: pointer; transition: color .2s, border-color .2s, transform .3s; }
.auth-card-theme:hover { color: var(--brand); border-color: var(--brand-200); transform: rotate(-15deg); }
.auth-card-x .auth-switch { margin-right: 0; }
/* On phones the card has no frame, so keep the toggle in the top bar instead. */
@media (max-width: 559px) { .auth-card-theme { display: none; } }
@media (min-width: 560px) { .auth-topbar.has-card-theme .theme-toggle { display: none; } .auth-card-x .auth-switch { margin-inline: 30px; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .when-dark { display: inline; } :root:not([data-theme="light"]) .theme-toggle .when-light { display: none; } }
@media (min-width: 1000px) { .auth-shell .auth-topbar .auth-back { display: none; } }
/* Desktop: the top bar is empty now (back button is on the panel, theme toggle in the card),
   so the form only needs room for the arch emblem above it. */
@media (min-width: 1000px) { .auth-main, .auth-main[class] { padding-top: 52px; padding-bottom: 20px; } }
@media (min-width: 1000px) and (max-height: 700px) { .auth-card-wide .hint { display: none; }
    .auth-card-wide .auth-alt { display: none; } }

/* ---- Auth brand panel: plum jaali, centred arch; fixed while the form scrolls ---- */
.auth-aside { display: none; }
@media (min-width: 1000px) {
    .auth-aside { position: sticky; top: 0; height: 100vh; height: 100dvh; align-self: start; display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
        color: #eadfe5; text-align: center; padding: 26px clamp(28px, 3.2vw, 48px) 22px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23c9a24b' stroke-opacity='.1' stroke-width='1'%3E%3Cpath d='M28 4l24 24-24 24L4 28z'/%3E%3Ccircle cx='28' cy='28' r='9'/%3E%3Cpath d='M0 0l56 56M56 0L0 56'/%3E%3C/g%3E%3C/svg%3E"),
            radial-gradient(520px 420px at 50% 42%, rgba(140, 22, 75, .55), transparent 70%),
            radial-gradient(700px 420px at 0% 0%, #5e1736, transparent 70%), #24101b; }
    /* a faint large arch behind everything */
    .auth-aside::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 12%; transform: translateX(-50%); width: min(78%, 520px); height: 86%;
        border-radius: 999px 999px 0 0; border: 1px solid rgba(201, 162, 75, .16); border-bottom: 0; pointer-events: none; }
    .auth-aside-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
    .auth-aside-back { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: 999px; border: 1px solid rgba(201, 162, 75, .45);
        background: rgba(255, 255, 255, .05); color: #f3dfae; font-weight: 600; font-size: .85rem; transition: background-color .2s, border-color .2s, color .2s; }
    .auth-aside-back:hover { background: rgba(201, 162, 75, .16); border-color: #c9a24b; color: #fff; text-decoration: none; }
    .auth-aside-back i { font-size: .78rem; transition: transform .2s; }
    .auth-aside-back:hover i { transform: translateX(-3px); }
    .auth-aside-logo img { height: 34px; width: auto; }
    .auth-aside-logo:hover { text-decoration: none; }

    .auth-aside-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 0; }
    .auth-arch { position: relative; width: clamp(130px, 25vh, 230px); aspect-ratio: 4 / 5; flex-shrink: 0; margin-bottom: clamp(18px, 3.6vh, 34px); border-radius: 999px 999px 20px 20px;
        border: 6px solid #2e1422; outline: 1.5px solid #c9a24b; outline-offset: 6px; box-shadow: 0 0 0 12px rgba(201, 162, 75, .06), 0 30px 60px -18px rgba(0, 0, 0, .7), 0 0 80px -10px rgba(216, 26, 86, .35); }
    .auth-arch img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px 999px 14px 14px; }
    .auth-arch::after { content: ""; position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%) rotate(45deg); width: 10px; height: 10px; background: #c9a24b; box-shadow: 0 0 0 4px #24101b; }
    .auth-aside h2 { color: #fff; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 1rem + 1.7vw, 2.5rem); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 8px; max-width: 460px; }
    .auth-aside-sub { margin: 0 0 clamp(14px, 2.6vh, 24px); color: #c9b5bf; font-size: .95rem; }
    .auth-aside-points { list-style: none; margin: 0; padding: 0; display: inline-grid; gap: 8px; text-align: left; }
    .auth-aside-points li { display: flex; align-items: center; gap: 12px; padding: 9px 16px 9px 10px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(201, 162, 75, .2); color: #eadfe5; font-size: .92rem; }
    .auth-aside-points i { width: 26px; height: 26px; flex-shrink: 0; display: grid; place-items: center; border-radius: 999px; background: linear-gradient(180deg, #f3dfae, #c9a24b); color: #26101c; font-size: .7rem; }
    .auth-aside-foot { margin: 0; font-size: .78rem; color: rgba(234, 223, 229, .55); }
}
@media (min-width: 1000px) and (max-height: 760px) {
    .auth-aside-sub { display: none; }
    .auth-aside h2 { margin-bottom: 14px; font-size: 1.75rem; }
    .auth-aside-points { gap: 6px; }
    .auth-aside-points li { padding-block: 6px; font-size: .88rem; }
}
@media (min-width: 1000px) and (max-height: 620px) { .auth-arch { display: none; } }

@media (min-width: 1000px) { .auth-aside-back { white-space: nowrap; } }
@media (min-width: 1000px) and (max-width: 1180px) { .auth-aside-top { grid-template-columns: auto 1fr; } .auth-aside-logo { justify-self: end; } .auth-aside-logo img { height: 28px; } }

/* Sign-up v3: wider card, gender on one row, password + mobile side by side. */
@media (min-width: 560px) { .auth-card-wide { max-width: 700px; width: 100%; } }
.auth-gender { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-items: center; }
.auth-gender > .label { grid-column: 1 / -1; font-size: .86rem; font-weight: 700; color: var(--ink-800); }
@media (min-width: 640px) { .auth-gender { grid-template-columns: auto 1fr 1fr; gap: 14px; } .auth-gender > .label { grid-column: auto; margin: 0; white-space: nowrap; } }
.auth-phone .select { height: 50px; width: 104px; flex: 0 0 104px; border-radius: 14px 0 0 14px; background-color: var(--surface-2); border: 1.5px solid var(--line); font-weight: 600; padding-inline: 12px 26px; }
.auth-phone .input { border-radius: 0 14px 14px 0 !important; }
.auth-phone .select:focus { border-color: var(--brand); outline: none; position: relative; z-index: 1; }
@media (min-width: 1000px) and (max-height: 860px) { .auth-phone .select { height: 46px; } }
@media (max-width: 559px) { .auth-phone .select { height: 46px; } }
/* Sign-up card: roomier fields (the wide layout has height to spare). */
@media (min-width: 560px) {
    .auth-card-wide.auth-card-x { padding: 48px 44px 28px; }
    .auth-card-wide.auth-card-x form { gap: 18px; }
    .auth-card-wide.auth-card-x .input, .auth-card-wide .auth-phone .select { height: 54px; }
    .auth-card-wide.auth-card-x .choice span { min-height: 54px; }
    .auth-card-wide .auth-submit { height: 56px; margin-top: 6px; }
    .auth-card-wide.auth-card-x .field { gap: 8px; }
    .auth-card-wide .auth-head { margin-bottom: 24px; }
}
@media (min-width: 1000px) and (max-height: 860px) {
    .auth-card-wide.auth-card-x { padding: 40px 40px 18px; }
    .auth-card-wide.auth-card-x form { gap: 16px; }
    .auth-card-wide.auth-card-x .input, .auth-card-wide .auth-phone .select { height: 52px; }
    .auth-card-wide.auth-card-x .choice span { min-height: 52px; }
    .auth-card-wide .auth-submit { height: 54px; }
    .auth-card-wide .auth-head { margin-bottom: 20px; }
    .auth-card-wide.auth-card-x .auth-switch { margin-bottom: 20px; }
}
@media (min-width: 1000px) and (max-height: 700px) {
    .auth-card-wide.auth-card-x { padding-top: 40px; }
    .auth-card-wide.auth-card-x form { gap: 12px; }
    .auth-card-wide.auth-card-x .input, .auth-card-wide .auth-phone .select { height: 46px; }
    .auth-card-wide.auth-card-x .choice span { min-height: 46px; }
    .auth-card-wide .auth-submit { height: 48px; }
    .auth-card-wide .auth-head { margin-bottom: 12px; }
}
/* Bride / groom choice: distinct coloured badges so they read at a glance. */
.choice .g-ic { width: 30px; height: 30px; flex-shrink: 0; display: inline-grid; place-items: center; border-radius: 999px; font-style: normal; font-size: .95rem; }
.choice .g-ic i { margin: 0; }
.choice .g-bride { background: #fde4ee; color: #d81a56; }
.choice .g-groom { background: #e3ecfb; color: #2f5fb3; }
:root[data-theme="dark"] .choice .g-bride { background: rgba(216, 26, 86, .2); color: #ff8fb1; }
:root[data-theme="dark"] .choice .g-groom { background: rgba(80, 130, 220, .2); color: #9cbcf5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .choice .g-bride { background: rgba(216, 26, 86, .2); color: #ff8fb1; } :root:not([data-theme="light"]) .choice .g-groom { background: rgba(80, 130, 220, .2); color: #9cbcf5; } }
.choice small { font-size: .78rem; font-weight: 500; color: var(--ink-400); }
.choice input:checked + span .g-bride { background: #d81a56; color: #fff; }
.choice input:checked + span .g-groom { background: #2f5fb3; color: #fff; }
.choice input[value="Male"]:checked + span { border-color: #2f5fb3; background: color-mix(in srgb, #2f5fb3 8%, var(--surface)); color: #23488a; box-shadow: inset 0 0 0 1px #2f5fb3; }
:root[data-theme="dark"] .choice input[value="Male"]:checked + span { color: #b9d0fa; }
:root .choice input:checked + span .g-bride { background: #d81a56; color: #fff; }
:root .choice input:checked + span .g-groom { background: #2f5fb3; color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .choice input:checked + span .g-bride { background: #d81a56; color: #fff; } :root:not([data-theme="light"]) .choice input:checked + span .g-groom { background: #2f5fb3; color: #fff; } :root:not([data-theme="light"]) .choice input[value="Male"]:checked + span { color: #b9d0fa; } }
:root[data-theme="dark"] .choice input:checked + span .g-bride { background: #d81a56; color: #fff; }
:root[data-theme="dark"] .choice input:checked + span .g-groom { background: #2f5fb3; color: #fff; }
/* Log-in and sign-up share one card size, so switching tabs doesn't jump.
   Heights match the sign-up form at each breakpoint; the log-in content is centred inside. */
@media (min-width: 560px) {
    .auth-card-wide { display: flex; flex-direction: column; min-height: 766px; }
    .auth-card-login .auth-head { margin-top: auto; }
    .auth-card-login .auth-secure { margin-bottom: auto; }
    .auth-card-login .auth-head .lede { display: block; }
    .auth-card-login form { width: 100%; max-width: 480px; margin-inline: auto; }
    .auth-card-login .auth-alt, .auth-card-login .auth-secure { width: 100%; max-width: 480px; margin-inline: auto; }
}
@media (min-width: 1000px) and (max-height: 860px) { .auth-card-wide { min-height: 657px; } }
@media (min-width: 1000px) and (max-height: 700px) { .auth-card-wide { min-height: 512px; } .auth-card-login .auth-head .lede { display: none; } }
/* Phones: framed card on a soft brand background, emblem + theme toggle inside the card. */
@media (max-width: 559px) {
    .auth-shell { background: radial-gradient(420px 260px at 50% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%), var(--surface-2); }
    .auth-main { padding: 0 14px 24px; }
    .auth-topbar { padding: 14px 2px 8px; }
    .auth-topbar.has-card-theme .theme-toggle { display: none; }
    .auth-card-x { margin: 40px 0 auto; padding: 40px 18px 20px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 48px -30px rgba(80, 10, 40, .4); }
    .auth-emblem { display: grid; position: absolute; top: -26px; left: 50%; transform: translateX(-50%); place-items: center; width: 44px; height: 52px; padding-top: 5px;
        border-radius: 999px 999px 12px 12px; background: radial-gradient(50px 40px at 50% 20%, #7a1c47, transparent 75%), #26101c; color: #f3dfae; font-size: .95rem; border: 2px solid #c9a24b; box-shadow: 0 0 0 5px var(--surface-2); }
    .auth-card-theme { display: grid; top: 10px; right: 10px; width: 34px; height: 34px; }
    .auth-card-x .auth-switch { margin: 6px 34px 16px; }
    .auth-card-x .auth-switch a { padding: 9px 8px; font-size: .88rem; }
    .auth-head h1 { font-size: 1.55rem; }
    .auth-card-login .auth-head .lede { display: block; font-size: .9rem; }
    .auth-gender { gap: 8px 10px; }
    .auth-card-x .choice span { min-height: 48px; gap: 8px; padding: 8px 10px; }
    .choice .g-ic { width: 26px; height: 26px; font-size: .85rem; }
    .auth-row { gap: 12px; }
    .auth-terms { font-size: .78rem; }
}
@media (max-width: 359px) { .choice small { display: none; } }


/* =====================================================================
   App feel (mobile + installed PWA)
   ===================================================================== */
html { -webkit-tap-highlight-color: transparent; }
a, button, summary, label, .btn { touch-action: manipulation; }

/* Bottom navigation: pill behind the active icon, safe-area aware. */
.tabbar { grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); gap: 2px;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -22px rgba(60, 10, 35, .45); }
.tabbar a { min-height: 54px; gap: 4px; border-radius: 14px; font-size: .68rem; font-weight: 700; color: var(--ink-500); -webkit-user-select: none; user-select: none; transition: color .2s; }
.tabbar .tab-ic { position: relative; display: grid; place-items: center; width: 54px; height: 30px; border-radius: 999px; transition: background-color .25s, transform .2s; }
.tabbar a i { font-size: 1.15rem; }
.tabbar a:active .tab-ic { transform: scale(.9); }
.tabbar a[aria-current] { color: var(--brand); }
.tabbar a[aria-current] .tab-ic { background: var(--brand-50); }
.tabbar .count-badge { position: absolute; top: -2px; right: 6px; left: auto; box-shadow: 0 0 0 2px var(--surface); }
body.has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
@media (min-width: 960px) { body.has-tabbar { padding-bottom: 0; } }

/* Phones: the bottom bar already has Messages/Interests/Join, so the header stays light. */
@media (max-width: 959px) {
    body.has-tabbar .site-header .hdr-icon[href*="dashboard/messages"],
    body.has-tabbar .m-actions .m-icon[href*="dashboard/messages"],
    body.has-tabbar .m-actions .m-icon[href*="dashboard/interests"] { display: none; }
    .site-header .bar { gap: 10px; }
}

/* Back button: only inside the installed app (JS un-hides it), never on the home page. */
.app-back { display: none; width: 38px; height: 38px; flex-shrink: 0; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-800); margin-right: 2px; }
.app-back:not([hidden]) { display: grid; }
.app-back:active { transform: scale(.92); }

/* Thin progress bar while the next page loads. */
.nav-progress { position: fixed; top: 0; left: 0; z-index: 3000; height: 3px; width: 0; background: linear-gradient(90deg, var(--brand), #c9a24b); box-shadow: 0 0 8px rgba(216, 26, 86, .5); opacity: 0; transition: width .3s ease, opacity .2s; pointer-events: none; }
.nav-progress.is-active { opacity: 1; width: 80%; transition: width 6s cubic-bezier(.1, .7, .2, 1), opacity .2s; }

/* Smooth cross-page transitions (Chrome/Edge/Android); the bottom bar stays put. */
@view-transition { navigation: auto; }
.tabbar { view-transition-name: tabbar; }
.site-header, .m-header { view-transition-name: site-header; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* Installed app (standalone): no website chrome that only makes sense in a browser. */
@media (display-mode: standalone) {
    html { overscroll-behavior-y: none; }
    body { -webkit-user-select: none; user-select: none; }
    input, textarea, select, [contenteditable], .prose, .prose *, .p-doc-body, .p-doc-body *, .chat, .chat * { -webkit-user-select: text; user-select: text; }
    [data-install-app], .h-app, .footer-cta { display: none !important; }
    .site-header, .m-header { padding-top: env(safe-area-inset-top); }
}
@media (display-mode: standalone) and (max-width: 959px) {
    /* the bottom bar replaces the big website footer */
    .site-footer .footer-grid, .site-footer .footer-arch, .m-footer .m-footer-grid { display: none; }
    .site-footer { padding-top: 12px; }
}

/* Log-in / sign-up on phones & tablets: normal site header + bottom nav. */
.site-header.hdr-auth { display: none; }
@media (max-width: 999px) {
    .site-header.hdr-auth { display: block; }
    body.auth-body .auth-topbar { display: none; }
    body.auth-body .auth-shell, body.auth-body .auth-main { min-height: 0; }
    body.auth-body .auth-main { padding-top: 18px; }
    body.auth-body .auth-card-x { margin-top: 30px; margin-bottom: 8px; }
}
@media (min-width: 1000px) { body.auth-body .tabbar { display: none; } body.auth-body.has-tabbar { padding-bottom: 0; } }
@media (max-width: 559px) { .auth-card-login .auth-head .lede { display: none; } }
@media (max-width: 559px) { .auth-secure { display: none; } }
@media (max-width: 999px) { body.auth-body .auth-card-theme { display: none; } body.auth-body .auth-card-x .auth-switch { margin-inline: 0; } }


/* Install-app sheet (bottom sheet on phones, centred card on larger screens). */
.install-sheet { position: fixed; inset: 0; z-index: 2500; display: flex; align-items: flex-end; justify-content: center; }
.install-backdrop { position: absolute; inset: 0; background: rgba(20, 6, 14, .5); opacity: 0; transition: opacity .25s; }
.install-panel { position: relative; width: 100%; max-width: 440px; padding: 26px 22px calc(20px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: var(--surface);
    box-shadow: 0 -20px 50px -20px rgba(40, 8, 25, .5); transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.install-panel::before { content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line); }
.install-sheet.is-open .install-backdrop { opacity: 1; }
.install-sheet.is-open .install-panel { transform: none; }
@media (min-width: 600px) { .install-sheet { align-items: center; } .install-panel { border-radius: 26px; padding-bottom: 22px; transform: translateY(20px) scale(.97); opacity: 0; transition: transform .25s, opacity .25s; } .install-sheet.is-open .install-panel { opacity: 1; } .install-panel::before { display: none; } }
.install-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 999px; border: 0; background: var(--surface-2); color: var(--ink-500); display: grid; place-items: center; cursor: pointer; }
.install-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; }
.install-head img { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 10px 22px -12px rgba(120, 15, 60, .6); }
.install-head h2 { margin: 0 0 2px; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.install-head p { margin: 0; color: var(--ink-500); font-size: .85rem; }
.install-points { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.install-points li { display: flex; align-items: center; gap: 10px; font-size: .92rem; color: var(--ink-700); }
.install-points i { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: 999px; background: var(--brand-50); color: var(--brand); font-size: .78rem; }
.install-ios { margin: 0 0 16px; padding: 14px 16px 14px 34px; border-radius: 16px; background: var(--surface-2); border: 1px dashed var(--line); display: grid; gap: 6px; font-size: .9rem; color: var(--ink-700); }
.install-ios i { color: var(--brand); margin-left: 4px; }
.install-actions { display: grid; gap: 6px; }
.install-actions .btn-primary { gap: 10px; }
@media (prefers-reduced-motion: reduce) { .install-panel, .install-backdrop { transition: none; } }

/* Already installed: no "install the app" messages anywhere on the site. */
.app-installed [data-install-app], .app-installed .h-app, .app-installed .install-sheet { display: none !important; }
.pcard-link { position: relative; z-index: 2; } .pcard-link:hover { text-decoration: none; color: var(--brand-ink); }
/* Whole card body is clickable too (except the save button). */
.pcard-body { position: relative; cursor: pointer; }

/* ---- Admin sign-in ---- */
body.adm-login-page { background: #1a0a13; }
.adm-login { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 18px var(--gutter, 16px) 22px; isolation: isolate;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23c9a24b' stroke-opacity='.09' stroke-width='1'%3E%3Cpath d='M28 4l24 24-24 24L4 28z'/%3E%3Ccircle cx='28' cy='28' r='9'/%3E%3Cpath d='M0 0l56 56M56 0L0 56'/%3E%3C/g%3E%3C/svg%3E"),
        radial-gradient(700px 420px at 50% 0%, rgba(140, 22, 75, .55), transparent 70%), radial-gradient(600px 400px at 100% 100%, rgba(201, 162, 75, .12), transparent 70%), #1a0a13; color: #eadfe5; }
.adm-login::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 70px; transform: translateX(-50%); width: min(92vw, 620px); height: calc(100% - 140px); border: 1px solid rgba(201, 162, 75, .16); border-bottom: 0; border-radius: 999px 999px 0 0; pointer-events: none; }
.adm-login-top { width: 100%; max-width: 1100px; display: flex; justify-content: space-between; align-items: center; }
.adm-back { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 999px; border: 1px solid rgba(201, 162, 75, .45); color: #f3dfae; font-weight: 600; font-size: .86rem; background: rgba(255, 255, 255, .04); }
.adm-back:hover { background: rgba(201, 162, 75, .16); color: #fff; text-decoration: none; }
.adm-theme { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .05); color: #f3dfae; cursor: pointer; }
@media (max-width: 420px) { .adm-back span { display: none; } }

.adm-card { position: relative; width: 100%; max-width: 440px; margin: auto; margin-top: 64px; padding: 50px 32px 26px; text-align: center; border-radius: 28px;
    background: var(--surface); color: var(--ink-900); border: 1px solid rgba(201, 162, 75, .45); box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .8), 0 0 0 8px rgba(201, 162, 75, .06); }
.adm-emblem { position: absolute; top: -34px; left: 50%; transform: translateX(-50%); display: grid; place-items: center; width: 60px; height: 70px; padding-top: 6px; border-radius: 999px 999px 14px 14px;
    background: radial-gradient(60px 50px at 50% 20%, #7a1c47, transparent 75%), #26101c; color: #f3dfae; font-size: 1.4rem; border: 2px solid #c9a24b; box-shadow: 0 0 0 6px var(--surface), 0 16px 30px -12px rgba(0, 0, 0, .6); }
.adm-logo { display: inline-block; padding: 8px 14px; margin-bottom: 14px; border-radius: 12px; background: #26101c; }
.adm-logo img { height: 28px; width: auto; display: block; }
.adm-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
:root[data-theme="dark"] .adm-chip { background: rgba(250, 204, 21, .14); color: #fde68a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .adm-chip { background: rgba(250, 204, 21, .14); color: #fde68a; } }
.adm-card h1 { margin: 12px 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 1.9rem; }
.adm-lede { margin: 0 auto 20px; color: var(--ink-500); font-size: .92rem; max-width: 330px; }
.adm-card .alert { text-align: left; }
.adm-form { display: grid; gap: 14px; text-align: left; }
.adm-form label { font-size: .84rem; font-weight: 700; color: var(--ink-800); }
.adm-input { position: relative; }
.adm-input > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-400); font-size: .9rem; z-index: 1; pointer-events: none; }
.adm-input:focus-within > i { color: var(--brand); }
.adm-input .input { height: 50px; padding-left: 44px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid var(--line); }
.adm-input .input:focus { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); outline: none; }
.adm-input .password-toggle { right: 8px; padding: 0 12px; min-height: 34px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: .78rem; }
.adm-submit { margin-top: 4px; height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 800; font-size: 1rem; color: #26101c;
    background: linear-gradient(180deg, #f0d48f, #c9a24b); box-shadow: 0 14px 28px -14px rgba(201, 162, 75, .9); transition: filter .2s, transform .15s; }
.adm-submit:hover { filter: brightness(1.05); }
.adm-submit:active { transform: scale(.98); }
.adm-notes { list-style: none; margin: 20px 0 0; padding: 14px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 6px; text-align: left; font-size: .8rem; color: var(--ink-500); }
.adm-notes i { color: #c9a24b; width: 18px; text-align: center; margin-right: 4px; }
.adm-foot { margin: 22px 0 0; font-size: .78rem; color: rgba(234, 223, 229, .55); }
@media (max-width: 479px) { .adm-card { padding: 46px 20px 22px; margin-top: 52px; } }
.adm-logo { display: table; margin: 0 auto 14px; }
/* Admin sign-in: no blue autofill background, and fit short laptop screens. */
.adm-input .input:-webkit-autofill, .adm-input .input:-webkit-autofill:hover, .adm-input .input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 40px var(--surface-2) inset; -webkit-text-fill-color: var(--ink-900); caret-color: var(--ink-900); transition: background-color 9999s; }
.adm-login { justify-content: flex-start; }
.adm-card { margin: auto; margin-top: 56px; margin-bottom: 0; }
@media (max-height: 860px) {
    .adm-login { padding-top: 12px; padding-bottom: 12px; }
    .adm-card { margin-top: 44px; padding: 40px 28px 18px; }
    .adm-emblem { width: 52px; height: 60px; top: -30px; font-size: 1.2rem; }
    .adm-logo { margin-bottom: 10px; padding: 6px 12px; }
    .adm-logo img { height: 24px; }
    .adm-card h1 { font-size: 1.65rem; margin: 8px 0 4px; }
    .adm-lede { margin-bottom: 14px; font-size: .86rem; }
    .adm-form { gap: 10px; }
    .adm-input .input { height: 46px; }
    .adm-submit { height: 48px; }
    .adm-notes { margin-top: 14px; padding-top: 10px; gap: 4px; font-size: .76rem; }
    .adm-foot { margin-top: 12px; }
}
@media (max-height: 700px) {
    .adm-notes { display: none; }
    .adm-lede { display: none; }
}
.adm-card { margin-top: auto; margin-bottom: auto; }
.adm-login-top { margin-bottom: 44px; }
@media (max-height: 860px) { .adm-login-top { margin-bottom: 36px; } }
