* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

:root {
    --bg: #0f0f14;
    --panel: #1a1a24;
    --panel-2: #22222e;
    --line: #2c2c3a;
    --text: #f5f5f7;
    --muted: #9a9aac;
    --accent: #e11d48;
    --accent-2: #f43f5e;
    --ok: #22c55e;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ---------- Navbar ---------- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
}
.brand { font-size: 22px; font-weight: 700; letter-spacing: .5px; text-decoration: none; color: var(--text); cursor: pointer; }
.brand:hover { opacity: .85; }
.brand span { color: var(--accent-2); }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; transition: color .15s; }
.nav-links a:hover { color: var(--text); }
.user-chip { color: var(--text); font-weight: 600; font-size: 14px; }
.user-chip::before { content: '👤 '; }
.nav-link-chat { position: relative; }
.nav-msg-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
    z-index: 5;
}
.nav-msg-badge[hidden] { display: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: transform .1s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------- Random brief cards ---------- */
.brief-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.brief-card { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; transition: transform .15s, border-color .15s; }
.brief-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.brief-card .avatar { width: 52px; height: 52px; min-width: 52px; font-size: 18px; border-radius: 10px; }
.b-name { font-weight: 700; font-size: 15px; }
.b-sub { font-size: 12px; color: var(--muted); }

/* ---------- Photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; margin-bottom: 10px; }
.photo-thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb .del {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
}
.photo-thumb .del:hover { background: #000; }

/* ---------- Hero ---------- */
.hero {
    text-align: center;
    padding: 90px 20px 70px;
    background:
        radial-gradient(ellipse at 50% -10%, rgba(225, 29, 72, .25), transparent 60%),
        var(--bg);
}
.hero h1 { font-size: clamp(30px, 5vw, 52px); margin-bottom: 16px; }
.hero p { color: var(--muted); font-size: 18px; max-width: 620px; margin: 0 auto 30px; }

/* ---------- Filters ---------- */
.filters {
    max-width: 980px;
    margin: 0 auto 24px;
    padding: 18px 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}
.filters label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.filters select, .filters input {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    min-width: 150px;
}
.filters input[type="range"] { min-width: 160px; padding: 0; accent-color: var(--accent); }

/* ---------- SEO-блок внизу (компактный, в подвале) ---------- */
.seo {
    margin-top: 28px;
    border-top: 1px solid var(--line);
    padding: 20px 0 6px;
}
.seo-inner { max-width: 860px; }
.seo h2 { font-size: 16px; margin: 0 0 10px; }
.seo h3 { font-size: 13px; margin: 14px 0 4px; color: var(--text); }
.seo p { color: var(--muted); font-size: 12px; line-height: 1.55; margin-bottom: 8px; }

/* ---------- Grid / cards ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px 60px; }
.section-title { font-size: 24px; margin: 40px 0 20px; }
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.avatar {
    position: relative;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    font-weight: 700;
    color: rgba(255, 255, 255, .9);
    background: linear-gradient(135deg, var(--g1, #3b3b55), var(--g2, #1e1e2e));
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-count { position: absolute; bottom: 6px; right: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 10px; }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.card-name { font-size: 18px; font-weight: 700; }
.card-meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.role-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(225, 29, 72, .15);
    color: var(--accent-2);
    border: 1px solid rgba(225, 29, 72, .35);
    white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
#p-tag-add { margin-bottom: 8px; }
.tag {
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--panel-2);
    color: var(--muted);
    border: 1px solid var(--line);
}
.tag-edit { display: inline-flex; align-items: center; gap: 6px; }
.tag-click { cursor: pointer; transition: border-color .15s, color .15s; }
.tag-click:hover { border-color: var(--accent); color: var(--text); }
.tag-del { cursor: pointer; opacity: .65; font-size: 11px; }
.tag-del:hover { opacity: 1; color: var(--accent-2); }
.card-actions { display: flex; gap: 8px; margin-top: auto; }
.card-actions .btn { flex: 1; padding: 8px; font-size: 14px; }
.self-badge {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
}
.btn-like { background: var(--ok); color: #04260f; }
.btn-like:hover { filter: brightness(1.1); }
.btn-chat { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); text-align: center; text-decoration: none; }
.btn-chat:hover { border-color: var(--accent); color: var(--text); }

.online { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); display: inline-block; margin-right: 6px; }
.offline { background: var(--muted); }

/* ---------- Stats ---------- */
.stats { display: flex; gap: 16px; justify-content: center; margin-bottom: 40px; flex-wrap: wrap; }
.stat {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 14px 28px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: transform .12s, border-color .15s;
}
.stat-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
    z-index: 5;
}
.stat-badge[hidden] { display: none; }
.stat:hover { transform: translateY(-2px); border-color: var(--accent); }
.stat:active { transform: scale(.98); }
.stat b { display: block; font-size: 26px; color: var(--accent-2); }
.stat span { color: var(--muted); font-size: 13px; }

