/* ============================================================
   SocialNet 1.2 — «Люди», «Чёрный список», новые функции
   ============================================================ */

:root {
    --sn-glass: rgba(255, 255, 255, 0.86);
    --sn-glass-border: rgba(255, 255, 255, 0.7);
    --sn-shadow: 0 8px 32px rgba(79, 70, 229, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    --sn-grad: linear-gradient(135deg, #4f46e5 0%, #9333ea 50%, #ec4899 100%);
    --sn-soft: rgba(79, 70, 229, 0.08);
    --sn-online: #22c55e;
}
html.theme-dark {
    --sn-glass: rgba(30, 41, 59, 0.78);
    --sn-glass-border: rgba(148, 163, 184, 0.15);
    --sn-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --sn-soft: rgba(129, 140, 248, 0.14);
}

.btn.btn-icon {
    width: 38px;
    padding-left: 0;
    padding-right: 0;
    text-align: center;
    justify-content: center;
    flex: 0 0 auto;
}

/* ============================================================
   Общая оболочка страниц «Люди» и «Чёрный список»
   ============================================================ */
.people-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 0 40px;
}

.people-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding: 28px 28px 24px;
    border-radius: 24px;
    background: var(--sn-glass);
    border: 1px solid var(--sn-glass-border);
    box-shadow: var(--sn-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
}
.people-hero::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--sn-grad);
}
.people-hero-text h1 {
    margin: 0 0 6px;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--sn-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.people-hero-text p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.people-hero-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); opacity: .5; }
.people-hero-online { color: #16a34a; font-weight: 600; }
.people-hero-online::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--sn-online);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .5);
    animation: sn-pulse 2s infinite;
    vertical-align: 1px;
}
@keyframes sn-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); }
    70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Поиск */
.people-search {
    display: flex;
    gap: 8px;
    flex: 1 1 420px;
    max-width: 560px;
}
.people-search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 2;
    min-width: 0;
    padding: 0 14px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    transition: border-color .15s, box-shadow .15s;
}
.people-search-field.is-city { flex: 1; }
.people-search-field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--sn-soft);
}
.people-search-field svg {
    width: 18px; height: 18px;
    fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
    flex: 0 0 auto;
}
html body .people-search-field input[type="search"] {
    flex: 1;
    min-width: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
    padding: 11px 0;
    font-size: 15px;
    color: var(--text);
}
.people-search .btn { border-radius: 14px; padding-left: 18px; padding-right: 18px; }

/* Вкладки-фильтры */
.people-tabs {
    display: flex;
    gap: 8px;
    margin: 18px 0 14px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px;
}
.people-tabs::-webkit-scrollbar { display: none; }
.people-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--sn-glass);
    border: 1px solid var(--sn-glass-border);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: transform .15s, background .15s, color .15s;
}
.people-tab:hover { transform: translateY(-1px); color: var(--primary); }
.people-tab.is-active {
    background: var(--sn-grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 18px rgba(99, 102, 241, .3);
}
.people-tab-count {
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--sn-soft);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.people-tab.is-active .people-tab-count { background: rgba(255, 255, 255, .25); }
.people-tab-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sn-online); }

/* Панель над сеткой */
.people-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 0 4px;
}
.people-found { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.people-found strong { font-size: 18px; }
.people-found span { color: var(--muted); font-size: 14px; }
.people-reset { font-size: 13px; color: var(--primary); text-decoration: none; }
.people-reset:hover { text-decoration: underline; }
.people-sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.people-sort select {
    padding: 7px 30px 7px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}

#people-results { transition: opacity .2s; }
#people-results.is-loading { opacity: .45; pointer-events: none; }

/* ============================================================
   Карточка человека
   ============================================================ */
.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}
.person-card {
    --hue: 250;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-radius: 20px;
    background: var(--sn-glass);
    border: 1px solid var(--sn-glass-border);
    box-shadow: var(--sn-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    animation: sn-card-in .35s ease both;
}
.person-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(79, 70, 229, .16);
}
@keyframes sn-card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.people-grid .person-card:nth-child(2) { animation-delay: .03s; }
.people-grid .person-card:nth-child(3) { animation-delay: .06s; }
.people-grid .person-card:nth-child(4) { animation-delay: .09s; }
.people-grid .person-card:nth-child(n+5) { animation-delay: .12s; }

