/* ══════════════════════════════════════════
   DECK — style.css
══════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --bg: #0e0e0f;
  --bg2: #161618;
  --bg3: #1e1e21;
  --bg4: #252529;
  --border: #2e2e33;
  --text: #f0ede6;
  --text2: #9d9a93;
  --text3: #5c5a56;
  --accent: #e8a84b;
  --accent2: #c4873a;
  --accent-dim: rgba(232,168,75,0.12);
  --red: #e85b5b;
  --green: #5be8a0;
  --radius: 14px;
  --radius-sm: 8px;
  --nav-h: 60px;
  --tab-h: 56px;
  --sidebar-w: 230px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 15px; overflow: hidden; }
input, textarea, button { font-family: inherit; font-size: 15px; color: inherit; border: none; outline: none; background: none; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Portrait lock CSS hint ── */
@media screen and (orientation: landscape) and (max-width: 768px) {
  body::before {
    content: 'Пожалуйста, поверните телефон вертикально';
    position: fixed; inset: 0; background: var(--bg); color: var(--text2);
    display: flex; align-items: center; justify-content: center;
    text-align: center; font-size: 16px; padding: 32px; z-index: 9999;
  }
  body > * { display: none !important; }
}

/* ══════════════════════════════════════════
   SCREENS
══════════════════════════════════════════ */
.screen { position: fixed; inset: 0; display: none; flex-direction: column; overflow: hidden; }
.screen.active { display: flex; }

/* ══════════════════════════════════════════
   AUTH
══════════════════════════════════════════ */
#auth-screen { align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.auth-logo { font-family: 'Playfair Display', serif; font-size: 56px; font-weight: 900; color: var(--accent); letter-spacing: -2px; margin-bottom: 6px; text-align: center; }
.auth-tagline { color: var(--text3); text-align: center; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 36px; }
.auth-box { width: 100%; max-width: 380px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: 0 24px 64px rgba(0,0,0,.5); }
.auth-tabs { display: flex; margin-bottom: 24px; background: var(--bg3); border-radius: var(--radius-sm); padding: 3px; }
.auth-tab { flex: 1; padding: 9px; text-align: center; border-radius: 6px; color: var(--text2); font-weight: 500; font-size: 13px; cursor: pointer; transition: .2s; }
.auth-tab.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 11px; color: var(--text2); margin-bottom: 6px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.auth-field input { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--text); transition: .2s; }
.auth-field input:focus { border-color: var(--accent); background: var(--bg4); }
.auth-field input::placeholder { color: var(--text3); }
.auth-err { color: var(--red); font-size: 13px; margin-bottom: 12px; display: none; padding: 10px 12px; background: rgba(232,91,91,.08); border-radius: var(--radius-sm); border-left: 3px solid var(--red); }

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn-primary { width: 100%; padding: 13px; background: var(--accent); color: #1a1200; border-radius: var(--radius-sm); font-weight: 700; font-size: 15px; transition: .15s; letter-spacing: .01em; }
.btn-primary:hover { background: var(--accent2); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ══════════════════════════════════════════
   SETUP
══════════════════════════════════════════ */
#setup-screen { align-items: center; justify-content: center; padding: 24px; background: var(--bg); overflow-y: auto; }
.setup-box { width: 100%; max-width: 400px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: 0 24px 64px rgba(0,0,0,.5); }
.setup-title { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.setup-sub { color: var(--text2); font-size: 13px; margin-bottom: 24px; }
.avatar-picker { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
.avatar-preview { width: 90px; height: 90px; border-radius: 50%; background: var(--bg3); border: 2px dashed var(--border); display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; transition: .2s; margin-bottom: 10px; }
.avatar-preview:hover { border-color: var(--accent); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-preview svg { width: 34px; height: 34px; stroke: var(--text3); fill: none; stroke-width: 1.8; }
.avatar-hint { font-size: 12px; color: var(--text3); margin-bottom: 10px; }
.avatar-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 7px; margin-top: 8px; }
.avatar-option { width: 42px; height: 42px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: .15s; overflow: hidden; }
.avatar-option:hover, .avatar-option.selected { border-color: var(--accent); transform: scale(1.05); }
.avatar-option img { width: 100%; height: 100%; object-fit: cover; }
.edit-field { margin-bottom: 14px; }
.edit-field label { display: block; font-size: 11px; color: var(--text2); margin-bottom: 6px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.edit-field input, .edit-field textarea { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--text); transition: .2s; resize: none; }
.edit-field input:focus, .edit-field textarea:focus { border-color: var(--accent); background: var(--bg4); }
.edit-field input::placeholder, .edit-field textarea::placeholder { color: var(--text3); }

/* ══════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════ */
#app-screen { background: var(--bg); }

/* Nav */
.app-nav { height: var(--nav-h); background: var(--bg2); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 16px; flex-shrink: 0; gap: 12px; }
.nav-logo { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 900; color: var(--accent); letter-spacing: -1px; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-icon-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--bg3); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .15s; position: relative; border: 1px solid var(--border); overflow: hidden; flex-shrink: 0; }
.nav-icon-btn:hover { background: var(--bg4); }
.nav-icon-btn svg { width: 19px; height: 19px; stroke: var(--text); fill: none; stroke-width: 1.8; }
.nav-avatar-btn { padding: 0; }
.badge { position: absolute; top: -2px; right: -2px; width: 16px; height: 16px; background: var(--red); border-radius: 50%; font-size: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; border: 2px solid var(--bg2); }

/* Install button (nav, desktop) */
.install-btn { display: flex; align-items: center; gap: 7px; padding: 8px 14px; background: var(--accent-dim); border: 1px solid var(--accent); border-radius: 20px; color: var(--accent); font-size: 13px; font-weight: 600; transition: .15s; white-space: nowrap; }
.install-btn:hover { background: var(--accent); color: #1a1200; }
.install-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.2; }
@media (max-width: 768px) { .install-btn { display: none !important; } }

/* App body */
.app-body { flex: 1; display: flex; overflow: hidden; }

/* Sidebar */
.sidebar { width: var(--sidebar-w); background: var(--bg2); border-right: 1px solid var(--border); padding: 12px 8px 16px; display: flex; flex-direction: column; flex-shrink: 0; }
@media (max-width: 768px) { .sidebar { display: none; } }
.sidebar-nav { flex: 1; }
.sidebar-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text2); font-weight: 500; transition: .15s; font-size: 14px; margin-bottom: 2px; }
.sidebar-item:hover { background: var(--bg3); color: var(--text); }
.sidebar-item.active { background: var(--accent-dim); color: var(--accent); }
.sidebar-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }
.sidebar-notif-pill { background: var(--red); color: #fff; font-size: 10px; padding: 1px 7px; border-radius: 10px; margin-left: auto; font-weight: 700; }

/* Sidebar install button */
.sidebar-install-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 14px; background: var(--accent-dim); border: 1px solid rgba(232,168,75,.3); border-radius: var(--radius-sm); color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; margin-bottom: 10px; }
.sidebar-install-btn:hover { background: var(--accent); color: #1a1200; }
.sidebar-install-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }

.sidebar-user { border-top: 1px solid var(--border); padding-top: 12px; display: flex; align-items: center; gap: 10px; padding-left: 6px; cursor: pointer; }
.sidebar-user:hover .sidebar-user-name { color: var(--accent); }
.sidebar-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--bg3); border: 1.5px solid var(--border); flex-shrink: 0; }
.sidebar-user-name { font-weight: 600; font-size: 14px; transition: .15s; }
.sidebar-user-handle { font-size: 12px; color: var(--text3); }

/* Main content */
.main-content { flex: 1; overflow-y: auto; overflow-x: hidden; }
.page { display: none; animation: fadeIn .2s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Bottom Tabs */
.bottom-tabs { height: var(--tab-h); background: var(--bg2); border-top: 1px solid var(--border); display: none; flex-shrink: 0; position: relative; z-index: 50; }
@media (max-width: 768px) { .bottom-tabs { display: flex; } }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; color: var(--text3); gap: 3px; transition: .15s; position: relative; padding: 6px 0; }
.tab-item.active { color: var(--accent); }
.tab-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tab-item span { font-size: 9px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.tab-badge { position: absolute; top: 5px; right: calc(50% - 20px); width: 15px; height: 15px; background: var(--red); border-radius: 50%; font-size: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; border: 2px solid var(--bg2); }

/* ══════════════════════════════════════════
   FEED
══════════════════════════════════════════ */
.feed-wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
@media (max-width: 768px) { .feed-wrap { padding: 8px 0; } }

/* Composer */
.post-composer { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
@media (max-width: 768px) { .post-composer { border-radius: 0; border-left: none; border-right: none; margin-bottom: 6px; } }
.composer-row { display: flex; gap: 12px; align-items: flex-start; }
.composer-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg3); flex-shrink: 0; border: 1.5px solid var(--border); }
.composer-right { flex: 1; }
.composer-input { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; resize: none; color: var(--text); line-height: 1.6; min-height: 80px; transition: .2s; font-size: 14px; }
.composer-input:focus { border-color: var(--accent); background: var(--bg4); }
.composer-input::placeholder { color: var(--text3); }
.composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.composer-hint { font-size: 11px; color: var(--text3); }
@media (max-width: 600px) { .composer-hint { display: none; } }
.btn-post { padding: 9px 22px; background: var(--accent); color: #1a1200; border-radius: var(--radius-sm); font-weight: 700; font-size: 13px; transition: .15s; }
.btn-post:hover { background: var(--accent2); }
.btn-post:disabled { opacity: .4; cursor: not-allowed; }

/* Post card */
.post-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; transition: border-color .2s; }
@media (max-width: 768px) { .post-card { border-radius: 0; border-left: none; border-right: none; margin-bottom: 4px; } }
.post-card:hover { border-color: var(--bg4); }
.post-header { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; }
.post-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg3); cursor: pointer; flex-shrink: 0; border: 1.5px solid var(--border); }
.post-user { flex: 1; }
.post-display-name { font-weight: 600; font-size: 14px; cursor: pointer; transition: .15s; }
.post-display-name:hover { color: var(--accent); }
.post-username { font-size: 12px; color: var(--text3); }
.post-time { font-size: 11px; color: var(--text3); white-space: nowrap; }
.post-delete-btn { color: var(--text3); font-size: 16px; padding: 4px 8px; border-radius: 6px; cursor: pointer; transition: .15s; margin-left: 4px; line-height: 1; }
.post-delete-btn:hover { color: var(--red); background: rgba(232,91,91,.1); }
.post-body { padding: 0 14px 12px; line-height: 1.65; font-size: 14px; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.post-actions { display: flex; border-top: 1px solid var(--border); }
.post-action { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 0; cursor: pointer; color: var(--text3); font-size: 13px; font-weight: 500; transition: .15s; border-right: 1px solid var(--border); user-select: none; }
.post-action:last-child { border-right: none; }
.post-action:hover { color: var(--text); background: rgba(255,255,255,.03); }
.post-action.liked { color: var(--red); }
.post-action.liked svg { fill: var(--red); stroke: var(--red); }
.post-action svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; transition: .15s; }