/* ---------- Forms ---------- */
.form-panel {
    max-width: 620px;
    margin: 0 auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 26px;
}
.form-panel h3 { margin-bottom: 18px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-group { flex: 1; min-width: 150px; margin-bottom: 14px; }
.form-group label, .auth-form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea,
.auth-form input, .auth-form select, .auth-form textarea {
    width: 100%;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
}

/* ---------- Auth page ---------- */
.auth-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background:
        radial-gradient(ellipse at 50% -20%, rgba(225, 29, 72, .2), transparent 60%),
        var(--bg);
}
.auth-wrap {
    width: 100%;
    max-width: 420px;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0 auto;
}
.auth-body .seo { width: 100%; }
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 30px;
}
.auth-brand { text-align: center; font-size: 26px; font-weight: 700; margin-bottom: 22px; }
.auth-brand span { color: var(--accent-2); }
/* Тот же шрифт, что и заголовок «Найди своего человека» на главной, но вдвое меньше и в одну строку */
.auth-title {
    text-align: center;
    font-size: clamp(14px, 2.2vw, 22px);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 18px;
    color: var(--text);
    white-space: nowrap;
}
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tab {
    flex: 1;
    padding: 10px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, color .15s;
}
.auth-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.auth-form .btn { margin-top: 6px; }
.auth-error { color: var(--accent-2); font-size: 14px; margin-top: 14px; min-height: 20px; text-align: center; }
@keyframes error-flash {
    0% { opacity: 0; transform: translateY(-2px); }
    15% { opacity: 1; transform: translateY(0); }
    100% { opacity: 1; }
}
.auth-error.flash { animation: error-flash .45s ease; }
.auth-link { display: block; text-align: center; margin-top: 14px; color: var(--muted); font-size: 14px; text-decoration: none; }
.auth-link:hover { color: var(--text); }

