/* Desktop header controls: spacious language buttons and a reliable theme target. */
@media (min-width: 601px) {
  .topin {
    gap: 20px;
  }

  .locale {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .locale a {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
  }

  .locale a:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--text) 28%, var(--line));
    color: var(--text);
  }

  .locale a.on {
    border-color: var(--text);
    background: var(--text);
    color: var(--bg);
    box-shadow: 0 5px 14px rgba(15, 23, 42, .14);
  }

  .theme {
    position: relative;
    z-index: 1;
    display: inline-grid;
    flex: 0 0 40px;
    place-items: center;
    width: 40px;
    height: 38px;
    touch-action: manipulation;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  }

  .theme:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--text) 28%, var(--line));
    box-shadow: 0 5px 14px rgba(15, 23, 42, .08);
  }

  .theme:focus-visible,
  .locale a:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--text) 22%, transparent);
    outline-offset: 2px;
  }
}

@media (min-width: 951px) and (max-width: 1120px) {
  .topin {
    gap: 14px;
  }

  .topin nav {
    gap: 13px;
  }

  .locale {
    gap: 4px;
  }

  .locale a {
    min-width: 34px;
    padding: 0 7px;
  }
}

/* Keep the compact connected selector that already works well on phones. */
@media (max-width: 600px) {
  .locale {
    display: flex;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: transparent;
  }

  .locale a {
    min-width: 0;
    height: auto;
    padding: 7px 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 11px;
    letter-spacing: normal;
  }

  .locale a.on {
    background: var(--text);
    color: var(--bg);
    box-shadow: none;
  }

  .theme {
    flex: 0 0 38px;
    touch-action: manipulation;
  }
}

.logoutform {
  margin: 0;
}

.logoutform .pillbutton {
  cursor: pointer;
  font: inherit;
}
