/* ==========================================================================
   Nearby app.css — Atlas-aligned
   - Token-driven; no raw hex values. Theme switches via theme.css.
   - Bootstrap 5 reset is loaded before this file; we override .btn-primary,
     .form-control, etc. to align with Atlas.
   - Component-specific styling lives in *.razor.css; this file is global.
   ========================================================================== */

/* ===== Base ===== */
html, body {
    font-family: var(--font-sans);
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

h1:focus { outline: none; }

a, .btn-link {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}
a:hover, .btn-link:hover { color: var(--text-strong); }

/* ── Bootstrap button overrides — Atlas Primary Pill ── */
.btn-primary {
    /* inline-flex + center alignment is required because the button has a
         fixed height and zero vertical padding — without it, the default
         inline-block layout puts the text at the top of the box. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-brand);
    background: var(--brand);
    border: 1px solid var(--text);
    border-radius: var(--radius-pill);
    padding: 0 32px;
    height: 44px;
    font-family: var(--font-sans);
    font-size: var(--text-body-lg);
    line-height: 1;
    font-weight: 400;
    text-decoration: none;
    transition: background var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}

.btn-primary:hover {
    background: var(--brand-strong);
    color: var(--text-on-brand);
    border-color: var(--text);
    transform: translateY(-1px);
}

.btn-primary:active {
    background: var(--brand);
    transform: translateY(0);
}

.btn-primary:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
    box-shadow: none;
}

/* Outline / ghost button — Atlas Ghost Feature Button */
.btn-ghost-atlas {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    background: transparent;
    border: 1px solid var(--surface-border-strong);
    border-radius: var(--radius-outline);
    padding: 8px 16px;
    font-family: var(--font-sans);
    font-size: var(--text-body-lg);
    line-height: 1;
    text-decoration: none;
    transition: background var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out);
}

.btn-ghost-atlas:hover {
    color: var(--text);
    background: var(--surface);
    border-color: var(--text);
}

/* Dark Square Button — secondary nav / minor actions */
.btn-square-atlas {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--text);
    border-radius: var(--radius-square);
    padding: 0 24px 0 32px;
    height: 44px;
    font-family: var(--font-sans);
    font-size: var(--text-body-lg);
    line-height: 1;
    text-decoration: none;
}

.btn-square-atlas:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 2px var(--text);
}

.content { padding-top: 1.1rem; }

.valid.modified:not([type=checkbox]) { outline: 1px solid var(--match); }
.invalid { outline: 1px solid var(--danger); }

.validation-message {
    color: var(--danger);
    font-size: var(--fs-sm);
    margin-top: 0.25rem;
}

.text-muted-light { color: var(--text-muted) !important; }

/* ===== Atlas card (was .atlas-card; the glass-morphism is long gone) =====
     Atlas uses solid surfaces with subtle borders; no backdrop-filter blur. */
.atlas-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: background var(--dur-fast) var(--ease-out);
}

.atlas-card:hover {
    background: var(--surface-strong);
    color: inherit;
}

.atlas-card--flush {
    padding: 0;
    overflow: hidden;
}

.atlas-card-inner {
    background: var(--bg-elev-2);
    border-radius: var(--radius-default);
    padding: var(--space-2);
    border: 1px solid var(--surface-border);
}

/* ===== Setup Form Card ===== */
.setup-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-outline);
    padding: 40px;
}

.setup-card .form-control,
.setup-card .input-group-text {
    background: var(--bg-elev-2);
    color: var(--text);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-input);
    transition: border-color var(--dur-base) var(--ease-out);
}

.setup-card .form-control:focus {
    background: var(--bg-elev-3);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: none;
}

.setup-card .btn-ghost-atlas { border-width: 1px; }

.setup-card .btn-ghost-atlas:hover,
.setup-card .btn-check:checked + .btn-ghost-atlas {
    background: var(--text);
    color: var(--bg);
}

