:root {
  color-scheme: dark;
  --app-height: 100dvh;
  --bg: #07111b;
  --bg-top: #0c1724;
  --panel: rgba(12, 22, 34, 0.82);
  --panel-strong: rgba(16, 28, 42, 0.96);
  --panel-soft: rgba(17, 29, 43, 0.68);
  --line: rgba(145, 181, 223, 0.12);
  --line-strong: rgba(133, 182, 243, 0.28);
  --line-accent: #5ea8ff;
  --line-accent-strong: #7fc8ff;
  --line-accent-soft: rgba(94, 168, 255, 0.18);
  --text: #eff6ff;
  --text-soft: #b5c9df;
  --text-dim: #7f96b2;
  --danger: #ff677f;
  --danger-soft: rgba(255, 103, 127, 0.14);
  --success: #44c28d;
  --success-soft: rgba(68, 194, 141, 0.16);
  --shadow-soft: 0 22px 50px rgba(2, 8, 18, 0.22);
  --shadow-strong: 0 32px 80px rgba(2, 8, 18, 0.45);
  --body-grad-1: rgba(88, 172, 255, 0.18);
  --body-grad-2: rgba(74, 117, 255, 0.12);
  --body-grad-3: rgba(34, 81, 126, 0.18);
  --body-bg-start: #09121c;
  --body-bg-mid: #08131f;
  --body-bg-end: #06101a;
  --orb-1: rgba(82, 148, 255, 0.15);
  --orb-2: rgba(42, 204, 255, 0.09);
  --glass-top: rgba(18, 31, 46, 0.88);
  --glass-bottom: rgba(12, 22, 34, 0.84);
  --input-bg: rgba(10, 19, 30, 0.9);
  --input-bg-focus: rgba(11, 22, 34, 0.98);
  --input-placeholder: rgba(181, 201, 223, 0.62);
  --button-bg: linear-gradient(180deg, rgba(37, 81, 136, 0.95) 0%, rgba(26, 59, 104, 0.95) 100%);
  --button-shadow: 0 12px 22px rgba(16, 46, 88, 0.2);
  --button-hover-shadow: 0 18px 28px rgba(14, 42, 83, 0.28);
  --button-hover-border: rgba(127, 200, 255, 0.18);
  --button-ghost-bg: rgba(255, 255, 255, 0.03);
  --button-ghost-border: rgba(255, 255, 255, 0.06);
  --button-danger-bg: linear-gradient(180deg, rgba(91, 31, 45, 0.96) 0%, rgba(66, 22, 34, 0.96) 100%);
  --button-danger-shadow: 0 12px 22px rgba(73, 19, 33, 0.28);
  --button-success-bg: linear-gradient(180deg, rgba(41, 119, 85, 0.96) 0%, rgba(27, 90, 63, 0.96) 100%);
  --button-success-shadow: 0 12px 22px rgba(20, 73, 53, 0.24);
  --profile-mini-bg: radial-gradient(circle at top right, rgba(122, 195, 255, 0.18), transparent 36%), linear-gradient(180deg, rgba(19, 34, 50, 0.96) 0%, rgba(15, 26, 39, 0.96) 100%);
  --profile-mini-border: rgba(132, 169, 216, 0.16);
  --list-bg: linear-gradient(180deg, rgba(10, 18, 28, 0.92) 0%, rgba(10, 18, 28, 0.84) 100%);
  --item-bg: linear-gradient(180deg, rgba(18, 30, 44, 0.92) 0%, rgba(15, 25, 36, 0.92) 100%);
  --item-hover-bg: linear-gradient(180deg, rgba(21, 35, 52, 0.96) 0%, rgba(16, 28, 40, 0.96) 100%);
  --item-selected-bg: linear-gradient(180deg, rgba(24, 48, 75, 0.95) 0%, rgba(17, 36, 57, 0.95) 100%);
  --chat-header-bg: radial-gradient(circle at top right, rgba(94, 168, 255, 0.14), transparent 28%), linear-gradient(180deg, rgba(15, 27, 40, 0.96) 0%, rgba(13, 23, 35, 0.94) 100%);
  --chat-empty-bg: radial-gradient(circle at top, rgba(95, 175, 255, 0.14), transparent 42%), linear-gradient(180deg, rgba(15, 26, 38, 0.94) 0%, rgba(10, 18, 28, 0.9) 100%);
  --messages-bg: radial-gradient(circle at top left, rgba(94, 168, 255, 0.08), transparent 28%), linear-gradient(180deg, rgba(9, 16, 25, 0.97) 0%, rgba(9, 16, 25, 0.92) 100%);
  --message-bubble-border: rgba(132, 169, 216, 0.12);
  --message-bubble-bg: linear-gradient(180deg, rgba(19, 31, 46, 0.96) 0%, rgba(16, 27, 39, 0.96) 100%);
  --message-bubble-mine-border: rgba(94, 168, 255, 0.24);
  --message-bubble-mine-bg: linear-gradient(180deg, rgba(38, 84, 145, 0.96) 0%, rgba(27, 66, 118, 0.96) 100%);
  --message-mine-meta: rgba(244, 248, 255, 0.88);
  --message-link-bg: rgba(255, 255, 255, 0.06);
  --message-download-bg: rgba(7, 14, 24, 0.68);
  --composer-bg: linear-gradient(180deg, rgba(15, 27, 40, 0.98) 0%, rgba(13, 22, 33, 0.95) 100%);
  --composer-input-bg: rgba(8, 16, 25, 0.92);
  --members-bg: linear-gradient(180deg, rgba(13, 23, 35, 0.98) 0%, rgba(10, 19, 29, 0.96) 100%);
  --members-sheet-bg: linear-gradient(180deg, rgba(14, 24, 36, 0.99) 0%, rgba(9, 16, 26, 0.99) 100%);
  --members-backdrop-bg: rgba(3, 8, 16, 0.65);
  --members-handle: rgba(145, 181, 223, 0.22);
  --dialog-bg: linear-gradient(180deg, rgba(18, 31, 46, 0.98) 0%, rgba(12, 22, 34, 0.98) 100%);
  --dialog-backdrop-bg: rgba(4, 9, 15, 0.65);
  --ctx-bg: linear-gradient(180deg, rgba(20, 34, 50, 0.98) 0%, rgba(13, 22, 34, 0.98) 100%);
  --ctx-border: rgba(145, 181, 223, 0.18);
  --ctx-hover-bg: rgba(94, 168, 255, 0.1);
  --call-overlay-bg: rgba(5, 11, 20, 0.9);
  --call-top-bg: rgba(12, 22, 34, 0.74);
  --call-top-border: rgba(145, 181, 223, 0.12);
  --call-tile-bg: #03070d;
  --call-who-bg: rgba(7, 12, 20, 0.68);
  --device-panel-bg: rgba(9, 16, 26, 0.72);
  --incoming-bg: linear-gradient(180deg, rgba(18, 31, 46, 0.96) 0%, rgba(12, 22, 34, 0.96) 100%);
  --emoji-tab-bg: rgba(255, 255, 255, 0.04);
  --emoji-tab-active-bg: rgba(94, 168, 255, 0.24);
  --emoji-grid-bg: rgba(255, 255, 255, 0.03);
  --voice-bg: rgba(255, 255, 255, 0.06);
  --voice-progress: rgba(255, 255, 255, 0.2);
  --voice-progress-fill: var(--line-accent);
  --avatar-image-bg: #132235;
  --brand-grad-1: #55a6ff;
  --brand-grad-2: #3485ff;
  --brand-grad-3: #1f5fcc;
  --brand-shadow: 0 22px 44px rgba(23, 77, 170, 0.32);
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 22px;
  --radius-xl: 26px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

html[data-theme="default"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3f8;
  --bg-top: #ffffff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --panel-soft: rgba(244, 247, 252, 0.76);
  --line: rgba(39, 58, 84, 0.12);
  --line-strong: rgba(49, 91, 154, 0.24);
  --line-accent: #4a7dff;
  --line-accent-strong: #2b5fff;
  --line-accent-soft: rgba(74, 125, 255, 0.14);
  --text: #142231;
  --text-soft: #40556b;
  --text-dim: #6e8195;
  --danger: #c84a62;
  --danger-soft: rgba(200, 74, 98, 0.12);
  --success: #2da56f;
  --success-soft: rgba(45, 165, 111, 0.14);
  --shadow-soft: 0 18px 40px rgba(20, 32, 56, 0.12);
  --shadow-strong: 0 28px 70px rgba(20, 32, 56, 0.18);
  --body-grad-1: rgba(95, 151, 255, 0.12);
  --body-grad-2: rgba(104, 161, 255, 0.10);
  --body-grad-3: rgba(87, 135, 204, 0.08);
  --body-bg-start: #f8fbff;
  --body-bg-mid: #edf3f9;
  --body-bg-end: #e7eef6;
  --orb-1: rgba(102, 149, 255, 0.10);
  --orb-2: rgba(92, 184, 255, 0.08);
  --glass-top: rgba(255, 255, 255, 0.88);
  --glass-bottom: rgba(244, 247, 252, 0.92);
  --input-bg: rgba(255, 255, 255, 0.96);
  --input-bg-focus: rgba(255, 255, 255, 1);
  --input-placeholder: rgba(99, 118, 138, 0.72);
  --button-bg: linear-gradient(180deg, #4a7dff 0%, #2f63e8 100%);
  --button-shadow: 0 12px 24px rgba(44, 86, 178, 0.2);
  --button-hover-shadow: 0 16px 30px rgba(44, 86, 178, 0.24);
  --button-hover-border: rgba(55, 103, 226, 0.35);
  --button-ghost-bg: rgba(31, 55, 88, 0.04);
  --button-ghost-border: rgba(49, 91, 154, 0.2);
  --button-danger-bg: linear-gradient(180deg, #e46b84 0%, #cb5670 100%);
  --button-danger-shadow: 0 12px 24px rgba(166, 57, 86, 0.24);
  --button-success-bg: linear-gradient(180deg, #3cb684 0%, #289a6a 100%);
  --button-success-shadow: 0 12px 24px rgba(33, 124, 87, 0.22);
  --profile-mini-bg: radial-gradient(circle at top right, rgba(107, 156, 255, 0.18), transparent 38%), linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 250, 255, 0.98) 100%);
  --profile-mini-border: rgba(89, 125, 180, 0.16);
  --list-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 255, 0.94) 100%);
  --item-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 250, 255, 0.96) 100%);
  --item-hover-bg: linear-gradient(180deg, rgba(245, 250, 255, 0.98) 0%, rgba(238, 245, 255, 0.96) 100%);
  --item-selected-bg: linear-gradient(180deg, rgba(232, 241, 255, 0.98) 0%, rgba(223, 236, 255, 0.96) 100%);
  --chat-header-bg: radial-gradient(circle at top right, rgba(95, 152, 255, 0.2), transparent 34%), linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.98) 100%);
  --chat-empty-bg: radial-gradient(circle at top, rgba(96, 158, 255, 0.18), transparent 44%), linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 248, 255, 0.96) 100%);
  --messages-bg: radial-gradient(circle at top left, rgba(95, 152, 255, 0.12), transparent 32%), linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 250, 255, 0.96) 100%);
  --message-bubble-border: rgba(82, 123, 180, 0.16);
  --message-bubble-bg: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(246, 250, 255, 0.98) 100%);
  --message-bubble-mine-border: rgba(166, 177, 191, 0.34);
  --message-bubble-mine-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 244, 248, 0.98) 100%);
  --message-mine-meta: rgba(56, 72, 90, 0.9);
  --message-link-bg: rgba(27, 53, 92, 0.06);
  --message-download-bg: rgba(26, 49, 82, 0.72);
  --composer-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 250, 255, 0.96) 100%);
  --composer-input-bg: rgba(255, 255, 255, 1);
  --members-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(243, 248, 255, 0.97) 100%);
  --members-sheet-bg: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(241, 247, 255, 0.99) 100%);
  --members-backdrop-bg: rgba(22, 39, 67, 0.24);
  --members-handle: rgba(78, 116, 180, 0.24);
  --dialog-bg: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(245, 250, 255, 0.98) 100%);
  --dialog-backdrop-bg: rgba(24, 38, 58, 0.38);
  --ctx-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 251, 255, 0.98) 100%);
  --ctx-border: rgba(74, 112, 168, 0.22);
  --ctx-hover-bg: rgba(74, 125, 255, 0.14);
  --call-overlay-bg: rgba(226, 236, 247, 0.86);
  --call-top-bg: rgba(255, 255, 255, 0.95);
  --call-top-border: rgba(74, 112, 168, 0.2);
  --call-tile-bg: #f7fbff;
  --call-who-bg: rgba(20, 43, 76, 0.58);
  --device-panel-bg: rgba(255, 255, 255, 0.96);
  --incoming-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 250, 255, 0.98) 100%);
  --emoji-tab-bg: rgba(42, 64, 96, 0.08);
  --emoji-tab-active-bg: rgba(74, 125, 255, 0.24);
  --emoji-grid-bg: rgba(42, 64, 96, 0.04);
  --voice-bg: rgba(42, 64, 96, 0.08);
  --voice-progress: rgba(45, 79, 130, 0.2);
  --avatar-image-bg: #d8e6f7;
  --brand-grad-1: #8fb6ff;
  --brand-grad-2: #5c8eff;
  --brand-grad-3: #3e70e7;
  --brand-shadow: 0 18px 36px rgba(69, 101, 180, 0.26);
}

