/* 7.9.65 — launch polish: document scroll, sticky header, footer logo, switcher, bell, nalog, blog, reg */

/* NEVER overflow-x:clip on html — it computes overflow-y to hidden in Chromium. */
html,
html:has(.landing-shell),
html:has(body.bu-landing-page),
html:has(body.bu-product-page) {
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: scroll !important;
}
html body.bu-landing-page,
html body.bu-product-page,
html body.bu-author-page,
html body.bu-public-inner,
html body.bu-nalog-page,
html body.bu-auth-chrome {
  height: auto !important;
  max-height: none !important;
  min-height: 100dvh !important;
  overflow: visible !important;
  position: static !important;
  transform: none !important;
  filter: none !important;
  contain: none !important;
}
html body .landing-shell,
html body .landing-shell-main,
html body.bu-product-page main.bu-pro,
html body.bu-product-page main.bu-blog,
html body.bu-product-page main.bu-page,
html body.bu-product-page main.bu-mkt,
html body.bu-product-page main.bu-article-pro {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  contain: none !important;
  transform: none !important;
}

/* Sticky / fixed header — never hide, never translate away */
html body.bu-landing-page .bu-neon-head,
html body.bu-product-page .bu-neon-head,
html body.bu-author-page .bu-neon-head,
html body .landing-shell-main > .bu-neon-head,
html body.bu-landing-page .bu-neon-head.is-home,
html body.bu-landing-page .bu-neon-head.is-inner,
html body.bu-landing-page .bu-neon-head.is-stuck,
html body.bu-landing-page .bu-neon-head.is-hidden,
html body.bu-product-page .bu-neon-head.is-inner,
html body [data-landing-header].bu-neon-head {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  z-index: 2147483000 !important;
  height: 58px !important;
  min-height: 58px !important;
  margin: 0 !important;
  transform: none !important;
  filter: none !important;
  contain: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
html body.bu-auth-chrome .bu-auth-top {
  position: sticky !important;
  top: 0 !important;
  z-index: 80 !important;
  background: #fff;
}
html body.bu-landing-page .landing-shell-main,
html body.bu-product-page .landing-shell-main {
  padding-top: 58px !important;
}
@media (min-width: 1100px) {
  html body.bu-landing-page .bu-neon-head,
  html body.bu-product-page .bu-neon-head,
  html body [data-landing-header].bu-neon-head {
    left: 232px !important;
    width: auto !important;
  }
}
@media (max-width: 1099px) {
  html body.bu-landing-page .bu-neon-head,
  html body.bu-product-page .bu-neon-head,
  html body [data-landing-header].bu-neon-head {
    left: 0 !important;
    width: 100% !important;
  }
}

/* Compact market switcher — fits 232px nav and header */
html body .bu-edition-switch {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 8px 0;
  z-index: 5;
}
html body .bu-edition-switch > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
}
html body .bu-edition-switch > summary::-webkit-details-marker { display: none; }
html body .bu-edition-switch .bu-ed-flag {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #0f172a;
  font-size: 9px;
  letter-spacing: 0.04em;
}
html body .bu-edition-switch .bu-ed-copy {
  min-width: 0;
  flex: 1;
}
html body .bu-edition-switch .bu-ed-copy strong,
html body .bu-edition-switch .bu-ed-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body .bu-edition-switch .bu-ed-copy span {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.7;
}
html body .bu-edition-menu {
  margin-top: 6px;
  padding: 6px;
  border-radius: 12px;
  background: #0b1220;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 4px;
}
html body .bu-edition-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 12px;
}
html body .bu-edition-menu a.is-on,
html body .bu-edition-menu a:hover {
  background: rgba(11, 110, 134, 0.35);
}
html body .bu-neon-head .bu-edition-switch {
  width: auto;
  max-width: 220px;
  margin: 0;
}
html body .bu-neon-head .bu-edition-switch > summary {
  background: rgba(255, 255, 255, 0.08);
  min-height: 36px;
}
html body .bu-neon-head .bu-edition-menu {
  position: absolute;
  right: 0;
  min-width: 240px;
  z-index: 40;
}

