.topbar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 77px;
  gap: 24px;
}
.wordmark { width: fit-content; color: var(--ink); text-decoration: none; }
.brand-mark { flex: none; }
.topbar .privacy { justify-self: end; white-space: nowrap; }
.tools-navigation { display: flex; align-items: center; gap: 18px; min-width: 0; }
.current-tool { color: var(--muted); font-size: .875rem; font-weight: 520; }
.tools-switcher > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  font-size: .875rem;
  font-weight: 620;
  list-style: none;
  user-select: none;
}
.tools-switcher > summary::-webkit-details-marker { display: none; }
.tools-switcher > summary::marker { content: ''; }
.tools-switcher > summary:hover { border-color: #aab3c2; background: #fff; }
.tools-switcher[open] > summary { border-color: #bacaf5; background: #e7eeff; color: #2145b1; }
.tools-grid-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.tools-chevron { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; transition: transform .15s ease; }
.tools-switcher[open] .tools-chevron { transform: rotate(180deg); }
.tools-panel {
  position: absolute;
  inset: calc(100% + 8px) 0 auto auto;
  width: min(960px, calc(100vw - 64px));
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafbfc;
  box-shadow: 0 8px 20px #20242b0a, 0 24px 64px #20242b1a;
}
.tools-groups { display: grid; grid-template-columns: .95fr 1.15fr 1fr 1.15fr; gap: 18px; }
.tools-group h2 { margin: 0 9px 9px; color: var(--muted); font-size: .75rem; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; }
.tools-group ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.tools-link {
  display: grid;
  gap: 5px;
  min-height: 64px;
  padding: 11px 9px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.35;
}
.tools-link:hover { background: #edf0f5; }
.tools-link strong { font-size: .875rem; font-weight: 620; }
.tools-link span { color: var(--muted); font-size: .8125rem; }
.tools-link[aria-current="page"] { background: #e7eeff; color: #2145b1; }
.tools-link[aria-current="page"] span { color: #385893; }
.tools-link:focus-visible { outline-offset: 1px; }
.tools-browse { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-top: 17px; padding: 16px 9px 0; border-top: 1px solid var(--line); color: #2145b1; text-decoration: none; font-size: .875rem; font-weight: 600; }
.tools-browse:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 601px) and (max-width: 1000px) {
  .tools-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
}
@media (max-width: 760px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    gap: 9px 16px;
    padding-block: 14px 12px;
  }
  .topbar .privacy { display: none; }
  .tools-navigation { display: contents; }
  .tools-switcher { grid-area: 1 / 2; }
  .current-tool { grid-area: 2 / 1 / 3 / -1; font-size: .8125rem; }
  .tools-panel { width: 100%; max-height: calc(100dvh - 126px); }
}
@media (max-width: 600px) {
  .tools-panel { padding: 18px 13px; border-radius: 12px; }
  .tools-groups { grid-template-columns: 1fr; gap: 19px; }
  .tools-group h2 { margin-bottom: 5px; }
  .tools-group ul { gap: 2px; }
  .tools-link { min-height: 57px; gap: 3px; padding-block: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .tools-chevron { transition: none; }
}
