/* =============================================
   UTOPIA SETTINGS — Gallery-style refresh
   Mobile-first, theme-aware (light + dark).
   Pairs with app-chrome.css (top header + pill nav).
   ============================================= */

/* Local tokens (only what styles.css doesn't already cover) */
:root {
    --settings-radius-card: 1.5rem;     /* rounded-3xl */
    --settings-radius-row:  1rem;       /* rounded-xl */
    --settings-card-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
    --settings-card-border: var(--border-primary);
    --settings-row-bg:      rgba(255, 255, 255, 0.03);
    --settings-row-bg-hover: rgba(255, 255, 255, 0.06);
    --settings-danger:      #ef4444;
    --settings-danger-soft: rgba(239, 68, 68, 0.12);
    --settings-danger-border: rgba(239, 68, 68, 0.32);
    --settings-toggle-track: rgba(255, 255, 255, 0.18);
    --settings-pill-blue:   var(--blue-500);
}

[data-theme="light"] {
    --settings-card-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    --settings-row-bg:      #ffffff;
    --settings-row-bg-hover: #f8fafc;
    --settings-toggle-track: rgba(15, 23, 42, 0.16);
}

/* =============================================
   PAGE FRAME
   ============================================= */
.settings-main {
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* =============================================
   1. PROFILE HERO
   ============================================= */
.profile-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 0 8px;
}

.profile-pic-wrapper {
    position: relative;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    overflow: visible;
    cursor: pointer;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    transition: transform 0.15s ease;
}
.profile-pic-wrapper:hover { transform: scale(1.02); }
.profile-pic-wrapper:active { transform: scale(0.98); }

.profile-pic {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.profile-pic-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #fff;
}
.profile-pic-overlay .material-symbols-outlined { font-size: 32px; }
.profile-pic-wrapper:hover .profile-pic-overlay,
.profile-pic-wrapper:focus-visible .profile-pic-overlay { opacity: 1; }

.profile-pic-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--blue-500);
    color: #fff;
    border: 4px solid var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-pic-badge .material-symbols-outlined { font-size: 18px; }

.hero-name {
    font-family: 'Manrope', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.hero-bio {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 18px;
    max-width: 32ch;
    line-height: 1.45;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px 24px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.hero-meta-item .material-symbols-outlined { font-size: 18px; }

.hero-stats {
    display: flex;
    /* .hero-stats is a shared component and styles.css flips it to
       flex-direction:column on mobile. Force row here (settings.css loads
       after styles.css) so Trades/Cards stay side-by-side at all widths. */
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 28px;
    margin-top: 22px;
    width: 100%;
    max-width: 320px;
    justify-content: center;
}
.hero-stats::before {
    display: none;
}
.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 80px;
}
.hero-stat-value {
    font-family: 'Manrope', sans-serif;
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}
.hero-stat-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    line-height: 1;
}
.hero-stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border-primary);
}

/* =============================================
   2. SECTION BLOCKS (label + card + button)
   ============================================= */
.settings-block {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.block-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin: 0 4px;
}
.block-label.danger { color: var(--settings-danger); }

.block-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border: 1px solid var(--settings-card-border);
    border-radius: var(--settings-radius-card);
    box-shadow: var(--settings-card-shadow);
    overflow: hidden;
}

/* form-card stacks rows with internal padding */
.form-card {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =============================================
   3. FORM ROWS (used in form-card and modal)
   ============================================= */
.form-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--settings-row-bg);
    border: 1px solid var(--border-primary);
    border-radius: var(--settings-radius-row);
    transition: border-color 0.2s ease, background 0.2s ease;
}
.form-row:focus-within {
    border-color: var(--blue-500);
    background: var(--settings-row-bg-hover);
}
.form-row-stack { align-items: flex-start; }
.form-row-stack .form-row-icon { margin-top: 2px; }

.form-row-icon {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 22px !important;
}

.form-row-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.form-row-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.form-row-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.form-row-input,
.form-row-textarea,
.form-row-select {
    width: 100%;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 0;
}
.form-row-input::placeholder { color: var(--text-muted); font-weight: 500; }

