
.app-svg-icon,
.app-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    flex-shrink: 0;
}
.app-svg-icon { fill: currentColor; }
/* ============================================================
   Dating product styles. Shared palette, typography, and shell dimensions
   are owned by Rebel.Shared.UI (shared-theme/base/shell/controls).
   ============================================================ */
:root {
    /* Backgrounds */
    --app-surface-2:       #27292D;
    --app-surface-elevated:#24262B;

    /* Text */

    /* Brand / Primary — shared focus accent */

    /* Status */

    /* Semantic */
    --app-hover-bg:        rgba(255,255,255,0.06);
    --app-pill-bg:         rgba(255,255,255,0.06);
    --app-chip-bg:         rgba(170,167,255,0.14);
    --app-chip-border:     rgba(170,167,255,0.32);
    --app-field-bg:        #1D1F22;
    --app-focus-ring:      0 0 0 3px rgba(170, 167, 255, 0.35);
    --app-shadow-card:     0 1px 2px rgba(0, 0, 0, 0.32), 0 8px 24px rgba(0, 0, 0, 0.24);
    --app-badge-surface:   color-mix(in srgb, var(--app-surface) 82%, transparent);
    --app-badge-text:      var(--app-text);
    --app-danger-soft:     rgba(240,131,139,0.14);
    --app-warning-soft:    rgba(232,181,88,0.14);
    --app-info-soft:       rgba(124,198,220,0.14);
    --app-overlay-backdrop:rgba(10, 10, 12, .72);
    --app-overlay-panel:   var(--app-bg);

    /* TomSelect tokens and anatomy are canonical in shared-theme.css and
       shared-controls.css (Rebel.Shared.UI). */
}

[data-theme="light"] {
    --app-surface-2:       #EEEFEC;
    --app-surface-elevated:#FFFFFF;
    --app-hover-bg:        #EFEFEB;
    --app-pill-bg:         #EFEFEB;
    --app-chip-bg:         rgba(87,91,199,0.08);
    --app-chip-border:     rgba(87,91,199,0.28);
    --app-field-bg:        #FFFFFF;
    --app-focus-ring:      0 0 0 3px rgba(87, 91, 199, 0.28);
    --app-shadow-card:     0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.08);
    --app-badge-surface:   color-mix(in srgb, var(--app-surface) 92%, transparent);
    --app-badge-text:      var(--app-text);
    --app-danger-soft:     #FBE9E9;
    --app-warning-soft:    #FBF0DA;
    --app-info-soft:       #E2F2F7;
    --app-overlay-backdrop:rgba(32, 33, 36, .5);
    --app-overlay-panel:   var(--app-bg);

    /* TomSelect tokens and anatomy are canonical in shared-theme.css and
       shared-controls.css (Rebel.Shared.UI). */
}

/* ── Component aliases (used by razor.css files) ─────────────── */
:root {
    /* Aliases for component files */
    --app-text-primary:    var(--app-text);
    --app-text-secondary:  var(--app-text-soft);
    --app-hover:           var(--app-hover-bg);
    --app-primary-alpha:   var(--app-chip-bg);
    --app-surface-rgb:     29, 31, 34;

    /* Border radii */
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  16px;
    --radius-xxl: 16px;

    /* Shadows */
    --shadow-sm:  0 1px 2px rgba(0,0,0,0.30), 0 2px 6px rgba(0,0,0,0.22);
    --shadow-md:  0 1px 2px rgba(0,0,0,0.32), 0 8px 24px rgba(0,0,0,0.24);
    --shadow-lg:  0 1px 2px rgba(0,0,0,0.34), 0 12px 32px rgba(0,0,0,0.28);

    /* Layout */
    --header-height: var(--app-header-height-desktop, 52px);
}

[data-theme="light"] {
    --app-text-primary:   var(--app-text);
    --app-text-secondary: var(--app-text-soft);
    --app-surface-rgb:    255, 255, 255;
}

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