html[data-theme="burgundy"] {
  color-scheme: dark;
  --bg: #12070b;
  --bg-top: #1b0c12;
  --panel: rgba(31, 12, 19, 0.84);
  --panel-strong: rgba(42, 15, 25, 0.96);
  --panel-soft: rgba(49, 17, 29, 0.72);
  --line: rgba(255, 184, 204, 0.12);
  --line-strong: rgba(255, 160, 185, 0.22);
  --line-accent: #d8617a;
  --line-accent-strong: #f08aa1;
  --line-accent-soft: rgba(216, 97, 122, 0.18);
  --text: #fff2f6;
  --text-soft: #e8c2cb;
  --text-dim: #b98d99;
  --danger: #ff6f86;
  --danger-soft: rgba(255, 111, 134, 0.14);
  --success: #48b98b;
  --success-soft: rgba(72, 185, 139, 0.14);
  --body-grad-1: rgba(160, 36, 68, 0.18);
  --body-grad-2: rgba(115, 20, 51, 0.16);
  --body-grad-3: rgba(83, 14, 32, 0.18);
  --body-bg-start: #18080d;
  --body-bg-mid: #12070b;
  --body-bg-end: #0d0407;
  --orb-1: rgba(214, 72, 102, 0.16);
  --orb-2: rgba(130, 23, 54, 0.12);
  --glass-top: rgba(43, 16, 26, 0.90);
  --glass-bottom: rgba(28, 10, 18, 0.88);
  --button-bg: linear-gradient(180deg, rgba(173, 63, 91, 0.98) 0%, rgba(124, 32, 58, 0.98) 100%);
  --button-shadow: 0 12px 24px rgba(81, 18, 39, 0.3);
  --button-hover-shadow: 0 18px 30px rgba(81, 18, 39, 0.38);
  --button-hover-border: rgba(236, 160, 181, 0.3);
  --button-ghost-bg: rgba(255, 214, 226, 0.05);
  --button-ghost-border: rgba(255, 188, 206, 0.12);
  --button-danger-bg: linear-gradient(180deg, rgba(157, 28, 58, 0.98) 0%, rgba(108, 15, 40, 0.98) 100%);
  --button-danger-shadow: 0 12px 24px rgba(70, 7, 28, 0.4);
  --button-success-bg: linear-gradient(180deg, rgba(58, 149, 114, 0.98) 0%, rgba(37, 110, 83, 0.98) 100%);
  --button-success-shadow: 0 12px 24px rgba(23, 77, 57, 0.28);
  --profile-mini-bg: radial-gradient(circle at top right, rgba(242, 118, 146, 0.2), transparent 38%), linear-gradient(180deg, rgba(50, 18, 31, 0.97) 0%, rgba(33, 12, 21, 0.96) 100%);
  --profile-mini-border: rgba(255, 182, 202, 0.16);
  --list-bg: linear-gradient(180deg, rgba(39, 14, 24, 0.94) 0%, rgba(30, 11, 19, 0.9) 100%);
  --item-bg: linear-gradient(180deg, rgba(56, 20, 33, 0.94) 0%, rgba(44, 16, 27, 0.92) 100%);
  --item-hover-bg: linear-gradient(180deg, rgba(67, 24, 39, 0.96) 0%, rgba(49, 18, 30, 0.94) 100%);
  --item-selected-bg: linear-gradient(180deg, rgba(83, 28, 47, 0.96) 0%, rgba(59, 20, 34, 0.95) 100%);
  --chat-header-bg: radial-gradient(circle at top right, rgba(237, 125, 153, 0.18), transparent 32%), linear-gradient(180deg, rgba(50, 18, 30, 0.96) 0%, rgba(35, 12, 21, 0.95) 100%);
  --chat-empty-bg: radial-gradient(circle at top, rgba(224, 102, 132, 0.18), transparent 42%), linear-gradient(180deg, rgba(47, 16, 27, 0.95) 0%, rgba(30, 11, 18, 0.93) 100%);
  --messages-bg: radial-gradient(circle at top left, rgba(214, 101, 129, 0.12), transparent 30%), linear-gradient(180deg, rgba(34, 12, 22, 0.97) 0%, rgba(25, 9, 16, 0.94) 100%);
  --message-bubble-border: rgba(255, 184, 204, 0.16);
  --message-bubble-bg: linear-gradient(180deg, rgba(59, 21, 35, 0.96) 0%, rgba(43, 16, 27, 0.95) 100%);
  --message-bubble-mine-border: rgba(240, 138, 161, 0.28);
  --message-bubble-mine-bg: linear-gradient(180deg, rgba(170, 63, 91, 0.96) 0%, rgba(128, 36, 62, 0.95) 100%);
  --message-link-bg: rgba(255, 214, 226, 0.08);
  --message-download-bg: rgba(46, 10, 22, 0.7);
  --composer-bg: linear-gradient(180deg, rgba(48, 17, 29, 0.98) 0%, rgba(33, 12, 21, 0.96) 100%);
  --composer-input-bg: rgba(35, 12, 21, 0.94);
  --members-bg: linear-gradient(180deg, rgba(45, 16, 27, 0.98) 0%, rgba(31, 11, 19, 0.96) 100%);
  --members-sheet-bg: linear-gradient(180deg, rgba(48, 17, 29, 0.99) 0%, rgba(30, 11, 19, 0.98) 100%);
  --members-backdrop-bg: rgba(18, 4, 9, 0.72);
  --members-handle: rgba(255, 190, 208, 0.24);
  --dialog-bg: linear-gradient(180deg, rgba(50, 18, 30, 0.98) 0%, rgba(32, 11, 20, 0.98) 100%);
  --dialog-backdrop-bg: rgba(17, 3, 8, 0.64);
  --ctx-bg: linear-gradient(180deg, rgba(55, 20, 33, 0.98) 0%, rgba(35, 13, 22, 0.98) 100%);
  --ctx-border: rgba(255, 176, 198, 0.2);
  --ctx-hover-bg: rgba(216, 97, 122, 0.22);
  --call-overlay-bg: rgba(24, 7, 13, 0.9);
  --call-top-bg: rgba(45, 16, 27, 0.78);
  --call-top-border: rgba(255, 184, 204, 0.14);
  --call-tile-bg: #200912;
  --call-who-bg: rgba(18, 5, 10, 0.74);
  --device-panel-bg: rgba(30, 11, 19, 0.76);
  --incoming-bg: linear-gradient(180deg, rgba(50, 18, 30, 0.96) 0%, rgba(32, 11, 20, 0.96) 100%);
  --emoji-tab-bg: rgba(255, 214, 226, 0.08);
  --emoji-tab-active-bg: rgba(216, 97, 122, 0.32);
  --emoji-grid-bg: rgba(255, 214, 226, 0.04);
  --voice-bg: rgba(255, 214, 226, 0.08);
  --voice-progress: rgba(255, 197, 216, 0.24);
  --avatar-image-bg: #3b1420;
  --brand-grad-1: #f487a3;
  --brand-grad-2: #d24f72;
  --brand-grad-3: #8a2441;
  --brand-shadow: 0 18px 38px rgba(74, 14, 33, 0.36);
}