.form-row-textarea {
    resize: vertical;
    min-height: 64px;
    line-height: 1.45;
}

.form-row-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 18px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 8 10 12 14 8'/></svg>");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 16px 16px;
}

.form-row-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row-locked .form-row-value { color: var(--text-secondary); }
.form-row-lock {
    color: var(--text-muted);
    font-size: 18px !important;
    flex-shrink: 0;
    opacity: 0.6;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Address search results (Geocoding-based; replaces legacy Places widget) */
.loc-search-row { position: relative; }

.loc-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--settings-radius-row);
    box-shadow: var(--settings-card-shadow);
    max-height: 280px;
    overflow-y: auto;
}

.loc-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border-primary);
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.15s ease;
}
.loc-search-item:last-child { border-bottom: 0; }
.loc-search-item:hover,
.loc-search-item.active { background: var(--settings-row-bg-hover); }

.loc-search-item .material-symbols-outlined {
    font-size: 18px !important;
    color: var(--text-muted);
    flex-shrink: 0;
}
.loc-search-item-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loc-search-empty {
    padding: 14px;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* =============================================
   4. TRADING PREFERENCES (map + radius)
   ============================================= */
.trade-pref-card {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.trade-pref-map-wrap {
    position: relative;
    height: 200px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
    overflow: hidden;
}

.trade-pref-map {
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
}

.trade-pref-map-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    pointer-events: none;
}
.trade-pref-map-placeholder .material-symbols-outlined { font-size: 32px; }
.trade-pref-map-placeholder[hidden] { display: none; }

.map-city-badge {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border: 1px solid var(--border-primary);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 5;
    pointer-events: none;
    white-space: nowrap;
    max-width: calc(100% - 28px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.trade-pref-body {
    padding: 18px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gps-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 4px 2px;
}
.gps-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}
.gps-status.success { color: #10b981; }
.gps-status.error   { color: var(--settings-danger); }

/* Radius control */
.radius-control {
    margin-top: 10px;
    padding: 18px 4px 6px;
    border-top: 1px solid var(--border-primary);
}
.radius-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.radius-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.radius-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}
.radius-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.radius-value {
    display: flex;
    align-items: baseline;
    gap: 1px;
    flex-shrink: 0;
    font-family: 'Manrope', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--blue-500);
    line-height: 1;
}
/* Editable number entry — alternative to dragging the slider.
   Dashed underline signals editability on both touch and pointer. */
.radius-input {
    width: 3ch;
    box-sizing: content-box;
    font: inherit;
    color: inherit;
    text-align: right;
    background: transparent;
    border: none;
    border-bottom: 2px dashed rgba(59, 130, 246, 0.45);
    padding: 2px 3px 1px;
    border-radius: 6px 6px 0 0;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
    appearance: textfield;
    transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.radius-input::-webkit-outer-spin-button,
.radius-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.radius-input:hover { border-bottom-color: var(--blue-500); }
.radius-input:focus {
    outline: none;
    border-bottom: 2px solid var(--blue-500);
    background: rgba(59, 130, 246, 0.10);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.30);
}
.radius-unit { color: inherit; }

.radius-slider-wrap {
    position: relative;
    height: 28px;
}
.radius-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: var(--border-primary);
    border-radius: 2px;
    overflow: hidden;
    pointer-events: none;
}
.radius-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.08s linear;
}
.radius-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 28px;
    background: transparent;
    cursor: pointer;
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0;
}
.radius-slider::-webkit-slider-runnable-track { background: transparent; height: 28px; border: 0; }
.radius-slider::-moz-range-track { background: transparent; height: 28px; border: 0; }
.radius-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--blue-500);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.45);
    margin-top: 2px;          /* (28-24)/2 = 2px to vertically center on the 28px track */
    cursor: grab;
    transition: transform 0.15s ease;
}
.radius-slider::-webkit-slider-thumb:active { transform: scale(1.12); cursor: grabbing; }
.radius-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--blue-500);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.45);
    cursor: grab;
}
.radius-slider:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 2px 10px rgba(59, 130, 246, 0.45);
}

