/* The same button sits by the language link and becomes a labelled row in the sheet. */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  flex: none; min-width: 44px; min-height: 44px; padding: 0 10px;
  border: 0; border-radius: var(--r-btn, 2px); background: transparent;
  color: var(--p-ink); font: inherit; cursor: pointer;
  transition: background-color 150ms ease-out;
}
.theme-toggle:hover { background: var(--p-hover-wash); }
.theme-toggle:focus-visible { outline: 2px solid var(--p-focus); outline-offset: 2px; }
.theme-toggle svg { width: 20px; height: 20px; flex: none; }
.theme-toggle__label,
:root[data-theme="light"] .theme-toggle__sun,
:root[data-theme="dark"] .theme-toggle__moon { display: none; }

.hd__logo img, .footer__logo img, .nav__logo--img img { filter: var(--p-logo-filter); }
.ground-inverse .nav__logo--img img { filter: none; }

@media (min-width: 1024px) and (max-width: 1279px) {
  .nav__bar { gap: var(--s-5); }
  .nav__actions { gap: var(--s-2); }
}
@media (max-width: 1023px) {
  .nav.is-open .nav__actions .nav__lang { order: 0; }
  .nav.is-open .nav__links {
    /* Clear the pinned CTA, theme row and language link at the bottom. */
    padding-bottom: calc(var(--btn-h) + 48px + 44px + 4 * var(--s-4) + env(safe-area-inset-bottom));
  }
  .nav .theme-toggle__label { display: inline; }
}
@media (prefers-reduced-motion: reduce) { .theme-toggle { transition: none; } }

@media (max-width: 1199px) {
  .hd__nav .theme-toggle { justify-content: space-between; padding-inline: 0; }
  .hd__nav .theme-toggle__label { display: inline; order: -1; }
}

:root[data-theme="light"] .tile__more span { border-color: var(--line-control); }
:root[data-theme="light"] .tile:hover .tile__more span { border-color: var(--p-action); }

/* Keep check and radio edges visible independently of the platform's native tint. */
:root[data-theme="light"] .check input[type="checkbox"] {
  appearance: none; display: inline-grid; place-items: center; flex: none;
  width: 18px; height: 18px; padding: 0; cursor: pointer;
  background: var(--bg, var(--p-bg)); color: var(--ink, var(--p-ink));
  border: 1px solid color-mix(in srgb, currentColor var(--p-control-mix), transparent);
}
:root[data-theme="light"] .check input[type="checkbox"] { border-radius: 2px; }
:root[data-theme="light"] .check input[aria-invalid="true"] { border-color: var(--p-error); }
:root[data-theme="light"] .check input[type="checkbox"]:checked {
  background: var(--ink, var(--p-ink)); color: var(--bg, var(--p-bg)); border-color: transparent;
}
:root[data-theme="light"] .check input[type="checkbox"]:checked::after {
  content: ""; width: 9px; height: 5px; border: solid currentColor;
  border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg);
}

@media (min-width: 1200px) {
  .hd__nav { column-gap: 24px; }
  .hd__actions { column-gap: 12px; }
}
:root[data-theme="light"] .hd__search input:focus {
  outline: 2px solid var(--p-focus); outline-offset: 2px; box-shadow: none;
}
:root[data-theme="light"] .thumb:not([aria-pressed="true"]) { border-color: var(--line-control); }
:root[data-theme="light"] .thumb:hover { border-color: var(--p-ink); }
:root[data-theme="light"] .thumb:focus-visible { outline: 2px solid var(--p-focus); outline-offset: 2px; }