html, body {
    font-family: var(--app-font-sans);
    background-color: var(--app-bg);
    color: var(--app-text);
    scroll-behavior: smooth;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* The document never becomes a horizontal scroller. Rails own their overflow.
   clip, unlike hidden, does not turn body into a competing sticky scroll container. */
html, body {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}

.app-header, .network-navigation, .app-footer {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}


/* Subtle page entrance fade-in (skips HTMX swap targets to avoid re-animating) */
.app-body > main {
    animation: page-fade-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes page-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .app-body > main,
    .photo-verified-badge .app-icon {
        animation: none !important;
    }
}


/* ── Typography helpers ──────────────────────────────────── */
.font-brand {
    font-family: var(--app-font-sans);
}

.text-primary  { color: var(--app-primary) !important; }
.text-muted    { color: var(--app-text-muted) !important; }
.text-accent   { color: var(--app-accent) !important; }
.text-success  { color: var(--app-success) !important; }
.text-danger   { color: var(--app-danger) !important; }

/* ── Card / Surface ──────────────────────────────────────── */
.card-dating {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    padding: var(--app-card-padding, 1rem);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card-dating:hover {
    border-color: var(--app-chip-border);
    box-shadow: var(--app-shadow-soft);
}

/* Button appearance is owned by the shared .app-button contract
   (Rebel.Shared.UI). Product styles keep only layout and status. */

/* Profile matching controls returned by MVC/HTMX fragments. */
.profile-status-chip {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    min-height: 31px;
    padding: .36rem .68rem;
    border-radius: 999px;
    border: 1px solid var(--app-border);
    font-size: .8rem;
    font-weight: 800;
    background: color-mix(in srgb, var(--app-surface) 72%, transparent);
    color: var(--app-text-primary);
}

.profile-status-chip--match {
    color: var(--app-primary-dark);
    border-color: color-mix(in srgb, var(--app-primary) 34%, var(--app-border));
    background: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface));
}