html[data-theme="black"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-top: #050505;
  --panel: rgba(8, 8, 8, 0.88);
  --panel-strong: rgba(12, 12, 12, 0.96);
  --panel-soft: rgba(18, 18, 18, 0.78);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-accent: #7aa2ff;
  --line-accent-strong: #9bb8ff;
  --line-accent-soft: rgba(122, 162, 255, 0.16);
  --text: #f5f5f5;
  --text-soft: #c4c4c4;
  --text-dim: #8a8a8a;
  --danger: #ff5e78;
  --danger-soft: rgba(255, 94, 120, 0.12);
  --success: #3dbb84;
  --success-soft: rgba(61, 187, 132, 0.14);
  --body-grad-1: rgba(255, 255, 255, 0.03);
  --body-grad-2: rgba(255, 255, 255, 0.02);
  --body-grad-3: rgba(122, 162, 255, 0.05);
  --body-bg-start: #050505;
  --body-bg-mid: #020202;
  --body-bg-end: #000000;
  --orb-1: rgba(255, 255, 255, 0.04);
  --orb-2: rgba(122, 162, 255, 0.05);
  --glass-top: rgba(10, 10, 10, 0.88);
  --glass-bottom: rgba(4, 4, 4, 0.92);
  --button-bg: linear-gradient(180deg, rgba(120, 120, 120, 0.36) 0%, rgba(74, 74, 74, 0.42) 100%);
  --button-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  --button-hover-shadow: 0 16px 28px rgba(0, 0, 0, 0.56);
  --button-hover-border: rgba(255, 255, 255, 0.2);
  --button-ghost-bg: rgba(255, 255, 255, 0.04);
  --button-ghost-border: rgba(255, 255, 255, 0.1);
  --button-danger-bg: linear-gradient(180deg, rgba(118, 35, 53, 0.98) 0%, rgba(76, 20, 34, 0.98) 100%);
  --button-danger-shadow: 0 12px 24px rgba(42, 8, 16, 0.48);
  --button-success-bg: linear-gradient(180deg, rgba(52, 130, 96, 0.98) 0%, rgba(34, 87, 64, 0.98) 100%);
  --button-success-shadow: 0 12px 24px rgba(13, 38, 27, 0.42);
  --profile-mini-bg: radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 36%), linear-gradient(180deg, rgba(20, 20, 20, 0.96) 0%, rgba(8, 8, 8, 0.96) 100%);
  --profile-mini-border: rgba(255, 255, 255, 0.12);
  --list-bg: linear-gradient(180deg, rgba(14, 14, 14, 0.95) 0%, rgba(8, 8, 8, 0.92) 100%);
  --item-bg: linear-gradient(180deg, rgba(22, 22, 22, 0.95) 0%, rgba(13, 13, 13, 0.93) 100%);
  --item-hover-bg: linear-gradient(180deg, rgba(30, 30, 30, 0.96) 0%, rgba(16, 16, 16, 0.95) 100%);
  --item-selected-bg: linear-gradient(180deg, rgba(36, 36, 36, 0.98) 0%, rgba(20, 20, 20, 0.96) 100%);
  --chat-header-bg: radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 28%), linear-gradient(180deg, rgba(16, 16, 16, 0.98) 0%, rgba(8, 8, 8, 0.96) 100%);
  --chat-empty-bg: radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 42%), linear-gradient(180deg, rgba(18, 18, 18, 0.96) 0%, rgba(7, 7, 7, 0.95) 100%);
  --messages-bg: radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), transparent 30%), linear-gradient(180deg, rgba(10, 10, 10, 0.98) 0%, rgba(6, 6, 6, 0.96) 100%);
  --message-bubble-border: rgba(255, 255, 255, 0.1);
  --message-bubble-bg: linear-gradient(180deg, rgba(26, 26, 26, 0.97) 0%, rgba(14, 14, 14, 0.95) 100%);
  --message-bubble-mine-border: rgba(255, 255, 255, 0.12);
  --message-bubble-mine-bg: linear-gradient(180deg, rgba(30, 30, 30, 0.98) 0%, rgba(10, 10, 10, 0.96) 100%);
  --message-mine-meta: rgba(245, 245, 245, 0.9);
  --message-link-bg: rgba(255, 255, 255, 0.08);
  --message-download-bg: rgba(0, 0, 0, 0.7);
  --composer-bg: linear-gradient(180deg, rgba(16, 16, 16, 0.98) 0%, rgba(8, 8, 8, 0.95) 100%);
  --composer-input-bg: rgba(4, 4, 4, 0.96);
  --members-bg: linear-gradient(180deg, rgba(15, 15, 15, 0.98) 0%, rgba(7, 7, 7, 0.96) 100%);
  --members-sheet-bg: linear-gradient(180deg, rgba(18, 18, 18, 0.99) 0%, rgba(6, 6, 6, 0.98) 100%);
  --members-backdrop-bg: rgba(0, 0, 0, 0.72);
  --members-handle: rgba(255, 255, 255, 0.24);
  --dialog-bg: linear-gradient(180deg, rgba(18, 18, 18, 0.98) 0%, rgba(7, 7, 7, 0.98) 100%);
  --dialog-backdrop-bg: rgba(0, 0, 0, 0.65);
  --ctx-bg: linear-gradient(180deg, rgba(24, 24, 24, 0.98) 0%, rgba(10, 10, 10, 0.98) 100%);
  --ctx-border: rgba(255, 255, 255, 0.16);
  --ctx-hover-bg: rgba(122, 162, 255, 0.18);
  --call-overlay-bg: rgba(0, 0, 0, 0.9);
  --call-top-bg: rgba(16, 16, 16, 0.76);
  --call-top-border: rgba(255, 255, 255, 0.12);
  --call-tile-bg: #000;
  --call-who-bg: rgba(0, 0, 0, 0.72);
  --device-panel-bg: rgba(8, 8, 8, 0.78);
  --incoming-bg: linear-gradient(180deg, rgba(18, 18, 18, 0.96) 0%, rgba(8, 8, 8, 0.96) 100%);
  --emoji-tab-bg: rgba(255, 255, 255, 0.08);
  --emoji-tab-active-bg: rgba(122, 162, 255, 0.26);
  --emoji-grid-bg: rgba(255, 255, 255, 0.04);
  --voice-bg: rgba(255, 255, 255, 0.08);
  --voice-progress: rgba(255, 255, 255, 0.24);
  --avatar-image-bg: #0a0a0a;
  --brand-grad-1: #8a8a8a;
  --brand-grad-2: #5e5e5e;
  --brand-grad-3: #2f2f2f;
  --brand-shadow: 0 18px 36px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: thin;
  scrollbar-color: rgba(132, 169, 216, 0.34) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(132, 169, 216, 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Aptos", "Segoe UI Variable Text", "Segoe UI", "SF Pro Text", "Noto Sans", sans-serif;
  background:
    radial-gradient(circle at top left, var(--body-grad-1), transparent 34%),
    radial-gradient(circle at top right, var(--body-grad-2), transparent 32%),
    radial-gradient(circle at bottom, var(--body-grad-3), transparent 40%),
    linear-gradient(180deg, var(--body-bg-start) 0%, var(--body-bg-mid) 38%, var(--body-bg-end) 100%);
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  touch-action: pan-x pan-y;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.65;
}