/* ===== Auth Pages ===== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 8rem);
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--surface-border-strong);
    border-radius: var(--radius-outline);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
}

.auth-card h1,
.auth-card h2 {
    color: var(--text);
    font-family: var(--font-sequel);
    font-weight: 400;
    font-size: var(--text-subheading);
    line-height: var(--leading-subheading);
    letter-spacing: var(--tracking-subheading);
}

.auth-card .form-label {
    color: var(--text-soft);
    font-size: var(--text-body);
}

.auth-card .form-control {
    background: var(--bg-elev-2);
    border: 1px solid var(--control-border);
    color: var(--text);
    border-radius: var(--radius-input);
}

.auth-card .form-control:focus {
    background: var(--bg-elev-3);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: none;
}

.auth-card .form-control::placeholder { color: var(--text-faint); }
.auth-card hr { border-color: var(--surface-border); }

.auth-link {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: var(--text-body);
}

.auth-link:hover { color: var(--text-strong); }

/* ===== Page Title ===== */
.page-title {
    color: var(--text);
    font-family: var(--font-sequel);
    font-weight: 400;
    font-size: var(--text-subheading);
    line-height: var(--leading-subheading);
    letter-spacing: var(--tracking-subheading);
    margin-bottom: 1.5rem;
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    font-weight: 500;
    margin-bottom: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-complete { background: var(--match-soft); color: var(--match); }
.status-incomplete { background: var(--super-soft); color: var(--super); }

/* ===== Dashboard Grid ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.matches-preview-card { grid-column: 1 / -1; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item { text-align: center; }

.stat-value {
    display: block;
    font-family: var(--font-sequel);
    font-size: var(--text-heading-lg);
    line-height: var(--leading-heading-lg);
    letter-spacing: var(--tracking-heading-lg);
    font-weight: 400;
    color: var(--text);
}

.stat-label {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.match-preview-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.match-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-input);
    text-decoration: none;
    color: inherit;
    transition: background var(--dur-fast) var(--ease-out);
}

.match-preview-item:hover {
    background: var(--surface-hover);
    color: inherit;
}

.match-preview-reason {
    color: var(--text-soft);
    font-size: var(--text-body);
    text-align: right;
}

@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* ===== Step Indicator ===== */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--surface-border-strong);
    color: var(--text-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
    font-size: var(--text-body);
    transition: all var(--dur-base) var(--ease-out);
}

.step.active .step-num {
    background: var(--brand);
    border-color: var(--text);
    color: var(--text-on-brand);
}

.step-label {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    color: var(--text-faint);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.step.active .step-label { color: var(--text-soft); }

.step-line {
    width: 60px;
    height: 1px;
    background: var(--surface-border-strong);
    margin: 0 0.5rem;
    margin-bottom: 1.2rem;
    transition: background var(--dur-base) var(--ease-out);
}

.step-line.active { background: var(--accent); }

/* ===== Match Grid ===== */
.match-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.match-card {
    transition: transform var(--dur-base) var(--ease-out),
                background var(--dur-base) var(--ease-out);
    cursor: pointer;
}

.match-card:hover {
    transform: translateY(-2px);
    background: var(--surface-strong);
}

.match-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.match-name {
    color: var(--text);
    font-size: var(--text-body-lg);
    font-weight: 400;
    margin: 0;
}

.match-meta {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: var(--text-caption);
}

.match-summary {
    color: var(--text-soft);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* NB-10: why two people were introduced, in one sentence. Replaces every score badge. */
.match-reason {
    color: var(--text);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    font-weight: 500;
    margin: 0.25rem 0 0.6rem;
}

.match-shared { margin-top: 0.5rem; }

.match-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== What you share (match detail) ===== */
.share-reason {
    font-size: var(--text-body-lg);
    line-height: 1.4;
    color: var(--text);
    margin: 0 0 1rem;
}

.share-group + .share-group { margin-top: 0.9rem; }

.share-label {
    display: block;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.share-hello {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--surface-border);
}

.share-icebreaker {
    color: var(--text-soft);
    font-style: italic;
    margin: 0 0 0.75rem;
}

/* ===== Tag Cloud ===== */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-cloud.compact { gap: 0.3rem; }

.tag-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    font-weight: 500;
    letter-spacing: 0.04em;
    border: 1px solid var(--surface-border);
}

.tag-badge.small {
    padding: 0.2rem 0.5rem;
    font-size: var(--text-caption);
}

/* Tag categories — desaturated to fit Atlas dark canvas */
.tag-interest { background: var(--surface); color: var(--text-soft); }
.tag-trait    { background: var(--surface-strong); color: var(--text); }
.tag-goal     { background: var(--match-soft); color: var(--match); }
.tag-more     { background: var(--surface); color: var(--text-faint); }

/* ===== QR Code ===== */
.qr-container {
    display: inline-block;
    padding: 1.5rem;
    background: var(--text-strong);
    border-radius: var(--radius-md);
}

.qr-image {
    width: 200px;
    height: 200px;
    display: block;
}

/* ===== Hero / Landing ===== */
.hero-section {
    text-align: center;
    padding: 6rem 2rem 4rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-sequel);
    font-size: var(--text-heading-lg);
    line-height: var(--leading-heading-lg);
    letter-spacing: var(--tracking-heading-lg);
    font-weight: 400;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-family: var(--font-sans);
    font-size: var(--text-body-lg);
    line-height: var(--leading-body-lg);
    color: var(--text-soft);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Sections ===== */
.section-padded {
    padding: var(--space-5) 2rem;
}

.section-alt {
    background: var(--bg-elev-1);
}

.section-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    color: var(--text);
    font-family: var(--font-sequel);
    font-weight: 400;
    font-size: var(--text-subheading);
    line-height: var(--leading-subheading);
    letter-spacing: var(--tracking-subheading);
    margin-bottom: var(--space-3);
}

