


#notif-bell-wrap { position: relative; }
#notif-bell-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--glass-border);
  background: linear-gradient(155deg, rgba(255,255,255,.06), rgba(255,255,255,.015));
  color: var(--text-dim); cursor: pointer; transition: all .22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
#notif-bell-btn:hover {
  color: var(--on-light); border-color: transparent; background: var(--grad);
  box-shadow: 0 6px 18px rgba(0,0,0,.38), 0 0 16px rgba(255,255,255,.14); transform: translateY(-1px);
}
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 20px; background: var(--grad); color: var(--on-light); font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg);
  box-shadow: 0 0 0 0 rgba(255,255,255,.5); animation: notif-badge-pulse 2.4s ease-in-out infinite;
}
@keyframes notif-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); }
  50% { box-shadow: 0 0 0 4px rgba(255,255,255,0); }
}
.notif-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; width: 320px; max-height: 420px;
  border: 1px solid transparent; border-radius: var(--radius);
  background:
    linear-gradient(var(--bg3), var(--bg3)) padding-box,
    linear-gradient(165deg, rgba(255,255,255,.24), rgba(255,255,255,.03) 45%, rgba(255,255,255,.12)) border-box;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0,0,0,.55), var(--shadow-blue); opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .18s, transform .18s, visibility .18s; z-index: 400; overflow: hidden; display: flex; flex-direction: column;
}
.notif-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.notif-dropdown-head {
  padding: 14px 16px; font-weight: 700; font-size: .9rem; border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
#notif-mark-all {
  background: none; border: none; color: var(--blue-light); font-size: .72rem; font-weight: 600;
  cursor: pointer; padding: 4px 6px; border-radius: 6px; transition: background .15s, color .15s; white-space: nowrap;
}
#notif-mark-all:hover { background: var(--glass); color: var(--text); }
.notif-head-actions { display: flex; align-items: center; gap: 4px; }
.notif-sound-toggle {
  display: flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  background: none; border: none; border-radius: 6px; color: var(--text-dim); cursor: pointer;
  transition: background .15s, color .15s;
}
.notif-sound-toggle:hover { background: var(--glass); color: var(--text); }
.notif-sound-toggle.muted { color: var(--text-muted); }
.notif-dropdown-list { overflow-y: auto; max-height: 360px; }
.notif-empty, .sub-empty { padding: 2rem 1rem; text-align: center; color: var(--text-muted); font-size: .85rem; }
.sub-empty a { color: var(--blue-light); font-weight: 600; text-decoration: none; }
.sub-empty a:hover { text-decoration: underline; color: var(--text); }
.notif-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid var(--glass-border); transition: background .15s; position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--glass); }
.notif-item.unread { background: rgba(255, 255, 255, 0.06); }
.notif-item-dot {
  position: absolute; top: 16px; right: 14px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--grad); box-shadow: 0 0 8px rgba(255,255,255,0.5); flex-shrink: 0;
}
.notif-item-thumb { width: 56px; height: 34px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.notif-item-icon {
  width: 34px; height: 34px; border-radius: 8px; background: var(--glass); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0; color: var(--blue-light);
}
.notif-item-body { flex: 1; min-width: 0; padding-right: 14px; }
.notif-item-title { font-size: .82rem; font-weight: 600; line-height: 1.3; }
.notif-item-sub { font-size: .76rem; color: var(--text-muted); margin-top: 2px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }


.notif-toast { display: flex; gap: 10px; align-items: center; cursor: pointer; padding-right: 20px; }
.notif-toast-thumb { width: 60px; height: 36px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.notif-toast-body { min-width: 0; }
.notif-toast-title { font-size: .82rem; font-weight: 700; }
.notif-toast-sub { font-size: .76rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }


.dm-toast {
  position: relative;
  align-items: flex-start;
  gap: 13px;
  min-width: 320px;
  max-width: 360px;
  padding: 14px 16px 16px 14px;
  padding-right: 34px;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0) 40%),
    var(--bg2);
  border-color: var(--glass-border);
  box-shadow: 0 18px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.02) inset;
  cursor: pointer;
  animation: dm-toast-in .38s cubic-bezier(.2,.9,.25,1.2);
}