body::before {
  width: 260px;
  height: 260px;
  top: 4%;
  left: -40px;
  background: var(--orb-1);
}

body::after {
  width: 320px;
  height: 320px;
  right: -50px;
  bottom: 8%;
  background: var(--orb-2);
}
a {
  color: var(--line-accent-strong);
}

img,
video,
audio {
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.glass {
  background: linear-gradient(180deg, var(--glass-top) 0%, var(--glass-bottom) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.panel {
  border-radius: var(--radius-xl);
}

.screen {
  min-height: calc(var(--app-height) - var(--safe-top) - var(--safe-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--line-accent-strong);
}

.auth-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(320px, 440px);
  gap: 22px;
}

.auth-shell.compact {
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
}

.auth-showcase,
.auth-panel {
  padding: 28px;
}

.auth-showcase {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  min-height: 420px;
}

.auth-showcase h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.02;
  max-width: 11ch;
}

.auth-panel {
  width: 100%;
  align-self: center;
}

.auth-panel-compact {
  width: min(420px, 100%);
  padding: 22px;
}

.auth-mini-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.auth-panel h2 {
  font-size: 30px;
  margin-top: 8px;
}

.auth-copy {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.65;
}

.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-points span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  font-size: 13px;
}

.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.08em;
  color: white;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.25), transparent 32%),
    linear-gradient(135deg, var(--brand-grad-1) 0%, var(--brand-grad-2) 45%, var(--brand-grad-3) 100%);
  box-shadow: var(--brand-shadow);
}