/* Footer logo: real mark on a light plate — kill invert (white-on-white) */
html body .bu-pub-foot .bu-pub-foot-logo,
html body .bu-pub-foot .bu-pub-foot-logo .bu-brand-file,
html body .bu-pub-foot .bu-pub-foot-logo picture,
html body .bu-pub-foot .bu-pub-foot-logo-img-wrap {
  display: inline-flex !important;
  align-items: center;
  background: #fff !important;
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}
html body .bu-pub-foot .bu-pub-foot-logo img,
html body .bu-pub-foot .bu-pub-foot-logo-img,
html body .bu-pub-foot .bu-brand-file img,
html body .bu-foot .bu-foot-logo-img {
  display: block !important;
  max-height: 44px !important;
  width: auto !important;
  height: 40px !important;
  object-fit: contain !important;
  filter: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Tab bell — always visible, gold when watching, pulse when unread */
html body .bu-stab {
  overflow: visible !important;
}
html body .bu-stab-bell,
html body .bu-bell svg {
  width: 22px !important;
  height: 22px !important;
  color: #e2e8f0 !important;
  filter: none !important;
}
html body .bu-bell {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #1e293b;
  color: #f8fafc !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}
html body .bu-stab.is-on .bu-stab-bell {
  background: #0f172a;
  color: #fff !important;
  box-shadow: 0 0 0 2px #fff;
}
html body .bu-stab.watch .bu-stab-bell,
html body .bu-bell.has-new,
html body .bu-bell[aria-expanded="true"] {
  background: #f59e0b !important;
  color: #1c1917 !important;
  box-shadow: 0 0 0 2px #fff, 0 0 18px rgba(245, 158, 11, 0.9);
}
html body .bu-bell-n,
html body [data-bell-count] {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: #22c55e;
  color: #052e16 !important;
  font-size: 10px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px #0f172a;
}
html body .bu-bell.has-new .bu-bell-n,
html body .bu-stab.watch::after {
  animation: bu-bell-pulse 1.6s ease-out infinite;
}
@keyframes bu-bell-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Particles + reveal */
html body.bu-landing-page canvas.bu-fx-hero {
  opacity: 0.72 !important;
  mix-blend-mode: screen;
}
html body .bu-reveal {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(6px);
  animation: bu-reveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
html body .bu-reveal.is-in,
html.bu-fx-ready body .bu-pro-hero-inner,
html.bu-fx-ready body .bu-neon-hero-copy {
  opacity: 1;
  transform: none;
  filter: none;
}
@keyframes bu-reveal {
  to { opacity: 1; transform: none; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  html body .bu-reveal { opacity: 1; transform: none; filter: none; animation: none; }
}

/* Registration: bigger sticky columns */
html body.bu-auth-chrome .bu-reg-stage-wrap,
html body.bu-auth-chrome main.bu-join-wrap.bu-join-reg {
  max-width: 1360px !important;
  width: min(1360px, calc(100% - 20px)) !important;
}
html body.bu-auth-chrome .bu-reg-stage {
  grid-template-columns: 240px minmax(0, 1fr) 320px;
  gap: 20px;
}
html body.bu-auth-chrome .bu-reg-rail,
html body.bu-auth-chrome .bu-reg-doc {
  position: sticky !important;
  top: 76px !important;
  align-self: start;
}
html body.bu-auth-chrome .bu-join-card,
html body.bu-auth-chrome .bu-reg-form {
  min-height: 520px;
  padding: 22px 24px !important;
}
@media (max-width: 1100px) {
  html body.bu-auth-chrome .bu-reg-stage {
    grid-template-columns: 1fr;
  }
  html body.bu-auth-chrome .bu-reg-rail,
  html body.bu-auth-chrome .bu-reg-doc {
    position: relative !important;
    top: 0 !important;
  }
}

/* Early access 455/700 */
html body .bu-early {
  background: linear-gradient(135deg, #0f172a 0%, #0b6e86 48%, #c2410c 100%);
}
html body .bu-early-k { color: #fdba74; }
html body .bu-early-line { font-size: 16px; }
html body .bu-early-sub { margin: 0; font-size: 13px; opacity: 0.88; }

/* Nalog command center v4 */
html body.bu-nalog-page .bu-dash-v3 {
  gap: 16px;
}
html body.bu-nalog-page .bu-cc-hero {
  border-radius: 24px;
  padding: 24px 26px;
}
html body.bu-nalog-page .bu-cc-sys,
html body.bu-nalog-page .bu-cc-metrics,
html body.bu-nalog-page .bu-cc-ops {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
html body.bu-nalog-page .bu-cc-sys a,
html body.bu-nalog-page .bu-cc-metrics a,
html body.bu-nalog-page .bu-cc-metrics div,
html body.bu-nalog-page .bu-cc-ops a,
html body.bu-nalog-page .bu-cc-ops button {
  background: #fff;
  border: 1px solid #dbe4ee;
  border-radius: 16px;
  padding: 14px 16px;
  text-decoration: none;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}
html body.bu-nalog-page .bu-cc-sys a small,
html body.bu-nalog-page .bu-cc-metrics small {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
html body.bu-nalog-page .bu-cc-sys a strong,
html body.bu-nalog-page .bu-cc-metrics strong {
  font-size: 20px;
}
@media (max-width: 980px) {
  html body.bu-nalog-page .bu-cc-sys,
  html body.bu-nalog-page .bu-cc-metrics,
  html body.bu-nalog-page .bu-cc-ops {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  html body.bu-nalog-page .bu-cc-hero,
  html body.bu-nalog-page .bu-cc-sys,
  html body.bu-nalog-page .bu-cc-metrics,
  html body.bu-nalog-page .bu-cc-ops {
    grid-template-columns: 1fr;
  }
}

/* Chat */
html body .bu-chat-row.is-unread,
html body .bu-chat-notif.is-unread {
  background: #ecfdf5 !important;
  box-shadow: inset 3px 0 0 #16a34a;
}
html body .bu-chat-compose {
  display: flex;
  gap: 8px;
  padding: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
html body .bu-chat-compose input {
  flex: 1;
  min-height: 44px;
  border-radius: 12px;
}
@media (max-width: 720px) {
  html body .bu-chat-drawer {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Blog / article */
html body .bu-article-v65 {
  background: #f4efe4;
  color: #1a2332;
}
html body .bu-article-v65 .bu-article-hero-full {
  position: relative;
  min-height: 360px;
  overflow: hidden;
}
html body .bu-article-v65 .bu-article-hero-full img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
html body .bu-article-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 13px;
  color: #475569;
}
html body .bu-article-share {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
html body .bu-article-share a,
html body .bu-article-share button {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #dbe4ee;
  background: #fff;
  text-decoration: none;
  color: #0f172a;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
html body .bu-article-author {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e4d6c2;
  margin: 24px 0;
}
html body .bu-blog-read {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

@media (orientation: landscape) and (max-height: 500px) {
  html body.bu-product-page .bu-pro-hero { min-height: 240px; }
  html body.bu-auth-chrome .bu-reg-rail { position: relative !important; }
}