/* ===== Steps Grid (Landing) ===== */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.step-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.step-card h3 {
    color: var(--text);
    font-family: var(--font-sequel);
    font-size: var(--text-body-lg);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.step-card p {
    color: var(--text-soft);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    margin: 0;
}

.step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand);
    border: 1px solid var(--text);
    color: var(--text-on-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
    font-size: var(--text-body-lg);
    margin: 0 auto 1rem;
}

@media (max-width: 768px) {
    .steps-grid { grid-template-columns: 1fr; }
    .hero-section { padding: 3rem 1rem 2rem; }
}

/* ===== Features Grid (Landing) ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.feature-card h4 {
    color: var(--text);
    font-family: var(--font-sequel);
    font-size: var(--text-body-lg);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-soft);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    margin: 0;
}

@media (max-width: 640px) {
    .features-grid { grid-template-columns: 1fr; }
}

/* ===== Process List (How It Works) ===== */
.process-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
}

.process-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.process-num {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: var(--brand);
    border: 1px solid var(--text);
    color: var(--text-on-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sequel);
    font-weight: 400;
    font-size: var(--text-body-lg);
}

.process-body h3 {
    color: var(--text);
    font-family: var(--font-sequel);
    font-size: var(--text-body-lg);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.process-body p {
    color: var(--text-soft);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    margin: 0;
}

/* ===== Blazor Error UI ===== */
#blazor-error-ui {
    color-scheme: light only;
    background: var(--super);
    color: var(--bg);
    bottom: 0;
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: var(--danger);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--text-strong);
}

.blazor-error-boundary::after { content: "An error has occurred." }

/* ===== Loading Progress ===== */
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--surface-border-strong);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 500;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--text);
    letter-spacing: 0.04em;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code {
    color: var(--text);
    font-family: var(--font-mono);
    background: var(--surface);
    padding: 0.1em 0.4em;
    border-radius: var(--radius-default);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--text-faint);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ===== Avatar Container Styles ===== */
.avatar-container {
    text-align: center;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    position: relative;
    min-height: 450px;
}

.avatar-3d-canvas {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-input);
    overflow: hidden;
    margin: 10px auto;
    background: var(--bg-elev-2);
    position: relative;
}

.avatar-3d-canvas.loading::after {
    content: 'Loading avatar...';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-strong);
    color: var(--text);
    font-size: var(--text-body);
    border-radius: var(--radius-input);
}

.avatar-3d-canvas canvas { border-radius: var(--radius-input); }

/* Voice on/off toggle pinned to the top-right of the avatar container.
   Uses an emoji glyph rather than an icon font so it works without
   pulling in a new dependency, and stays legible on dark surfaces. */