.brand-mark.small {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  font-size: 18px;
}

.brand-mark.mid {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  font-size: 20px;
  margin: 0 auto 14px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 4px;
  color: var(--text-soft);
  font-size: 14px;
}

.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--line-accent);
  flex: none;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 15px !important;
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  resize: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--line-accent);
  box-shadow: 0 0 0 4px rgba(94, 168, 255, 0.14);
  background: var(--input-bg-focus);
}

button {
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--button-bg);
  color: #f5f9ff;
  font: inherit;
  font-size: 14px !important;
  font-weight: 700;
  line-height: 1;
  padding: 10px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  box-shadow: var(--button-shadow);
}

button:hover {
  border-color: var(--button-hover-border);
  box-shadow: var(--button-hover-shadow);
}

button:active {
  transform: translateY(1px) scale(0.985);
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

button.ghost {
  background: var(--button-ghost-bg);
  border-color: var(--button-ghost-border);
  color: var(--text-soft);
  box-shadow: none;
}

button.danger {
  background: var(--button-danger-bg);
  border-color: rgba(255, 103, 127, 0.18);
  box-shadow: var(--button-danger-shadow);
}

button.success {
  background: var(--button-success-bg);
  border-color: rgba(68, 194, 141, 0.18);
  box-shadow: var(--button-success-shadow);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.tabs button {
  width: 100%;
}

.tab.active {
  background: linear-gradient(180deg, var(--line-accent-strong) 0%, var(--line-accent) 100%);
  border-color: var(--line-strong);
}

#gateBtn,
#loginBtn,
#registerBtn {
  width: 100%;
  margin-top: 14px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.small {
  font-size: 13px;
  color: var(--text-dim);
}

.error {
  min-height: 20px;
  margin-top: 12px;
  color: #ff93a6;
  font-size: 14px;
}

.mobile-only {
  display: none;
}

#app {
  min-height: calc(var(--app-height) - var(--safe-top) - var(--safe-bottom));
  height: calc(var(--app-height) - var(--safe-top) - var(--safe-bottom));
  display: grid;
  grid-template-columns: 78px minmax(270px, 330px) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.workspace-rail,
.sidebar,
.chat-area {
  min-height: 0;
}

.workspace-rail {
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.workspace-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.workspace-caption {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.quick-tabs {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.quick {
  width: 100%;
  min-height: 58px;
  padding: 8px 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-color: transparent;
  color: var(--text-dim);
  box-shadow: none;
  flex-direction: column;
}

.quick-glyph {
  font-size: 20px;
  line-height: 1;
}

.quick-label {
  font-size: 11px;
  letter-spacing: 0.04em;
}

.quick.active {
  color: white;
  background: linear-gradient(180deg, var(--line-accent-soft) 0%, transparent 100%);
  border-color: var(--line-strong);
  box-shadow: 0 18px 30px rgba(9, 39, 88, 0.26);
}

.sidebar {
  padding: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sidebar-actions button {
  width: 100%;
  min-height: 40px;
}

.profile-mini {
  padding: 14px;
  border-radius: 20px;
  background: var(--profile-mini-bg);
  border: 1px solid var(--profile-mini-border);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-card-copy {
  min-width: 0;
  flex: 1;
}

.profile-card-copy strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-card-copy span,
.profile-card-copy p {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.4;
}

.profile-id {
  align-self: flex-start;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--line-accent-soft);
  color: var(--line-accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.tab-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pane-header h3 {
  margin-top: 6px;
  font-size: 18px;
}

.pane-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pane-actions button {
  min-height: 38px;
}

.section-block + .section-block {
  margin-top: 18px;
}

.section-title {
  margin-bottom: 10px;
  color: var(--text-soft);
  font-weight: 700;
}

.search-wrap {
  position: relative;
}

.search-wrap::before {
  content: "⌕";
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 14px;
  pointer-events: none;
}

.search-wrap input {
  padding-left: 42px;
}

.list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--list-bg);
  padding: 6px;
}

.list.compact {
  flex: none;
  max-height: 250px;
}

.list:empty::after,
.member-list:empty::after {
  content: "Пока пусто";
  display: block;
  padding: 18px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

.item {
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(132, 169, 216, 0.08);
  background: var(--item-bg);
  transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s ease;
}

.item + .item {
  margin-top: 8px;
}

.item:hover {
  transform: translateY(-1px);
  border-color: rgba(132, 169, 216, 0.18);
  background: var(--item-hover-bg);
}

.item.is-clickable {
  cursor: pointer;
}

.item.selected {
  border-color: rgba(94, 168, 255, 0.32);
  background: var(--item-selected-bg);
  box-shadow: inset 0 0 0 1px rgba(94, 168, 255, 0.12);
}

.item-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.item-copy {
  min-width: 0;
  flex: 1;
}

.item-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.item b,
.item-title-row b {
  display: block;
  font-size: 14px;
  line-height: 1.3;
}

.item small {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.4;
}

.item-preview {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.item-time {
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}

.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.item-tag {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--line-accent-soft);
  color: var(--line-accent-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
}

.actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions {
  margin-top: 12px;
}

.actions button {
  min-height: 34px;
  min-width: 34px;
  padding: 8px 10px;
  box-shadow: none;
}

.chat-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

.chat-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--chat-header-bg);
}

.chat-header-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.chat-header-main.is-clickable {
  cursor: pointer;
}

.chat-avatar {
  flex: none;
  display: flex;
  align-items: center;
}

.chat-heading {
  min-width: 0;
}

.chat-heading h3 {
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-meta {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 12px;
}

.chat-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  max-width: 100%;
}

.chat-controls button {
  min-height: 36px;
  min-width: 36px;
  padding: 8px;
  border-radius: 12px;
  box-shadow: none;
}

.chat-stack {
  --members-panel-width: 320px;
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.group-members {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--members-bg);
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, var(--members-panel-width));
  transform: translateX(calc(100% + 16px));
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  box-shadow: var(--shadow-strong);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.chat-stack.members-open .group-members {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.group-members-head {
  margin-bottom: 14px;
}

.group-members h4 {
  margin-top: 6px;
  font-size: 20px;
}

.member-list {
  min-height: 0;
  overflow-y: auto;
}

.chat-main {
  min-width: 0;
  min-height: 0;
  position: relative;
  padding-right: 0;
  transition: padding-right 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-stack.members-open .chat-main {
  padding-right: calc(var(--members-panel-width) + 10px);
}

.chat-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2;
}

.chat-empty-card {
  max-width: 460px;
  padding: 30px 28px;
  text-align: center;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--chat-empty-bg);
  box-shadow: var(--shadow-strong);
}

.chat-empty-card h3 {
  font-size: 28px;
  margin-bottom: 10px;
}

.chat-empty-card p {
  color: var(--text-soft);
  line-height: 1.7;
}

.messages {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--messages-bg);
}

.messages.hidden {
  display: none !important;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: min(82%, 680px);
  position: relative;
}

.message.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.pending {
  opacity: 0.82;
}

.message-bubble {
  min-width: 0;
  border-radius: 18px;
  padding: 10px 12px;
  border: 1px solid var(--message-bubble-border);
  background: var(--message-bubble-bg);
  box-shadow: 0 14px 28px rgba(6, 15, 27, 0.22);
  position: relative;
}

.message.mine .message-bubble {
  border-color: var(--message-bubble-mine-border);
  background: var(--message-bubble-mine-bg);
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 12px;
}

.message-author {
  color: var(--text-soft);
  font-weight: 700;
}

.message.mine .message-author,
.message.mine .message-meta {
  color: var(--message-mine-meta);
}

.message-content {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.message-text + img,
.message-text + video,
.message-text + audio,
.message-text + .message-file {
  margin-top: 10px;
}

.message-content img,
.message-content video {
  display: block;
  border-radius: 18px;
  max-height: 340px;
  box-shadow: 0 14px 26px rgba(4, 10, 20, 0.24);
}

.message-content audio {
  display: block;
  margin-top: 10px;
  width: min(320px, 100%);
}

.message-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--message-link-bg);
  color: inherit;
  text-decoration: none;
}

.message-content a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--message-link-bg);
  color: inherit;
  text-decoration: none;
}

.message-reply-ref {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--line-accent-soft);
  border: 1px solid var(--line-strong);
  box-shadow: none;
  text-align: left;
  color: inherit;
}

.message-reply-ref.missing {
  opacity: 0.75;
}

.message-reply-author {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.message-reply-text {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.35;
}

.message-highlight .message-bubble {
  animation: messageFlash 1.3s ease;
}

@keyframes messageFlash {
  0% {
    box-shadow:
      0 0 0 0 rgba(94, 168, 255, 0.38),
      0 14px 28px rgba(6, 15, 27, 0.22);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(94, 168, 255, 0),
      0 14px 28px rgba(6, 15, 27, 0.22);
  }
}

.message-media-wrap {
  position: relative;
  display: inline-block;
  max-width: min(360px, 100%);
}

.message-media-wrap .message-image,
.message-media-wrap .message-video {
  display: block;
  width: 100%;
  max-height: 340px;
  border-radius: 18px;
  object-fit: cover;
}

.message-circle-wrap {
  position: relative;
  width: min(260px, 72vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
}

.message-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.message-content video.message-circle {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  max-height: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-download-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 34px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--message-download-bg);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.voice-player {
  display: grid;
  grid-template-columns: auto minmax(120px, 220px) auto auto;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--voice-bg);
  border: 1px solid var(--line);
}

.voice-play {
  min-width: 34px;
  min-height: 34px;
  padding: 8px;
  border-radius: 999px;
  box-shadow: none;
}

.voice-play.is-playing {
  background: var(--button-success-bg);
}

.voice-progress {
  margin: 0;
  width: 100%;
  accent-color: var(--voice-progress-fill);
  box-shadow: none;
  background: transparent;
}

.voice-time {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

.voice-download {
  min-width: 34px;
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--message-link-bg);
  text-decoration: none;
  color: inherit;
}

.voice-audio {
  display: none;
}

#btnVoice.is-recording,
#btnCircle.is-recording {
  background: var(--button-danger-bg);
  border-color: rgba(255, 103, 127, 0.3);
  color: #fff;
  box-shadow: var(--button-danger-shadow);
}

.emoji-browser {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--emoji-grid-bg);
}

