/* Контент ВК - стили. Просто и читаемо, работает на компьютере и телефоне (И6). */
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
:root {
  --bg: #f5f6f8; --panel: #fff; --line: #e2e4e8; --text: #1c1e21;
  --muted: #7a7e85; --accent: #2d6cdf; --red: #d63031; --green: #1a9c5d;
}
body { font: 14px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif;
       background: var(--bg); color: var(--text); height: 100vh;
       display: flex; flex-direction: column; }

/* Вход */
.login-body { align-items: center; justify-content: center; }
.login-box { background: var(--panel); padding: 32px; border-radius: 12px;
             width: 320px; display: flex; flex-direction: column; gap: 12px;
             box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.login-box h1 { font-size: 22px; }
.login-box input { padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.login-box button { padding: 10px; border: 0; border-radius: 8px;
                    background: var(--accent); color: #fff; cursor: pointer; }
.vk-login-btn { display: block; text-align: center; padding: 12px; border-radius: 8px;
                background: #07f; color: #fff; text-decoration: none; font-weight: 600; }
.fallback-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.fallback-form input { padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.fallback-form button { padding: 10px; border: 0; border-radius: 8px;
                        background: var(--accent); color: #fff; cursor: pointer; }
.login-box details summary { cursor: pointer; }
.profile-btn { display: flex; justify-content: space-between; align-items: center;
               width: 100%; padding: 12px; margin: 6px 0; border: 1px solid var(--line);
               border-radius: 10px; background: var(--panel); cursor: pointer;
               font-size: 15px; font-weight: 600; }
.profile-btn:hover { background: var(--bg); }

/* Шапка */
.topbar { display: flex; align-items: center; gap: 16px; padding: 8px 16px;
          background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.tab { border: 0; background: none; padding: 8px 12px; border-radius: 8px;
       cursor: pointer; font-size: 14px; }
.tab.active { background: var(--bg); font-weight: 600; }
.topbar-right { display: flex; gap: 12px; align-items: center; }
.muted { color: var(--muted); font-size: 12px; text-decoration: none; }
.badge { background: var(--red); color: #fff; border-radius: 10px;
         padding: 1px 7px; font-size: 12px; }

/* Три колонки (И1) */
.columns { display: flex; flex: 1; min-height: 0; }
.col { display: flex; flex-direction: column; min-height: 0;
       border-right: 1px solid var(--line); background: var(--panel); }
.col-communities { width: 280px; flex-shrink: 0; }
.col-posts { width: 360px; flex-shrink: 0; }
.col-card { flex: 1; }
.col-head { padding: 8px; border-bottom: 1px solid var(--line);
            display: flex; gap: 8px; align-items: center; }
.col-head input[type=text], #comm-search { flex: 1; padding: 7px 10px;
            border: 1px solid var(--line); border-radius: 8px; }
.mine-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.list { overflow-y: auto; flex: 1; }
.placeholder { padding: 24px; color: var(--muted); text-align: center; }

/* Сообщества (С2-С4) */
.comm { display: flex; gap: 10px; padding: 10px 12px; cursor: pointer;
        border-bottom: 1px solid var(--line); align-items: center; }
.comm:hover, .comm.active { background: var(--bg); }
.comm img { width: 36px; height: 36px; border-radius: 50%; background: var(--line); }
.comm .comm-info { flex: 1; min-width: 0; }
.comm .comm-name { font-weight: 600; white-space: nowrap; overflow: hidden;
                   text-overflow: ellipsis; }
.comm .comm-sub { font-size: 12px; color: var(--muted); }
.comm.no-access { background: #fdecea; }
.comm.no-access .comm-sub { color: var(--red); }

/* Посты (И2) */
.filters { display: flex; gap: 4px; flex-wrap: wrap; }
.filter { border: 1px solid var(--line); background: none; border-radius: 14px;
          padding: 4px 10px; cursor: pointer; font-size: 12px; }
.filter.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.post-item { padding: 10px 12px; border-bottom: 1px solid var(--line);
             cursor: pointer; display: flex; gap: 10px; }
.post-item:hover, .post-item.active { background: var(--bg); }
.post-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.post-item .post-info { flex: 1; min-width: 0; }
.post-item .post-date { font-size: 12px; color: var(--muted); }
.post-item .post-text { font-size: 13px; max-height: 3.9em; overflow: hidden; }
.post-item .post-stats { font-size: 12px; color: var(--muted); margin-top: 4px; }
.unanswered-mark { color: var(--red); font-weight: 600; }

/* Карточка (И4) */
.card-area { overflow-y: auto; flex: 1; padding: 16px; }
.post-full-text { white-space: pre-wrap; margin: 12px 0; }
.post-attachments img { max-width: 200px; border-radius: 8px; margin: 4px; }
.vk-link-btn { display: inline-block; padding: 6px 12px; border: 1px solid var(--line);
               border-radius: 8px; text-decoration: none; color: var(--text);
               font-size: 13px; }
.comment { margin: 10px 0; padding: 10px; border-radius: 10px; background: var(--bg); }
.comment.reply { margin-left: 28px; }
.comment.from-community { background: #e8f2ec; }
.comment.unanswered-c { outline: 2px solid var(--red); }
.comment .c-head { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.comment .c-author { font-weight: 600; color: var(--text); }
.comment .c-actions { margin-top: 8px; display: flex; gap: 8px; }
.reply-box { display: flex; gap: 8px; margin-top: 8px; }
.reply-box input { flex: 1; padding: 7px 10px; border: 1px solid var(--line);
                   border-radius: 8px; }
button.small { padding: 6px 10px; border: 1px solid var(--line); background: var(--panel);
               border-radius: 8px; cursor: pointer; font-size: 12px; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.error { color: var(--red); font-size: 13px; }
.ok { color: var(--green); font-size: 13px; }

/* Сводный список (И5) и админка */
.unanswered-page, .admin-page { max-width: 860px; margin: 0 auto; padding: 16px;
                                width: 100%; overflow-y: auto; }
#view-unanswered, #view-admin { flex: 1; min-height: 0; display: flex; }
.ua-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
           padding: 12px; margin: 8px 0; }
.ua-item .c-head { font-size: 12px; color: var(--muted); }
.admin-page section { background: var(--panel); border: 1px solid var(--line);
                      border-radius: 10px; padding: 16px; margin: 12px 0; }
.form-row { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.form-row input, .form-row select { padding: 8px; border: 1px solid var(--line);
                                    border-radius: 8px; }
.form-row button { padding: 8px 14px; border: 0; border-radius: 8px;
                   background: var(--accent); color: #fff; cursor: pointer; }
.user-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line);
            align-items: center; }

/* Телефон (И6): колонки в столбик */
@media (max-width: 800px) {
  .columns { flex-direction: column; overflow-y: auto; }
  .col { width: 100% !important; border-right: 0; border-bottom: 1px solid var(--line); }
  .list { max-height: 40vh; }
}