.aria-voice-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--surface-border);
    background: var(--surface-strong);
    color: var(--text);
    font-size: var(--text-body-lg);
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 120ms ease, transform 120ms ease;
}

.aria-voice-toggle:hover {
    background: var(--surface);
    transform: scale(1.05);
}

.aria-voice-toggle:focus-visible {
    outline: 2px solid var(--accent, #4a9eff);
    outline-offset: 2px;
}

.aria-voice-toggle[aria-pressed="true"] {
    /* Muted state — softer presence so the on state is the visible default. */
    opacity: 0.7;
}

.avatar-controls {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.avatar-controls .btn {
    font-size: var(--text-title);
    padding: 8px 15px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--dur-fast) var(--ease-out);
}

.avatar-controls .btn:hover {
    background: var(--surface-hover);
}

/* Speech Bubble */
.speech-bubble,
.speech-bubble-3d {
    position: relative;
    background: var(--text);
    color: var(--bg);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    max-width: 300px;
    min-width: 200px;
    font-size: var(--text-body);
    line-height: var(--leading-body);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent var(--text) transparent;
}

.emotion-indicator {
    margin-top: 15px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: var(--text-body);
    padding: 10px 20px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-full);
    display: inline-block;
    letter-spacing: 0.04em;
}

/* ===== Interaction Panel / Chat ===== */
.interaction-panel {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 25px;
    height: 100%;
}

.interaction-panel h2,
.interaction-panel h3 {
    color: var(--text);
    font-family: var(--font-sequel);
    margin-bottom: 20px;
    font-weight: 400;
}

.messages {
    height: 300px;
    overflow-y: auto;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-input);
    padding: 15px;
    margin-bottom: 15px;
    background: var(--bg-elev-2);
}

.message {
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
    max-width: 80%;
}

.message.user {
    background: var(--brand);
    color: var(--text-on-brand);
    margin-left: auto;
    text-align: right;
}

.message.avatar {
    background: var(--surface-strong);
    color: var(--text);
    margin-right: auto;
}

.input-area { margin-top: 15px; }

.input-area textarea {
    border-radius: var(--radius-input);
    border: 1px solid var(--control-border);
    background: var(--bg-elev-2);
    color: var(--text);
    transition: border-color var(--dur-base) var(--ease-out);
}

.input-area textarea:focus {
    border-color: var(--accent);
    box-shadow: none;
}

.input-area .btn {
    border-radius: var(--radius-pill);
    padding: 10px 25px;
}

.input-area .btn-primary {
    background: var(--brand);
    border: 1px solid var(--text);
}

.input-area .btn-secondary {
    background: var(--surface);
    border: 1px solid var(--surface-border-strong);
    color: var(--text);
}

.input-area .btn-info {
    background: var(--info);
    border: 1px solid var(--text);
    color: var(--text);
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== Question Form Styles ===== */
.question-form { margin-top: 20px; }

.question-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 25px;
    border-left: 3px solid var(--accent);
}

.question-text {
    color: var(--text);
    font-family: var(--font-sequel);
    font-weight: 400;
    margin-bottom: 10px;
}

.required-badge {
    background: var(--danger);
    color: var(--text-strong);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    margin-bottom: 15px;
    display: inline-block;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.answer-section { margin: 20px 0; }

.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--bg-elev-2);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-input);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out);
}