.emoji-category-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.emoji-cat-btn {
  min-width: 40px;
  min-height: 36px;
  padding: 8px;
  border-radius: 12px;
  background: var(--emoji-tab-bg);
  border: 1px solid transparent;
  box-shadow: none;
}

.emoji-cat-btn.active {
  background: var(--emoji-tab-active-bg);
  border-color: var(--line-strong);
}

.emoji-recent-section {
  margin-top: 10px;
}

.emoji-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 6px;
}

.emoji-btn {
  min-height: 38px;
  min-width: 38px;
  padding: 8px;
  border-radius: 10px;
  background: var(--emoji-tab-bg);
  border: 1px solid transparent;
  box-shadow: none;
  font-size: 20px !important;
  line-height: 1;
}

.emoji-btn:hover {
  background: var(--emoji-tab-active-bg);
}

.composer {
  padding: 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--composer-bg);
}

.reply-composer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--line-accent-soft);
}

.reply-composer-copy {
  min-width: 0;
  flex: 1;
}

#replyComposerTitle {
  font-size: 12px;
  font-weight: 700;
  color: var(--line-accent-strong);
  line-height: 1.2;
}

#replyComposerText {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#btnCancelReply {
  min-width: 34px;
  min-height: 34px;
  padding: 6px;
  border-radius: 10px;
  box-shadow: none;
}

