:root {
      color-scheme: dark;
      --bg: #0f0f10;
      --wall: #050607;
      --bar: #202124;
      --panel: #1a1b1d;
      --panel-2: #242529;
      --line: #2d2e32;
      --text: #f4f4f5;
      --muted: #8f9299;
      --muted-2: #6f737b;
      --accent: #2a9ef4;
      --accent-2: #1687df;
      --green: #52d273;
      --danger: #ef5b6d;
      --bubble-in: #202124;
      --bubble-out: #2b77d9;
      --nav-h: 76px;
      --top-h: 108px;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    }
    * { box-sizing: border-box; }
    html, body { margin: 0; width: 100%; min-height: 100%; background: #000; color: var(--text); overflow-x: hidden; }
    body { overflow: hidden; }
    button, input { font: inherit; }
    button { color: inherit; border: 0; background: transparent; }
    .phone {
      width: 100%;
      height: var(--app-height, 100dvh);
      max-width: 540px;
      margin: 0 auto;
      background: var(--bg);
      position: relative;
      overflow: hidden;
    }
    .hidden { display: none !important; }
    .auth-screen {
      min-height: 100%;
      padding: max(26px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
      display: grid;
      align-content: center;
      gap: 22px;
      background: radial-gradient(circle at 50% -10%, rgba(42, 158, 244, .22), transparent 38%), #111214;
    }
    .auth-logo {
      width: 88px; height: 88px; border-radius: 50%;
      display: grid; place-items: center; margin: 0 auto 4px;
      background: linear-gradient(180deg, #5ab7ff, #238adf);
      font-size: 42px; font-weight: 800;
    }
    .auth-title { text-align: center; font-size: 28px; font-weight: 760; margin: 0; }
    .auth-copy { text-align: center; color: var(--muted); margin: -10px 0 8px; line-height: 1.35; }
    .auth-card { display: grid; gap: 14px; }
    .auth-screen.resume-waiting .field,
    .auth-screen.resume-waiting .primary-btn,
    .auth-screen.resume-waiting .ghost-btn { display: none !important; }
    .field { display: grid; gap: 8px; }
    .field label { color: var(--accent); font-weight: 650; font-size: 14px; }
    .field input {
      width: 100%; border: 1px solid var(--line); border-radius: 12px;
      background: var(--panel); color: var(--text); padding: 15px 14px;
      outline: none; font-size: 17px;
    }
    .field input:focus { border-color: var(--accent); }
    .primary-btn {
      height: 50px; border-radius: 14px; background: var(--accent);
      color: #fff; font-weight: 750; box-shadow: 0 10px 24px rgba(42, 158, 244, .26);
    }
    .ghost-btn { height: 44px; border-radius: 12px; background: var(--panel-2); color: var(--text); font-weight: 650; }
    .status { min-height: 20px; color: var(--muted); font-size: 14px; line-height: 1.35; }
    .status.error { color: var(--danger); }
    .status.ok { color: var(--green); }

    .app { width: 100%; min-width: 0; height: 100%; display: grid; grid-template-rows: auto 1fr auto; background: var(--bg); overflow: hidden; }
    .top {
      padding: max(10px, env(safe-area-inset-top)) 14px 0;
      background: var(--bar);
      border-bottom: 1px solid rgba(255,255,255,.04);
      z-index: 3;
      min-width: 0;
      overflow: hidden;
    }
    .top-row { min-width: 0; height: 44px; display: flex; align-items: center; gap: 10px; }
    .title { font-size: 24px; font-weight: 800; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; color: #f0f1f2; }
    .search {
      height: 38px; display: flex; align-items: center; gap: 10px;
      background: #151619; border-radius: 20px; padding: 0 14px; margin: 2px 0 8px;
    }
    .search span { color: var(--muted); font-size: 19px; }
    .search input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 16px; }
    .search-clear { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; color: #dce3eb; font-size: 18px; display: none; place-items: center; }
    .search-clear.visible { display: grid; }
    .tabs { display: flex; max-width: 100%; min-width: 0; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0 10px 8px; margin: 0 -10px; scroll-padding-inline: 10px; overscroll-behavior-x: contain; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab {
      flex: 0 0 auto; height: 36px; padding: 0 14px; border-radius: 19px;
      color: #b7bac0; background: #18191b; font-weight: 700; white-space: nowrap;
    }
    .tab.active { color: #bde5ff; background: #20384a; }
    .sort-bar {
      display: flex; align-items: center; gap: 8px; min-width: 0;
      padding: 0 10px 8px; margin: -2px -10px 0; overflow-x: auto; scrollbar-width: none;
    }
    .sort-bar::-webkit-scrollbar { display: none; }
    .sort-label { flex: 0 0 auto; color: var(--muted); font-size: 13px; font-weight: 760; }
    .sort-select {
      flex: 0 1 190px; min-width: 128px; height: 32px; border: 0; border-radius: 16px;
      padding: 0 30px 0 12px; color: #dcefff; background: #182c3c; font-weight: 760;
      outline: 0; appearance: none;
    }
    .sort-direction {
      flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
      background: rgba(42,158,244,.18); color: #bde5ff; font-size: 18px; font-weight: 900;
      display: grid; place-items: center;
    }

    .content { min-height: 0; min-width: 0; overflow: hidden; position: relative; }
    .scroll { height: 100%; min-width: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scroll-padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); }
    .sync-line { color: var(--accent); font-weight: 700; font-size: 13px; padding: 6px 18px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .sync-line:empty { display: none; }
    .list { display: grid; min-width: 0; max-width: 100%; overflow-x: hidden; }
    .row {
      width: 100%; min-width: 0; min-height: 70px; display: grid; grid-template-columns: 54px minmax(0, 1fr) 44px; gap: 10px;
      padding: 7px 14px; align-items: center;
    }
    .row.channel-row { grid-template-columns: 54px minmax(0, 1fr) auto; }
    .row:active { background: rgba(255,255,255,.05); }
    .avatar {
      width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
      background: linear-gradient(180deg, #69bfff, #2d8de4); font-size: 22px; font-weight: 800; overflow: hidden;
    }
    .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .avatar.alt { background: linear-gradient(180deg, #9c72f2, #5d4bd7); }
    .avatar.saved { background: #2b9bf0; }
    .row-main { min-width: 0; max-width: 100%; overflow: hidden; display: block; }
    .row-title { display: block; min-width: 0; font-size: 17px; font-weight: 770; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .row-sub { display: block; min-width: 0; margin-top: 3px; color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .row-kpis { display: flex; max-width: 100%; gap: 5px; margin-top: 6px; overflow: hidden; flex-wrap: wrap; }
    .row-kpi { color: #c7cbd2; background: #2a2b30; border-radius: 10px; padding: 3px 7px; font-size: 12px; white-space: nowrap; }
    .row-meta { width: 44px; min-width: 0; color: var(--muted-2); font-size: 13px; text-align: right; display: grid; gap: 5px; justify-items: end; align-self: start; padding-top: 7px; }
    .channel-row .row-meta { width: auto; align-self: center; padding-top: 0; }
    .row-action { min-width: 82px; height: 36px; border-radius: 18px; background: var(--accent); color: #fff; font-weight: 780; font-size: 14px; padding: 0 12px; }
    .row-action.off { background: #303136; color: #c9cbd0; }
    .badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent); color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; }
    .empty { padding: 56px 28px; text-align: center; color: var(--muted); line-height: 1.45; }
    .empty strong { display: block; color: var(--text); font-size: 20px; margin-bottom: 8px; }
    .empty .list-retry { width: auto; min-width: 150px; margin-top: 16px; padding: 0 20px; }
    .list-footer { min-height: 54px; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
    .loading-dot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #3a3c42; border-top-color: var(--accent); animation: spin .8s linear infinite; }

    .gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: #000; }
    .tile { aspect-ratio: 1; background: #17181b; position: relative; overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
    .tile:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
    .tile img, .tile video, .tile iframe { width: 100%; height: 100%; object-fit: cover; display: block; border: 0; }
    .tile-preview { width: 100%; height: 100%; display: grid; place-items: center; }
    .tile-fallback { padding: 8px; text-align: center; overflow-wrap: anywhere; }
    .tile-fallback strong { display: block; color: #f4f7fb; font-size: 12px; margin-bottom: 3px; }
    .tile.state-missing, .tile.state-needs_download, .tile.state-failed { background: #18344d; }
    .tile.state-auth_error { background: #3b2025; }
    .tile-skeleton { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: rgba(255,255,255,.46); animation: spin .9s linear infinite; }
    .tile-audio { display: grid; place-items: center; align-content: center; gap: 8px; color: #c9cdd3; }
    .tile-audio::before { content: ""; width: 42px; height: 22px; border-radius: 12px; background: repeating-linear-gradient(90deg, rgba(42,158,244,.7) 0 3px, transparent 3px 7px); opacity: .72; }
    .tile .kind { position: absolute; left: 6px; bottom: 5px; padding: 3px 6px; border-radius: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; }
    .tile .select { position: absolute; right: 7px; top: 7px; width: 26px; height: 26px; border: 2px solid #fff; border-radius: 50%; background: rgba(0,0,0,.22); }
    .tile.selected .select { background: var(--accent); border-color: var(--accent); }
    .gallery-head { min-height: 60px; max-width: 100%; display: grid; align-content: center; gap: 6px; padding: 6px 10px; color: var(--muted); background: #0f1012; font-weight: 700; overflow: hidden; }
    .gallery-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .gallery-chip-row { display: flex; gap: 8px; min-width: 0; overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: none; overscroll-behavior-x: contain; }
    .gallery-chip-row::-webkit-scrollbar { display: none; }
    .gallery-filter { flex: 0 0 auto; min-height: 30px; padding: 0 10px; border-radius: 15px; background: rgba(255,255,255,.06); color: #d2d6dc; font-size: 13px; font-weight: 760; }
    .gallery-filter.active { background: rgba(42,158,244,.22); color: #aee0ff; }
    .gallery-filter:disabled { opacity: .45; }
    .gallery-selection-bar { display: flex; align-items: center; gap: 8px; min-width: 0; padding-top: 2px; }
    .gallery-selection-bar span { flex: 1; min-width: 0; font-size: 13px; color: #c8d6e4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .gallery-selection-bar button { flex: 0 0 auto; min-height: 30px; padding: 0 10px; border-radius: 15px; background: rgba(42,158,244,.22); color: #bfe4ff; font-size: 13px; font-weight: 800; }
    .gallery-selection-bar button.secondary { background: rgba(255,255,255,.07); color: #d2d6dc; }
    .gallery-selection-bar button:disabled { opacity: .55; }

    .nav {
      position: absolute; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%);
      width: calc(100% - 36px); max-width: 430px; height: 66px; background: rgba(35,36,39,.96);
      border-radius: 32px; display: grid; grid-template-columns: repeat(4, 1fr);
      box-shadow: 0 12px 36px rgba(0,0,0,.34); z-index: 5; overflow: hidden;
    }
    .nav button { display: grid; place-items: center; align-content: center; gap: 4px; color: #fff; font-size: 13px; font-weight: 700; }
    .nav .ico { font-size: 24px; line-height: 1; }
    .nav button.active { color: #5bbcff; background: rgba(42, 158, 244, .12); }
    .float-nav.floatNavAvoidsDialogSend {
      position: absolute; right: 18px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 18;
      width: 44px; height: 44px; border-radius: 50%; background: rgba(42,158,244,.9); color: #fff;
      display: grid; place-items: center; font-size: 22px; font-weight: 850; box-shadow: 0 10px 26px rgba(0,0,0,.34);
    }
    .float-nav.hidden { display: none; }
    .dialog:not(.hidden) ~ .float-nav { bottom: calc(132px + env(safe-area-inset-bottom)); }
    .dialog.composer-focused ~ .float-nav { display: none; }
    .profile-screen:not(.hidden) ~ .float-nav { display: none; }
    .safe-area-inset-bottom { padding-bottom: env(safe-area-inset-bottom); }

    .dialog, .profile-screen { position: absolute; inset: 0; background: var(--wall); z-index: 10; display: grid; grid-template-rows: auto 1fr auto; }
    .dialog-head, .profile-head {
      background: var(--bar); display: flex; align-items: center; gap: 12px;
      padding: max(12px, env(safe-area-inset-top)) 12px 10px;
    }
    .dialog-title, .profile-title { min-width: 0; flex: 1; }
    .dialog-title strong, .profile-title strong { display: block; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .dialog-title span, .profile-title span { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
    .dialog-menu.menuViewportClamp { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 48px); right: 12px; left: auto; z-index: 24; width: max-content; max-width: min(320px, calc(100vw - 24px)); padding: 8px; border-radius: 14px; background: rgba(31,33,38,.98); box-shadow: 0 16px 40px rgba(0,0,0,.42); display: grid; gap: 4px; overflow-x: hidden; overflow-wrap: anywhere; }
    .dialog-menu.hidden { display: none; }
    .dialog-menu button { min-height: 42px; max-width: 100%; border-radius: 10px; padding: 0 12px; text-align: left; color: var(--text); background: transparent; font-weight: 720; overflow-wrap: anywhere; }
    .dialog-menu button:active { background: rgba(255,255,255,.08); }
    .dialog-menu-status { color: var(--muted); font-size: 13px; line-height: 1.35; padding: 6px 12px 4px; overflow-wrap: anywhere; }
    .dialog-job-row { min-width: 0; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.08); overflow-wrap: anywhere; }
    .dialog-job-row:first-child { border-top: 0; }
    .menu-download-link { color: var(--accent); font-weight: 800; text-decoration: none; }
    .dialog-job-row .menu-download-link { min-height: 0; height: auto; padding: 0; display: inline-block; background: transparent; border-radius: 0; text-align: left; }
    .download-success { display: block; margin-top: 2px; color: #9bd6ff; font-size: 12px; overflow-wrap: anywhere; }
    .dialog-profile-trigger { min-width: 0; flex: 1; display: flex; align-items: center; gap: 12px; text-align: left; }
    .dialog-profile-trigger:disabled { cursor: default; }
    .dialog-profile-trigger .avatar { flex: 0 0 auto; }
    .timeline {
      overflow-y: auto; padding: 12px 10px calc(74px + env(safe-area-inset-bottom));
      background:
        radial-gradient(circle at 20% 18%, rgba(255,255,255,.04), transparent 10%),
        radial-gradient(circle at 80% 30%, rgba(255,255,255,.035), transparent 12%),
        #050607;
    }
    .timeline-stack { min-height: 100%; display: flex; flex-direction: column; align-items: stretch; }
    .timeline-stack.bottom { justify-content: flex-end; }
    .timeline-row { width: 100%; display: flex; justify-content: flex-start; margin: 7px 0; }
    .timeline-row.out { justify-content: flex-end; }
    .timeline-row.system { justify-content: center; margin: 12px 0 8px; }
    .bubble {
      display: block; width: max-content; max-width: min(84%, 430px); min-width: 0;
      padding: 9px 12px; border-radius: 14px; background: var(--bubble-in); line-height: 1.32;
      position: relative; white-space: normal; overflow-wrap: anywhere; text-align: left;
    }
    .bubble.out { background: var(--bubble-out); }
    .bubble.event { border: 1px solid rgba(42,158,244,.45); }
    .bubble.selected { outline: 2px solid var(--accent); }
    .bubble .meta { color: rgba(255,255,255,.66); font-size: 12px; margin-top: 5px; text-align: right; }
    .event-label { display: block; color: #9bd6ff; font-size: 12px; font-weight: 800; margin-bottom: 4px; text-transform: uppercase; }
    .sender-label { display: block; color: #9bd6ff; font-size: 13px; font-weight: 800; margin-bottom: 4px; overflow-wrap: anywhere; }
    .forward-label { display: block; color: #f0a0a8; font-size: 13px; font-weight: 760; margin-bottom: 4px; overflow-wrap: anywhere; }
    .reply-card { border-left: 3px solid rgba(155,216,255,.8); padding: 4px 0 5px 8px; margin-bottom: 7px; color: #d8ecff; background: rgba(255,255,255,.04); border-radius: 6px; overflow-wrap: anywhere; }
    .reply-card strong { display: block; font-size: 13px; color: #9bd6ff; }
    .reply-card span { display: block; font-size: 13px; color: rgba(255,255,255,.76); }
    .bubble-text { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
    .location-card { width: min(260px, 72vw); min-height: 150px; border-radius: 14px; overflow: hidden; background: #e8e2ca; color: #2b3440; margin-bottom: 7px; display: grid; grid-template-rows: 1fr auto; }
    .location-map { min-height: 108px; display: grid; place-items: center; background: linear-gradient(135deg, #e7dfc8 25%, #d7e7c7 25% 35%, #e7dfc8 35% 55%, #cfe1ee 55%); position: relative; }
    .location-map::before { content: ""; width: 54px; height: 54px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(255,255,255,.75); }
    .location-meta { padding: 9px 10px; background: rgba(0,0,0,.72); color: #fff; font-weight: 760; }
    .location-meta span { display: block; color: #b9c4cf; font-size: 12px; font-weight: 500; margin-top: 2px; overflow-wrap: anywhere; }
    .media-card { min-width: 190px; max-width: min(260px, 72vw); min-height: 132px; border-radius: 12px; overflow: hidden; background: #121315; display: grid; place-items: center; margin-bottom: 7px; position: relative; }
    .media-card img, .media-card video, .media-card iframe { width: 100%; height: 100%; max-height: 260px; object-fit: cover; display: block; border: 0; }
    .media-card.video-note-card { min-width: 168px; width: min(232px, 64vw); max-width: min(232px, 64vw); aspect-ratio: 1; min-height: 0; border-radius: 999px; }
    .media-card.video-note-card img, .media-card.video-note-card video { height: 100%; border-radius: inherit; }
    .media-card.video-note-card video { background: #0d0f11; object-fit: cover; }
    .media-time { position: absolute; right: 8px; bottom: 6px; z-index: 2; padding: 2px 6px; border-radius: 10px; background: rgba(0,0,0,.52); color: #d7edf8; font-size: 11px; line-height: 1.2; }
    .media-fallback { display: grid; place-items: center; align-content: center; gap: 6px; padding: 18px; color: #c9cdd3; text-align: center; }
    .media-fallback strong { display: block; color: #fff; font-size: 15px; }
    .media-fallback span { overflow-wrap: anywhere; }
    .media-retry { min-height: 30px; margin-top: 4px; padding: 0 12px; border-radius: 15px; background: rgba(42,158,244,.22); color: #bde5ff; font-size: 13px; font-weight: 760; display: inline-grid; place-items: center; }
    .media-retry-error { color: var(--danger); font-size: 12px; overflow-wrap: anywhere; }
    .edited-diff { display: grid; gap: 7px; }
    .edited-diff span { display: block; color: rgba(255,255,255,.58); font-size: 12px; font-weight: 700; }
    .load-older-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
    .load-older-sentinel { flex: 1 1 100%; min-width: 0; padding: 8px 10px; border-radius: 14px; background: rgba(32,33,36,.72); color: #aeb4bd; font-size: 13px; font-weight: 720; text-align: center; overflow-wrap: anywhere; }
    .load-older-retry, .load-latest, .new-message-badge { height: 34px; border-radius: 17px; background: rgba(32,33,36,.92); color: #dfe1e5; font-weight: 800; padding: 0 12px; white-space: nowrap; }
    .load-start { flex: 0 0 auto; height: 42px; border-radius: 20px; background: rgba(42,158,244,.2); color: #bde5ff; font-weight: 800; padding: 0 14px; white-space: nowrap; }
    .dialog-history-note { width: 100%; margin: 0 0 8px; padding: 8px 10px; border-radius: 12px; background: rgba(42,158,244,.12); color: #bde5ff; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
    .date-pill { width: max-content; max-width: 70%; margin: 12px auto 8px; padding: 5px 10px; border-radius: 12px; background: rgba(46,49,56,.92); color: #fff; font-size: 13px; font-weight: 760; }
    .scroll-date-pill { position: absolute; top: 82px; left: 50%; transform: translateX(-50%); z-index: 18; pointer-events: none; opacity: 0; transition: opacity .16s ease; }
    .scroll-date-pill.visible { opacity: 1; }
    .composer {
      min-height: 62px; padding: 8px 10px max(8px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px;
      background: rgba(10,10,11,.92);
    }
    .composer-box {
      flex: 1; min-height: 44px; max-height: 104px; border: 0; border-radius: 24px; background: #1b1c1f;
      display: flex; align-items: center; padding: 11px 16px; color: #f3f6fa; font-size: 16px;
      resize: none; outline: 0; line-height: 1.32; font-family: inherit; overflow-y: auto;
    }
    .composer-box::placeholder { color: var(--muted); }
    .send-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 21px; font-weight: 900; }
    .send-btn:disabled { opacity: .42; }
    .composer.selecting .composer-box { color: #fff; background: #20384a; font-weight: 750; }

    .profile-scroll { overflow-y: auto; padding: 22px 16px calc(var(--nav-h) + env(safe-area-inset-bottom)); }
    .profile-hero { text-align: center; padding: 8px 0 20px; }
    .profile-hero .avatar { width: 110px; height: 110px; margin: 0 auto 18px; font-size: 42px; }
    .profile-hero h2 { margin: 0; font-size: 25px; overflow-wrap: anywhere; }
    .profile-hero p { margin: 6px 0 0; color: var(--muted); overflow-wrap: anywhere; }
    .action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 4px 0 14px; }
    .action-grid.three { grid-template-columns: repeat(3, 1fr); }
    .action-card { min-width: 0; min-height: 72px; border-radius: 16px; background: var(--panel-2); display: grid; place-items: center; align-content: center; gap: 5px; font-weight: 700; }
    button.action-card { width: 100%; border: 0; color: var(--text); }
    button.action-card:disabled { opacity: .58; }
    .action-card span { font-size: 24px; }
    .info-card { border-radius: 18px; background: var(--panel); padding: 16px; display: grid; gap: 16px; margin-bottom: 14px; }
    .info-card h3 { margin: 0 0 2px; font-size: 16px; color: #cfd3da; }
    .info-line strong { display: block; font-size: 19px; font-weight: 520; overflow-wrap: anywhere; }
    .info-line span { display: block; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
    .info-chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
    .info-chip { min-width: 0; max-width: 100%; padding: 6px 9px; border-radius: 12px; background: rgba(42,158,244,.16); color: #c8eaff; font-size: 13px; font-weight: 760; overflow-wrap: anywhere; }
    .settings-placeholder { padding: 70px 28px; text-align: center; color: var(--muted); }
    .media-viewer { position: absolute; inset: 0; z-index: 30; background: #000; display: grid; grid-template-rows: auto 1fr auto; }
    .media-viewer-head { min-height: 58px; padding: max(10px, env(safe-area-inset-top)) 12px 10px; display: flex; align-items: center; gap: 12px; background: rgba(20,21,24,.96); }
    .media-viewer-title { min-width: 0; flex: 1; }
    .media-viewer-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
    .media-viewer-title span { color: var(--muted); font-size: 13px; }
    .media-viewer-body { min-width: 0; min-height: 0; display: grid; place-items: center; padding: 10px; }
    .media-viewer-body img, .media-viewer-body video, .media-viewer-body iframe { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; border: 0; }
    .media-viewer-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
    .media-viewer-action { min-height: 36px; padding: 0 14px; border-radius: 18px; background: rgba(42,158,244,.22); color: #d7efff; font-weight: 780; display: inline-grid; place-items: center; text-decoration: none; }
    .media-viewer-status { min-height: 48px; padding: 10px 14px max(10px, env(safe-area-inset-bottom)); color: var(--muted); background: rgba(20,21,24,.92); text-align: center; overflow-wrap: anywhere; }
    .geo-map-modal { position: absolute; inset: 0; z-index: 34; background: #0a0b0d; display: grid; grid-template-rows: auto 1fr auto; }
    .geo-map-body { min-width: 0; min-height: 0; display: grid; }
    .geo-map-body iframe { width: 100%; height: 100%; border: 0; background: #111; }
    .geo-action { min-height: 34px; border: 0; border-radius: 17px; padding: 0 14px; background: rgba(42,158,244,.18); color: #cbeaff; font-weight: 780; }
    @keyframes spin { to { transform: rotate(360deg); } }
    @media (min-width: 700px) {
      body { background: #08090a; }
      .phone { margin-top: 18px; height: calc(100vh - 36px); border-radius: 28px; border: 1px solid #2d2f34; }
    }
    @media (max-width: 600px) {
      :root { --nav-h: 70px; }
      .phone.tg-compact .top { padding: 8px 14px 0; }
      .phone.tg-compact .top-row { height: 40px; }
      .phone.tg-compact .title { font-size: 25px; }
      .phone.tg-compact .icon-btn { width: 36px; height: 36px; font-size: 22px; }
      .phone.tg-compact .search { height: 38px; margin: 0 0 8px; }
      .phone.tg-compact .tabs { gap: 5px; padding: 0 8px 8px; margin: 0 -8px; scroll-padding-inline: 8px; }
      .phone.tg-compact .tab { height: 36px; padding: 0 8px; font-size: 14px; }
      .phone.tg-compact .sync-line { padding-inline: 18px; }
      .phone.tg-compact .nav { width: calc(100% - 46px); height: 66px; }
    }