* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
  body { margin: 0; background: #0a0a0f; color: #fff; font-family: "VK Sans Display", "VK Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; letter-spacing: -0.12px; font-weight: 400; min-height: 100vh; }
  #app { display: grid; grid-template-columns: 380px 1fr; min-height: 100vh; }
  #sidebar { background: rgba(255,255,255,0.03); border-right: 1px solid rgba(255,255,255,0.08); padding: 20px; overflow-y: auto; max-height: 100vh; }
  #stage { display: flex; align-items: center; justify-content: center; padding: 30px; background: radial-gradient(ellipse at center, #0f2d5e 0%, #000 80%); }
  .back-link { color: rgba(255,255,255,0.5); text-decoration: none; font-size: 13px; display: inline-flex; gap: 6px; margin-bottom: 16px; }
  .title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
  .subtitle { font-size: 12px; color: rgba(255,255,255,0.4); margin-bottom: 20px; }
  .label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: rgba(255,255,255,0.4); font-weight: 600; margin-bottom: 6px; }
  .field { width: 100%; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 9px 12px; color: #fff; font-size: 13px; margin-bottom: 12px; outline: none; font-family: inherit; }
  .field:focus { border-color: #0077FF; }
  textarea.field { resize: vertical; min-height: 70px; }
  .btn { padding: 10px 16px; border-radius: 10px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 7px; }
  .btn-primary { background: #0077FF; color: #fff; width: 100%; justify-content: center; padding: 12px; }
  .btn-secondary { background: rgba(255,255,255,0.07); color: #fff; border: 1px solid rgba(255,255,255,0.12); }
  .btn-ghost { background: transparent; color: rgba(255,255,255,0.6); padding: 6px 10px; font-size: 12px; }
  .btn-ghost:hover { color: #fff; background: rgba(255,255,255,0.05); }
  .divider { height: 1px; background: rgba(255,255,255,0.08); margin: 18px 0; }
  .row { display: flex; gap: 6px; }
  .row > * { flex: 1; }
  .event-row { display: flex; gap: 8px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; font-size: 12px; }
  .event-row.reply { margin-left: 20px; border-left: 2px solid rgba(0,119,255,0.4); }
  .event-row .who { font-weight: 600; font-size: 11px; color: #0077FF; min-width: 60px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .event-row .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255,255,255,0.85); }
  .event-row button { background: transparent; border: none; color: rgba(255,255,255,0.4); cursor: pointer; padding: 0 4px; }

  /* Device */
  .device { width: 393px; height: 820px; background: #000; border-radius: 44px; padding: 11px; position: relative; box-shadow: 0 35px 80px -20px rgba(0,0,0,0.7), 0 0 0 2px rgba(255,255,255,0.08); }
  .device::before { content: ''; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 124px; height: 36px; background: #000; border-radius: 20px; z-index: 10; }
  .device.vertical { width: 461px; height: 820px; border-radius: 24px; padding: 0; }
  .device.vertical::before { display: none; }
  .device-screen { width: 100%; height: 100%; border-radius: 34px; overflow: hidden; display: flex; flex-direction: column; background: #fff; }
  .device.vertical .device-screen { border-radius: 24px; }

  /* VK — точная палитра 2024/2025 */
  .vk-light {
    --bg: #FFFFFF; --bg2: #F0F2F5; --card: #FFFFFF;
    --text: #000000; --text2: #2C2D2E; --muted: #818C99; --muted2: #99A2AD;
    --link: #0077FF; --border: #E7E8EC; --border2: #EDEEF0;
    --like: #FF3347; --author-bg: #E5EBF1; --author-fg: #2A5885;
    --reaction-bg: #F0F2F5; --reaction-border: transparent;
    --thread-line: #DCE1E6;
  }
  .vk-dark {
    --bg: #19191A; --bg2: #19191A; --card: #19191A;
    --text: #E1E3E6; --text2: #E1E3E6; --muted: #76787A; --muted2: #6D7885;
    --link: #529EF4; --border: #2A2A2B; --border2: #232324;
    --like: #FF5C5C; --author-bg: #2C3A4A; --author-fg: #70A7E8;
    --reaction-bg: #232324; --reaction-border: transparent;
    --thread-line: #2E2F30;
  }

  .vk-screen, .phone {
    background: var(--bg); color: var(--text); height: 100%;
    display: flex; flex-direction: column;
    font-family: "VK Sans Display", "VK Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.12px;
    font-weight: 400;
    font-size: 15px;
  }

  /* iOS status bar */
  .status-bar { display:flex; justify-content:space-between; align-items:center; padding: 16px 28px 6px; background: var(--card); color: var(--text); font-size:15px; font-weight:600; letter-spacing:-0.2px; }
  .status-bar .time { font-variant-numeric: tabular-nums; }
  .status-bar .ic-row { display:flex; align-items:center; gap:6px; }

  /* Top app bar */
  .vk-top { display:flex; align-items:center; padding: 4px 4px 6px; background: var(--card); border-bottom: 0.5px solid var(--border); min-height: 44px; }
  .vk-top .btn-ico { width: 44px; height: 40px; display:flex; align-items:center; justify-content:center; color: var(--link); cursor:pointer; }
  .vk-top .tt-wrap { flex:1; text-align:center; padding: 0 4px; }
  .vk-top .tt-title { font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: -0.2px; line-height: 1.15; }
  .vk-top .tt-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

  .feed { flex: 1; overflow-y: auto; scrollbar-width: none; background: var(--bg); }
  .feed::-webkit-scrollbar { display: none; }

  /* Post card */
  .post { background: var(--card); padding: 12px 0 0; border-bottom: 8px solid var(--bg2); }
  .vk-dark .post { border-bottom: 1px solid var(--border); }
  .post-head { display: flex; gap: 10px; align-items: center; padding: 0 14px 10px; }
  .post-head .av { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; background-size:cover; background-position:center; }
  .post-head .meta { flex: 1; min-width: 0; }
  .post-head .name { font-weight: 600; font-size: 15px; color: var(--text); display:flex; align-items:center; gap:4px; letter-spacing:-0.1px; }
  .post-head .time { color: var(--muted); font-size: 13px; margin-top: 1px; display:flex; align-items:center; gap:4px; }
  .post-head .time .dot { width:3px; height:3px; border-radius:50%; background: var(--muted); }
  .post-head .more { width:32px; height:32px; display:flex; align-items:center; justify-content:center; color: var(--muted); }

  .vk-verified { width:14px; height:14px; flex-shrink:0; }

  .post-text { font-size: 15px; line-height: 1.35; color: var(--text); padding: 0 14px 10px; white-space: pre-wrap; word-wrap: break-word; }
  .post-image { width: 100%; min-height: 240px; max-height: 440px; background: linear-gradient(135deg, #0077FF, #5ac8fa); display:flex; align-items:center; justify-content:center; overflow:hidden; font-size:72px; }
  .post-image img, .post-image video { width: 100%; height: 100%; object-fit: cover; display:block; }

  .post-actions { display:flex; align-items:center; padding: 6px 8px; gap: 4px; }
  .act { display:flex; align-items:center; gap: 5px; padding: 7px 10px; color: var(--muted2); font-size: 14px; font-weight: 500; cursor: pointer; border-radius: 18px; background: var(--reaction-bg); transition: background .15s; }
  .act svg { width: 20px; height: 20px; stroke-width: 1.8; }
  .act.liked { color: var(--like); }
  .act.liked .ic-heart { fill: var(--like); stroke: var(--like); }
  .act .count { font-variant-numeric: tabular-nums; }
  .views-act { margin-left: auto; background: transparent; padding-right: 4px; pointer-events: none; }

  /* Comments */
  .cm-section { background: var(--card); padding: 2px 0 10px; }
  .cm-section-header { padding: 14px 14px 6px; font-size: 17px; font-weight: 600; color: var(--text); display:flex; align-items:center; justify-content:space-between; letter-spacing:-0.2px; }
  .cm-section-header .sort { color: var(--link); font-size:15px; font-weight:400; display:flex; align-items:center; gap:2px; cursor: pointer; }
  .cm-section-header .sort svg { width: 14px; height: 14px; }

  .cm { display:flex; gap: 10px; padding: 8px 14px 4px; animation: cmIn .35s cubic-bezier(.34,1.56,.64,1) both; position: relative; }
  .cm.reply { padding-left: 56px; }
  .cm.reply::before {
    content: ''; position: absolute; left: 32px; top: 0; bottom: -4px;
    width: 2px; background: var(--thread-line); border-radius: 1px;
  }
  .cm.reply.last-reply::before { bottom: 50%; }
  /* Сворачиваемый тред */
  .cm-thread { display: flex; flex-direction: column; }
  .cm-thread.collapsed > .cm { display: none; }
  .cm-toggle { padding: 4px 14px 8px 56px; font-size: 14px; font-weight: 500; color: var(--link); cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; position: relative; }
  .cm-toggle::before { content: ''; display: inline-block; width: 20px; height: 2px; background: var(--thread-line); border-radius: 1px; }
  .cm-toggle:hover { text-decoration: underline; }
  .cm.reply::after {
    content: ''; position: absolute; left: 32px; top: 22px;
    width: 16px; height: 2px; background: var(--thread-line); border-radius: 1px;
  }
  @keyframes cmIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

  .cm .c-av { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; background-size:cover; background-position:center; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:600; font-size:14px; letter-spacing:-0.3px; }
  .cm.reply .c-av { width: 32px; height: 32px; font-size: 13px; }
  .cm .c-body { flex: 1; min-width: 0; font-size: 15px; color: var(--text); line-height: 1.32; padding-top: 1px; }

  .cm .name-row { display:flex; align-items:center; gap: 5px; margin-bottom: 1px; flex-wrap: wrap; }
  .cm .name { font-weight: 500; font-size: 15px; color: var(--text); letter-spacing:-0.1px; }
  .cm .author-badge {
    display: inline-flex; align-items: center; height: 16px;
    padding: 0 6px; border-radius: 4px;
    background: var(--author-bg); color: var(--author-fg);
    font-size: 10px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase;
  }
  .cm .text { font-size: 15px; color: var(--text); word-wrap: break-word; }
  .cm .text a, .cm .mention, .cm .hashtag { color: var(--link); text-decoration: none; }

  .cm .attach {
    margin-top: 6px; width: 160px; height: 160px; border-radius: 12px; overflow: hidden;
    background: linear-gradient(135deg,#6EC5E9,#9BB0F0); display:flex; align-items:center; justify-content:center; font-size: 48px;
  }
  .cm .attach.sticker { background: transparent; width: 120px; height: 120px; }

  .c-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12.5px;
    color: #626D7A;
    font-weight: 500;
    flex-wrap: wrap;
  }
  .vk-dark .c-actions { color: var(--muted2); }
  .c-react {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    height: 24px;
    border-radius: 12px;
    background: rgba(0,119,255,0.08);
    color: #0077FF;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    transition: background .15s;
  }
  .vk-dark .c-react { background: rgba(82,158,244,0.14); color: var(--link); }
  .c-react .emoji, .c-react .em { font-size: 14px; line-height: 1; }
  .c-react .count, .c-react .n { font-variant-numeric: tabular-nums; }
  .c-react.liked { background: rgba(255,51,71,0.1); color: #FF3347; }
  .vk-dark .c-react.liked { background: rgba(255,92,92,0.18); color: var(--like); }
  .c-react:hover { background: rgba(0,119,255,0.14); }
  .vk-dark .c-react:hover { background: rgba(82,158,244,0.22); }
  .c-react.liked:hover { background: rgba(255,51,71,0.18); }
  .c-reply { color: #626D7A; cursor: pointer; font-weight: 500; }
  .vk-dark .c-reply { color: var(--muted2); }
  .c-reply:hover { color: var(--text); }
  .c-time  { color: #99A2AD; font-weight: 400; }
  .vk-dark .c-time { color: var(--muted); }

  .pinned-row { display:flex; align-items:center; gap:4px; color: var(--muted); font-size: 13px; margin-bottom: 2px; font-weight: 400; }
  .pinned-row svg { width: 12px; height: 12px; }

  .view-more { color: var(--link); font-size: 14px; padding: 6px 14px 10px 60px; cursor: pointer; font-weight: 400; display: flex; align-items: center; gap: 4px; }
  .view-more svg { width: 10px; height: 10px; }

  /* Composer */
  .cm-input { display:flex; align-items:center; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--card); border-top: 0.5px solid var(--border); }
  .cm-input .avatar-me { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #0077FF, #529EF4); flex-shrink:0; }
  .cm-input .field-box { flex:1; background: var(--reaction-bg); border-radius: 18px; padding: 0 8px 0 14px; display:flex; align-items:center; gap: 6px; color: var(--muted); font-size: 15px; min-height: 36px; }
  .cm-input .field-box .txt { flex: 1; }
  .cm-input .field-box .ic { width: 32px; height: 32px; display:flex; align-items:center; justify-content:center; color: var(--muted); flex-shrink:0; cursor: pointer; }
  .cm-input .field-box .ic svg { width: 22px; height: 22px; }
  .cm-input .send-ic { width: 40px; height: 40px; display:flex; align-items:center; justify-content:center; color: var(--link); cursor: pointer; }

  .home-bar { width: 134px; height: 5px; background: rgba(0,0,0,0.85); border-radius: 3px; margin: 6px auto 8px; }
  .vk-dark .home-bar { background: rgba(255,255,255,0.55); }

  .fmt-row { display: flex; gap: 6px; margin-bottom: 12px; }
  .fmt-btn { flex: 1; padding: 8px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: rgba(255,255,255,0.7); font-size: 12px; font-weight: 500; cursor: pointer; }
  .fmt-btn.active { background: rgba(0,119,255,0.15); border-color: #0077FF; color: #60a5fa; }

  .controls { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: rgba(15,15,25,0.9); border: 1px solid rgba(255,255,255,0.1); border-radius: 40px; padding: 7px 10px; display: flex; gap: 6px; z-index: 50; backdrop-filter: blur(14px); }
  .ctrl-btn { background: transparent; color: #fff; border: none; padding: 8px 14px; border-radius: 30px; font-size: 13px; font-weight: 600; cursor: pointer; }
  .ctrl-btn.play { background: #0077FF; }
  .ctrl-btn.stop { background: rgba(239,68,68,0.85); }
  .ctrl-btn.rec  { background: rgba(239,68,68,0.2); color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
  .ctrl-btn.rec.recording { background: rgba(239,68,68,0.95); color: #fff; }
  .sc-grid{display:flex;flex-wrap:wrap;gap:6px;}
  .sc-btn{padding:6px 10px;border-radius:8px;border:1px solid rgba(255,255,255,0.1);background:rgba(255,255,255,0.05);cursor:pointer;font-size:12px;color:inherit;}
  .sc-btn:hover{background:rgba(255,255,255,0.1);}