.composer textarea {
  margin: 0;
  min-height: 50px;
  max-height: 150px;
  border-radius: 16px;
  background: var(--composer-input-bg);
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.composer-actions button {
  flex: 0 0 auto;
  min-height: 38px;
  min-width: 38px;
  padding: 8px;
  border-radius: 12px;
  white-space: nowrap;
  touch-action: manipulation;
}

#sendBtn {
  margin-left: auto;
  background: linear-gradient(180deg, var(--line-accent-strong) 0%, var(--line-accent) 100%);
  box-shadow: 0 18px 30px rgba(34, 88, 171, 0.32);
  touch-action: manipulation;
}

.avatar {
  --avatar-size: 42px;
  --avatar-hue: 210;
  width: var(--avatar-size);
  height: var(--avatar-size);
  min-width: var(--avatar-size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.25), transparent 34%),
    linear-gradient(135deg, hsl(var(--avatar-hue) 78% 62%) 0%, hsl(calc(var(--avatar-hue) + 28) 72% 46%) 100%);
  color: white;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 20px rgba(8, 21, 39, 0.28);
}

img.avatar {
  object-fit: cover;
  background: var(--avatar-image-bg);
}

.avatar-sm {
  --avatar-size: 38px;
  font-size: 13px;
}

.avatar-md {
  --avatar-size: 46px;
  font-size: 14px;
}

.avatar-lg {
  --avatar-size: 52px;
  font-size: 16px;
}

.avatar-xl {
  --avatar-size: 58px;
  font-size: 18px;
}

.avatar-placeholder {
  border-radius: 22px;
}

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  background: var(--call-overlay-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.call-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: calc(14px + var(--safe-top)) calc(14px + var(--safe-right)) calc(14px + var(--safe-bottom)) calc(14px + var(--safe-left));
}

.call-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: var(--call-top-bg);
  border: 1px solid var(--call-top-border);
}

.call-top h3 {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  font-size: 18px;
}

.call-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  align-content: center;
  overflow-y: auto;
}

.call-tile {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: var(--call-tile-bg);
  aspect-ratio: 16 / 11;
  border: 1px solid var(--call-top-border);
  box-shadow: var(--shadow-soft);
}

.call-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.call-tile.local.cam-front video {
  transform: scaleX(-1);
}

.call-tile.local.cam-back video,
.call-tile.local.screen-share video {
  transform: none;
}

.call-tile .who {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--call-who-bg);
  color: white;
  font-size: 12px;
}

.call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.call-actions button {
  min-height: 42px;
  min-width: 42px;
  padding: 10px;
  border-radius: 999px;
}

.device-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: var(--device-panel-bg);
  border: 1px solid var(--call-top-border);
}

.incoming {
  position: fixed;
  top: calc(18px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 360px);
  z-index: 110;
  padding: 20px;
  border-radius: 24px;
  background: var(--incoming-bg);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-strong);
}

.floating-call {
  position: fixed;
  right: calc(18px + var(--safe-right));
  bottom: calc(18px + var(--safe-bottom));
  z-index: 90;
  min-height: 46px;
  min-width: 46px;
  padding: 10px;
  border-radius: 999px;
  background: var(--button-success-bg);
  border-color: rgba(68, 194, 141, 0.18);
}

dialog {
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--dialog-bg);
  color: var(--text);
  box-shadow: var(--shadow-strong);
}

dialog::backdrop {
  background: var(--dialog-backdrop-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

dialog h3,
dialog h4 {
  margin-bottom: 10px;
}

dialog h4 {
  margin-top: 18px;
}

.dialog-actions {
  margin-top: 18px;
}

.dialog-actions button {
  flex: 1 1 140px;
}

.dialog-inline {
  margin-top: 10px;
}

.user-view-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-view-copy {
  min-width: 0;
}

.user-view-username,
.user-view-id {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 13px;
}

.user-view-about {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--message-link-bg);
  line-height: 1.5;
}

.user-view-status {
  margin-top: 10px;
}

.logout-button {
  margin-top: 14px;
  width: 100%;
}

@media (max-width: 1180px) {
  #app {
    grid-template-columns: 72px minmax(250px, 300px) minmax(0, 1fr);
  }

  .sidebar-actions {
    grid-template-columns: 1fr;
  }

  .chat-stack {
    --members-panel-width: 280px;
  }
}

@media (max-width: 980px) {
  .auth-shell,
  .auth-shell.compact {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    min-height: auto;
  }

  #app {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  .workspace-rail {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + var(--safe-bottom));
    z-index: 35;
    min-height: 72px;
    padding: 8px 10px;
    flex-direction: row;
    justify-content: space-between;
    border-radius: 28px;
  }

  .workspace-brand {
    display: none;
  }

  .quick-tabs {
    margin: 0;
    flex-direction: row;
    gap: 8px;
  }

  .quick {
    min-height: 50px;
    padding: 8px;
    border-radius: 14px;
  }

  .quick-label {
    font-size: 10px;
  }

  .sidebar,
  .chat-area {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-shadow: none;
  }

  .sidebar {
    padding: 12px 12px calc(94px + var(--safe-bottom));
  }

  .chat-area {
    padding: calc(8px + var(--safe-top)) 10px calc(12px + var(--safe-bottom));
  }

  body.chat-active .sidebar {
    display: none;
  }

  body:not(.chat-active) .chat-area {
    display: none;
  }

  .mobile-only {
    display: inline-flex;
  }

  #btnMobileMenu {
    display: none;
  }

  .chat-header {
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  .chat-header-main {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  .chat-controls {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-top: 2px;
    padding-bottom: 0;
  }

  .chat-controls button {
    flex: 0 0 auto;
  }

  #btnBackToList {
    display: inline-flex;
    min-width: 36px;
    width: 36px;
    padding: 8px;
  }

  .chat-avatar .avatar-xl {
    --avatar-size: 44px;
    font-size: 14px;
  }

  .chat-stack.members-open .chat-main {
    padding-right: 0;
  }

  .group-members {
    max-width: 100%;
  }

  .messages {
    padding: 12px;
    border-radius: 18px;
  }

  .message {
    max-width: 100%;
  }

  .message-content img,
  .message-content video {
    max-height: 240px;
  }

  .message-circle-wrap {
    width: min(220px, 64vw);
  }

  .composer {
    border-radius: 18px;
  }

  .composer-actions {
    gap: 6px;
  }

  .floating-call {
    right: 14px;
    bottom: calc(92px + var(--safe-bottom));
  }
}

