/* === ПРОФИЛЬ-ИДЕНТИТИ, ШТОРКА НАСТРОЕК, ОЖИВЛЕНИЕ СТЕКЛА === */

/* --- карточки: лёгкие аврора-подсветки фона (под контентом) --- */
#view-profile .card{--aur-1:rgba(138,120,255,.11);--aur-2:rgba(255,110,180,.06);background:radial-gradient(120% 90% at 88% -18%,var(--aur-1),transparent 60%),radial-gradient(100% 80% at -8% 112%,var(--aur-2),transparent 62%),var(--surface)}
.admin-panel{--aur-1:rgba(64,190,170,.10);--aur-2:rgba(70,130,255,.07);background:radial-gradient(120% 90% at 88% -18%,var(--aur-1),transparent 60%),radial-gradient(100% 80% at -8% 112%,var(--aur-2),transparent 62%),var(--surface)}
.opt-card{--aur-1:rgba(255,170,80,.07);--aur-2:rgba(138,120,255,.07);background:radial-gradient(120% 90% at 88% -18%,var(--aur-1),transparent 60%),radial-gradient(100% 80% at -8% 112%,var(--aur-2),transparent 62%),var(--surface)}
[data-theme="light"] #view-profile .card{--aur-1:rgba(110,95,230,.10);--aur-2:rgba(220,80,160,.06)}
[data-theme="light"] .admin-panel{--aur-1:rgba(20,150,130,.09);--aur-2:rgba(60,110,230,.07)}
[data-theme="light"] .opt-card{--aur-1:rgba(220,130,30,.07);--aur-2:rgba(110,95,230,.07)}
/* световая нить по верхней кромке карточек */
#view-profile .card::after,.admin-panel::after,.opt-card::after{content:'';position:absolute;top:0;left:12%;right:12%;height:1px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.22),transparent);pointer-events:none}
[data-theme="light"] #view-profile .card::after,[data-theme="light"] .admin-panel::after,[data-theme="light"] .opt-card::after{background:linear-gradient(90deg,transparent,rgba(255,255,255,.95),transparent)}
#view-profile .card,.admin-panel,.opt-card{position:relative}

/* --- confirm-модалки (удаление подписки и др.) — поверх шторки настроек --- */
.confirm-modal-overlay{z-index:2100}