.option-item:hover {
    background: var(--surface-hover);
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.yes-no-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.yes-no-buttons .btn {
    padding: 15px 40px;
    font-size: var(--text-body-lg);
    border-radius: var(--radius-pill);
}

.rating-stars {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.star {
    font-size: 2.5rem;
    color: var(--surface-border-strong);
    cursor: pointer;
    transition: color var(--dur-fast) var(--ease-out);
}

.star:hover, .star.filled {
    color: var(--super);
}

.rating-label {
    margin-left: 15px;
    color: var(--text-soft);
    font-size: var(--text-body-lg);
}

.submit-answer {
    width: 100%;
    padding: 12px;
    font-size: var(--text-body-lg);
    margin-top: 15px;
}

/* ===== Dark form controls for dashboard context ===== */
.atlas-card .form-control {
    background: var(--bg-elev-2);
    border: 1px solid var(--control-border);
    color: var(--text);
    border-radius: var(--radius-input);
}

.atlas-card .form-control:focus {
    background: var(--bg-elev-3);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: none;
}

.atlas-card .form-control::placeholder { color: var(--text-faint); }

/* ===== Leaflet Map Dark Theme ===== */
/* --map-h comes from the LeafletMap component's Height parameter. */
.leaflet-map-container {
    height: var(--map-h, 400px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.map-placeholder {
    min-height: var(--map-h, 400px);
}

.leaflet-popup-content-wrapper {
    background: var(--surface);
    border-radius: var(--radius-input);
    border: 1px solid var(--surface-border-strong);
    color: var(--text);
}

.leaflet-popup-tip {
    background: var(--surface);
}

.leaflet-popup-content {
    font-family: var(--font-sans);
    color: var(--text);
    font-size: var(--text-body);
    margin: 10px 14px;
}

.leaflet-popup-content a {
    color: var(--text);
    text-decoration: underline;
}

.leaflet-popup-content-wrapper .leaflet-popup-close-button {
    color: var(--text-faint);
}

.leaflet-dark-tooltip {
    background: var(--surface-strong);
    border: 1px solid var(--surface-border);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--text-body);
    border-radius: var(--radius-default);
    padding: 4px 10px;
}

.leaflet-dark-tooltip::before {
    border-top-color: var(--surface-strong);
}

.user-marker-pulse {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--map-accent); /* drawn on dark tiles in both themes */
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 0 rgba(140, 155, 255, 0.6);
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(140, 155, 255, 0.6); }
    70% { box-shadow: 0 0 0 12px rgba(140, 155, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(140, 155, 255, 0); }
}

.leaflet-control-zoom a {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--surface-border) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--surface-hover) !important;
}

.leaflet-control-attribution {
    background: var(--surface) !important;
    color: var(--text-faint) !important;
    font-family: var(--font-mono);
    font-size: var(--text-caption);
}

.leaflet-control-attribution a {
    color: var(--text-soft) !important;
}

/* Placeholder shown instead of the map until the visitor opts in to CARTO tiles. */
.map-consent {
    min-height: var(--map-h, auto);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-elev-1);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    color: var(--text);
}

.map-consent-title {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-body-lg);
    color: var(--text);
}

.map-consent-note {
    margin: 0;
    max-width: 36ch;
    font-size: var(--text-body);
    line-height: var(--lh-base);
    color: var(--text-muted);
}

.map-consent-action {
    margin-top: 0.5rem;
    cursor: pointer;
}

.map-consent--mini {
    padding: 1rem;
    gap: 0.25rem;
}

.map-consent--mini .map-consent-title {
    font-size: var(--text-body);
}

.map-consent--mini .map-consent-note {
    font-size: var(--fs-sm);
}

.map-consent--mini .map-consent-action {
    margin-top: 0.25rem;
    font-size: var(--text-body);
}

/* A drawn map, with the control that withdraws tile consent underneath it. */
.map-frame {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.leaflet-map-container:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.map-hide-action {
    align-self: flex-end;
    margin: 0 0.5rem 0.25rem;
    padding: 0.25rem 0.5rem;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: var(--fs-sm);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.map-hide-action:hover {
    color: var(--text);
}

.map-hide-action:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

/* Map switch on the cookie page. */
.map-tile-setting {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.map-tile-setting .map-tile-setting-state {
    margin: 0;
    color: var(--text);
}

/* Live region that announces "Map shown" / "Map hidden"; read out, not shown. */
.map-status {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Location Consent Dialog ===== */
.consent-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.consent-dialog {
    max-width: 540px;
    width: 90%;
    background: var(--surface);
    border: 1px solid var(--surface-border-strong);
    border-radius: var(--radius-outline);
    padding: 2rem;
    color: var(--text);
}

.consent-dialog h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text);
    font-family: var(--font-sequel);
    font-weight: 400;
}

.consent-body {
    font-size: var(--text-body);
    line-height: var(--leading-body);
    margin-bottom: 1.5rem;
}

.consent-body ul {
    padding-left: 1.2rem;
}

.consent-body li {
    margin-bottom: 0.5rem;
}

.consent-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ===== Debug Panel ===== */
.debug-btn {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--super);
    border: 1px solid var(--super-soft);
    border-radius: var(--radius-default);
    padding: 2px 8px;
    opacity: 0.7;
    transition: opacity var(--dur-fast) var(--ease-out);
}

.debug-btn:hover {
    opacity: 1;
    color: var(--super);
    border-color: var(--super);
}

.debug-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1rem;
    z-index: 10000;
}

