/* Гид, колокольчик, баннер установки PWA */

.tour-hl {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 3500;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
  box-sizing: border-box;
  background: transparent;
  box-shadow: 0 0 0 2px #5eead4, 0 0 0 500vmax rgba(5, 8, 14, 0.56);
  will-change: transform, width, height;
}
.tour-hl[hidden] { display: none !important; }
html.tour-on,
html.tour-on body {
  overflow: visible !important;
}

.tour-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: auto;
  top: auto;
  z-index: 4000;
  pointer-events: none;
  width: 320px;
  max-width: calc(100vw - 32px);
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tour-root .tour-sheet,
.tour-root .tour-chip,
.tour-root .tour-x,
.tour-root .tour-btn {
  pointer-events: auto;
}
.tour-root[hidden] { display: none !important; }
.tour-chip {
  pointer-events: auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.35);
  background: rgba(14, 20, 32, 0.96);
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
.tour-chip[hidden] { display: none !important; }
.tour-sheet {
  pointer-events: auto;
  position: relative;
  width: 100%;
  margin: 0;
  padding: 18px 44px 16px 18px;
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 16px;
  background: rgba(8, 12, 20, 0.97);
  color: #f8fafc;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.tour-sheet::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: rgba(8, 12, 20, 0.97);
  border: 1px solid rgba(94, 234, 212, 0.28);
  transform: rotate(45deg);
}
.tour-root[data-place="right"] .tour-sheet::after {
  left: -6px;
  top: var(--tour-arrow, 50%);
  margin-top: -6px;
  border-right: 0;
  border-top: 0;
}
.tour-root[data-place="left"] .tour-sheet::after {
  right: -6px;
  top: var(--tour-arrow, 50%);
  margin-top: -6px;
  border-left: 0;
  border-bottom: 0;
}
.tour-root[data-place="bottom"] .tour-sheet::after {
  top: -6px;
  left: var(--tour-arrow, 50%);
  margin-left: -6px;
  border-bottom: 0;
  border-right: 0;
}
.tour-root[data-place="top"] .tour-sheet::after {
  bottom: -6px;
  left: var(--tour-arrow, 50%);
  margin-left: -6px;
  border-top: 0;
  border-left: 0;
}
.tour-root[data-place="float"] .tour-sheet::after { display: none; }
.tour-chip,
.tour-x,
.tour-btn {
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
.tour-sheet[hidden] { display: none !important; }
.tour-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.tour-x:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.tour-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.tour-dots i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}
.tour-dots i.is-on { background: #5eead4; width: 18px; }
.tour-step {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5eead4;
}
.tour-sheet h3 {
  margin: 0 0 8px;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.25;
  color: #ffffff;
}
.tour-sheet p,
.tour-sheet .tour-body {
  margin: 0 0 16px;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
  color: #f1f5f9;
}
.tour-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.tour-btn {
  appearance: none;
  border: 0;
  border-radius: 11px;
  height: 42px;
  padding: 0 16px;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
}
.tour-btn-skip {
  background: transparent;
  color: #94a3b8;
}
.tour-btn-skip:hover { color: #f8fafc; }
.tour-btn-next {
  background: #5eead4;
  color: #06201b;
  margin-left: auto;
}
.tour-btn-next:hover { filter: brightness(1.05); }
.tour-btn[disabled] { opacity: 0.35; pointer-events: none; }

.main-head-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.main-head-tools .btn,
.main-head-tools .btn-ghost,
.main-head-tools .head-logout {
  width: auto;
  margin: 0;
}
.main-head-tools .btn-primary {
  width: auto;
  min-width: 180px;
  margin: 0;
}

.notif-wrap { position: relative; }
.notif-bell {
  appearance: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(14, 20, 32, 0.7);
  color: #e8eef8;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
}
.notif-bell svg { width: 20px; height: 20px; }
.notif-bell:hover { border-color: rgba(94, 234, 212, 0.35); color: #fff; }
.notif-bell.is-open { border-color: rgba(94, 234, 212, 0.5); }
.notif-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
}
.notif-badge[hidden] { display: none !important; }

.notif-pop {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  width: 20rem;
  max-width: calc(100vw - 32px);
  max-height: min(72vh, 480px);
  overflow: auto;
  overflow-wrap: anywhere;
  z-index: 50;
  padding: 1rem;
  border-radius: 1rem;
  background: #0f172a;
  border: 1px solid #1e293b;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
}
.notif-pop[hidden] { display: none !important; }

/* Mobile: escape .main overflow clipping; pin under header, not centered */
@media (max-width: 767px) {
  .notif-pop {
    position: fixed;
    top: max(64px, calc(env(safe-area-inset-top, 0px) + 56px));
    right: 16px;
    left: auto;
    width: min(20rem, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    z-index: 80;
  }
}
.notif-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 6px 10px;
}
.notif-pop-head strong { font-size: 0.92rem; }
.notif-mark {
  appearance: none;
  border: 0;
  background: none;
  color: #5eead4;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.notif-item:hover { background: rgba(255, 255, 255, 0.05); }
.notif-item.is-unread { background: rgba(94, 234, 212, 0.08); }
.notif-item-kind {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5eead4;
}
.notif-item-title { font-size: 0.88rem; font-weight: 700; overflow-wrap: anywhere; }
.notif-item-text { font-size: 0.78rem; color: #8b97ab; line-height: 1.35; overflow-wrap: anywhere; }
.notif-empty {
  margin: 8px 6px 12px;
  color: #8b97ab;
  font-size: 0.84rem;
}
.notif-mirror {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 8px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 6px;
  font-size: 0.8rem;
  color: #c7d2de;
}
.notif-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.notif-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.notif-switch span {
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  position: relative;
  transition: 0.15s ease;
}
.notif-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e8eef8;
  transition: 0.15s ease;
}
.notif-switch input:checked + span { background: rgba(94, 234, 212, 0.45); }
.notif-switch input:checked + span::after { transform: translateX(18px); background: #5eead4; }

.pwa-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 401;
  pointer-events: auto;
  width: min(560px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: 16px;
  background: rgba(14, 20, 32, 0.97);
  border: 1px solid rgba(94, 234, 212, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  color: #f2f5f9;
}
.pwa-banner[hidden] { display: none !important; }
.pwa-banner-mark {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 12px;
  background: #0e1420;
  flex-shrink: 0;
}
.pwa-banner-copy { flex: 1; min-width: 0; }
.pwa-banner-copy strong {
  display: block;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
}
.pwa-banner-copy span {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: #8b97ab;
  font-weight: 500;
}
.pwa-banner-install {
  appearance: none;
  border: 0;
  border-radius: 11px;
  height: 36px;
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
  background: #5eead4;
  color: #06201b;
  cursor: pointer;
  white-space: nowrap;
}
.pwa-banner-guide {
  background: transparent;
  color: #5eead4;
  border: 1px solid rgba(94, 234, 212, 0.4);
}
.pwa-banner-close {
  appearance: none;
  border: 0;
  background: none;
  color: #8b97ab;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 6px;
}

.pwa-nav-btn {
  appearance: none;
  margin-left: auto;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.35);
  background: rgba(94, 234, 212, 0.12);
  color: #5eead4;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.pwa-nav-btn:hover { background: rgba(94, 234, 212, 0.22); color: #f2f5f9; }
.pwa-nav-btn[hidden] { display: none !important; }

@media (max-width: 640px) {
  .pwa-banner { display: none !important; }
  .pwa-nav-btn {
    height: 28px;
    padding: 0 10px;
    font-size: 0.7rem;
  }
}

/* Tiny phones: hide header install so brand stays intact */
@media (max-width: 400px) {
  .pwa-nav-btn {
    display: none !important;
  }
}

html.is-telegram-miniapp .pwa-banner,
html.is-telegram-miniapp #pwa-install-root,
html.is-telegram-miniapp .pwa-nav-btn,
body.is-telegram-miniapp .pwa-banner,
body.is-telegram-miniapp #pwa-install-root,
body.is-telegram-miniapp .pwa-nav-btn {
  display: none !important;
}

#pwa-install-root {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 40;
  pointer-events: none;
  padding: 12px 12px max(16px, env(safe-area-inset-bottom));
}
#pwa-install-root[hidden] { display: none !important; }
#pwa-install-root .pwa-banner,
#pwa-install-root .pwa-sheet {
  pointer-events: auto;
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  width: min(560px, 100%);
  margin: 0 auto;
}
.pwa-sheet {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pwa-sheet .ig-card {
  width: 100%;
  max-height: min(52vh, 420px);
}

.ig-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 16px max(20px, env(safe-area-inset-bottom));
  pointer-events: auto;
}
.ig-card {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  width: min(440px, 100%);
  max-height: min(68vh, 560px);
  overflow: auto;
  padding: 20px 18px 16px;
  border-radius: 22px;
  background: rgba(14, 20, 32, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
  color: #f2f5f9;
}
.ig-x {
  position: absolute;
  top: 12px;
  right: 12px;
  appearance: none;
  border: 0;
  background: none;
  color: #8b97ab;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 4px 8px;
}
.ig-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 28px 14px 0;
}
.ig-brand img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  background: #070b12;
}
.ig-brand strong {
  display: block;
  font-size: 1.02rem;
  letter-spacing: -0.03em;
}
.ig-brand span {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: #8b97ab;
}
.ig-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.ig-tab {
  appearance: none;
  flex: 1;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #c5cedb;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.ig-tab.is-on {
  background: rgba(94, 234, 212, 0.16);
  border-color: rgba(94, 234, 212, 0.45);
  color: #5eead4;
}
.ig-art {
  display: grid;
  place-items: center;
  min-height: 168px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ig-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5eead4;
}
.ig-card h3 {
  margin: 0 0 8px;
  font-size: 1.14rem;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.ig-body {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #c5cedb;
}
.ig-link {
  appearance: none;
  display: inline-block;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: none;
  color: #5eead4;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ig-nav,
.ig-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.ig-dock {
  width: min(440px, 100%);
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(14, 20, 32, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.ig-nav .tour-dots,
.ig-dock .tour-dots { margin: 0; }
.ig-nav .tour-btn-next,
.ig-dock .tour-btn-next {
  margin-left: 0;
  min-width: 120px;
  min-height: 44px;
  pointer-events: auto;
  flex: 1;
}

.ig-phone {
  width: 132px;
  border-radius: 22px;
  padding: 10px 8px 8px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 2px #070b12;
}
.ig-phone-screen {
  height: 108px;
  border-radius: 12px;
  background: #0b1220;
  display: grid;
  place-items: center;
  gap: 4px;
  color: #e8eef8;
  font-size: 0.72rem;
  font-weight: 700;
}
.ig-phone-screen img { width: 42px; height: 42px; border-radius: 10px; }
.ig-ios-dock {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.ig-share {
  display: grid;
  place-items: center;
  width: 36px;
  height: 28px;
  border-radius: 8px;
  color: #5eead4;
  background: rgba(94, 234, 212, 0.16);
}

.ig-sheet {
  width: min(280px, 100%);
  border-radius: 16px;
  overflow: hidden;
  background: #161e2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ig-sheet-row {
  padding: 11px 14px;
  font-size: 0.86rem;
  color: #c5cedb;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ig-sheet-row:last-child { border-bottom: 0; }
.ig-sheet-row.is-on {
  color: #06201b;
  background: #5eead4;
  font-weight: 800;
}

.ig-home {
  display: grid;
  place-items: center;
  gap: 8px;
  color: #e8eef8;
  font-size: 0.78rem;
  font-weight: 700;
}
.ig-home img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.ig-chrome {
  width: min(280px, 100%);
  border-radius: 12px;
  overflow: hidden;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ig-chrome-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #1a2333;
}
.ig-chrome-bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}
.ig-chrome-bar b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 24px;
  border-radius: 6px;
  color: #5eead4;
  background: rgba(94, 234, 212, 0.16);
  font-size: 1.05rem;
}
.ig-chrome-body {
  display: grid;
  place-items: center;
  height: 92px;
}
.ig-chrome-body img { width: 48px; height: 48px; border-radius: 12px; }

.ig-desk {
  width: min(300px, 100%);
  border-radius: 12px;
  overflow: hidden;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ig-desk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #1a2333;
}
.ig-url {
  flex: 1;
  height: 22px;
  border-radius: 999px;
  background: #0b1220;
  color: #8b97ab;
  font-size: 0.7rem;
  line-height: 22px;
  padding: 0 10px;
}
.ig-desk-bar b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 22px;
  border-radius: 6px;
  color: #06201b;
  background: #5eead4;
  font-size: 0.85rem;
}
.ig-desk-body {
  display: grid;
  place-items: center;
  height: 96px;
  font-size: 0.78rem;
  color: #c5cedb;
}
.ig-desk-body img { width: 44px; height: 44px; border-radius: 10px; }
.ig-desk-body p { margin: 6px 0 0; }

.ig-dialog {
  width: min(260px, 100%);
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 16px 14px;
  border-radius: 16px;
  background: #161e2c;
  text-align: center;
}
.ig-dialog img { width: 48px; height: 48px; border-radius: 12px; }
.ig-dialog strong { font-size: 0.92rem; }
.ig-dialog span { font-size: 0.74rem; color: #8b97ab; }
.ig-dialog em {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-style: normal;
  font-weight: 800;
  font-size: 0.8rem;
  background: #5eead4;
  color: #06201b;
}

.ig-row {
  display: flex;
  gap: 10px;
}
.ig-app {
  width: 110px;
  padding: 14px 10px;
  border-radius: 14px;
  text-align: center;
  background: #161e2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ig-app b { display: block; font-size: 0.86rem; }
.ig-app span { display: block; margin-top: 4px; font-size: 0.7rem; color: #8b97ab; }
.ig-app.is-dim { opacity: 0.45; }
.ig-app.is-on {
  border-color: rgba(94, 234, 212, 0.5);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.25);
}

.is-pulse { animation: ig-pulse 1.15s ease-in-out infinite; }
@keyframes ig-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.45); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(94, 234, 212, 0); }
}

@media (min-width: 720px) {
  .ig-overlay { justify-content: center; }
}