/* Comments */
.comments-panel { border-top: 1px solid var(--border); background: var(--bg); }
.comments-list { max-height: 260px; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.comment-item { display: flex; gap: 9px; }
.comment-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--bg3); flex-shrink: 0; cursor: pointer; }
.comment-body { flex: 1; background: var(--bg3); border-radius: var(--radius-sm); padding: 8px 11px; }
.comment-name { font-size: 12px; font-weight: 600; cursor: pointer; transition: .15s; }
.comment-name:hover { color: var(--accent); }
.comment-text { font-size: 13px; margin-top: 2px; line-height: 1.5; color: var(--text2); }
.comment-input-row { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); align-items: center; }
.comment-input { flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; padding: 9px 14px; font-size: 13px; transition: .2s; }
.comment-input:focus { border-color: var(--accent); }
.comment-input::placeholder { color: var(--text3); }
.btn-comment-send { padding: 9px 15px; background: var(--accent); color: #1a1200; border-radius: 20px; font-weight: 700; font-size: 12px; transition: .15s; white-space: nowrap; }
.btn-comment-send:hover { background: var(--accent2); }

/* Empty / loader states */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text3); }
.empty-state svg { width: 48px; height: 48px; stroke: var(--border); fill: none; stroke-width: 1.5; margin: 0 auto 16px; }
.empty-state h3 { font-size: 17px; color: var(--text2); margin-bottom: 6px; font-weight: 600; }
.empty-state p { font-size: 13px; }
.loader { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text3); gap: 10px; font-size: 14px; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════
   EXPLORE