.debug-panel {
    width: 480px;
    max-width: 95vw;
    max-height: calc(100vh - 2rem);
    background: var(--surface);
    border: 1px solid var(--super-soft);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--super-soft);
}

.debug-header h3 {
    margin: 0;
    font-family: var(--font-mono);
    font-size: var(--text-body);
    font-weight: 500;
    color: var(--super);
    letter-spacing: 0.05em;
}

.debug-close {
    background: none;
    border: none;
    color: var(--text-faint);
    font-size: var(--text-title);
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.debug-close:hover {
    color: var(--text);
}

.debug-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1.25rem;
}

.debug-section {
    margin-bottom: 1.25rem;
}

.debug-section:last-child {
    margin-bottom: 0;
}

.debug-section h4 {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--super);
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--surface-border);
}

.debug-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.25rem 0;
    gap: 1rem;
}

.debug-label {
    font-size: var(--text-body);
    color: var(--text-faint);
    flex-shrink: 0;
}

.debug-value {
    font-size: var(--text-body);
    color: var(--text);
    text-align: right;
    word-break: break-all;
}

.debug-mono {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
}

.debug-link {
    font-size: var(--text-body);
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.debug-link:hover {
    color: var(--text-strong);
}

.debug-claims {
    margin-top: 0.75rem;
}

.debug-claims h5 {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin: 0 0 0.4rem 0;
}

.debug-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-caption);
}

.debug-table th {
    text-align: left;
    color: var(--text-faint);
    font-weight: 500;
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--surface-border);
}

.debug-table td {
    padding: 0.25rem 0.5rem;
    color: var(--text-soft);
    border-bottom: 1px solid var(--surface-border);
    word-break: break-all;
}

.debug-table tr:hover td {
    background: var(--surface-hover);
}

.debug-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--surface-border);
    display: flex;
    justify-content: flex-end;
}

/* ── Chat Connection Banner ── */

.chat-connection-banner {
    padding: 0.6rem 1rem;
    font-size: var(--text-body);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--surface-border);
}

.chat-connection-banner.banner-info {
    background: rgba(106, 144, 196, 0.15);
    color: var(--info);
}

.chat-connection-banner.banner-warning {
    background: var(--super-soft);
    color: var(--super);
}

.chat-connection-banner.banner-danger {
    background: rgba(212, 90, 90, 0.15);
    color: var(--danger);
}

.pending-badge {
    margin-left: auto;
    background: var(--surface-strong);
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    font-weight: 500;
    letter-spacing: 0.04em;
}

/* ── Discover page ── */

.discover-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.discover-chip {
    background: var(--surface);
    border: 1px solid var(--surface-border-strong);
    color: var(--text-soft);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-outline);
    font-size: var(--text-body);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out);
}

.discover-chip:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.discover-chip.active {
    background: var(--brand);
    color: var(--text-on-brand);
    border-color: var(--text);
}

.discover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.discover-card {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    transition: transform var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out);
}

.discover-card:hover {
    transform: translateY(-2px);
    background: var(--surface-strong);
    text-decoration: none;
}

.discover-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--surface-border-strong);
}

.discover-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: var(--text-on-brand);
    font-family: var(--font-sequel);
    font-size: var(--text-subheading);
    font-weight: 400;
    text-transform: uppercase;
}

.discover-info {
    flex: 1;
    min-width: 0;
}

.discover-name {
    color: var(--text);
    font-size: var(--text-body-lg);
}

.discover-meta {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: var(--text-caption);
}

.discover-reason {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.reason-badge {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-default);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
    border: 1px solid var(--surface-border);
}

