/* NEXORA — «графит и морская волна»: сдержанная графитовая основа, один акцент, тональные аватары, воздух и аккуратная типографика */
/* NEXORA — темы. Блок между маркерами создаётся генератором и проверяется на контраст (WCAG AA). */
/* THEMES:BEGIN */
:root { --fs: 19px; --tap: clamp(44px, 2.4rem, 48px); }
:root {
  --bg: #0F1315;
  --panel: #161B1E;
  --raise: #1E2529;
  --text: #E9EEF0;
  --muted: #93A0A6;
  --line: rgba(255,255,255,.08);
  --accent: #0B6E78;
  --accent-text: #4FD1C5;
  --fill: #0B6E78;
  --fill-text: #FFFFFF;
  --mine: #0B6E78;
  --mine-text: #FFFFFF;
  --mine-meta: rgba(255,255,255,0.88);
  --tick-read: #A8EFF7;
  --badge-bg: #0B6E78;
  --badge-text: #FFFFFF;
  --switch-on: #0B6E78;
  --knob: #FFFFFF;
  --knob-on: #FFFFFF;
  --switch-off: rgba(147,160,166,0.35);
  --other: #1E2529;
  --other-line: transparent;
  --glass: rgba(22,27,30,0.86);
  --ok: #34D399;
  --ok-text: #34D399;
  --idle: #7F8C92;
  --danger: #FF8A8A;
  --name-s: 55%;
  --name-l: 70%;
  --av-bg-s: 32%;
  --av-bg-l: 24%;
  --av-fg-s: 70%;
  --av-fg-l: 80%;
  --toast: #343B3E;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --call-glow: rgba(11,110,120,.42);
  --call-bg: #0F1315;
  --color-scheme: dark;
  --bg-image: none;
  --panel-image: none;
  --edge-hi: transparent;
  --fill-edge: inset 0 0 0 0 transparent;
  --mine-shadow: inset 0 0 0 0 transparent;
  --fab-shadow: 0 6px 16px rgba(0,0,0,.28);
  --sheen: linear-gradient(transparent, transparent);
  --call-av-bg-s: 32%;
  --call-av-fg-s: 70%;
}
[data-theme="light"] {
  --bg: #F4F6F7;
  --panel: #FFFFFF;
  --raise: #EAEEF0;
  --text: #111719;
  --muted: #5A676D;
  --line: rgba(15,30,40,.10);
  --accent: #0B6E78;
  --accent-text: #0B6E78;
  --fill: #0B6E78;
  --fill-text: #FFFFFF;
  --mine: #0B6E78;
  --mine-text: #FFFFFF;
  --mine-meta: rgba(255,255,255,0.88);
  --tick-read: #A8EFF7;
  --badge-bg: #0B6E78;
  --badge-text: #FFFFFF;
  --switch-on: #0B6E78;
  --knob: #FFFFFF;
  --knob-on: #FFFFFF;
  --switch-off: rgba(90,103,109,0.32);
  --other: #FFFFFF;
  --other-line: rgba(15,30,40,.08);
  --glass: rgba(255,255,255,0.88);
  --ok: #12B981;
  --ok-text: #0A7A55;
  --idle: #66737A;
  --danger: #C62828;
  --name-s: 55%;
  --name-l: 30%;
  --av-bg-s: 55%;
  --av-bg-l: 74%;
  --av-fg-s: 55%;
  --av-fg-l: 24%;
  --toast: #111719;
  --shadow: 0 10px 28px rgba(15,30,40,.16);
  --call-glow: rgba(11,110,120,.42);
  --call-bg: #0F1315;
  --color-scheme: light;
  --bg-image: none;
  --panel-image: none;
  --edge-hi: transparent;
  --fill-edge: inset 0 0 0 0 transparent;
  --mine-shadow: inset 0 0 0 0 transparent;
  --fab-shadow: 0 6px 16px rgba(0,0,0,.28);
  --sheen: linear-gradient(transparent, transparent);
  --call-av-bg-s: 32%;
  --call-av-fg-s: 70%;
}
:root[data-palette="classic"] {
  --bg: #0F1220;
  --panel: #171A2E;
  --raise: #1F2340;
  --text: #EEF0FF;
  --muted: #9AA0C6;
  --line: rgba(255,255,255,.09);
  --accent: #7C6CFF;
  --accent-text: #A99DFF;
  --fill: #5A49E6;
  --fill-text: #FFFFFF;
  --mine: #5A49E6;
  --mine-text: #FFFFFF;
  --mine-meta: rgba(255,255,255,0.9);
  --tick-read: #8BE9FF;
  --badge-bg: #5A49E6;
  --badge-text: #FFFFFF;
  --switch-on: #5A49E6;
  --knob: #FFFFFF;
  --knob-on: #FFFFFF;
  --switch-off: rgba(154,160,198,0.35);
  --other: #232849;
  --other-line: rgba(255,255,255,.04);
  --glass: rgba(23,26,46,0.86);
  --ok: #3DDC97;
  --ok-text: #3DDC97;
  --idle: #8B90B5;
  --danger: #FF8A98;
  --name-s: 75%;
  --name-l: 74%;
  --av-bg-s: 32%;
  --av-bg-l: 24%;
  --av-fg-s: 70%;
  --av-fg-l: 80%;
  --toast: #353953;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --call-glow: rgba(124,108,255,.35);
  --call-bg: #0F1220;
  --color-scheme: dark;
  --bg-image: none;
  --panel-image: none;
  --edge-hi: transparent;
  --fill-edge: inset 0 0 0 0 transparent;
  --mine-shadow: inset 0 0 0 0 transparent;
  --fab-shadow: 0 6px 16px rgba(0,0,0,.28);
  --sheen: linear-gradient(transparent, transparent);
  --call-av-bg-s: 32%;
  --call-av-fg-s: 70%;
}
:root[data-palette="classic"][data-theme="light"] {
  --bg: #EEF0F8;
  --panel: #FFFFFF;
  --raise: #E6E9F6;
  --text: #15172B;
  --muted: #59608A;
  --line: rgba(30,35,90,.12);
  --accent: #5A49E6;
  --accent-text: #4636C9;
  --fill: #5A49E6;
  --fill-text: #FFFFFF;
  --mine: #5A49E6;
  --mine-text: #FFFFFF;
  --mine-meta: rgba(255,255,255,0.9);
  --tick-read: #C8F3FF;
  --badge-bg: #5A49E6;
  --badge-text: #FFFFFF;
  --switch-on: #5A49E6;
  --knob: #FFFFFF;
  --knob-on: #FFFFFF;
  --switch-off: rgba(89,96,138,0.32);
  --other: #FFFFFF;
  --other-line: rgba(30,35,90,.08);
  --glass: rgba(255,255,255,0.88);
  --ok: #12B981;
  --ok-text: #0A7A55;
  --idle: #666B90;
  --danger: #C9243A;
  --name-s: 65%;
  --name-l: 28%;
  --av-bg-s: 55%;
  --av-bg-l: 68%;
  --av-fg-s: 55%;
  --av-fg-l: 22%;
  --toast: #15172B;
  --shadow: 0 10px 28px rgba(15,30,40,.16);
  --call-glow: rgba(124,108,255,.35);
  --call-bg: #0F1220;
  --color-scheme: light;
  --bg-image: none;
  --panel-image: none;
  --edge-hi: transparent;
  --fill-edge: inset 0 0 0 0 transparent;
  --mine-shadow: inset 0 0 0 0 transparent;
  --fab-shadow: 0 6px 16px rgba(0,0,0,.28);
  --sheen: linear-gradient(transparent, transparent);
  --call-av-bg-s: 32%;
  --call-av-fg-s: 70%;
}
:root[data-palette="candy"] {
  --bg: #150F2B;
  --panel: #1F1740;
  --raise: #2A2057;
  --text: #F4F0FF;
  --muted: #AFA6D6;
  --line: rgba(190,170,255,.14);
  --accent: #8B5CFF;
  --accent-text: #B79CFF;
  --fill: linear-gradient(135deg, #6D3DF2, #C62F7C);
  --fill-text: #FFFFFF;
  --mine: linear-gradient(135deg, #6D3DF2, #C62F7C);
  --mine-text: #FFFFFF;
  --mine-meta: rgba(255,255,255,0.96);
  --tick-read: #A8F0FF;
  --badge-bg: #FFD55A;
  --badge-text: #2B1B00;
  --switch-on: linear-gradient(135deg, #6D3DF2, #C62F7C);
  --knob: #FFFFFF;
  --knob-on: #FFFFFF;
  --switch-off: rgba(175,166,214,0.35);
  --other: #2A2057;
  --other-line: rgba(190,170,255,.12);
  --glass: rgba(31,23,64,0.86);
  --ok: #34E5B0;
  --ok-text: #34E5B0;
  --idle: #9A92C4;
  --danger: #FF7A88;
  --name-s: 75%;
  --name-l: 74%;
  --av-bg-s: 32%;
  --av-bg-l: 26%;
  --av-fg-s: 70%;
  --av-fg-l: 80%;
  --toast: #3F3668;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --call-glow: rgba(124,77,255,.45);
  --call-bg: #150F2B;
  --color-scheme: dark;
  --bg-image: none;
  --panel-image: none;
  --edge-hi: transparent;
  --fill-edge: inset 0 0 0 0 transparent;
  --mine-shadow: inset 0 0 0 0 transparent;
  --fab-shadow: 0 6px 16px rgba(0,0,0,.28);
  --sheen: linear-gradient(transparent, transparent);
  --call-av-bg-s: 32%;
  --call-av-fg-s: 70%;
}
:root[data-palette="candy"][data-theme="light"] {
  --bg: #F3EEFF;
  --panel: #FFFFFF;
  --raise: #EDE6FF;
  --text: #1E1740;
  --muted: #5B5285;
  --line: rgba(60,30,140,.12);
  --accent: #5B34D6;
  --accent-text: #5B34D6;
  --fill: linear-gradient(135deg, #6D3DF2, #C62F7C);
  --fill-text: #FFFFFF;
  --mine: linear-gradient(135deg, #6D3DF2, #C62F7C);
  --mine-text: #FFFFFF;
  --mine-meta: rgba(255,255,255,0.96);
  --tick-read: #C8F3FF;
  --badge-bg: #FFD55A;
  --badge-text: #2B1B00;
  --switch-on: linear-gradient(135deg, #6D3DF2, #C62F7C);
  --knob: #FFFFFF;
  --knob-on: #FFFFFF;
  --switch-off: rgba(91,82,133,0.32);
  --other: #FFFFFF;
  --other-line: rgba(60,30,140,.10);
  --glass: rgba(255,255,255,0.88);
  --ok: #12B981;
  --ok-text: #0B7D57;
  --idle: #6A6194;
  --danger: #C9243A;
  --name-s: 65%;
  --name-l: 28%;
  --av-bg-s: 55%;
  --av-bg-l: 70%;
  --av-fg-s: 55%;
  --av-fg-l: 24%;
  --toast: #1E1740;
  --shadow: 0 10px 28px rgba(15,30,40,.16);
  --call-glow: rgba(124,77,255,.45);
  --call-bg: #150F2B;
  --color-scheme: light;
  --bg-image: none;
  --panel-image: none;
  --edge-hi: transparent;
  --fill-edge: inset 0 0 0 0 transparent;
  --mine-shadow: inset 0 0 0 0 transparent;
  --fab-shadow: 0 6px 16px rgba(0,0,0,.28);
  --sheen: linear-gradient(transparent, transparent);
  --call-av-bg-s: 32%;
  --call-av-fg-s: 70%;
}
:root[data-palette="ocean"] {
  --bg: #0A1322;
  --panel: #101C30;
  --raise: #172640;
  --text: #E8EFFA;
  --muted: #8FA2BF;
  --line: rgba(255,255,255,.08);
  --accent: #3B82F6;
  --accent-text: #6EA8FF;
  --fill: #1F5FD6;
  --fill-text: #FFFFFF;
  --mine: #1F5FD6;
  --mine-text: #FFFFFF;
  --mine-meta: rgba(255,255,255,0.9);
  --tick-read: #A8E1FF;
  --badge-bg: #1F5FD6;
  --badge-text: #FFFFFF;
  --switch-on: #1F5FD6;
  --knob: #FFFFFF;
  --knob-on: #FFFFFF;
  --switch-off: rgba(143,162,191,0.35);
  --other: #172640;
  --other-line: transparent;
  --glass: rgba(16,28,48,0.86);
  --ok: #2DD4BF;
  --ok-text: #2DD4BF;
  --idle: #7B8CA8;
  --danger: #FF8A8A;
  --name-s: 60%;
  --name-l: 72%;
  --av-bg-s: 32%;
  --av-bg-l: 24%;
  --av-fg-s: 70%;
  --av-fg-l: 80%;
  --toast: #2E3C53;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --call-glow: rgba(31,95,214,.42);
  --call-bg: #0A1322;
  --color-scheme: dark;
  --bg-image: none;
  --panel-image: none;
  --edge-hi: transparent;
  --fill-edge: inset 0 0 0 0 transparent;
  --mine-shadow: inset 0 0 0 0 transparent;
  --fab-shadow: 0 6px 16px rgba(0,0,0,.28);
  --sheen: linear-gradient(transparent, transparent);
  --call-av-bg-s: 32%;
  --call-av-fg-s: 70%;
}
:root[data-palette="ocean"][data-theme="light"] {
  --bg: #F1F5FB;
  --panel: #FFFFFF;
  --raise: #E6EDF8;
  --text: #0F1B2D;
  --muted: #52627A;
  --line: rgba(15,40,90,.11);
  --accent: #1D56C7;
  --accent-text: #1D56C7;
  --fill: #1D56C7;
  --fill-text: #FFFFFF;
  --mine: #1D56C7;
  --mine-text: #FFFFFF;
  --mine-meta: rgba(255,255,255,0.9);
  --tick-read: #C8E8FF;
  --badge-bg: #1D56C7;
  --badge-text: #FFFFFF;
  --switch-on: #1D56C7;
  --knob: #FFFFFF;
  --knob-on: #FFFFFF;
  --switch-off: rgba(82,98,122,0.32);
  --other: #FFFFFF;
  --other-line: rgba(15,40,90,.08);
  --glass: rgba(255,255,255,0.88);
  --ok: #14B8A6;
  --ok-text: #0A7A66;
  --idle: #5F6E85;
  --danger: #C62828;
  --name-s: 60%;
  --name-l: 28%;
  --av-bg-s: 55%;
  --av-bg-l: 72%;
  --av-fg-s: 55%;
  --av-fg-l: 24%;
  --toast: #0F1B2D;
  --shadow: 0 10px 28px rgba(15,30,40,.16);
  --call-glow: rgba(31,95,214,.42);
  --call-bg: #0A1322;
  --color-scheme: light;
  --bg-image: none;
  --panel-image: none;
  --edge-hi: transparent;
  --fill-edge: inset 0 0 0 0 transparent;
  --mine-shadow: inset 0 0 0 0 transparent;
  --fab-shadow: 0 6px 16px rgba(0,0,0,.28);
  --sheen: linear-gradient(transparent, transparent);
  --call-av-bg-s: 32%;
  --call-av-fg-s: 70%;
}
:root[data-palette="bordeaux"] {
  --bg: #150E10;
  --panel: #1E1417;
  --raise: #2A1C20;
  --text: #F5EBED;
  --muted: #B39AA1;
  --line: rgba(255,255,255,.08);
  --accent: #A23A55;
  --accent-text: #F0A0B5;
  --fill: #A23A55;
  --fill-text: #FFFFFF;
  --mine: #A23A55;
  --mine-text: #FFFFFF;
  --mine-meta: rgba(255,255,255,0.9);
  --tick-read: #FFD0DB;
  --badge-bg: #A23A55;
  --badge-text: #FFFFFF;
  --switch-on: #A23A55;
  --knob: #FFFFFF;
  --knob-on: #FFFFFF;
  --switch-off: rgba(179,154,161,0.35);
  --other: #2A1C20;
  --other-line: transparent;
  --glass: rgba(30,20,23,0.86);
  --ok: #34D399;
  --ok-text: #34D399;
  --idle: #A08C92;
  --danger: #FF9A9A;
  --name-s: 55%;
  --name-l: 74%;
  --av-bg-s: 32%;
  --av-bg-l: 24%;
  --av-fg-s: 70%;
  --av-fg-l: 80%;
  --toast: #3F3336;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --call-glow: rgba(162,58,85,.42);
  --call-bg: #150E10;
  --color-scheme: dark;
  --bg-image: none;
  --panel-image: none;
  --edge-hi: transparent;
  --fill-edge: inset 0 0 0 0 transparent;
  --mine-shadow: inset 0 0 0 0 transparent;
  --fab-shadow: 0 6px 16px rgba(0,0,0,.28);
  --sheen: linear-gradient(transparent, transparent);
  --call-av-bg-s: 32%;
  --call-av-fg-s: 70%;
}
:root[data-palette="bordeaux"][data-theme="light"] {
  --bg: #FAF4F5;
  --panel: #FFFFFF;
  --raise: #F1E6E9;
  --text: #1E1013;
  --muted: #6A5258;
  --line: rgba(60,20,30,.11);
  --accent: #9A2F4B;
  --accent-text: #9A2F4B;
  --fill: #9A2F4B;
  --fill-text: #FFFFFF;
  --mine: #9A2F4B;
  --mine-text: #FFFFFF;
  --mine-meta: rgba(255,255,255,0.9);
  --tick-read: #FFE0E8;
  --badge-bg: #9A2F4B;
  --badge-text: #FFFFFF;
  --switch-on: #9A2F4B;
  --knob: #FFFFFF;
  --knob-on: #FFFFFF;
  --switch-off: rgba(106,82,88,0.32);
  --other: #FFFFFF;
  --other-line: rgba(60,20,30,.08);
  --glass: rgba(255,255,255,0.88);
  --ok: #12B981;
  --ok-text: #0A7A55;
  --idle: #7A646A;
  --danger: #B3202F;
  --name-s: 50%;
  --name-l: 30%;
  --av-bg-s: 55%;
  --av-bg-l: 74%;
  --av-fg-s: 55%;
  --av-fg-l: 24%;
  --toast: #1E1013;
  --shadow: 0 10px 28px rgba(15,30,40,.16);
  --call-glow: rgba(162,58,85,.42);
  --call-bg: #150E10;
  --color-scheme: light;
  --bg-image: none;
  --panel-image: none;
  --edge-hi: transparent;
  --fill-edge: inset 0 0 0 0 transparent;
  --mine-shadow: inset 0 0 0 0 transparent;
  --fab-shadow: 0 6px 16px rgba(0,0,0,.28);
  --sheen: linear-gradient(transparent, transparent);
  --call-av-bg-s: 32%;
  --call-av-fg-s: 70%;
}
:root[data-palette="chrome"] {
  --bg: #0A0C0F;
  --panel: #12161B;
  --raise: #1B2128;
  --text: #EEF2F6;
  --muted: #9AA5B1;
  --line: rgba(220,230,245,.11);
  --accent: #C9D3DF;
  --accent-text: #B9CCE6;
  --fill: linear-gradient(180deg, #F6F8FB 0%, #DDE3EA 47%, #B7C1CE 53%, #D3DAE3 100%);
  --fill-text: #0C1015;
  --mine: linear-gradient(180deg, #F6F8FB 0%, #DDE3EA 47%, #B7C1CE 53%, #D3DAE3 100%);
  --mine-text: #0C1015;
  --mine-meta: rgba(8,12,16,0.82);
  --tick-read: #0A4A8A;
  --badge-bg: linear-gradient(180deg, #F6F8FB 0%, #DDE3EA 47%, #B7C1CE 53%, #D3DAE3 100%);
  --badge-text: #0C1015;
  --switch-on: linear-gradient(180deg, #F6F8FB 0%, #DDE3EA 47%, #B7C1CE 53%, #D3DAE3 100%);
  --knob: #D5DCE5;
  --knob-on: #10151B;
  --switch-off: rgba(154,165,177,0.35);
  --other: #1B2128;
  --other-line: rgba(220,230,245,.06);
  --glass: rgba(18,22,27,0.86);
  --ok: #34D399;
  --ok-text: #34D399;
  --idle: #8691A0;
  --danger: #FF8A8A;
  --name-s: 22%;
  --name-l: 70%;
  --av-bg-s: 0%;
  --av-bg-l: 22%;
  --av-fg-s: 0%;
  --av-fg-l: 80%;
  --toast: #32373E;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --call-glow: rgba(190,205,225,.14);
  --call-bg: #07090B;
  --color-scheme: dark;
  --bg-image: radial-gradient(70rem 40rem at 15% -8%, rgba(190,205,225,.10), transparent 62%), linear-gradient(180deg, #0E1116, #07090B);
  --panel-image: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,0) 62%);
  --edge-hi: rgba(255,255,255,.07);
  --fill-edge: inset 0 1px 0 rgba(255,255,255,.9), inset 0 -1px 0 rgba(0,0,0,.3);
  --mine-shadow: inset 0 1px 0 rgba(255,255,255,.85), inset 0 -1px 0 rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.35);
  --fab-shadow: 0 8px 20px rgba(0,0,0,.5);
  --sheen: linear-gradient(145deg, rgba(255,255,255,.22), rgba(255,255,255,0) 52%);
  --call-av-bg-s: 0%;
  --call-av-fg-s: 0%;
}
:root[data-palette="chrome"][data-theme="light"] {
  --bg: #DDE3EA;
  --panel: #F3F6F9;
  --raise: #E2E8EE;
  --text: #10151B;
  --muted: #4F5C69;
  --line: rgba(20,35,55,.14);
  --accent: #1F3F66;
  --accent-text: #1B4A82;
  --fill: linear-gradient(180deg, #4A5461 0%, #262D36 47%, #1A2028 53%, #323B47 100%);
  --fill-text: #FFFFFF;
  --mine: linear-gradient(180deg, #4A5461 0%, #262D36 47%, #1A2028 53%, #323B47 100%);
  --mine-text: #FFFFFF;
  --mine-meta: rgba(255,255,255,0.9);
  --tick-read: #9ED0FF;
  --badge-bg: linear-gradient(180deg, #4A5461 0%, #262D36 47%, #1A2028 53%, #323B47 100%);
  --badge-text: #FFFFFF;
  --switch-on: linear-gradient(180deg, #4A5461 0%, #262D36 47%, #1A2028 53%, #323B47 100%);
  --knob: #FFFFFF;
  --knob-on: #FFFFFF;
  --switch-off: rgba(79,92,105,0.32);
  --other: #F7F9FB;
  --other-line: rgba(20,35,55,.10);
  --glass: rgba(243,246,249,0.88);
  --ok: #12B981;
  --ok-text: #075F43;
  --idle: #4F5C69;
  --danger: #A91D1D;
  --name-s: 25%;
  --name-l: 30%;
  --av-bg-s: 0%;
  --av-bg-l: 78%;
  --av-fg-s: 0%;
  --av-fg-l: 28%;
  --toast: #10151B;
  --shadow: 0 10px 28px rgba(15,30,40,.16);
  --call-glow: rgba(190,205,225,.14);
  --call-bg: #07090B;
  --color-scheme: light;
  --bg-image: radial-gradient(70rem 40rem at 15% -8%, rgba(255,255,255,.65), transparent 62%), linear-gradient(180deg, #E9EEF3, #D3DAE2);
  --panel-image: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0) 70%);
  --edge-hi: rgba(255,255,255,.9);
  --fill-edge: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -1px 0 rgba(0,0,0,.4);
  --mine-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -1px 0 rgba(0,0,0,.4), 0 2px 8px rgba(15,25,40,.3);
  --fab-shadow: 0 8px 18px rgba(15,25,40,.35);
  --sheen: linear-gradient(145deg, rgba(255,255,255,.6), rgba(255,255,255,0) 55%);
  --call-av-bg-s: 0%;
  --call-av-fg-s: 0%;
}
/* THEMES:END */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: var(--fs); }
html, body { margin: 0; height: 100%; }
body { background: var(--bg-image), var(--bg); color: var(--text); overflow: hidden; overscroll-behavior: none; line-height: 1.4; letter-spacing: -.003em;
  font-family: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.sprite { position: absolute; width: 0; height: 0; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
svg { width: 1.4rem; height: 1.4rem; fill: currentColor; display: block; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* ---------- каркас ---------- */
#app { display: grid; grid-template-columns: 100%; height: 100dvh; width: 100%; }
#listPane, #chatPane { min-width: 0; min-height: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--bg-image), var(--bg); }
#chatPane { position: relative; }
#app:not(.chat-open) #chatPane { display: none; }
#app.chat-open #listPane { display: none; }
@media (min-width: 860px) {
  #app { grid-template-columns: minmax(20rem, 24rem) 1fr; }
  #app:not(.chat-open) #chatPane, #app.chat-open #listPane { display: flex; }
  #listPane { border-right: 1px solid var(--line); background: var(--panel-image), var(--panel); }
  .icon-btn.only-mobile { display: none; }
}

/* ---------- верхняя панель ---------- */
.bar { position: relative; z-index: 5; flex: none; display: flex; align-items: center; gap: .1rem;
  min-height: calc(var(--tap) + .9rem); padding: calc(.4rem + env(safe-area-inset-top)) .5rem .4rem .6rem;
  background: var(--panel-image), var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { padding-left: .5rem; font-size: 1rem; font-weight: 700; letter-spacing: .22em; }
.spacer { flex: 1; }
.icon-btn { flex: none; width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.icon-btn:hover { background: var(--raise); }
.icon-btn:active { background: var(--line); }
.title-wrap { flex: 1; min-width: 0; padding: 0 .35rem; }
.chat-title { font-size: 1.06rem; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-status { display: flex; align-items: center; gap: .38rem; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-status.ok::before, .chat-status.idle::before { content: ""; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); }
.chat-status.idle::before { background: var(--idle); }
.chat-status.ok { color: var(--ok-text); }
@media (max-width: 480px) { #chatAvatar { display: none; } .title-wrap { padding-left: .5rem; } }

/* ---------- аватары: тональные, оттенок по чату ---------- */
.avatar { --h: 200; position: relative; flex: none; width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 1.25rem;
  background: var(--sheen), hsl(var(--h) var(--av-bg-s) var(--av-bg-l)); color: hsl(var(--h) var(--av-fg-s) var(--av-fg-l)); }
.avatar.sm { width: 2.5rem; height: 2.5rem; font-size: 1.05rem; margin-left: .1rem; }
.avatar.big { width: 7rem; height: 7rem; font-size: 3rem; }
.avatar.online::after { content: ""; position: absolute; right: -.02rem; bottom: -.02rem; width: .85rem; height: .85rem; border-radius: 50%; background: var(--ok); border: .17rem solid var(--bg); }
#listPane .avatar.online::after { border-color: var(--bg); }
@media (min-width: 860px) { #listPane .avatar.online::after { border-color: var(--panel); } }
.chat-item:hover .avatar.online::after, .chat-item.active .avatar.online::after { border-color: var(--raise) !important; }

/* ---------- список чатов ---------- */
#chatList { flex: 1; overflow-y: auto; }
.chat-item { position: relative; display: flex; align-items: center; gap: .85rem; padding: .8rem 1rem; cursor: pointer; transition: background .15s; }
.chat-item::after { content: ""; position: absolute; left: 5.05rem; right: 0; bottom: 0; height: 1px; background: var(--line); }
.chat-item:hover, .chat-item.active { background: var(--raise); }
.ci-main { flex: 1; min-width: 0; }
.ci-top, .ci-bottom { display: flex; align-items: center; gap: .5rem; }
.ci-title { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-time { flex: none; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ci-last { flex: 1; font-size: .9rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.unread .ci-title { font-weight: 750; }
.chat-item.unread .ci-last, .chat-item.unread .ci-time { color: var(--text); }
.badge { flex: none; min-width: 1.55rem; height: 1.55rem; padding: 0 .45rem; border-radius: .8rem; display: grid; place-items: center; background: var(--badge-bg); color: var(--badge-text); font-size: .75rem; font-weight: 700; box-shadow: var(--fill-edge); }
.list-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 1.1rem calc(.9rem + env(safe-area-inset-bottom)) .5rem; }
.foot-links { display: flex; flex-direction: column; align-items: flex-start; }
.link-btn { min-height: var(--tap); padding: 0 .9rem; background: none; border: 0; color: var(--accent-text); font-weight: 600; cursor: pointer; text-align: left; }
.fab { flex: none; width: 3.5rem; height: 3.5rem; border: 0; border-radius: 1.15rem; background: var(--fill); color: var(--fill-text); display: grid; place-items: center; cursor: pointer; box-shadow: var(--fill-edge), var(--fab-shadow); transition: transform .12s; }
.fab svg { width: 1.6rem; height: 1.6rem; }
.fab:active { transform: scale(.94); }
.empty { display: flex; flex-direction: column; align-items: stretch; gap: .8rem; padding: 2.4rem 1.4rem; text-align: center; }
.empty-logo { align-self: center; margin-bottom: .5rem; border-radius: 1.4rem; }
.empty-title { font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; }
.empty p { margin: 0 0 .6rem; color: var(--muted); }
.no-chat { margin: auto; padding: 2rem; text-align: center; color: var(--muted); font-size: 1.05rem; }

/* ---------- кнопки ---------- */
.btn { min-height: var(--tap); padding: 0 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--raise); font-weight: 600; cursor: pointer; transition: filter .15s, transform .1s; }
.btn:active { transform: scale(.98); filter: brightness(.92); }
.btn.primary { background: var(--fill); border-color: transparent; color: var(--fill-text); box-shadow: var(--fill-edge); }
.empty .btn { width: 100%; }

/* ---------- чат ---------- */
#chatView { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.msgs-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
#messages { flex: 1; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .22rem; padding: .9rem max(.75rem, calc((100% - 50rem) / 2)) 1rem; }
.day { display: flex; align-items: center; gap: .8rem; align-self: stretch; margin: .8rem 0 .5rem; color: var(--muted); font-size: .78rem; font-weight: 600; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { display: flex; max-width: 100%; }
.msg.mine { justify-content: flex-end; }
.msg.cont { margin-top: -.08rem; }
.msg.pop { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bubble { max-width: min(85%, 34rem); padding: .48rem .8rem .34rem; border-radius: 1.15rem; background: var(--other); border: 1px solid var(--other-line); box-shadow: inset 0 1px 0 var(--edge-hi); overflow-wrap: anywhere; word-break: break-word; }
.msg:not(.mine) .bubble { border-bottom-left-radius: .35rem; }
.msg:not(.mine).cont .bubble { border-top-left-radius: .35rem; }
.msg:not(.mine):has(+ .msg.cont) .bubble { border-bottom-left-radius: .35rem; }
.msg.mine .bubble { background: var(--mine); border-color: transparent; color: var(--mine-text); border-bottom-right-radius: .35rem; box-shadow: var(--mine-shadow); }
.msg.mine.cont .bubble { border-top-right-radius: .35rem; }
.msg.mine:has(+ .msg.cont) .bubble { border-bottom-right-radius: .35rem; }
.who { --h: 200; margin-bottom: .1rem; font-size: .84rem; font-weight: 650; color: hsl(var(--h) var(--name-s) var(--name-l)); }
.txt { white-space: pre-wrap; font-size: 1rem; }
.txt a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.meta { display: flex; align-items: center; justify-content: flex-end; gap: .3em; margin-top: .08rem; font-size: .72rem; white-space: nowrap; user-select: none; font-variant-numeric: tabular-nums; }
/* текст: время и реакции «обтекают» последнюю строку — если места хватает, пузырь не становится выше */
.bubble.tx .txt { display: inline; }
.bubble.tx .meta { float: right; height: 1.4rem; align-items: flex-end; margin: 0 -.15rem -.32rem .7rem; padding-bottom: .12rem; position: relative; top: .2rem; }
.msg.mine .meta { color: var(--mine-meta); }
.msg:not(.mine) .meta { color: var(--muted); }
.edited { font-style: italic; }
.tk { margin: 0 .38em 0 0; font-size: .9rem; font-weight: 700; letter-spacing: -.38em; }
.tk.s { margin-right: 0; letter-spacing: 0; }
.tk.r { color: var(--tick-read); }
.msg.pending .bubble { opacity: .7; }
.msg.failed .bubble { outline: 2px solid var(--danger); }
.retry { color: var(--mine-text); font-weight: 700; text-decoration: underline; cursor: pointer; }
.bubble img.photo { display: block; max-width: 100%; max-height: 22rem; margin: .1rem 0; border-radius: .8rem; cursor: zoom-in; }
.media-ph { min-width: 12rem; min-height: 6rem; display: grid; place-items: center; color: var(--muted); font-size: .9rem; }
.bubble audio { display: block; width: min(18rem, 66vw); height: 2.6rem; }
.bubble video { display: block; max-width: 100%; max-height: 22rem; border-radius: .8rem; }
.file-chip { display: flex; align-items: center; gap: .65rem; padding: .25rem 0; cursor: pointer; }
.file-chip .fi { font-size: 1.6rem; }
.file-chip .fn { font-weight: 600; overflow-wrap: anywhere; }
.file-chip .fs { font-size: .8rem; opacity: .75; }
.msg.sys { justify-content: center; }
.sys-bubble { padding: .3rem .9rem; border-radius: 1rem; background: var(--raise); color: var(--muted); font-size: .86rem; }
.sys-bubble.missed { color: var(--danger); }
.empty-hint { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; padding: 2rem; text-align: center; color: var(--muted); pointer-events: none; }
.empty-hint b { color: var(--text); font-size: 1.2rem; font-weight: 650; }
.down-btn { position: absolute; right: .9rem; bottom: .7rem; z-index: 4; width: var(--tap); height: var(--tap); border-radius: 50%; display: grid; place-items: center; background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.25); cursor: pointer; }
.down-btn svg.down { transform: rotate(-90deg); }
.down-badge { position: absolute; top: -.5rem; right: -.2rem; min-width: 1.4rem; height: 1.4rem; padding: 0 .38rem; border-radius: .7rem; display: grid; place-items: center; background: var(--badge-bg); color: var(--badge-text); font-size: .72rem; font-weight: 700; box-shadow: var(--fill-edge); }

/* ---------- поле ввода ---------- */
#composer { flex: none; padding: .5rem max(.6rem, calc((100% - 50rem) / 2 + .1rem)) calc(.5rem + env(safe-area-inset-bottom)); background: var(--panel-image), var(--panel); border-top: 1px solid var(--line); }
.input-row { display: flex; align-items: flex-end; gap: .3rem; }
#msgInput { flex: 1; min-width: 0; min-height: var(--tap); max-height: 8rem; padding: .65rem 1rem; border: 0; border-radius: 1.4rem; outline: none; resize: none; background: var(--raise); font-size: 1rem; line-height: 1.35; transition: box-shadow .15s; }
#msgInput:focus { box-shadow: 0 0 0 1.5px var(--accent-text); }
#msgInput::placeholder { color: var(--muted); opacity: .95; font-size: .85em; }
.send-btn { flex: none; width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: var(--fill); color: var(--fill-text); display: grid; place-items: center; cursor: pointer; box-shadow: var(--fill-edge); transition: transform .1s; }
.send-btn:active { transform: scale(.92); }
.rec-bar { display: flex; align-items: center; gap: .6rem; min-height: var(--tap); padding: 0 .1rem; font-variant-numeric: tabular-nums; }
.rec-dot { width: .8rem; height: .8rem; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.edit-bar { display: flex; align-items: center; gap: .4rem; margin-bottom: .45rem; padding: .2rem .3rem .2rem .85rem; border-left: .22rem solid var(--accent-text); border-radius: .5rem; background: var(--raise); }
.edit-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .85rem; }
.edit-text b { color: var(--accent-text); font-weight: 650; }
.edit-text span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- меню и диалоги ---------- */
.menu { position: absolute; z-index: 20; right: .6rem; top: calc(100% - .3rem); min-width: 14.5rem; overflow: hidden; border-radius: 1rem; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); transform-origin: 100% 0; animation: menuin .14s ease-out; }
@keyframes menuin { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.menu button { display: block; width: 100%; min-height: var(--tap); padding: 0 1.1rem; text-align: left; background: none; border: 0; cursor: pointer; }
.menu button:hover { background: var(--raise); }
.menu .danger { color: var(--danger); }
dialog { width: min(92vw, 28rem); max-height: 92dvh; overflow-y: auto; padding: 1.3rem; border: 1px solid var(--line); border-radius: 1.4rem; background: var(--panel-image), var(--panel); color: var(--text); box-shadow: var(--shadow); animation: dlgin .18s ease-out; }
dialog::backdrop { background: rgba(5,8,10,.6); }
@keyframes dlgin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 640px) {
  dialog { width: 100%; max-width: none; margin: auto 0 0; padding: 1.3rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom)); border-radius: 1.5rem 1.5rem 0 0; border-bottom: 0; animation: sheet .22s cubic-bezier(.2,.8,.2,1); }
}
dialog h2 { margin: 0 0 .6rem; font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; }
.set-h { margin: 1.3rem 0 .1rem; font-size: .85rem; font-weight: 650; color: var(--muted); }
dialog label { display: block; margin: .8rem 0 .3rem; font-size: .9rem; color: var(--muted); }
dialog input[type="text"], dialog textarea, dialog select { width: 100%; min-height: var(--tap); padding: .7rem 1rem; border-radius: .9rem; border: 1px solid var(--line); background: var(--bg); outline: none; font-size: 1rem; }
dialog textarea { resize: none; }
dialog input[type="text"]:focus, dialog textarea:focus, dialog select:focus { border-color: var(--accent-text); }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }
.set-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.hint { margin: .5rem 0 0; font-size: .85rem; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: .6rem; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: var(--tap); margin: 0; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: .35rem; border-radius: .35rem; background: var(--switch-off); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 1.6rem; height: 1.6rem; margin-top: -.62rem; border-radius: 50%; background: var(--fill); border: 3px solid var(--panel); box-shadow: 0 0 0 1.5px var(--accent); }
input[type="range"]::-moz-range-track { height: .35rem; border-radius: .35rem; background: var(--switch-off); }
input[type="range"]::-moz-range-thumb { width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--accent); border: 3px solid var(--panel); }
.switch-row { display: flex; align-items: center; gap: 1rem; margin-top: .7rem; }
.sw-text { flex: 1; min-width: 0; }
.sw-title { font-weight: 600; }
.switch-row .hint { margin: .1rem 0 0; }
.switch { position: relative; flex: none; width: 3.3rem; height: 44px; }
.switch input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.slider { position: absolute; left: 0; right: 0; top: 50%; height: 1.9rem; transform: translateY(-50%); border-radius: 1rem; background: var(--switch-off); transition: background .18s; }
.slider::before { content: ""; position: absolute; left: .22rem; top: 50%; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--knob); box-shadow: 0 1px 3px rgba(0,0,0,.35); transform: translateY(-50%); transition: transform .18s, background .18s; }
.switch input:checked + .slider { background: var(--switch-on); }
.switch input:checked + .slider::before { transform: translate(1.35rem, -50%); background: var(--knob-on); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .slider { opacity: .45; }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* ---------- просмотр фото, уведомление, ошибка ---------- */
#viewer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(5,8,10,.95); cursor: zoom-out; }
#viewer img { max-width: 96vw; max-height: 94dvh; object-fit: contain; }
#toast { position: fixed; z-index: 60; left: 50%; bottom: calc(6rem + env(safe-area-inset-bottom)); max-width: 90vw; padding: .7rem 1.15rem; border-radius: 1rem; text-align: center; color: #fff; background: var(--toast); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(1rem); transition: opacity .22s, transform .22s; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#fatal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 2rem; background: var(--bg); text-align: center; font-size: 1.1rem; }

/* ---------- экран звонка (всегда тёмный) ---------- */
.call-screen { position: fixed; inset: 0; z-index: 70; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; align-items: center; color: #fff;
  padding: calc(4rem + env(safe-area-inset-top)) 1.5rem calc(2.6rem + env(safe-area-inset-bottom));
  background: radial-gradient(48rem 34rem at 50% -8%, var(--call-glow), transparent 66%), var(--call-bg); }
.call-screen .avatar { background: hsl(var(--h) var(--call-av-bg-s) 22%); color: hsl(var(--h) var(--call-av-fg-s) 80%); }
.call-info, .call-actions { position: relative; z-index: 2; }
.call-info { display: flex; flex-direction: column; align-items: center; gap: .8rem; text-align: center; }
.call-name { font-size: 1.65rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.call-status { min-height: 1.6rem; font-size: 1.05rem; opacity: .8; font-variant-numeric: tabular-nums; }
.call-screen.ringing .avatar.big::before, .call-screen.ringing .avatar.big::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.28); animation: halo 2.2s ease-out infinite; }
.call-screen.ringing .avatar.big::after { animation-delay: 1.1s; }
@keyframes halo { from { transform: scale(.94); opacity: .9; } to { transform: scale(1.38); opacity: 0; } }
.call-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 1.1rem; }
.call-btn { min-width: 4.2rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; background: none; border: 0; color: #fff; font-size: .8rem; cursor: pointer; }
.cb-circle { width: 4.1rem; height: 4.1rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.13); transition: transform .1s; }
.call-btn:active .cb-circle { transform: scale(.93); }
.cb-circle svg { width: 1.85rem; height: 1.85rem; }
.cb-circle.green { background: #12805C; }
.cb-circle.red { background: #C93C3C; }
.cb-circle.off { background: #fff; color: #161B1E; }
svg.hang { transform: rotate(135deg); }
.call-screen .remote-video, .call-screen .local-video { display: none; }
.call-screen.video.has-local .local-video { display: block; position: absolute; z-index: 3; top: calc(1rem + env(safe-area-inset-top)); right: 1rem; width: 6.5rem; height: 8.7rem; object-fit: cover; border-radius: 1rem; border: 1.5px solid rgba(255,255,255,.35); background: #000; transform: scaleX(-1); box-shadow: var(--shadow); }
.call-screen.video.rear .local-video { transform: none; }
.call-screen.video.cam-off .local-video { visibility: hidden; }
.call-screen.remote .remote-video { display: block; position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.call-screen.remote .call-info { position: absolute; top: calc(1rem + env(safe-area-inset-top)); left: 1rem; align-items: flex-start; gap: .1rem; text-align: left; text-shadow: 0 1px 5px rgba(0,0,0,.8); }
.call-screen.remote .avatar.big { display: none; }
.call-screen.remote .call-name { font-size: 1.15rem; }
.call-screen.remote .call-status { min-height: 0; font-size: .95rem; }
.call-screen.remote .call-actions { position: absolute; left: 0; right: 0; bottom: 0; padding: 3rem 1rem calc(1.5rem + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.66)); }
.call-screen.video .call-actions { gap: .8rem; }
.call-screen.video .call-btn { min-width: 3.6rem; }
.call-screen.video .cb-circle { width: 3.5rem; height: 3.5rem; }
.call-screen.video .cb-circle svg { width: 1.6rem; height: 1.6rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- выбор оформления ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: .3rem; }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: .4rem; min-height: 44px; padding: .55rem 2px .5rem; border: 1.5px solid var(--line); border-radius: 1rem; background: transparent; color: var(--text); cursor: pointer; }
.theme-opt.sel { border-color: var(--accent-text); background: var(--raise); }
.theme-sw { width: 2.7rem; height: 2.7rem; border-radius: .9rem; background: linear-gradient(135deg, var(--sw-bg) 0 52%, var(--sw-fill) 52% 100%); box-shadow: inset 0 0 0 1px rgba(128,128,128,.35); }
.theme-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: min(.78rem, 13px); font-weight: 600; }

/* ---------- размер шрифта: кнопки вместо ползунка ---------- */
.stepper { display: flex; align-items: center; gap: .6rem; margin-top: .2rem; }
.step-btn { flex: none; min-width: 3.6rem; height: var(--tap); padding: 0 .9rem; display: inline-flex; align-items: baseline; justify-content: center; gap: .05rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--raise); font-weight: 700; cursor: pointer; transition: transform .1s, filter .15s; }
.step-btn:active:not(:disabled) { transform: scale(.96); filter: brightness(.92); }
.step-btn:disabled { opacity: .35; cursor: not-allowed; }
.step-btn .a-s { font-size: .8rem; } .step-btn .a-l { font-size: 1.15rem; }
.step-val { flex: 1; text-align: center; font-variant-numeric: tabular-nums; }
.font-sample { margin-top: .6rem; padding: .7rem .9rem; border-radius: 1rem; background: var(--raise); line-height: 1.35; overflow-wrap: anywhere; }
.font-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: var(--tap); }
.font-foot .hint { margin: 0; }

/* ---------- ответы, удаление, видеосообщения ---------- */
.btn.danger-btn { color: var(--danger); }
.msg { position: relative; touch-action: pan-y; }
.msg:not(.swiping) { transition: transform .18s ease-out; }
.msg.swiping::before { content: "↩"; position: absolute; left: -2.3rem; top: 50%; transform: translateY(-50%); font-size: 1.35rem; color: var(--muted); opacity: .6; }
.msg.armed::before { color: var(--accent-text); opacity: 1; }
.msg.del { opacity: 0; transform: scale(.96); transition: opacity .16s, transform .16s; }
.msg.flash .bubble { animation: flash 1.3s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--accent-text); } to { box-shadow: 0 0 0 0 transparent; } }
.quote { display: flex; flex-direction: column; min-width: 0; margin: .1rem 0 .4rem; padding: .25rem .6rem; border-left: .22rem solid var(--accent-text); border-radius: .4rem; background: rgba(127,140,150,.16); cursor: pointer; font-size: .88rem; }
.msg.mine .quote { background: rgba(255,255,255,.16); border-left-color: var(--mine-text); }
@supports (background: color-mix(in srgb, red 10%, transparent)) { .msg.mine .quote { background: color-mix(in srgb, var(--mine-text) 14%, transparent); } }
.quote b { font-size: .8rem; font-weight: 650; color: var(--accent-text); }
.msg.mine .quote b { color: var(--mine-text); }
.quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .88; }
.quote.gone span { font-style: italic; opacity: .6; }
.reply-bar { border-left-color: var(--accent-text); }
.vnote { position: relative; width: min(15rem, 62vw); aspect-ratio: 1; overflow: hidden; border-radius: 50%; background: #000; cursor: pointer; }
.vnote .vn-video { display: block; width: 100%; height: 100%; object-fit: cover; }
.vnote .media-ph { position: absolute; inset: 0; color: #fff; }
.vnote::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; background: conic-gradient(rgba(255,255,255,.6) calc(var(--p, 0) * 1%), transparent 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); }
.vn-play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.6rem; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6); transition: opacity .15s; }
.vnote.playing .vn-play { opacity: 0; }
.vn-dur { position: absolute; left: 50%; transform: translateX(-50%); bottom: 1rem; padding: .08rem .5rem; border-radius: .8rem; background: rgba(0,0,0,.55); color: #fff; font-size: .75rem; font-variant-numeric: tabular-nums; }
.bubble.vn, .msg.mine .bubble.vn { padding: 0; background: transparent; border: 0; box-shadow: none; }
.bubble.vn .meta, .msg.mine .bubble.vn .meta { padding: .1rem .4rem 0; color: var(--muted); }
.vrec { position: fixed; inset: 0; z-index: 66; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; padding: 1.5rem; background: rgba(5,8,10,.95); color: #fff; }
.vrec-circle { position: relative; width: min(78vw, 22rem); aspect-ratio: 1; overflow: hidden; border-radius: 50%; background: #000; box-shadow: 0 0 0 3px rgba(255,255,255,.14); }
.vrec-circle canvas { display: block; width: 100%; height: 100%; }
.vrec.front .vrec-circle canvas { transform: scaleX(-1); }
.vrec-ring { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; background: conic-gradient(rgba(255,107,107,.85) calc(var(--p, 0) * 1%), transparent 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); }
.vrec-time { font-size: 1.2rem; font-variant-numeric: tabular-nums; }

/* ---------- без масштабирования щипком (в записи кружка щипок = зум камеры) ---------- */
html, body { touch-action: pan-x pan-y; }
.vrec { touch-action: none; }
.vrec-zoom { position: absolute; left: 50%; bottom: .9rem; transform: translateX(-50%); padding: .1rem .7rem; border-radius: 1rem; background: rgba(0,0,0,.55); color: #fff; font-size: .9rem; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .2s; pointer-events: none; }
.vrec-zoom.show { opacity: 1; }
.vrec-hint { font-size: .8rem; opacity: .6; }

/* ---------- реакции ---------- */
.reacts { display: inline-flex; flex-wrap: nowrap; gap: .2rem; margin-right: .15rem; }
.rx, .rx-opt { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", system-ui, sans-serif; }
.rx { display: inline-flex; align-items: center; gap: .15rem; height: 1.3rem; padding: 0 .32rem; border-radius: .7rem; border: 1px solid transparent; background: rgba(127,140,150,.18); color: inherit; font-size: 1.05rem; line-height: 1; cursor: pointer; position: relative; }
button.rx::after { content: ""; position: absolute; inset: -.5rem -.15rem; }   /* зона нажатия больше, чем сам значок */
span.rx { cursor: default; }
.rx i { font-style: normal; font-size: .72rem; font-variant-numeric: tabular-nums; }
.rx.mine { border-color: transparent; }
.msg.mine .rx { background: rgba(255,255,255,.18); border-color: transparent; }
.msg.mine .rx.mine { border-color: transparent; }
.rx-pop { position: absolute; z-index: 30; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .1rem; width: min(94%, 25rem); padding: .3rem; border-radius: 1.6rem; background: var(--panel-image), var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); animation: menuin .14s ease-out; }
.rx-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .1rem; }
.rx-opt { height: 44px; border: 0; border-radius: .9rem; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; transition: transform .1s; }
.rx-opt.sel { background: var(--raise); }
.rx-opt:active { transform: scale(1.2); }