══════════════════════════════════════════ */
.explore-wrap { max-width: 700px; margin: 0 auto; padding: 20px 16px; }
@media (max-width: 768px) { .explore-wrap { padding: 14px 12px; } }
.section-title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; margin-bottom: 16px; }
.search-bar { display: flex; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 14px; margin-bottom: 16px; }
.search-bar svg { width: 17px; height: 17px; stroke: var(--text3); fill: none; stroke-width: 2; flex-shrink: 0; }
.search-bar input { flex: 1; padding: 12px 0; background: none; color: var(--text); font-size: 14px; }
.search-bar input::placeholder { color: var(--text3); }
.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
@media (max-width: 480px) { .users-grid { grid-template-columns: 1fr 1fr; } }
.user-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 14px; text-align: center; cursor: pointer; transition: .2s; }
.user-card:hover { border-color: rgba(232,168,75,.4); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.user-card-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--bg3); margin: 0 auto 10px; border: 2px solid var(--border); }
.user-card-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.user-card-handle { font-size: 12px; color: var(--text3); margin-bottom: 12px; }
.btn-follow { display: inline-block; padding: 7px 18px; border-radius: 20px; font-weight: 600; font-size: 12px; transition: .15s; border: 1px solid var(--border); cursor: pointer; }
.btn-follow.following { background: var(--bg3); color: var(--text2); }
.btn-follow.not-following { background: var(--accent); color: #1a1200; border-color: var(--accent); }
.btn-follow:hover { opacity: .85; }
.no-results { text-align: center; padding: 40px; color: var(--text3); font-size: 14px; }

/* ══════════════════════════════════════════
   MESSAGES
══════════════════════════════════════════ */
.messages-wrap { display: flex; height: calc(100vh - var(--nav-h) - var(--tab-h)); overflow: hidden; }
@media (min-width: 769px) { .messages-wrap { height: calc(100vh - var(--nav-h)); } }
.chats-list { width: 300px; border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; background: var(--bg); }
@media (max-width: 768px) { .chats-list { width: 100%; } .chats-list.hidden { display: none; } }
.chats-header { padding: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--bg2); position: sticky; top: 0; z-index: 1; }
.chats-title { font-weight: 700; font-size: 16px; }
.new-chat-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--bg3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .15s; }
.new-chat-btn:hover { background: var(--accent-dim); border-color: var(--accent); }
.new-chat-btn svg { width: 15px; height: 15px; stroke: var(--text); fill: none; stroke-width: 2.5; }
.chat-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer; transition: .15s; border-bottom: 1px solid var(--border); }
.chat-item:hover, .chat-item.active { background: var(--bg3); }
.chat-item-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--bg3); flex-shrink: 0; border: 1.5px solid var(--border); }
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.chat-item-last { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-time { font-size: 11px; color: var(--text3); white-space: nowrap; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.chat-window { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
@media (max-width: 768px) { .chat-window { display: none; position: fixed; inset: 0; z-index: 100; background: var(--bg); } .chat-window.mobile-visible { display: flex; } }
.chat-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; background: var(--bg2); flex-shrink: 0; }
.chat-back { width: 32px; height: 32px; border-radius: 50%; background: var(--bg3); display: none; align-items: center; justify-content: center; cursor: pointer; border: 1px solid var(--border); flex-shrink: 0; }
@media (max-width: 768px) { .chat-back { display: flex; } }
.chat-back svg { width: 17px; height: 17px; stroke: var(--text); fill: none; stroke-width: 2.2; }
.chat-peer-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--bg3); cursor: pointer; flex-shrink: 0; border: 1.5px solid var(--border); }
.chat-peer-name { font-weight: 600; font-size: 15px; cursor: pointer; flex: 1; }
.chat-peer-name:hover { color: var(--accent); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { display: flex; gap: 8px; max-width: 76%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble { padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.55; word-break: break-word; }
.msg.theirs .msg-bubble { background: var(--bg3); border-bottom-left-radius: 4px; color: var(--text); }
.msg.mine .msg-bubble { background: var(--accent); color: #1a1200; border-bottom-right-radius: 4px; font-weight: 500; }
.no-chat { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; color: var(--text3); }
.no-chat svg { width: 48px; height: 48px; stroke: var(--border); fill: none; stroke-width: 1.5; }
.no-chat span { font-size: 14px; }
.chat-input-area { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-end; background: var(--bg2); flex-shrink: 0; }
.chat-input { flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; padding: 10px 16px; resize: none; max-height: 120px; line-height: 1.5; font-size: 14px; transition: .2s; }
.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text3); }
.chat-send { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; transition: .15s; border: none; }
.chat-send:hover { background: var(--accent2); transform: scale(1.05); }
.chat-send svg { width: 17px; height: 17px; stroke: #1a1200; fill: none; stroke-width: 2.5; }

/* ══════════════════════════════════════════
   NOTIFICATIONS
══════════════════════════════════════════ */
.notif-wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px; }
@media (max-width: 768px) { .notif-wrap { padding: 14px 0; } }
.notif-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; transition: .15s; }
@media (max-width: 768px) { .notif-item { border-radius: 0; border-left: none; border-right: none; margin-bottom: 2px; } }
.notif-item:hover { background: var(--bg3); }
.notif-item.unread { border-left: 3px solid var(--accent); }
.notif-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--bg3); flex-shrink: 0; }
.notif-text { flex: 1; font-size: 13px; line-height: 1.5; color: var(--text2); }
.notif-text strong { color: var(--text); font-weight: 600; }
.notif-time { font-size: 11px; color: var(--text3); white-space: nowrap; }