.dm-toast::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
  background: var(--grad);
}
.dm-toast:hover { border-color: rgba(255,255,255,.28); }
.dm-toast:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 2px; }

.dm-toast-avatar {
  width: 42px; height: 42px; border-radius: 50%; overflow: visible; flex-shrink: 0; position: relative;
  box-shadow: 0 0 0 2px var(--bg2), 0 0 0 3.5px rgba(255,255,255,.35);
}
.dm-toast-avatar-img {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 750; color: #fff;
}

.dm-toast-avatar::after {
  content: ''; position: absolute; right: -2px; bottom: -2px; width: 17px; height: 17px;
  border-radius: 50%; box-shadow: 0 0 0 2.5px var(--bg2);
  background: var(--grad) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A0A0A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") no-repeat center / 9px 9px;
}

.dm-toast-content { flex: 1; min-width: 0; padding-top: 1px; }
.dm-toast-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dm-toast .notif-toast-title { font-size: .86rem; }
.dm-toast-time { font-size: .68rem; color: var(--text-muted); flex-shrink: 0; }
.dm-toast-preview {
  margin-top: 5px; max-width: none; white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.06);
  border-radius: 9px; padding: 7px 9px; line-height: 1.35; color: var(--text-dim);
}

.dm-toast-close {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; border: none; cursor: pointer;
  background: transparent; color: var(--text-muted); opacity: 0; transition: opacity .15s, background .15s, color .15s;
}
.dm-toast-close svg { width: 13px; height: 13px; }
.dm-toast:hover .dm-toast-close, .dm-toast-close:focus-visible { opacity: 1; }
.dm-toast-close:hover { background: rgba(255,255,255,.12); color: var(--text); }

.dm-toast-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2.5px; background: rgba(255,255,255,.06); }
.dm-toast-progress-bar { height: 100%; width: 100%; background: var(--grad); transform-origin: left; animation: dm-toast-shrink linear forwards; animation-duration: var(--dm-toast-ms, 8000ms); }
.dm-toast.paused .dm-toast-progress-bar { animation-play-state: paused; }