.radius-bounds {
    display: flex;
    justify-content: space-between;
    font-size: 0.625rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-top: 8px;
}

/* =============================================
   5. SETTINGS LIST (toggles + chevron links)
   ============================================= */
.list-card {
    padding: 4px 8px;
}
.list-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    color: inherit;
    text-decoration: none;
    border-radius: 0;
    border-top: 1px solid var(--border-primary);
    transition: background 0.15s ease;
}
.list-card .list-row:first-child { border-top: 0; }
.list-row:hover { background: var(--settings-row-bg-hover); border-radius: 12px; }

.list-row-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}
.list-row-icon .material-symbols-outlined { font-size: 20px; }

.list-row-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.list-row-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}
.list-row-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}
.list-row-chevron {
    color: var(--text-muted);
    font-size: 22px !important;
    flex-shrink: 0;
}

/* =============================================
   6. TOGGLE SWITCH (iOS-style pill)
   ============================================= */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}
.toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}
.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--settings-toggle-track);
    border-radius: 9999px;
    transition: background 0.2s ease;
}
.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}
.toggle-input:checked + .toggle-track { background: var(--blue-500); }
.toggle-input:checked + .toggle-track .toggle-thumb { transform: translateX(20px); }
.toggle-input:focus-visible + .toggle-track {
    outline: 2px solid var(--blue-500);
    outline-offset: 2px;
}

/* =============================================
   7. BUTTONS
   ============================================= */
.btn-primary-pill {
    width: 100%;
    padding: 16px 22px;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: #ffffff;
    font-family: 'Manrope', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}
.btn-primary-pill:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(59, 130, 246, 0.45); }
.btn-primary-pill:active { transform: translateY(0) scale(0.98); }
.btn-primary-pill:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-ghost-pill:hover { background: var(--settings-row-bg-hover); border-color: var(--blue-500); color: var(--blue-500); }
.btn-ghost-pill .material-symbols-outlined { font-size: 18px; }

.btn-danger-pill {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 22px;
    border: 1px solid var(--settings-danger-border);
    border-radius: var(--radius-full);
    background: var(--settings-danger-soft);
    color: var(--settings-danger);
    font-family: 'Manrope', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
.btn-danger-pill:hover { background: rgba(239, 68, 68, 0.18); }
.btn-danger-pill:active { transform: scale(0.98); }
.btn-danger-pill:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-danger-pill .material-symbols-outlined { font-size: 20px; }

.danger-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    padding: 0 8px;
}

.signout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px;
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    font-family: 'Manrope', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease;
    margin-bottom: 24px;
}
.signout-btn:hover { color: var(--settings-danger); }
.signout-btn .material-symbols-outlined { font-size: 22px; }

/* =============================================
   8. MODAL (delete confirmation)
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.96);
    width: calc(100% - 32px);
    max-width: 440px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--settings-radius-card);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.25s var(--home-transition);
    overflow: hidden;
}
.modal.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-primary);
}
.modal-title {
    font-family: 'Manrope', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.modal-close {
    background: none;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.modal-content {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-primary);
}
.modal-footer .btn-ghost-pill,
.modal-footer .btn-danger-pill { flex: 1; padding: 12px 16px; }

.delete-warning {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: var(--settings-danger-soft);
    border: 1px solid var(--settings-danger-border);
    border-radius: 12px;
    align-items: flex-start;
}
.delete-warning .material-symbols-outlined {
    color: var(--settings-danger);
    font-size: 28px;
    flex-shrink: 0;
}
.delete-warning p { margin: 0; font-size: 0.875rem; line-height: 1.5; color: var(--text-primary); }
.delete-warning strong { color: var(--settings-danger); }

/* =============================================
   9. TOAST
   ============================================= */