.reason-badge.reason-new-member       { background: var(--match-soft);  color: var(--match); }
.reason-badge.reason-recently-active  { background: rgba(106, 144, 196, 0.18); color: var(--info); }
.reason-badge.reason-nearby           { background: var(--super-soft);  color: var(--super); }
.reason-badge.reason-high-compatibility { background: var(--like-soft); color: var(--like); }

.reason-detail {
    font-size: var(--text-body);
    color: var(--text-faint);
}

.last-active {
    display: block;
    margin-top: 0.3rem;
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    color: var(--match);
}

.verified-check {
    background: var(--match-soft);
    color: var(--match);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-caption);
    font-weight: 500;
}

/* ── Search page ── */

.search-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-result-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: transform var(--dur-fast) var(--ease-out);
}

.search-result-card:hover {
    transform: translateX(4px);
    text-decoration: none;
}

.search-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--surface-border-strong);
}

.search-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: var(--text-on-brand);
    font-family: var(--font-sequel);
    font-size: var(--text-body-lg);
    font-weight: 400;
    text-transform: uppercase;
}

.search-info {
    flex: 1;
    min-width: 0;
}

/* ── Who Viewed Me widget ── */

.viewers-badge {
    background: rgba(106, 144, 196, 0.20);
    color: var(--info);
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    font-weight: 500;
    letter-spacing: 0.04em;
}

.viewers-row {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.3rem;
}

.viewer-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    min-width: 56px;
    flex-shrink: 0;
}

.viewer-pill img,
.viewer-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--surface-border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: var(--text-on-brand);
    font-family: var(--font-sequel);
    font-size: var(--text-body-lg);
    font-weight: 400;
    text-transform: uppercase;
}

.viewer-time {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    margin-top: 0.2rem;
}

/* ── Match Avatar ── */

.match-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--surface-border-strong);
}

.match-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: var(--text-on-brand);
    font-family: var(--font-sequel);
    font-size: var(--text-body-lg);
    font-weight: 400;
    text-transform: uppercase;
}

/* ── Photo Gallery ── */

.photo-gallery {
    width: 100%;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--surface-border-strong);
    cursor: pointer;
    transition: transform var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
}

.photo-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.photo-item.primary {
    border-color: var(--super);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.primary-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--super);
    color: var(--bg);
    font-size: var(--text-body);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.photo-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--dur-fast) var(--ease-out);
}

/* Keyboard users reach the actions too: show them whenever anything in the tile has focus. */
.photo-item:hover .photo-actions,
.photo-item:focus-within .photo-actions {
    opacity: 1;
}

.photo-open {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

.photo-open:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: -3px;
}

.btn-photo-action {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.75);
    color: var(--text);
    font-size: var(--text-body-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-photo-action.btn-delete {
    background: var(--danger);
    font-size: var(--text-body-lg);
    line-height: 1;
}

.btn-photo-action:hover {
    transform: scale(1.1);
}

.photo-upload-slot {
    aspect-ratio: 1;
    border: 1px dashed var(--surface-border-strong);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out);
    background: var(--surface);
}

.photo-upload-slot:hover {
    border-color: var(--accent);
    background: var(--surface-strong);
}

/* Visually hidden, not display:none, so the file picker stays reachable with the keyboard. */
.photo-upload-slot input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.photo-upload-slot {
    position: relative;
}

.photo-upload-slot:focus-within {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.upload-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-soft);
    font-size: var(--text-body);
}

.upload-icon {
    font-size: 2rem;
    line-height: 1;
}

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-faint);
    font-size: 3rem;
}

.photo-placeholder p {
    font-size: var(--text-body-lg);
    margin-top: 0.5rem;
}

.photo-lightbox {
    position: fixed;
    inset: 0;
    width: 100%;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    cursor: pointer;
}

.photo-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-md);
}

/* ── Notification Bell ── */

.notification-bell {
    position: relative;
    display: inline-block;
}

.bell-btn {
    position: relative;
    font-size: var(--text-title);
    padding: 0.3rem 0.6rem;
    min-width: 44px;
    min-height: 44px;
    background: transparent;
    border: 0;
    color: var(--text);
}