@media (max-width: 640px) {
  .screen {
    padding: 12px 10px;
  }

  .auth-showcase,
  .auth-panel {
    padding: 18px;
  }

  .auth-panel-compact {
    padding: 18px;
  }

  .auth-showcase h1 {
    font-size: 34px;
  }

  .pane-header {
    flex-direction: column;
  }

  .pane-actions {
    width: 100%;
    justify-content: stretch;
  }

  .pane-actions button {
    flex: 1 1 auto;
  }

  .chat-heading h3 {
    white-space: normal;
  }

  .chat-meta {
    font-size: 12px;
  }

  .chat-empty-card {
    padding: 18px 16px;
  }

  .dialog-actions button {
    width: 100%;
  }

  .call-top {
    align-items: stretch;
  }

  .call-grid {
    grid-template-columns: 1fr;
  }

  .call-actions {
    justify-content: space-between;
  }
}

.msg-status {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 2px;
  letter-spacing: -0.03em;
}
.msg-status.read {
  color: var(--line-accent-strong);
}

.actions {
  flex-wrap: wrap;
}
.actions button {
  flex: 0 0 auto;
}

.group-members-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.group-members-title {
  flex: 1;
  min-width: 0;
}
.members-close-btn {
  display: inline-flex;
  flex: none;
  min-width: 36px;
  min-height: 36px;
  padding: 8px;
  border-radius: 50%;
  font-size: 16px !important;
}

.members-backdrop {
  display: none;
}

@media (max-width: 980px) {
  .members-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 58;
    background: var(--members-backdrop-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
  }
  .members-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .group-members.members-modal-open {
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: min(80vh, calc(var(--app-height) - 42px - var(--safe-top)));
    z-index: 59;
    border-radius: 24px 24px 0 0 !important;
    border-bottom: none;
    overflow: hidden;
    padding: 10px 14px calc(80px + var(--safe-bottom));
    background: var(--members-sheet-bg);
    box-shadow: 0 -18px 50px rgba(2,8,18,0.55);
    transform: translateY(calc(100% + 16px));
    opacity: 1;
    pointer-events: none;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .group-members.members-modal-open.sheet-visible {
    transform: translateY(0);
    pointer-events: auto;
  }
  .group-members.members-modal-open .group-members-head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-bottom: 10px;
    background: inherit;
  }
  .group-members.members-modal-open .member-list {
    overflow-y: auto;
    flex: 1;
    padding-bottom: 4px;
  }

  .group-members.members-modal-open::before {
    content: "";
    display: block;
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: var(--members-handle);
    margin: 0 auto 14px;
    flex: none;
  }

  .members-close-btn {
    display: inline-flex;
  }

  #btnShowMembers {
    display: inline-flex !important;
  }

  #btnShowMembers.active {
    background: rgba(94, 168, 255, 0.16);
    border-color: rgba(127, 200, 255, 0.22);
    color: var(--line-accent-strong);
  }
}

.msg-ctx-menu {
  min-width: 190px;
  padding: 6px;
  border-radius: 16px;
  background: var(--ctx-bg);
  border: 1px solid var(--ctx-border);
  box-shadow: 0 20px 50px rgba(2,8,18,0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.msg-ctx-menu button {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  border-radius: 10px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  font-size: 14px !important;
  font-weight: 600;
  color: var(--text);
  padding: 9px 12px;
}
.msg-ctx-menu button:hover {
  background: var(--ctx-hover-bg);
  border-color: transparent;
  box-shadow: none;
}
.msg-ctx-menu button.danger {
  color: var(--danger);
}

/* ─── Фикс скрытия участников в ЛС ─── */
.group-members.hidden {
  display: none !important;
}

/* ─── Кнопка контекстного меню сообщения (Три точки) ─── */
.msg-menu-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: -32px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-dim) !important;
  font-size: 18px !important;
  padding: 4px 8px !important;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.message.mine .msg-menu-btn {
  right: auto;
  left: -32px;
}
.message:hover .msg-menu-btn,
.msg-menu-btn:focus,
.msg-menu-btn:active {
  opacity: 1;
  color: var(--line-accent-strong) !important;
}

/* На мобильных устройствах три точки видны всегда, но полупрозрачны */
@media (hover: none) {
  .msg-menu-btn {
    opacity: 0.6;
  }
}

/* ─── 1. ФИКС ДЛЯ МОБИЛОК: Скрываем нижнее меню при открытом чате ─── */
  
  /* Растягиваем чат на весь экран, освобождая место от меню */
/* ─── 2. ОПТИМИЗАЦИЯ ДЛЯ ПК: Широкий групповой чат ─── */
@media (min-width: 99999px) {
  /* Контейнер чата всегда занимает максимум доступного места */
  .chat-layout-wrapper {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
  }

  .chat-panel {
    flex: 1 1 auto; /* Чат занимает все свободное пространство */
    width: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  /* Правая панель группы в стиле Telegram Desktop */
  .group-members {
    width: min(100%, 300px);
    max-width: 300px;
    background: var(--panel);
    backdrop-filter: blur(16px);
    border-left: 1px solid var(--line);
  }
}

/* ─── 3. ВКЛАДКА НАСТРОЕК ───────────────────────────────────────────────────── */
#viewSettings {
  display: none;
}

#viewSettings:not(.hidden) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  padding: 14px;
  overflow-y: auto;
}

#viewSettings.hidden {
  display: none !important;
}

.settings-content {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.settings-content h3,
.settings-content h4 {
  margin-bottom: 12px;
  color: var(--text-soft);
}

.settings-content h4 {
  margin-top: 24px;
  font-size: 16px;
}

.settings-content label {
  display: block;
  margin-top: 16px;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 14px;
}

.glass-input {
  width: 100%;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 15px !important;
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.glass-input:focus {
  outline: none;
  border-color: var(--line-accent);
  box-shadow: 0 0 0 4px rgba(94, 168, 255, 0.14);
  background: var(--input-bg-focus);
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

.primary-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: var(--button-bg);
  border-color: var(--button-hover-border);
  color: white;
  font-weight: 700;
  font-size: 15px !important;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--button-shadow);
}

.primary-btn:hover {
  border-color: var(--button-hover-border);
  box-shadow: var(--button-hover-shadow);
}

.primary-btn:active {
  transform: translateY(1px) scale(0.985);
}

.danger-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: var(--button-danger-bg);
  border-color: rgba(255, 103, 127, 0.18);
  color: #fff;
  font-weight: 700;
  font-size: 15px !important;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--button-danger-shadow);
}

.danger-btn:hover {
  border-color: rgba(255, 103, 127, 0.28);
  box-shadow: var(--button-danger-shadow);
}

.action-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
}


#btnShowMembers.active {
  background: rgba(94, 168, 255, 0.16);
  border-color: rgba(127, 200, 255, 0.22);
  color: var(--line-accent-strong);
}

@media (max-width: 980px) {
  .workspace-rail {
    transition:
      transform 0.28s ease,
      opacity 0.2s ease,
      visibility 0.2s ease;
  }

  body.chat-active .workspace-rail {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(calc(100% + 24px));
  }

  body.chat-active .chat-area {
    padding-bottom: calc(12px + var(--safe-bottom));
  }
}