.toast-notification {
    position: fixed;
    bottom: calc(var(--home-pill-offset) + var(--home-pill-height) + 12px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1100;
    max-width: calc(100% - 32px);
    text-align: center;
}
.toast-notification.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast-notification.toast-success { border-color: rgba(16, 185, 129, 0.6); color: #10b981; }
.toast-notification.toast-error   { border-color: var(--settings-danger-border); color: var(--settings-danger); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 380px) {
    .settings-main { gap: 22px; }
    .hero-name { font-size: 1.375rem; }
    .profile-pic-wrapper { width: 112px; height: 112px; }
    .form-row { padding: 12px 14px; gap: 12px; }
    .radius-value { font-size: 1.375rem; }
    .map-city-badge { font-size: 0.625rem; padding: 5px 10px; }
}

@media (min-width: 640px) {
    .form-grid-2 { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
    .settings-main { gap: 36px; }
    .hero-name { font-size: 1.875rem; }
    .hero-bio { font-size: 0.9375rem; max-width: 40ch; }
    .trade-pref-map-wrap { height: 240px; }
    .form-card { padding: 18px; gap: 12px; }
    .list-card { padding: 6px 12px; }
    .trade-pref-body { padding: 22px 18px 10px; }
    .modal { max-width: 480px; }
}

@media (min-width: 1024px) {
    .settings-main { gap: 44px; }
    .trade-pref-map-wrap { height: 280px; }
    .hero-stats { max-width: 360px; gap: 36px; }
    .hero-stat-value { font-size: 1.25rem; }
}

/* =============================================
   LIGHT-THEME MICRO-OVERRIDES
   The variables above already do most of the
   heavy lifting; these handle a few cases that
   feel better with explicit white surfaces.
   ============================================= */
[data-theme="light"] .form-row {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .form-row:focus-within {
    background: #ffffff;
    border-color: var(--blue-500);
}
[data-theme="light"] .list-row-icon {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .map-city-badge {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .toggle-thumb {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}
[data-theme="light"] .btn-ghost-pill { border-color: rgba(15, 23, 42, 0.14); }
[data-theme="light"] .modal { background: #ffffff; }
[data-theme="light"] .toast-notification {
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
[data-theme="light"] .delete-warning p { color: var(--text-primary); }

/* =============================================
   10. VERIFY-AND-CHANGE FLOW
       (full-page sheet for changing username,
        email, or phone with SMS verification)
   ============================================= */

/* Clickable row variant (replaces .form-row-locked) */
.form-row-action {
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}
.form-row-action:hover {
    background: var(--settings-row-bg-hover);
    border-color: var(--blue-500);
}
.form-row-action:focus-visible {
    outline: 2px solid var(--blue-500);
    outline-offset: 2px;
}
.form-row-action:active { transform: scale(0.997); }

.form-row-chevron {
    color: var(--text-muted);
    font-size: 22px !important;
    flex-shrink: 0;
    opacity: 0.55;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.form-row-action:hover .form-row-chevron {
    opacity: 0.85;
    transform: translateX(2px);
}

/* Overlay backdrop */
.verify-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.verify-overlay.active { opacity: 1; pointer-events: auto; }

/* Full-screen sheet (mobile-first) */
.verify-sheet {
    position: fixed;
    inset: 0;
    z-index: 1101;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    color: var(--text-primary);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity 0.22s ease, transform 0.25s var(--ease-out, cubic-bezier(0,0,0.2,1));
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.verify-sheet.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Header */
.verify-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 14px;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}
.verify-title {
    font-family: 'Manrope', sans-serif;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    text-align: center;
}
.verify-icon-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.verify-icon-btn:hover {
    background: var(--settings-row-bg-hover);
    color: var(--text-primary);
}
.verify-icon-btn .material-symbols-outlined { font-size: 22px; }

/* Body — scroll-safe vertical container with a centered inner column */
.verify-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 18px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-overflow-scrolling: touch;
}

.verify-step {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: verifyFadeIn 0.22s var(--ease-out, cubic-bezier(0,0,0.2,1));
}
@keyframes verifyFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.verify-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.5;
    text-align: center;
}
.verify-subtitle strong { color: var(--text-primary); font-weight: 700; }

.verify-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.verify-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.verify-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--settings-row-bg);
    border: 1px solid var(--border-primary);
    border-radius: var(--settings-radius-row);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}
.verify-input::placeholder { color: var(--text-muted); font-weight: 500; }
.verify-input:focus {
    border-color: var(--blue-500);
    background: var(--settings-row-bg-hover);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}
.verify-hint {
    margin: 2px 2px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.verify-error {
    margin: 4px 2px 0;
    color: var(--settings-danger);
    font-size: 0.8125rem;
    font-weight: 600;
}
.verify-cta { margin-top: 4px; }

/* 6-digit code input — copied from styles.css so the modal styles are self-contained */
.verify-body .code-input-wrapper {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 8px 0 4px;
}
.verify-body .code-digit {
    width: 48px;
    height: 60px;
    padding: 0;
    text-align: center;
    font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--settings-row-bg);
    border: 2px solid var(--border-primary);
    border-radius: 14px;
    outline: none;
    caret-color: var(--blue-500);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.verify-body .code-digit:focus {
    border-color: var(--blue-500);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}
.verify-body .code-digit.filled {
    border-color: var(--sky-500);
    background: rgba(14, 165, 233, 0.08);
}
.verify-body .code-digit.error {
    border-color: var(--settings-danger);
    animation: verifyShake 0.3s var(--ease-out, cubic-bezier(0,0,0.2,1));
}
@keyframes verifyShake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

/* Resend section */
.verify-resend {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin-top: 4px;
}
.verify-resend-btn {
    background: none;
    border: 0;
    color: var(--blue-500);
    font: inherit;
    font-weight: 700;
    margin-left: 4px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.verify-resend-btn:hover:not(:disabled) {
    color: var(--blue-400);
    background: var(--settings-row-bg-hover);
}
.verify-resend-btn:disabled { opacity: 0.5; cursor: not-allowed; }
#verifyResendCountdown { font-weight: 600; color: var(--text-muted); }

/* Success step */
.verify-step-success {
    align-items: center;
    text-align: center;
    padding-top: 12px;
}
.verify-success-icon {
    font-size: 72px !important;
    color: #10b981;
    filter: drop-shadow(0 0 18px rgba(16, 185, 129, 0.35));
}
.verify-success-title {
    font-family: 'Manrope', sans-serif;
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}
.verify-success-sub {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.5;
    max-width: 32ch;
}
.verify-step-success .verify-cta { margin-top: 8px; }

/* --- Tighter mobile spacing --- */
@media (max-width: 380px) {
    .verify-body { padding: 18px 14px 22px; }
    .verify-body .code-digit { width: 42px; height: 56px; font-size: 1.5rem; border-radius: 12px; }
    .verify-body .code-input-wrapper { gap: 8px; }
    .verify-success-icon { font-size: 64px !important; }
}

/* --- Desktop: floating centered card (still full-screen overlay behind) --- */
@media (min-width: 640px) {
    .verify-sheet {
        inset: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, calc(-50% + 12px));
        width: min(560px, calc(100% - 64px));
        max-height: calc(100vh - 64px);
        border-radius: var(--settings-radius-card);
        border: 1px solid var(--border-primary);
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
        overflow: hidden;
    }
    .verify-sheet.active {
        transform: translate(-50%, -50%);
    }
    .verify-body { padding: 28px 28px 32px; }
    .verify-title { font-size: 1.125rem; }
    .verify-body .code-digit { width: 52px; height: 64px; font-size: 1.75rem; }
}

/* --- Light theme overrides --- */
[data-theme="light"] .verify-sheet {
    background: #ffffff;
}
[data-theme="light"] .verify-overlay {
    background: rgba(15, 23, 42, 0.45);
}
[data-theme="light"] .verify-input {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.10);
}
[data-theme="light"] .verify-input:focus {
    background: #ffffff;
    border-color: var(--blue-500);
}
[data-theme="light"] .verify-body .code-digit {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.10);
    color: var(--text-primary);
}
[data-theme="light"] .verify-body .code-digit:focus {
    background: #ffffff;
    border-color: var(--blue-500);
}
[data-theme="light"] .verify-body .code-digit.filled {
    background: rgba(14, 165, 233, 0.08);
    border-color: var(--sky-500);
}
[data-theme="light"] .form-row-action:hover {
    background: #f8fafc;
}
[data-theme="light"] .verify-icon-btn:hover {
    background: #f1f5f9;
}