.profile-status-chip--matched {
    color: #fff4f7;
    border-color: transparent;
    background: linear-gradient(135deg, color-mix(in srgb, var(--app-primary) 78%, #351421), color-mix(in srgb, var(--app-primary) 42%, var(--app-surface)));
}

.profile-status-chip--liked-me {
    color: #124228;
    border-color: color-mix(in srgb, var(--app-success) 34%, var(--app-border));
    background: linear-gradient(135deg, color-mix(in srgb, var(--app-success) 30%, #ffffff), color-mix(in srgb, var(--app-success) 12%, var(--app-surface)));
}

.profile-status-chip--liked-by-me {
    color: #7a4d10;
    border-color: color-mix(in srgb, var(--app-warning) 24%, var(--app-border));
    background: color-mix(in srgb, var(--app-warning-soft) 84%, var(--app-surface));
}

.profile-matching-panel {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: .55rem;
    width: 100%;
}

.profile-matching-panel .profile-status-chip {
    min-height: 42px;
    border-radius: 13px;
    padding-inline: .78rem;
}

.profile-matching-panel .profile-action-form {
    flex: 1 1 12rem;
}

.profile-action-form {
    margin: 0;
    display: flex;
    flex: 1 1 9rem;
    min-width: min(100%, 8.75rem);
}

/* ── Form controls ───────────────────────────────────────── */
.form-dating {
    background: var(--app-surface-2);
    border: 1.5px solid var(--app-border);
    border-radius: 10px;
    color: var(--app-text);
    padding: 0.6rem 0.9rem;
    width: 100%;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-dating:hover:not(:focus) {
    border-color: var(--app-chip-border);
}
.form-dating:focus {
    border-color: var(--app-primary);
    box-shadow: var(--app-focus-ring);
    transform: translateY(-1px);
}
.form-dating::placeholder { color: var(--app-text-muted); }

.form-label-dating {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--app-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
    display: block;
}

.form-group-dating { margin-bottom: 1.1rem; }

/* Select */
select.form-dating {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239b91b0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.2rem;
}
select.form-dating option {
    background: var(--app-surface-2);
    color: var(--app-text);
}

/* ── Badges / Pills ──────────────────────────────────────── */
.badge-rose {
    background: var(--app-chip-bg);
    color: var(--app-primary);
    border: 1px solid var(--app-chip-border);
    border-radius: 20px;
    padding: 0.2rem 0.65rem;
    font-size: 0.74rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.badge-verified {
    background: rgba(82,212,138,0.18);
    color: var(--app-success);
    border: 1px solid rgba(82,212,138,0.4);
    border-radius: 20px;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.badge-new {
    background: var(--app-info-soft);
    color: var(--app-info);
    border: 1px solid var(--app-border);
    border-radius: 20px;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ── Interest chip (profile page) ───────────────────────── */
.interest-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--app-chip-bg);
    border: 1px solid var(--app-chip-border);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    color: var(--app-text-soft);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.interest-chip:hover {
    border-color: var(--app-primary);
    color: var(--app-primary);
    transform: translateY(-1px);
}

/* ── Avatar ──────────────────────────────────────────────── */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--app-chip-border);
    background: var(--app-surface-2);
    flex-shrink: 0;
}
.avatar-xs { width: 32px;  height: 32px;  }
.avatar-sm { width: 44px;  height: 44px;  }
.avatar-md { width: 64px;  height: 64px;  }
.avatar-lg { width: 96px;  height: 96px;  }
.avatar-xl { width: 140px; height: 140px; }
.avatar-placeholder {
    background: linear-gradient(135deg, var(--app-surface-2) 0%, var(--app-surface) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-text-muted);
    font-size: 1.4rem;
}

/* ── Loading spinner ─────────────────────────────────────── */
.spinner-rose {
    width: 28px;
    height: 28px;
    border: 3px solid var(--app-chip-border);
    border-top-color: var(--app-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ── Page heading ────────────────────────────────────────── */
.page-title {
    font-family: var(--app-font-sans);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--app-text);
    margin-bottom: 0;
    line-height: 1.2;
}

/* ── Divider ─────────────────────────────────────────────── */
.divider-rose {
    border: none;
    height: 1px;
    background: var(--app-divider);
    margin: 1.25rem 0;
}

/* ── Toast ───────────────────────────────────────────────── */
.toast-container-dating {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast-dating {
    background: var(--app-surface-2);
    border: 1px solid var(--app-chip-border);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    color: var(--app-text);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    pointer-events: all;
    animation: toast-in 0.25s ease;
}
.toast-dating.toast-success { border-color: rgba(82,212,138,0.4); }
.toast-dating.toast-danger  { border-color: rgba(255,107,107,0.4); }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(1rem); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── App dialog ──────────────────────────────────────────── */
.app-dialog {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    padding: 0;
    color: var(--app-text);
    min-width: 300px;
    max-width: 480px;
}
.app-dialog::backdrop { background: rgba(0,0,0,0.65); }

/* TomSelect closed-control and body-level dropdown anatomy is canonical in
   shared-controls.css (Rebel.Shared.UI), which loads after this file. */

/* ── Profile grid cards (HTMX-swapped, global needed) ─────── */
.profile-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.profile-card-item {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}
.profile-card-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--app-shadow-card),
                0 0 0 1px var(--app-chip-border);
    text-decoration: none;
    color: inherit;
}
.profile-card-item:active {
    transform: translateY(-1px) scale(0.99);
    transition: transform 0.1s;
}

/* Photo depth gradient — subtle dark fade at bottom for legibility of badges */
.profile-card-img { position: relative; }
.profile-card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        transparent 60%,
        rgba(0, 0, 0, 0.25) 100%);
    pointer-events: none;
}

.profile-card-img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
    background: var(--app-surface-2);
}
.profile-card-img-placeholder {
    width: 100%;
    aspect-ratio: 3/4;
    background: linear-gradient(160deg, var(--app-surface-2) 0%, var(--app-surface) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-text-muted);
}
.profile-card-img-placeholder .app-icon { font-size: 3rem; }

.profile-card-body {
    padding: 0.75rem;
}
.profile-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--app-text);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-card-meta {
    font-size: 0.77rem;
    color: var(--app-text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.profile-card-badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.profile-card-actions {
    position: absolute;
    bottom: 3.8rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}


/* ── Unread badge ────────────────────────────────────────── */
.unread-badge {
    background: var(--app-primary);
    color: #fff;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    min-width: 1.2rem;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 2px 6px rgba(224, 123, 150, 0.4);
}

.unread-total-badge { animation: pulse-soft 2s ease-in-out infinite; }
@keyframes pulse-soft {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.85; transform: scale(0.96); }
}

/* ── Validation ──────────────────────────────────────────── */
.validation-msg {
    font-size: 0.78rem;
    color: var(--app-danger);
    margin-top: 0.25rem;
}
.field-valid   { border-color: var(--app-success) !important; }
.field-invalid { border-color: var(--app-danger) !important; }

/* ── Blazor error UI ─────────────────────────────────────── */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ── Completeness bar ────────────────────────────────────── */
.completeness-bar {
    height: 6px;
    background: var(--app-border);
    border-radius: 3px;
    overflow: hidden;
}
.completeness-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--app-primary) 0%, var(--app-accent) 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}
.completeness-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.35) 50%,
        transparent 100%);
    animation: shine 2.4s ease-in-out infinite;
}
@keyframes shine {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* ── Responsive helpers ──────────────────────────────────── */
@media (max-width: 576px) {
    .hide-xs { display: none !important; }
    .profile-card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    .profile-card-body { padding: 0.5rem 0.625rem; }
    .profile-card-meta { display: none; }
}
@media (min-width: 577px) and (max-width: 991px) {
    .profile-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 992px) {
    .profile-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* ── Profile card extras (HTMX-rendered, must be global) ─── */
.profile-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-card-location {
    font-size: 0.78rem;
    color: var(--app-text-muted);
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-bottom: 0.2rem;
}

.profile-card-location .app-icon {
    font-size: 0.78rem;
}

.profile-card-tagline {
    font-size: 0.78rem;
    color: var(--app-text-soft);
    font-style: italic;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

/* ── Toast container (App.razor renders this) ────────────── */
#toast-container {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast-item {
    background: var(--app-surface-2);
    border: 1px solid var(--app-chip-border);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    color: var(--app-text);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    pointer-events: all;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(1rem);
    transition: opacity 0.25s, transform 0.25s;
}
.toast-item.toast-show {
    opacity: 1;
    transform: translateX(0);
}
.toast-item button {
    background: none;
    border: none;
    color: var(--app-text-muted);
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    font-size: 0.875rem;
}
.toast-success { border-color: rgba(82,212,138,0.4); }
.toast-error   { border-color: rgba(255,107,107,0.4); }
.toast-info    { border-color: var(--app-chip-border); }

/* ── Auth page helpers (Login.razor / Register.razor) ─────── */
.btn-block { display: flex; width: 100%; justify-content: center; }

.auth-title {
    font-family: var(--app-font-sans);
    font-size: 1.5rem; font-weight: 600;
    color: var(--app-text-primary);
    margin: 0 0 0.25rem;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--app-text-muted);
    margin: 0 0 1.5rem;
}

.auth-error {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(220,53,69,0.12);
    border: 1px solid rgba(220,53,69,0.3);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    font-size: 0.83rem;
    color: var(--app-danger, #dc3545);
    margin-bottom: 1rem;
}
.auth-error .app-icon { font-size: 1rem; flex-shrink: 0; }

.auth-form { display: flex; flex-direction: column; gap: 0.25rem; }

.auth-divider {
    display: flex; align-items: center; gap: 1rem;
    color: var(--app-text-muted); font-size: 0.8rem;
    margin: 1.25rem 0;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; height: 1px;
    background: var(--app-border);
}

.reg-terms {
    display: flex; align-items: flex-start; gap: 0.6rem;
    font-size: 0.8rem; color: var(--app-text-secondary);
    margin: 0.25rem 0;
}
.reg-terms a { color: var(--app-primary); text-decoration: none; }
.reg-terms a:hover { text-decoration: underline; }

.reg-trust {
    display: flex; align-items: center; justify-content: center;
    gap: 1.25rem; flex-wrap: wrap;
    margin-top: 1.25rem;
    font-size: 0.78rem; color: var(--app-text-muted);
}
.reg-trust span {
    display: flex; align-items: center; gap: 0.3rem;
}
.reg-trust .app-icon { font-size: 0.9rem; color: var(--app-primary); }

/* ── Focus-ring override ─────────────────────────────────────── */
section:focus, div:focus, main:focus, header:focus, nav:focus,
footer:focus, article:focus, aside:focus, html:focus, body:focus,
h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus,
p:focus, span:focus, ul:focus, ol:focus, li:focus, form:focus,
section:focus-visible, div:focus-visible, main:focus-visible,
header:focus-visible, nav:focus-visible, footer:focus-visible,
article:focus-visible, aside:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--app-primary);
    outline-offset: 2px;
    box-shadow: none !important;
}

