.theme-toggle {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  color: var(--text);
  background: var(--theme-control-bg, rgba(255, 255, 255, 0.06));
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--accent);
  font-size: 1rem;
  line-height: 1;
}

.ios-download-banner {
  display: none;
}

@media (max-width: 800px) {
  .ios-download-banner.is-visible {
    position: sticky;
    top: 64px;
    z-index: 19;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto 32px;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    padding: 10px max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
    color: var(--text);
    background: var(--bg, #111315);
    background: color-mix(in srgb, var(--bg, #111315) 94%, transparent);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }

  .ios-download-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }

  .ios-download-banner-copy {
    min-width: 0;
  }

  .ios-download-banner-copy strong,
  .ios-download-banner-copy span {
    display: block;
  }

  .ios-download-banner-copy strong {
    overflow: hidden;
    font-size: 0.82rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ios-download-banner-copy span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.25;
  }

  .ios-download-banner-badge {
    display: block;
    width: 108px;
  }

  .ios-download-banner-badge img {
    display: block;
    width: 108px;
    height: 36px;
  }

  .ios-download-banner-close {
    -webkit-appearance: none;
    appearance: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 50%;
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
  }

  .ios-download-banner-close:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
  }
}

@media (max-width: 420px) {
  .ios-download-banner.is-visible {
    grid-template-columns: 40px minmax(0, 1fr) 96px 28px;
    gap: 8px;
  }

  .ios-download-banner-icon {
    width: 40px;
    height: 40px;
  }

  .ios-download-banner-badge,
  .ios-download-banner-badge img {
    width: 96px;
  }

  .ios-download-banner-badge img {
    height: 32px;
  }
}

:root[data-theme="light"] .ios-download-banner.is-visible {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(23, 26, 29, 0.12);
}

@media (max-width: 640px) {
  .theme-toggle {
    margin-left: auto;
    margin-right: 8px;
  }
}

@media (min-width: 641px) {
  .site-nav,
  .sony-nav-links {
    order: 2;
    margin-left: auto;
  }

  .theme-toggle {
    order: 3;
    flex: 0 0 auto;
  }
}
