/* Liquid Glass skin for the authenticated Hub. */
body.hub-liquid {
    --hub-ink: #24303d;
    --hub-muted: #687587;
    --hub-accent: #237b79;
    --hub-accent-strong: #176765;
    --hub-border: rgba(209, 218, 228, .88);
    --hub-surface: rgba(255, 255, 255, .76);
    --hub-chrome: rgba(248, 250, 253, .74);
    --hub-subtle: rgba(236, 241, 247, .74);
    --hub-field: rgba(255, 255, 255, .88);
    --hub-hover: rgba(35, 123, 121, .09);
    --hub-shadow: 0 12px 32px rgba(37, 53, 73, .10), inset 0 1px rgba(255, 255, 255, .82);
    min-height: 100vh;
    color: var(--hub-ink);
    background-color: #e9edf4;
    background-image:
        radial-gradient(ellipse at 9% 12%, rgba(166, 207, 220, .36), transparent 49%),
        radial-gradient(ellipse at 88% 28%, rgba(203, 191, 226, .31), transparent 54%),
        radial-gradient(ellipse at 48% 100%, rgba(255, 255, 255, .75), transparent 57%),
        linear-gradient(135deg, #f3f6fa 0%, #e8edf5 53%, #f0eef6 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
}
/* Same image-free palette collection as the User Panel. */
body.hub-liquid[data-hub-background='jade'] { background-color: #c4e3d4; background-image: linear-gradient(135deg in oklch, oklch(96.08% .0174 164.66), oklch(75.64% .0918 158.21)); }
body.hub-liquid[data-hub-background='spectrum'] { background-color: #b6b8c1; background-image: linear-gradient(135deg, oklch(37.8% .0455 262.97) 0 16.667%, oklch(59.45% .0207 260.86) 16.667% 33.333%, oklch(80.31% .0303 111.85) 33.333% 50%, oklch(80.71% .0854 82.26) 50% 66.667%, oklch(61.81% .102 54.79) 66.667% 83.333%, oklch(41.73% .0675 27.31) 83.333% 100%); }
body.hub-liquid[data-hub-background='coast'] { background-color: #9ec8d9; background-image: linear-gradient(180deg in oklch, oklch(71.82% .0712 229.34), oklch(88.88% .0537 30.83) 48%, oklch(71.33% .082 192.43)); }
body.hub-liquid[data-hub-background='violet'] { background-color: #a367c2; background-image: linear-gradient(180deg in oklch, oklch(40.27% .1001 292.66), oklch(65.11% .1125 304.98) 55%, oklch(79.42% .1243 348.64)); }
body.hub-liquid[data-hub-background='lilac'] { background-color: #d4bee9; background-image: linear-gradient(315deg in oklch, oklch(71.65% .1392 288.98), oklch(76.87% .123 299.36) 20%, oklch(83.07% .1019 310.73) 40%, oklch(88.99% .0789 320.54) 60%, oklch(94.88% .0193 264.68)); }
body.hub-liquid[data-hub-background='petal'] { background-color: #efd4e7; background-image: conic-gradient(from 135deg, oklch(85.83% .0978 341.72), oklch(89.37% .0784 337.49), oklch(95.28% .0276 326.92), oklch(97.24% .0179 220.19), oklch(92.91% .0387 238.14), oklch(85.04% .0661 266.69), oklch(85.83% .0978 341.72)); }
body.hub-liquid[data-hub-background='twilight'] { background-color: #a5a1d0; background-image: conic-gradient(from 225deg, oklch(87.8% .0441 245.39), oklch(93.31% .022 234.82), oklch(94.09% .0152 305.63), oklch(90.55% .0207 319.36), oklch(83.07% .0455 252.79), oklch(64.17% .0965 274.98), oklch(87.8% .0441 245.39)); }
body.hub-liquid[data-hub-background='ice'] { background-color: #f4f4fe; background-image: radial-gradient(circle 476px at 54.8% 51.5%, #a8e5fd 0%, #f4f4fe 42.3%, #f4f4fe 100%); }
body.hub-liquid[data-hub-background='pastel'] { background-color: #cc95c0; background-image: linear-gradient(to right, #7aa1d2, #dbd4b4, #cc95c0); }
body.hub-liquid[data-hub-background='cloud'] { background-color: #e0eafc; background-image: linear-gradient(to right, #cfdef3, #e0eafc); }
body.hub-liquid .header-main {
    position: sticky;
    top: 0;
    z-index: 35;
    margin-bottom: 18px;
    background: var(--hub-chrome);
    border: 1px solid var(--hub-border);
    border-top: 0;
    box-shadow: 0 4px 20px rgba(34, 48, 68, .06);
    -webkit-backdrop-filter: blur(26px) saturate(135%);
    backdrop-filter: blur(26px) saturate(135%);
}
body.hub-liquid .header-title { color: var(--hub-ink); }
body.hub-liquid .user-box {
    flex-wrap: wrap;
    justify-content: flex-end;
    color: var(--hub-muted);
    background: var(--hub-surface);
    border-color: var(--hub-border);
    box-shadow: inset 0 1px rgba(255, 255, 255, .55);
}
body.hub-liquid .user-box a { border-color: var(--hub-accent); color: var(--hub-accent-strong); }
body.hub-liquid .user-box a:hover { background: var(--hub-accent); color: #fff; }
body.hub-liquid .user-box a.user-name-link { color: var(--hub-accent-strong); }
body.hub-liquid .user-box a.user-name-link:hover { background: transparent; color: var(--hub-accent); }
body.hub-liquid #sidebar {
    background: rgba(25, 34, 46, .78);
    color: #e9f1f5;
    border-left: 1px solid rgba(185, 204, 218, .24);
    box-shadow: 0 14px 36px rgba(18, 30, 43, .18);
    -webkit-backdrop-filter: blur(28px) saturate(130%);
    backdrop-filter: blur(28px) saturate(130%);
}
body.hub-liquid #sidebar .brand { color: #f7fbff; }
body.hub-liquid #sidebar .brand svg { stroke: #77d8d1; }
body.hub-liquid .sidebar-section-title { color: #a7bbc9; }
body.hub-liquid .sidebar-section-title:before,
body.hub-liquid .sidebar-submenu-item:before { background: #75d1ca; }
body.hub-liquid .sidebar-link { color: #d5e0e9; }
body.hub-liquid .sidebar-link:hover,
body.hub-liquid .sidebar-submenu-item:hover { background: rgba(255, 255, 255, .09); color: #fff; }
body.hub-liquid .sidebar-link.active { background: rgba(117, 209, 202, .9); color: #15343a; box-shadow: 0 7px 19px rgba(62, 187, 178, .25); }
body.hub-liquid .sidebar-link.active .icon svg { stroke: #15343a; }
body.hub-liquid .badge { background: #75d1ca; color: #15343a; }
body.hub-liquid .badge-orange { background: #f4a66f; color: #3e2515; }
body.hub-liquid #openSidebar { background: var(--hub-chrome); border: 1px solid var(--hub-border); box-shadow: var(--hub-shadow); }
body.hub-liquid #openSidebar svg { stroke: var(--hub-ink); }
body.hub-liquid #dynamic {
    color: var(--hub-ink);
}
body.hub-liquid #dynamic :is(.bg-white, .bg-slate-50, .bg-slate-100) {
    background-color: var(--hub-surface) !important;
    border-color: var(--hub-border) !important;
    box-shadow: var(--hub-shadow);
}
body.hub-liquid #dynamic :is(.text-slate-900, .text-slate-800, .text-slate-700, .text-gray-900, .text-gray-800, .text-gray-700) { color: var(--hub-ink) !important; }
body.hub-liquid #dynamic :is(.text-slate-600, .text-slate-500, .text-slate-400, .text-gray-600, .text-gray-500, .text-gray-400) { color: var(--hub-muted) !important; }
body.hub-liquid #dynamic :is(.border-slate-100, .border-slate-200, .border-slate-300, .border-gray-100, .border-gray-200) { border-color: var(--hub-border) !important; }
body.hub-liquid #dynamic :is(input, select, textarea) { color: var(--hub-ink); background: var(--hub-field); border-color: var(--hub-border); }
body.hub-liquid #dynamic :is(input, select, textarea):focus { border-color: var(--hub-accent); box-shadow: 0 0 0 3px rgba(35, 123, 121, .15); outline: 0; }
body.hub-liquid #devicesModal > div { background: var(--hub-surface); color: var(--hub-ink); border: 1px solid var(--hub-border); box-shadow: 0 22px 62px rgba(0, 0, 0, .26); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
body.hub-liquid .telegram-partner-card { background: var(--hub-surface); border-color: var(--hub-border); box-shadow: var(--hub-shadow); }
body.hub-liquid .telegram-partner-title { color: var(--hub-ink); }

/* Appearance controls. */
body.hub-liquid .hub-appearance { display: inline-flex; align-items: center; gap: 7px; direction: rtl; }
body.hub-liquid .hub-background-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    border: 0;
    border-radius: 8px;
    color: var(--hub-muted);
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
body.hub-liquid .hub-background-picker { position: relative; }
body.hub-liquid .hub-background-toggle { padding: 3px 9px; border: 1px solid var(--hub-border); background: var(--hub-subtle); }
body.hub-liquid .hub-background-toggle:hover,
body.hub-liquid .hub-background-toggle[aria-expanded='true'] { background: var(--hub-field); color: var(--hub-ink); }
body.hub-liquid .hub-background-toggle > svg { width: 14px; height: 14px; transition: transform 150ms ease; }
body.hub-liquid .hub-background-toggle[aria-expanded='true'] > svg { transform: rotate(180deg); }
body.hub-liquid .hub-background-icon,
body.hub-liquid .hub-background-preview { display: inline-block; flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, .72); box-shadow: 0 1px 2px rgba(27, 38, 52, .16); }
body.hub-liquid .hub-background-icon { width: 15px; height: 15px; border-radius: 5px; background: linear-gradient(135deg, #b9dbe0, #f1eefa 60%, #a9cad5); }
body.hub-liquid .hub-background-menu {
    position: absolute;
    z-index: 80;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(138px, 1fr));
    gap: 5px;
    width: 318px;
    padding: 8px;
    border: 1px solid var(--hub-border);
    border-radius: 14px;
    background: var(--hub-chrome);
    box-shadow: 0 18px 42px rgba(25, 38, 54, .20);
    -webkit-backdrop-filter: blur(28px) saturate(135%);
    backdrop-filter: blur(28px) saturate(135%);
}
body.hub-liquid .hub-background-menu[hidden] { display: none; }
body.hub-liquid .hub-background-option { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 5px 7px; border: 1px solid transparent; border-radius: 9px; color: var(--hub-muted); background: transparent; font: inherit; font-size: 11px; font-weight: 700; text-align: start; cursor: pointer; }
body.hub-liquid .hub-background-option:hover { background: var(--hub-hover); color: var(--hub-ink); }
body.hub-liquid .hub-background-option[aria-checked='true'] { border-color: var(--hub-border); background: var(--hub-hover); color: var(--hub-ink); }
body.hub-liquid .hub-background-preview { width: 34px; height: 27px; border-radius: 6px; background-size: cover; background-position: center; }
body.hub-liquid .hub-preview-mica { background-image: linear-gradient(135deg, #c0dbe0, #f4f1f8 56%, #bac5de); }
body.hub-liquid .hub-preview-jade { background: linear-gradient(135deg, #e4f5ed, #86cbaa); }
body.hub-liquid .hub-preview-spectrum { background: linear-gradient(135deg, #445071, #b5c686 48%, #d68d54); }
body.hub-liquid .hub-preview-coast { background: linear-gradient(#89bcda, #e8b8c8 48%, #70b5bd); }
body.hub-liquid .hub-preview-violet { background: linear-gradient(#6645a0, #d77ba9); }
body.hub-liquid .hub-preview-lilac { background: linear-gradient(135deg, #9c65d7, #ece4fb 75%); }
body.hub-liquid .hub-preview-petal { background: conic-gradient(from 135deg, #e593bc, #f7e1ee, #b3daf1, #e593bc); }
body.hub-liquid .hub-preview-twilight { background: conic-gradient(from 225deg, #bfc8e7, #eee7f4, #8872bc, #bfc8e7); }
body.hub-liquid .hub-preview-ice { background: radial-gradient(circle at center, #a8e5fd, #f4f4fe 70%); }
body.hub-liquid .hub-preview-pastel { background: linear-gradient(90deg, #7aa1d2, #dbd4b4, #cc95c0); }
body.hub-liquid .hub-preview-cloud { background: linear-gradient(90deg, #cfdef3, #e0eafc); }

@media (max-width: 900px) {
    body.hub-liquid .header-main { margin-bottom: 12px; padding: .75rem .9rem .75rem 4.25rem; align-items: flex-start; }
    body.hub-liquid .header-title { font-size: 1.1rem; }
    body.hub-liquid .user-box { gap: .35rem .45rem; justify-content: flex-start; }
    body.hub-liquid .user-box > span { flex-basis: 100%; order: 1; }
    body.hub-liquid .user-box > a[href*='logout'] { order: 2; }
    body.hub-liquid .hub-appearance { order: 2; width: auto; }
    body.hub-liquid .hub-background-label,
    body.hub-liquid .hub-background-toggle > svg { display: none; }
    body.hub-liquid .hub-background-toggle { width: 32px; min-height: 32px; padding: 0; }
    body.hub-liquid .hub-background-menu { position: fixed; top: var(--hub-background-menu-top, 80px); inset-inline: 12px; width: auto; max-height: calc(100dvh - var(--hub-background-menu-top, 80px) - 12px); grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-y: auto; overscroll-behavior: contain; }
    body.hub-liquid .hub-background-option { min-width: 0; }
    body.hub-liquid #dynamic { padding-inline: 14px; padding-bottom: 24px; }
}
@media (prefers-reduced-transparency: reduce) {
    body.hub-liquid { --hub-surface: #f9fbfd; --hub-chrome: #f9fbfd; --hub-subtle: #edf1f6; background-image: none; }
    body.hub-liquid :is(#sidebar, .header-main, .hub-background-menu, #devicesModal > div) { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
    body.hub-liquid *, body.hub-liquid *::before, body.hub-liquid *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
