/* Shared navigation frame. Page-specific forms, cards and actions keep their styles. */
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-footer .hfn-footer-monitoring{width:100%;margin:0 0 10px;border:1px solid #304553;border-radius:9px;background:#122330;color:#bfe0ed;cursor:pointer}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail:not(.is-expanded) .hfn-footer-monitoring{width:100%;padding:8px 0;justify-content:center}
@media(max-width:700px){
 :is(.helper-unified-page,.faq-unified-page) .hfn-mobile{position:fixed;left:10px;bottom:14px;z-index:139;width:44px;height:44px;border:1px solid #466878;border-radius:12px;background:#102532;box-shadow:0 4px 18px #0006}
 :is(.helper-unified-page,.faq-unified-page) .hfn-mobile svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
}
body:has(.helper-unified-page) .helper-nav-wrap{display:none!important}
body:has(.helper-unified-page) :is(.console-side-rail,.gh-s5-base-rail,.room-console-side-rail,.hp44-rail,.inv36-base,.mp3-side,#ghRailProfile){display:none!important}
.helper-unified-page{width:100%;min-height:100vh;position:relative;isolation:isolate}
.helper-unified-page .hfn-workspace{min-width:0;z-index:auto}
@media(min-width:1251px){.helper-unified-page.hfn-game-page .gamehub{height:100svh!important;min-height:0!important}}

/* Game pages paint a full-bleed backdrop on their own root element instead of on
   the body. Keeping the rail offset on .hfn-workspace would clip that backdrop and
   expose a bare strip of shell background beside the floating rail, so here the
   offset moves onto the page root: the backdrop still runs under the rail while the
   content shifts exactly as much as it does on every other page. Each of these roots
   also carries its own legacy offset from the era of a permanently collapsed rail,
   and these rules are the single place that value is now decided. */
.helper-unified-page.hfn-game-page .hfn-workspace{margin-left:0}
.helper-unified-page.hfn-game-page .hfn-topbar{margin-left:136px}
/* HELPER_BASE_SPACING_R1
   Shared game-page offset: floating rail + an 8px visual gap. */
.helper-unified-page.hfn-game-page :is(.gamehub,.gp3-page,#marketplaceRoot,.gi2-page,#gameRoomStage,.lbd){padding-left:94px!important}
.helper-unified-page.hfn-game-page.hfn-expanded.hfn-pinned .hfn-workspace{margin-left:0}
.helper-unified-page.hfn-game-page.hfn-expanded.hfn-pinned .hfn-topbar{margin-left:346px}
.helper-unified-page.hfn-game-page.hfn-expanded.hfn-pinned :is(.gamehub,.gp3-page,#marketplaceRoot,.gi2-page,#gameRoomStage,.lbd){padding-left:302px!important}
/* The marketplace sidebar is a second rail beside the shared one, so it is dropped
   together with the column it occupied; its categories and trade tabs are mirrored
   into the shared rail by the navigation script. */
.helper-unified-page #marketplaceRoot .mpx-app{display:block!important;grid-template-columns:none!important}
.helper-unified-page #marketplaceRoot .mpx-workspace{margin-left:0!important}
/* <main> stays transparent so the page root is the only surface painting a backdrop. */
.helper-unified-page .helper-main:has(#marketplaceRoot){background:transparent!important}
@media(max-width:700px){
 .helper-unified-page.hfn-game-page .hfn-topbar,.helper-unified-page.hfn-game-page.hfn-expanded.hfn-pinned .hfn-topbar{margin-left:16px}
 .helper-unified-page.hfn-game-page :is(.gamehub,.gp3-page,#marketplaceRoot,.gi2-page,#gameRoomStage,.lbd),.helper-unified-page.hfn-game-page.hfn-expanded.hfn-pinned :is(.gamehub,.gp3-page,#marketplaceRoot,.gi2-page,#gameRoomStage,.lbd){padding-left:12px!important}
}

/* Counts mirrored from the page keep their place at the end of a rail row. */
:is(.helper-unified-page,.faq-unified-page) .hfn-item .hfn-count{margin-left:auto;padding:2px 7px;border-radius:6px;background:#ffffff0d;color:#9fb6c6;font:600 10px/1.4 'Segoe UI',sans-serif;font-style:normal}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail:not(.is-expanded) .hfn-item .hfn-count{display:none}
.helper-unified-page .hfn-topbar{position:relative;z-index:10}
.helper-unified-page main.helper-main{min-height:100vh}
.helper-unified-page main.helper-main>:is(section,div):not([class*="modal"]):not([id*="Modal"]){max-width:100%!important}
.helper-unified-page main.helper-main>:is([data-console-rail],.landing-console-v1,.game-hub-page,.game-room-stage){width:100%!important;margin-left:0!important;padding-left:20px!important;padding-right:20px!important}
:is(.helper-unified-page,.faq-unified-page) :is(.hfn-rail,.hfn-rail *,.hfn-topbar,.hfn-topbar *){box-sizing:border-box;min-width:0}
:is(.helper-unified-page,.faq-unified-page) .hfn-group>p{margin:10px 0 5px;line-height:1.3}
:is(.helper-unified-page,.faq-unified-page) .hfn-nav-row{display:flex;align-items:center;gap:2px}
:is(.helper-unified-page,.faq-unified-page) .hfn-nav-row>.hfn-item{flex:1;min-width:0}
:is(.helper-unified-page,.faq-unified-page) .hfn-favorite-toggle{display:grid;place-items:center;flex:0 0 28px;width:28px;height:32px;border:0;border-radius:6px;padding:5px;background:transparent;color:#788e9f;cursor:pointer;font:20px/1 Arial,sans-serif}
:is(.helper-unified-page,.faq-unified-page) .hfn-favorite-toggle svg{width:17px;height:17px}
:is(.helper-unified-page,.faq-unified-page) .hfn-favorite-toggle:hover{background:#ffffff0a;color:#b6eff9}
:is(.helper-unified-page,.faq-unified-page) .hfn-favorite-toggle[aria-pressed=true]{color:#77e5f4}
:is(.helper-unified-page,.faq-unified-page) .hfn-favorite-toggle[aria-pressed=true] svg{fill:#77e5f440}
:is(.helper-unified-page,.faq-unified-page) .hfn-favorite-toggle:disabled{opacity:.4;cursor:default}
:is(.helper-unified-page,.faq-unified-page) .hfn-favorites-empty{display:block;padding:4px 12px 8px;color:#91a7b8;font:11px/1.5 'Segoe UI',sans-serif}
:is(.helper-unified-page,.faq-unified-page) .hfn-favorite-mark{display:grid;place-items:center;flex:0 0 20px;width:20px;color:#77e5f4}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail:not(.is-expanded) :is(.hfn-favorite-toggle,.hfn-favorites-empty){display:none}
:is(.helper-unified-page,.faq-unified-page) .hfn-topbar-actions{display:flex;align-items:center;gap:10px;margin-left:auto;flex-shrink:0}
:is(.helper-unified-page,.faq-unified-page) .hfn-dashboard-top{display:flex;align-items:center;justify-content:center;gap:9px;min-height:36px;padding:8px 12px;border:1px solid #43818e;border-radius:8px;background:linear-gradient(135deg,#224854,#142d3c);color:#e0fbff;font:600 12px/1.2 'Segoe UI',sans-serif;text-decoration:none;box-shadow:inset 0 1px 0 #a7edff12}
:is(.helper-unified-page,.faq-unified-page) .hfn-dashboard-top svg{width:18px;height:18px;color:#90e9f4}
:is(.helper-unified-page,.faq-unified-page) .hfn-dashboard{padding:11px 8px;border:1px solid #3e6b79;background:linear-gradient(135deg,#1c3a46,#102331);box-shadow:inset 0 1px 0 #a7edff12}
:is(.helper-unified-page,.faq-unified-page) .hfn-dashboard:hover{background:#204554;border-color:#76bdca}
:is(.helper-unified-page,.faq-unified-page) .hfn-dashboard .hfn-profile-copy{white-space:normal;gap:5px;flex:1}
:is(.helper-unified-page,.faq-unified-page) .hfn-dashboard .hfn-profile-copy b{font:600 12px/1.35 'Segoe UI',sans-serif;color:#e7faff}
:is(.helper-unified-page,.faq-unified-page) .hfn-dashboard .hfn-profile-copy small{font:10px/1.3 'Segoe UI',sans-serif;color:#9bbcca}
:is(.helper-unified-page,.faq-unified-page) .hfn-dashboard .hfn-avatar{flex-basis:30px;width:30px;height:32px}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail:not(.is-expanded) .hfn-dashboard{padding:4px 0;border:0;background:none;box-shadow:none}
:is(.helper-unified-page,.faq-unified-page) .hfn-breadcrumbs strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:40vw}
@media(max-width:700px){
 .helper-unified-page main.helper-main>:is([data-console-rail],.landing-console-v1,.game-hub-page,.game-room-stage){padding-left:12px!important;padding-right:12px!important}
 :is(.helper-unified-page,.faq-unified-page) .hfn-topbar-actions{gap:6px}
 :is(.helper-unified-page,.faq-unified-page) .hfn-dashboard-top{min-height:36px;padding:8px;font-size:0;gap:0}
 :is(.helper-unified-page,.faq-unified-page) .hfn-dashboard-top span{display:none}
 :is(.helper-unified-page,.faq-unified-page) .hfn-breadcrumbs{flex:1}
}

/* Compact shared menu; keep comfortable touch targets on phones. */
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-item{height:34px;margin:1px 0;padding-inline:11px;gap:10px;font-size:12px;font-weight:500;line-height:1.3}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-item svg{width:18px;height:18px}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-group>p{height:20px;margin:7px 0 3px;font-size:8px;letter-spacing:.09em}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-group+.hfn-group{margin-top:8px}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-group[hidden]{display:none!important}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-favorite-toggle{height:30px;flex-basis:26px;width:26px}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-item.is-active:before{top:10px;bottom:10px}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-favorites-empty{font-size:10px;padding-bottom:5px}
@media(max-width:700px){
 :is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-item{height:40px}
 :is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-favorite-toggle{height:36px;flex-basis:32px;width:32px}
}

/* HELPER_BASE_EDGE_GAP_R2 START */
/*
  Base rail geometry:
  closed: left 14 + width 72 = right edge 86
  pinned: left 14 + width 280 = right edge 294
  Keep only a 4px visual gap between rail and page content.
*/
@media (min-width: 701px) {
  body.helper-unified-page .hfn-workspace,
  body.faq-unified-page .hfn-workspace {
    margin-left: 90px !important;
  }

  body.helper-unified-page.hfn-expanded.hfn-pinned .hfn-workspace,
  body.faq-unified-page.hfn-expanded.hfn-pinned .hfn-workspace {
    margin-left: 298px !important;
  }

  body.helper-unified-page.hfn-game-page .hfn-workspace {
    margin-left: 0 !important;
  }

  body.helper-unified-page.hfn-game-page .hfn-topbar {
    margin-left: 90px !important;
  }

  body.helper-unified-page.hfn-game-page.hfn-expanded.hfn-pinned .hfn-topbar {
    margin-left: 298px !important;
  }

  body.helper-unified-page.hfn-game-page :is(
    .gamehub,
    .gp3-page,
    #marketplaceRoot,
    .gi2-page,
    #gameRoomStage,
    .pi-page
  ) {
    box-sizing: border-box !important;
    padding-left: 90px !important;
  }

  body.helper-unified-page.hfn-game-page.hfn-expanded.hfn-pinned :is(
    .gamehub,
    .gp3-page,
    #marketplaceRoot,
    .gi2-page,
    #gameRoomStage,
    .pi-page
  ) {
    padding-left: 298px !important;
  }

  body.helper-unified-page.hfn-game-page .gi2-page.invx-page,
  body.helper-unified-page.hfn-game-page .gp3-page[data-hp51-page],
  body.helper-unified-page.hfn-game-page .gp3-page[data-hp49-index-bg],
  body.helper-unified-page.hfn-game-page .pi-page[data-hp52-page],
  body.helper-unified-page.hfn-game-page.helper-room-stage2a #gameRoomStage {
    padding-left: 90px !important;
  }

  body.helper-unified-page.hfn-game-page.hfn-expanded.hfn-pinned .gi2-page.invx-page,
  body.helper-unified-page.hfn-game-page.hfn-expanded.hfn-pinned .gp3-page[data-hp51-page],
  body.helper-unified-page.hfn-game-page.hfn-expanded.hfn-pinned .gp3-page[data-hp49-index-bg],
  body.helper-unified-page.hfn-game-page.hfn-expanded.hfn-pinned .pi-page[data-hp52-page],
  body.helper-unified-page.hfn-game-page.hfn-expanded.hfn-pinned.helper-room-stage2a #gameRoomStage {
    padding-left: 298px !important;
  }

  body.helper-unified-page.hfn-game-page .gi2-page .gi2-shell {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.helper-unified-page.hfn-game-page .pi-page .pi-shell {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.helper-unified-page.hfn-game-page #marketplaceRoot .mpx-workspace {
    margin-left: 0 !important;
  }
}
/* HELPER_BASE_EDGE_GAP_R2 END */

/* HELPER_BASE_RAIL_C_R1 START
   The chosen rail direction: the list stays complete, but it gains a filter and
   groups that fold, and the footer collapses three different treatments into one
   identity card plus a row of two controls. The geometry of the rail and of the
   workspace offset is untouched; this block only decides appearance. */

/* --- filter ---------------------------------------------------------------- */
:is(.helper-unified-page,.faq-unified-page) .hfn-search{display:flex;align-items:center;gap:8px;height:34px;margin:0 12px 8px;padding:0 11px;border:1px solid #27333f;border-radius:9px;background:#0a121a;transition:border-color .16s ease,background .16s ease}
:is(.helper-unified-page,.faq-unified-page) .hfn-search:focus-within,
:is(.helper-unified-page,.faq-unified-page) .hfn-search.is-searching{border-color:#3c6b80;background:#0c1722}
:is(.helper-unified-page,.faq-unified-page) .hfn-search input{flex:1;min-width:0;height:100%;border:0;padding:0;background:none;color:#d8e6f1;font:12px/1 inherit;outline:none;appearance:none}
:is(.helper-unified-page,.faq-unified-page) .hfn-search input::placeholder{color:#6f8497}
:is(.helper-unified-page,.faq-unified-page) .hfn-search input::-webkit-search-cancel-button{appearance:none}
:is(.helper-unified-page,.faq-unified-page) .hfn-search kbd{flex:0 0 auto;padding:2px 6px;border:1px solid #2b3846;border-radius:4px;color:#5f7487;font:600 9px/1 ui-monospace,'Cascadia Mono',monospace}
:is(.helper-unified-page,.faq-unified-page) .hfn-search.is-searching kbd{display:none}
:is(.helper-unified-page,.faq-unified-page) .hfn-search-empty{margin:6px 0 0;padding:0 12px;color:#7f93a6;font-size:11px}
:is(.helper-unified-page,.faq-unified-page) .hfn-filtered-out{display:none!important}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail:not(.is-expanded) :is(.hfn-search,.hfn-search-empty){display:none}

/* --- folding groups -------------------------------------------------------- */
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-group>p{padding:0}
:is(.helper-unified-page,.faq-unified-page) .hfn-group-toggle{display:flex;align-items:center;gap:8px;width:100%;height:100%;padding:0 12px;border:0;background:none;color:inherit;font:inherit;letter-spacing:inherit;text-transform:inherit;text-align:left;cursor:pointer;transition:color .15s ease}
:is(.helper-unified-page,.faq-unified-page) .hfn-group-toggle:hover{color:#cfe3f0}
/* The chevron is drawn from borders so the rail needs no new icon asset. */
:is(.helper-unified-page,.faq-unified-page) .hfn-group-toggle::after{content:"";flex:0 0 auto;width:5px;height:5px;margin-left:auto;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg);opacity:.7;transition:transform .18s ease}
:is(.helper-unified-page,.faq-unified-page) .hfn-group-toggle[aria-expanded=false]::after{transform:translateY(0) rotate(-45deg)}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail.is-expanded .hfn-group.is-closed>:not(p){display:none}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail:not(.is-expanded) .hfn-group-toggle{display:none}

/* --- rows ------------------------------------------------------------------ */
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-item{height:35px;border-radius:8px}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-item.is-active{background:#54def512;color:#dff4fa;box-shadow:none}
/* A page-section row and a site row used to look identically active, so the
   index showed two "Главная" rows lit at once. Sections now read as secondary. */
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-item[data-page-section]{color:#9db0c1}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-item[data-page-section].is-active{background:none;color:#d7e5ef}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-item[data-page-section].is-active:before{width:2px;background:#54def566;box-shadow:none}

/* --- footer ---------------------------------------------------------------- */
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-footer{margin:0;padding:10px 12px 12px;border-top:1px solid #1e2935;background:#0a1019}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-dashboard{padding:8px 9px;border:1px solid #2c3e4c;border-radius:10px;background:#101b25;box-shadow:none}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-dashboard:hover{border-color:#3c5a6c;background:#16242f}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-dashboard .hfn-avatar{overflow:hidden;font:600 13px/1 inherit}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail .hfn-dashboard .hfn-avatar img{width:100%;height:100%;display:block;object-fit:cover}
:is(.helper-unified-page,.faq-unified-page) .hfn-online{flex:0 0 7px;width:7px;height:7px;margin-left:auto;border-radius:50%;background:#3ce6a0;box-shadow:0 0 7px #3ce6a0}
:is(.helper-unified-page,.faq-unified-page) .hfn-quick{display:flex;gap:6px;margin-top:9px}
:is(.helper-unified-page,.faq-unified-page) .hfn-quick>*{flex:1;min-width:0;height:32px;margin:0;padding:0 8px;display:flex;align-items:center;justify-content:center;gap:7px;border:1px solid #26333f;border-radius:8px;background:#0e1721;color:#93a9ba;font-size:11px;font-weight:500;white-space:nowrap}
:is(.helper-unified-page,.faq-unified-page) .hfn-quick>*:hover{border-color:#35485a;color:#d3e4ef}
:is(.helper-unified-page,.faq-unified-page) .hfn-quick svg{width:16px;height:16px}
:is(.helper-unified-page,.faq-unified-page) .hfn-pin[aria-pressed=true]{border-color:#54def544;background:#54def50d;color:#9fe9f6}
:is(.helper-unified-page,.faq-unified-page) .hfn-pin i{margin-left:0}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail:not(.is-expanded) .hfn-quick{flex-direction:column;gap:6px}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail:not(.is-expanded) .hfn-quick>*{padding:0}
:is(.helper-unified-page,.faq-unified-page) .hfn-rail:not(.is-expanded) .hfn-online{display:none}
/* HELPER_BASE_RAIL_C_R1 END */

/* HELPER_BASE_RAIL_C_R1 PATCH
   Pages carry a global `.helper-main input { ... !important }` skin for their own
   forms. The rail is chrome, not page content, so its filter opts out of it. */
:is(.helper-unified-page,.faq-unified-page) .hfn-search input#hfnSearch{height:100%!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important;color:#d8e6f1!important;font-size:12px!important;line-height:1!important}
/* Phones never shift the page for the rail, so the pin has nothing to hold. */
@media(max-width:700px){:is(.helper-unified-page,.faq-unified-page) .hfn-quick .hfn-pin{display:none}}
