/* wonder.mirrors_chrome/v3
   One bar. Same bytes. Every surface.
   The skin is fixed: literal tokens only, no inheritance from host pages.
   Law: /mirrors/CHROME.md */

:root {
  --wm-h1: 3.35rem;
  --wm-h2: 2.55rem;
  --wm-chrome-total: calc(var(--wm-h1) + var(--wm-h2));
}

/*
 * Chrome owns the top from the first paint. This cannot depend on a class
 * JavaScript adds after the registry request: the stylesheet is the contract.
 */
body.wm-has-chrome {
  padding-top: calc(var(--wm-chrome-total) + 0.65rem) !important;
}
html {
  scroll-padding-top: calc(var(--wm-chrome-total) + 0.85rem);
}

.wm-chrome,
.wm-chrome * {
  box-sizing: border-box;
}

.wm-chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2147480000;
  height: var(--wm-chrome-total);
  margin: 0;
  padding: 0;
  /* fixed skin — never host tokens */
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica,
    Arial, sans-serif;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  direction: ltr;
  color: #52525b;
  background: rgba(250, 250, 252, 0.94);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  border-bottom: 1px solid rgba(212, 212, 216, 0.82);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.78) inset,
    0 10px 30px rgba(24, 24, 27, 0.035);
}
@supports not (backdrop-filter: blur(1px)) {
  .wm-chrome {
    background: #fafafc;
  }
}

/* A content-neutral shell: registry identity is never duplicated in HTML. */
.wm-chrome.wm-is-pending::before,
.wm-chrome.wm-is-pending::after {
  content: "";
  position: absolute;
  left: max(1rem, calc((100% - 1240px) / 2 + 1.25rem));
  pointer-events: none;
}
.wm-chrome.wm-is-pending::before {
  top: calc((var(--wm-h1) - 1.8rem) / 2);
  width: 8.5rem;
  height: 1.8rem;
  border-radius: 0.65rem;
  background:
    linear-gradient(135deg, #d4d4d8, #f4f4f5) 0 0 / 1.8rem 1.8rem no-repeat,
    linear-gradient(#e4e4e7, #e4e4e7) 2.45rem 0.58rem / 5.8rem 0.62rem no-repeat;
}
.wm-chrome.wm-is-pending::after {
  top: calc(var(--wm-h1) + (var(--wm-h2) - 0.56rem) / 2);
  width: 12rem;
  height: 0.56rem;
  border-radius: 999px;
  background: #e9e9ed;
}
.wm-chrome.wm-is-degraded::before {
  content: "";
  position: absolute;
  inset: var(--wm-h1) 0 auto;
  border-top: 1px solid rgba(228, 228, 231, 0.76);
}

.wm-row {
  width: 100%;
}
.wm-row.wm-world {
  height: var(--wm-h1);
  border-bottom: 1px solid rgba(228, 228, 231, 0.76);
}
.wm-row.wm-here {
  height: var(--wm-h2);
  background: rgba(255, 255, 255, 0.52);
}

.wm-inner {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  overflow: hidden;
}

.wm-chrome a {
  text-decoration: none;
  color: #6b6b74;
  transition:
    color 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}
.wm-chrome a:hover {
  color: #18181b;
  text-decoration: none;
}
.wm-chrome a:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.32);
  outline-offset: 2px;
}
.wm-skip {
  position: fixed;
  top: 0.55rem;
  left: max(0.75rem, calc((100% - 1240px) / 2 + 1rem));
  z-index: 2;
  padding: 0.62rem 0.78rem;
  border: 1px solid #d4d4d8;
  border-radius: 0.65rem;
  color: #18181b !important;
  background: #fff;
  box-shadow: 0 6px 20px rgba(24, 24, 27, 0.14);
  font-size: 0.78rem;
  font-weight: 700;
  transition: none !important;
  transform: translateY(calc(-100% - 1rem));
}
.wm-skip:focus {
  transform: translateY(0);
}

/* ---------- world row ---------- */

.wm-brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  min-height: 2.25rem;
  font-weight: 720;
  font-size: 0.9rem;
  letter-spacing: -0.025em;
  color: #18181b !important;
  white-space: nowrap;
}
.wm-brand-mark {
  position: relative;
  width: 1.85rem;
  height: 1.85rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 0.62rem;
  background:
    radial-gradient(circle at 32% 25%, #fff 0 6%, transparent 7%),
    linear-gradient(145deg, #18181b 8%, #52525b 43%, #71717a 58%, #27272a 92%);
  box-shadow:
    0 1px 1px rgba(24, 24, 27, 0.16),
    0 5px 14px rgba(24, 24, 27, 0.13),
    0 0 0 1px rgba(24, 24, 27, 0.06);
}
.wm-brand-mark::after {
  content: "";
  position: absolute;
  width: 1.1rem;
  height: 2.4rem;
  top: -0.45rem;
  left: 0.55rem;
  transform: rotate(28deg);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.22),
    transparent
  );
}
.wm-brand-label {
  padding-right: 0.12rem;
}
.wm-brand[aria-current="page"] {
  text-decoration: none;
}

.wm-system {
  display: flex;
  align-items: center;
  gap: 0.18rem;
  flex: 0 0 auto;
  padding: 0.2rem;
  border: 1px solid rgba(228, 228, 231, 0.9);
  border-radius: 0.78rem;
  background: rgba(244, 244, 245, 0.76);
  box-shadow: 0 1px 1px rgba(24, 24, 27, 0.025) inset;
}
.wm-system a {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: 0.34rem 0.62rem;
  border-radius: 0.58rem;
  font-weight: 650;
  font-size: 0.76rem;
  white-space: nowrap;
}
.wm-system a:hover {
  background: rgba(255, 255, 255, 0.8);
}
.wm-system a[aria-current="page"] {
  color: #18181b;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(24, 24, 27, 0.08),
    0 0 0 1px rgba(212, 212, 216, 0.68);
}