.person-cover {
    display: block;
    width: 100%;
    height: 78px;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.35) 0, transparent 45%),
        linear-gradient(135deg, hsl(var(--hue), 82%, 62%) 0%, hsl(calc(var(--hue) + 50), 78%, 60%) 100%);
}
.person-card.is-self .person-cover { background: var(--sn-grad); }

.person-avatar {
    position: relative;
    display: block;
    margin-top: -48px;
    border-radius: 50%;
    padding: 4px;
    background: var(--card);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .1);
}
.person-avatar img { display: block; width: 88px !important; height: 88px !important; border-radius: 50%; object-fit: cover; }
.person-online {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--sn-online);
    border: 3px solid var(--card);
}

.person-body { padding: 10px 16px 0; width: 100%; box-sizing: border-box; flex: 1; }
.person-name {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.person-name a { color: var(--text); text-decoration: none; }
.person-name a:hover { color: var(--primary); }
.person-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--sn-soft);
    color: var(--primary);
}
.person-tag.is-new { background: rgba(236, 72, 153, .12); color: #db2777; }
html.theme-dark .person-tag.is-new { background: rgba(236, 72, 153, .18); color: #f9a8d4; } /* 1.3.21 */
.person-line {
    margin: 4px 0 12px;
    min-height: 20px;
    font-size: 13px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
    padding: 10px 0;
    list-style: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.person-stats li { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.person-stats li + li { border-left: 1px solid var(--border); }
.person-stats b { font-size: 16px; color: var(--text); }
.person-stats span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.person-seen b { color: var(--muted); font-size: 13px; line-height: 19px; }
.person-seen.is-online b, .person-seen.is-online span { color: #16a34a; }

.person-mutual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
}
.person-mutual-faces { display: inline-flex; }
.person-mutual-faces img {
    width: 22px !important; height: 22px !important;
    border-radius: 50%;
    border: 2px solid var(--card);
    margin-left: -7px;
}
.person-mutual-faces img:first-child { margin-left: 0; }

.person-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px 16px;
}
.person-actions > .btn:first-child { flex: 1; }
.person-actions .btn { border-radius: 12px; font-size: 14px; }

/* Пустое состояние */
.people-empty, .bl-empty {
    text-align: center;
    padding: 48px 20px;
    border-radius: 20px;
    background: var(--sn-glass);
    border: 1px dashed var(--border);
}
.people-empty-icon { font-size: 44px; margin-bottom: 8px; }
.people-empty p, .bl-empty p { margin: 0 0 14px; font-size: 16px; }
.bl-empty small { display: block; color: var(--muted); line-height: 1.5; }

.people-pagination { margin-top: 24px; }

/* ============================================================
   Чёрный список
   ============================================================ */
.bl-back {
    display: inline-block;
    margin: 0 0 12px 4px;
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
}
.bl-back:hover { color: var(--primary); }
.bl-hero::before { background: linear-gradient(135deg, #ef4444 0%, #f97316 100%); }

.bl-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}
.bl-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bl-card {
    border-radius: 20px;
    background: var(--sn-glass);
    border: 1px solid var(--sn-glass-border);
    box-shadow: var(--sn-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.bl-add { padding: 18px; }
.bl-add label { display: block; margin-bottom: 10px; }
.bl-search-wrap { position: relative; }
html body #bl-search {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--card);
    font-size: 15px;
}
.bl-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; }

.bl-list { padding: 6px; }
.bl-list .bl-empty { border: 0; background: transparent; }
.bl-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 14px;
    transition: background .15s, opacity .25s, transform .25s;
}
.bl-row:hover { background: var(--sn-soft); }
.bl-row + .bl-row { border-top: 1px solid var(--border); }
.bl-row.is-removing { opacity: 0; transform: translateX(20px); }
.bl-row.is-new { animation: sn-card-in .3s ease both; }
.bl-avatar img { display: block; width: 48px !important; height: 48px !important; border-radius: 50%; object-fit: cover; filter: grayscale(.6); }
.bl-info { flex: 1; min-width: 0; }
.bl-name { display: block; font-weight: 600; color: var(--text); text-decoration: none; }
.bl-name:hover { color: var(--primary); }
.bl-info small { color: var(--muted); font-size: 12px; }
.bl-row .btn { border-radius: 10px; font-size: 13px; white-space: nowrap; }

.bl-help { padding: 18px 20px; position: sticky; top: 90px; }
.bl-help h3 { margin: 0 0 12px; font-size: 15px; }
.bl-help ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bl-help li { display: flex; gap: 10px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.bl-help li span {
    flex: 0 0 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--sn-soft);
    font-size: 14px;
}

/* ============================================================
   Выпадающие подсказки пользователей (шапка + чёрный список)
   ============================================================ */
.hs-suggest, .bl-suggest {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
    padding: 6px;
    max-height: 420px;
    overflow-y: auto;
}
.hs-suggest[hidden], .bl-suggest[hidden] { display: none; }
.header-search .hs-suggest {
    position: absolute;
    left: 0; right: 0;
    top: calc(100% + 8px);
    z-index: 50;
}
.su-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
}
.su-item:hover, .su-item.is-active { background: var(--sn-soft); }
.su-avatar { position: relative; flex: 0 0 36px; }
.su-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: block; }
.su-avatar i {
    position: absolute; right: -1px; bottom: -1px;
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--sn-online);
    border: 2px solid var(--card);
}
.su-text { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.su-text b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-text small { font-size: 12px; color: var(--muted); }
.su-note { font-size: 12px; color: var(--muted); }
.su-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 14px; }
.su-more {
    display: block;
    margin-top: 4px;
    padding: 10px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

/* ============================================================
   Профиль: меню «⋯» и закрытая страница
   ============================================================ */
.profile-more { position: relative; display: inline-block; }
.profile-more-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 60;
    min-width: 220px;
    padding: 6px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
    animation: sn-card-in .15s ease both;
}
.profile-more-menu[hidden] { display: none; }
.profile-more-menu button,
.profile-more-menu a {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}
.profile-more-menu button:hover,
.profile-more-menu a:hover { background: var(--sn-soft); }
.profile-more-menu .is-danger { color: #dc2626; }
.profile-more-menu .is-danger.btn-danger { color: #16a34a; } /* «Разблокировать» */
.profile-more-sep { height: 1px; margin: 4px 6px; background: var(--border); }

.profile-restricted {
    text-align: center;
    padding: 40px 20px;
    border-radius: 20px;
    background: var(--sn-glass);
    border: 1px dashed var(--border);
}
.profile-restricted p { margin: 6px 0; }
.profile-restricted small { display: block; color: var(--muted); margin-bottom: 14px; }

/* ============================================================
   Настройки: раздел «Приватность» и заполненность профиля
   ============================================================ */
.settings-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.settings-section-title { margin: 0 0 14px; font-size: 18px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.settings-link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-top: 6px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    text-decoration: none;
    transition: border-color .15s, transform .15s;
}
.settings-link-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.settings-link-icon {
    flex: 0 0 42px; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: rgba(239, 68, 68, .1);
    font-size: 20px;
}
.settings-link-text { flex: 1; display: flex; flex-direction: column; }
.settings-link-text small { color: var(--muted); font-size: 13px; }
.settings-link-arrow { color: var(--muted); font-size: 18px; }

.profile-complete {
    margin: 0 0 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--sn-glass);
    border: 1px solid var(--sn-glass-border);
    box-shadow: var(--sn-shadow);
}
.profile-complete-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.profile-complete-head small { color: var(--muted); }
.profile-complete-bar { height: 8px; margin: 10px 0 12px; border-radius: 999px; background: var(--sn-soft); overflow: hidden; }
.profile-complete-bar span { display: block; height: 100%; border-radius: inherit; background: var(--sn-grad); transition: width .6s ease; }
.profile-complete-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-complete-chips .chip {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px dashed var(--border);
    color: var(--muted);
}

/* ============================================================
   Чат: разделители дней, черновики
   ============================================================ */
.chat-day-sep {
    display: flex;
    justify-content: center;
    margin: 14px 0 8px;
    position: sticky;
    top: 4px;
    z-index: 2;
}
.chat-day-sep span {
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: var(--sn-glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
}
.dialog-draft { color: #dc2626; font-weight: 600; }
html.theme-dark .dialog-draft { color: #f87171; } /* 1.3.21: тёмно-красное «Черновик:» почти не читалось */

/* ============================================================
   Композер: счётчик символов
   ============================================================ */
.composer-counter { font-size: 12px; color: var(--muted); margin-left: auto; margin-right: 8px; font-variant-numeric: tabular-nums; }
.composer-counter.is-warn { color: #d97706; }
.composer-counter.is-over { color: #dc2626; font-weight: 700; }

/* ============================================================
   Кнопка «Наверх»
   ============================================================ */
.sn-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 90;
    width: 46px; height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--sn-grad);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(99, 102, 241, .35);
    opacity: 0;
    transform: translateY(16px) scale(.9);
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.sn-to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 900px) {
    .bl-layout { grid-template-columns: 1fr; }
    .bl-help { position: static; }
}
@media (max-width: 768px) {
    .people-page { padding-top: 0; }
    .people-hero { padding: 22px 18px 18px; border-radius: 20px; }
    .people-hero-text h1 { font-size: 28px; }
    .people-search { flex-basis: 100%; max-width: none; flex-wrap: wrap; }
    .people-search-field { flex: 1 1 100%; }
    .people-search-field.is-city { flex: 1 1 0; }
    .people-search .btn { flex: 0 0 auto; }
    .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .person-cover { height: 60px; }
    .person-avatar { margin-top: -40px; }
    .person-avatar img { width: 72px !important; height: 72px !important; }
    .person-body { padding: 8px 10px 0; }
    .person-name { font-size: 15px; }
    .person-actions { padding: 12px 10px 12px; }
    .person-actions .btn { font-size: 13px; padding-left: 8px; padding-right: 8px; }
    .sn-to-top { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); right: 14px; width: 42px; height: 42px; }
    .bl-row { flex-wrap: wrap; }
    .bl-row .btn { margin-left: 62px; }
}
@media (max-width: 420px) {
    .people-grid { grid-template-columns: 1fr; }
    .person-card { flex-direction: row; flex-wrap: wrap; text-align: left; align-items: center; }
    .person-cover { display: none; }
    .person-avatar { margin: 14px 0 0 14px; padding: 0; box-shadow: none; }
    .person-avatar img { width: 60px !important; height: 60px !important; }
    .person-online { right: 0; bottom: 0; width: 14px; height: 14px; }
    .person-body { flex: 1; min-width: 0; padding: 14px 14px 0 12px; }
    .person-name { justify-content: flex-start; }
    .person-line { margin-bottom: 0; }
    .person-stats { display: none; }
    .person-mutual { justify-content: flex-start; margin-top: 4px; }
}

/* ============================================================
   Настройки: разделы (Основное, Личная информация, Оформление,
   Приватность, Безопасность)
   ============================================================ */
html body .edit-profile-page.settings-page { max-width: 1000px; }
.flash.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
html.theme-dark .flash.error { background: rgba(127, 29, 29, .35); color: #fecaca; border-color: rgba(248, 113, 113, .35); }
html.theme-dark .flash.success { background: rgba(6, 95, 70, .35); color: #a7f3d0; border-color: rgba(52, 211, 153, .3); }

.settings-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.settings-nav {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border-radius: 18px;
    background: var(--sn-glass);
    border: 1px solid var(--sn-glass-border);
    box-shadow: var(--sn-shadow);
}
.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.settings-nav-item i { font-style: normal; font-size: 18px; width: 24px; text-align: center; flex: 0 0 auto; }
.settings-nav-item:hover { background: var(--sn-soft); }
.settings-nav-item.is-active { background: var(--sn-soft); color: var(--primary); font-weight: 600; }
.settings-nav-profile { margin-top: 6px; padding-top: 13px; border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; color: var(--muted); }

.settings-form { min-width: 0; }
.settings-panel + .settings-panel { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
/* С JS показываем только активный раздел */
.settings-layout.js-ready .settings-panel { display: none; }
.settings-layout.js-ready .settings-panel.is-active { display: block; margin-top: 0; padding-top: 0; border-top: 0; animation: sn-settings-in .2s ease both; }
@keyframes sn-settings-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.settings-panel-head { margin: 0 0 20px; }
.settings-panel-head h2 { margin: 0 0 4px; font-size: 20px; }
.settings-panel-head p { margin: 0; color: var(--muted); font-size: 13px; }
.settings-subtitle { margin: 22px 0 12px; font-size: 15px; }
.settings-hint { color: var(--muted); font-size: 12px; }

/* Блок «Приватность» рисует свой заголовок и разделитель — внутри раздела они лишние */
.settings-panel .settings-section { margin-top: 0; padding-top: 0; border-top: 0; }
.settings-panel .settings-section-title { display: none; }

.settings-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--card);
}
.settings-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-row-text small { color: var(--muted); font-size: 13px; }
.settings-row .btn { white-space: nowrap; }
.settings-row .btn:disabled { opacity: .5; cursor: default; }

.edit-field input[readonly] { background: var(--bg); color: var(--muted); cursor: default; }

.settings-pass { position: relative; display: flex; }
.settings-pass input { flex: 1; min-width: 0; padding-right: 44px !important; }
.settings-pass-eye {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px;
    border: 0; border-radius: 8px;
    background: transparent; cursor: pointer; font-size: 16px;
}
.settings-pass-eye:hover { background: var(--sn-soft); }
.settings-pass-meter { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.settings-pass-meter span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }
.settings-pass-meter.lvl-0 span { width: 10%; background: #ef4444; }
.settings-pass-meter.lvl-1 span { width: 25%; background: #ef4444; }
.settings-pass-meter.lvl-2 span { width: 50%; background: #f59e0b; }
.settings-pass-meter.lvl-3 span { width: 75%; background: #22c55e; }
.settings-pass-meter.lvl-4 span { width: 100%; background: #16a34a; }
#pass-match.is-ok { color: #16a34a; }
#pass-match.is-bad { color: #dc2626; }

.settings-actions { position: sticky; bottom: 0; z-index: 5; padding-bottom: 14px; background: var(--card); }

@media (max-width: 768px) {
    .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    /* Разделы — горизонтальная прокручиваемая лента «чипов» */
    .settings-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding: 6px;
        border-radius: 14px;
    }
    .settings-nav::-webkit-scrollbar { display: none; }
    .settings-nav-item { flex: 0 0 auto; padding: 9px 12px; white-space: nowrap; }
    .settings-nav-item i { width: auto; font-size: 16px; }
    .settings-nav-profile { margin-top: 0; padding-top: 9px; border-top: 0; border-radius: 12px; }
    .settings-row { flex-wrap: wrap; }
    .settings-row .btn { flex: 1 1 100%; }
    /* Кнопка «Сохранить» над нижней панелью навигации */
    .settings-actions { bottom: calc(var(--sn-nav-h, 60px) + var(--sn-safe-bottom, 0px)); padding-bottom: 12px; }
    body.mnav-hidden .settings-actions { bottom: 0; }
    /* Компактная панель: одна строка, а не две кнопки на всю ширину */
    .settings-actions { flex-direction: row; gap: 8px; margin-top: 16px; padding-top: 12px; }
    .settings-actions .btn { width: auto; padding: 10px 16px; }
    .settings-actions .btn-primary { flex: 1 1 auto; }
}

/* ============================================================
   Чёрный список: выпадающий список под карточкой списка
   .bl-card имеет backdrop-filter, поэтому каждая карточка — отдельный
   контекст наложения, и z-index подсказок внутри первой карточки не
   поднимал их над второй. Поднимаем саму карточку с поиском.
   ============================================================ */
.bl-add { position: relative; z-index: 20; }
.bl-add:focus-within { z-index: 40; }

/* ============================================================
   Вход: ссылка «Забыли пароль?» (1.3.1)
   ============================================================ */
.auth-remember-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-forgot-link { color: var(--primary); font-size: 14px; font-weight: 500; text-decoration: none; }
.auth-forgot-link:hover { text-decoration: underline; }

/* ============================================================
   «Забыли пароль?»: переключатель способов (1.3.2)
   ============================================================ */
.auth-tabs { display: flex; gap: 6px; padding: 4px; margin: 0 0 18px; border-radius: 14px; background: var(--sn-soft, rgba(100, 116, 139, .12)); }
.auth-tab {
    flex: 1; padding: 9px 8px; border: 0; border-radius: 10px; cursor: pointer;
    background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600;
    transition: background .15s, color .15s;
}
.auth-tab.is-active { background: var(--card, #fff); color: var(--primary); box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }
.auth-pane { display: none; }
.auth-pane.is-active { display: flex; flex-direction: column; }
.auth-hint { margin: 0 0 4px; font-size: 13px; line-height: 1.5; color: var(--muted); }
#code-code { text-transform: uppercase; letter-spacing: .06em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Контрольный вопрос на странице восстановления (1.3.3) */
.sq-question-box { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--sn-soft, rgba(100, 116, 139, .12)); }
.sq-question-box small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.sq-question-box strong { font-size: 15px; line-height: 1.4; }
.auth-link-btn { margin-top: 10px; padding: 6px; border: 0; background: none; color: var(--primary); font: inherit; font-size: 14px; cursor: pointer; text-align: center; }
.auth-link-btn:hover { text-decoration: underline; }
.auth-hint-center { margin-top: 16px; text-align: center; }
.sq-step { display: flex; flex-direction: column; gap: 16px; }

/* ============================================================
   Выпадающие списки в формах — как поля ввода, со своей стрелкой (1.3.4)
   Регистрация («Контрольный вопрос»), настройки (вопрос, пол, семейное положение)
   ============================================================ */
.auth-field select,
.edit-field select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 44px 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background-color: #fff;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px 18px;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    line-height: 1.3;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.auth-field select:hover,
.edit-field select:hover { border-color: #a5b4fc; }
.auth-field select:focus,
.edit-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
}
/* пока вопрос не выбран — серый «плейсхолдер» */
.auth-field select:required:invalid { color: var(--muted); }
.auth-field select option,
.edit-field select option { color: var(--text); background: #fff; }

html.theme-dark .auth-field select,
html.theme-dark .edit-field select {
    background-color: rgba(15, 23, 42, .6);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
    color: var(--text);
    border-color: var(--border);
}
html.theme-dark .auth-field select option,
html.theme-dark .edit-field select option { background: #1e293b; color: #e2e8f0; }

/* «Свой вопрос» плавно появляется */
.sq-custom-wrap { animation: sn-sq-in .2s ease; }
@keyframes sn-sq-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

@media (max-width: 768px) {
    .auth-field select, .edit-field select { font-size: 16px; }  /* iOS не приближает страницу при фокусе */
}

/* ---------- 1.3.28: список сеансов (Настройки → Безопасность) ---------- */
.sn-default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sn-sess-list { list-style: none; margin: -8px 0 22px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sn-sess {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--card);
}
.sn-sess.is-current { border-color: var(--primary); background: rgba(79, 70, 229, 0.05); }
.sn-sess-ico { flex: 0 0 auto; font-size: 22px; line-height: 1; }
.sn-sess-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sn-sess-text strong { font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sn-sess-text small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.sn-sess-badge {
    font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
    background: var(--primary); color: #fff;
}
.sn-sess-end { flex: 0 0 auto; padding: 6px 12px; font-size: 13px; }
html.theme-dark .sn-sess.is-current { background: rgba(129, 140, 248, 0.1); }
@media (max-width: 600px) {
    .sn-sess { flex-wrap: wrap; }
    .sn-sess-end { flex: 1 1 100%; }
}
