/* shared/switcher.css — the skin switcher that appears on every edition */
/* The pill is fixed bottom-right: leave room under anything scrolled into view (focus, anchors) so it is not covered */
html { scroll-padding-bottom: 4rem; }
.skin-switch { position: fixed; right: 1rem; bottom: 1rem; z-index: 120; font: 500 0.78rem/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 0.04em; }
.skin-switch summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.9rem; border-radius: 999px;
  background: rgba(20, 20, 22, 0.86); color: #f3f1ec; border: 1px solid rgba(255, 255, 255, 0.36);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.skin-switch summary::-webkit-details-marker { display: none; }
.skin-switch summary::before { content: "◐"; font-size: 0.9em; }
.skin-switch summary b { font-weight: 600; }
.skin-switch summary::after { content: "▴"; opacity: 0.6; }
.skin-switch[open] summary::after { content: "▾"; }
.skin-menu { position: absolute; right: 0; bottom: calc(100% + 0.5rem); display: flex; gap: 0.25rem; padding: 0.35rem; max-width: min(92vw, 560px);
  background: rgba(20, 20, 22, 0.96); color: #f3f1ec; border: 1px solid rgba(255, 255, 255, 0.36); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8); }
.skin-switch ul { margin: 0; padding: 0; list-style: none; min-width: 190px; }
.skin-themes { max-height: min(60vh, 420px); overflow-y: auto; border-left: 1px solid rgba(255, 255, 255, 0.12); padding-left: 0.25rem !important; min-width: 230px !important; scrollbar-width: thin; }
.skin-switch li a, .skin-switch li button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 0.8rem; padding: 0.5rem 0.7rem; border-radius: 8px; color: inherit; text-decoration: none; background: none; border: 0; border-left: 3px solid transparent; font: inherit; text-align: left; cursor: pointer; }
.skin-switch li a:hover, .skin-switch li button:hover { background: rgba(255, 255, 255, 0.1); }
.skin-switch li a.is-current, .skin-switch li button.is-current { background: rgba(255, 255, 255, 0.14); border-left-color: currentColor; }   /* the tint alone is 1.5:1; the bar marks the current item */
.skin-switch li small { display: block; opacity: 0.72; font-weight: 400; }
.skin-switch li a small { display: inline; }
.skin-switch li kbd { font: inherit; padding: 0 0.3rem; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 4px; }
.skin-switch li.label { padding: 0.4rem 0.7rem 0.2rem; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.72; }
/* Focus: the menu is dark on every edition, so the ring is light; the pill sits on an unknown page colour, so it gets a two-tone ring */
.skin-switch .skin-menu :focus-visible { outline: 2px solid #f3f1ec; outline-offset: 2px; }
.skin-switch summary:focus-visible { outline: 2px solid #f3f1ec; outline-offset: 0; box-shadow: 0 0 0 4px #141416, 0 10px 30px -10px rgba(0, 0, 0, 0.7); }
@media print { .skin-switch { display: none !important; } }

@media (max-width: 700px) {
  .skin-switch { right: 0.5rem; bottom: 0.5rem; font-size: 0.72rem; }
  .skin-switch summary { padding: 0.45rem 0.7rem; }
  .skin-menu { flex-direction: column; max-height: 70vh; overflow-y: auto; }
  .skin-themes { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-left: 0 !important; max-height: none; }
}

/* Windows High Contrast / forced colours: no backgrounds or shadows, so draw real edges */
@media (forced-colors: active) {
  .skin-switch li button { border: 1px solid ButtonText; border-left-width: 3px; border-left-color: transparent; margin-top: 2px; }
  .skin-switch li a.is-current, .skin-switch li button.is-current { border-left-color: currentColor; }
  .skin-switch li a { text-decoration: underline; }
}