.wm-peers {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(
    90deg,
    #000 0,
    #000 calc(100% - 1.25rem),
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    #000 0,
    #000 calc(100% - 1.25rem),
    transparent 100%
  );
}
.wm-peers::before {
  content: "";
  flex: 1 1 auto;
  min-width: 0;
}
.wm-peers::-webkit-scrollbar {
  display: none;
}
.wm-peer {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 2rem;
  padding: 0.35rem 0.62rem 0.35rem 0.48rem;
  border-radius: 0.68rem;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 620;
  white-space: nowrap;
}
.wm-peer:hover {
  border-color: rgba(212, 212, 216, 0.82);
  background: rgba(255, 255, 255, 0.86);
  transform: translateY(-1px);
}
.wm-peer[aria-current="page"] {
  color: #18181b;
  border-color: color-mix(in srgb, var(--wm-peer-color, #a3a3a3) 45%, #e4e4e7);
  background: #fff;
  box-shadow:
    0 1px 2px rgba(24, 24, 27, 0.07),
    0 0 0 1px
      color-mix(in srgb, var(--wm-peer-color, #a3a3a3) 18%, transparent);
}
.wm-peer .wm-pdot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: var(--wm-peer-color, #a3a3a3);
  box-shadow: 0 0 0 2px
    color-mix(in srgb, var(--wm-peer-color, #a3a3a3) 13%, transparent);
}
.wm-peer.is-mesh {
  color: #71717a;
  font-weight: 500;
}

/* ---------- here row ---------- */

.wm-ctx {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 1.8rem;
  padding-right: 0.78rem;
  border-right: 1px solid rgba(212, 212, 216, 0.82);
  font-weight: 670;
  font-size: 0.74rem;
  color: #313136;
  white-space: nowrap;
}
.wm-ctx a {
  color: #313136;
  font-weight: 670;
}
.wm-ctx .wm-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--wm-peer-color, #a3a3a3);
  box-shadow: 0 0 0 2px
    color-mix(in srgb, var(--wm-peer-color, #a3a3a3) 22%, transparent);
}

.wm-local {
  display: flex;
  align-items: center;
  gap: 0.16rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(
    90deg,
    #000 0,
    #000 calc(100% - 1.25rem),
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    #000 0,
    #000 calc(100% - 1.25rem),
    transparent 100%
  );
}
.wm-local::-webkit-scrollbar {
  display: none;
}
.wm-local a,
.wm-local span {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.34rem 0.58rem;
  border-radius: 0.56rem;
  white-space: nowrap;
  color: #71717a;
}
.wm-local a:hover {
  color: #18181b;
  background: rgba(244, 244, 245, 0.86);
}
.wm-crumbs .wm-sep {
  min-height: auto;
  padding: 0 0.04rem;
  color: #d4d4d8;
}
.wm-crumbs .wm-crumb-here {
  color: #18181b;
  font-weight: 600;
}

.wm-ext {
  flex: 0 0 auto;
  margin-left: auto;
}
.wm-ext a {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.34rem 0.58rem;
  border: 1px solid rgba(212, 212, 216, 0.82);
  border-radius: 0.58rem;
  color: #18181b;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.73rem;
  font-weight: 650;
  white-space: nowrap;
}
.wm-ext a:hover {
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.06);
}

/* A mirror borrows its subject's palette and sets their name large. This is the
   one line on the page that says whose site it is not. */
.wm-notice {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 0.72rem;
  line-height: 1.25;
  color: #6b7280;
}
.wm-ext + .wm-notice {
  margin-left: 0.62rem;
}
.wm-notice a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wm-notice a:hover {
  color: #27272a;
}

/* Retired page-owned navs (tagged by the stamper). */
.wm-legacy-system {
  display: none !important;
}

@media (max-width: 820px) {
  .wm-inner {
    padding: 0 0.85rem;
    gap: 0.55rem;
  }
  .wm-peer {
    width: 1.95rem;
    justify-content: center;
    padding-right: 0.42rem;
    padding-left: 0.42rem;
  }
  .wm-peer-label {
    display: none;
  }
  .wm-peer[aria-current="page"] {
    width: auto;
  }
  .wm-peer[aria-current="page"] .wm-peer-label {
    display: inline;
  }
}

@media (max-width: 520px) {
  :root {
    --wm-h1: 3.2rem;
    --wm-h2: 2.5rem;
  }
  .wm-inner {
    padding: 0 0.68rem;
    gap: 0.45rem;
  }
  .wm-brand {
    gap: 0.45rem;
  }
  .wm-brand-mark {
    width: 1.72rem;
    height: 1.72rem;
    border-radius: 0.56rem;
  }
  .wm-brand-label {
    font-size: 0.84rem;
  }
  .wm-system {
    gap: 0.08rem;
    padding: 0.15rem;
  }
  .wm-system a {
    min-height: 1.75rem;
    padding: 0.3rem 0.45rem;
    font-size: 0.71rem;
  }
  .wm-ctx {
    max-width: 42%;
    overflow: hidden;
    padding-right: 0.48rem;
    text-overflow: ellipsis;
  }
  .wm-ext a {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* The bar is one line at this width; the notice would crowd the name out.
     Every mirror still carries it in the DOM for assistive technology. */
  .wm-notice {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (max-width: 350px) {
  .wm-brand-label {
    display: none;
  }
  .wm-brand {
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wm-chrome a {
    transition: none;
  }
}

@media print {
  .wm-chrome {
    display: none;
  }
  body.wm-has-chrome {
    padding-top: 0 !important;
  }
}