/* ── HTMX-injected fragments (must be global, not scoped) ─── */

/* Photo thumbs injected by UploadPhoto */
.my-photo-thumb {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--app-border);
    transition: border-color 0.15s;
}
.my-photo-thumb--primary { border-color: var(--app-primary); }
.my-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

.photo-primary-badge {
    position: absolute;
    bottom: 0.375rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--app-primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    white-space: nowrap;
}

.photo-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 50%;
    background: rgba(0,0,0,0.65);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s;
}
.my-photo-thumb:hover .photo-delete-btn { opacity: 1; }
.photo-delete-btn .app-icon { font-size: 0.875rem; }

@media (hover: none) {
    .photo-delete-btn { opacity: 1; }
    .prompt-del-btn   { opacity: 1; }
}

/* Language chips injected by AddLanguage */
.lang-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--app-chip-bg);
    border: 1px solid var(--app-chip-border);
    border-radius: 2rem;
    padding: 0.3rem 0.75rem 0.3rem 0.875rem;
}
.lang-chip-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--app-text-primary);
}
.lang-chip-level {
    font-size: 0.75rem;
    color: var(--app-text-muted);
    border-left: 1px solid var(--app-border);
    padding-left: 0.375rem;
}
.lang-chip-del {
    background: none;
    border: none;
    color: var(--app-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
    margin-left: 0.125rem;
    transition: color 0.15s;
}
.lang-chip-del:hover { color: var(--app-danger); }
.lang-chip-del .app-icon { font-size: 0.875rem; }

/* Prompt cards injected by AddPrompt */
.my-prompt-card {
    background: var(--app-bg);
    border: 1px solid var(--app-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.my-prompt-q {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-text-muted);
}
.my-prompt-a {
    font-size: 0.9375rem;
    color: var(--app-text-primary);
    font-family: var(--app-font-sans);
    font-style: italic;
    line-height: 1.5;
}
.prompt-del-btn {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    background: none;
    border: none;
    color: var(--app-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
    opacity: 0;
}
.my-prompt-card:hover .prompt-del-btn { opacity: 1; }
.prompt-del-btn:hover { color: var(--app-danger); background: rgba(255,107,107,0.1); }
.prompt-del-btn .app-icon { font-size: 1.125rem; }


/* ============================================================
   Dating reference-system overrides
   ============================================================ */
:root {
    --app-surface-2: #27292D;
    --app-surface-elevated: #24262B;
    --app-card: #1D1F22;
    --app-text-primary: #F2F2F0;
    --app-text-secondary: #C7C8CC;
    --app-primary-alpha: rgba(170,167,255,0.14);
    --app-danger-soft: rgba(240,131,139,0.14);
    --app-warning-soft: rgba(232,181,88,0.14);
    --app-info-soft: rgba(124,198,220,0.14);
    --app-chip-bg: rgba(170,167,255,0.14);
    --app-chip-border: rgba(170,167,255,0.32);
    --app-field-bg: #1D1F22;
    --app-hover-bg: rgba(255,255,255,0.06);
    --app-pill-bg: rgba(255,255,255,0.06);
    --app-focus-ring: 0 0 0 3px rgba(170, 167, 255, 0.35);
    --app-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.32), 0 8px 24px rgba(0, 0, 0, 0.24);
    --app-overlay-backdrop: rgba(10, 10, 12, .72);
    --app-overlay-panel: var(--app-bg);
    --app-surface-rgb: 29,31,34;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 16px;
    --radius-xxl: 16px;
    --app-page-padding-block: 1.25rem;
    --app-section-gap: 1rem;
    --app-card-padding-compact: 0.85rem;
    --app-grid-gap: 0.75rem;
    --app-grid-gap-compact: 0.5rem;
    --header-height: var(--app-header-height-desktop);
    --z-sticky-header: 100;
    --z-mobile-nav: 700;
}

[data-theme="light"] {
    --app-surface-2: #EEEFEC;
    --app-surface-elevated: #FFFFFF;
    --app-card: #FFFFFF;
    --app-text-primary: #202124;
    --app-text-secondary: #41454C;
    --app-primary-alpha: rgba(87,91,199,0.10);
    --app-danger-soft: #FBE9E9;
    --app-warning-soft: #FBF0DA;
    --app-info-soft: #E2F2F7;
    --app-chip-bg: rgba(87,91,199,0.08);
    --app-chip-border: rgba(87,91,199,0.28);
    --app-field-bg: #FFFFFF;
    --app-hover-bg: #EFEFEB;
    --app-pill-bg: #EFEFEB;
    --app-focus-ring: 0 0 0 3px rgba(87, 91, 199, 0.28);
    --app-shadow-card: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.08);
    --app-overlay-backdrop: rgba(32, 33, 36, .5);
    --app-overlay-panel: var(--app-bg);
    --app-surface-rgb: 255,255,255;
}

html, body {
    background: var(--app-bg);
    color: var(--app-text);
    font-family: var(--app-font-sans);
}


.card-dating {
    border: 1px solid var(--app-border);
    background: var(--app-card);
    border-radius: 28px;
    box-shadow: 0 20px 58px rgba(22,16,14,0.10);
}

[data-theme="dark"] .card-dating {
    box-shadow: 0 20px 58px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
}

.card-dating:hover { box-shadow: var(--app-shadow-card); }

.font-brand, h1, h2.logo-serif {
    font-family: var(--app-font-sans);
}


.fancybox__container {
    --fancybox-zIndex: 1600;
}

.profile-match-success-note {
    flex: 1 1 100%;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 38px;
    padding: .55rem .75rem;
    border-radius: 13px;
    color: #33531f;
    background: color-mix(in srgb, var(--app-success-soft) 78%, var(--app-surface));
    border: 1px solid color-mix(in srgb, var(--app-success) 24%, var(--app-border));
    font-weight: 800;
    font-size: .86rem;
}

/* Rebel's existing identity, shared by Dating's header and footer. */
.rebel-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--app-brand-gap, 8px);
    flex-shrink: 0;
    color: var(--app-text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--app-brand-font-size, 18.88px);
    font-weight: 800;
    line-height: 1.6;
    letter-spacing: normal;
    text-decoration: none;
    white-space: nowrap;
}
.rebel-brand:hover { color: var(--app-text-primary); text-decoration: none; }
.rebel-brand__mark {
    display: block;
    width: var(--app-brand-mark-size, 34px);
    height: var(--app-brand-mark-size, 34px);
    flex-shrink: 0;
    border-radius: 6px;
    object-fit: cover;
}

/* Keep sticky editors and scroll targets aligned with the actual header height. */
@media (max-width: 1024px) {
    :root { --header-height: var(--app-header-height-mobile); }
}
:root.header-scroll-hidden { --header-height: 0px; }
/* Dating discovery palette and modal scroll lock. */
[data-theme="light"] {
    --app-surface-2: #EEEFEC;
    --app-surface-elevated: #FFFFFF;
    --app-card: #FFFFFF;
    --app-text-primary: #202124;
    --app-text-secondary: #41454C;
    --app-primary-alpha: rgba(87,91,199,.10);
    --app-chip-bg: rgba(87,91,199,0.08);
    --app-chip-border: rgba(87,91,199,0.28);
    --app-hover-bg: #EFEFEB;
    --app-pill-bg: #EFEFEB;
    --app-field-bg: #FFFFFF;
    --app-surface-rgb: 255,255,255;
    --app-focus-ring: 0 0 0 3px rgba(87, 91, 199, 0.28);
    --app-shadow-card: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.08);
}
html[data-theme="light"], html[data-theme="light"] body { background: #F7F7F5; }
