/* Site navigation shared by the site, the cabinet and the terminal. Phone section strip (src/pages/SectionStrip.tsx): the eight sections in one row that scrolls sideways with a swipe,
   snapping to items, no scrollbar, a fading edge where more items wait, the current section brought into view by
   mountSectionStrip. Shown under the site and cabinet header below 1280 px and under the terminal header below 1200 px. */
.section-strip { display: none; }
.section-strip {
  --strip-ink: var(--color-ink, var(--it-text, #efefef));
  --strip-muted: var(--color-muted, var(--it-muted, #a1a1a1));
  --strip-rule: var(--color-rule, var(--it-soft-border, #262626));
  --strip-active: var(--color-ink, var(--it-text, #efefef));
  --strip-on-active: var(--color-paper, var(--it-bg, #0c0c0c));
  border-top: 1px solid var(--strip-rule);
}
.section-strip-track {
  display: flex; gap: 4px; padding: 6px 12px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  --fade-start: 0px; --fade-end: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent 100%);
}
.section-strip-track::-webkit-scrollbar { display: none; }
.section-strip-track[data-start="more"] { --fade-start: 28px; }
.section-strip-track[data-end="more"] { --fade-end: 36px; }
.section-strip-track > a {
  flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border-radius: 999px; color: var(--strip-muted); font-size: 14px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
}
.section-strip-track > a[aria-current] { background: var(--strip-active); color: var(--strip-on-active); font-weight: 600; }
.section-strip-track > a:focus-visible { outline: 2px solid var(--strip-ink); outline-offset: -2px; }
@media (hover: hover) { .section-strip-track > a:not([aria-current]):hover { color: var(--strip-ink); } }
/* The eight header links need about 1280 px beside the account and «Купить челлендж»: narrower screens get the strip
   and the menu button instead (the menu keeps the account and the purchase). */
@media (max-width: 1279px) {
  html[data-bm-site] .section-strip { display: block; }
  html[data-bm-site] .site-header .desktop-nav { display: none; }
  html[data-bm-site] .site-header .menu-button { display: block; }
}
@media (min-width: 1280px) { html[data-bm-site] .site-header .desktop-nav { margin-inline: 24px auto; gap: 24px; } }
@media (max-width: 639px) { html[data-bm-site] .site-header .login-account { display: none; } }
/* In the terminal the strip replaces the header's Торговля/Рынки buttons below 1200 px, so nothing shows twice. */
@media (max-width: 1199px) { .it-app .section-strip { display: block; } .it-app .it-top-nav { display: none; } }
@media (prefers-reduced-motion: no-preference) { .section-strip-track { scroll-behavior: smooth; } }

/* Header account (SiteHeader): the picture or the first letter beside the nickname, on site and cabinet pages. */
html[data-bm-site] .login-account { display: inline-flex; align-items: center; gap: 8px; max-width: 200px; }
html[data-bm-site] .login-account > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-bm-site] .login-account .avatar { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--color-paper-3); border: 1px solid var(--color-rule); color: var(--color-ink); font-size: 12px; font-weight: 600; }

/* Header instrument search (SiteHeader): a 40 px icon that opens leftwards into a field on focus, no script; it sends
   q to /trade, which opens the terminal's market list filtered by it. Desktop only; the phone menu has a wide field. */
html[data-bm-site] .header-search { position: relative; flex: none; width: 40px; height: 40px; }
html[data-bm-site] .header-search input {
  position: absolute; top: 0; right: 0; z-index: 2; width: 40px; height: 40px; min-height: 40px; padding: 0 38px 0 0; margin: 0;
  border: 1px solid var(--color-rule); border-radius: 999px; background: var(--color-paper-2); color: var(--color-ink); font-size: 14px; cursor: pointer;
  transition: width 180ms var(--ease-out, ease-out), padding 180ms var(--ease-out, ease-out);
}
html[data-bm-site] .header-search input:focus { width: 240px; padding-left: 16px; border-color: var(--color-ink); outline: 2px solid var(--color-ink); outline-offset: 1px; cursor: text; background: var(--color-surface); }
html[data-bm-site] .header-search input::-webkit-search-cancel-button { display: none; }
html[data-bm-site] .header-search svg { position: absolute; top: 11px; right: 11px; z-index: 3; width: 18px; height: 18px; fill: none; stroke: var(--color-ink); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
html[data-bm-site] .header-search-wide { width: auto; grid-column: 1 / -1; }
html[data-bm-site] .header-search-wide input { position: static; width: 100%; height: 44px; padding: 0 44px 0 16px; cursor: text; background: var(--color-surface); }
html[data-bm-site] .header-search-wide svg { top: 13px; right: 14px; }
@media (max-width: 1279px) { html[data-bm-site] .header-actions > .header-search { display: none; } }
@media (prefers-reduced-motion: reduce) { html[data-bm-site] .header-search input { transition: none; } }

/* Admin shield (SiteHeader, task 502): only in an admin's header, first of the header actions, so on a phone it sits in
   the gap between the mark and the language menu. Just the icon (Евгений А., 13.11.2026: no frame around it), centred
   in a 44 px tap target that lines up with the language menu and the theme toggle; the cabinet's generic summary rule
   (space-between, padding, min-height) is reset here. */
html[data-bm-site] .admin-shield { position: relative; flex: none; display: flex; align-items: center; align-self: center; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
html[data-bm-site] .admin-shield > summary { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 44px; height: 44px; min-height: 0; max-height: 44px; margin: 0; padding: 0; border: 0; border-radius: var(--tl-radius, 12px); background: transparent; box-shadow: none; color: var(--color-ink); list-style: none; cursor: pointer; }
html[data-bm-site] .admin-shield > summary::-webkit-details-marker { display: none; }
html[data-bm-site] .admin-shield > summary::before, html[data-bm-site] .admin-shield > summary::after { content: none; display: none; }
html[data-bm-site] .admin-shield > summary:hover, html[data-bm-site] .admin-shield[open] > summary { opacity: 0.75; background: transparent; }
html[data-bm-site] .admin-shield > summary:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }
html[data-bm-site] .admin-shield > summary svg { display: block; flex: none; width: 22px; height: 22px; margin: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
html[data-bm-site] .admin-shield > nav { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; min-width: 220px; padding: 6px; border: 1px solid var(--color-rule); border-radius: var(--tl-radius, 12px); background: var(--color-surface); box-shadow: 0 8px 24px var(--color-shadow); }
html[data-bm-site] .admin-shield > nav a { display: flex; align-items: center; min-height: 44px; box-sizing: border-box; padding: 10px; border-radius: 8px; color: var(--color-ink); text-decoration: none; font-size: 14px; white-space: nowrap; }
html[data-bm-site] .admin-shield > nav a:hover, html[data-bm-site] .admin-shield > nav a:focus-visible { background: var(--color-paper-2); }
/* The shield takes 44 px of the header row: on screens up to 1439 px an admin's header keeps the avatar and hides the
   nickname beside it (still read out by screen readers), so the theme toggle stays on the screen. */
@media (max-width: 1439px) { html[data-bm-site] .header-actions:has(> .admin-shield) .login-account > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
@media (max-width: 639px) { html[data-bm-site] .admin-shield > nav { right: auto; left: 50%; transform: translateX(-50%); } }

/* The active shield uses the same ink and fine underline as the section links. */
html[data-bm-site] .admin-shield > summary[aria-current] { position: relative; }
html[data-bm-site] .admin-shield > summary[aria-current]::after { content: ""; display: block; position: absolute; bottom: 4px; left: 50%; width: 22px; height: 1px; transform: translateX(-50%); background: currentColor; }
/* Make room for the shield's 44 px target in a narrow admin header. */
@media (max-width: 639px) { html[data-bm-site] .header-inner:has(.admin-shield) > .brand > span { display: none; } }