@keyframes dm-toast-in {
  from { opacity: 0; transform: translateX(60px) scale(.94); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes dm-toast-shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (max-width: 520px) {
  .dm-toast { min-width: 0; max-width: none; }
}


.notif-watch-modal {
  position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  background: rgba(2, 4, 12, 0.85); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.notif-watch-modal.open { opacity: 1; visibility: visible; }
.notif-watch-inner { width: min(900px, 92vw); background: var(--bg3); border: 1px solid var(--glass-border); border-radius: var(--radius); overflow: hidden; }
.notif-watch-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--glass-border); }
.notif-watch-head span { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 1rem; }
.notif-watch-head button { background: none; border: none; color: var(--text-dim); cursor: pointer; display: flex; }
.notif-watch-head button:hover { color: var(--text); }
.notif-watch-frame { position: relative; width: 100%; padding-top: 56.25%; background: #000; }
.notif-watch-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }


.sub-add-tabs { display: flex; gap: 6px; margin-bottom: .9rem; }
.sub-add-tab {
  flex: 1; padding: 9px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
  background: var(--glass); color: var(--text-dim); font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.sub-add-tab.active { background: var(--grad); border-color: transparent; color: var(--on-light); }
.sub-link-row { display: flex; gap: 8px; }
.sub-link-row .form-input { flex: 1; }
.sub-search-results { margin-top: .6rem; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.sub-search-item, .sub-list-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--glass-border);
}
.sub-search-item img, .sub-list-item img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sub-search-item-title, .sub-list-item-title { flex: 1; font-size: .83rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-search-loading { padding: 1rem; text-align: center; color: var(--text-muted); font-size: .82rem; }
.sub-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.sub-remove-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; padding: 4px; border-radius: 6px; }
.sub-remove-btn:hover { color: #EF4444; background: rgba(239, 68, 68, 0.1); }


.sugg-section { margin: 2rem 0; padding: 0 2.5rem; max-width: 1200px; margin-left: auto; margin-right: auto; }
.sugg-channels-row { display: flex; gap: 18px; overflow-x: auto; padding: 4px 4px 10px; scrollbar-width: thin; }
.sugg-channel-card {
  flex: 0 0 92px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; text-align: center;
}
.sugg-channel-avatar {
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--bg3);
  border: 2px solid var(--glass-border); transition: border-color .2s, transform .2s;
}
.sugg-channel-card:hover .sugg-channel-avatar, .sugg-channel-card:focus-visible .sugg-channel-avatar {
  border-color: var(--blue-light); transform: translateY(-2px);
}
.sugg-channel-name {
  font-size: .78rem; font-weight: 600; line-height: 1.25; width: 100%;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.sugg-empty {
  padding: 2rem; text-align: center; color: var(--text-muted); font-size: .85rem;
  background: var(--glass); border: 1px dashed var(--glass-border); border-radius: var(--radius);
  flex: 1 1 100%;
}
.sugg-empty button { margin-top: .8rem; }


.cv-modal-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.cv-modal-item {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--glass-border); cursor: pointer; transition: border-color .15s;
}
.cv-modal-item:hover { border-color: var(--blue-light); }
.cv-modal-item img { width: 100px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: var(--bg3); }
.cv-modal-item-text { flex: 1; min-width: 0; }
.cv-modal-item-title { font-size: .84rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cv-modal-item-date { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }


.channel-sugg-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.channel-sugg-item {
  display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .15s;
}
.channel-sugg-item:hover { background: var(--glass); }
.channel-sugg-item img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.channel-sugg-item-text { flex: 1; min-width: 0; }
.channel-sugg-item-title { font-size: .78rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.channel-sugg-item-channel { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }

@media (max-width: 1024px) { .sugg-section { padding: 0 1.8rem; } }
@media (max-width: 768px) { .sugg-section { padding: 0 1.2rem; } }

@media (max-width: 640px) {
  .notif-dropdown { width: 92vw; right: -8px; }
  .sugg-channel-card { flex-basis: 76px; }
}


#friends-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--glass-border);
  background: linear-gradient(155deg, rgba(255,255,255,.06), rgba(255,255,255,.015));
  color: var(--text-dim); cursor: pointer; transition: all .22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
#friends-btn:hover {
  color: var(--on-light); border-color: transparent; background: var(--grad);
  box-shadow: 0 6px 18px rgba(0,0,0,.38), 0 0 16px rgba(255,255,255,.14); transform: translateY(-1px);
}

.friends-tabs { display: flex; gap: 6px; margin-bottom: 1rem; }
.friends-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
  background: var(--glass); color: var(--text-dim); font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.friends-tab.active { background: var(--grad); border-color: transparent; color: var(--on-light); }
.friends-tab-count {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 20px; background: rgba(255,255,255,0.25);
  font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.friends-tab:not(.active) .friends-tab-count { background: var(--grad); color: var(--on-light); }

.friends-add-row { display: flex; gap: 8px; }
.friends-add-row .form-input { flex: 1; }

.friends-panel { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.friends-empty { padding: 2rem 1rem; text-align: center; color: var(--text-muted); font-size: .85rem; }

.friend-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--glass-border);
}
.friend-item-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 750; color: #fff;
}
.friend-item-name { flex: 1; font-size: .83rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-item-pending { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }

.friend-view-btn, .friend-remove-btn, .friend-cancel-btn, .friend-accept-btn, .friend-decline-btn {
  background: none; border: none; cursor: pointer; display: flex; padding: 6px; border-radius: 6px; color: var(--text-muted); flex-shrink: 0;
}
.friend-view-btn:hover { color: var(--blue-light); background: rgba(96, 165, 250, 0.12); }
.friend-remove-btn:hover, .friend-decline-btn:hover, .friend-cancel-btn:hover { color: #EF4444; background: rgba(239, 68, 68, 0.1); }
.friend-accept-btn:hover { color: #10B981; background: rgba(16, 185, 129, 0.12); }

@media (max-width: 640px) {
  .friends-tabs { flex-wrap: wrap; }
}