/* ══════════════════════════════════════════
   PROFILE
══════════════════════════════════════════ */
.profile-wrap { max-width: 600px; margin: 0 auto; }
.profile-header { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 28px 20px 20px; }
.profile-top { display: flex; align-items: center; gap: 20px; margin-bottom: 14px; }
.profile-big-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--bg3); border: 3px solid var(--border); flex-shrink: 0; }
.profile-info { flex: 1; }
.profile-display-name { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; margin-bottom: 2px; }
.profile-username { font-size: 13px; color: var(--text3); margin-bottom: 12px; }
.profile-stats { display: flex; gap: 20px; }
.stat { text-align: center; }
.stat-num { font-weight: 700; font-size: 17px; }
.stat-lbl { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.profile-bio { font-size: 14px; color: var(--text2); line-height: 1.65; margin-bottom: 4px; }
.profile-actions { display: flex; gap: 8px; margin-top: 14px; }
.btn-edit-profile, .btn-profile-follow, .btn-message-user {
  flex: 1; padding: 9px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; text-align: center; transition: .15s; cursor: pointer; border: 1px solid var(--border);
}
.btn-edit-profile { background: var(--bg3); color: var(--text); }
.btn-edit-profile:hover { background: var(--bg4); }
.btn-profile-follow { background: var(--accent); color: #1a1200; border-color: var(--accent); }
.btn-profile-follow.following { background: var(--bg3); color: var(--text2); border-color: var(--border); }
.btn-message-user { background: var(--bg3); }
.btn-message-user:hover { background: var(--bg4); }
.profile-posts { padding: 12px; }
.profile-posts-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2px; }
.profile-post-thumb { aspect-ratio: 1; overflow: hidden; background: var(--bg3); cursor: pointer; position: relative; }
.profile-post-thumb:hover .post-thumb-overlay { opacity: 1; }
.post-thumb-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; opacity: 0; transition: .2s; color: #fff; font-weight: 600; font-size: 13px; gap: 14px; }
.post-thumb-overlay svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 2; }
.post-thumb-overlay span { display: flex; align-items: center; gap: 4px; }
.profile-post-text { position: absolute; inset: 0; display: flex; align-items: flex-start; padding: 9px; font-size: 11px; color: var(--text2); line-height: 1.4; overflow: hidden; }

/* ══════════════════════════════════════════
   MODALS
══════════════════════════════════════════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; box-shadow: 0 32px 80px rgba(0,0,0,.6); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg2); z-index: 1; }
.modal-title { font-weight: 700; font-size: 16px; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; background: var(--bg3); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .15s; border: 1px solid var(--border); }
.modal-close:hover { background: var(--bg4); }
.modal-close svg { width: 15px; height: 15px; stroke: var(--text); fill: none; stroke-width: 2.5; }
.modal-body { padding: 20px; }
.edit-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.edit-avatar-preview { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--bg3); border: 2px dashed var(--border); cursor: pointer; transition: .2s; flex-shrink: 0; }
.edit-avatar-preview:hover { border-color: var(--accent); }

/* ══════════════════════════════════════════
   iOS INSTALL PROMPT
══════════════════════════════════════════ */
.ios-prompt { position: fixed; bottom: calc(var(--tab-h) + 10px); left: 50%; transform: translateX(-50%); z-index: 300; width: calc(100% - 32px); max-width: 380px; }
.ios-prompt-inner { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 16px 48px rgba(0,0,0,.6); position: relative; }
.ios-prompt-close { position: absolute; top: 12px; right: 14px; color: var(--text3); cursor: pointer; font-size: 16px; line-height: 1; }
.ios-prompt-logo { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 900; color: var(--accent); margin-bottom: 8px; }
.ios-prompt-text { font-size: 14px; color: var(--text2); line-height: 1.6; }
.ios-prompt-text strong { color: var(--text); }
.ios-prompt-arrow { text-align: center; font-size: 22px; margin-top: 10px; color: var(--accent); animation: bounce 1.5s infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ══════════════════════════════════════════
   TOAST
══════════════════════════════════════════ */
#toast { position: fixed; bottom: calc(var(--tab-h) + 16px); left: 50%; transform: translateX(-50%) translateY(16px); background: var(--bg3); border: 1px solid var(--border); color: var(--text); padding: 10px 22px; border-radius: 20px; font-size: 13px; font-weight: 500; opacity: 0; transition: .3s cubic-bezier(.34,1.56,.64,1); z-index: 999; pointer-events: none; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 769px) { #toast { bottom: 24px; } }