.bell-btn:hover {
    background: var(--surface);
    color: var(--text);
}

.bell-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: var(--text-strong);
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notification-panel {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 340px;
    max-height: 480px;
    background: var(--surface);
    border: 1px solid var(--surface-border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notification-panel-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--surface-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
    font-weight: 400;
}

.notification-list {
    overflow-y: auto;
    max-height: 400px;
}

.notification-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-faint);
    font-size: var(--text-body);
}

.notification-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--surface-border);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out);
}

.notification-item:hover {
    background: var(--surface-hover);
}

.notification-item.unread {
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
}

.notification-panel-title {
    margin: 0;
    font-size: var(--text-body);
    font-weight: 600;
    color: var(--text);
}

.notification-item:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: -2px;
}

.notification-title,
.notification-body,
.notification-time {
    display: block;
}

.notification-title {
    color: var(--text);
    font-weight: 400;
    font-size: var(--text-body);
    margin-bottom: 0.2rem;
}

.notification-body {
    color: var(--text-soft);
    font-size: var(--text-body);
    margin-bottom: 0.3rem;
}

.notification-time {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: var(--text-caption);
}

/* ── Profile Completion ── */

.completion-bar {
    padding: 0;
}

.completion-label {
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0;
}

/* Plain text colour: a next step, not a warning. */
.completion-hint {
    font-size: var(--text-body);
    color: var(--text-soft);
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* ── Icebreaker Suggestions ── */

.icebreaker-section {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.icebreaker-title {
    color: var(--text-soft);
    font-size: var(--text-body);
    margin-bottom: 0.25rem;
}

.icebreaker-btn {
    background: var(--surface);
    border: 1px solid var(--surface-border-strong);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    color: var(--text);
    font-size: var(--text-body);
    text-align: left;
    cursor: pointer;
    transition: background var(--dur-base) var(--ease-out),
                border-color var(--dur-base) var(--ease-out);
}

.icebreaker-btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
}

.icebreaker-tone {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--text-caption);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--info);
    margin-right: 0.5rem;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-default);
    background: rgba(106, 144, 196, 0.12);
    vertical-align: middle;
}

/* ── Compact language picker: flag-only buttons with hover tooltip ──
     Used on /profile/create step 3 (language preferences) and any other
     multi-select language list. Flag is the affordance; full language
     name surfaces in a tooltip overlay on hover/focus. */
.lang-flag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lang-flag-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border-strong);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    line-height: 1;
    transition: transform var(--dur-base) var(--ease-out),
                border-color var(--dur-base) var(--ease-out),
                background var(--dur-base) var(--ease-out);
}

.lang-flag-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: var(--surface-hover);
}

.lang-flag-btn:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}

.lang-flag-btn.selected {
    border-color: var(--accent);
    background: var(--surface-hover);
    box-shadow: inset 0 0 0 2px var(--accent);
}

.lang-flag-img {
    display: block;
    width: 1.75rem;          /* 28px — fits inside the 44px button with padding */
    height: 1.3rem;           /* ~4:3, matches most national flag aspect ratios */
    object-fit: cover;        /* trim flags with extreme aspect to keep grid tidy */
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    user-select: none;
    -webkit-user-drag: none;
}

.lang-flag-check {
    position: absolute;
    bottom: -3px;
    right: -3px;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.2rem;
    border-radius: 999px;
    background: var(--brand);
    color: var(--text-on-brand);
    font-size: var(--text-caption);
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--surface);
}

/* Tooltip overlay (CSS-only, no JS) */
.lang-flag-btn[data-tooltip]:hover::after,
.lang-flag-btn[data-tooltip]:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.35rem 0.6rem;
    background: rgba(0, 0, 0, 0.92);
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: var(--text-body-sm);
    font-weight: 500;
    letter-spacing: 0;
    white-space: nowrap;
    border-radius: var(--radius-default);
    pointer-events: none;
    z-index: 10;
}

.lang-flag-btn[data-tooltip]:hover::before,
.lang-flag-btn[data-tooltip]:focus-visible::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 0.1rem);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.92);
    pointer-events: none;
    z-index: 10;
}
