/* Shared masthead for React and standalone cryptography tools. */
.site-chrome,
.topbar.site-chrome {
  --header-height: 78px;
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  padding: 0 clamp(22px, 4vw, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  background: #f0eee6f2;
  color: #242620;
  border-bottom: 1px solid #25291f33;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  font-family: var(--font-sans);
}
.site-chrome .brand {
  display: flex;
  justify-self: start;
  align-items: center;
  gap: 9px;
  letter-spacing: normal;
  color: inherit;
  text-decoration: none;
}
.site-chrome .brand-mark {
  display: block;
  width: 33px;
  height: 33px;
  filter: none;
}
.site-chrome .brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.site-chrome .brand strong {
  display: flex;
  align-items: center;
  font-size: 21px;
  gap: 12px;
  letter-spacing: 0;
}
.site-chrome .brand strong span {
  font:
    12px/1.4 Arial,
    "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0.04em;
  color: #6b7065;
}
.site-chrome .desktop-nav {
  display: flex;
  justify-self: center;
  align-items: center;
  margin: 0;
  gap: 27px;
}
.site-chrome .desktop-nav > a {
  color: #454a40;
  white-space: nowrap;
  position: relative;
  padding: 28px 0;
  font-size: var(--type-ui);
  font-weight: 550;
  text-decoration: none;
}
.site-chrome .desktop-nav > a:after {
  position: absolute;
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2447dd;
  bottom: 15px;
  left: calc(50% - 2px);
  transform: scale(0);
  transition: transform 0.2s;
}
.site-chrome .desktop-nav > a[aria-current]:after,
.site-chrome .desktop-nav > a:hover:after {
  transform: scale(1);
}
.site-chrome
  .desktop-nav
  > a:is(
    [href="/models"],
    [href="/storybook"],
    [href="/archive"],
    [href="/pqc-arsenal"]
  ) {
  display: none;
}
.site-chrome .chrome-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.site-chrome .motion-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6b7065;
  border: 0;
  background: transparent;
  font-size: 10px;
  padding: 8px 0;
}
.site-chrome .equalizer {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 15px;
}
.site-chrome .equalizer i {
  background: #2447dd;
  width: 2px;
}
.site-chrome .equalizer i:nth-child(1) {
  height: 5px;
}
.site-chrome .equalizer i:nth-child(2) {
  height: 11px;
}
.site-chrome .equalizer i:nth-child(3) {
  height: 7px;
}
.site-chrome .menu-toggle {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 15px;
  width: auto;
  height: 39px;
  min-width: 84px;
  border: 1px solid #242620;
  background: #242620;
  color: #f0eee6;
  border-radius: 30px;
  padding: 0 15px;
  font-size: 12px;
  cursor: pointer;
}
.site-chrome .menu-toggle > span {
  width: auto;
  height: auto;
  background: none;
  transform: none;
}
.site-chrome .menu-toggle i {
  font: 400 21px/1 Arial;
  font-style: normal;
}
.site-chrome .runtime {
  font-size: 10px;
  color: #6b7065;
  white-space: nowrap;
}
.site-chrome .runtime i {
  background: #2447dd;
}
.practice-mobile-menu[hidden] {
  display: none;
}
.practice-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 35px clamp(24px, 8vw, 140px);
  background: #2447dd;
  color: #f0eee6;
  border: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.practice-mobile-menu::backdrop {
  background: #182785aa;
}
.practice-menu-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0eee650;
  padding-bottom: 24px;
  font-size: 12px;
}
.practice-menu-top button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 12px;
  cursor: pointer;
}
.practice-mobile-menu nav {
  display: grid;
  padding-top: 20px;
}
.practice-mobile-menu nav a {
  display: flex;
  padding: 15px 0;
  border-bottom: 1px solid #f0eee64d;
  color: #f0eee6;
  font-size: clamp(25px, 3vw, 46px);
  text-decoration: none;
}
.practice-mobile-menu nav a:before {
  content: "";
  font-size: 0.6em;
  margin-right: 25px;
  align-self: center;
}
.practice-mobile-menu nav a[aria-current] {
  opacity: 0.5;
}
.practice-mobile-menu :focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}
@media (max-width: 1200px) {
  .site-chrome,
  .topbar.site-chrome {
    --header-height: 70px;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .site-chrome .desktop-nav {
    display: none;
  }
  .site-chrome .brand strong {
    font-size: 19px;
  }
  .site-chrome .chrome-actions {
    gap: 12px;
  }
}
@media (max-width: 600px) {
  .site-chrome,
  .topbar.site-chrome {
    --header-height: 66px;
  }
  .site-chrome .brand-mark {
    width: 27px;
    height: 27px;
  }
  .site-chrome .brand strong {
    font-size: 18px;
  }
  .site-chrome .brand strong span {
    display: none;
  }
  .site-chrome .chrome-actions {
    gap: 9px;
  }
  .site-chrome .motion-switch > span:last-child {
    display: none;
  }
  .site-chrome .menu-toggle {
    min-width: 73px;
    height: 35px;
    gap: 10px;
    padding: 0 12px;
  }
  .site-chrome .runtime {
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .site-chrome .jump-trigger {
    padding: 6px 10px;
  }
  .site-chrome .jump-trigger kbd {
    display: none;
  }
}

/* A non-modal settings dropdown shared by React and the standalone laboratory. */
.site-settings { position: relative; }
.site-settings-panel[hidden] { display: none; }
.site-settings-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 120; width: 300px; max-width: calc(100vw - 32px); padding: 20px; border: 1px solid var(--theme-border); border-radius: 12px; background: var(--theme-surface); color: var(--theme-ink); box-shadow: 0 12px 36px var(--theme-shadow); }
.site-settings-panel h2 { margin: 0 0 12px; font-size: 15px; line-height: 1.5; font-weight: 650; }
.settings-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; font-size: 14px; }
.settings-row > span { color: var(--theme-ink); white-space: nowrap; }
.settings-row + .settings-row { border-top: 1px solid var(--theme-border); }
.site-settings-panel p { margin: 10px 0 0; font-size: 12px; line-height: 1.8; color: var(--theme-muted); }
html .site-settings-panel .theme-picker select { width: 132px; }
.settings-motion { min-height: 44px; padding: 10px 16px; border: 1px solid var(--theme-control-border); border-radius: 8px; background: var(--theme-bg); color: var(--theme-ink); font: inherit; font-size: 13px; cursor: pointer; }
.settings-motion:focus-visible,.site-settings-panel :focus-visible { outline: 2px solid var(--theme-accent); outline-offset: 3px; }
html .site-chrome .site-settings .menu-toggle { gap: 8px; line-height: 1; }
html .site-chrome .site-settings .menu-toggle > span { display: block; line-height: 1.4; }
.site-settings .settings-chevron { display: block; width: 14px; height: 14px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.site-settings .menu-toggle[aria-expanded=true] .settings-chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .site-settings .settings-chevron { transition: none; } }
.practice-search { display: grid; gap: 8px; margin-top: 24px; color: var(--theme-ink); }
.practice-search input { min-height: 44px; width: 100%; font: inherit; padding: 12px; border: 1px solid var(--theme-control-border); color: var(--theme-ink); background: var(--theme-bg); }
@media (max-width: 700px) {
  html:root:root { --site-header-height: 64px; }
  html:root body .site-chrome { --header-height: 64px; grid-template-columns: minmax(0,1fr) auto; padding-block: 0; }
  html:root body .site-chrome .chrome-actions { justify-self: end; gap: 8px; }
  html:root body .site-chrome .jump-trigger { display: inline-flex; min-height: 44px; }
  html:root body .site-chrome .menu-toggle { min-height: 44px; }
}

.practice-mobile-menu nav a[hidden] { display: none; }
.practice-search-status { margin: 20px 0 0; color: var(--theme-muted); font-size: 13px; line-height: 1.8; }
.practice-mobile-menu .practice-news-results[hidden] { display: none; }
.practice-news-results h3 { margin: 8px 0; font-size: 14px; font-weight: 600; }
.practice-mobile-menu .practice-news-results a { display: grid; gap: 8px; font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.practice-news-results a::before { display: none; }
.practice-news-results strong { font-weight: 650; }
.practice-news-results small { font-size: 12px; color: var(--theme-muted); }
.practice-news-results span { font-size: 13px; color: var(--theme-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

html .site-chrome .jump-trigger { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--theme-control-border); border-radius: 10px; background: var(--theme-surface); color: var(--theme-ink); font: 500 var(--type-caption)/1.4 var(--font-sans); cursor: pointer; }