/* --- identity-блок профиля --- */
.profile-card .profile-head-row{justify-content:flex-start;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.profile-identity{display:flex;align-items:center;gap:14px;min-width:0}
.profile-avatar{position:relative;width:58px;height:58px;border-radius:50%;flex-shrink:0;background:var(--avatar-bg,#1a1a20);display:flex;align-items:center;justify-content:center;box-shadow:0 6px 20px rgba(0,0,0,.35)}
[data-theme="light"] .profile-avatar{--avatar-bg:#fff;box-shadow:0 6px 20px rgba(40,50,120,.16)}
.profile-avatar::before{content:'';position:absolute;inset:-3px;border-radius:50%;background:conic-gradient(from 210deg,#8a7dff,#ff7ab0,#6fd6ff,#8a7dff);z-index:-1;opacity:.9}
[data-theme="light"] .profile-avatar::before{opacity:.75}
.profile-avatar img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:none;transition:transform .35s cubic-bezier(.34,1.56,.64,1)}
.profile-avatar.has-photo{cursor:pointer}
.profile-avatar.has-photo::before{opacity:1}
.profile-avatar.has-photo:hover img{transform:scale(1.07)}
.profile-avatar span{display:flex;width:100%;height:100%;align-items:center;justify-content:center;color:var(--text-ghost)}
.profile-avatar span svg{width:52%;height:52%}
.profile-names{min-width:0}
.profile-username{font-size:18px;font-weight:700;line-height:1.25;word-break:break-all;cursor:pointer;transition:opacity .2s}
.profile-username:hover{opacity:.72}
.profile-username:active{transform:scale(.985)}
.profile-uid{margin-top:3px;font-size:12.5px;font-weight:600;color:var(--text-muted);letter-spacing:.02em;cursor:pointer;width:fit-content;border-bottom:1px dashed transparent;transition:color .2s,border-color .2s;font-feature-settings:"tnum"}
.profile-uid:hover{color:var(--text-secondary);border-bottom-color:var(--text-ghost)}
.profile-head-actions{margin-left:auto;display:flex;align-items:center;gap:8px;flex-shrink:0}

/* --- кнопка-шестерёнка --- */
.settings-gear-btn{width:38px;height:38px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;background:var(--pill-bg);border:1px solid var(--pill-border);color:var(--text-secondary);cursor:pointer;flex-shrink:0;transition:background .25s,color .25s,transform .15s;backdrop-filter:var(--pill-blur);-webkit-backdrop-filter:var(--pill-blur);box-shadow:var(--pill-edge)}
.settings-gear-btn svg{width:20px;height:20px;stroke:currentColor;fill:none;transition:transform .5s cubic-bezier(.34,1.56,.64,1)}
.settings-gear-btn:hover{color:var(--text);background:var(--pill-bg-hover)}
.settings-gear-btn:hover svg{transform:rotate(60deg)}
.settings-gear-btn:active{transform:scale(.92)}

/* выйти — та же геометрия, что у шестерёнки, но красный hover, без вращения иконки */
.logout-gear-btn:hover{color:var(--danger);border-color:rgba(255,69,58,.4);background:rgba(255,69,58,.08)}
.logout-gear-btn:hover svg{transform:none}

/* --- шторка настроек (поверх всего, с блюром) --- */
.settings-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.15);backdrop-filter:blur(14px) saturate(160%);-webkit-backdrop-filter:blur(14px) saturate(160%);z-index:2000;display:flex;align-items:center;justify-content:center;padding:20px;opacity:0;visibility:hidden;transition:all .3s ease}
[data-theme="light"] .settings-overlay{background:rgba(245,245,245,.15)}
.settings-overlay.active{opacity:1;visibility:visible}
.settings-sheet{background:rgba(0,0,0,.45);backdrop-filter:blur(24px) saturate(180%);-webkit-backdrop-filter:blur(24px) saturate(180%);border:1px solid var(--border-heavy);border-radius:28px;padding:24px;width:100%;max-width:480px;max-height:86vh;overflow-y:auto;position:relative;transform:translateY(20px) scale(.96);transition:all .18s cubic-bezier(.175,.885,.32,1.275);box-shadow:0 20px 50px rgba(0,0,0,.5),inset 0 1px 0 rgba(255,255,255,.08)}
[data-theme="light"] .settings-sheet{background:rgba(255,255,255,.15)}
.settings-overlay.active .settings-sheet{transform:translateY(0) scale(1);animation:glassBlurIn .18s ease-out both}
.settings-head{margin-bottom:14px;padding-right:34px}
.settings-title{font-size:20px;font-weight:800;letter-spacing:-.2px}
.settings-sub{font-size:13px;color:var(--text-muted);margin-top:3px}
.settings-sheet .modal-close{position:absolute;top:14px;right:16px}
body:has(#settingsOverlay.active) .fab-ticket-btn,body:has(#settingsOverlay.active) #fabTicketBtn{display:none!important}

/* --- пустое состояние чата: не мигать при автообновлении ---
   плашка переносится между перерисовками без пересоздания (preserve/restore в 10-chat.js),
   поэтому fadeIn-анимация отключена (иначе перезапускалась бы каждые 2.5с и вспыхивала),
   а появление/скрытие идёт плавно через класс .visible */
.chat-empty-state{animation:none;opacity:0;visibility:hidden;transition:opacity .35s ease,visibility .35s ease}
.chat-empty-state.visible{opacity:1;visibility:visible}

/* --- пункты опций: чуть выразительнее --- */
.opt-icon{box-shadow:inset 0 1px 0 rgba(255,255,255,.09)}
.opt-item{touch-action:manipulation;-webkit-tap-highlight-color:transparent}

@media (max-width:768px){
.profile-avatar{width:50px;height:50px}
.profile-username{font-size:16.5px}
.profile-uid{font-size:11.5px}
.settings-sheet{padding:18px 14px;border-radius:22px}
}
@media (prefers-reduced-motion:reduce){
.settings-gear-btn svg,.settings-gear-btn,.settings-overlay,.settings-sheet,.profile-username,.profile-uid,.profile-avatar img{animation:none!important;transition:none!important}
}
.profile-restriction-notice{margin:12px 0;padding:13px 15px;border-radius:14px;font-size:13px;font-weight:750;line-height:1.45;animation:fadeIn .25s ease}.profile-restriction-notice.freeze{background:rgba(95,205,255,.13);color:#7ddfff;border:1px solid rgba(95,205,255,.34);box-shadow:inset 0 1px 0 rgba(255,255,255,.08)}.profile-restriction-notice.block{background:rgba(92,20,20,.22);color:#ffb1ab;border:1px solid rgba(255,69,58,.42)}.subscription-link-wrap{position:relative}.sub-link-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:14px;background:rgba(15,22,30,.72);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);color:#9ee8ff;font-weight:850;letter-spacing:.1px;z-index:2}.subscription-link-wrap .link-text.is-sub-disabled{filter:blur(3px);opacity:.45;pointer-events:none}

.restriction-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:9px}.restriction-restore-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px;border-radius:12px;padding:8px 14px;border:1px solid rgba(95,205,255,.30);background:rgba(95,205,255,.09);color:#9ee8ff;font-family:inherit;font-size:13px;font-weight:800;cursor:pointer;box-shadow:var(--pill-edge),var(--pill-shadow);backdrop-filter:var(--pill-blur);-webkit-backdrop-filter:var(--pill-blur);transition:.2s}.restriction-restore-btn{color:#9ee8ff}.restriction-hint{font-size:11px;opacity:.78}.restriction-title{font-weight:850}.restriction-reason{margin-top:3px;font-size:12px;font-weight:550;opacity:.72}

.profile-restriction-notice.block{background:rgba(92,20,20,.22);color:#ffb1ab;border:1px solid rgba(255,69,58,.42)}

.restriction-restore-btn:hover{background:rgba(95,205,255,.15);border-color:rgba(95,205,255,.48);transform:translateY(-1px)}.restriction-restore-btn:active{transform:scale(.98)}

/* === LIGHT THEME: CONTRAST FIX FOR RESTRICTION BLOCKS === */

/* общая плашка ограничения в светлой теме */
[data-theme="light"] .profile-restriction-notice{
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 2px 10px rgba(15,30,60,.08);
}

/* freeze / заморозка */
[data-theme="light"] .profile-restriction-notice.freeze{
  background: rgba(7,89,127,.12);
  border-color: rgba(7,89,127,.36);
  color: #064c6e; /* тёмно-синий вместо светло-голубого */
}

/* block / блокировка */
[data-theme="light"] .profile-restriction-notice.block{
  background: rgba(166,27,18,.10);
  border-color: rgba(166,27,18,.36);
  color: #9b140d; /* тёмно-красный вместо бледно-розового */
}

/* кнопка восстановления */
[data-theme="light"] .restriction-restore-btn{
  background: rgba(7,89,127,.10);
  border-color: rgba(7,89,127,.34);
  color: #064c6e;
  box-shadow:
    0 1px 2px rgba(15,30,60,.10),
    inset 0 1px 0 rgba(255,255,255,.70);
}

[data-theme="light"] .restriction-restore-btn:hover{
  background: rgba(7,89,127,.16);
  border-color: rgba(7,89,127,.50);
  color: #043a55;
}

[data-theme="light"] .restriction-restore-btn:active{
  transform: scale(.98);
}

/* подсказки и причины внутри плашек — делаем читаемее */
[data-theme="light"] .profile-restriction-notice .restriction-hint,
[data-theme="light"] .profile-restriction-notice .restriction-reason{
  opacity: .88;
}

[data-theme="light"] .profile-restriction-notice.block .restriction-hint,
[data-theme="light"] .profile-restriction-notice.block .restriction-reason{
  opacity: .90;
}

/* если используется оверлей на ссылке подписки — тоже правим под светлую тему */
[data-theme="light"] .sub-link-overlay{
  background: rgba(238,246,252,.90);
  color: #064c6e;
  backdrop-filter: blur(5px) saturate(120%);
  -webkit-backdrop-filter: blur(5px) saturate(120%);
}

[data-theme="light"] .subscription-link-wrap .link-text.is-sub-disabled{
  opacity: .58;
}