/* ---------- Chat ---------- */
.chat-wrap {
    max-width: 1000px;
    margin: 24px auto 40px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    height: calc(100vh - 140px);
    min-height: 420px;
}
.chat-side {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-side input {
    margin: 14px;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
}
.user-list { list-style: none; overflow-y: auto; flex: 1; }
.user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background .12s;
}
.user-item:hover { background: var(--panel-2); }
.user-item.active { background: var(--panel-2); border-left-color: var(--accent); }
.user-item.empty { cursor: default; color: var(--muted); font-size: 13px; }
.user-item .u-name { font-weight: 600; font-size: 15px; }
.user-item .u-sub { font-size: 12px; color: var(--muted); }
.user-item .u-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.user-item .u-dot.on { background: var(--ok); }
.user-item .unread {
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}
.user-item .row-del {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color .12s, background .12s;
}
.user-item .row-del:hover { color: var(--accent-2); background: var(--panel-2); }
.chat-main {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.chat-head small { color: var(--muted); font-weight: 400; }
.btn-danger { background: transparent; color: #e5484d; border: 1px solid #e5484d; }
.btn-danger:hover { background: rgba(229, 72, 77, .12); color: #ff6b6f; border-color: #ff6b6f; }
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.msg {
    max-width: 72%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 15px;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.msg.mine { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .m-time { display: block; font-size: 11px; opacity: .6; margin-top: 4px; }
.chat-input {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--line);
}
.chat-input input {
    flex: 1;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 15px;
    font-family: inherit;
}
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 16px; }
.chat-input .attach {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.chat-input .attach:hover { border-color: var(--accent); }
.chat-img {
    max-width: 240px;
    max-height: 240px;
    width: auto;
    border-radius: 10px;
    display: block;
    margin: 2px 0 4px;
    cursor: zoom-in;
    object-fit: cover;
}
.img-lightbox { z-index: 400; cursor: zoom-out; }
.lightbox-inner { position: relative; max-width: 94vw; max-height: 90vh; }
.lightbox-inner img {
    max-width: 94vw;
    max-height: 86vh;
    border-radius: 10px;
    display: block;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
}
.lightbox-inner .modal-close { position: absolute; top: 8px; right: 8px; }

/* ---------- Toast / footer / misc ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%) translateY(80px);
    background: var(--accent);
    color: #fff;
    padding: 14px 26px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
    opacity: 0;
    transition: transform .3s, opacity .3s;
    z-index: 100;
    max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ---------- Уведомления о сообщениях (чат) ---------- */
.notify-stack {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
    max-width: 340px;
}
.notify {
    background: var(--panel);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
    animation: notify-in .25s ease;
}
.notify:hover { border-color: var(--accent-2); }
.notify .n-count {
    margin-left: 6px;
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    padding: 1px 8px;
    font-weight: 700;
    font-size: 12px;
}
@keyframes notify-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Админ ---------- */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.btn-ghost.active { background: var(--panel-2); color: var(--text); border-color: var(--accent); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.admin-table th { background: var(--panel-2); color: var(--muted); font-size: 12px; text-transform: uppercase; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-ban { color: var(--accent-2); font-weight: 600; }
.msg-conv { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.msg-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.msg-row:last-child { border-bottom: none; }
.msg-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.msg-ind { white-space: nowrap; font-size: 13px; }
.send-as { display: flex; gap: 6px; margin-top: 10px; align-items: center; }
.send-as select,
.send-as input {
    background: var(--panel-2); color: var(--text);
    border: 1px solid var(--line); border-radius: 8px;
    padding: 8px 10px; font-size: 14px;
}
.send-as select { max-width: 150px; }
.send-as input { flex: 1; min-width: 0; }
.send-as input::placeholder { color: var(--muted); }
.row-flash { animation: row-flash 1.2s ease-in-out 2; }
@keyframes row-flash {
    0%, 100% { background: transparent; }
    50% { background: rgba(255, 173, 66, 0.22); }
}
.edit-panel { background: var(--panel); border: 1px solid var(--accent); border-radius: 12px; padding: 16px; margin-bottom: 20px; }
.logs-list { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; max-height: 60vh; overflow: auto; font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; color: var(--text); }

footer {
    border-top: 1px solid var(--line);
    padding: 30px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
footer .warn { color: var(--accent-2); font-weight: 600; }
/* SEO-блок внутри футера: убираем двойную линию (у footer уже есть border-top) */
footer .seo { margin-top: 26px; border-top: none; padding: 0; text-align: left; }
footer .seo .container { padding-bottom: 0; }
/* Строка поддержки под футером */
.support-line { text-align: center; color: var(--muted); font-size: 12px; padding: 12px 20px 28px; }
.support-line a { color: var(--accent-2); text-decoration: none; }
.support-line a:hover { text-decoration: underline; }

.empty { text-align: center; color: var(--muted); padding: 40px; }

/* ---------- Модальное окно списков (лайкнули / мэтчи / онлайн) ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 16px;
}
/* hidden-атрибут должен скрывать оверлей (display:flex его перебивал) */
.modal-overlay[hidden] { display: none; }
.modal {
    width: 100%;
    max-width: 460px;
    max-height: 80vh;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 18px; }
.modal-close {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.modal-close:hover { border-color: var(--accent); }
.modal-list { overflow-y: auto; padding: 8px; min-height: 0; }
.stat-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .12s;
}
.stat-user:hover { background: var(--panel-2); }
.stat-user .avatar { width: 48px; height: 48px; min-width: 48px; border-radius: 10px; font-size: 18px; }
.modal-empty { text-align: center; color: var(--muted); padding: 30px; }

/* ---------- Просмотр анкеты (view.html) ---------- */
.back-link { display: inline-block; margin-bottom: 18px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--accent); }
.view-card {
    display: grid;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 28px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
}
.view-photos { min-width: 0; }
.carousel { display: flex; align-items: center; gap: 10px; }
.car-stage { flex: 1; min-width: 0; }
.car-stage img { width: 100%; max-height: 480px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); display: block; background: #000; }
.car-nav {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.car-nav:hover { border-color: var(--accent); color: var(--accent); }
.car-nav[hidden] { display: none; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 2px solid var(--line); background: var(--panel-2); padding: 0; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.active { border-color: var(--accent); }
.photo-count { margin-top: 8px; font-size: 12px; color: var(--muted); }
.view-avatar { height: 260px; font-size: 90px; border-radius: 12px; }
.view-info { display: flex; flex-direction: column; gap: 12px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.view-bio { color: var(--text); line-height: 1.6; white-space: pre-wrap; }
.view-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 8px; }
.view-actions .btn { flex: 0 0 auto; padding: 10px 24px; font-size: 15px; }

/* ---------- Мобильная адаптация (iPhone / Android) ---------- */
@media (max-width: 720px) {
    body { -webkit-tap-highlight-color: transparent; }

    /* Поля крупнее — иначе iOS зумит страницу при фокусе */
    input, select, textarea { font-size: 16px !important; }

    /* ---------- Навигация ---------- */
    .navbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; }
    .brand { font-size: 19px; }
    .nav-links { flex-wrap: wrap; gap: 8px 14px; }
    .nav-links a { font-size: 14px; }
    .user-chip { font-size: 13px; }

    /* ---------- Hero ---------- */
    .hero { padding: 44px 16px 36px; }
    .hero h1 { font-size: 26px; }
    .hero p { font-size: 16px; }

    /* ---------- Контейнер / заголовки ---------- */
    .container { padding: 0 14px 40px; }
    .section-title { font-size: 20px; margin: 28px 0 14px; }

    /* ---------- Статистика ---------- */
    .stats { gap: 10px; margin-bottom: 24px; }
    .stat { padding: 10px 16px; border-radius: 10px; }
    .stat b { font-size: 22px; }
    .stat span { font-size: 12px; }

    /* ---------- Фильтры ---------- */
    .filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 14px;
    }
    .filters > div:first-child { grid-column: 1 / -1; }
    .filters > div:nth-child(4) { grid-column: 1 / -1; }
    .filters > button { grid-column: 1 / -1; }
    .filters select, .filters input { min-width: 0; padding: 10px 10px; }
    .filters input[type="range"] { min-width: 0; width: 100%; }

    /* ---------- Лента ---------- */
    .grid { grid-template-columns: 1fr; gap: 14px; }
    .card .avatar { height: 200px; }
    .card-body { padding: 12px 14px; }
    .card-name { font-size: 16px; }
    .card-meta { font-size: 12px; }
    .card-actions .btn { padding: 8px; font-size: 14px; }

    /* ---------- Случайные анкеты ---------- */
    .brief-grid { grid-template-columns: 1fr; gap: 10px; }
    .brief-card { padding: 10px; gap: 10px; }
    .brief-card .avatar { width: 46px; height: 46px; min-width: 46px; font-size: 16px; border-radius: 8px; }
    .b-name { font-size: 14px; }

    /* ---------- Чат (мессенджер на весь экран) ---------- */
    .chat-wrap {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        gap: 10px;
        height: calc(100vh - 68px);
        height: calc(100dvh - 68px);
        min-height: 0;
        padding: 0 12px;
        margin: 8px auto 12px;
    }
    .chat-side { max-height: 34vh; }
    .chat-main { min-height: 0; }
    .chat-messages { padding: 12px; gap: 8px; min-height: 0; }
    .msg { max-width: 82%; padding: 9px 12px; font-size: 15px; }
    .chat-input { padding: 10px 12px; gap: 8px; }
    .chat-input input { font-size: 16px; padding: 11px 12px; }
    .chat-input .btn { padding: 11px 16px; font-size: 14px; }
    .chat-input .attach { padding: 6px 10px; font-size: 17px; }
    .chat-img { max-width: 180px; max-height: 180px; }
    .chat-head { padding: 12px 14px; font-size: 15px; }
    .user-item { padding: 10px 12px; }
    .user-item .u-name { font-size: 14px; }

    /* ---------- Просмотр анкеты ---------- */
    .view-card { grid-template-columns: 1fr; gap: 14px; padding: 14px; }
    .car-nav { width: 34px; height: 34px; font-size: 18px; }
    .car-stage img { max-height: 62vh; }
    .thumb { width: 52px; height: 52px; }
    .view-avatar { height: 220px; font-size: 70px; }
    .view-bio { font-size: 14px; }
    .view-actions .btn { padding: 10px 18px; font-size: 14px; }
    .back-link { margin-bottom: 12px; }

    /* ---------- Формы (редактирование анкеты) ---------- */
    .form-panel { padding: 18px 16px; }
    .form-row { gap: 10px; }
    .form-group { min-width: 120px; }

    /* ---------- Вход / регистрация ---------- */
    .auth-body { padding: 12px; }
    .auth-card { padding: 20px 16px; border-radius: 14px; }
    .auth-brand { font-size: 22px; margin-bottom: 18px; }

    /* ---------- Админ ---------- */
    .admin-tabs { gap: 6px; flex-wrap: wrap; }
    .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
    .admin-table th, .admin-table td { padding: 8px 10px; font-size: 13px; }
    .msg-row { flex-wrap: wrap; gap: 6px; }
    .msg-meta { white-space: normal; }
    .send-as { flex-wrap: wrap; }
    .send-as select { max-width: 120px; }
    .send-as input { flex-basis: 100%; }
    .logs-list { max-height: 50vh; }

    /* ---------- Тосты / уведомления ---------- */
    .toast { bottom: 16px; padding: 12px 18px; font-size: 14px; }
    .notify-stack { left: 10px; right: 10px; bottom: 10px; max-width: none; }
    .notify { padding: 10px 12px; font-size: 13px; }

    /* ---------- Модальное окно списков ---------- */
    .modal-overlay { padding: 10px; }
    .modal { max-height: 86vh; }
    .stat-user { padding: 8px; }

    /* ---------- Подвал ---------- */
    footer { padding: 22px 16px; font-size: 12px; }
}
