/* The tool header has two groups. Wrap a whole group only if enlarged text needs it. */
@media (max-width: 639px) {
  .tk-tool-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px !important;
  }
  .tk-tool-topbar .tk-tool-back {
    display: inline-flex;
    align-items: center;
    flex: none;
    white-space: nowrap;
    min-height: 40px;
    padding: 7px 10px !important;
    gap: 6px !important;
  }
  .tk-tool-back svg,
  .tk-tool-actions > :is(.tk-theme-toggle, .lang-toggle, #hero-hamburger) {
    flex: none;
  }
  .tk-tool-topbar :is(.tk-tool-back, .lang-btn, #hero-hamburger) {
    transition-property: color, background-color, border-color, box-shadow !important;
  }
  .tk-tool-topbar .tk-tool-actions {
    display: flex;
    flex: none;
    align-items: center;
    margin-inline-start: auto;
    gap: 8px !important;
  }
  .tk-tool-actions .lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 34px;
    min-height: 34px;
    line-height: 1.2;
    padding: 4px 8px !important;
  }
  .tk-tool-actions #hero-hamburger,
  .tk-tool-more summary {
    width: 38px !important;
    height: 38px !important;
    padding: 0;
  }
  .tk-tool-more { position: relative; flex: none; }
  .tk-tool-more summary {
    display: grid;
    place-items: center;
    border: 1px solid var(--tk-border);
    border-radius: 10px;
    background: var(--tk-surface);
    color: var(--tk-ink);
    list-style: none;
    cursor: pointer;
  }
  .tk-tool-more summary::-webkit-details-marker { display: none; }
  .tk-tool-menu-links {
    position: absolute;
    z-index: 10;
    inset-inline-end: 0;
    top: calc(100% + 4px);
    min-width: max-content;
    padding: 4px;
    border: 1px solid var(--tk-border);
    border-radius: 10px;
    background: var(--tk-surface);
  }
  .tk-tool-topbar .tk-tool-menu-links .hero-nav-link {
    display: block !important;
    color: var(--tk-ink) !important;
    padding: 8px 12px;
    white-space: nowrap;
  }
  .tk-content-topbar.tk-tool-topbar { z-index: 25; }
  .tk-content-topbar.tk-tool-topbar .tk-tool-actions { flex: none; margin-inline-start: auto; }
  .tk-content-topbar .tk-content-nav-links[hidden] { display: none !important; }
  .tk-tool-actions .tk-locale-links { padding: 0; gap: 0; }
  .tk-tool-actions .tk-locale-links a { min-width: 34px; padding: 4px 7px; min-height: 34px; white-space: nowrap; }
  .tk-tool-menu-links { background: var(--tk-raised, #202023); }
  html.light-mode .tk-tool-menu-links { background: #faf8f2; }
  .tk-tool-menu-links > a { display: block; padding: 9px 12px; white-space: nowrap; }
}
@media (max-width: 359px) {
  .tk-tool-topbar.px-4 { padding-inline: 8px; }
  .px-4 > .tk-tool-topbar:not(.px-4) { margin-inline: -8px; }
  .tk-tool-topbar .tk-tool-back { gap: 4px !important; padding-inline: 6px !important; }
  .tk-tool-topbar .tk-tool-actions { gap: 5px !important; }
  .tk-tool-actions .lang-btn { padding-inline: 5px !important; }
}
