/* Header-only override. Load after the existing desktop and mobile styles.
   React-owned nodes and the ownerHoldBrand entry point stay in place.
   Equal outer tracks center the title + .RU against the full header width;
   the logo occupies the left track without shifting the title.
   Visibility of headActions/tvm-head is inherited from the existing CSS. */
html:root:root body .site header .wrap.header {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  gap: 8px 0 !important;
  min-height: 0 !important;
  padding-block: 10px !important;
  padding-inline: 0 !important;
  box-sizing: border-box !important;
}

html:root:root body .site header .wrap.header > .brand.ownerHoldBrand {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  display: grid !important;
  justify-items: stretch !important;
  align-content: center !important;
  gap: 5px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  text-align: center !important;
  position: relative !important;
}

html:root:root body .site header .wrap.header > .brand.ownerHoldBrand > .brandLine {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content max-content minmax(0, 1fr) !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

html:root:root body .site header .wrap.header > .brand.ownerHoldBrand > .brandLine > .qualityShield {
  grid-column: 1 !important;
  grid-row: 1 !important;
  justify-self: start !important;
  align-self: center !important;
  display: block !important;
  width: 44px !important;
  height: 48px !important;
  max-width: none !important;
  object-fit: contain !important;
  margin: 0 !important;
}

html:root:root body .site header .wrap.header > .brand.ownerHoldBrand > .brandLine > b {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: block !important;
  min-width: 0 !important;
  margin: 0 !important;
  font-size: clamp(18px, 2.2vw, 30px) !important;
  line-height: 1.15 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  transform: none !important;
}

html:root:root body .site header .wrap.header > .brand.ownerHoldBrand > .brandLine > .brandRu {
  grid-column: 3 !important;
  grid-row: 1 !important;
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 29px !important;
  height: 29px !important;
  padding: 0 5px !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  box-sizing: border-box !important;
  transform: none !important;
}

html:root:root body .site header .wrap.header > .brand.ownerHoldBrand > .brandSubtitle {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: center !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

html:root:root body .site header .wrap.header > .headActions,
html:root:root body .site header .wrap.header > .tvm-head {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  position: relative !important;
  inset: auto !important;
  justify-self: end !important;
  justify-content: flex-end !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  gap: 6px !important;
  z-index: 1;
}

@media (max-width: 599px) {
  html:root:root body .site header .wrap.header > .brand.ownerHoldBrand > .brandLine {
    gap: 4px !important;
  }
  html:root:root body .site header .wrap.header > .brand.ownerHoldBrand > .brandLine > .qualityShield {
    width: 30px !important;
    height: 34px !important;
  }
  html:root:root body .site header .wrap.header > .brand.ownerHoldBrand > .brandLine > .brandRu {
    min-width: 27px !important;
    height: 25px !important;
    padding-inline: 4px !important;
    font-size: 12px !important;
  }
}

/* Only wide screens share the first row with the desktop action group.
   Its own grid column constrains long account names and wraps controls. */
@media (min-width: 1600px) {
  html:root:root body .site header .wrap.header {
    grid-template-rows: auto !important;
    min-height: 76px !important;
  }
  html:root:root body .site header .wrap.header > .headActions {
    grid-column: 3 !important;
    grid-row: 1 !important;
    align-self: center !important;
  }
}

/* Community destinations in sidebar; sharing/search actions in the bottom footer. */
html:root:root body #root .homeRightColumn > .socialLinks.tvShareSource{display:none!important}
#tvGroupsSide{box-sizing:border-box;width:100%;padding:12px;border:1px solid var(--line,#c7d8d2);border-radius:12px;order:20}
#tvGroupsSide h2{margin:0 0 10px;font:700 14px/1.3 system-ui,sans-serif}
#tvGroupsSide .tvGroups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}
#tvGroupsSide .tvGroups a{box-sizing:border-box;display:flex;flex-direction:column;gap:5px;justify-content:center;align-items:center;width:auto;min-width:0;height:auto;min-height:60px;padding:7px 2px;border-radius:10px;border:1px solid rgba(255,255,255,.8);text-decoration:none;color:#fff;box-shadow:none}
#tvGroupsSide .tvGroups a svg{width:22px;height:22px;flex:none}
#tvGroupsSide .tvGroups a span{font:600 10px/1.2 system-ui,sans-serif;max-width:100%;text-align:center;overflow-wrap:anywhere}
#tvShareFoot{max-width:1280px;margin:16px auto 0;padding:0 16px;box-sizing:border-box;text-align:center}
#tvShareFoot .socialLinks{display:flex!important;align-items:center;justify-content:center;flex-wrap:wrap!important;width:100%!important;gap:8px!important;margin:12px 0!important}
#tvShareFoot .socialLinksCaption{display:block!important;position:static!important;width:100%!important;height:auto!important;clip-path:none!important;overflow:visible!important;margin:0 0 3px!important;font:600 12px/1.4 system-ui,sans-serif}
#tvShareFoot .socialLink,#tvShareFoot .tvm-sysshare{display:inline-flex!important;position:relative;width:44px!important;height:44px!important;min-height:44px!important;flex:0 0 44px!important;border-radius:50%!important;padding:0!important;align-items:center;justify-content:center}
#tvShareFoot .socialIcon{display:inline-flex;width:23px;height:23px;align-items:center;justify-content:center}
#tvShareFoot .socialIcon svg,#tvShareFoot .socialIcon img{width:23px;height:23px;max-width:100%;max-height:100%}
#tvShareFoot .socialLink>span:last-child,#tvShareFoot .tvm-sysshare>span{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap}
@media(max-width:899px){#tvGroupsSide .tvGroups{grid-template-columns:repeat(4,minmax(0,1fr))}#tvGroupsSide .tvGroups a{min-height:62px}#tvGroupsSide{padding:12px}}
